From 6c28f99d8894b9f9a3c1394d120115f69012f2c3 Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 30 Apr 2010 17:56:23 +0000 Subject: * merge some patches from win32-uncode-test branch. see #1685. * file.c, include/ruby/intern.h (rb_str_encode_ospath): new function to convert encoding for pathname. * win32.c, include/ruby/win32.h (rb_w32_ulink, rb_w32_urename, rb_w32_ustati64, rb_w32_uopen, rb_w32_uutime, rb_w32_uchdir, rb_w32_umkdir, rb_w32_urmdir, rb_w32_uunlink): new functions to accept UTF-8 path. * win32/win32.c (rb_w32_opendir, link, rb_w32_stati64, rb_w32_utime, rb_w32_unlink): use WCHAR path internally. * file.c (rb_stat, eaccess, access_internal, rb_file_s_ftype, chmod_internal, rb_file_chmod, rb_file_chown, utime_internal, rb_file_s_link, unlink_internal, rb_file_s_rename): use UTF-8 version functions on Win32. * file.c (apply2files, rb_stat, rb_file_s_lstat, rb_file_symlink_p, rb_file_readable_p, rb_file_writable_p, rb_file_executable_p, check3rdbyte, rb_file_identical_p, rb_file_chmod, rb_file_chown, rb_file_s_link, rb_file_s_symlink, rb_file_s_rename): call rb_str_encode_ospath() before passing the path to system. * io.c (rb_sysopen): ditto. * dir.c (dir_chdir, dir_s_mkdir, dir_s_rmdir): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/win32.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include/ruby/win32.h') diff --git a/include/ruby/win32.h b/include/ruby/win32.h index 8ea3f3b1c4..a71fb97b1e 100644 --- a/include/ruby/win32.h +++ b/include/ruby/win32.h @@ -256,12 +256,15 @@ extern int rb_w32_socketpair(int, int, int, int *); extern char * rb_w32_getcwd(char *, int); extern char * rb_w32_getenv(const char *); extern int rb_w32_rename(const char *, const char *); +extern int rb_w32_urename(const char *, const char *); extern char **rb_w32_get_environ(void); extern void rb_w32_free_environ(char **); extern int rb_w32_map_errno(DWORD); extern int chown(const char *, int, int); +extern int rb_w32_uchown(const char *, int, int); extern int link(const char *, const char *); +extern int rb_w32_ulink(const char *, const char *); extern int gettimeofday(struct timeval *, struct timezone *); extern rb_pid_t waitpid (rb_pid_t, int *, int); extern rb_pid_t rb_w32_spawn(int, const char *, const char*); @@ -274,10 +277,16 @@ extern rb_pid_t rb_w32_getppid(void); extern int rb_w32_isatty(int); #endif extern int rb_w32_mkdir(const char *, int); +extern int rb_w32_umkdir(const char *, int); extern int rb_w32_rmdir(const char *); +extern int rb_w32_urmdir(const char *); extern int rb_w32_unlink(const char *); +extern int rb_w32_uunlink(const char *); +extern int rb_w32_uchmod(const char *, int); extern int rb_w32_stati64(const char *, struct stati64 *); +extern int rb_w32_ustati64(const char *, struct stati64 *); extern int rb_w32_access(const char *, int); +extern int rb_w32_uaccess(const char *, int); #ifdef __BORLANDC__ extern int rb_w32_fstati64(int, struct stati64 *); @@ -627,14 +636,17 @@ HANDLE GetCurrentThreadHandle(void); int rb_w32_sleep(unsigned long msec); int rb_w32_putc(int, FILE*); int rb_w32_getc(FILE*); -int rb_w32_wopen(const WCHAR *, int, ...); int rb_w32_open(const char *, int, ...); +int rb_w32_uopen(const char *, int, ...); +int rb_w32_wopen(const WCHAR *, int, ...); int rb_w32_close(int); int rb_w32_fclose(FILE*); int rb_w32_pipe(int[2]); size_t rb_w32_read(int, void *, size_t); size_t rb_w32_write(int, const void *, size_t); int rb_w32_utime(const char *, const struct utimbuf *); +int rb_w32_uutime(const char *, const struct utimbuf *); +long rb_w32_write_console(unsigned long, int); int WINAPI rb_w32_Sleep(unsigned long msec); int rb_w32_wait_events_blocking(HANDLE *events, int num, DWORD timeout); -- cgit v1.2.3