Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-03-17 00:20:56 +0300
committerChristopher Faylor <me@cgf.cx>2005-03-17 00:20:56 +0300
commit2693c1ac5651248b79c3a7805615b043a901ae6f (patch)
tree9baedb56d5c51dd988be04ed51023e74ccbc1679 /winsup/cygwin/dir.cc
parent80e4c577b6ada0d6b64bf139075c2f9983608bc8 (diff)
* dir.cc: Rename opendir_* to dirent_* throughout.
(opendir_states): Move and rename. * fhandler.h (dirent_states): to here. * fhandler_disk_file.cc (fhandler_disk_file::readdir): Use raw readdir when skipping through entries since it is keeping track of "." and "..". (fhandler_cygdrive::seekdir): Use fhandler_disk_file::readdir to do everything. * fhandler_virtual.cc (fhandler_virtual::opendir): Set flag indicating that we provide . and .. (fhandler_virtual::seekdir): Ditto. (fhandler_virtual::rewinddir): Ditto. * fhandler_registry.cc (fhandler_registry::rewinddir): Ditto.
Diffstat (limited to 'winsup/cygwin/dir.cc')
-rw-r--r--winsup/cygwin/dir.cc20
1 files changed, 6 insertions, 14 deletions
diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc
index e74498fb0..5aabcd370 100644
--- a/winsup/cygwin/dir.cc
+++ b/winsup/cygwin/dir.cc
@@ -38,14 +38,6 @@ dirfd (DIR *dir)
return dir->__d_dirent->d_fd;
}
-enum opendir_states
-{
- opendir_ok = 0,
- opendir_saw_dot = 1,
- opendir_saw_dot_dot = 2,
- opendir_saw_eof = 4
-};
-
/* opendir: POSIX 5.1.2.1 */
extern "C" DIR *
opendir (const char *name)
@@ -89,18 +81,18 @@ readdir (DIR *dir)
if (!res)
{
- if (!(dir->__flags & opendir_saw_dot))
+ if (!(dir->__flags & dirent_saw_dot))
{
res = dir->__d_dirent;
strcpy (res->d_name, ".");
- dir->__flags |= opendir_saw_dot;
+ dir->__flags |= dirent_saw_dot;
dir->__d_position++;
}
- else if (!(dir->__flags & opendir_saw_dot_dot))
+ else if (!(dir->__flags & dirent_saw_dot_dot))
{
res = dir->__d_dirent;
strcpy (res->d_name, "..");
- dir->__flags |= opendir_saw_dot_dot;
+ dir->__flags |= dirent_saw_dot_dot;
dir->__d_position++;
}
}
@@ -114,13 +106,13 @@ readdir (DIR *dir)
if (res->d_name[1] == '\0')
{
dir->__d_dirent->d_ino = dir->__d_dirhash;
- dir->__flags |= opendir_saw_dot;
+ dir->__flags |= dirent_saw_dot;
}
else if (res->d_name[1] != '.' || res->d_name[2] != '\0')
goto hashit;
else
{
- dir->__flags |= opendir_saw_dot_dot;
+ dir->__flags |= dirent_saw_dot_dot;
char *p, up[strlen (dir->__d_dirname) + 1];
strcpy (up, dir->__d_dirname);
if (!(p = strrchr (up, '\\')))