summaryrefslogtreecommitdiff
path: root/io.c
AgeCommit message (Collapse)Author
2008-09-30* io.c (rb_io_extract_modeenc): should honor value of thematz
textmode: and binmode: options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-26* include/ruby/encoding.h (rb_str_encode): renamed fromakr
rb_str_transcode. [ruby-dev:36593] (rb_econv_has_convpath_p): renamed from rb_transcode_convertible. * transcode.c: follow the renaming. * io.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-24* io.c (rb_io_mode_enc): make it static.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-24* io.c (rb_io_s_binread): offset argument was wrongly passed tomatz
internal IO#read call. [ruby-core:18810] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* io.c (io_binwrite): allocate wbuf if nosync.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* io.c (copy_stream_body): use io_binwrite instead of io_fwrite.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* io.c (io_binwrite): add nosync argument.akr
(do_writeconv): extracted from io_fwrite. (io_fwrite): add nosync argument. use do_writeconv. (io_write): add nosync argument. (io_write_m): new function for IO#write. (rb_p): don't append record separator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* io.c (rb_io_s_binread): a new method to read binary chunk from amatz
file. [ruby-core:18674] * io.c (open_key_args): wrong permission specified for read-open. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* thread.c, include/ruby/intern.h (rb_thread_interrupted): added.ko1
* io.c: use VALUE of thead instead of rb_tread_t to check interrupts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-17* io.c (rb_io_extract_modeenc): process option mode: and perm: asmatz
well. * io.c (open_key_args): move mode: and perm: related code to rb_io_extract_modeenc(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-16* io.c (rb_io_readbyte): rdoc updated. [ruby-core:18617]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-16* io.c (rb_io_gets_m): rdoc updated. limit counts in bytes.matz
[ruby-core:18617] * io.c (rb_io_readlines, rb_f_gets): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-15* gc.c, include/ruby/ruby.h: rename rb_register_mark_object()ko1
to rb_gc_register_mark_object(). * eval.c, vm.c: initialize vm->mark_object_ary at Init_top_self(). * bignum.c, complex.c, encoding.c, ext/win32ole/win32ole.c, io.c, load.c, marshal.c, rational.c, ruby.c, vm.c: use rb_gc_register_mark_object() instead of rb_global_variable() or rb_gc_register_address(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-15* encoding.c (rb_enc_get_index): don't return -1.akr
* io.c (rb_scan_open_args): call FilePathValue before encoding conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-13* include/ruby/oniguruma.h (OnigEncodingTypeST): add end argument forakr
left_adjust_char_head. (ONIGENC_LEFT_ADJUST_CHAR_HEAD): add end argument. (onigenc_get_left_adjust_char_head): ditto. * include/ruby/encoding.h (rb_enc_left_char_head): add end argument. * regenc.h (onigenc_single_byte_left_adjust_char_head): ditto. * regenc.c (onigenc_get_right_adjust_char_head): follow the interface change. (onigenc_get_right_adjust_char_head_with_prev): ditto. (onigenc_get_prev_char_head): ditto. (onigenc_step_back): ditto. (onigenc_get_left_adjust_char_head): ditto. (onigenc_single_byte_code_to_mbc): ditto. * re.c: ditto. * string.c: ditto. * io.c: ditto. * regexec.c: ditto. * enc/euc_jp.c: ditto. * enc/cp949.c: ditto. * enc/shift_jis.c: ditto. * enc/gbk.c: ditto. * enc/big5.c: ditto. * enc/euc_tw.c: ditto. * enc/euc_kr.c: ditto. * enc/emacs_mule.c: ditto. * enc/gb18030.c: ditto. * enc/utf_8.c: ditto. * enc/utf_16le.c: ditto. * enc/utf_16be.c: ditto. * enc/utf_32le.c: ditto. * enc/utf_32be.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-13* io.c (io_encoding_set): don't need argc argument.akr
(rb_io_s_pipe): update io_encoding_set call. (rb_io_set_encoding): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-13* io.c (make_writeconv): use rb_enc_name.akr
(make_readconv): ditto. * transcode.c (rb_econv_open_opts): ditto. (econv_args): ditto. (decorate_convpath): ditto. (econv_set_replacement): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-12* iseq.c (iseq_s_compile_file): use rb_file_open_str.akr
* io.c (rb_file_open_generic): call validate_enc_binmode. (rb_file_open_str): call FilePathValue. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-12* io.c (validate_enc_binmode): extracted from rb_io_extract_modeenc.akr
(rb_io_extract_modeenc): use validate_enc_binmode. (io_encoding_set): call validate_enc_binmode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-10* io.c (io_binwrite): extracted from io_fwrite.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-09* include/ruby/encoding.h (econv_after_output): renamed fromakr
econv_output_followed_by_input. (ECONV_AFTER_OUTPUT): renamed from ECONV_OUTPUT_FOLLOWED_BY_INPUT. * transcode.c: follow the renaming. * io.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-09* include/ruby/io.h (rb_io_t): rename field: writeconv_stateless toakr
writeconv_asciicompat. * io.c: follow the renaming. * gc.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-09* io.c (io_fwrite): raise an error if ASCII incompatible stringakr
written for text mode IO without encoding conversion. (rb_io_extract_modeenc): binmode requirement changed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-09* include/ruby/encoding.h (ECONV_DECORATOR_MASK): mergeakr
ECONV_ENCODER_MASK and ECONV_DECORATOR_MASK. (ECONV_UNIVERSAL_NEWLINE_DECORATOR): renamed from ECONV_UNIVERSAL_NEWLINE_DECODER. (ECONV_CRLF_NEWLINE_DECORATOR): renamed from ECONV_CRLF_NEWLINE_ENCODER. (ECONV_CR_NEWLINE_DECORATOR): renamed from ECONV_CR_NEWLINE_ENCODER. (ECONV_XML_TEXT_DECORATOR): renamed from ECONV_XML_TEXT_ENCODER. (ECONV_XML_ATTR_CONTENT_DECORATOR): renamed from ECONV_XML_ATTR_CONTENT_ENCODER. (ECONV_STATEFUL_DECORATOR_MASK): renamed from ECONV_STATEFUL_ENCODER_MASK. (ECONV_XML_ATTR_QUOTE_DECORATOR): renamed from ECONV_XML_ATTR_CONTENT_DECORATOR. * io.c: follow the renaming. * transcode.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-08* io.c (make_writeconv): useless branch removed.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-08* include/ruby/encoding.h (rb_econv_asciicompat_encoding): renamedakr
from rb_econv_stateless_encoding to apply stateless ASCII incompatible encodings such as UTF-16BE. * io.c (make_writeconv): use rb_econv_asciicompat_encoding. * transcode_data.h (rb_transcoder_asciicompat_type_t): renamed from rb_transcoder_stateful_type_t. (rb_transcoder): use rb_transcoder_asciicompat_type_t. * transcode.c: follow the type change. (asciicompat_encoding_i): renamed from stateless_encoding_i. (rb_econv_asciicompat_encoding): renamed from rb_econv_stateless_encoding. (econv_s_asciicompat_encoding): method renamed. * tool/transcode-tblgen.rb: follow the type change. * enc/trans/utf_16_32.trans: follow the type change. rb_from_UTF_16BE to UTF-8 is asciicompat_decoder. rb_from_UTF_16LE to UTF-8 is asciicompat_decoder. rb_from_UTF_32BE to UTF-8 is asciicompat_decoder. rb_from_UTF_32LE to UTF-8 is asciicompat_decoder. UTF-8 to rb_to_UTF_16BE is asciicompat_encoder. UTF-8 to rb_to_UTF_16LE is asciicompat_encoder. UTF-8 to rb_to_UTF_32BE is asciicompat_encoder. UTF-8 to rb_to_UTF_32LE is asciicompat_encoder. * enc/trans/newline.trans: follow the type change. universal newline decoder is asciicompat_converter. * enc/trans/escape.trans: follow the type change. * enc/trans/iso2022.trans: ditto. * enc/trans/japanese.trans: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-07* io.c (make_writeconv): choose ASCII compatible encoding asakr
intermediate encoding if stateful encoder exists. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-07* include/ruby/encoding.h (ECONV_XML_ATTR_CONTENT_ENCODER): defined.akr
(ECONV_STATEFUL_ENCODER_MASK): defined. (ECONV_XML_ATTR_QUOTE_ENCODER): defined. (ECONV_XML_ATTR_ENCODER): removed. * enc/trans/escape.trans (rb_escape_xml_attr_content): defined. (rb_escape_xml_attr_quote): defined. (rb_escape_xml_attr): removed. * io.c (NEED_WRITECONV): writeconv is required if supplemental converter is used. (make_writeconv): apply stateful encoder in writeconv. * transcode.c: follow the constant change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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