Lines Matching refs:dir
32 DIR *dir = 0; in opendir() local
39 if ((dir = (DIR *)loader_tls_heap_alloc(sizeof *dir)) != 0 && in opendir()
40 (dir->name = (char *)loader_tls_heap_alloc(base_length + in opendir()
42 strcat(strcpy(dir->name, name), all); in opendir()
44 if ((dir->handle = in opendir()
45 (handle_type)_findfirst(dir->name, &dir->info)) != -1) { in opendir()
46 dir->result.d_name = 0; in opendir()
49 loader_tls_heap_free(dir->name); in opendir()
50 loader_tls_heap_free(dir); in opendir()
51 dir = 0; in opendir()
55 loader_tls_heap_free(dir); in opendir()
56 dir = 0; in opendir()
63 return dir; in opendir()
66 int closedir(DIR *dir) { in closedir() argument
69 if (dir) { in closedir()
70 if (dir->handle != -1) { in closedir()
71 result = _findclose(dir->handle); in closedir()
74 loader_tls_heap_free(dir->name); in closedir()
75 loader_tls_heap_free(dir); in closedir()
86 struct dirent *readdir(DIR *dir) { in readdir() argument
89 if (dir && dir->handle != -1) { in readdir()
90 if (!dir->result.d_name || _findnext(dir->handle, &dir->info) != -1) { in readdir()
91 result = &dir->result; in readdir()
92 result->d_name = dir->info.name; in readdir()
101 void rewinddir(DIR *dir) { in rewinddir() argument
102 if (dir && dir->handle != -1) { in rewinddir()
103 _findclose(dir->handle); in rewinddir()
104 dir->handle = (handle_type)_findfirst(dir->name, &dir->info); in rewinddir()
105 dir->result.d_name = 0; in rewinddir()