diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-24 09:13:55 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-24 09:13:55 +0000 |
commit | 571b114708061819db35ad7c0349502196aa92be (patch) | |
tree | d0ae53732c3d8b85f38240f47aa2f1671320770f /include/ruby/io.h | |
parent | 6d019ccbd0f93b6be47884f4cc814798614d284e (diff) |
* include/ruby/io.h (rb_io_enc_t): add opts field.
(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
Diffstat (limited to 'include/ruby/io.h')
-rw-r--r-- | include/ruby/io.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/ruby/io.h b/include/ruby/io.h index 217387e11a..189a5f211c 100644 --- a/include/ruby/io.h +++ b/include/ruby/io.h @@ -58,6 +58,7 @@ typedef struct rb_io_t { struct rb_io_enc_t { rb_encoding *enc; rb_encoding *enc2; + rb_econv_option_t opts; } encs; rb_econv_t *readconv; @@ -89,12 +90,6 @@ typedef struct rb_io_t { #define FMODE_TRUNC 0x00000800 #define FMODE_TEXTMODE 0x00001000 /* #define FMODE_PREP 0x00010000 */ -#define FMODE_INVALID_MASK 0x00f00000 -#define FMODE_INVALID_IGNORE 0x00100000 -#define FMODE_INVALID_REPLACE 0x00200000 -#define FMODE_UNDEF_MASK 0x0f000000 -#define FMODE_UNDEF_IGNORE 0x01000000 -#define FMODE_UNDEF_REPLACE 0x02000000 #define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr) @@ -133,6 +128,7 @@ typedef struct rb_io_t { fp->tied_io_for_writing = 0;\ fp->encs.enc = NULL;\ fp->encs.enc2 = NULL;\ + fp->encs.opts.flags = 0;\ } while (0) FILE *rb_io_stdio_file(rb_io_t *fptr); |