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()
124 return &(dp->dent); in readdir()
127 int closedir(DIR *dp) in closedir() argument
129 if (!dp) in closedir()
133 if (dp->handle != INVALID_HANDLE_VALUE) { in closedir()
134 FindClose(dp->handle); in closedir()
136 if (dp->dirw) in closedir()
137 free(dp->dirw); in closedir()
138 if (dp) in closedir()
139 free(dp); in closedir()
144 int rewinddir(DIR *dp) in rewinddir() argument
152 FindClose(dp->handle); in rewinddir()
154 dp->offset = 0; in rewinddir()
155 dp->finished = 0; in rewinddir()
158 dirw_len = wcslen((wchar_t *)dp->dirw); in rewinddir()
160 …w_len >= 3 && PHP_WIN32_IOUTIL_IS_LETTERW(dp->dirw[0]) && L':' == dp->dirw[1] && PHP_WIN32_IOUTIL_… in rewinddir()
174 wcscpy(filespecw + PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW, dp->dirw); in rewinddir()
177 wcscpy(filespecw, dp->dirw); in rewinddir()
186 …if ((handle = FindFirstFileExW(filespecw, FindExInfoBasic, &(dp->fileinfo), FindExSearchNameMatch,… in rewinddir()
187 dp->finished = 1; in rewinddir()
191 dp->handle = handle; in rewinddir()