mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* gc.c (obj_free), io.c (rb_io_fptr_finalize), rubyio.h (OpenFile):
sharing OpenFile. * io.c (rb_io_initialize): accept IO instance. [ruby-dev:22195] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
61deeb3741
commit
b0e0f45571
4 changed files with 65 additions and 12 deletions
2
rubyio.h
2
rubyio.h
|
@ -24,6 +24,7 @@ typedef struct OpenFile {
|
|||
int lineno; /* number of lines read */
|
||||
char *path; /* pathname for file */
|
||||
void (*finalize) _((struct OpenFile*,int)); /* finalize proc */
|
||||
long refcnt;
|
||||
} OpenFile;
|
||||
|
||||
#define FMODE_READABLE 1
|
||||
|
@ -50,6 +51,7 @@ typedef struct OpenFile {
|
|||
fp->lineno = 0;\
|
||||
fp->path = NULL;\
|
||||
fp->finalize = 0;\
|
||||
fp->refcnt = 1;\
|
||||
} while (0)
|
||||
|
||||
#define GetReadFile(fptr) ((fptr)->f)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue