MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / readdir

Function readdir

modules/dasSQLITE/sqlite/shell.c:1426–1454  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1424** Implementation of the POSIX readdir() function using the MSVCRT.
1425*/
1426LPDIRENT readdir(
1427 LPDIR dirp
1428){
1429 struct _finddata_t data;
1430
1431 if( dirp==NULL ) return NULL;
1432
1433 if( dirp->d_first.d_ino==0 ){
1434 dirp->d_first.d_ino++;
1435 dirp->d_next.d_ino++;
1436
1437 return &dirp->d_first;
1438 }
1439
1440next:
1441
1442 memset(&data, 0, sizeof(struct _finddata_t));
1443 if( _findnext(dirp->d_handle, &data)==-1 ) return NULL;
1444
1445 /* TODO: Remove this block to allow hidden and/or system files. */
1446 if( is_filtered(data) ) goto next;
1447
1448 dirp->d_next.d_ino++;
1449 dirp->d_next.d_attributes = data.attrib;
1450 strncpy(dirp->d_next.d_name, data.name, NAME_MAX);
1451 dirp->d_next.d_name[NAME_MAX] = '\0';
1452
1453 return &dirp->d_next;
1454}
1455
1456/*
1457** Implementation of the POSIX readdir_r() function using the MSVCRT.

Callers 6

fsdirNextFunction · 0.85
introduceDaslibMethod · 0.85
collect_module_namesFunction · 0.85
init_modules_for_folderFunction · 0.85
builtin_dirFunction · 0.85
rmdir_rec_implFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected