MCPcopy Create free account
hub / github.com/audacity/audacity / readdir

Function readdir

lib-src/sqlite/shell.c:1295–1323  ·  view source on GitHub ↗

** Implementation of the POSIX readdir() function using the MSVCRT. */

Source from the content-addressed store, hash-verified

1293** Implementation of the POSIX readdir() function using the MSVCRT.
1294*/
1295LPDIRENT readdir(
1296 LPDIR dirp
1297){
1298 struct _finddata_t data;
1299
1300 if( dirp==NULL ) return NULL;
1301
1302 if( dirp->d_first.d_ino==0 ){
1303 dirp->d_first.d_ino++;
1304 dirp->d_next.d_ino++;
1305
1306 return &dirp->d_first;
1307 }
1308
1309next:
1310
1311 memset(&data, 0, sizeof(struct _finddata_t));
1312 if( _findnext(dirp->d_handle, &data)==-1 ) return NULL;
1313
1314 /* TODO: Remove this block to allow hidden and/or system files. */
1315 if( is_filtered(data) ) goto next;
1316
1317 dirp->d_next.d_ino++;
1318 dirp->d_next.d_attributes = data.attrib;
1319 strncpy(dirp->d_next.d_name, data.name, NAME_MAX);
1320 dirp->d_next.d_name[NAME_MAX] = '\0';
1321
1322 return &dirp->d_next;
1323}
1324
1325/*
1326** Implementation of the POSIX readdir_r() function using the MSVCRT.

Callers 6

lilv_dir_for_eachFunction · 0.85
osdir_list_nextFunction · 0.85
osdir_list_nextFunction · 0.85
osdir_list_nextFunction · 0.85
listFilesMethod · 0.85
fsdirNextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected