|
Ruby
2.5.0dev(2017-10-22revision60238)
|
#include "ruby/ruby.h"#include "ruby/encoding.h"#include "ruby/util.h"#include <fcntl.h>#include <process.h>#include <sys/stat.h>#include <stdio.h>#include <stdlib.h>#include <errno.h>#include <assert.h>#include <ctype.h>#include <windows.h>#include <winbase.h>#include <wincon.h>#include <share.h>#include <shlobj.h>#include <mbstring.h>#include <shlwapi.h>#include "ruby/win32.h"#include "win32/dir.h"#include "win32/file.h"#include "internal.h"#include "encindex.h"#include "dln.h"#include "dln_find.c"#include <sys/timeb.h>#include "missing/nextafter.c"Go to the source code of this file.
Data Structures | |
| struct | constat |
| struct | ChildRecord |
| struct | _NtCmdLineElement |
| struct | ioinfo |
| struct | WSAMSG |
| struct | NET_LUID |
| struct | asynchronous_arg_t |
Macros | |
| #define | isdirsep(x) ((x) == '/' || (x) == '\\') |
| #define | DLN_FIND_EXTRA_ARG_DECL ,UINT cp |
| #define | DLN_FIND_EXTRA_ARG ,cp |
| #define | rb_w32_stati64(path, st) w32_stati64(path, st, cp) |
| #define | getenv(name) w32_getenv(name, cp) |
| #define | CharNext(p) CharNextExA(cp, (p), 0) |
| #define | dln_find_exe_r rb_w32_udln_find_exe_r |
| #define | dln_find_file_r rb_w32_udln_find_file_r |
| #define | dln_find_exe_r(fname, path, buf, size) rb_w32_udln_find_exe_r(fname, path, buf, size, cp) |
| #define | dln_find_file_r(fname, path, buf, size) rb_w32_udln_find_file_r(fname, path, buf, size, cp) |
| #define | ENV_MAX 512 |
| #define | enough_to_get(n) (--(n) >= 0) |
| #define | enough_to_put(n) (--(n) >= 0) |
| #define | Debug(something) /* nothing */ |
| #define | TO_SOCKET(x) _get_osfhandle(x) |
| #define | RUBY_CRITICAL if (0) {} else /* just remark */ |
| #define | ERROR_PIPE_LOCAL 229L |
| #define | map_errno rb_w32_map_errno |
| #define | LK_ERR(f, i) |
| #define | LK_LEN ULONG_MAX |
| #define | CSIDL_LOCAL_APPDATA 28 |
| #define | CSIDL_COMMON_APPDATA 35 |
| #define | CSIDL_WINDOWS 36 |
| #define | CSIDL_SYSTEM 37 |
| #define | CSIDL_PROFILE 40 |
| #define | env wk.val |
| #define | set_env_val(vname) |
| #define | conlist_disabled ((st_table *)-1) |
| #define | MAKE_SOCKDATA(af, fl) ((int)((((int)af)<<4)|((fl)&0xFFFF))) |
| #define | GET_FAMILY(v) ((int)(((v)>>4)&0xFFFF)) |
| #define | GET_FLAGS(v) ((int)((v)&0xFFFF)) |
| #define | MAXCHILDNUM 256 /* max num of child processes */ |
| #define | FOREACH_CHILD(v) |
| #define | END_FOREACH_CHILD } while (0) |
| #define | InternalCmdsMax 8 |
| #define | STRNDUPV(ptr, v, src, len) (((char *)memcpy(((ptr) = ALLOCV((v), (len) + 1)), (src), (len)))[len] = 0) |
| #define | filecp rb_w32_filecp |
| #define | mbstr_to_wstr rb_w32_mbstr_to_wstr |
| #define | wstr_to_mbstr rb_w32_wstr_to_mbstr |
| #define | acp_to_wstr(str, plen) mbstr_to_wstr(CP_ACP, str, -1, plen) |
| #define | wstr_to_acp(str, plen) wstr_to_mbstr(CP_ACP, str, -1, plen) |
| #define | filecp_to_wstr(str, plen) mbstr_to_wstr(filecp(), str, -1, plen) |
| #define | wstr_to_filecp(str, plen) wstr_to_mbstr(filecp(), str, -1, plen) |
| #define | utf8_to_wstr(str, plen) mbstr_to_wstr(CP_UTF8, str, -1, plen) |
| #define | wstr_to_utf8(str, plen) wstr_to_mbstr(CP_UTF8, str, -1, plen) |
| #define | NTGLOB 0x1 |
| #define | NTMALLOC 0x2 |
| #define | NTSTRING 0x4 |
| #define | GetBit(bits, i) ((bits)[(i) / CHAR_BIT] & (1 << (i) % CHAR_BIT)) |
| #define | SetBit(bits, i) ((bits)[(i) / CHAR_BIT] |= (1 << (i) % CHAR_BIT)) |
| #define | BitOfIsDir(n) ((n) * 2) |
| #define | BitOfIsRep(n) ((n) * 2 + 1) |
| #define | DIRENT_PER_CHAR (CHAR_BIT / 2) |
| #define | FILE_COUNT(stream) stream->_cnt |
| #define | FILE_READPTR(stream) stream->_ptr |
| #define | FILE_FILENO(stream) stream->_file |
| #define | _CRTIMP __declspec(dllimport) |
| #define | IOINFO_L2E 5 |
| #define | IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) |
| #define | _osfhnd(i) (_pioinfo(i)->osfhnd) |
| #define | _osfile(i) (_pioinfo(i)->osfile) |
| #define | rb_acrt_lowio_lock_fh(i) EnterCriticalSection(&_pioinfo(i)->lock) |
| #define | rb_acrt_lowio_unlock_fh(i) LeaveCriticalSection(&_pioinfo(i)->lock) |
| #define | pioinfo_extra 0 |
| #define | _set_osfhnd(fh, osfh) (void)(_osfhnd(fh) = osfh) |
| #define | _set_osflags(fh, flags) (_osfile(fh) = (flags)) |
| #define | FOPEN 0x01 /* file handle open */ |
| #define | FEOFLAG 0x02 /* end of file has been encountered */ |
| #define | FPIPE 0x08 /* file handle refers to a pipe */ |
| #define | FNOINHERIT 0x10 /* file handle opened O_NOINHERIT */ |
| #define | FAPPEND 0x20 /* file handle opened O_APPEND */ |
| #define | FDEV 0x40 /* file handle refers to device */ |
| #define | FTEXT 0x80 /* file handle is in text mode */ |
| #define | open_null(fd) |
| #define | ROOT_UID 0 |
| #define | ROOT_GID 0 |
| #define | WSAID_WSARECVMSG {0xf689d7c8,0x6f1f,0x436b,{0x8a,0x53,0xe5,0x4f,0xe3,0x51,0xc3,0x22}} |
| #define | WSAID_WSASENDMSG {0xa441e712,0x754f,0x43ca,{0x84,0xa7,0x0d,0xee,0x44,0xcf,0x60,0x6d}} |
| #define | msghdr_to_wsamsg(msg, wsamsg) |
| #define | hex2byte(str) ((isdigit(*(str)) ? *(str) - '0' : toupper(*(str)) - 'A' + 10) << 4 | (isdigit(*((str) + 1)) ? *((str) + 1) - '0' : toupper(*((str) + 1)) - 'A' + 10)) |
| #define | FILE_DEVICE_FILE_SYSTEM 0x00000009 |
| #define | FSCTL_GET_REPARSE_POINT ((0x9<<16)|(42<<2)) |
| #define | IO_REPARSE_TAG_SYMLINK 0xA000000CL |
| #define | SYMBOLIC_LINK_FLAG_DIRECTORY (0x1) |
| #define | COPY_STAT(src, dest, size_cast) |
| #define | yield_once() Sleep(0) |
| #define | yield_until(condition) do yield_once(); while (!(condition)) |
| #define | set_new_std_handle(newfd, handle) |
| #define | set_new_std_fd(newfd) set_new_std_handle(newfd, (HANDLE)rb_w32_get_osfhandle(newfd)) |
| #define | FOREGROUND_MASK (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY) |
| #define | BACKGROUND_MASK (BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY) |
| #define | constat_attr_color_reverse(attr) |
| #define | COMMON_LVB_UNDERSCORE 0x8000 |
| #define | INVALID_SET_FILE_POINTER ((DWORD)-1) |
Typedefs | |
| typedef struct _NtCmdLineElement | NtCmdLineElement |
| typedef DWORD(WINAPI * | get_final_path_func) (HANDLE, WCHAR *, DWORD, DWORD) |
| typedef DWORD(WINAPI * | cigl_t) (const GUID *, NET_LUID *) |
| typedef DWORD(WINAPI * | cilnA_t) (const NET_LUID *, char *, size_t) |
Enumerations | |
| enum | { constat_init = -2, constat_esc = -1, constat_seq = 0 } |
Functions | |
| int | rb_w32_reparse_symlink_p (const WCHAR *path) |
| int | rb_w32_wait_events (HANDLE *events, int num, DWORD timeout) |
| VALUE | rb_w32_conv_from_wchar (const WCHAR *wstr, rb_encoding *enc) |
| int | ruby_brace_glob_with_enc (const char *str, int flags, ruby_glob_func *func, VALUE arg, rb_encoding *enc) |
| int | rb_w32_map_errno (DWORD winerr) |
| DWORD | rb_w32_osver (void) |
| int | flock (int fd, int oper) |
| VALUE | rb_w32_special_folder (int type) |
| UINT | rb_w32_system_tmpdir (WCHAR *path, UINT len) |
| WCHAR * | rb_w32_home_dir (void) |
| void | rb_w32_sysinit (int *argc, char ***argv) |
| char * | getlogin (void) |
| SOCKET | rb_w32_get_osfhandle (int fh) |
| rb_pid_t | rb_w32_spawn (int mode, const char *cmd, const char *prog) |
| rb_pid_t | rb_w32_uspawn (int mode, const char *cmd, const char *prog) |
| rb_pid_t | rb_w32_aspawn_flags (int mode, const char *prog, char *const *argv, DWORD flags) |
| rb_pid_t | rb_w32_uaspawn_flags (int mode, const char *prog, char *const *argv, DWORD flags) |
| rb_pid_t | rb_w32_aspawn (int mode, const char *prog, char *const *argv) |
| rb_pid_t | rb_w32_uaspawn (int mode, const char *prog, char *const *argv) |
| UINT | filecp (void) |
| char * | rb_w32_wstr_to_mbstr (UINT cp, const WCHAR *wstr, int clen, long *plen) |
| WCHAR * | rb_w32_mbstr_to_wstr (UINT cp, const char *str, int clen, long *plen) |
| DIR * | rb_w32_opendir (const char *filename) |
| DIR * | rb_w32_uopendir (const char *filename) |
| char * | rb_w32_conv_from_wstr (const WCHAR *wstr, long *lenp, rb_encoding *enc) |
| struct direct * | rb_w32_readdir (DIR *dirp, rb_encoding *enc) |
| long | rb_w32_telldir (DIR *dirp) |
| void | rb_w32_seekdir (DIR *dirp, long loc) |
| void | rb_w32_rewinddir (DIR *dirp) |
| void | rb_w32_closedir (DIR *dirp) |
| int | rb_w32_io_cancelable_p (int fd) |
| int | rb_w32_is_socket (int fd) |
| char * | rb_w32_strerror (int e) |
| rb_uid_t | getuid (void) |
| rb_uid_t | geteuid (void) |
| rb_gid_t | getgid (void) |
| rb_gid_t | getegid (void) |
| int | setuid (rb_uid_t uid) |
| int | setgid (rb_gid_t gid) |
| int | ioctl (int i, int u,...) |
| void | rb_w32_fdset (int fd, fd_set *set) |
| void | rb_w32_fdclr (int fd, fd_set *set) |
| int | rb_w32_fdisset (int fd, fd_set *set) |
| void | rb_w32_fd_copy (rb_fdset_t *dst, const fd_set *src, int max) |
| void | rb_w32_fd_dup (rb_fdset_t *dst, const rb_fdset_t *src) |
| int | rb_w32_time_subtract (struct timeval *rest, const struct timeval *wait) |
| int | rb_w32_check_interrupt (void *) |
| int | rb_w32_select_with_thread (int nfds, fd_set *rd, fd_set *wr, fd_set *ex, struct timeval *timeout, void *th) |
| int WSAAPI | rb_w32_select (int nfds, fd_set *rd, fd_set *wr, fd_set *ex, struct timeval *timeout) |
| int WSAAPI | rb_w32_accept (int s, struct sockaddr *addr, int *addrlen) |
| int WSAAPI | rb_w32_bind (int s, const struct sockaddr *addr, int addrlen) |
| int WSAAPI | rb_w32_connect (int s, const struct sockaddr *addr, int addrlen) |
| int WSAAPI | rb_w32_getpeername (int s, struct sockaddr *addr, int *addrlen) |
| int WSAAPI | rb_w32_getsockname (int fd, struct sockaddr *addr, int *addrlen) |
| int WSAAPI | rb_w32_getsockopt (int s, int level, int optname, char *optval, int *optlen) |
| int WSAAPI | rb_w32_ioctlsocket (int s, long cmd, u_long *argp) |
| int WSAAPI | rb_w32_listen (int s, int backlog) |
| int WSAAPI | rb_w32_recv (int fd, char *buf, int len, int flags) |
| int WSAAPI | rb_w32_recvfrom (int fd, char *buf, int len, int flags, struct sockaddr *from, int *fromlen) |
| int WSAAPI | rb_w32_send (int fd, const char *buf, int len, int flags) |
| int WSAAPI | rb_w32_sendto (int fd, const char *buf, int len, int flags, const struct sockaddr *to, int tolen) |
| int | recvmsg (int fd, struct msghdr *msg, int flags) |
| int | sendmsg (int fd, const struct msghdr *msg, int flags) |
| int WSAAPI | rb_w32_setsockopt (int s, int level, int optname, const char *optval, int optlen) |
| int WSAAPI | rb_w32_shutdown (int s, int how) |
| int WSAAPI | rb_w32_socket (int af, int type, int protocol) |
| struct hostent *WSAAPI | rb_w32_gethostbyaddr (const char *addr, int len, int type) |
| struct hostent *WSAAPI | rb_w32_gethostbyname (const char *name) |
| int WSAAPI | rb_w32_gethostname (char *name, int len) |
| struct protoent *WSAAPI | rb_w32_getprotobyname (const char *name) |
| struct protoent *WSAAPI | rb_w32_getprotobynumber (int num) |
| struct servent *WSAAPI | rb_w32_getservbyname (const char *name, const char *proto) |
| struct servent *WSAAPI | rb_w32_getservbyport (int port, const char *proto) |
| int | socketpair (int af, int type, int protocol, int *sv) |
| int | getifaddrs (struct ifaddrs **ifap) |
| void | freeifaddrs (struct ifaddrs *ifp) |
| void | endhostent (void) |
| void | endnetent (void) |
| void | endprotoent (void) |
| void | endservent (void) |
| struct netent * | getnetent (void) |
| struct netent * | getnetbyaddr (long net, int type) |
| struct netent * | getnetbyname (const char *name) |
| struct protoent * | getprotoent (void) |
| struct servent * | getservent (void) |
| void | sethostent (int stayopen) |
| void | setnetent (int stayopen) |
| void | setprotoent (int stayopen) |
| void | setservent (int stayopen) |
| int | fcntl (int fd, int cmd,...) |
| int | rb_w32_set_nonblock (int fd) |
| rb_pid_t | waitpid (rb_pid_t pid, int *stat_loc, int options) |
| int __cdecl | gettimeofday (struct timeval *tv, struct timezone *tz) |
| int | clock_gettime (clockid_t clock_id, struct timespec *sp) |
| int | clock_getres (clockid_t clock_id, struct timespec *sp) |
| char * | rb_w32_getcwd (char *buffer, int size) |
| char * | rb_w32_ugetcwd (char *buffer, int size) |
| VALUE | rb_dir_getwd_ospath (void) |
| int | chown (const char *path, int owner, int group) |
| int | rb_w32_uchown (const char *path, int owner, int group) |
| int | lchown (const char *path, int owner, int group) |
| int | rb_w32_ulchown (const char *path, int owner, int group) |
| int | kill (int pid, int sig) |
| int | rb_w32_ulink (const char *from, const char *to) |
| int | link (const char *from, const char *to) |
| int | rb_w32_read_reparse_point (const WCHAR *path, rb_w32_reparse_buffer_t *rp, size_t bufsize, WCHAR **result, DWORD *len) |
| ssize_t | rb_w32_ureadlink (const char *path, char *buf, size_t bufsize) |
| ssize_t | readlink (const char *path, char *buf, size_t bufsize) |
| int | rb_w32_usymlink (const char *src, const char *link) |
| int | symlink (const char *src, const char *link) |
| int | wait (int *status) |
| char * | rb_w32_ugetenv (const char *name) |
| char * | rb_w32_getenv (const char *name) |
| int | rb_w32_urename (const char *from, const char *to) |
| int | rb_w32_rename (const char *from, const char *to) |
| int | rb_w32_fstat (int fd, struct stat *st) |
| int | rb_w32_fstati64 (int fd, struct stati64 *st) |
| int | rb_w32_stat (const char *path, struct stat *st) |
| int | rb_w32_ustati64 (const char *path, struct stati64 *st) |
| int | rb_w32_stati64 (const char *path, struct stati64 *st) |
| int | rb_w32_ulstati64 (const char *path, struct stati64 *st) |
| int | rb_w32_lstati64 (const char *path, struct stati64 *st) |
| int | rb_w32_access (const char *path, int mode) |
| int | rb_w32_uaccess (const char *path, int mode) |
| int | rb_w32_utruncate (const char *path, off_t length) |
| int | rb_w32_truncate (const char *path, off_t length) |
| int | rb_w32_ftruncate (int fd, off_t length) |
| int | rb_w32_times (struct tms *tmbuf) |
| uintptr_t | rb_w32_asynchronize (asynchronous_func_t func, uintptr_t self, int argc, uintptr_t *argv, uintptr_t intrval) |
| char ** | rb_w32_get_environ (void) |
| void | rb_w32_free_environ (char **env) |
| rb_pid_t | rb_w32_getpid (void) |
| rb_pid_t | rb_w32_getppid (void) |
| STATIC_ASSERT (std_handle,(STD_OUTPUT_HANDLE-STD_INPUT_HANDLE)==(STD_ERROR_HANDLE-STD_OUTPUT_HANDLE)) | |
| int | rb_w32_dup2 (int oldfd, int newfd) |
| int | rb_w32_uopen (const char *file, int oflag,...) |
| int | rb_w32_open (const char *file, int oflag,...) |
| int | rb_w32_wopen (const WCHAR *file, int oflag,...) |
| int | rb_w32_fclose (FILE *fp) |
| int | rb_w32_pipe (int fds[2]) |
| int | rb_w32_close (int fd) |
| ssize_t | rb_w32_read (int fd, void *buf, size_t size) |
| ssize_t | rb_w32_write (int fd, const void *buf, size_t size) |
| long | rb_w32_write_console (uintptr_t strarg, int fd) |
| int | rb_w32_uutime (const char *path, const struct utimbuf *times) |
| int | rb_w32_utime (const char *path, const struct utimbuf *times) |
| int | rb_w32_uchdir (const char *path) |
| int | rb_w32_umkdir (const char *path, int mode) |
| int | rb_w32_mkdir (const char *path, int mode) |
| int | rb_w32_rmdir (const char *path) |
| int | rb_w32_urmdir (const char *path) |
| int | rb_w32_uunlink (const char *path) |
| int | rb_w32_unlink (const char *path) |
| int | rb_w32_uchmod (const char *path, int mode) |
| int | fchmod (int fd, int mode) |
| int | rb_w32_isatty (int fd) |
| int | signbit (double x) |
| const char *WSAAPI | rb_w32_inet_ntop (int af, const void *addr, char *numaddr, size_t numaddr_len) |
| int WSAAPI | rb_w32_inet_pton (int af, const char *src, void *dst) |
| char | rb_w32_fd_is_text (int fd) |
| struct tm * | gmtime_r (const time_t *tp, struct tm *rp) |
| struct tm * | localtime_r (const time_t *tp, struct tm *rp) |
| int | rb_w32_wrap_io_handle (HANDLE h, int flags) |
| int | rb_w32_unwrap_io_handle (int fd) |
| int | rb_w32_set_thread_description (HANDLE th, const WCHAR *name) |
| int | rb_w32_set_thread_description_str (HANDLE th, VALUE name) |
Variables | |
| EXTERN_C _CRTIMP ioinfo * | __pioinfo [] |
| VALUE(*const | rb_f_notimplement_ )(int, const VALUE *, VALUE) = rb_f_notimplement |
| #define _osfhnd | ( | i | ) | (_pioinfo(i)->osfhnd) |
Definition at line 2429 of file win32.c.
Referenced by rb_w32_isatty(), and rb_w32_write_console().
| #define _osfile | ( | i | ) | (_pioinfo(i)->osfile) |
Definition at line 2430 of file win32.c.
Referenced by rb_w32_fd_is_text(), rb_w32_read(), and rb_w32_write().
| #define _set_osfhnd | ( | fh, | |
| osfh | |||
| ) | (void)(_osfhnd(fh) = osfh) |
Definition at line 2531 of file win32.c.
Referenced by rb_w32_fclose(), rb_w32_pipe(), and rb_w32_unwrap_io_handle().
| #define _set_osflags | ( | fh, | |
| flags | |||
| ) | (_osfile(fh) = (flags)) |
Definition at line 2532 of file win32.c.
Referenced by rb_w32_pipe(), and rb_w32_read().
| #define acp_to_wstr | ( | str, | |
| plen | |||
| ) | mbstr_to_wstr(CP_ACP, str, -1, plen) |
| #define BACKGROUND_MASK (BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY) |
| #define COMMON_LVB_UNDERSCORE 0x8000 |
| #define constat_attr_color_reverse | ( | attr | ) |
| #define COPY_STAT | ( | src, | |
| dest, | |||
| size_cast | |||
| ) |
Definition at line 5347 of file win32.c.
Referenced by rb_w32_stat().
| #define env wk.val |
Referenced by rb_execarg_init(), rb_vmdebug_proc_dump_raw(), rb_w32_free_environ(), and rb_w32_get_environ().
| #define ERROR_PIPE_LOCAL 229L |
| #define FDEV 0x40 /* file handle refers to device */ |
Definition at line 2539 of file win32.c.
Referenced by rb_w32_write().
| #define FEOFLAG 0x02 /* end of file has been encountered */ |
Definition at line 2535 of file win32.c.
Referenced by rb_w32_read(), and rb_w32_write().
| #define filecp rb_w32_filecp |
Definition at line 1273 of file win32.c.
Referenced by rb_w32_readdir().
| #define filecp_to_wstr | ( | str, | |
| plen | |||
| ) | mbstr_to_wstr(filecp(), str, -1, plen) |
Definition at line 1278 of file win32.c.
Referenced by link(), rb_w32_mkdir(), rb_w32_open(), rb_w32_opendir(), rb_w32_rename(), rb_w32_rmdir(), rb_w32_unlink(), and rb_w32_utime().
| #define FNOINHERIT 0x10 /* file handle opened O_NOINHERIT */ |
Definition at line 2537 of file win32.c.
Referenced by rb_w32_pipe().
| #define FOPEN 0x01 /* file handle open */ |
Definition at line 2534 of file win32.c.
Referenced by rb_w32_pipe().
| #define FOREACH_CHILD | ( | v | ) |
| #define FOREGROUND_MASK (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY) |
| #define FPIPE 0x08 /* file handle refers to a pipe */ |
Definition at line 2536 of file win32.c.
Referenced by rb_w32_pipe(), and rb_w32_write().
| #define FTEXT 0x80 /* file handle is in text mode */ |
Definition at line 2540 of file win32.c.
Referenced by rb_w32_fd_is_text(), rb_w32_read(), and rb_w32_write().
Definition at line 71 of file win32.c.
Referenced by getaddrinfo(), Init_Method(), main(), nl_langinfo_codeset(), and st_init_table_with_size().
| #define hex2byte | ( | str | ) | ((isdigit(*(str)) ? *(str) - '0' : toupper(*(str)) - 'A' + 10) << 4 | (isdigit(*((str) + 1)) ? *((str) + 1) - '0' : toupper(*((str) + 1)) - 'A' + 10)) |
| #define INVALID_SET_FILE_POINTER ((DWORD)-1) |
| #define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) |
| #define LK_ERR | ( | f, | |
| i | |||
| ) |
| #define LK_LEN ULONG_MAX |
Definition at line 341 of file win32.c.
Referenced by rb_w32_close(), rb_w32_fclose(), and rb_w32_unwrap_io_handle().
| #define MAKE_SOCKDATA | ( | af, | |
| fl | |||
| ) | ((int)((((int)af)<<4)|((fl)&0xFFFF))) |
| #define map_errno rb_w32_map_errno |
Definition at line 293 of file win32.c.
Referenced by clock_getres(), clock_gettime(), kill(), rb_w32_fclose(), and rb_w32_pipe().
| #define mbstr_to_wstr rb_w32_mbstr_to_wstr |
| #define msghdr_to_wsamsg | ( | msg, | |
| wsamsg | |||
| ) |
| #define open_null | ( | fd | ) |
| #define rb_acrt_lowio_lock_fh | ( | i | ) | EnterCriticalSection(&_pioinfo(i)->lock) |
Definition at line 2431 of file win32.c.
Referenced by rb_w32_pipe(), rb_w32_read(), and rb_w32_write().
| #define rb_acrt_lowio_unlock_fh | ( | i | ) | LeaveCriticalSection(&_pioinfo(i)->lock) |
Definition at line 2432 of file win32.c.
Referenced by rb_w32_pipe(), rb_w32_read(), and rb_w32_write().
| #define rb_w32_stati64 | ( | path, | |
| st | |||
| ) | w32_stati64(path, st, cp) |
Definition at line 70 of file win32.c.
Referenced by rb_w32_access(), and rb_w32_stat().
| #define ROOT_GID 0 |
| #define ROOT_UID 0 |
| #define RUBY_CRITICAL if (0) {} else /* just remark */ |
Definition at line 130 of file win32.c.
Referenced by kill(), rb_w32_asynchronize(), rb_w32_fdisset(), and rb_w32_pipe().
| #define set_env_val | ( | vname | ) |
| #define set_new_std_fd | ( | newfd | ) | set_new_std_handle(newfd, (HANDLE)rb_w32_get_osfhandle(newfd)) |
Definition at line 6151 of file win32.c.
Referenced by rb_w32_dup2().
| #define set_new_std_handle | ( | newfd, | |
| handle | |||
| ) |
| #define TO_SOCKET | ( | x | ) | _get_osfhandle(x) |
Definition at line 116 of file win32.c.
Referenced by fcntl(), rb_w32_close(), rb_w32_fclose(), rb_w32_fdclr(), rb_w32_fdisset(), rb_w32_io_cancelable_p(), rb_w32_is_socket(), rb_w32_read(), rb_w32_set_nonblock(), rb_w32_unwrap_io_handle(), and rb_w32_write().
| #define utf8_to_wstr | ( | str, | |
| plen | |||
| ) | mbstr_to_wstr(CP_UTF8, str, -1, plen) |
Definition at line 1280 of file win32.c.
Referenced by rb_w32_uchdir(), rb_w32_uchmod(), rb_w32_ulink(), rb_w32_umkdir(), rb_w32_uopen(), rb_w32_uopendir(), rb_w32_urename(), rb_w32_urmdir(), rb_w32_uunlink(), and rb_w32_uutime().
| #define WSAID_WSARECVMSG {0xf689d7c8,0x6f1f,0x436b,{0x8a,0x53,0xe5,0x4f,0xe3,0x51,0xc3,0x22}} |
| #define WSAID_WSASENDMSG {0xa441e712,0x754f,0x43ca,{0x84,0xa7,0x0d,0xee,0x44,0xcf,0x60,0x6d}} |
| #define wstr_to_acp | ( | str, | |
| plen | |||
| ) | wstr_to_mbstr(CP_ACP, str, -1, plen) |
| #define wstr_to_filecp | ( | str, | |
| plen | |||
| ) | wstr_to_mbstr(filecp(), str, -1, plen) |
Definition at line 1279 of file win32.c.
Referenced by rb_w32_conv_from_wstr().
| #define wstr_to_mbstr rb_w32_wstr_to_mbstr |
| #define wstr_to_utf8 | ( | str, | |
| plen | |||
| ) | wstr_to_mbstr(CP_UTF8, str, -1, plen) |
Definition at line 1281 of file win32.c.
Referenced by rb_w32_get_environ().
| #define yield_until | ( | condition | ) | do yield_once(); while (!(condition)) |
| typedef struct _NtCmdLineElement NtCmdLineElement |
| anonymous enum |
Definition at line 4646 of file win32.c.
References CLOCK_MONOTONIC, CLOCK_REALTIME, errno, map_errno, timespec::tv_nsec, and timespec::tv_sec.
Referenced by rb_clock_getres().
Definition at line 4608 of file win32.c.
References CLOCK_MONOTONIC, CLOCK_REALTIME, count, errno, gettimeofday(), map_errno, NULL, timespec::tv_nsec, timeval::tv_sec, timespec::tv_sec, and timeval::tv_usec.
Referenced by rb_timespec_now().
| int fcntl | ( | int | fd, |
| int | cmd, | ||
| ... | |||
| ) |
Definition at line 4297 of file win32.c.
References errno, F_SETFL, is_socket, and TO_SOCKET.
Referenced by dup2(), rb_cloexec_fcntl_dupfd(), rb_io_set_nonblock(), rb_maygvl_fd_fix_cloexec(), and rsock_detect_cloexec().
| void freeifaddrs | ( | struct ifaddrs * | ifp | ) |
Definition at line 4191 of file win32.c.
References ifaddrs::ifa_addr, ifaddrs::ifa_name, ifaddrs::ifa_next, and ruby_xfree().
| rb_gid_t getegid | ( | void | ) |
| rb_uid_t geteuid | ( | void | ) |
| rb_gid_t getgid | ( | void | ) |
| struct netent* getnetbyaddr | ( | long | net, |
| int | type | ||
| ) |
| struct netent* getnetbyname | ( | const char * | name | ) |
Definition at line 4596 of file win32.c.
Referenced by clock_gettime(), rb_clock_gettime(), rb_timespec_now(), and rb_w32_select_with_thread().
| rb_uid_t getuid | ( | void | ) |
| struct tm* gmtime_r | ( | const time_t * | tp, |
| struct tm * | rp | ||
| ) |
| int kill | ( | int | pid, |
| int | sig | ||
| ) |
Definition at line 4925 of file win32.c.
References filecp_to_wstr, free(), and NULL.
Referenced by rb_mark_end_proc(), and rb_set_end_proc().
| struct tm* localtime_r | ( | const time_t * | tp, |
| struct tm * | rp | ||
| ) |
| VALUE rb_dir_getwd_ospath | ( | void | ) |
Definition at line 4748 of file win32.c.
References DATA_PTR, Data_Wrap_Struct, my_getcwd, NULL, OBJ_TAINT, dir_data::path, Qnil, rb_tainted_str_new2, RUBY_DEFAULT_FREE, strlen(), and xfree().
| int WSAAPI rb_w32_accept | ( | int | s, |
| struct sockaddr * | addr, | ||
| int * | addrlen | ||
| ) |
| int rb_w32_access | ( | const char * | path, |
| int | mode | ||
| ) |
Definition at line 5830 of file win32.c.
References errno, and rb_w32_stati64.
Definition at line 1509 of file win32.c.
References rb_w32_aspawn_flags().
Definition at line 1494 of file win32.c.
Referenced by rb_w32_aspawn().
| uintptr_t rb_w32_asynchronize | ( | asynchronous_func_t | func, |
| uintptr_t | self, | ||
| int | argc, | ||
| uintptr_t * | argv, | ||
| uintptr_t | intrval | ||
| ) |
Definition at line 5998 of file win32.c.
References argc, asynchronous_arg_t::argc, argv, asynchronous_arg_t::argv, asynchronous_arg_t::errnum, FALSE, asynchronous_arg_t::func, NULL, RUBY_CRITICAL, asynchronous_arg_t::self, asynchronous_arg_t::stackaddr, and val.
| int WSAAPI rb_w32_bind | ( | int | s, |
| const struct sockaddr * | addr, | ||
| int | addrlen | ||
| ) |
| int rb_w32_check_interrupt | ( | void * | ) |
| int rb_w32_close | ( | int | fd | ) |
| void rb_w32_closedir | ( | DIR * | dirp | ) |
Definition at line 2341 of file win32.c.
References DIR::bits, direct::d_altname, direct::d_name, DIR::dirstr, free(), and DIR::start.
| int WSAAPI rb_w32_connect | ( | int | s, |
| const struct sockaddr * | addr, | ||
| int | addrlen | ||
| ) |
| VALUE rb_w32_conv_from_wchar | ( | const WCHAR * | wstr, |
| rb_encoding * | enc | ||
| ) |
Definition at line 2174 of file win32.c.
References ECONV_UNDEF_REPLACE, ENCINDEX_ASCII, ENCINDEX_US_ASCII, ENCINDEX_UTF_16LE, ENCINDEX_UTF_8, len, NULL, Qnil, rb_enc_from_index(), rb_enc_str_new(), rb_enc_to_index(), rb_long2int, rb_str_conv_enc_opts(), and RSTRING_PTR.
Referenced by rb_w32_conv_from_wstr().
| char* rb_w32_conv_from_wstr | ( | const WCHAR * | wstr, |
| long * | lenp, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 2205 of file win32.c.
References len, malloc, NIL_P, rb_w32_conv_from_wchar(), RSTRING_LEN, RSTRING_PTR, and wstr_to_filecp.
| int rb_w32_dup2 | ( | int | oldfd, |
| int | newfd | ||
| ) |
Definition at line 6155 of file win32.c.
References dup2(), and set_new_std_fd.
| int rb_w32_fclose | ( | FILE * | fp | ) |
| void rb_w32_fd_copy | ( | rb_fdset_t * | dst, |
| const fd_set * | src, | ||
| int | max | ||
| ) |
| void rb_w32_fd_dup | ( | rb_fdset_t * | dst, |
| const rb_fdset_t * | src | ||
| ) |
| char rb_w32_fd_is_text | ( | int | fd | ) |
| void rb_w32_fdclr | ( | int | fd, |
| fd_set * | set | ||
| ) |
| int rb_w32_fdisset | ( | int | fd, |
| fd_set * | set | ||
| ) |
Definition at line 2790 of file win32.c.
References RUBY_CRITICAL, and TO_SOCKET.
| void rb_w32_fdset | ( | int | fd, |
| fd_set * | set | ||
| ) |
| void rb_w32_free_environ | ( | char ** | env | ) |
| int rb_w32_fstat | ( | int | fd, |
| struct stat * | st | ||
| ) |
| int rb_w32_fstati64 | ( | int | fd, |
| struct stati64 * | st | ||
| ) |
| char** rb_w32_get_environ | ( | void | ) |
| SOCKET rb_w32_get_osfhandle | ( | int | fh | ) |
Definition at line 1064 of file win32.c.
Referenced by rb_io_addstr().
| struct hostent* WSAAPI rb_w32_gethostbyaddr | ( | const char * | addr, |
| int | len, | ||
| int | type | ||
| ) |
| struct hostent* WSAAPI rb_w32_gethostbyname | ( | const char * | name | ) |
| int WSAAPI rb_w32_getpeername | ( | int | s, |
| struct sockaddr * | addr, | ||
| int * | addrlen | ||
| ) |
| rb_pid_t rb_w32_getpid | ( | void | ) |
Definition at line 6108 of file win32.c.
Referenced by rb_w32_pipe().
| struct protoent* WSAAPI rb_w32_getprotobyname | ( | const char * | name | ) |
| struct servent* WSAAPI rb_w32_getservbyport | ( | int | port, |
| const char * | proto | ||
| ) |
| int WSAAPI rb_w32_getsockname | ( | int | fd, |
| struct sockaddr * | addr, | ||
| int * | addrlen | ||
| ) |
| int WSAAPI rb_w32_getsockopt | ( | int | s, |
| int | level, | ||
| int | optname, | ||
| char * | optval, | ||
| int * | optlen | ||
| ) |
| WCHAR* rb_w32_home_dir | ( | void | ) |
| int WSAAPI rb_w32_inet_pton | ( | int | af, |
| const char * | src, | ||
| void * | dst | ||
| ) |
| int rb_w32_io_cancelable_p | ( | int | fd | ) |
| int WSAAPI rb_w32_ioctlsocket | ( | int | s, |
| long | cmd, | ||
| u_long * | argp | ||
| ) |
| int rb_w32_is_socket | ( | int | fd | ) |
| int rb_w32_lstati64 | ( | const char * | path, |
| struct stati64 * | st | ||
| ) |
| WCHAR* rb_w32_mbstr_to_wstr | ( | UINT | cp, |
| const char * | str, | ||
| int | clen, | ||
| long * | plen | ||
| ) |
| int rb_w32_mkdir | ( | const char * | path, |
| int | mode | ||
| ) |
Definition at line 7437 of file win32.c.
References filecp_to_wstr, and NULL.
| int rb_w32_open | ( | const char * | file, |
| int | oflag, | ||
| ... | |||
| ) |
Definition at line 6202 of file win32.c.
References filecp_to_wstr, and NULL.
Definition at line 2111 of file win32.c.
References filecp_to_wstr, and NULL.
| int rb_w32_pipe | ( | int | fds[2] | ) |
Definition at line 6433 of file win32.c.
References _set_osfhnd, _set_osflags, err, errno, FALSE, FNOINHERIT, FOPEN, FPIPE, map_errno, name, NULL, rb_acrt_lowio_lock_fh, rb_acrt_lowio_unlock_fh, rb_w32_close(), rb_w32_getpid(), RUBY_CRITICAL, and snprintf.
| ssize_t rb_w32_read | ( | int | fd, |
| void * | buf, | ||
| size_t | size | ||
| ) |
Definition at line 6996 of file win32.c.
References _osfile, _set_osflags, err, FALSE, FEOFLAG, FTEXT, is_socket, len, rb_acrt_lowio_lock_fh, rb_acrt_lowio_unlock_fh, rb_w32_recv(), TO_SOCKET, and wait().
| int rb_w32_read_reparse_point | ( | const WCHAR * | path, |
| rb_w32_reparse_buffer_t * | rp, | ||
| size_t | bufsize, | ||
| WCHAR ** | result, | ||
| DWORD * | len | ||
| ) |
Definition at line 5006 of file win32.c.
Referenced by rb_w32_reparse_symlink_p().
| struct direct* rb_w32_readdir | ( | DIR * | dirp, |
| rb_encoding * | enc | ||
| ) |
Definition at line 2282 of file win32.c.
References ENCINDEX_ASCII, filecp, and rb_enc_to_index().
| int WSAAPI rb_w32_recv | ( | int | fd, |
| char * | buf, | ||
| int | len, | ||
| int | flags | ||
| ) |
Definition at line 3530 of file win32.c.
Referenced by rb_w32_read().
| int WSAAPI rb_w32_recvfrom | ( | int | fd, |
| char * | buf, | ||
| int | len, | ||
| int | flags, | ||
| struct sockaddr * | from, | ||
| int * | fromlen | ||
| ) |
Definition at line 5304 of file win32.c.
References filecp_to_wstr, free(), and NULL.
| int rb_w32_reparse_symlink_p | ( | const WCHAR * | path | ) |
Definition at line 4981 of file win32.c.
References ALLOCV, ALLOCV_END, FALSE, len, rb_w32_read_reparse_point(), rb_w32_reparse_buffer_size, size, and TRUE.
| void rb_w32_rewinddir | ( | DIR * | dirp | ) |
Definition at line 2329 of file win32.c.
References DIR::curr, DIR::loc, and DIR::start.
Referenced by rb_w32_seekdir().
| int rb_w32_rmdir | ( | const char * | path | ) |
Definition at line 7472 of file win32.c.
References filecp_to_wstr, and NULL.
| void rb_w32_seekdir | ( | DIR * | dirp, |
| long | loc | ||
| ) |
Definition at line 2314 of file win32.c.
References DIR::curr, DIR::loc, and rb_w32_rewinddir().
| int WSAAPI rb_w32_select | ( | int | nfds, |
| fd_set * | rd, | ||
| fd_set * | wr, | ||
| fd_set * | ex, | ||
| struct timeval * | timeout | ||
| ) |
Definition at line 3198 of file win32.c.
References rb_w32_select_with_thread().
| int rb_w32_select_with_thread | ( | int | nfds, |
| fd_set * | rd, | ||
| fd_set * | wr, | ||
| fd_set * | ex, | ||
| struct timeval * | timeout, | ||
| void * | th | ||
| ) |
Definition at line 3061 of file win32.c.
References errno, gettimeofday(), NULL, rb_fd_init, timeval::tv_sec, and timeval::tv_usec.
Referenced by rb_w32_select().
| int WSAAPI rb_w32_send | ( | int | fd, |
| const char * | buf, | ||
| int | len, | ||
| int | flags | ||
| ) |
Definition at line 3545 of file win32.c.
Referenced by rb_w32_write().
| int rb_w32_set_nonblock | ( | int | fd | ) |
Definition at line 4374 of file win32.c.
References is_socket, and TO_SOCKET.
Referenced by rb_io_set_nonblock().
| int rb_w32_set_thread_description | ( | HANDLE | th, |
| const WCHAR * | name | ||
| ) |
| int rb_w32_set_thread_description_str | ( | HANDLE | th, |
| VALUE | name | ||
| ) |
| int WSAAPI rb_w32_setsockopt | ( | int | s, |
| int | level, | ||
| int | optname, | ||
| const char * | optval, | ||
| int | optlen | ||
| ) |
| int WSAAPI rb_w32_socket | ( | int | af, |
| int | type, | ||
| int | protocol | ||
| ) |
| VALUE rb_w32_special_folder | ( | int | type | ) |
Definition at line 5683 of file win32.c.
References COPY_STAT, and rb_w32_stati64.
| int rb_w32_stati64 | ( | const char * | path, |
| struct stati64 * | st | ||
| ) |
| char* rb_w32_strerror | ( | int | e | ) |
Definition at line 2651 of file win32.c.
References EADDRINUSE, EWOULDBLOCK, and sys_nerr.
| void rb_w32_sysinit | ( | int * | argc, |
| char *** | argv | ||
| ) |
Definition at line 831 of file win32.c.
Referenced by ruby_sysinit().
Definition at line 3022 of file win32.c.
References timeval::tv_sec, and timeval::tv_usec.
| int rb_w32_times | ( | struct tms * | tmbuf | ) |
Definition at line 5947 of file win32.c.
References tms::tms_utime.
| int rb_w32_uaccess | ( | const char * | path, |
| int | mode | ||
| ) |
Definition at line 5845 of file win32.c.
References errno, and rb_w32_ustati64().
Definition at line 1516 of file win32.c.
References rb_w32_uaspawn_flags().
Definition at line 1502 of file win32.c.
Referenced by rb_w32_uaspawn().
| int rb_w32_uchdir | ( | const char * | path | ) |
Definition at line 7389 of file win32.c.
References free(), NULL, and utf8_to_wstr.
| int rb_w32_uchmod | ( | const char * | path, |
| int | mode | ||
| ) |
Definition at line 7558 of file win32.c.
References free(), NULL, and utf8_to_wstr.
| int rb_w32_uchown | ( | const char * | path, |
| int | owner, | ||
| int | group | ||
| ) |
| int rb_w32_ulchown | ( | const char * | path, |
| int | owner, | ||
| int | group | ||
| ) |
Definition at line 4905 of file win32.c.
References free(), NULL, and utf8_to_wstr.
| int rb_w32_ulstati64 | ( | const char * | path, |
| struct stati64 * | st | ||
| ) |
| int rb_w32_umkdir | ( | const char * | path, |
| int | mode | ||
| ) |
Definition at line 7423 of file win32.c.
References NULL, and utf8_to_wstr.
| int rb_w32_unlink | ( | const char * | path | ) |
Definition at line 7544 of file win32.c.
References filecp_to_wstr, and NULL.
| int rb_w32_unwrap_io_handle | ( | int | fd | ) |
| int rb_w32_uopen | ( | const char * | file, |
| int | oflag, | ||
| ... | |||
| ) |
Definition at line 6168 of file win32.c.
References NULL, and utf8_to_wstr.
Definition at line 2124 of file win32.c.
References NULL, and utf8_to_wstr.
| ssize_t rb_w32_ureadlink | ( | const char * | path, |
| char * | buf, | ||
| size_t | bufsize | ||
| ) |
Definition at line 5285 of file win32.c.
References free(), NULL, and utf8_to_wstr.
| int rb_w32_urmdir | ( | const char * | path | ) |
Definition at line 7486 of file win32.c.
References NULL, and utf8_to_wstr.
| int rb_w32_ustati64 | ( | const char * | path, |
| struct stati64 * | st | ||
| ) |
Definition at line 5774 of file win32.c.
Referenced by rb_w32_uaccess().
Definition at line 7375 of file win32.c.
References filecp_to_wstr, and NULL.
| int rb_w32_uunlink | ( | const char * | path | ) |
Definition at line 7530 of file win32.c.
References NULL, and utf8_to_wstr.
Definition at line 7361 of file win32.c.
References NULL, and utf8_to_wstr.
| int rb_w32_wait_events | ( | HANDLE * | events, |
| int | num, | ||
| DWORD | timeout | ||
| ) |
| int rb_w32_wrap_io_handle | ( | HANDLE | h, |
| int | flags | ||
| ) |
Definition at line 7820 of file win32.c.
References f, and O_NONBLOCK.
| ssize_t rb_w32_write | ( | int | fd, |
| const void * | buf, | ||
| size_t | size | ||
| ) |
| long rb_w32_write_console | ( | uintptr_t | strarg, |
| int | fd | ||
| ) |
| char* rb_w32_wstr_to_mbstr | ( | UINT | cp, |
| const WCHAR * | wstr, | ||
| int | clen, | ||
| long * | plen | ||
| ) |
| ssize_t readlink | ( | const char * | path, |
| char * | buf, | ||
| size_t | bufsize | ||
| ) |
| int ruby_brace_glob_with_enc | ( | const char * | str, |
| int | flags, | ||
| ruby_glob_func * | func, | ||
| VALUE | arg, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 2353 of file dir.c.
References ruby_glob_funcs_t::error, brace_args::flags, brace_args::funcs, GLOB_VERBOSE, ruby_glob_funcs_t::match, NULL, and brace_args::value.
Referenced by ruby_brace_glob().
| int signbit | ( | double | x | ) |
Definition at line 7648 of file win32.c.
Referenced by lgamma_r().
| int socketpair | ( | int | af, |
| int | type, | ||
| int | protocol, | ||
| int * | sv | ||
| ) |
| STATIC_ASSERT | ( | std_handle | , |
| (STD_OUTPUT_HANDLE-STD_INPUT_HANDLE) | = =(STD_ERROR_HANDLE-STD_OUTPUT_HANDLE) |
||
| ) |
| int wait | ( | int * | status | ) |
Definition at line 5160 of file win32.c.
References waitpid().
Referenced by rb_w32_read(), and rb_w32_write().
| rb_pid_t waitpid | ( | rb_pid_t | pid, |
| int * | stat_loc, | ||
| int | options | ||
| ) |
| int err |
Definition at line 135 of file win32.c.
Referenced by kill(), onig_compile_ruby(), onig_new(), ossl_raise(), rb_check_backtrace(), rb_f_exec(), rb_fiber_start(), rb_mutex_unlock(), rb_notify_fd_close(), rb_pipe(), rb_reg_check_preprocess(), rb_reg_match_p(), rb_reg_prepare_re(), rb_set_errinfo(), rb_threadptr_unlock_all_locking_mutexes(), rb_w32_pipe(), rb_w32_read(), rb_w32_write(), reg_enum_key(), reg_get_val(), reg_get_val2(), ruby_close(), ruby_getpeername(), ruby_getsockname(), ruby_shutdown(), and sdbm_prep().
1.8.13