MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / rewinddir

Function rewinddir

tools/streamer_recorder/include/msdirent.h:348–366  ·  view source on GitHub ↗

* Resets the position of the directory stream to which dirp refers to the * beginning of the directory. It also causes the directory stream to refer * to the current state of the corresponding directory, as a call to opendir() * would have done. If dirp does not refer to a directory stream, the effect * is undefined. */

Source from the content-addressed store, hash-verified

346 * is undefined.
347 */
348static void rewinddir(DIR* dirp)
349{
350 if (dirp != NULL) {
351 /* release search handle */
352 if (dirp->search_handle != INVALID_HANDLE_VALUE) {
353 FindClose (dirp->search_handle);
354 }
355
356 /* open new search handle and retrieve the first entry */
357 dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->find_data);
358 if (dirp->search_handle != INVALID_HANDLE_VALUE) {
359 /* a directory entry is now waiting in memory */
360 dirp->cached = 1;
361 } else {
362 /* failed to re-open directory: no directory entry in memory */
363 dirp->cached = 0;
364 }
365 }
366}
367
368
369#ifdef __cplusplus

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected