From ffff30fc87f019bec2e2cd37312508e95918d9a8 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 24 Aug 2008 09:13:55 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@18816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/io.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'include/ruby') diff --git a/include/ruby/io.h b/include/ruby/io.h index 217387e11..189a5f211 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); -- cgit