summaryrefslogtreecommitdiff
path: root/libarchive/archive_windows.h
diff options
context:
space:
mode:
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>2011-04-11 12:46:37 -0400
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>2011-04-11 12:46:37 -0400
commitf9d148d66cc0827bbe8ed4e1f722c44b27d1e038 (patch)
tree18aac8702af8132ac356ce3aaafb0a36e72489fb /libarchive/archive_windows.h
parent7e59ca749833a2dc949649a09ca84dd216248cde (diff)
downloadlibarchive-f9d148d66cc0827bbe8ed4e1f722c44b27d1e038.tar.gz
Improve archive_write_disk_windows.c.
- Use WCS to pathname. This has made following changes. - FindFirstFileW and GetFileInformationByHandle instead of stat/lstat. - Move __la_chmod and __la_ftruncate used only in the file from archive_windows.c and change it to wide char version. - Remove __la_mkdir and directly use CreateDirectoryW in the file. - Remove __la_rmdir and use _wrmdir in the file. - Remove __la_unlink and use _wunlink in the file. - Remove __la_link and Move la_CreateHardLinkW into the file to use it directly. - Use _wopen instead of __la_open. Unfortunately, at this time we cannot use full-pathname through __la_win_permissive_name_w() completely at the file because __la_win_permissive_name_w() trim "../". For example, the path "abc/a/../b../c", which is multi dirs in one entry, will be converted to "<parent-dir>/abc/c", so we could not make both abc/a and abc/b directories if we applied __la_win_permissive_name_w() to the path at _archive_write_disk_header(). SVN-Revision: 3213
Diffstat (limited to 'libarchive/archive_windows.h')
-rw-r--r--libarchive/archive_windows.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/libarchive/archive_windows.h b/libarchive/archive_windows.h
index 6e97d3c4..448fd1f6 100644
--- a/libarchive/archive_windows.h
+++ b/libarchive/archive_windows.h
@@ -90,21 +90,16 @@
/* Alias the Windows _function to the POSIX equivalent. */
#define chdir __la_chdir
-#define chmod __la_chmod
#define close _close
#define fcntl __la_fcntl
#ifndef fileno
#define fileno _fileno
#endif
#define fstat __la_fstat
-#define ftruncate __la_ftruncate
-#define link __la_link
#define lseek __la_lseek
#define lstat __la_stat
-#define mkdir(d,m) __la_mkdir(d, m)
#define open __la_open
#define read __la_read
-#define rmdir __la_rmdir
#if !defined(__BORLANDC__)
#define setmode _setmode
#endif
@@ -116,7 +111,6 @@
#if !defined(__BORLANDC__)
#define umask _umask
#endif
-#define unlink __la_unlink
#define waitpid __la_waitpid
#define write __la_write
@@ -249,14 +243,6 @@
#endif
-/* Tell libarchive code that we have simulations for these. */
-#ifndef HAVE_FTRUNCATE
-#define HAVE_FTRUNCATE 1
-#endif
-#ifndef HAVE_LINK
-#define HAVE_LINK 1
-#endif
-
/* Replacement POSIX function */
extern int __la_chdir(const char *path);
extern int __la_chmod(const char *path, mode_t mode);
@@ -284,5 +270,8 @@ extern ssize_t __la_write(int fd, const void *buf, size_t nbytes);
extern wchar_t *__la_win_permissive_name(const char *name);
extern wchar_t *__la_win_permissive_name_w(const wchar_t *wname);
+extern void __la_dosmaperr(unsigned long e);
+#define la_dosmaperr(e) __la_dosmaperr(e)
+
#endif /* LIBARCHIVE_ARCHIVE_WINDOWS_H_INCLUDED */