Lines Matching refs:dp
26 DIR *dp; in opendir() local
66 dp = (DIR *) calloc(1, sizeof(DIR) + (_MAX_FNAME*5+1)*sizeof(char)); in opendir()
67 if (dp == NULL) { in opendir()
73 …if ((handle = FindFirstFileExW(filespecw, FindExInfoBasic, &(dp->fileinfo), FindExSearchNameMatch,… in opendir()
76 dp->finished = 1; in opendir()
78 free(dp); in opendir()
84 dp->dirw = _wcsdup(resolvedw); in opendir()
85 dp->handle = handle; in opendir()
86 dp->offset = 0; in opendir()
87 dp->finished = 0; in opendir()
92 return dp; in opendir()
95 struct dirent *readdir(DIR *dp) in readdir() argument
100 if (!dp || dp->finished) in readdir()
103 if (dp->offset != 0) { in readdir()
104 if (FindNextFileW(dp->handle, &(dp->fileinfo)) == 0) { in readdir()
105 dp->finished = 1; in readdir()
110 _tmp = php_win32_cp_conv_w_to_any(dp->fileinfo.cFileName, PHP_WIN32_CP_IGNORE_LEN, &reclen); in readdir()
115 memmove(dp->dent.d_name, _tmp, reclen + 1); in readdir()
117 dp->dent.d_reclen = (unsigned short)reclen; in readdir()
119 dp->offset++; in readdir()
121 dp->dent.d_ino = 1; in readdir()
122 dp->dent.d_off = dp->offset; in readdir()
123 if (dp->fileinfo.dwFileAttributes & (FILE_ATTRIBUTE_REPARSE_POINT | FILE_ATTRIBUTE_DEVICE)) { in readdir()
124 dp->dent.d_type = DT_UNKNOWN; /* conservative */ in readdir()
125 } else if (dp->fileinfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { in readdir()
126 dp->dent.d_type = DT_DIR; in readdir()
128 dp->dent.d_type = DT_REG; in readdir()
131 return &(dp->dent); in readdir()
134 int closedir(DIR *dp) in closedir() argument
136 if (!dp) in closedir()
140 if (dp->handle != INVALID_HANDLE_VALUE) { in closedir()
141 FindClose(dp->handle); in closedir()
143 if (dp->dirw) in closedir()
144 free(dp->dirw); in closedir()
145 if (dp) in closedir()
146 free(dp); in closedir()
151 int rewinddir(DIR *dp) in rewinddir() argument
159 FindClose(dp->handle); in rewinddir()
161 dp->offset = 0; in rewinddir()
162 dp->finished = 0; in rewinddir()
165 dirw_len = wcslen((wchar_t *)dp->dirw); in rewinddir()
167 …w_len >= 3 && PHP_WIN32_IOUTIL_IS_LETTERW(dp->dirw[0]) && L':' == dp->dirw[1] && PHP_WIN32_IOUTIL_… in rewinddir()
181 wcscpy(filespecw + PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW, dp->dirw); in rewinddir()
184 wcscpy(filespecw, dp->dirw); in rewinddir()
193 …if ((handle = FindFirstFileExW(filespecw, FindExInfoBasic, &(dp->fileinfo), FindExSearchNameMatch,… in rewinddir()
194 dp->finished = 1; in rewinddir()
198 dp->handle = handle; in rewinddir()