summaryrefslogtreecommitdiff
path: root/rubyio.h
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-08 13:26:27 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-08 13:26:27 +0000
commit78f7b7036bb6c950a3533a5eb0f2fc9741511efa (patch)
treefa816a2108da7da9fb68f1f209f38cd4be8d5cbc /rubyio.h
parent19f57ce1443f309c726aef8e5316efde1dfece8e (diff)
* 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
Diffstat (limited to 'rubyio.h')
-rw-r--r--rubyio.h13
1 files changed, 6 insertions, 7 deletions
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*));