MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / hd_glob_parse

Function hd_glob_parse

src/hdaccess.c:248–263  ·  view source on GitHub ↗

@ @ requires valid_read_string(device_pattern); @ requires \valid(list_disk); @ ensures \valid(list_disk); @*/

Source from the content-addressed store, hash-verified

246 @ ensures \valid(list_disk);
247 @*/
248static list_disk_t *hd_glob_parse(const char *device_pattern, list_disk_t *list_disk, const int verbose, const int testdisk_mode)
249{
250 glob_t globbuf;
251 globbuf.gl_offs = 0;
252 glob(device_pattern, GLOB_DOOFFS, NULL, &globbuf);
253 if(globbuf.gl_pathc>0)
254 {
255 unsigned int i;
256 for (i=0; i<globbuf.gl_pathc; i++)
257 {
258 list_disk=insert_new_disk(list_disk, file_test_availability(globbuf.gl_pathv[i], verbose, testdisk_mode));
259 }
260 }
261 globfree(&globbuf);
262 return list_disk;
263}
264#endif
265
266

Callers 1

hd_parseFunction · 0.85

Calls 1

insert_new_diskFunction · 0.85

Tested by

no test coverage detected