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
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
* 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
(MakeOpenFile): initialize pathv as Qnil.
* gc.c: mark pathv field in T_FILE.
* io.c: follow the rb_io_t field change.
* file.c: ditto.
* ext/socket/socket.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/encoding.h (rb_econv_t): new field: flags.
(rb_econv_binmode): declared.
* io.c (io_unread): text mode hack removed.
(NEED_NEWLINE_DECODER): defined.
(NEED_NEWLINE_ENCODER): defined.
(NEED_READCONV): defined.
(NEED_WRITECONV): defined.
(TEXTMODE_NEWLINE_ENCODER): defined for windows.
(make_writeconv): setup converter with TEXTMODE_NEWLINE_ENCODER for
text mode.
(io_fwrite): use NEED_WRITECONV. character code conversion is
disabled if fptr->writeconv_stateless is nil.
(make_readconv): setup converter with
ECONV_UNIVERSAL_NEWLINE_DECODER for text mode.
(read_all): use NEED_READCONV.
(appendline): use NEED_READCONV.
(rb_io_getline_1): use NEED_READCONV.
(io_getc): use NEED_READCONV.
(rb_io_ungetc): use NEED_READCONV.
(rb_io_binmode): OS-level text mode test removed. call
rb_econv_binmode.
(rb_io_binmode_m): call rb_io_binmode_m with write_io as well.
(rb_io_flags_mode): return mode string including "t".
(rb_io_mode_flags): detect "t" for text mode.
(rb_sysopen): always specify O_BINARY.
* transcode.c (rb_econv_open_by_transcoder_entries): initialize flags.
(rb_econv_open): if source and destination encoding is
both empty string, open newline converter. last_tc will be NULL in
this case.
(rb_econv_encoding_to_insert_output): last_tc may be NULL now.
(rb_econv_string): ditto.
(output_replacement_character): ditto.
(transcode_loop): ditto.
(econv_init): ditto.
(econv_inspect): ditto.
(rb_econv_binmode): new function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(rb_file_open_internal): ditto.
(rb_io_open): ditto.
(rb_file_open): pass filename as a VALUE to rb_file_open_internal.
(rb_open_file): pass filename as a VALUE to rb_file_open_generic.
(open_key_args): pass filename as a VALUE to rb_io_open.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
external encoding and internal encoding is given.
(pipe_open): add flags and convconfig argument to initialize
fptr->{mode,enc,enc2}.
(pipe_open_v): pass flags and convconfig from caller to pipe_open.
(pipe_open_s): ditto.
(pop_last_hash): new function.
(rb_io_s_popen): use last hash as option to specify code conversion.
(rb_io_open): specify flags and convconfig arguments for
pipe_open_s.
(rb_f_backquote): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(rb_io_open): set up encoding using new argument opt.
(open_key_args): call rb_io_open with opt. don't call
io_set_encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(rb_io_reopen): use rb_io_flags_modenum and rb_io_modenum_mode.
(rb_io_stdio_file): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(rb_io_extract_modeenc): new function.
(rb_file_open_generic): new function.
(rb_file_open_internal): use rb_file_open_generic.
(rb_file_sysopen_internal): use rb_file_open_generic.
(rb_open_file): use rb_io_extract_modeenc and rb_file_open_generic.
(rb_io_open): call rb_file_open_internal instead of rb_file_open.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
useless because vmode and perm is overwritten by rb_scan_args
anyway.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e