Lines Matching defs:dirp
294 static struct dirent *readdir (DIR *dirp);
295 static struct _wdirent *_wreaddir (_WDIR *dirp);
298 DIR *dirp, struct dirent *entry, struct dirent **result);
300 _WDIR *dirp, struct _wdirent *entry, struct _wdirent **result);
302 static int closedir (DIR *dirp);
303 static int _wclosedir (_WDIR *dirp);
305 static void rewinddir (DIR* dirp);
306 static void _wrewinddir (_WDIR* dirp);
327 static WIN32_FIND_DATAW *dirent_first (_WDIR *dirp);
328 static WIN32_FIND_DATAW *dirent_next (_WDIR *dirp);
356 _WDIR *dirp;
367 dirp = (_WDIR*) malloc (sizeof (struct _WDIR));
368 if (!dirp) {
373 dirp->handle = INVALID_HANDLE_VALUE;
374 dirp->patt = NULL;
375 dirp->cached = 0;
392 dirp->patt = (wchar_t*) malloc (sizeof (wchar_t) * n + 16);
393 if (dirp->patt == NULL) {
407 n = GetFullPathNameW (dirname, n, dirp->patt, NULL);
413 wcsncpy_s (dirp->patt, n+1, dirname, n);
417 p = dirp->patt + n;
434 if (!dirent_first (dirp)) {
439 return dirp;
443 _wclosedir (dirp);
455 _WDIR *dirp)
463 (void) _wreaddir_r (dirp, &dirp->ent, &entry);
477 _WDIR *dirp,
484 datap = dirent_next (dirp);
539 _WDIR *dirp)
542 if (dirp) {
545 if (dirp->handle != INVALID_HANDLE_VALUE) {
546 FindClose (dirp->handle);
550 free (dirp->patt);
553 free (dirp);
572 _WDIR* dirp)
574 if (dirp) {
576 if (dirp->handle != INVALID_HANDLE_VALUE) {
577 FindClose (dirp->handle);
581 dirent_first (dirp);
588 _WDIR *dirp)
594 dirp->handle = FindFirstFileExW(
595 dirp->patt, FindExInfoStandard, &dirp->data,
597 if (dirp->handle != INVALID_HANDLE_VALUE) {
600 datap = &dirp->data;
601 dirp->cached = 1;
606 dirp->cached = 0;
639 _WDIR *dirp)
644 if (dirp->cached != 0) {
647 p = &dirp->data;
648 dirp->cached = 0;
650 } else if (dirp->handle != INVALID_HANDLE_VALUE) {
653 if (FindNextFileW (dirp->handle, &dirp->data) != FALSE) {
655 p = &dirp->data;
658 FindClose (dirp->handle);
659 dirp->handle = INVALID_HANDLE_VALUE;
680 struct DIR *dirp;
689 dirp = (DIR*) malloc (sizeof (struct DIR));
690 if (!dirp) {
713 dirp->wdirp = _wopendir (wname);
714 if (!dirp->wdirp) {
721 return dirp;
725 free (dirp);
734 DIR *dirp)
742 (void) readdir_r (dirp, &dirp->ent, &entry);
756 DIR *dirp,
763 datap = dirent_next (dirp->wdirp);
845 DIR *dirp)
848 if (dirp) {
851 ok = _wclosedir (dirp->wdirp);
852 dirp->wdirp = NULL;
855 free (dirp);
872 DIR* dirp)
875 _wrewinddir (dirp->wdirp);