* include/ruby/io.h (rb_io_t): new fields: writeconv,
commit7bf658c52ccbee352bc19aa83eb6e1ca2c55e5c5
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Mon, 18 Aug 2008 12:06:42 +0000 (18 12:06 +0000)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Mon, 18 Aug 2008 12:06:42 +0000 (18 12:06 +0000)
tree6d4afdf333976a87b4f0de7ef667c8e4603277f9
parent27bfca9f70b9476b9fcf880dcaa2c8c39f9defee
* include/ruby/io.h (rb_io_t): new fields: writeconv,
  writeconv_stateless and writeconv_initialized.
  (MakeOpenFile): initialize them.

* include/ruby/encoding.h (rb_econv_stateless_encoding): declared.
  (rb_econv_string): declared.

* io.c (make_writeconv): new function.
  (io_fwrite): use econv.
  (make_readconv): fix error message.
  (finish_writeconv): new function.
  (fptr_finalize): call finish_writeconv.
  (clear_writeconv): new function.
  (clear_codeconv): new function to call both clear_readconv and
  clear_writeconv.
  (rb_io_fptr_finalize): call clear_codeconv instead of
  clear_readconv.
  (mode_enc): ditto.
  (io_set_encoding): ditto.
  (argf_next_argv): ditto.
  (io_encoding_set): ditto.

* gc.c (gc_mark_children): mark writeconv_stateless in T_FILE.

* transcode.c (stateless_encoding_i): new function.
  (rb_econv_stateless_encoding): ditto.
  (rb_econv_string): ditto.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
ChangeLog
gc.c
include/ruby/encoding.h
include/ruby/io.h
io.c
test/ruby/test_io_m17n.rb
transcode.c