ruby-changes:4532
From: ko1@a...
Date: Tue, 15 Apr 2008 12:36:20 +0900 (JST)
Subject: [ruby-changes:4532] nobu - Ruby:r16025 (ruby_1_8): * rubyio.h (rb_io_t): renamed from OpenFile.
nobu 2008-04-15 12:35:55 +0900 (Tue, 15 Apr 2008)
New Revision: 16025
Modified files:
branches/ruby_1_8/ChangeLog
branches/ruby_1_8/ext/dl/dl.c
branches/ruby_1_8/ext/io/wait/wait.c
branches/ruby_1_8/ext/pty/pty.c
branches/ruby_1_8/ext/readline/readline.c
branches/ruby_1_8/ext/socket/socket.c
branches/ruby_1_8/file.c
branches/ruby_1_8/gc.c
branches/ruby_1_8/io.c
branches/ruby_1_8/ruby.h
branches/ruby_1_8/rubyio.h
branches/ruby_1_8/win32/win32.h
Log:
* rubyio.h (rb_io_t): renamed from OpenFile.
* ruby.h (struct RHash), file.c, gc.c, io.c, ext/dl/dl.c,
ext/io/wait/wait.c, ext/pty/pty.c, ext/readline/readline.c,
ext/socket/socket.c: ditto.
* win32/win32.h: removed workaround for OpenFile.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/win32/win32.h?r1=16025&r2=16024&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ruby.h?r1=16025&r2=16024&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ext/io/wait/wait.c?r1=16025&r2=16024&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=16025&r2=16024&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ext/socket/socket.c?r1=16025&r2=16024&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ext/readline/readline.c?r1=16025&r2=16024&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ext/dl/dl.c?r1=16025&r2=16024&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ext/pty/pty.c?r1=16025&r2=16024&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/io.c?r1=16025&r2=16024&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/file.c?r1=16025&r2=16024&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/rubyio.h?r1=16025&r2=16024&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/gc.c?r1=16025&r2=16024&diff_format=u
Index: ruby_1_8/ext/dl/dl.c
===================================================================
--- ruby_1_8/ext/dl/dl.c (revision 16024)
+++ ruby_1_8/ext/dl/dl.c (revision 16025)
@@ -551,7 +551,7 @@
VALUE
rb_io_to_ptr(VALUE self)
{
- OpenFile *fptr;
+ rb_io_t *fptr;
FILE *fp;
GetOpenFile(self, fptr);
Index: ruby_1_8/ext/pty/pty.c
===================================================================
--- ruby_1_8/ext/pty/pty.c (revision 16024)
+++ ruby_1_8/ext/pty/pty.c (revision 16025)
@@ -416,7 +416,7 @@
VALUE res;
struct pty_info info;
struct pty_info thinfo;
- OpenFile *wfptr,*rfptr;
+ rb_io_t *wfptr,*rfptr;
VALUE rport = rb_obj_alloc(rb_cFile);
VALUE wport = rb_obj_alloc(rb_cFile);
char SlaveName[DEVICELEN];
Index: ruby_1_8/ext/readline/readline.c
===================================================================
--- ruby_1_8/ext/readline/readline.c (revision 16024)
+++ ruby_1_8/ext/readline/readline.c (revision 16025)
@@ -79,7 +79,7 @@
char *prompt = NULL;
char *buff;
int status;
- OpenFile *ofp, *ifp;
+ rb_io_t *ofp, *ifp;
rb_secure(4);
if (rb_scan_args(argc, argv, "02", &tmp, &add_hist) > 0) {
Index: ruby_1_8/ext/socket/socket.c
===================================================================
--- ruby_1_8/ext/socket/socket.c (revision 16024)
+++ ruby_1_8/ext/socket/socket.c (revision 16025)
@@ -244,7 +244,7 @@
VALUE sock;
int fd;
{
- OpenFile *fp;
+ rb_io_t *fp;
MakeOpenFile(sock, fp);
fp->f = rb_fdopen(fd, "r");
@@ -259,7 +259,7 @@
bsock_s_for_fd(klass, fd)
VALUE klass, fd;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
VALUE sock = init_sock(rb_obj_alloc(klass), NUM2INT(fd));
GetOpenFile(sock, fptr);
@@ -275,7 +275,7 @@
{
VALUE howto;
int how;
- OpenFile *fptr;
+ rb_io_t *fptr;
if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
rb_raise(rb_eSecurityError, "Insecure: can't shutdown socket");
@@ -300,7 +300,7 @@
bsock_close_read(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
rb_raise(rb_eSecurityError, "Insecure: can't close socket");
@@ -319,7 +319,7 @@
bsock_close_write(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
rb_raise(rb_eSecurityError, "Insecure: can't close socket");
@@ -384,7 +384,7 @@
VALUE sock, lev, optname, val;
{
int level, option;
- OpenFile *fptr;
+ rb_io_t *fptr;
int i;
char *v;
int vlen;
@@ -467,7 +467,7 @@
int level, option;
socklen_t len;
char *buf;
- OpenFile *fptr;
+ rb_io_t *fptr;
level = NUM2INT(lev);
option = NUM2INT(optname);
@@ -491,7 +491,7 @@
{
char buf[1024];
socklen_t len = sizeof buf;
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(sock, fptr);
if (getsockname(fileno(fptr->f), (struct sockaddr*)buf, &len) < 0)
@@ -505,7 +505,7 @@
{
char buf[1024];
socklen_t len = sizeof buf;
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(sock, fptr);
if (getpeername(fileno(fptr->f), (struct sockaddr*)buf, &len) < 0)
@@ -521,7 +521,7 @@
{
VALUE mesg, to;
VALUE flags;
- OpenFile *fptr;
+ rb_io_t *fptr;
FILE *f;
int fd, n;
@@ -574,7 +574,7 @@
VALUE *argv;
enum sock_recv_type from;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
VALUE str;
char buf[1024];
socklen_t alen = sizeof buf;
@@ -644,7 +644,7 @@
static VALUE
s_recvfrom_nonblock(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
{
- OpenFile *fptr;
+ rb_io_t *fptr;
VALUE str;
char buf[1024];
socklen_t alen = sizeof buf;
@@ -1350,7 +1350,7 @@
socks_s_close(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
if (rb_safe_level() >= 4 && !OBJ_TAINTED(sock)) {
rb_raise(rb_eSecurityError, "Insecure: can't close socket");
@@ -1483,7 +1483,7 @@
}
static VALUE
-s_accept_nonblock(VALUE klass, OpenFile *fptr, struct sockaddr *sockaddr, socklen_t *len)
+s_accept_nonblock(VALUE klass, rb_io_t *fptr, struct sockaddr *sockaddr, socklen_t *len)
{
int fd2;
@@ -1542,7 +1542,7 @@
tcp_accept(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct sockaddr_storage from;
socklen_t fromlen;
@@ -1585,7 +1585,7 @@
tcp_accept_nonblock(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct sockaddr_storage from;
socklen_t fromlen;
@@ -1599,7 +1599,7 @@
tcp_sysaccept(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct sockaddr_storage from;
socklen_t fromlen;
@@ -1630,7 +1630,7 @@
{
struct sockaddr_un sockaddr;
int fd, status;
- OpenFile *fptr;
+ rb_io_t *fptr;
SafeStringValue(path);
fd = ruby_socket(AF_UNIX, SOCK_STREAM, 0);
@@ -1682,7 +1682,7 @@
ip_addr(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct sockaddr_storage addr;
socklen_t len = sizeof addr;
@@ -1697,7 +1697,7 @@
ip_peeraddr(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct sockaddr_storage addr;
socklen_t len = sizeof addr;
@@ -1778,7 +1778,7 @@
udp_connect(sock, host, port)
VALUE sock, host, port;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct udp_arg arg;
VALUE ret;
@@ -1796,7 +1796,7 @@
udp_bind(sock, host, port)
VALUE sock, host, port;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct addrinfo *res0, *res;
rb_secure(3);
@@ -1821,7 +1821,7 @@
VALUE sock;
{
VALUE mesg, flags, host, port;
- OpenFile *fptr;
+ rb_io_t *fptr;
FILE *f;
int n;
struct addrinfo *res0, *res;
@@ -1920,7 +1920,7 @@
unix_path(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(sock, fptr);
if (fptr->path == 0) {
@@ -1967,7 +1967,7 @@
{
#if defined(HAVE_SENDMSG) && (FD_PASSING_BY_MSG_CONTROL || FD_PASSING_BY_MSG_ACCRIGHTS)
int fd;
- OpenFile *fptr;
+ rb_io_t *fptr;
struct msghdr msg;
struct iovec vec[1];
char buf[1];
@@ -1980,7 +1980,7 @@
#endif
if (rb_obj_is_kind_of(val, rb_cIO)) {
- OpenFile *valfptr;
+ rb_io_t *valfptr;
GetOpenFile(val, valfptr);
fd = fileno(valfptr->f);
}
@@ -2048,7 +2048,7 @@
{
#if defined(HAVE_RECVMSG) && (FD_PASSING_BY_MSG_CONTROL || FD_PASSING_BY_MSG_ACCRIGHTS)
VALUE klass, mode;
- OpenFile *fptr;
+ rb_io_t *fptr;
struct msghdr msg;
struct iovec vec[2];
char buf[1];
@@ -2152,7 +2152,7 @@
unix_accept(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct sockaddr_un from;
socklen_t fromlen;
@@ -2195,7 +2195,7 @@
unix_accept_nonblock(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct sockaddr_un from;
socklen_t fromlen;
@@ -2209,7 +2209,7 @@
unix_sysaccept(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct sockaddr_un from;
socklen_t fromlen;
@@ -2231,7 +2231,7 @@
unix_addr(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct sockaddr_un addr;
socklen_t len = sizeof addr;
@@ -2246,7 +2246,7 @@
unix_peeraddr(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct sockaddr_un addr;
socklen_t len = sizeof addr;
@@ -2526,7 +2526,7 @@
sock_connect(sock, addr)
VALUE sock, addr;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
int fd;
StringValue(addr);
@@ -2582,7 +2582,7 @@
sock_connect_nonblock(sock, addr)
VALUE sock, addr;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
int n;
StringValue(addr);
@@ -2680,7 +2680,7 @@
sock_bind(sock, addr)
VALUE sock, addr;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
StringValue(addr);
GetOpenFile(sock, fptr);
@@ -2764,7 +2764,7 @@
sock_listen(sock, log)
VALUE sock, log;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
int backlog;
rb_secure(4);
@@ -3040,7 +3040,7 @@
sock_accept(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
VALUE sock2;
char buf[1024];
socklen_t len = sizeof buf;
@@ -3103,7 +3103,7 @@
sock_accept_nonblock(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
VALUE sock2;
char buf[1024];
socklen_t len = sizeof buf;
@@ -3156,7 +3156,7 @@
sock_sysaccept(sock)
VALUE sock;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
VALUE sock2;
char buf[1024];
socklen_t len = sizeof buf;
Index: ruby_1_8/ext/io/wait/wait.c
===================================================================
--- ruby_1_8/ext/io/wait/wait.c (revision 16024)
+++ ruby_1_8/ext/io/wait/wait.c (revision 16025)
@@ -56,7 +56,7 @@
io_ready_p(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
FILE *fp;
ioctl_arg n;
@@ -84,7 +84,7 @@
VALUE *argv;
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
fd_set rd;
FILE *fp;
int fd;
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog (revision 16024)
+++ ruby_1_8/ChangeLog (revision 16025)
@@ -1,3 +1,13 @@
+Tue Apr 15 12:35:44 2008 Nobuyoshi Nakada <nobu@r...>
+
+ * rubyio.h (rb_io_t): renamed from OpenFile.
+
+ * ruby.h (struct RHash), file.c, gc.c, io.c, ext/dl/dl.c,
+ ext/io/wait/wait.c, ext/pty/pty.c, ext/readline/readline.c,
+ ext/socket/socket.c: ditto.
+
+ * win32/win32.h: removed workaround for OpenFile.
+
Tue Apr 15 00:15:29 2008 Hidetoshi NAGAI <nagai@a...>
* ext/tk/lib/tk/text.rb: typo. call a wrong method.
Index: ruby_1_8/io.c
===================================================================
--- ruby_1_8/io.c (revision 16024)
+++ ruby_1_8/io.c (revision 16025)
@@ -219,7 +219,7 @@
void
rb_io_check_initialized(fptr)
- OpenFile *fptr;
+ rb_io_t *fptr;
{
if (!fptr) {
rb_raise(rb_eIOError, "uninitialized stream");
@@ -228,7 +228,7 @@
void
rb_io_check_closed(fptr)
- OpenFile *fptr;
+ rb_io_t *fptr;
{
rb_io_check_initialized(fptr);
if (!fptr->f && !fptr->f2) {
@@ -236,11 +236,11 @@
}
}
-static void io_fflush _((FILE *, OpenFile *));
+static void io_fflush _((FILE *, rb_io_t *));
-static OpenFile *
+static rb_io_t *
flush_before_seek(fptr)
- OpenFile *fptr;
+ rb_io_t *fptr;
{
if (fptr->mode & FMODE_WBUF) {
io_fflush(GetWriteFile(fptr), fptr);
@@ -262,7 +262,7 @@
void
rb_io_check_readable(fptr)
- OpenFile *fptr;
+ rb_io_t *fptr;
{
rb_io_check_closed(fptr);
if (!(fptr->mode & FMODE_READABLE)) {
@@ -281,7 +281,7 @@
void
rb_io_check_writable(fptr)
- OpenFile *fptr;
+ rb_io_t *fptr;
{
rb_io_check_closed(fptr);
if (!(fptr->mode & FMODE_WRITABLE)) {
@@ -346,7 +346,7 @@
static void
io_fflush(f, fptr)
FILE *f;
- OpenFile *fptr;
+ rb_io_t *fptr;
{
int n;
@@ -425,7 +425,7 @@
#endif
static int
-wsplit_p(OpenFile *fptr)
+wsplit_p(rb_io_t *fptr)
{
FILE *f = GetWriteFile(fptr);
int r;
@@ -449,7 +449,7 @@
static long
io_fwrite(str, fptr)
VALUE str;
- OpenFile *fptr;
+ rb_io_t *fptr;
{
long len, n, r, l, offset = 0;
FILE *f = GetWriteFile(fptr);
@@ -529,7 +529,7 @@
long len;
FILE *f;
{
- OpenFile of;
+ rb_io_t of;
of.f = f;
of.f2 = NULL;
@@ -560,7 +560,7 @@
io_write(io, str)
VALUE io, str;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
long n;
rb_secure(4);
@@ -635,7 +635,7 @@
rb_io_flush(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
FILE *f;
GetOpenFile(io, fptr);
@@ -664,7 +664,7 @@
rb_io_tell(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
off_t pos;
GetOpenFile(io, fptr);
@@ -678,7 +678,7 @@
VALUE io, offset;
int whence;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
off_t pos;
pos = NUM2OFFT(offset);
@@ -742,7 +742,7 @@
rb_io_set_pos(io, offset)
VALUE io, offset;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
off_t pos;
pos = NUM2OFFT(offset);
@@ -772,7 +772,7 @@
rb_io_rewind(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(io, fptr);
if (io_seek(fptr, 0L, 0) != 0) rb_sys_fail(fptr->path);
@@ -821,7 +821,7 @@
rb_io_eof(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
int ch;
GetOpenFile(io, fptr);
@@ -861,7 +861,7 @@
rb_io_sync(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(io, fptr);
return (fptr->mode & FMODE_SYNC) ? Qtrue : Qfalse;
@@ -886,7 +886,7 @@
rb_io_set_sync(io, mode)
VALUE io, mode;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(io, fptr);
if (RTEST(mode)) {
@@ -915,7 +915,7 @@
VALUE io;
{
#ifdef HAVE_FSYNC
- OpenFile *fptr;
+ rb_io_t *fptr;
FILE *f;
GetOpenFile(io, fptr);
@@ -947,7 +947,7 @@
rb_io_fileno(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
int fd;
GetOpenFile(io, fptr);
@@ -979,7 +979,7 @@
rb_io_pid(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(io, fptr);
if (!fptr->pid)
@@ -998,7 +998,7 @@
rb_io_inspect(obj)
VALUE obj;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
char *buf, *cname, *st = "";
long len;
@@ -1057,7 +1057,7 @@
io_fread(ptr, len, fptr)
char *ptr;
long len;
- OpenFile *fptr;
+ rb_io_t *fptr;
{
long n = len;
int c;
@@ -1113,7 +1113,7 @@
long len;
FILE *f;
{
- OpenFile of;
+ rb_io_t of;
of.f = f;
of.f2 = NULL;
@@ -1124,7 +1124,7 @@
static long
remain_size(fptr)
- OpenFile *fptr;
+ rb_io_t *fptr;
{
struct stat st;
off_t siz = BUFSIZ;
@@ -1150,7 +1150,7 @@
static VALUE
read_all(fptr, siz, str)
- OpenFile *fptr;
+ rb_io_t *fptr;
long siz;
VALUE str;
{
@@ -1186,7 +1186,7 @@
return str;
}
-void rb_io_set_nonblock(OpenFile *fptr)
+void rb_io_set_nonblock(rb_io_t *fptr)
{
int flags;
#ifdef F_GETFL
@@ -1224,7 +1224,7 @@
static VALUE
io_getpartial(int argc, VALUE *argv, VALUE io, int nonblock)
{
- OpenFile *fptr;
+ rb_io_t *fptr;
VALUE length, str;
long n, len;
@@ -1407,7 +1407,7 @@
static VALUE
rb_io_write_nonblock(VALUE io, VALUE str)
{
- OpenFile *fptr;
+ rb_io_t *fptr;
FILE *f;
long n;
@@ -1454,7 +1454,7 @@
VALUE *argv;
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
long n, len;
VALUE length, str;
@@ -1510,7 +1510,7 @@
static int
appendline(fptr, delim, strp)
- OpenFile *fptr;
+ rb_io_t *fptr;
int delim;
VALUE *strp;
{
@@ -1615,7 +1615,7 @@
static inline int
swallow(fptr, term)
- OpenFile *fptr;
+ rb_io_t *fptr;
int term;
{
FILE *f = fptr->f;
@@ -1654,7 +1654,7 @@
static VALUE
rb_io_getline_fast(fptr, delim)
- OpenFile *fptr;
+ rb_io_t *fptr;
unsigned char delim;
{
VALUE str = Qnil;
@@ -1689,7 +1689,7 @@
VALUE rs, io;
{
VALUE str = Qnil;
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
@@ -1746,7 +1746,7 @@
rb_io_gets(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
@@ -1814,7 +1814,7 @@
rb_io_lineno(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
@@ -1842,7 +1842,7 @@
rb_io_set_lineno(io, lineno)
VALUE io, lineno;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
@@ -1996,7 +1996,7 @@
rb_io_each_byte(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
FILE *f;
int c;
@@ -2042,7 +2042,7 @@
rb_io_getc(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
FILE *f;
int c;
@@ -2126,7 +2126,7 @@
rb_io_ungetc(io, c)
VALUE io, c;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
int cc = NUM2INT(c);
GetOpenFile(io, fptr);
@@ -2156,7 +2156,7 @@
rb_io_isatty(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(io, fptr);
if (isatty(fileno(fptr->f)) == 0)
@@ -2166,7 +2166,7 @@
static void
fptr_finalize(fptr, noraise)
- OpenFile *fptr;
+ rb_io_t *fptr;
int noraise;
{
int n1 = 0, n2 = 0, f1, f2 = -1;
@@ -2211,7 +2211,7 @@
static void
rb_io_fptr_cleanup(fptr, noraise)
- OpenFile *fptr;
+ rb_io_t *fptr;
int noraise;
{
if (fptr->finalize) {
@@ -2224,7 +2224,7 @@
void
rb_io_fptr_finalize(fptr)
- OpenFile *fptr;
+ rb_io_t *fptr;
{
if (!fptr) return;
if (fptr->path) {
@@ -2240,7 +2240,7 @@
rb_io_close(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
int fd, fd2;
fptr = RFILE(io)->fptr;
@@ -2328,7 +2328,7 @@
rb_io_closed(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
fptr = RFILE(io)->fptr;
rb_io_check_initialized(fptr);
@@ -2357,7 +2357,7 @@
rb_io_close_read(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
int n;
if (rb_safe_level() >= 4 && !OBJ_TAINTED(io)) {
@@ -2402,7 +2402,7 @@
rb_io_close_write(io)
VALUE io;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
int n;
if (rb_safe_level() >= 4 && !OBJ_TAINTED(io)) {
@@ -2444,7 +2444,7 @@
{
VALUE offset, ptrname;
int whence = SEEK_SET;
- OpenFile *fptr;
+ rb_io_t *fptr;
off_t pos;
if (rb_scan_args(argc, argv, "11", &offset, &ptrname) == 2) {
@@ -2482,7 +2482,7 @@
rb_io_syswrite(io, str)
VALUE io, str;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
FILE *f;
long n;
@@ -2530,7 +2530,7 @@
VALUE io;
{
VALUE len, str;
- OpenFile *fptr;
+ rb_io_t *fptr;
long n, ilen;
rb_scan_args(argc, argv, "11", &len, &str);
@@ -2593,7 +2593,7 @@
VALUE io;
{
#if defined(_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__EMX__)
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(io, fptr);
#ifdef __human68k__
@@ -2887,7 +2887,7 @@
VALUE io;
const char *fname, *mode;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
MakeOpenFile(io, fptr);
@@ -2911,7 +2911,7 @@
char *fname;
int flags, mode;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
int fd;
char *m;
@@ -2936,13 +2936,13 @@
#if defined (_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__VMS)
static struct pipe_list {
- OpenFile *fptr;
+ rb_io_t *fptr;
struct pipe_list *next;
} *pipe_list;
static void
pipe_add_fptr(fptr)
- OpenFile *fptr;
+ rb_io_t *fptr;
{
struct pipe_list *list;
@@ -2954,7 +2954,7 @@
static void
pipe_del_fptr(fptr)
- OpenFile *fptr;
+ rb_io_t *fptr;
{
struct pipe_list *list = pipe_list;
struct pipe_list *tmp;
@@ -2989,11 +2989,11 @@
}
}
-static void pipe_finalize _((OpenFile *fptr,int));
+static void pipe_finalize _((rb_io_t *fptr,int));
static void
pipe_finalize(fptr, noraise)
- OpenFile *fptr;
+ rb_io_t *fptr;
int noraise;
{
#if !defined (__CYGWIN__) && !defined(_WIN32)
@@ -3019,14 +3019,14 @@
void
rb_io_synchronized(fptr)
- OpenFile *fptr;
+ rb_io_t *fptr;
{
fptr->mode |= FMODE_SYNC;
}
void
rb_io_unbuffered(fptr)
- OpenFile *fptr;
+ rb_io_t *fptr;
{
rb_io_synchronized(fptr);
}
@@ -3039,7 +3039,7 @@
char *pname, *mode;
{
int modef = rb_io_mode_flags(mode);
- OpenFile *fptr;
+ rb_io_t *fptr;
#if defined(DJGPP) || defined(__human68k__) || defined(__VMS)
FILE *f;
#else
@@ -3516,7 +3516,7 @@
static char*
rb_io_mode_string(fptr)
- OpenFile *fptr;
+ rb_io_t *fptr;
{
switch (fptr->mode & FMODE_READWRITE) {
case FMODE_READABLE:
@@ -3533,7 +3533,7 @@
io_reopen(io, nfile)
VALUE io, nfile;
{
- OpenFile *fptr, *orig;
+ rb_io_t *fptr, *orig;
char *mode;
int fd, fd2;
off_t pos = 0;
@@ -3559,7 +3559,7 @@
io_fflush(GetWriteFile(fptr), fptr);
}
- /* copy OpenFile structure */
+ /* copy rb_io_t structure */
fptr->mode = orig->mode;
fptr->pid = orig->pid;
fptr->lineno = orig->lineno;
@@ -3651,7 +3651,7 @@
{
VALUE fname, nmode;
char *mode;
- OpenFile *fptr;
+ rb_io_t *fptr;
rb_secure(4);
if (rb_scan_args(argc, argv, "11", &fname, &nmode) == 1) {
@@ -3665,8 +3665,8 @@
rb_io_taint_check(file);
fptr = RFILE(file)->fptr;
if (!fptr) {
- fptr = RFILE(file)->fptr = ALLOC(OpenFile);
- MEMZERO(fptr, OpenFile, 1);
+ fptr = RFILE(file)->fptr = ALLOC(rb_io_t);
+ MEMZERO(fptr, rb_io_t, 1);
}
if (!NIL_P(nmode)) {
@@ -3711,7 +3711,7 @@
rb_io_init_copy(dest, io)
VALUE dest, io;
{
- OpenFile *fptr, *orig;
+ rb_io_t *fptr, *orig;
int fd;
char *mode;
@@ -3731,7 +3731,7 @@
fseeko(orig->f, 0L, SEEK_CUR);
}
- /* copy OpenFile structure */
+ /* copy rb_io_t structure */
fptr->mode = orig->mode;
fptr->pid = orig->pid;
fptr->lineno = orig->lineno;
@@ -4182,7 +4182,7 @@
int mode;
VALUE klass;
{
- OpenFile *fp;
+ rb_io_t *fp;
VALUE io = io_alloc(klass);
MakeOpenFile(io, fp);
@@ -4203,7 +4203,7 @@
VALUE io;
char *path;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(io, fptr);
if (fptr->path) rb_bug("illegal prep_path() call");
@@ -4235,7 +4235,7 @@
VALUE io;
{
VALUE fnum, mode;
- OpenFile *fp;
+ rb_io_t *fp;
int fd, flags;
rb_secure(4);
@@ -4392,7 +4392,7 @@
{
extern VALUE rb_argv;
char *fn;
- OpenFile *fptr;
+ rb_io_t *fptr;
int stdout_binmode = 0;
if (TYPE(rb_stdout) == T_FILE) {
@@ -4699,7 +4699,7 @@
{
volatile VALUE port;
VALUE result;
- OpenFile *fptr;
+ rb_io_t *fptr;
SafeStringValue(str);
port = pipe_open(str, 0, "r");
@@ -4736,7 +4736,7 @@
fd_set rset, wset, eset, pset;
fd_set *rp, *wp, *ep;
struct timeval *tp, timerec;
- OpenFile *fptr;
+ rb_io_t *fptr;
long i;
int max = 0, n;
int interrupt_flag = 0;
@@ -4898,7 +4898,7 @@
{
#if !defined(MSDOS) && !defined(__human68k__)
int cmd = NUM2ULONG(req);
- OpenFile *fptr;
+ rb_io_t *fptr;
long len = 0;
long narg = 0;
int retval;
Index: ruby_1_8/rubyio.h
===================================================================
--- ruby_1_8/rubyio.h (revision 16024)
+++ ruby_1_8/rubyio.h (revision 16025)
@@ -20,16 +20,19 @@
#include <stdio_ext.h>
#endif
-typedef struct OpenFile {
+typedef struct rb_io_t {
FILE *f; /* stdio ptr for read/write */
FILE *f2; /* additional ptr for rw pipes */
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 */
-} OpenFile;
+ void (*finalize) _((struct rb_io_t*,int)); /* finalize proc */
+} rb_io_t;
+#define HAVE_RB_IO_T 1
+#define OpenFile rb_io_t /* for backward compatibility */
+
#define FMODE_READABLE 1
#define FMODE_WRITABLE 2
#define FMODE_READWRITE 3
@@ -51,7 +54,7 @@
RFILE(obj)->fptr = 0;\
}\
fp = 0;\
- fp = RFILE(obj)->fptr = ALLOC(OpenFile);\
+ fp = RFILE(obj)->fptr = ALLOC(rb_io_t);\
fp->f = fp->f2 = NULL;\
fp->mode = 0;\
fp->pid = 0;\
@@ -70,15 +73,15 @@
long rb_io_fwrite _((const char *, long, FILE *));
int rb_io_mode_flags _((const char*));
int rb_io_modenum_flags _((int));
-void rb_io_check_writable _((OpenFile*));
-void rb_io_check_readable _((OpenFile*));
-void rb_io_fptr_finalize _((OpenFile*));
-void rb_io_synchronized _((OpenFile*));
-void rb_io_check_initialized _((OpenFile*));
-void rb_io_check_closed _((OpenFile*));
+void rb_io_check_writable _((rb_io_t*));
+void rb_io_check_readable _((rb_io_t*));
+void rb_io_fptr_finalize _((rb_io_t*));
+void rb_io_synchronized _((rb_io_t*));
+void rb_io_check_initialized _((rb_io_t*));
+void rb_io_check_closed _((rb_io_t*));
int rb_io_wait_readable _((int));
int rb_io_wait_writable _((int));
-void rb_io_set_nonblock(OpenFile *fptr);
+void rb_io_set_nonblock(rb_io_t *fptr);
VALUE rb_io_taint_check _((VALUE));
NORETURN(void rb_eof_error _((void)));
Index: ruby_1_8/ruby.h
===================================================================
--- ruby_1_8/ruby.h (revision 16024)
+++ ruby_1_8/ruby.h (revision 16025)
@@ -390,7 +390,7 @@
struct RFile {
struct RBasic basic;
- struct OpenFile *fptr;
+ struct rb_io_t *fptr;
};
struct RData {
Index: ruby_1_8/file.c
===================================================================
--- ruby_1_8/file.c (revision 16024)
+++ ruby_1_8/file.c (revision 16025)
@@ -138,7 +138,7 @@
rb_file_path(obj)
VALUE obj;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
fptr = RFILE(rb_io_taint_check(obj))->fptr;
rb_io_check_initialized(fptr);
@@ -652,7 +652,7 @@
tmp = rb_check_convert_type(file, T_FILE, "IO", "to_io");
if (!NIL_P(tmp)) {
- OpenFile *fptr;
+ rb_io_t *fptr;
rb_secure(2);
GetOpenFile(tmp, fptr);
@@ -673,7 +673,7 @@
tmp = rb_check_convert_type(*file, T_FILE, "IO", "to_io");
if (!NIL_P(tmp)) {
- OpenFile *fptr;
+ rb_io_t *fptr;
GetOpenFile(tmp, fptr);
f = (HANDLE)rb_w32_get_osfhandle(fileno(fptr->f));
@@ -739,7 +739,7 @@
rb_io_stat(obj)
VALUE obj;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct stat st;
GetOpenFile(obj, fptr);
@@ -800,7 +800,7 @@
VALUE obj;
{
#ifdef HAVE_LSTAT
- OpenFile *fptr;
+ rb_io_t *fptr;
struct stat st;
rb_secure(2);
@@ -1594,7 +1594,7 @@
rb_file_atime(obj)
VALUE obj;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct stat st;
GetOpenFile(obj, fptr);
@@ -1639,7 +1639,7 @@
rb_file_mtime(obj)
VALUE obj;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct stat st;
GetOpenFile(obj, fptr);
@@ -1687,7 +1687,7 @@
rb_file_ctime(obj)
VALUE obj;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
struct stat st;
GetOpenFile(obj, fptr);
@@ -1755,7 +1755,7 @@
rb_file_chmod(obj, vmode)
VALUE obj, vmode;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
int mode;
rb_secure(2);
@@ -1899,7 +1899,7 @@
rb_file_chown(obj, owner, group)
VALUE obj, owner, group;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
int o, g;
rb_secure(2);
@@ -3087,7 +3087,7 @@
rb_file_truncate(obj, len)
VALUE obj, len;
{
- OpenFile *fptr;
+ rb_io_t *fptr;
FILE *f;
off_t pos;
@@ -3148,7 +3148,7 @@
static int
rb_thread_flock(fd, op, fptr)
int fd, op;
- OpenFile *fptr;
+ rb_io_t *fptr;
{
if (rb_thread_alone() || (op & LOCK_NB)) {
int ret;
@@ -3214,7 +3214,7 @@
VALUE operation;
{
#ifndef __CHECKER__
- OpenFile *fptr;
+ rb_io_t *fptr;
int op;
rb_secure(2);
Index: ruby_1_8/win32/win32.h
===================================================================
--- ruby_1_8/win32/win32.h (revision 16024)
+++ ruby_1_8/win32/win32.h (revision 16025)
@@ -19,9 +19,7 @@
//
// #include <stdarg.h> conflict with varargs.h?
-// There is function-name conflitct, so we rename it
#if !defined(IN) && !defined(FLOAT)
-#define OpenFile WINAPI_OpenFile
#ifdef __BORLANDC__
#define USE_WINSOCK2
#endif
@@ -32,7 +30,6 @@
#include <windows.h>
#include <winsock.h>
#endif
-#undef OpenFile
#endif
#define NT 1 /* deprecated */
Index: ruby_1_8/gc.c
===================================================================
--- ruby_1_8/gc.c (revision 16024)
+++ ruby_1_8/gc.c (revision 16025)
@@ -35,7 +35,7 @@
#endif
void re_free_registers _((struct re_registers*));
-void rb_io_fptr_finalize _((struct OpenFile*));
+void rb_io_fptr_finalize _((struct rb_io_t*));
#define rb_setjmp(env) RUBY_SETJMP(env)
#define rb_jmp_buf rb_jmpbuf_t
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/