diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-16 17:06:35 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-16 17:06:35 +0000 |
commit | 63daa7c07d6c10c1a47a4578e5fa015760967e84 (patch) | |
tree | 1a6b5f56c22cac07c3ebff759e5ef97d5c42ef64 /include | |
parent | 69f22784f21acb3aaf2f4984d614bc15ca46308b (diff) |
* include/ruby/io.h (rb_io_t): new fields: readconv, crbuf, crbuf_off,
crbuf_len, crbuf_capa.
(MakeOpenFile): initialize them.
* io.c (io_shift_crbuf): new function.
(io_getc): use econv.
(rb_io_fptr_finalize): finalize readconv and crbuf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/io.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/ruby/io.h b/include/ruby/io.h index 95be788c08..da7589f60c 100644 --- a/include/ruby/io.h +++ b/include/ruby/io.h @@ -36,17 +36,26 @@ typedef struct rb_io_t { char *path; /* pathname for file */ void (*finalize)(struct rb_io_t*,int); /* finalize proc */ long refcnt; + char *wbuf; /* wbuf_off + wbuf_len <= wbuf_capa */ int wbuf_off; int wbuf_len; int wbuf_capa; + char *rbuf; /* rbuf_off + rbuf_len <= rbuf_capa */ int rbuf_off; int rbuf_len; int rbuf_capa; + VALUE tied_io_for_writing; - rb_encoding *enc; - rb_encoding *enc2; + rb_encoding *enc; /* int_enc if enc2. ext_enc otherwise. */ + rb_encoding *enc2; /* ext_enc if not NULL. */ + + rb_econv_t *readconv; + char *crbuf; /* crbuf_off + crbuf_len <= crbuf_capa */ + int crbuf_off; + int crbuf_len; + int crbuf_capa; } rb_io_t; #define HAVE_RB_IO_T 1 @@ -89,6 +98,11 @@ typedef struct rb_io_t { fp->rbuf_off = 0;\ fp->rbuf_len = 0;\ fp->rbuf_capa = 0;\ + fp->readconv = NULL;\ + fp->crbuf = NULL;\ + fp->crbuf_off = 0;\ + fp->crbuf_len = 0;\ + fp->crbuf_capa = 0;\ fp->tied_io_for_writing = 0;\ fp->enc = 0;\ fp->enc2 = 0;\ |