diff options
author | Simon Howard | 2009-07-13 00:52:26 +0000 |
---|---|---|
committer | Simon Howard | 2009-07-13 00:52:26 +0000 |
commit | 480a31094b7621dd7d65ec05a6e36964dca99b66 (patch) | |
tree | 11b218d674e828c12981d819b8f2396b680436df /wince/fileops.c | |
parent | 37db69b86bc5052901e250578e9c3920886d79ff (diff) | |
parent | e66653a8a67f3613344ae4ea30b37403d6ff17cf (diff) | |
download | chocolate-doom-480a31094b7621dd7d65ec05a6e36964dca99b66.tar.gz chocolate-doom-480a31094b7621dd7d65ec05a6e36964dca99b66.tar.bz2 chocolate-doom-480a31094b7621dd7d65ec05a6e36964dca99b66.zip |
Merge from trunk.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1624
Diffstat (limited to 'wince/fileops.c')
-rw-r--r-- | wince/fileops.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/wince/fileops.c b/wince/fileops.c new file mode 100644 index 00000000..b0617bd3 --- /dev/null +++ b/wince/fileops.c @@ -0,0 +1,49 @@ +// +// "Extension" implementation of ANSI C file functions for Windows CE. +// +// I (Simon Howard) release this file to the public domain. +// + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <windows.h> + +#include "fileops.h" + +int remove(const char *pathname) +{ + wchar_t temp[MAX_PATH + 1]; + + MultiByteToWideChar(CP_OEMCP, + 0, + pathname, + strlen(pathname) + 1, + temp, + MAX_PATH); + + return DeleteFileW(temp) != 0; +} + +int rename(const char *oldpath, const char *newpath) +{ + wchar_t oldpath1[MAX_PATH + 1]; + wchar_t newpath1[MAX_PATH + 1]; + + MultiByteToWideChar(CP_OEMCP, + 0, + oldpath, + strlen(oldpath) + 1, + oldpath1, + MAX_PATH); + MultiByteToWideChar(CP_OEMCP, + 0, + newpath, + strlen(newpath) + 1, + newpath1, + MAX_PATH); + + return MoveFileW(oldpath1, newpath1); +} + |