summaryrefslogtreecommitdiff
path: root/io.c
AgeCommit message (Collapse)Author
2007-12-25* io.c (appendline): move RS comparison to rb_io_getline_1().matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25* io.c (rb_io_external_encoding): should return nil formatz
pass-through write IO. [ruby-dev:32740] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25* io.c (appendline): initialize rslen to 1 if rsptr is 0.akr
rslen should be the length of the delimiter. if only delim is given, it should be 1. [ruby-dev:32746] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25* io.c (io_encoding_set): missing return type.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24* io.c (rb_io_s_pipe): now takes up to two arguments. allow itsmatz
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24* include/ruby/encoding.h (rb_enc_left_char_head): new utility macro.matz
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23* io.c (appendline): should do multibyte aware RS search.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23* io.c (io_enc_str): should preserve default_external encoding.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23* io.c (prepare_getline_args): convert RS to external encoding.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23* io.c (rb_io_check_readable): should not fill fptr->enc always.matz
read-write IO (e.g. socket) does not work. [ruby-dev:32685] * io.c (io_read_encoding): retrieve reading encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23* io.c (rb_io_external_encoding): should return the encoding ofmatz
the file reading. * io.c (rb_io_internal_encoding): should return the encoding of read string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23* io.c (rb_f_open): documentation update.matz
* io.c (rb_io_s_pipe): ditto. * io.c (io_fwrite): wrong encoding destination. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23* io.c (rb_io_s_pipe): allow specifying read-side encoding.matz
* io.c (io_enc_str): wrong encoding destination. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23* io.c (open_key_args): IO direct methods (foreach, readlines,matz
read) now takes keyword argument: encoding, mode, open_args. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23* io.c (rb_io_s_read): encoding argument reverted.matz
* io.c (mode_enc): independent function to share code. * io.c (rb_io_internal_encoding): new method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23* io.c (rb_io_binmode_m): removed C99ism.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-22* include/ruby/encoding.h, encoding.c, re.c, io.c, parse.y, numeric.c,akr
ruby.c, transcode.c: rename rb_ascii_encoding. to rb_ascii8bit_encoding. rb_ascii_encoding is ambiguous with ASCII-8BIT and US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-22* io.c (rb_io_mode_enc): do not set encoding unless explicitlymatz
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)). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-22* io.c, io.h: temporary patch to partially implement transcode-on-read and ↵davidflanagan
transcode-on-write git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21io.c: fix typo in rdoc commentdavidflanagan
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* encoding.c (rb_ascii_encoding): renamed from previousmatz
rb_default_encoding(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* io.c (io_ungetc): avoid buffer relocation, which might causematz
serious problem under concurrent situation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* io.c: write() should be in blocking region.ko1
* bootstraptest/test_io.rb, test_knownbug.rb: move a fixed test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* io.c (rb_io_s_read): allow specifying encoding explicitly.matz
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* io.c (Init_IO): define IO::BINARY even if O_BINARY is not exist.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* io.c (rb_io_external_encoding): should fill delayedmatz
initialization for STDIN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* io.c (rb_io_external_encoding): new method.matz
* encoding.c (rb_enc_from_encoding): returns Qnil for NULL encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* io.c (rb_io_mode_enc): set default external encoding if nomatz
encoding specified explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* regerror.c, string.c, io.c, lib/getoptlong.rb, lib/net/imap.rb,akr
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-20* io.c (select_internal): should return original value.gotoyuzo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-14* io.c (rb_f_p): RDoc update. a patch from murphy <murphy AT rubychan.de>.matz
[ruby-core:14010] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-13* io.c (rb_io_synchronized): should check if initialized.matz
[ruby-dev:32585] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-12* io.c (rb_io_getc): use default external encoding if fptr->enc ismatz
not set. [ruby-dev:32565] * lib/rubygems/package.rb (Gem::TarReader::Entry::rewind): typo fixed. [ruby-dev:32565] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-12* io.c (read_all): should associate default external encoding.matz
* io.c (io_read): should NOT associate default external encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-12* io.c (rb_io_mode_enc): allow specifying external encoding inmatz
open mode, e.g. open(path, "r:utf-8"). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-12* io.c (rb_io_check_readable): set default external encoding tomatz
STDIN. * io.c (io_enc_str): associate encoding to output string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09* file.c (rb_get_path): use the original object if to_path method isnobu
not defined. [ruby-dev:32473] * io.c (rb_f_open): call to_open on non-string objects, instead of to_str. [ruby-dev:32473] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-06* encoding.c (rb_enc_precise_mbclen): new function for mbclen withakr
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-01* io.c (rb_f_open): use to_open for every non-string object. pathmatz
object may use method_missing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-26* io.c (rb_read_internal, rb_sysopen_internal): remove C99 dependency.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-23* io.c: add rb_read_internal() as blocking function.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-20* gc.h, vm_core.h: decl of rb_gc_save_machine_context()ko1
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-20* io.c (rb_io_close_on_exec_p): new method IO#close_on_exec?.akr
(rb_io_set_close_on_exec): new method IO#close_on_exec=. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-20 * include/ruby/win32.h win32/win32.c (rb_w32_pipe_exec): use dual fdusa
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-20* include/ruby/io.h (rb_io_t): add tied_io_for_writing member.akr
* 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-09* io.c (rb_io_each_byte): should update rbuf_off and rbuf_len formatz
each iteration. [ruby-dev:31659][ruby-dev:32192] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-25* io.c (rb_io_tell, rb_io_seek): check errno too. [ruby-dev:32093]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-04* io.c (Init_IO): remove obsolete variables: $defout, $deferr.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-28* io.c (rb_io_fdopen): create IO object from fd.nobu
* parse.y (yycompile): use encoding of the source as default. * ruby.c (proc_options, load_file): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-28* io.c (rb_io_getline_fast, rb_io_getline_1): set encoding to thenobu
result string, as well as getc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e