summaryrefslogtreecommitdiff
path: root/io.c
AgeCommit message (Collapse)Author
2008-09-06* include/ruby/encoding.h (ECONV_ERROR_HANDLER_MASK): defined.akr
(ECONV_DECODER_MASK): defined. (ECONV_ENCODER_MASK): defined. * io.c (make_writeconv): restrict ecflags for writeconv with ECONV_ERROR_HANDLER_MASK. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-06* io.c (rb_io_binmode): clear newline flags in writeconv_pre_ecflags.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05* io.c (rb_io_extract_modeenc): raise an error for ASCII incompatibleakr
encoding without binmode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05* include/ruby/io.h (rb_io_modestr_fmode): renamed fromakr
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05* io.c (MODENUM_MAX): removed.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05* io.c (copy_stream_fallback_body): use read method unless readpartialnobu
is available. [ruby-dev:36124] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* io.c (argf_mark): mark p->encs.ecopts.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* include/ruby/intern.h (rb_file_open_str): declared.akr
* io.c (rb_file_open_str): defined. * ext/zlib/zlib.c (gzfile_s_open): use rb_file_open_str instead of rb_file_open. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* io.c: variables renamed for consistency.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* include/ruby/io.h (rb_io_enc_t): rename flags to ecflags.akr
(rb_io_t): rename writeconv_pre_flags to writeconv_pre_ecflags. (MakeOpenFile): follow the renaming. * io.c: follow the renaming. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* io.c (struct sysopen_struct, rb_sysopen_internal, rb_sysopen):nobu
constified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* io.c: expanded ARGF members macros.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* io.c (argf_next_argv, argf_set_encoding): copy struct wise.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* io.c (rb_scan_open_args): follow rb_str_transcode change.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03rdoc update.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03* include/ruby/io.h (rb_io_t): new fields: encs.ecopts andakr
writeconv_pre_ecopts. (MakeOpenFile): initialize them. * include/ruby/encoding.h (rb_str_transcode): take ecopts argument. (rb_econv_flags): removed. (rb_econv_prepare_opts): declared. (rb_econv_open_opts): declared. * 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. * gc.c (gc_mark_children): mark encs.ecopts and writeconv_pre_ecopts in T_FILE. * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 * io.c (make_writeconv): follow akr's previous commit.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03* include/ruby/encoding.h (rb_econv_option_t): removed. Sinceakr
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03* include/ruby/signal.h: removed.ko1
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31fix typos.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31* include/ruby/intern.h: rename RB_UBF_DFL toko1
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-27* include/ruby/io.h (rb_io_t): refcnt field removed.akr
(MakeOpenFile): refcnt initialization removed. * io.c (rb_io_fptr_finalize): don't check refcnt. (rb_io_close_read): don't use refcnt. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-27* io.c (rb_io_initialize): don't accept IO object. [ruby-dev:35895]akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26* include/ruby/encoding.h (rb_econv_result_t): enumeration constant:akr
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26* include/ruby/io.h (rb_io_t): rename crbuf to cbuf.akr
* io.c: follow the renaming. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* io.c (make_writeconv): copy invalid/undef flags.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* include/ruby/io.h (rb_io_t): new field: writeconv_pre_opts.akr
* io.c (make_writeconv): initialize writeconv_pre_opts. (io_fwrite): use writeconv_pre_opts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* io.c: test _WIN32 for CRLF platform. (cygwin defines O_BINARY.)akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* io.c: force CRLF handling if RUBY_TEST_CRLF_ENVIRONMENT is defined.akr
This is only for testing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* io.c (io_fwrite): add TEXTMODE_NEWLINE_ENCODER to option forakr
rb_str_transcode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* include/ruby/intern.h (rb_io_ungetbyte): added prototype.nobu
* io.c (rb_io_gets): use rb_io_getline_1 for unget buffer. * ruby.c (load_file): use rb_io_ungetbyte. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* io.c (rb_io_init_copy): copy encs.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24rdoc updated.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* io.c (rb_io_open): add an argument: vperm.akr
(open_key_args): call rb_io_open with perm. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* io.c (sym_invalid): removed.akr
(sym_undef): removed. (sym_ignore): removed. (sym_replace): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* io.c (rb_io_reopen): initialize fptr->encs.opts.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* io.c (rb_io_s_pipe): accept optional hash.akr
(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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/io.h (rb_io_enc_t): add opts field.akr
(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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* io.c (struct argf): use struct rb_io_enc_t.akr
(argf_enc): follow the struct argf change. (argf_enc2): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/encoding.h (rb_str_transcode): make 3rd argumentakr
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/io.h (rb_io_t): make enc and enc2 as structakr
rb_io_enc_t; * io.c: follow the structure change. (convconfig_t): defined by rb_io_enc_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/encoding.h (rb_econv_opts): declared.akr
* transcode.c (rb_econv_opts): defined. * io.c (rb_io_extract_modeenc): use rb_econv_opts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/encoding.h (rb_econv_option_t): defined.akr
(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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/encoding.h (rb_str_transcode): add ecflags argument.akr
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/encoding.h (rb_econv_substr_append): renamed fromakr
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/encoding.h (rb_econv_open_exc): declared.akr
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23* io.c (rb_scan_open_args): use pop_last_hash.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23* include/ruby/io.h (FMODE_INVALID_MASK): defined.akr
(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_*. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23* io.c (rb_io_extract_modeenc): check :textmode and :binmode in optionakr
hash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23* io.c (check_pipe_command): extracted from rb_f_open and rb_io_open.akr
(rb_f_open): use check_pipe_command. (rb_io_open): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e