|
|
@@ -27,6 +27,8 @@
|
|
|
#ifndef DIRENT_H
|
|
|
#define DIRENT_H
|
|
|
|
|
|
+#pragma warning(disable:4505) // error C4505: '_wreaddir': unreferenced local function has been removed
|
|
|
+
|
|
|
/*
|
|
|
* Define architecture flags so we don't need to include windows.h.
|
|
|
* Avoiding windows.h makes it simpler to use windows sockets in conjunction
|
|
|
@@ -355,11 +357,11 @@ _wreaddir(
|
|
|
if (datap) {
|
|
|
size_t n;
|
|
|
DWORD attr;
|
|
|
-
|
|
|
+
|
|
|
/* Pointer to directory entry to return */
|
|
|
entp = &dirp->ent;
|
|
|
|
|
|
- /*
|
|
|
+ /*
|
|
|
* Copy file name as wide-character string. If the file name is too
|
|
|
* long to fit in to the destination buffer, then truncate file name
|
|
|
* to PATH_MAX characters and zero-terminate the buffer.
|
|
|
@@ -515,12 +517,12 @@ dirent_next(
|
|
|
return p;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Open directory stream using plain old C-string.
|
|
|
*/
|
|
|
static DIR*
|
|
|
opendir(
|
|
|
- const char *dirname)
|
|
|
+ const char *dirname)
|
|
|
{
|
|
|
struct DIR *dirp;
|
|
|
int error;
|
|
|
@@ -552,7 +554,7 @@ opendir(
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- /*
|
|
|
+ /*
|
|
|
* Cannot convert file name to wide-character string. This
|
|
|
* occurs if the string contains invalid multi-byte sequences or
|
|
|
* the output buffer is too small to contain the resulting
|
|
|
@@ -590,7 +592,7 @@ opendir(
|
|
|
*/
|
|
|
static struct dirent*
|
|
|
readdir(
|
|
|
- DIR *dirp)
|
|
|
+ DIR *dirp)
|
|
|
{
|
|
|
WIN32_FIND_DATAW *datap;
|
|
|
struct dirent *entp;
|
|
|
@@ -605,7 +607,7 @@ readdir(
|
|
|
error = dirent_wcstombs_s(
|
|
|
&n, dirp->ent.d_name, PATH_MAX, datap->cFileName, PATH_MAX);
|
|
|
|
|
|
- /*
|
|
|
+ /*
|
|
|
* If the file name cannot be represented by a multi-byte string,
|
|
|
* then attempt to use old 8+3 file name. This allows traditional
|
|
|
* Unix-code to access some file names despite of unicode
|
|
|
@@ -617,7 +619,7 @@ readdir(
|
|
|
*/
|
|
|
if (error && datap->cAlternateFileName[0] != '\0') {
|
|
|
error = dirent_wcstombs_s(
|
|
|
- &n, dirp->ent.d_name, PATH_MAX,
|
|
|
+ &n, dirp->ent.d_name, PATH_MAX,
|
|
|
datap->cAlternateFileName, PATH_MAX);
|
|
|
}
|
|
|
|
|
|
@@ -645,7 +647,7 @@ readdir(
|
|
|
entp->d_reclen = sizeof (struct dirent);
|
|
|
|
|
|
} else {
|
|
|
- /*
|
|
|
+ /*
|
|
|
* Cannot convert file name to multi-byte string so construct
|
|
|
* an errornous directory entry and return that. Note that
|
|
|
* we cannot return NULL as that would stop the processing
|
|
|
@@ -673,7 +675,7 @@ readdir(
|
|
|
*/
|
|
|
static int
|
|
|
closedir(
|
|
|
- DIR *dirp)
|
|
|
+ DIR *dirp)
|
|
|
{
|
|
|
int ok;
|
|
|
if (dirp) {
|
|
|
@@ -700,7 +702,7 @@ closedir(
|
|
|
*/
|
|
|
static void
|
|
|
rewinddir(
|
|
|
- DIR* dirp)
|
|
|
+ DIR* dirp)
|
|
|
{
|
|
|
/* Rewind wide-character string directory stream */
|
|
|
_wrewinddir (dirp->wdirp);
|
|
|
@@ -830,9 +832,7 @@ dirent_set_errno(
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
-
|
|
|
#ifdef __cplusplus
|
|
|
}
|
|
|
#endif
|
|
|
#endif /*DIRENT_H*/
|
|
|
-
|