summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--ext/socket/socket.c4
-rw-r--r--hash.c4
-rw-r--r--rubysig.h4
-rw-r--r--signal.c2
-rw-r--r--win32/dir.h20
-rw-r--r--win32/win32.c122
-rw-r--r--win32/win32.h178
8 files changed, 177 insertions, 163 deletions
diff --git a/ChangeLog b/ChangeLog
index afcaef2..0bf8a7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed May 29 18:55:47 2002 KONISHI Hiromasa <H_Konishi@ruby-lang.org>
+
+ * function renames my* and win32_* to rb_w32_* in win32/win32.c
+ fixed files win32/win32.c, win32/win32.h, win32/dir.h,
+ hash.c, rubysig.h, signal.c, ext/socket/socket.c
+
Wed May 29 17:32:55 2002 WATANABE Hirofumi <eban@ruby-lang.org>
* time.c (tmcmp, search_time_t): activate unless HAVE_TIMEGM.
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index f4b59f4..30ddc69 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -169,8 +169,8 @@ sock_finalize(fptr)
if (!fptr->f) return;
s = get_osfhandle(fileno(fptr->f));
- myfdclose(fptr->f);
- if (fptr->f2) myfdclose(fptr->f2);
+ rb_w32_fdclose(fptr->f);
+ if (fptr->f2) rb_w32_fdclose(fptr->f2);
closesocket(s);
}
#endif
diff --git a/hash.c b/hash.c
index af1d832..f6d19ac 100644
--- a/hash.c
+++ b/hash.c
@@ -921,8 +921,8 @@ static int path_tainted = -1;
static char **origenviron;
#ifdef NT
-#define GET_ENVIRON(e) (e = win32_get_environ())
-#define FREE_ENVIRON(e) win32_free_environ(e)
+#define GET_ENVIRON(e) (e = rb_w32_get_environ())
+#define FREE_ENVIRON(e) rb_w32_free_environ(e)
static char **my_environ;
#undef environ
#define environ my_environ
diff --git a/rubysig.h b/rubysig.h
index 9e93296..04c5d56 100644
--- a/rubysig.h
+++ b/rubysig.h
@@ -28,9 +28,9 @@ typedef LONG rb_atomic_t;
ATOMIC_SET(rb_trap_immediate, trap_immediate);\
} while (0)
# define RUBY_CRITICAL(statements) do {\
- win32_enter_critical();\
+ rb_w32_enter_critical();\
statements;\
- win32_leave_critical();\
+ rb_w32_leave_critical();\
} while (0)
#else
typedef int rb_atomic_t;
diff --git a/signal.c b/signal.c
index 3a2c5c6..faf0ba6 100644
--- a/signal.c
+++ b/signal.c
@@ -368,7 +368,7 @@ sighandler(sig)
int sig;
{
#ifdef NT
-#define IN_MAIN_CONTEXT(f, a) (win32_main_context(a, f) ? (void)0 : f(a))
+#define IN_MAIN_CONTEXT(f, a) (rb_w32_main_context(a, f) ? (void)0 : f(a))
#else
#define IN_MAIN_CONTEXT(f, a) f(a)
#endif
diff --git a/win32/dir.h b/win32/dir.h
index 8aa793d..8665fb2 100644
--- a/win32/dir.h
+++ b/win32/dir.h
@@ -12,9 +12,17 @@ typedef struct {
struct direct dirstr;
} DIR;
-DIR* opendir(const char*);
-struct direct* readdir(DIR *);
-long telldir(DIR *);
-void seekdir(DIR *, long);
-void rewinddir(DIR *);
-void closedir(DIR *);
+
+DIR* rb_w32_opendir(const char*);
+struct direct* rb_w32_readdir(DIR *);
+long rb_w32_telldir(DIR *);
+void rb_w32_seekdir(DIR *, long);
+void rb_w32_rewinddir(DIR *);
+void rb_w32_closedir(DIR *);
+
+#define opendir rb_w32_opendir
+#define readdir rb_w32_readdir
+#define telldir rb_w32_telldir
+#define seekdir rb_w32_seekdir
+#define rewinddir rb_w32_rewinddir
+#define closedir rb_w32_closedir
diff --git a/win32/win32.c b/win32/win32.c
index 5d1c451..cd8bcae 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -237,7 +237,7 @@ flock(int fd, int oper)
const asynchronous_func_t locker = flock_winnt;
#endif
- return win32_asynchronize(locker,
+ return rb_w32_asynchronize(locker,
(VALUE)_get_osfhandle(fd), oper, NULL,
(DWORD)-1);
}
@@ -432,7 +432,7 @@ isInternalCmd(char *cmd)
SOCKET
-myget_osfhandle(int fh)
+rb_w32_get_osfhandle(int fh)
{
return _get_osfhandle(fh);
@@ -440,7 +440,7 @@ myget_osfhandle(int fh)
FILE *
-mypopen (char *cmd, char *mode)
+rb_w32_popen (char *cmd, char *mode)
{
FILE *fp;
int reading;
@@ -559,7 +559,7 @@ mypopen (char *cmd, char *mode)
extern VALUE rb_last_status;
int
-mypclose(FILE *fp)
+rb_w32_pclose(FILE *fp)
{
struct ChildRecord *child = FindPipedChildSlot(fp);
@@ -1099,7 +1099,7 @@ NtMakeCmdVector (char *cmdline, char ***vec, int InputCmd)
//
DIR *
-opendir(const char *filename)
+rb_w32_opendir(const char *filename)
{
DIR *p;
long len;
@@ -1114,7 +1114,7 @@ opendir(const char *filename)
// check to see if we've got a directory
//
- if ((win32_stat (filename, &sbuf) < 0 ||
+ if ((rb_w32_stat (filename, &sbuf) < 0 ||
sbuf.st_mode & _S_IFDIR == 0) &&
(!ISALPHA(filename[0]) || filename[1] != ':' || filename[2] != '\0' ||
((1 << (filename[0] & 0x5f) - 'A') & GetLogicalDrives()) == 0)) {
@@ -1196,7 +1196,7 @@ opendir(const char *filename)
//
struct direct *
-readdir(DIR *dirp)
+rb_w32_readdir(DIR *dirp)
{
int len;
static int dummy = 0;
@@ -1236,7 +1236,7 @@ readdir(DIR *dirp)
//
long
-telldir(DIR *dirp)
+rb_w32_telldir(DIR *dirp)
{
return (long) dirp->curr; /* ouch! pointer to long cast */
}
@@ -1246,7 +1246,7 @@ telldir(DIR *dirp)
// (Saved by telldir).
void
-seekdir(DIR *dirp, long loc)
+rb_w32_seekdir(DIR *dirp, long loc)
{
dirp->curr = (char *) loc; /* ouch! long to pointer cast */
}
@@ -1256,7 +1256,7 @@ seekdir(DIR *dirp, long loc)
//
void
-rewinddir(DIR *dirp)
+rb_w32_rewinddir(DIR *dirp)
{
dirp->curr = dirp->start;
}
@@ -1266,7 +1266,7 @@ rewinddir(DIR *dirp)
//
void
-closedir(DIR *dirp)
+rb_w32_closedir(DIR *dirp)
{
free(dirp->start);
free(dirp);
@@ -1358,7 +1358,7 @@ EXTERN_C _CRTIMP ioinfo * __pioinfo[];
#define _set_osfhnd(fh, osfh) (void)(_osfhnd(fh) = osfh)
static int
-my_open_osfhandle(long osfhandle, int flags)
+rb_w32_open_osfhandle(long osfhandle, int flags)
{
int fh;
char fileflags; /* _osfile flags */
@@ -1427,19 +1427,19 @@ is_socket(SOCKET fd)
}
int
-myfddup (int fd)
+rb_w32_fddup (int fd)
{
SOCKET s = TO_SOCKET(fd);
if (s == -1)
return -1;
- return my_open_osfhandle(s, O_RDWR|O_BINARY);
+ return rb_w32_open_osfhandle(s, O_RDWR|O_BINARY);
}
void
-myfdclose(FILE *fp)
+rb_w32_fdclose(FILE *fp)
{
RUBY_CRITICAL({
STHREAD_ONLY(_free_osfhnd(fileno(fp)));
@@ -1456,7 +1456,7 @@ myfdclose(FILE *fp)
#undef strerror
char *
-mystrerror(int e)
+rb_w32_strerror(int e)
{
static char buffer[512];
#if !defined __MINGW32__
@@ -1546,7 +1546,7 @@ ioctl(int i, unsigned int u, long data)
#undef FD_SET
void
-myfdset(int fd, fd_set *set)
+rb_w32_fdset(int fd, fd_set *set)
{
unsigned int i;
SOCKET s = TO_SOCKET(fd);
@@ -1567,7 +1567,7 @@ myfdset(int fd, fd_set *set)
#undef FD_CLR
void
-myfdclr(int fd, fd_set *set)
+rb_w32_fdclr(int fd, fd_set *set)
{
unsigned int i;
SOCKET s = TO_SOCKET(fd);
@@ -1587,7 +1587,7 @@ myfdclr(int fd, fd_set *set)
#undef FD_ISSET
int
-myfdisset(int fd, fd_set *set)
+rb_w32_fdisset(int fd, fd_set *set)
{
return __WSAFDIsSet(TO_SOCKET(fd), set);
}
@@ -1633,7 +1633,7 @@ extract_file_fd(fd_set *set, fd_set *fileset)
}
long
-myselect (int nfds, fd_set *rd, fd_set *wr, fd_set *ex,
+rb_w32_select (int nfds, fd_set *rd, fd_set *wr, fd_set *ex,
struct timeval *timeout)
{
long r;
@@ -1731,7 +1731,7 @@ StartSockets ()
#undef accept
SOCKET
-myaccept (SOCKET s, struct sockaddr *addr, int *addrlen)
+rb_w32_accept (SOCKET s, struct sockaddr *addr, int *addrlen)
{
SOCKET r;
@@ -1741,13 +1741,13 @@ myaccept (SOCKET s, struct sockaddr *addr, int *addrlen)
RUBY_CRITICAL(r = accept (TO_SOCKET(s), addr, addrlen));
if (r == INVALID_SOCKET)
errno = WSAGetLastError();
- return my_open_osfhandle(r, O_RDWR|O_BINARY);
+ return rb_w32_open_osfhandle(r, O_RDWR|O_BINARY);
}
#undef bind
int
-mybind (SOCKET s, struct sockaddr *addr, int addrlen)
+rb_w32_bind (SOCKET s, struct sockaddr *addr, int addrlen)
{
int r;
@@ -1763,7 +1763,7 @@ mybind (SOCKET s, struct sockaddr *addr, int addrlen)
#undef connect
int
-myconnect (SOCKET s, struct sockaddr *addr, int addrlen)
+rb_w32_connect (SOCKET s, struct sockaddr *addr, int addrlen)
{
int r;
if (!NtSocketsInitialized++) {
@@ -1779,7 +1779,7 @@ myconnect (SOCKET s, struct sockaddr *addr, int addrlen)
#undef getpeername
int
-mygetpeername (SOCKET s, struct sockaddr *addr, int *addrlen)
+rb_w32_getpeername (SOCKET s, struct sockaddr *addr, int *addrlen)
{
int r;
if (!NtSocketsInitialized++) {
@@ -1794,7 +1794,7 @@ mygetpeername (SOCKET s, struct sockaddr *addr, int *addrlen)
#undef getsockname
int
-mygetsockname (SOCKET s, struct sockaddr *addr, int *addrlen)
+rb_w32_getsockname (SOCKET s, struct sockaddr *addr, int *addrlen)
{
int r;
if (!NtSocketsInitialized++) {
@@ -1807,7 +1807,7 @@ mygetsockname (SOCKET s, struct sockaddr *addr, int *addrlen)
}
int
-mygetsockopt (SOCKET s, int level, int optname, char *optval, int *optlen)
+rb_w32_getsockopt (SOCKET s, int level, int optname, char *optval, int *optlen)
{
int r;
if (!NtSocketsInitialized++) {
@@ -1822,7 +1822,7 @@ mygetsockopt (SOCKET s, int level, int optname, char *optval, int *optlen)
#undef ioctlsocket
int
-myioctlsocket (SOCKET s, long cmd, u_long *argp)
+rb_w32_ioctlsocket (SOCKET s, long cmd, u_long *argp)
{
int r;
if (!NtSocketsInitialized++) {
@@ -1837,7 +1837,7 @@ myioctlsocket (SOCKET s, long cmd, u_long *argp)
#undef listen
int
-mylisten (SOCKET s, int backlog)
+rb_w32_listen (SOCKET s, int backlog)
{
int r;
if (!NtSocketsInitialized++) {
@@ -1852,7 +1852,7 @@ mylisten (SOCKET s, int backlog)
#undef recv
int
-myrecv (SOCKET s, char *buf, int len, int flags)
+rb_w32_recv (SOCKET s, char *buf, int len, int flags)
{
int r;
if (!NtSocketsInitialized++) {
@@ -1867,7 +1867,7 @@ myrecv (SOCKET s, char *buf, int len, int flags)
#undef recvfrom
int
-myrecvfrom (SOCKET s, char *buf, int len, int flags,
+rb_w32_recvfrom (SOCKET s, char *buf, int len, int flags,
struct sockaddr *from, int *fromlen)
{
int r;
@@ -1883,7 +1883,7 @@ myrecvfrom (SOCKET s, char *buf, int len, int flags,
#undef send
int
-mysend (SOCKET s, char *buf, int len, int flags)
+rb_w32_send (SOCKET s, char *buf, int len, int flags)
{
int r;
if (!NtSocketsInitialized++) {
@@ -1898,7 +1898,7 @@ mysend (SOCKET s, char *buf, int len, int flags)
#undef sendto
int
-mysendto (SOCKET s, char *buf, int len, int flags,
+rb_w32_sendto (SOCKET s, char *buf, int len, int flags,
struct sockaddr *to, int tolen)
{
int r;
@@ -1914,7 +1914,7 @@ mysendto (SOCKET s, char *buf, int len, int flags,
#undef setsockopt
int
-mysetsockopt (SOCKET s, int level, int optname, char *optval, int optlen)
+rb_w32_setsockopt (SOCKET s, int level, int optname, char *optval, int optlen)
{
int r;
if (!NtSocketsInitialized++) {
@@ -1929,7 +1929,7 @@ mysetsockopt (SOCKET s, int level, int optname, char *optval, int optlen)
#undef shutdown
int
-myshutdown (SOCKET s, int how)
+rb_w32_shutdown (SOCKET s, int how)
{
int r;
if (!NtSocketsInitialized++) {
@@ -1944,7 +1944,7 @@ myshutdown (SOCKET s, int how)
#undef socket
SOCKET
-mysocket (int af, int type, int protocol)
+rb_w32_socket (int af, int type, int protocol)
{
SOCKET s;
if (!NtSocketsInitialized++) {
@@ -1955,13 +1955,13 @@ mysocket (int af, int type, int protocol)
errno = WSAGetLastError();
//fprintf(stderr, "socket fail (%d)", WSAGetLastError());
}
- return my_open_osfhandle(s, O_RDWR|O_BINARY);
+ return rb_w32_open_osfhandle(s, O_RDWR|O_BINARY);
}
#undef gethostbyaddr
struct hostent *
-mygethostbyaddr (char *addr, int len, int type)
+rb_w32_gethostbyaddr (char *addr, int len, int type)
{
struct hostent *r;
if (!NtSocketsInitialized++) {
@@ -1976,7 +1976,7 @@ mygethostbyaddr (char *addr, int len, int type)
#undef gethostbyname
struct hostent *
-mygethostbyname (char *name)
+rb_w32_gethostbyname (char *name)
{
struct hostent *r;
if (!NtSocketsInitialized++) {
@@ -1991,7 +1991,7 @@ mygethostbyname (char *name)
#undef gethostname
int
-mygethostname (char *name, int len)
+rb_w32_gethostname (char *name, int len)
{
int r;
if (!NtSocketsInitialized++) {
@@ -2006,7 +2006,7 @@ mygethostname (char *name, int len)
#undef getprotobyname
struct protoent *
-mygetprotobyname (char *name)
+rb_w32_getprotobyname (char *name)
{
struct protoent *r;
if (!NtSocketsInitialized++) {
@@ -2021,7 +2021,7 @@ mygetprotobyname (char *name)
#undef getprotobynumber
struct protoent *
-mygetprotobynumber (int num)
+rb_w32_getprotobynumber (int num)
{
struct protoent *r;
if (!NtSocketsInitialized++) {
@@ -2036,7 +2036,7 @@ mygetprotobynumber (int num)
#undef getservbyname
struct servent *
-mygetservbyname (char *name, char *proto)
+rb_w32_getservbyname (char *name, char *proto)
{
struct servent *r;
if (!NtSocketsInitialized++) {
@@ -2051,7 +2051,7 @@ mygetservbyname (char *name, char *proto)
#undef getservbyport
struct servent *
-mygetservbyport (int port, char *proto)
+rb_w32_getservbyport (int port, char *proto)
{
struct servent *r;
if (!NtSocketsInitialized++) {
@@ -2204,7 +2204,7 @@ gettimeofday(struct timeval *tv, struct timezone *tz)
}
char *
-win32_getcwd(buffer, size)
+rb_w32_getcwd(buffer, size)
char *buffer;
int size;
{
@@ -2314,7 +2314,7 @@ wait()
}
char *
-win32_getenv(const char *name)
+rb_w32_getenv(const char *name)
{
static char *curitem = NULL;
static DWORD curlen = 0;
@@ -2341,7 +2341,7 @@ win32_getenv(const char *name)
}
int
-myrename(const char *oldpath, const char *newpath)
+rb_w32_rename(const char *oldpath, const char *newpath)
{
int res = 0;
int oldatts;
@@ -2413,7 +2413,7 @@ isUNCRoot(const char *path)
}
int
-win32_stat(const char *path, struct stat *st)
+rb_w32_stat(const char *path, struct stat *st)
{
const char *p;
char *buf1 = ALLOCA_N(char, strlen(path) + 1);
@@ -2452,7 +2452,7 @@ filetime_to_clock(FILETIME *ft)
}
int
-mytimes(struct tms *tmbuf)
+rb_w32_times(struct tms *tmbuf)
{
FILETIME create, exit, kernel, user;
@@ -2511,7 +2511,7 @@ static CRITICAL_SECTION* system_state(void)
static LONG flag_interrupt = -1;
static volatile DWORD tlsi_interrupt = TLS_OUT_OF_INDEXES;
-void win32_enter_critical(void)
+void rb_w32_enter_critical(void)
{
if (IsWinNT()) {
EnterCriticalSection(system_state());
@@ -2532,7 +2532,7 @@ void win32_enter_critical(void)
}
}
-void win32_leave_critical(void)
+void rb_w32_leave_critical(void)
{
if (IsWinNT()) {
LeaveCriticalSection(system_state());
@@ -2551,7 +2551,7 @@ struct handler_arg_t {
HANDLE handshake;
};
-static void win32_call_handler(struct handler_arg_t* h)
+static void rb_w32_call_handler(struct handler_arg_t* h)
{
int status;
RUBY_CRITICAL(rb_protect((VALUE (*)(VALUE))h->handler, (VALUE)h->arg, &h->status);
@@ -2584,13 +2584,13 @@ static void setup_call(CONTEXT* ctx, struct handler_arg_t *harg)
*--esp = (DWORD)harg;
*--esp = ctx->Eip;
ctx->Esp = (DWORD)esp;
- ctx->Eip = (DWORD)win32_call_handler;
+ ctx->Eip = (DWORD)rb_w32_call_handler;
#else
#error unsupported processor
#endif
}
-int win32_main_context(int arg, void (*handler)(int))
+int rb_w32_main_context(int arg, void (*handler)(int))
{
static HANDLE interrupt_done = NULL;
struct handler_arg_t harg;
@@ -2651,7 +2651,7 @@ int win32_main_context(int arg, void (*handler)(int))
return TRUE;
}
-int win32_sleep(unsigned long msec)
+int rb_w32_sleep(unsigned long msec)
{
DWORD ret;
RUBY_CRITICAL(ret = wait_events(NULL, msec));
@@ -2668,7 +2668,7 @@ static void catch_interrupt(void)
}
#undef fgetc
-int win32_getc(FILE* stream)
+int rb_w32_getc(FILE* stream)
{
int c, trap_immediate = rb_trap_immediate;
if (--stream->_cnt >= 0) {
@@ -2684,7 +2684,7 @@ int win32_getc(FILE* stream)
}
#undef fputc
-int win32_putc(int c, FILE* stream)
+int rb_w32_putc(int c, FILE* stream)
{
int trap_immediate = rb_trap_immediate;
if (--stream->_cnt >= 0) {
@@ -2718,7 +2718,7 @@ call_asynchronous(PVOID argp)
return (DWORD)arg->func(arg->self, arg->argc, arg->argv);
}
-VALUE win32_asynchronize(asynchronous_func_t func,
+VALUE rb_w32_asynchronize(asynchronous_func_t func,
VALUE self, int argc, VALUE* argv, VALUE intrval)
{
DWORD val;
@@ -2779,7 +2779,7 @@ VALUE win32_asynchronize(asynchronous_func_t func,
return val;
}
-char **win32_get_environ(void)
+char **rb_w32_get_environ(void)
{
char *envtop, *env;
char **myenvtop, **myenv;
@@ -2788,7 +2788,7 @@ char **win32_get_environ(void)
/*
* We avoid values started with `='. If you want to deal those values,
* change this function, and some functions in hash.c which recognize
- * `=' as delimiter or win32_getenv() and ruby_setenv().
+ * `=' as delimiter or rb_w32_getenv() and ruby_setenv().
* CygWin deals these values by changing first `=' to '!'. But we don't
* use such trick and follow cmd.exe's way that just doesn't show these
* values.
@@ -2812,7 +2812,7 @@ char **win32_get_environ(void)
return myenvtop;
}
-void win32_free_environ(char **env)
+void rb_w32_free_environ(char **env)
{
char **t = env;
diff --git a/win32/win32.h b/win32/win32.h
index 6dda865..b2be020 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -80,12 +80,12 @@ extern "C++" {
#undef putchar
#undef fgetchar
#undef fputchar
-#define getc(_stream) win32_getc(_stream)
-#define putc(_c, _stream) win32_putc(_c, _stream)
+#define getc(_stream) rb_w32_getc(_stream)
+#define putc(_c, _stream) rb_w32_putc(_c, _stream)
#define fgetc(_stream) getc(_stream)
#define fputc(_c, _stream) putc(_c, _stream)
-#define getchar() win32_getc(stdin)
-#define putchar(_c) win32_putc(_c, stdout)
+#define getchar() rb_w32_getc(stdin)
+#define putchar(_c) rb_w32_putc(_c, stdout)
#define fgetchar(_stream) getchar()
#define fputchar(_c, _stream) putchar(_c)
@@ -120,7 +120,7 @@ extern "C++" {
#define execvp _execvp
#define execvpe _execvpe
#define getpid _getpid
-#define sleep(x) win32_sleep((x)*1000)
+#define sleep(x) rb_w32_sleep((x)*1000)
#define spawnl _spawnl
#define spawnle _spawnle
#define spawnlp _spawnlp
@@ -140,7 +140,7 @@ extern "C++" {
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#undef stat
-#define stat(path,st) win32_stat(path,st)
+#define stat(path,st) rb_w32_stat(path,st)
/* these are defined in nt.c */
#ifdef __MINGW32__
@@ -149,46 +149,46 @@ struct timezone {
int tz_dsttime;
};
#endif
-extern int NtMakeCmdVector(char *, char ***, int);
-extern void NtInitialize(int *, char ***);
-extern char *NtGetLib(void);
-extern char *NtGetBin(void);
-extern FILE *mypopen(char *, char *);
-extern int mypclose(FILE *);
-extern int flock(int fd, int oper);
-extern int myfddup(int);
-extern void myfdclose(FILE *);
-extern SOCKET myaccept(SOCKET, struct sockaddr *, int *);
-extern int mybind(SOCKET, struct sockaddr *, int);
-extern int myconnect(SOCKET, struct sockaddr *, int);
-extern void myfdset(int, fd_set*);
-extern void myfdclr(int, fd_set*);
-extern int myfdisset(int, fd_set*);
-extern long myselect(int, fd_set *, fd_set *, fd_set *, struct timeval *);
-extern int mygetpeername(SOCKET, struct sockaddr *, int *);
-extern int mygetsockname(SOCKET, struct sockaddr *, int *);
-extern int mygetsockopt(SOCKET, int, int, char *, int *);
-extern int myioctlsocket(SOCKET, long, u_long *);
-extern int mylisten(SOCKET, int);
-extern int myrecv(SOCKET, char *, int, int);
-extern int myrecvfrom(SOCKET, char *, int, int, struct sockaddr *, int *);
-extern int mysend(SOCKET, char *, int, int);
-extern int mysendto(SOCKET, char *, int, int, struct sockaddr *, int);
-extern int mysetsockopt(SOCKET, int, int, char *, int);
-extern int myshutdown(SOCKET, int);
-extern SOCKET mysocket(int, int, int);
-extern SOCKET myget_osfhandle(int);
-extern struct hostent * mygethostbyaddr(char *, int, int);
-extern struct hostent * mygethostbyname(char *);
-extern int mygethostname(char *, int);
-extern struct protoent * mygetprotobyname(char *);
-extern struct protoent * mygetprotobynumber(int);
-extern struct servent * mygetservbyname(char *, char *);
-extern struct servent * mygetservbyport(int, char *);
-extern char *win32_getenv(const char *);
-extern int myrename(const char *, const char *);
-extern char **win32_get_environ(void);
-extern void win32_free_environ(char **);
+extern int NtMakeCmdVector(char *, char ***, int);
+extern void NtInitialize(int *, char ***);
+extern char * NtGetLib(void);
+extern char * NtGetBin(void);
+extern FILE * rb_w32_popen(char *, char *);
+extern int rb_w32_pclose(FILE *);
+extern int flock(int fd, int oper);
+extern int rb_w32_fddup(int);
+extern void rb_w32_fdclose(FILE *);
+extern SOCKET rb_w32_accept(SOCKET, struct sockaddr *, int *);
+extern int rb_w32_bind(SOCKET, struct sockaddr *, int);
+extern int rb_w32_connect(SOCKET, struct sockaddr *, int);
+extern void rb_w32_fdset(int, fd_set*);
+extern void rb_w32_fdclr(int, fd_set*);
+extern int rb_w32_fdisset(int, fd_set*);
+extern long rb_w32_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+extern int rb_w32_getpeername(SOCKET, struct sockaddr *, int *);
+extern int rb_w32_getsockname(SOCKET, struct sockaddr *, int *);
+extern int rb_w32_getsockopt(SOCKET, int, int, char *, int *);
+extern int rb_w32_ioctlsocket(SOCKET, long, u_long *);
+extern int rb_w32_listen(SOCKET, int);
+extern int rb_w32_recv(SOCKET, char *, int, int);
+extern int rb_w32_recvfrom(SOCKET, char *, int, int, struct sockaddr *, int *);
+extern int rb_w32_send(SOCKET, char *, int, int);
+extern int rb_w32_sendto(SOCKET, char *, int, int, struct sockaddr *, int);
+extern int rb_w32_setsockopt(SOCKET, int, int, char *, int);
+extern int rb_w32_shutdown(SOCKET, int);
+extern SOCKET rb_w32_socket(int, int, int);
+extern SOCKET rb_w32_get_osfhandle(int);
+extern struct hostent * rb_w32_gethostbyaddr(char *, int, int);
+extern struct hostent * rb_w32_gethostbyname(char *);
+extern int rb_w32_gethostname(char *, int);
+extern struct protoent * rb_w32_getprotobyname(char *);
+extern struct protoent * rb_w32_getprotobynumber(int);
+extern struct servent * rb_w32_getservbyname(char *, char *);
+extern struct servent * rb_w32_getservbyport(int, char *);
+extern char * rb_w32_getenv(const char *);
+extern int rb_w32_rename(const char *, const char *);
+extern char **rb_w32_get_environ(void);
+extern void rb_w32_free_environ(char **);
extern int chown(const char *, int, int);
extern int link(char *, char *);
@@ -219,9 +219,9 @@ extern GIDTYPE getegid (void);
extern int setuid (int);
extern int setgid (int);
-extern char *mystrerror(int);
+extern char *rb_w32_strerror(int);
-#define strerror(e) mystrerror(e)
+#define strerror(e) rb_w32_strerror(e)
#define PIPE_BUF 1024
@@ -235,11 +235,11 @@ extern char *mystrerror(int);
#ifdef popen
#undef popen
-#define popen mypopen
+#define popen rb_w32_popen
#endif
#ifdef pclose
#undef pclose
-#define pclose mypclose
+#define pclose rb_w32_pclose
#endif
/* #undef va_start */
@@ -248,144 +248,144 @@ extern char *mystrerror(int);
#ifdef accept
#undef accept
#endif
-#define accept myaccept
+#define accept rb_w32_accept
#ifdef bind
#undef bind
#endif
-#define bind mybind
+#define bind rb_w32_bind
#ifdef connect
#undef connect
#endif
-#define connect myconnect
+#define connect rb_w32_connect
#undef FD_SET
-#define FD_SET myfdset
+#define FD_SET rb_w32_fdset
#undef FD_CLR
-#define FD_CLR myfdclr
+#define FD_CLR rb_w32_fdclr
#undef FD_ISSET
-#define FD_ISSET myfdisset
+#define FD_ISSET rb_w32_fdisset
#undef select
-#define select myselect
+#define select rb_w32_select
#ifdef getpeername
#undef getpeername
#endif
-#define getpeername mygetpeername
+#define getpeername rb_w32_getpeername
#ifdef getsockname
#undef getsockname
#endif
-#define getsockname mygetsockname
+#define getsockname rb_w32_getsockname
#ifdef getsockopt
#undef getsockopt
#endif
-#define getsockopt mygetsockopt
+#define getsockopt rb_w32_getsockopt
#ifdef ioctlsocket
#undef ioctlsocket
#endif
-#define ioctlsocket myioctlsocket
+#define ioctlsocket rb_w32_ioctlsocket
#ifdef listen
#undef listen
#endif
-#define listen mylisten
+#define listen rb_w32_listen
#ifdef recv
#undef recv
#endif
-#define recv myrecv
+#define recv rb_w32_recv
#ifdef recvfrom
#undef recvfrom
#endif
-#define recvfrom myrecvfrom
+#define recvfrom rb_w32_recvfrom
#ifdef send
#undef send
#endif
-#define send mysend
+#define send rb_w32_send
#ifdef sendto
#undef sendto
#endif
-#define sendto mysendto
+#define sendto rb_w32_sendto
#ifdef setsockopt
#undef setsockopt
#endif
-#define setsockopt mysetsockopt
+#define setsockopt rb_w32_setsockopt
#ifdef shutdown
#undef shutdown
#endif
-#define shutdown myshutdown
+#define shutdown rb_w32_shutdown
#ifdef socket
#undef socket
#endif
-#define socket mysocket
+#define socket rb_w32_socket
#ifdef gethostbyaddr
#undef gethostbyaddr
#endif
-#define gethostbyaddr mygethostbyaddr
+#define gethostbyaddr rb_w32_gethostbyaddr
#ifdef gethostbyname
#undef gethostbyname
#endif
-#define gethostbyname mygethostbyname
+#define gethostbyname rb_w32_gethostbyname
#ifdef gethostname
#undef gethostname
#endif
-#define gethostname mygethostname
+#define gethostname rb_w32_gethostname
#ifdef getprotobyname
#undef getprotobyname
#endif
-#define getprotobyname mygetprotobyname
+#define getprotobyname rb_w32_getprotobyname
#ifdef getprotobynumber
#undef getprotobynumber
#endif
-#define getprotobynumber mygetprotobynumber
+#define getprotobynumber rb_w32_getprotobynumber
#ifdef getservbyname
#undef getservbyname
#endif
-#define getservbyname mygetservbyname
+#define getservbyname rb_w32_getservbyname
#ifdef getservbyport
#undef getservbyport
#endif
-#define getservbyport mygetservbyport
+#define getservbyport rb_w32_getservbyport
#ifdef get_osfhandle
#undef get_osfhandle
#endif
-#define get_osfhandle myget_osfhandle
+#define get_osfhandle rb_w32_get_osfhandle
#ifdef getcwd
#undef getcwd
#endif
-#define getcwd win32_getcwd
+#define getcwd rb_w32_getcwd
#ifdef getenv
#undef getenv
#endif
-#define getenv win32_getenv
+#define getenv rb_w32_getenv
#ifdef rename
#undef rename
#endif
-#define rename myrename
+#define rename rb_w32_rename
struct tms {
long tms_utime;
@@ -397,17 +397,17 @@ struct tms {
#ifdef times
#undef times
#endif
-#define times mytimes
+#define times rb_w32_times
/* thread stuff */
HANDLE GetCurrentThreadHandle(void);
-int win32_main_context(int arg, void (*handler)(int));
-int win32_sleep(unsigned long msec);
-void win32_enter_critical(void);
-void win32_leave_critical(void);
-int win32_putc(int, FILE*);
-int win32_getc(FILE*);
-#define Sleep(msec) (void)win32_sleep(msec)
+int rb_w32_main_context(int arg, void (*handler)(int));
+int rb_w32_sleep(unsigned long msec);
+void rb_w32_enter_critical(void);
+void rb_w32_leave_critical(void);
+int rb_w32_putc(int, FILE*);
+int rb_w32_getc(FILE*);
+#define Sleep(msec) (void)rb_w32_sleep(msec)
/*
== ***CAUTION***
@@ -417,6 +417,6 @@ Since this function is very dangerous, ((*NEVER*))
in asynchronous_func_t.
*/
typedef DWORD (*asynchronous_func_t)(DWORD self, int argc, DWORD* argv);
-DWORD win32_asynchronize(asynchronous_func_t func, DWORD self, int argc, DWORD* argv, DWORD intrval);
+DWORD rb_w32_asynchronize(asynchronous_func_t func, DWORD self, int argc, DWORD* argv, DWORD intrval);
#endif