Lines Matching refs:dp

29 	DIR *dp;  in opendir()  local
40 dp = (DIR *) calloc(1, sizeof(DIR) + (_MAX_FNAME*5+1)*sizeof(char)); in opendir()
41 if (dp == NULL) { in opendir()
47 free(dp); in opendir()
59 free(dp); in opendir()
76 …if ((handle = FindFirstFileExW(filespecw, FindExInfoBasic, &(dp->fileinfo), FindExSearchNameMatch,… in opendir()
79 dp->finished = 1; in opendir()
81 free(dp); in opendir()
87 dp->dirw = _wcsdup(resolvedw); in opendir()
88 dp->handle = handle; in opendir()
89 dp->offset = 0; in opendir()
90 dp->finished = 0; in opendir()
95 return dp; in opendir()
98 struct dirent *readdir(DIR *dp) in readdir() argument
103 if (!dp || dp->finished) in readdir()
106 if (dp->offset != 0) { in readdir()
107 if (FindNextFileW(dp->handle, &(dp->fileinfo)) == 0) { in readdir()
108 dp->finished = 1; in readdir()
113 _tmp = php_win32_cp_conv_w_to_any(dp->fileinfo.cFileName, PHP_WIN32_CP_IGNORE_LEN, &reclen); in readdir()
118 memmove(dp->dent.d_name, _tmp, reclen + 1); in readdir()
120 dp->dent.d_reclen = (unsigned short)reclen; in readdir()
122 dp->offset++; in readdir()
124 dp->dent.d_ino = 1; in readdir()
125 dp->dent.d_off = dp->offset; in readdir()
127 return &(dp->dent); in readdir()
130 int readdir_r(DIR *dp, struct dirent *entry, struct dirent **result) in readdir_r() argument
135 if (!dp || dp->finished) { in readdir_r()
140 if (dp->offset != 0) { in readdir_r()
141 if (FindNextFileW(dp->handle, &(dp->fileinfo)) == 0) { in readdir_r()
142 dp->finished = 1; in readdir_r()
148 _tmp = php_win32_cp_conv_w_to_any(dp->fileinfo.cFileName, PHP_WIN32_CP_IGNORE_LEN, &reclen); in readdir_r()
154 memmove(dp->dent.d_name, _tmp, reclen + 1); in readdir_r()
156 dp->dent.d_reclen = (unsigned short)reclen; in readdir_r()
158 dp->offset++; in readdir_r()
160 dp->dent.d_ino = 1; in readdir_r()
161 dp->dent.d_off = dp->offset; in readdir_r()
163 memcpy(entry, &dp->dent, sizeof(*entry)); in readdir_r()
165 *result = &dp->dent; in readdir_r()
170 int closedir(DIR *dp) in closedir() argument
172 if (!dp) in closedir()
176 if (dp->handle != INVALID_HANDLE_VALUE) { in closedir()
177 FindClose(dp->handle); in closedir()
179 if (dp->dirw) in closedir()
180 free(dp->dirw); in closedir()
181 if (dp) in closedir()
182 free(dp); in closedir()
187 int rewinddir(DIR *dp) in rewinddir() argument
195 FindClose(dp->handle); in rewinddir()
197 dp->offset = 0; in rewinddir()
198 dp->finished = 0; in rewinddir()
201 dirw_len = wcslen((wchar_t *)dp->dirw); in rewinddir()
203 …w_len >= 3 && PHP_WIN32_IOUTIL_IS_LETTERW(dp->dirw[0]) && L':' == dp->dirw[1] && PHP_WIN32_IOUTIL_… in rewinddir()
217 wcscpy(filespecw + PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW, dp->dirw); in rewinddir()
220 wcscpy(filespecw, dp->dirw); in rewinddir()
229 …if ((handle = FindFirstFileExW(filespecw, FindExInfoBasic, &(dp->fileinfo), FindExSearchNameMatch,… in rewinddir()
230 dp->finished = 1; in rewinddir()
234 dp->handle = handle; in rewinddir()