summaryrefslogtreecommitdiff
path: root/src/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dir.c')
-rw-r--r--src/dir.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/dir.c b/src/dir.c
index 5abafae9..f3e5127b 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -50,7 +50,7 @@ const char *vmsify (const char *name, int type);
# define NAMLEN(d) _D_NAMLEN(d)
#endif
-#if (defined (POSIX) || MK_OS_VMS || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__)
+#if (defined (POSIX) || MK_OS_VMS || MK_OS_W32) && !defined (__GNU_LIBRARY__)
/* Posix does not require that the d_ino field be present, and some
systems do not provide it. */
# define REAL_DIR_ENTRY(dp) 1
@@ -110,7 +110,7 @@ dosify (const char *filename)
}
#endif /* __MSDOS__ */
-#ifdef WINDOWS32
+#if MK_OS_W32
#include "pathstuff.h"
#endif
@@ -244,8 +244,8 @@ static unsigned int open_directories = 0;
struct directory_contents
{
dev_t dev; /* Device and inode numbers of this dir. */
-#ifdef WINDOWS32
- /* Inode means nothing on WINDOWS32. Even file key information is
+#if MK_OS_W32
+ /* Inode means nothing on Windows32. Even file key information is
* unreliable because it is random per file open and undefined for remote
* filesystems. The most unique attribute I can come up with is the fully
* qualified name of the directory. Beware though, this is also
@@ -263,7 +263,7 @@ struct directory_contents
# else
ino_t ino;
# endif
-#endif /* WINDOWS32 */
+#endif /* MK_OS_W32 */
struct hash_table dirfiles; /* Files in this directory. */
unsigned long counter; /* command_count value when last read. */
DIR *dirstream; /* Stream reading this directory. */
@@ -291,7 +291,7 @@ directory_contents_hash_1 (const void *key_0)
const struct directory_contents *key = key_0;
unsigned long hash;
-#ifdef WINDOWS32
+#if MK_OS_W32
hash = 0;
ISTRING_HASH_1 (key->path_key, hash);
hash ^= ((unsigned int) key->dev << 4) ^ (unsigned int) key->ctime;
@@ -304,7 +304,7 @@ directory_contents_hash_1 (const void *key_0)
# else
hash = ((unsigned int) key->dev << 4) ^ (unsigned int) key->ino;
# endif
-#endif /* WINDOWS32 */
+#endif /* MK_OS_W32 */
return hash;
}
@@ -314,7 +314,7 @@ directory_contents_hash_2 (const void *key_0)
const struct directory_contents *key = key_0;
unsigned long hash;
-#ifdef WINDOWS32
+#if MK_OS_W32
hash = 0;
ISTRING_HASH_2 (key->path_key, hash);
hash ^= ((unsigned int) key->dev << 4) ^ (unsigned int) ~key->ctime;
@@ -327,7 +327,7 @@ directory_contents_hash_2 (const void *key_0)
# else
hash = ((unsigned int) key->dev << 4) ^ (unsigned int) ~key->ino;
# endif
-#endif /* WINDOWS32 */
+#endif /* MK_OS_W32 */
return hash;
}
@@ -350,7 +350,7 @@ directory_contents_hash_cmp (const void *xv, const void *yv)
const struct directory_contents *y = yv;
int result;
-#ifdef WINDOWS32
+#if MK_OS_W32
ISTRING_COMPARE (x->path_key, y->path_key, result);
if (result)
return result;
@@ -373,7 +373,7 @@ directory_contents_hash_cmp (const void *xv, const void *yv)
if (result)
return result;
# endif
-#endif /* WINDOWS32 */
+#endif /* MK_OS_W32 */
return MAKECMP(x->dev, y->dev);
}
@@ -471,7 +471,7 @@ find_directory (const char *name)
struct stat st;
int r;
-#ifdef WINDOWS32
+#if MK_OS_W32
char *w32_path;
#endif
@@ -516,7 +516,7 @@ find_directory (const char *name)
dir->counter = command_count;
/* See if the directory exists. */
-#if defined(WINDOWS32)
+#if MK_OS_W32
{
char tem[MAX_PATH+1], *tstart, *tend;
size_t len = strlen (name);
@@ -544,7 +544,7 @@ find_directory (const char *name)
memset (&dc_key, '\0', sizeof (dc_key));
dc_key.dev = st.st_dev;
-#ifdef WINDOWS32
+#if MK_OS_W32
dc_key.path_key = w32_path = w32ify (name, 1);
dc_key.ctime = st.st_ctime;
#else
@@ -562,7 +562,7 @@ find_directory (const char *name)
if (HASH_VACANT (dc))
{
/* Nope; this really is a directory we haven't seen before. */
-#ifdef WINDOWS32
+#if MK_OS_W32
char fs_label[BUFSIZ];
char fs_type[BUFSIZ];
unsigned long fs_serno;
@@ -573,11 +573,11 @@ find_directory (const char *name)
dc = xcalloc (sizeof (struct directory_contents));
*dc = dc_key;
-#ifdef WINDOWS32
+#if MK_OS_W32
dc->path_key = xstrdup (w32_path);
dc->mtime = st.st_mtime;
- /* NTFS is the only WINDOWS32 filesystem that bumps mtime on a
+ /* NTFS is the only Windows32 filesystem that bumps mtime on a
directory when files are added/deleted from a directory. */
w32_path[3] = '\0';
if (GetVolumeInformation (w32_path, fs_label, sizeof (fs_label),
@@ -590,7 +590,7 @@ find_directory (const char *name)
dc->fs_flags = FS_NTFS;
else
dc->fs_flags = FS_UNKNOWN;
-#endif /* WINDOWS32 */
+#endif /* MK_OS_W32 */
hash_insert_at (&directory_contents, dc, dc_slot);
}
@@ -636,7 +636,7 @@ dir_contents_file_exists_p (struct directory *dir,
struct dirfile *df;
struct dirent *d;
struct directory_contents *dc = dir->contents;
-#ifdef WINDOWS32
+#if MK_OS_W32
struct stat st;
int rehash = 0;
#endif
@@ -684,7 +684,7 @@ dir_contents_file_exists_p (struct directory *dir,
if (dc->dirstream == NULL)
{
-#ifdef WINDOWS32
+#if MK_OS_W32
/*
* Check to see if directory has changed since last read. FAT
* filesystems force a rehash always as mtime does not change
@@ -751,7 +751,7 @@ dir_contents_file_exists_p (struct directory *dir,
dirfile_key.name = d->d_name;
dirfile_key.length = len;
dirfile_slot = (struct dirfile **) hash_find_slot (&dc->dirfiles, &dirfile_key);
-#ifdef WINDOWS32
+#if MK_OS_W32
/*
* If re-reading a directory, don't cache files that have
* already been discovered.
@@ -1085,7 +1085,7 @@ print_dir_data_base (void)
unsigned int impossible;
struct directory **dir_slot;
struct directory **dir_end;
-#ifdef WINDOWS32
+#if MK_OS_W32
char buf[INTSTR_LENGTH + 1];
#endif
@@ -1103,7 +1103,7 @@ print_dir_data_base (void)
if (dir->contents == NULL)
printf (_("# %s: could not be stat'd.\n"), dir->name);
else if (dir->contents->dirfiles.ht_vec == NULL)
-#ifdef WINDOWS32
+#if MK_OS_W32
printf (_("# %s (key %s, mtime %s): could not be opened.\n"),
dir->name, dir->contents->path_key,
make_ulltoa ((unsigned long long)dir->contents->mtime, buf));
@@ -1136,7 +1136,7 @@ print_dir_data_base (void)
++f;
}
}
-#ifdef WINDOWS32
+#if MK_OS_W32
printf (_("# %s (key %s, mtime %s): "),
dir->name, dir->contents->path_key,
make_ulltoa ((unsigned long long)dir->contents->mtime, buf));
@@ -1274,7 +1274,7 @@ read_dirstream (void *stream)
* On MS-Windows, stat() "succeeds" for foo/bar/. where foo/bar is a
* regular file; fix that here.
*/
-#if !defined(stat) && !defined(WINDOWS32) || MK_OS_VMS
+#if !defined(stat) && !MK_OS_W32 || MK_OS_VMS
# if !MK_OS_VMS
# ifndef HAVE_SYS_STAT_H
int stat (const char *path, struct stat *sbuf);
@@ -1291,7 +1291,7 @@ static int
local_stat (const char *path, struct stat *buf)
{
int e;
-#ifdef WINDOWS32
+#if MK_OS_W32
size_t plen = strlen (path);
/* Make sure the parent of "." exists and is a directory, not a
@@ -1314,7 +1314,7 @@ local_stat (const char *path, struct stat *buf)
#endif
/* Similarly for lstat. */
-#if !defined(lstat) && !defined(WINDOWS32) || MK_OS_VMS
+#if !defined(lstat) && !MK_OS_W32 || MK_OS_VMS
# if !MK_OS_VMS
# ifndef HAVE_SYS_STAT_H
int lstat (const char *path, struct stat *sbuf);
@@ -1326,7 +1326,7 @@ int lstat (const char *path, struct stat *sbuf);
# endif
# endif
# define local_lstat lstat
-#elif defined(WINDOWS32)
+#elif MK_OS_W32
/* Windows doesn't support lstat(). */
# define local_lstat local_stat
#else