aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
Commit message (Collapse)AuthorAgeFilesLines
* * include/ruby/io.h (rb_io_buffer_t): extract from rb_io_t.nobu2010-11-181-198/+198
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_readlines): forward to current_file for argumentsnobu2010-11-141-4/+14
| | | | | | | check. http://twitter.com/nagachika/status/3634254856589312 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_close): untie tied io before closing.nobu2010-11-111-2/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_write): add ARGF.write and so on.nobu2010-11-111-1/+52
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_read_nonblock): add ARGF.read_nonblock.nobu2010-11-111-1/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_finalize): status is success if no process.nobu2010-11-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_readlines, rb_io_each_line): limit must not be zero.nobu2010-11-041-0/+4
| | | | | | a patch from Tomoyuki Chikanaga at [ruby-dev:42538]. #4024 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_select): change rdoc.naruse2010-10-211-16/+47
| | | | | | patched by Eito Katagiri [ruby-core:31805] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_select): add correct rdoc.naruse2010-10-211-7/+17
| | | | | | patched by Dave Thomas [ruby-core:32467] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_ctl), parse.y (LVAR_USED): suppress warnings.nobu2010-10-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_ungetc): always see Bignum. On 32bit valid valuenaruse2010-10-121-2/+0
| | | | | | may be a Bignum. On 64bit for errors. [ruby-dev:42366] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_ungetc): use unsigned int for GB18030.naruse2010-10-121-5/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_putc): support multibyte characters.naruse2010-10-121-3/+9
| | | | | | [ruby-core:30697] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_set_encoding): use rb_funcall2 when the io is notnaruse2010-10-101-1/+6
| | | | | | a T_FILE. [ruby-dev:42356] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (fptr_finalize): write_mutex might have been destroyednobu2010-10-061-3/+9
| | | | | | | | already in finalization phase, as the order of finalizers is not guaranteed. rb_mutex_t should be used in place of Mutex object in the future. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_puts): fix for wide char encoding strings.nobu2010-09-151-1/+17
| | | | | | [ruby-dev:42212] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_scan_args): Add support for optional keywordknu2010-09-101-46/+26
| | | | | | | | | | | | | | | | | | | | argument hash. * README.EXT, README.EXT.ja: Update documentation accordingly. * dir.c (dir_initialize): Make use of the new rb_scan_args() feature. * io.c (rb_io_s_popen, rb_scan_open_args, rb_io_initialize) (rb_io_s_pipe, open_key_args, io_s_foreach, io_s_readlines) (rb_io_s_read, rb_io_set_encoding): Ditto. * transcode.c (str_transcode, econv_args) (econv_primitive_convert): Ditto. * ext/zlib/zlib.c (rb_gzreader_initialize): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/pty/pty.c (chfunc): pass through exceptions.nobu2010-09-021-26/+62
| | | | | | | | * io.c (rb_io_bufwrite, rb_io_bufread): added. * process.c (rb_fork_err): protect from exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (null_device): move from io.c.nobu2010-08-271-14/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (null_device): the name of null device. [ruby-dev:41791]nobu2010-08-271-0/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in, include/ruby/defines.h (RUBY_FUNC_EXPORTED): macronobu2010-08-141-1/+1
| | | | | | | | | | | to declare exported function. * array.c (rb_ary_memsize), string.c (rb_str_memsize), variable.c (rb_objspace_data_type_memsize): used in objspace. [ruby-dev:42022] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_memsize): constified.nobu2010-08-141-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2010-08-071-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_flush_buffer): write and buffer operations should benobu2010-07-201-32/+37
| | | | | | monolithic. [ruby-core:31348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (nogvl_copy_stream_sendfile): jump to retry_sendfile directlyakr2010-07-061-2/+1
| | | | | | | | to avoid select() on a socket which TCP state is CLOSED. patch by Eric Wong. [ruby-core:31053] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (swallow, prepare_getline_args, rb_io_getline_1): fix fornobu2010-07-041-3/+12
| | | | | | | | paragraph mode reading in non-ascii-compatible encoding. [ruby-dev:41803] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_inplace_mode_set): prohibits an assignment of a taintedusa2010-07-021-0/+3
| | | | | | | | | | | | | | value. * file.c (ruby_find_basename, ruby_find_extname): split from rb_file_s_basename() and rb_file_s_extname(). * util.c (ruby_add_suffix): support arbitrary length of the suffix to get rid of the potential buffer overflow. reported by tarui. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h, io.c: reverted r21709.nobu2010-06-271-18/+3
| | | | | | | | * ruby.c (load_file_internal): nothing to read if EOF reached while reading shebang. [ruby-core:30910] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (simple_sendfile): don't try to send data more than SSIZE_MAXakr2010-06-271-2/+7
| | | | | | | | with single sendfile call.. based on the patch by Eric Wong. [ruby-core:30908] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_next_argv): check for setting owner/group.nobu2010-06-221-2/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: rdoc fix for ARGF.lineno; cf. [ruby-core:29048]marcandre2010-06-221-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_syscall): should check argument string taint beforematz2010-06-121-1/+1
| | | | | | invoking system calls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_putc): documentation updated to mention putc wouldmatz2010-06-101-3/+8
| | | | | | | | not work well with multi-byte characters. [ruby-core:30697] * io.c (rb_f_putc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (parse_mode_enc): set set_by_bom bit. [ruby-core:30641]nobu2010-06-071-10/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): add RB_GC_GUARD.tarui2010-05-311-0/+3
| | | | | | | | This caused failure when test/ruby/test_argf.rb is executed with GC.stress = true in mswin32_90 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * removed trailing spaces.nobu2010-05-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c: Documentation: small fixesmarcandre2010-05-171-28/+28
| | | | | | | | * file.c: ditto * io.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-195/+195
| | | | | | | | | | | | | | * enum.c: Documentation: whitespace fix for r27865 * error.c: ditto * file.c: ditto * io.c: ditto * load.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-213/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (swallow): should use more_char() instead of fill_cbuf().usa2010-05-131-5/+1
| | | | | | | suggested by akr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Harmonize documentation, in particular regarding:marcandre2010-05-131-26/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - methods returning enumerators - array methods and argument naming (array -> ary, an_array -> new_ary) - minor improvements, typo fixed and styling issues Other documentation errors fixed: - return value was self instead of a new array (or vice-versa) for Array#{pop,shift,permutation,repeated_permutation,keep_if} - Array#rindex was missing the form with a block. * dir.c: ditto. * enum.c: ditto. Modified Enumerable#reverse_each' documentation to clarify that #each will be finish before any element is yielded. * error.c: ditto. * gc.c: ditto. * hash.c: ditto. * io.c: ditto. IO#{codepoints,each_codepoint} fixed as per [ruby-core:23948] * numeric.c: ditto. * range.c: ditto. * string.c: ditto. * struct.c: ditto. * vm_eval.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (swallow): small optimize.usa2010-05-131-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (swallow): support text mode and UTF-16/32 as internal encoding.usa2010-05-131-9/+42
| | | | | | | * io.c (io_shift_cbuf): read and throw it away when str is NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c, include/ruby/win32.h (rb_w32_has_cancel_io): newusa2010-05-101-2/+3
| | | | | | | | | function. * io.c (WAIT_FD_IN_WIN32): check only when it's not cancelable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (nogvl_copy_stream_sendfile): ISO C90 forbids mixed declarations and ↵kazu2010-05-081-2/+3
| | | | | | code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c: RDoc for subclasses of Exception. [ruby-core:28394]marcandre2010-05-081-0/+35
| | | | | | | | | | | | | | | | | | | | | | * cont.c: ditto * enumerator.c: ditto * io.c: ditto * math.c: ditto * numeric.c: ditto * proc.c: ditto * re.c: ditto * thread.c: ditto * transcode.c: ditto. Thanks to Run Paint for some of the documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add rdoc about IO#read(length). [ruby-core:29161]naruse2010-05-031-5/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * merge some patches from win32-uncode-test branch.usa2010-04-301-42/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see #1685. * file.c, include/ruby/intern.h (rb_str_encode_ospath): new function to convert encoding for pathname. * win32.c, include/ruby/win32.h (rb_w32_ulink, rb_w32_urename, rb_w32_ustati64, rb_w32_uopen, rb_w32_uutime, rb_w32_uchdir, rb_w32_umkdir, rb_w32_urmdir, rb_w32_uunlink): new functions to accept UTF-8 path. * win32/win32.c (rb_w32_opendir, link, rb_w32_stati64, rb_w32_utime, rb_w32_unlink): use WCHAR path internally. * file.c (rb_stat, eaccess, access_internal, rb_file_s_ftype, chmod_internal, rb_file_chmod, rb_file_chown, utime_internal, rb_file_s_link, unlink_internal, rb_file_s_rename): use UTF-8 version functions on Win32. * file.c (apply2files, rb_stat, rb_file_s_lstat, rb_file_symlink_p, rb_file_readable_p, rb_file_writable_p, rb_file_executable_p, check3rdbyte, rb_file_identical_p, rb_file_chmod, rb_file_chown, rb_file_s_link, rb_file_s_symlink, rb_file_s_rename): call rb_str_encode_ospath() before passing the path to system. * io.c (rb_sysopen): ditto. * dir.c (dir_chdir, dir_s_mkdir, dir_s_rmdir): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (seek_before_access): fixed argument type.nobu2010-04-301-2/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (seek_before_access): renamed. see [ruby-core:29861].nobu2010-04-291-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e