From 78f7b7036bb6c950a3533a5eb0f2fc9741511efa Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 8 Dec 2004 13:26:27 +0000 Subject: * rubyio.h, io.c, ext/dl/dl.c, ext/pty/pty.c, ext/socket/socket.c: create FILE object only when required: popen(3) and DL's IO#to_ptr. [ruby-dev:25122] * io.c (rb_io_binmode): use setmode for Human68k. [ruby-dev:25121] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- rubyio.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'rubyio.h') diff --git a/rubyio.h b/rubyio.h index 7ef021b72f..e9716c0306 100644 --- a/rubyio.h +++ b/rubyio.h @@ -21,19 +21,19 @@ #endif typedef struct OpenFile { - int fd; - FILE *f; /* stdio ptr for read/write */ + int fd; /* file descriptor */ + FILE *stdio_file; /* stdio ptr for read/write if available */ int mode; /* mode flags */ int pid; /* child's pid (for pipes) */ int lineno; /* number of lines read */ char *path; /* pathname for file */ void (*finalize) _((struct OpenFile*,int)); /* finalize proc */ long refcnt; - char *wbuf; + char *wbuf; /* wbuf_off + wbuf_len <= wbuf_capa */ int wbuf_off; int wbuf_len; int wbuf_capa; - char *rbuf; + char *rbuf; /* rbuf_off + rbuf_len <= rbuf_capa */ int rbuf_off; int rbuf_len; int rbuf_capa; @@ -60,7 +60,7 @@ typedef struct OpenFile { fp = 0;\ fp = RFILE(obj)->fptr = ALLOC(OpenFile);\ fp->fd = -1;\ - fp->f = NULL;\ + fp->stdio_file = NULL;\ fp->mode = 0;\ fp->pid = 0;\ fp->lineno = 0;\ @@ -77,8 +77,7 @@ typedef struct OpenFile { fp->rbuf_capa = 0;\ } while (0) -#define GetReadFile(fptr) ((fptr)->f) -#define GetWriteFile(fptr) ((fptr)->f) +FILE *rb_io_stdio_file(OpenFile *fptr); FILE *rb_fopen _((const char*, const char*)); FILE *rb_fdopen _((int, const char*)); -- cgit v1.2.3