diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-10 02:34:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-10 02:34:24 +0000 |
commit | b44c47d102763fbac164810884e3adcac64ef8ce (patch) | |
tree | 57288721b0d1a7d68048d6a986dbf1991cd77617 /include | |
parent | 0d3d17b907a93c64450aee62b440625c39dd8717 (diff) |
io.c: move RFile initialization
* io.c (rb_io_make_open_file): move from include/ruby/io.h, and
hide too detailed implementations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/io.h | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/include/ruby/io.h b/include/ruby/io.h index f71176043f..488a092004 100644 --- a/include/ruby/io.h +++ b/include/ruby/io.h @@ -119,49 +119,19 @@ typedef struct rb_io_t { #define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr) #define RB_IO_BUFFER_INIT(buf) do {\ - (buf).ptr = NULL;\ - (buf).off = 0;\ - (buf).len = 0;\ - (buf).capa = 0;\ + [<"internal macro RB_IO_BUFFER_INIT() is used">];\ } while (0) #define MakeOpenFile(obj, fp) do {\ - if (RFILE(obj)->fptr) {\ - rb_io_close(obj);\ - rb_io_fptr_finalize(RFILE(obj)->fptr);\ - RFILE(obj)->fptr = 0;\ - }\ - (fp) = 0;\ - RB_IO_FPTR_NEW(fp);\ - RFILE(obj)->fptr = (fp);\ + (fp) = rb_io_make_open_file(obj);\ } while (0) #define RB_IO_FPTR_NEW(fp) do {\ - (fp) = ALLOC(rb_io_t);\ - (fp)->fd = -1;\ - (fp)->stdio_file = NULL;\ - (fp)->mode = 0;\ - (fp)->pid = 0;\ - (fp)->lineno = 0;\ - (fp)->pathv = Qnil;\ - (fp)->finalize = 0;\ - RB_IO_BUFFER_INIT((fp)->wbuf);\ - RB_IO_BUFFER_INIT((fp)->rbuf);\ - RB_IO_BUFFER_INIT((fp)->cbuf);\ - (fp)->readconv = NULL;\ - (fp)->writeconv = NULL;\ - (fp)->writeconv_asciicompat = Qnil;\ - (fp)->writeconv_pre_ecflags = 0;\ - (fp)->writeconv_pre_ecopts = Qnil;\ - (fp)->writeconv_initialized = 0;\ - (fp)->tied_io_for_writing = 0;\ - (fp)->encs.enc = NULL;\ - (fp)->encs.enc2 = NULL;\ - (fp)->encs.ecflags = 0;\ - (fp)->encs.ecopts = Qnil;\ - (fp)->write_lock = 0;\ + [<"internal macro RB_IO_FPTR_NEW() is used">];\ } while (0) +rb_io_t *rb_io_make_open_file(VALUE obj); + FILE *rb_io_stdio_file(rb_io_t *fptr); FILE *rb_fdopen(int, const char*); |