summaryrefslogtreecommitdiff
path: root/io.c
AgeCommit message (Collapse)Author
2008-06-30* io.c (argf_each_line): pass args to each_line. [ruby-dev:34958]mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-24 * io.c (io_reopen): remove cygwin handling because it seems to be forusa
C's stdio. fixed [ruby-dev:35183] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-21 * io.c (rb_io_binmode_p, argf_binmode_p, Init_IO): new methodusa
IO#binmode? and ARGF.binmode? [ruby-dev:35148] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-18* io.c (rb_open_file): fs_encoding and fname_encoding isnaruse
rb_encoding *. fixed [ruby-dev:35151] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-18* io.c (rb_open_file): not rb_enc_get_index but rb_enc_get.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-16* io.c (io_set_encoding): defined.naruse
* 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 exernal_encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-11* io.c (read_all): should use io_read_encoding(), notmatz
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-11* io.c (rb_io_reopen): clear read buffer.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-11* io.c (io_fread): bypass buffered read if reading buffer is empty.matz
* io.c (remain_size): do not add extra one byte. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu
* *.c: no cache in init functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* io.c (fptr_finalize): close IO object if fd is already closed.akr
(rb_p): call rb_io_write just once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08* array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,ko1
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). * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-07* io.c (rb_f_open), re.c (rb_reg_search), transcode.c (str_transcode):nobu
suppress warnings. * util.c (quorem, rv_alloc, nrv_alloc): only used in dtoa(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-06 * io.c (rb_open_file, rb_io_s_sysopen): fmode should be unsigned int.usa
fixed [ruby-dev:34979] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-02* re.c: fix SEGV by Regexp.allocate.names, Match.allocate.names, etc.mame
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31* suppress warnings with -Wwrite-string.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-29remove a compile error.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-29* io.c (argf_readchar): raise EOFError, synchronizing IO#readchar.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-29* io.c (argf_external_encoding, argf_internal_encoding): fix SEGV bymame
ARGF.external_encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-28* io.c (rb_getc): same as rb_read_check.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-27* io.c (Init_IO): Define ARGF.{lines,bytes,chars}.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-12* io.c (rb_f_gets.): re-enable rdoc.akr
(rb_f_readline): ditto. (rb_f_readlines): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-12 * process.c, include/ruby/intern.h (rb_run_exec_options): externed.usa
* 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. !!!remark!!! these are not thread-safe. * process.c (rb_spawn_internal): remove calling run_exec_options() because cannot restore after spawn. we'll fix this later. * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-11* thread.c (thread_cleanup_func_before_exec): extracted fromakr
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-07* io.c (io_puts_ary): check recursion first. [ruby-dev:34580]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-05* io.c (io_fflush): IO#flush problem within threads. a patch frommatz
<s.wanabe at gmail.com> in [ruby-dev:34595]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-02* io.c (internal_read_func, internal_write_func): split fromnobu
internal_io_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-30* process.c (check_exec_redirect_fd): prohibit duplex IO.akr
(check_exec_fds): record maxhint even if close_others is not specified. (rb_exec_arg_fixup): renamed from rb_exec_arg_fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-28* include/ruby/intern.h (rb_exec_arg_init): declared.akr
(rb_exec_arg_addopt): delared. (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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26* io.c, signal.c, thread.c, thread_win32.c, include/ruby/intern.h:nobu
suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-24* include/ruby/intern.h (rb_env_clear): declared.akr
(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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-21* io.c (copy_stream_body): call rb_io_check_readable andakr
rb_io_check_writable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-20* io.c (copy_stream_func): suppress warnings.nobu
* thread_pthread.c (add_signal_thread_list): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-20* io.c (copy_stream_rbuf_to_dst): removed.akr
(copy_stream_fallback_body): don't bypass write method. (copy_stream_body): simplified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-20* io.c (copy_stream_fallback): write directly (bypassing write method)akr
if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-20avoid warnings in copy_stream_body.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-20* io.c (copy_stream_fallback): read directly (bypassing readpartial)akr
if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-19* io.c (copy_stream_body): use readpartial and write method forakr
non-IOs such as StringIO and ARGF. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-17* enc/trans/utf_16_32.c (fun_so_to_utf_16be, fun_so_to_utf_16le): addmame
parentheses to remove warnings of gcc. * io.c (rb_io_getc): remove unused variables. * compile.c (NODE_NEXT, NODE_REDO): remove unused labels. * ext/nkf/nkf.c (rb_nkf_convert): remove unused variables. * ext/syck/rubyext.c (syck_resolver_initialize, syck_resolver_detect_implicit, syck_emitter_emit): remove unused variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-15* io.c: #undef rb_argv moved before #define.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-31 * {bcc,win}32/Makefile.sub (config.h): define ssize_t.usa
* io.c (copy_stream_body): some platform don't have O_NOCTTY. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-30* io.c (io_getc): set coderange while getting characters.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-30* io.c (rb_io_lines, rb_io_bytes, rb_io_chars) Fixed their rdocs.yugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-30revert git backfire in r15860; sorrymatz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-30* proc.c (proc_dup): should copy is_lambda attribute as well.matz
[ruby-talk:296244] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-30forgot to return a value.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-30* io.c: IO.copy_stream implemented. [ruby-dev:33843]akr
* thread.c (rb_fd_select): new function. * configure.in (sys/sendfile.h): check the header file. (sendfile): check the function. (pread): check the function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-28* io.c (rb_io_each_char, rb_io_chars, argf_each_char, io_getc): Added ↵yugui
character-wise iterators; IO#each_char, IO#chars, ARGF#each_char. [ruby-dev:34052] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-21* io.c (rb_f_gets, rb_f_readline, rb_f_readlines): delegates to ARGFnobu
as well as puts and putc. [ruby-dev:34100] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-20* io.c (argf_getline): use receiver.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e