updated fuzz tests to use FileNamesTable* abstraction
This commit is contained in:
@@ -642,6 +642,15 @@ void UTIL_expandFNT(FileNamesTable** fnt, int followLinks)
|
||||
*fnt = newFNT;
|
||||
}
|
||||
|
||||
FileNamesTable* UTIL_createFNT_fromROTable(const char** filenames, size_t nbFilenames)
|
||||
{
|
||||
size_t const sizeof_FNTable = nbFilenames * sizeof(*filenames);
|
||||
const char** const newFNTable = (const char**)malloc(sizeof_FNTable);
|
||||
if (newFNTable==NULL) return NULL;
|
||||
memcpy(newFNTable, filenames, sizeof_FNTable);
|
||||
return UTIL_createFileNamesTable(newFNTable, nbFilenames, NULL);
|
||||
}
|
||||
|
||||
|
||||
/*-****************************************
|
||||
* count the number of physical cores
|
||||
|
||||
@@ -204,6 +204,14 @@ UTIL_mergeFileNamesTable(FileNamesTable* table1, FileNamesTable* table2);
|
||||
*/
|
||||
void UTIL_expandFNT(FileNamesTable** fnt, int followLinks);
|
||||
|
||||
/*! UTIL_createFNT_fromROTable() :
|
||||
* copy the @filenames pointer table inside the returned object.
|
||||
* The names themselves are still stored in their original buffer, which must outlive the object.
|
||||
* @return : a FileNamesTable* object,
|
||||
* or NULL in case of error
|
||||
*/
|
||||
FileNamesTable* UTIL_createFNT_fromROTable(const char** filenames, size_t nbFilenames);
|
||||
|
||||
/*! UTIL_createExpandedFNT() :
|
||||
* read names from @filenames, and expand those corresponding to directories
|
||||
* @return : an expanded FileNamesTable*, where each name is a file
|
||||
|
||||
Reference in New Issue
Block a user