ruby-changes:6001
From: usa <ko1@a...>
Date: Sun, 22 Jun 2008 00:28:40 +0900 (JST)
Subject: [ruby-changes:6001] Ruby:r17511 (win32-unicode-test): pullup r17510. (now we are testing auto version.h updating.)
usa 2008-06-22 00:28:07 +0900 (Sun, 22 Jun 2008) New Revision: 17511 Modified files: branches/win32-unicode-test/ChangeLog branches/win32-unicode-test/io.c Log: pullup r17510. (now we are testing auto version.h updating.) http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/win32-unicode-test/io.c?r1=17511&r2=17510&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/win32-unicode-test/ChangeLog?r1=17511&r2=17510&diff_format=u Index: win32-unicode-test/ChangeLog =================================================================== --- win32-unicode-test/ChangeLog (revision 17510) +++ win32-unicode-test/ChangeLog (revision 17511) @@ -1,3 +1,8 @@ +Sun Jun 22 00:01:36 2008 NAKAMURA Usaku <usa@r...> + + * 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@r...> * win32/win32.c (rb_w32_spawn): no longer support P_WAIT. @@ -85,25 +90,25 @@ Fri Jun 20 11:07:56 2008 Tanaka Akira <akr@f...> - * string.c (rb_memhash): randomize hash to avoid algorithmic - complexity attacks. - (rb_str_hash): use rb_memhash. + * 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. + * include/ruby/intern.h (rb_reset_random_seed): declared. - * thread.c (rb_thread_atfork): call rb_reset_random_seed. + * thread.c (rb_thread_atfork): call rb_reset_random_seed. - * inits.c (rb_call_inits): call Init_RandomSeed at first. + * 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. + * 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@r...> @@ -8736,7 +8741,7 @@ Fri Dec 28 01:55:04 2007 Martin Duerst <duerst@i...> * transcode.c (transcode_dispatch): reverted some of the changes - in r14746. + in r14746. * transcode.c, enc/trans/single_byte.c: Added conversions to/from US-ASCII and ASCII-8BIT (using data tables). Index: win32-unicode-test/io.c =================================================================== --- win32-unicode-test/io.c (revision 17510) +++ win32-unicode-test/io.c (revision 17511) @@ -3167,6 +3167,20 @@ 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_flags_mode(int flags) { @@ -7378,6 +7392,12 @@ } static VALUE +argf_binmode_p(VALUE argf) +{ + return argf_binmode ? Qtrue : Qfalse; +} + +static VALUE argf_skip(VALUE argf) { if (next_p != -1) { @@ -7703,6 +7723,7 @@ 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, "sysseek", rb_io_sysseek, -1); rb_define_method(rb_cIO, "ioctl", rb_io_ioctl, -1); @@ -7769,6 +7790,7 @@ 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/