#endif
#if defined(__APPLE__)
#undef _PATH_DEFTAPE
-#define _PATH_DEFTAPE "-" /* Mac OS has no tape support, default to stdio. */
+#define _PATH_DEFTAPE "-" /* Mac OS has no tape support, default to stdio. */
#endif
#ifndef _PATH_DEFTAPE
*/
#ifndef BSDTAR_WINDOWS_H
-#define BSDTAR_WINDOWS_H 1
+#define BSDTAR_WINDOWS_H 1
#include <direct.h>
#include <windows.h>
#ifndef PRId64
-#define PRId64 "I64"
+#define PRId64 "I64"
#endif
-#define geteuid() 0
+#define geteuid() 0
#ifndef S_IFIFO
-#define S_IFIFO 0010000 /* pipe */
+#define S_IFIFO 0010000 /* pipe */
#endif
#include <string.h> /* Must include before redefining 'strdup' */
#if !defined(__BORLANDC__)
-#define strdup _strdup
+#define strdup _strdup
#endif
#if !defined(__BORLANDC__)
-#define getcwd _getcwd
+#define getcwd _getcwd
#endif
-#define chdir __tar_chdir
+#define chdir __tar_chdir
int __tar_chdir(const char *);
#ifndef S_ISREG
-#define S_ISREG(a) (a & _S_IFREG)
+#define S_ISREG(a) (a & _S_IFREG)
#endif
#ifndef S_ISBLK
-#define S_ISBLK(a) (0)
+#define S_ISBLK(a) (0)
#endif
#endif /* BSDTAR_WINDOWS_H */
}
}
-#define TM_YEAR_ORIGIN 1900
+#define TM_YEAR_ORIGIN 1900
/* Yield A - B, measured in seconds. */
static long
/* Format the time using 'ls -l' conventions. */
tim = archive_entry_mtime(entry);
-#define HALF_YEAR (time_t)365 * 86400 / 2
+#define HALF_YEAR (time_t)365 * 86400 / 2
#if defined(_WIN32) && !defined(__CYGWIN__)
-#define DAY_FMT "%d" /* Windows' strftime function does not support %e format. */
+#define DAY_FMT "%d" /* Windows' strftime function does not support %e format. */
#else
-#define DAY_FMT "%e" /* Day number without leading zeros */
+#define DAY_FMT "%e" /* Day number without leading zeros */
#endif
if (tim < now - HALF_YEAR || tim > now + HALF_YEAR)
fmt = bsdtar->day_first ? DAY_FMT " %b %Y" : "%b " DAY_FMT " %Y";
/* Definitions for tree_entry.flags bitmap. */
#define isDir 1 /* This entry is a regular directory. */
#define isDirLink 2 /* This entry is a symbolic link to a directory. */
-#define needsFirstVisit 4 /* This is an initial entry. */
+#define needsFirstVisit 4 /* This is an initial entry. */
#define needsDescent 8 /* This entry needs to be previsited. */
-#define needsOpen 16 /* This is a directory that needs to be opened. */
+#define needsOpen 16 /* This is a directory that needs to be opened. */
#define needsAscent 32 /* This entry needs to be postvisited. */
/*
#if defined(HAVE_WINDOWS_H) && !defined(__CYGWIN__)
HANDLE d;
BY_HANDLE_FILE_INFORMATION fileInfo;
-#define INVALID_DIR_HANDLE INVALID_HANDLE_VALUE
+#define INVALID_DIR_HANDLE INVALID_HANDLE_VALUE
WIN32_FIND_DATA _findData;
WIN32_FIND_DATA *findData;
#else
DIR *d;
-#define INVALID_DIR_HANDLE NULL
+#define INVALID_DIR_HANDLE NULL
struct dirent *de;
#endif
int flags;
};
/* Definitions for tree.flags bitmap. */
-#define hasStat 16 /* The st entry is valid. */
-#define hasLstat 32 /* The lst entry is valid. */
+#define hasStat 16 /* The st entry is valid. */
+#define hasLstat 32 /* The lst entry is valid. */
#define hasFileInfo 64 /* The Windows fileInfo entry is valid. */
#if defined(_WIN32) && !defined(__CYGWIN__)
#ifdef HAVE_DIRENT_D_NAMLEN
/* BSD extension; avoids need for a strlen() call. */
-#define D_NAMELEN(dp) (dp)->d_namlen
+#define D_NAMELEN(dp) (dp)->d_namlen
#else
-#define D_NAMELEN(dp) (strlen((dp)->d_name))
+#define D_NAMELEN(dp) (strlen((dp)->d_name))
#endif
#include <stdio.h>
#if defined(_WIN32) && !defined(__CYGWIN__)
#ifndef IO_REPARSE_TAG_SYMLINK
/* Old SDKs do not provide IO_REPARSE_TAG_SYMLINK */
-#define IO_REPARSE_TAG_SYMLINK 0xA000000CL
+#define IO_REPARSE_TAG_SYMLINK 0xA000000CL
#endif
if (t->findData)
return ((t->findData->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
#include <wctype.h>
#else
/* If we don't have wctype, we need to hack up some version of iswprint(). */
-#define iswprint isprint
+#define iswprint isprint
#endif
#include "bsdtar.h"
static const char *strip_components(const char *path, int elements);
#if defined(_WIN32) && !defined(__CYGWIN__)
-#define read _read
+#define read _read
#endif
/* TODO: Hack up a version of mbtowc for platforms with no wide
* character support at all. I think the following might suffice,
* but it needs careful testing.
* #if !HAVE_MBTOWC
- * #define mbtowc(wcp, p, n) ((*wcp = *p), 1)
+ * #define mbtowc(wcp, p, n) ((*wcp = *p), 1)
* #endif
*/
#include "tree.h"
/* Size of buffer for holding file data prior to writing. */
-#define FILEDATABUFLEN 65536
+#define FILEDATABUFLEN 65536
/* Fixed size of uname/gname caches. */
#define name_cache_size 101
#ifndef O_BINARY
-#define O_BINARY 0
+#define O_BINARY 0
#endif
static const char * const NO_NAME = "(noname)";
return (SetFilePointerEx((HANDLE)_get_osfhandle(fd),
distance, NULL, FILE_BEGIN) ? 1 : -1);
}
-#define open _open
-#define close _close
-#define read _read
-#define lseek seek_file
+#define open _open
+#define close _close
+#define read _read
+#define lseek seek_file
#endif
void