diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-04 13:48:20 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-04 13:48:20 +0000 |
commit | a8c3540b32d7621c183627d7cc198f4b24798387 (patch) | |
tree | 602e5c4e6a866436cf999e994d4590df9c89fb2a /wince/sys | |
parent | 642e08187927b2debaa0d84a112123043f0f7912 (diff) | |
download | ruby-a8c3540b32d7621c183627d7cc198f4b24798387.tar.gz |
* dln.c: Ruby no longer supports Windows CE.
* eval.c: ditto.
* include/ruby/defines.h: ditto.
* include/ruby/win32.h: ditto.
* ruby.c: ditto.
* strftime.c: ditto.
* win32/Makefile.sub: ditto.
* win32/win32.c: ditto.
* ext/tk/extconf.rb: ditto.
* lib/fileutils.rb: ditto.
* test/fileutils/test_fileutils.rb: ditto.
* wince/*: removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'wince/sys')
-rw-r--r-- | wince/sys/stat.c | 102 | ||||
-rw-r--r-- | wince/sys/stat.h | 68 | ||||
-rw-r--r-- | wince/sys/timeb.c | 25 | ||||
-rw-r--r-- | wince/sys/timeb.h | 26 | ||||
-rw-r--r-- | wince/sys/types.h | 60 | ||||
-rw-r--r-- | wince/sys/utime.c | 44 | ||||
-rw-r--r-- | wince/sys/utime.h | 27 |
7 files changed, 0 insertions, 352 deletions
diff --git a/wince/sys/stat.c b/wince/sys/stat.c deleted file mode 100644 index 5d51dbf426..0000000000 --- a/wince/sys/stat.c +++ /dev/null @@ -1,102 +0,0 @@ -/*************************************************************** - stat.c - - author : uema2 - date : Nov 30, 2002 - - You can freely use, copy, modify, and redistribute - the whole contents. -***************************************************************/ - -#include <windows.h> -#include <sys/stat.h> -#include <time.h> -#include "..\wince.h" /* for wce_mbtowc */ - - -int _stat(const char *filename, struct _stat *st) -{ - DWORD dwAttribute; - HANDLE h; - DWORD dwSizeLow=0, dwSizeHigh=0, dwError=0; - WIN32_FIND_DATAW fd; - wchar_t *wfilename; - -// wfilename = wce_mbtowc(filename); - wfilename = wce_replaceRelativeDir(filename); - - dwAttribute = GetFileAttributesW(wfilename); - if(dwAttribute==0xFFFFFFFF) - { - free(wfilename); - return -1; - } - - st->st_mode = 0; - if((dwAttribute & FILE_ATTRIBUTE_DIRECTORY) != 0) - st->st_mode += S_IFDIR; - else - st->st_mode += S_IFREG; - - /* initialize */ - st->st_atime = 0; - st->st_mtime = 0; - st->st_ctime = 0; - st->st_size = 0; - st->st_dev = 0; - - h = FindFirstFileW(wfilename, &fd); - if(h == INVALID_HANDLE_VALUE) - { - if(wfilename[wcslen(wfilename)-1] == L'\\') - { - wfilename[wcslen(wfilename)-1] = L'\0'; - h = FindFirstFileW(wfilename, &fd); - if(h == INVALID_HANDLE_VALUE) - { - free(wfilename); - return 0; - } - } - else - { - free(wfilename); - return 0; - } - } - - /* FILETIME -> time_t */ - st->st_atime = wce_FILETIME2time_t(&fd.ftLastAccessTime); - st->st_mtime = wce_FILETIME2time_t(&fd.ftLastWriteTime); - st->st_ctime = wce_FILETIME2time_t(&fd.ftCreationTime); - st->st_size = fd.nFileSizeLow; - - FindClose( h ); - free(wfilename); - return 0; -} - -int fstat(int file, struct stat *sbuf) -{ - /* GetFileSize & GetFileTime */ - DWORD dwSize; - FILETIME ctime, atime, mtime; - - dwSize = GetFileSize( (HANDLE)file, NULL ); - if( dwSize == 0xFFFFFFFF ) - return -1; - - sbuf->st_size = dwSize; - sbuf->st_dev = 0; - sbuf->st_rdev = 0; - sbuf->st_mode = _S_IFREG; - sbuf->st_nlink= 1; - - GetFileTime( (HANDLE)file, &ctime, &atime, &mtime ); - sbuf->st_ctime = wce_FILETIME2time_t(&ctime); - sbuf->st_atime = wce_FILETIME2time_t(&atime); - sbuf->st_mtime = wce_FILETIME2time_t(&mtime); - - return 0; -} - diff --git a/wince/sys/stat.h b/wince/sys/stat.h deleted file mode 100644 index e3cdf8b8e7..0000000000 --- a/wince/sys/stat.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef SYS_STAT_H -#define SYS_STAT_H 1 - -#include <sys/types.h> - -#define _S_IFMT 0170000 /* file type mask */ -#define _S_IFDIR 0040000 /* directory */ -#define _S_IFCHR 0020000 /* character special */ -#define _S_IFIFO 0010000 /* pipe */ -#define _S_IFREG 0100000 /* regular */ -#define _S_IREAD 0000400 /* read permission, owner */ -#define _S_IWRITE 0000200 /* write permission, owner */ -#define _S_IEXEC 0000100 /* execute/search permission, owner */ - -#define S_IFMT _S_IFMT -#define S_IFREG _S_IFREG -#define S_IFCHR _S_IFCHR -#define S_IFDIR _S_IFDIR -#define S_IREAD _S_IREAD -#define S_IWRITE _S_IWRITE -#define S_IEXEC _S_IEXEC - -#ifndef S_ISDIR -#define S_ISDIR(X) (((X) & S_IFMT) == S_IFDIR) -#endif -#ifndef S_ISREG -#define S_ISREG(X) (((X) & S_IFMT) == S_IFREG) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// in sys/types.h -//typedef unsigned int _dev_t; -//typedef long _off_t; -//typedef unsigned short _ino_t; - -#ifndef _STAT_DEFINED -struct stat -{ - dev_t st_dev; - ino_t st_ino; - unsigned short st_mode; - short st_nlink; - short st_uid; - short st_gid; - dev_t st_rdev; - off_t st_size; - time_t st_atime; - time_t st_mtime; - time_t st_ctime; -}; -#define _STAT_DEFINED -#endif /* _STAT_DEFINED */ - -#define _stat stat - -int _stat(const char *filename, struct _stat *stat); -int fstat(int file, struct stat *sbuf); - - -#ifdef __cplusplus -}; -#endif - - -#endif diff --git a/wince/sys/timeb.c b/wince/sys/timeb.c deleted file mode 100644 index 838ae0798d..0000000000 --- a/wince/sys/timeb.c +++ /dev/null @@ -1,25 +0,0 @@ -/*************************************************************** - timeb.c -***************************************************************/ - -#include <windows.h> -#include <time.h> -#include <sys/timeb.h> - - -int ftime(struct timeb *tp) -{ - SYSTEMTIME s; - FILETIME f; - - GetLocalTime(&s); - SystemTimeToFileTime( &s, &f ); - - tp->dstflag = 0; - tp->timezone = _timezone/60; - tp->time = wce_FILETIME2time_t(&f); - tp->millitm = s.wMilliseconds; - - return 0; -} - diff --git a/wince/sys/timeb.h b/wince/sys/timeb.h deleted file mode 100644 index e051b9058c..0000000000 --- a/wince/sys/timeb.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef SYS_TIMEB_H -#define SYS_TIMEB_H 1 - -#include <sys/types.h> - -struct _timeb { - time_t time; - unsigned short millitm; - short timezone; - short dstflag; -}; - -#define timeb _timeb - -#ifdef __cplusplus -extern "C" { -#endif - -int ftime(struct timeb *tp); - -#ifdef __cplusplus -}; -#endif - - -#endif diff --git a/wince/sys/types.h b/wince/sys/types.h deleted file mode 100644 index 541d5e8361..0000000000 --- a/wince/sys/types.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef SYS_TYPES_H -#define SYS_TYPES_H 1 - -#define BIG_ENDIAN 1234 -#define LITTLE_ENDIAN 4321 - -#ifdef MIPS -#define BYTE_ORDER LITTLE_ENDIAN -#endif - -//#if UNDER_CE > 201 -// typedef unsigned long time_t; -// #define _TIME_T_DEFINED_ -//#endif -typedef unsigned long dev_t; -typedef unsigned long ino_t; -#ifndef _MODE_T_DEFINED_ - typedef unsigned long mode_t; - #define _MODE_T_DEFINED_ -#endif - -typedef long clock_t; - -#ifndef _PTRDIFF_T_DEFINED -typedef long ptrdiff_t; -#define _PTRDIFF_T_DEFINED -#endif - -typedef long off_t; - -//typedef unsigned char u_char; -//typedef unsigned short u_short; - -#ifndef _CADDR_T_DEFINED_ -typedef unsigned char * caddr_t; -#define _CADDR_T_DEFINED_ -#endif - -#ifndef _SIZE_T_DEFINED_ -typedef unsigned int size_t; -#define _SIZE_T_DEFINED_ -#endif - -//typedef unsigned char u_int8_t; - -//typedef short int16_t; -//typedef unsigned short u_int16_t; - -//typedef int int32_t; -//typedef unsigned int u_int32_t; - -//typedef unsigned long u_long; -//typedef unsigned int u_int; - -//#ifndef _TIME_T_DEFINED_ -//typedef unsigned long time_t; -//#define _TIME_T_DEFINED_ -//#endif - -#endif diff --git a/wince/sys/utime.c b/wince/sys/utime.c deleted file mode 100644 index 0139c13828..0000000000 --- a/wince/sys/utime.c +++ /dev/null @@ -1,44 +0,0 @@ -/*************************************************************** - utime.c -***************************************************************/ - -#include <windows.h> -#include <sys/utime.h> -#include "..\wince.h" /* for wce_mbtowc */ - - -#ifdef _WIN32_WCE - #if _WIN32_WCE < 300 - #define Int32x32To64(a, b) ((LONGLONG)((LONG)(a)) * (LONGLONG)((LONG)(b))) -/* #define Int32x32To64(a, b) ((__int64)((LONG)(a)) * (__int64)((LONG)(b))) */ - #endif -#endif - -int utime(const char *f, struct utimbuf *t) -{ - HANDLE h; - FILETIME atime={0}, mtime={0}; - __int64 time64; - BOOL rc; - wchar_t *w; - - w = wce_mbtowc(f); - h = CreateFileW(w, GENERIC_WRITE, - FILE_SHARE_READ|FILE_SHARE_WRITE, - NULL, OPEN_EXISTING, 0, 0); - free(w); - - if( h==INVALID_HANDLE_VALUE ) - return -1; - - time64 = Int32x32To64(t->actime, 10000000) + 116444736000000000; - atime.dwLowDateTime = (DWORD)time64; - atime.dwHighDateTime = (DWORD)(time64 >> 32); - time64 = Int32x32To64(t->modtime, 10000000) + 116444736000000000; - mtime.dwLowDateTime = (DWORD)time64; - mtime.dwHighDateTime = (DWORD)(time64 >> 32); - - rc = SetFileTime(h, NULL, &atime, &mtime); - return rc==TRUE ? 0 : -1; -} - diff --git a/wince/sys/utime.h b/wince/sys/utime.h deleted file mode 100644 index b644f02a61..0000000000 --- a/wince/sys/utime.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef SYS_UTIME_H -#define SYS_UTIME_H 1 - -#include <time.h> - -struct utimbuf -{ - time_t actime; - time_t modtime; -}; - -#define _utimbuf utimbuf - - -#ifdef __cplusplus -extern "C" { -#endif - -int utime(const char *f, struct utimbuf *t); - -#ifdef __cplusplus -}; -#endif - -//#define utime _utime - -#endif |