1999-01-20 07:45:32 +03:00
|
|
|
#ifndef EXT_NT_H
|
|
|
|
#define EXT_NT_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 1993, Intergraph Corporation
|
|
|
|
*
|
|
|
|
* You may distribute under the terms of either the GNU General Public
|
|
|
|
* License or the Artistic License, as specified in the perl README file.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2000-05-13 20:13:31 +04:00
|
|
|
#undef EXTERN
|
1999-01-20 07:45:32 +03:00
|
|
|
#if defined(IMPORT)
|
|
|
|
#define EXTERN extern __declspec(dllimport)
|
|
|
|
#elif defined(EXPORT)
|
|
|
|
#define EXTERN extern __declspec(dllexport)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//
|
|
|
|
// Definitions for NT port of Perl
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Ok now we can include the normal include files.
|
|
|
|
//
|
|
|
|
|
|
|
|
// #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
|
|
|
|
#include <windows.h>
|
|
|
|
#include <winsock.h>
|
|
|
|
#undef OpenFile
|
|
|
|
#endif
|
|
|
|
//
|
2001-11-14 21:41:46 +03:00
|
|
|
// We're not using Microsoft's "extensions" to C for
|
1999-01-20 07:45:32 +03:00
|
|
|
// Structured Exception Handling (SEH) so we can nuke these
|
|
|
|
//
|
|
|
|
#undef try
|
|
|
|
#undef except
|
|
|
|
#undef finally
|
|
|
|
#undef leave
|
1999-08-13 09:45:20 +04:00
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
2000-01-05 07:41:21 +03:00
|
|
|
extern "C++" {
|
1999-08-13 09:45:20 +04:00
|
|
|
#endif
|
|
|
|
|
1999-01-20 07:45:32 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <direct.h>
|
|
|
|
#include <process.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <math.h>
|
2002-08-28 06:39:29 +04:00
|
|
|
#include <signal.h>
|
2001-03-21 02:10:05 +03:00
|
|
|
#include <sys/stat.h>
|
1999-01-20 07:45:32 +03:00
|
|
|
#include <sys/types.h>
|
2001-08-07 04:21:40 +04:00
|
|
|
#if !defined(__BORLANDC__)
|
|
|
|
# include <sys/utime.h>
|
|
|
|
#else
|
|
|
|
# include <utime.h>
|
|
|
|
#endif
|
1999-08-13 09:45:20 +04:00
|
|
|
#include <io.h>
|
|
|
|
#include <malloc.h>
|
1999-01-20 07:45:32 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
#if defined(__cplusplus)
|
2000-01-05 07:41:21 +03:00
|
|
|
}
|
1999-08-13 09:45:20 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define UIDTYPE int
|
|
|
|
#define GIDTYPE int
|
|
|
|
#define pid_t int
|
|
|
|
#define WNOHANG -1
|
1999-01-20 07:45:32 +03:00
|
|
|
|
2001-02-17 18:17:10 +03:00
|
|
|
#undef getc
|
|
|
|
#undef putc
|
|
|
|
#undef fgetc
|
|
|
|
#undef fputc
|
|
|
|
#undef getchar
|
|
|
|
#undef putchar
|
|
|
|
#undef fgetchar
|
|
|
|
#undef fputchar
|
2002-05-29 14:22:19 +04:00
|
|
|
#define getc(_stream) rb_w32_getc(_stream)
|
|
|
|
#define putc(_c, _stream) rb_w32_putc(_c, _stream)
|
2001-02-17 18:17:10 +03:00
|
|
|
#define fgetc(_stream) getc(_stream)
|
|
|
|
#define fputc(_c, _stream) putc(_c, _stream)
|
2002-05-29 14:22:19 +04:00
|
|
|
#define getchar() rb_w32_getc(stdin)
|
|
|
|
#define putchar(_c) rb_w32_putc(_c, stdout)
|
2001-02-17 18:17:10 +03:00
|
|
|
#define fgetchar(_stream) getchar()
|
|
|
|
#define fputchar(_c, _stream) putchar(_c)
|
|
|
|
|
2002-06-11 05:27:48 +04:00
|
|
|
#ifndef __BORLANDC__
|
|
|
|
|
1999-01-20 07:45:32 +03:00
|
|
|
#define access _access
|
|
|
|
#define chmod _chmod
|
|
|
|
#define chsize _chsize
|
|
|
|
#define dup _dup
|
|
|
|
#define dup2 _dup2
|
|
|
|
#define isatty _isatty
|
|
|
|
#define open _open
|
|
|
|
#define setmode _setmode
|
|
|
|
#define execl _execl
|
|
|
|
#define execle _execle
|
|
|
|
#define execlp _execlp
|
|
|
|
#define execlpe _execlpe
|
|
|
|
#define execv _execv
|
|
|
|
#define execve _execve
|
|
|
|
#define execvp _execvp
|
|
|
|
#define execvpe _execvpe
|
2002-06-11 05:27:48 +04:00
|
|
|
#define lseek _lseek
|
1999-01-20 07:45:32 +03:00
|
|
|
#define spawnl _spawnl
|
|
|
|
#define spawnle _spawnle
|
|
|
|
#define spawnlp _spawnlp
|
|
|
|
#define spawnlpe _spawnlpe
|
|
|
|
#define spawnv _spawnv
|
|
|
|
#define spawnve _spawnve
|
|
|
|
#define spawnvp _spawnvp
|
|
|
|
#define spawnvpe _spawnvpe
|
|
|
|
#if _MSC_VER < 800
|
|
|
|
#define fileno _fileno
|
|
|
|
#endif
|
2002-06-11 05:27:48 +04:00
|
|
|
#define strcasecmp _stricmp
|
|
|
|
#define strncasecmp _strnicmp
|
|
|
|
#else
|
|
|
|
#define strcasecmp stricmp
|
|
|
|
#define strncasecmp strnicmp
|
|
|
|
#define _open _sopen
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define close _close
|
|
|
|
#define creat _creat
|
|
|
|
#define eof _eof
|
|
|
|
#define filelength _filelength
|
|
|
|
#define locking _locking
|
|
|
|
#define mktemp _mktemp
|
|
|
|
#define perror _perror
|
|
|
|
#define read _read
|
|
|
|
#define sopen _sopen
|
|
|
|
#define tell _tell
|
|
|
|
#define umask _umask
|
|
|
|
#define unlink _unlink
|
|
|
|
#define write _write
|
|
|
|
#define getpid _getpid
|
|
|
|
#define sleep(x) rb_w32_sleep((x)*1000)
|
1999-01-20 07:45:32 +03:00
|
|
|
#define utime _utime
|
1999-08-13 09:45:20 +04:00
|
|
|
#define vsnprintf _vsnprintf
|
|
|
|
#define snprintf _snprintf
|
2001-03-19 06:20:24 +03:00
|
|
|
#undef stat
|
2002-05-29 14:22:19 +04:00
|
|
|
#define stat(path,st) rb_w32_stat(path,st)
|
1999-01-20 07:45:32 +03:00
|
|
|
|
2000-05-13 20:13:31 +04:00
|
|
|
#ifdef __MINGW32__
|
|
|
|
struct timezone {
|
|
|
|
int tz_minuteswest;
|
|
|
|
int tz_dsttime;
|
|
|
|
};
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
extern int NtMakeCmdVector(char *, char ***, int);
|
|
|
|
extern void NtInitialize(int *, char ***);
|
|
|
|
extern char * NtGetLib(void);
|
|
|
|
extern char * NtGetBin(void);
|
2002-06-28 22:26:01 +04:00
|
|
|
extern pid_t pipe_exec(char *, int, FILE **, FILE **);
|
2002-05-29 14:22:19 +04:00
|
|
|
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 **);
|
1999-08-13 09:45:20 +04:00
|
|
|
|
|
|
|
extern int chown(const char *, int, int);
|
|
|
|
extern int link(char *, char *);
|
|
|
|
extern int gettimeofday(struct timeval *, struct timezone *);
|
|
|
|
extern pid_t waitpid (pid_t, int *, int);
|
|
|
|
extern int do_spawn(char *);
|
|
|
|
extern int kill(int, int);
|
2002-06-11 05:27:48 +04:00
|
|
|
#ifndef __BORLANDC__
|
1999-08-13 09:45:20 +04:00
|
|
|
extern int isinf(double);
|
|
|
|
extern int isnan(double);
|
2002-06-11 05:27:48 +04:00
|
|
|
#else
|
|
|
|
#include <float.h>
|
|
|
|
#ifndef isinf
|
|
|
|
#define isinf !_finite
|
|
|
|
#endif
|
|
|
|
#ifndef isnan
|
|
|
|
#define isnan _isnan
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S_ISDIR
|
|
|
|
#undef S_ISDIR
|
|
|
|
#endif
|
1999-08-13 09:45:20 +04:00
|
|
|
|
2002-06-11 05:27:48 +04:00
|
|
|
#ifdef S_ISFIFO
|
|
|
|
#undef S_ISFIFO
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S_ISBLK
|
|
|
|
#undef S_ISBLK
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S_ISCHR
|
|
|
|
#undef S_ISCHR
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S_ISREG
|
|
|
|
#undef S_ISREG
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define S_ISDIR(m) (((unsigned short)(m) & S_IFMT) == S_IFDIR)
|
|
|
|
#define S_ISFIFO(m) (((unsigned short)(m) & S_IFMT) == S_IFIFO)
|
|
|
|
#define S_ISBLK(m) (((unsigned short)(m) & S_IFMT) == S_IFBLK)
|
|
|
|
#define S_ISCHR(m) (((unsigned short)(m) & S_IFMT) == S_IFCHR)
|
|
|
|
#define S_ISREG(m) (((unsigned short)(m) & S_IFMT) == S_IFREG)
|
|
|
|
#endif
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
//
|
|
|
|
// define this so we can do inplace editing
|
|
|
|
//
|
|
|
|
|
|
|
|
#define SUFFIX
|
|
|
|
|
|
|
|
//
|
|
|
|
// stubs
|
|
|
|
//
|
2001-08-07 04:21:40 +04:00
|
|
|
#if !defined(__BORLANDC__)
|
1999-01-20 07:45:32 +03:00
|
|
|
extern int ioctl (int, unsigned int, long);
|
2001-08-07 04:21:40 +04:00
|
|
|
#endif
|
1999-01-20 07:45:32 +03:00
|
|
|
extern UIDTYPE getuid (void);
|
|
|
|
extern UIDTYPE geteuid (void);
|
|
|
|
extern GIDTYPE getgid (void);
|
|
|
|
extern GIDTYPE getegid (void);
|
|
|
|
extern int setuid (int);
|
|
|
|
extern int setgid (int);
|
|
|
|
|
2002-05-29 14:22:19 +04:00
|
|
|
extern char *rb_w32_strerror(int);
|
1999-01-20 07:45:32 +03:00
|
|
|
|
2002-05-29 14:22:19 +04:00
|
|
|
#define strerror(e) rb_w32_strerror(e)
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#define PIPE_BUF 1024
|
|
|
|
|
|
|
|
#define LOCK_SH 1
|
|
|
|
#define LOCK_EX 2
|
|
|
|
#define LOCK_NB 4
|
|
|
|
#define LOCK_UN 8
|
|
|
|
#ifndef EWOULDBLOCK
|
|
|
|
#define EWOULDBLOCK 10035 /* EBASEERR + 35 (winsock.h) */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2002-08-28 06:39:29 +04:00
|
|
|
#ifndef SIGINT
|
|
|
|
#define SIGINT 2
|
|
|
|
#endif
|
|
|
|
#ifndef SIGKILL
|
|
|
|
#define SIGKILL 9
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1999-01-20 07:45:32 +03:00
|
|
|
/* #undef va_start */
|
|
|
|
/* #undef va_end */
|
|
|
|
|
|
|
|
#ifdef accept
|
|
|
|
#undef accept
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define accept rb_w32_accept
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef bind
|
|
|
|
#undef bind
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define bind rb_w32_bind
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef connect
|
|
|
|
#undef connect
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define connect rb_w32_connect
|
1999-01-20 07:45:32 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
#undef FD_SET
|
2002-05-29 14:22:19 +04:00
|
|
|
#define FD_SET rb_w32_fdset
|
1999-08-13 09:45:20 +04:00
|
|
|
|
2000-06-28 12:31:35 +04:00
|
|
|
#undef FD_CLR
|
2002-05-29 14:22:19 +04:00
|
|
|
#define FD_CLR rb_w32_fdclr
|
2000-06-28 12:31:35 +04:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
#undef FD_ISSET
|
2002-05-29 14:22:19 +04:00
|
|
|
#define FD_ISSET rb_w32_fdisset
|
1999-08-13 09:45:20 +04:00
|
|
|
|
|
|
|
#undef select
|
2002-05-29 14:22:19 +04:00
|
|
|
#define select rb_w32_select
|
1999-08-13 09:45:20 +04:00
|
|
|
|
1999-01-20 07:45:32 +03:00
|
|
|
#ifdef getpeername
|
|
|
|
#undef getpeername
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define getpeername rb_w32_getpeername
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef getsockname
|
|
|
|
#undef getsockname
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define getsockname rb_w32_getsockname
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef getsockopt
|
|
|
|
#undef getsockopt
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define getsockopt rb_w32_getsockopt
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef ioctlsocket
|
|
|
|
#undef ioctlsocket
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define ioctlsocket rb_w32_ioctlsocket
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef listen
|
|
|
|
#undef listen
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define listen rb_w32_listen
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef recv
|
|
|
|
#undef recv
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define recv rb_w32_recv
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef recvfrom
|
|
|
|
#undef recvfrom
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define recvfrom rb_w32_recvfrom
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef send
|
|
|
|
#undef send
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define send rb_w32_send
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef sendto
|
|
|
|
#undef sendto
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define sendto rb_w32_sendto
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef setsockopt
|
|
|
|
#undef setsockopt
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define setsockopt rb_w32_setsockopt
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef shutdown
|
|
|
|
#undef shutdown
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define shutdown rb_w32_shutdown
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef socket
|
|
|
|
#undef socket
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define socket rb_w32_socket
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef gethostbyaddr
|
|
|
|
#undef gethostbyaddr
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define gethostbyaddr rb_w32_gethostbyaddr
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef gethostbyname
|
|
|
|
#undef gethostbyname
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define gethostbyname rb_w32_gethostbyname
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef gethostname
|
|
|
|
#undef gethostname
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define gethostname rb_w32_gethostname
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef getprotobyname
|
|
|
|
#undef getprotobyname
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define getprotobyname rb_w32_getprotobyname
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef getprotobynumber
|
|
|
|
#undef getprotobynumber
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define getprotobynumber rb_w32_getprotobynumber
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef getservbyname
|
|
|
|
#undef getservbyname
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define getservbyname rb_w32_getservbyname
|
1999-01-20 07:45:32 +03:00
|
|
|
|
|
|
|
#ifdef getservbyport
|
|
|
|
#undef getservbyport
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define getservbyport rb_w32_getservbyport
|
1999-08-13 09:45:20 +04:00
|
|
|
|
|
|
|
#ifdef get_osfhandle
|
|
|
|
#undef get_osfhandle
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define get_osfhandle rb_w32_get_osfhandle
|
1999-08-13 09:45:20 +04:00
|
|
|
|
2000-02-18 09:59:36 +03:00
|
|
|
#ifdef getcwd
|
|
|
|
#undef getcwd
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define getcwd rb_w32_getcwd
|
2000-02-18 09:59:36 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
#ifdef getenv
|
|
|
|
#undef getenv
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define getenv rb_w32_getenv
|
1999-08-13 09:45:20 +04:00
|
|
|
|
2000-08-09 08:26:06 +04:00
|
|
|
#ifdef rename
|
|
|
|
#undef rename
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define rename rb_w32_rename
|
2000-08-09 08:26:06 +04:00
|
|
|
|
2000-08-15 10:22:49 +04:00
|
|
|
struct tms {
|
|
|
|
long tms_utime;
|
|
|
|
long tms_stime;
|
|
|
|
long tms_cutime;
|
|
|
|
long tms_cstime;
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef times
|
|
|
|
#undef times
|
|
|
|
#endif
|
2002-05-29 14:22:19 +04:00
|
|
|
#define times rb_w32_times
|
2000-08-15 10:22:49 +04:00
|
|
|
|
2000-09-27 13:11:13 +04:00
|
|
|
/* thread stuff */
|
|
|
|
HANDLE GetCurrentThreadHandle(void);
|
2002-05-29 14:22:19 +04:00
|
|
|
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)
|
2000-11-14 10:10:31 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
== ***CAUTION***
|
|
|
|
Since this function is very dangerous, ((*NEVER*))
|
|
|
|
* lock any HANDLEs(i.e. Mutex, Semaphore, CriticalSection and so on) or,
|
|
|
|
* use anything like TRAP_BEG...TRAP_END block structure,
|
|
|
|
in asynchronous_func_t.
|
|
|
|
*/
|
|
|
|
typedef DWORD (*asynchronous_func_t)(DWORD self, int argc, DWORD* argv);
|
2002-05-29 14:22:19 +04:00
|
|
|
DWORD rb_w32_asynchronize(asynchronous_func_t func, DWORD self, int argc, DWORD* argv, DWORD intrval);
|
2000-09-27 13:11:13 +04:00
|
|
|
|
1999-01-20 07:45:32 +03:00
|
|
|
#endif
|