}
+UTIL_STATIC U64 UTIL_getTotalFileSize(const char** fileNamesTable, unsigned nbFiles)
+{
+ U64 total = 0;
+ unsigned n;
+ for (n=0; n<nbFiles; n++)
+ total += UTIL_getFileSize(fileNamesTable[n]);
+ return total;
+}
+
+
UTIL_STATIC U32 UTIL_isDirectory(const char* infilename)
{
int r;
/* *************************************
* Includes
***************************************/
+#include "util.h" /* UTIL_GetFileSize */
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memset */
#include <stdio.h> /* fprintf, fopen, ftello64 */
-#include "util.h" /* UTIL_GetFileSize */
#include "mem.h"
#include "zstd_static.h"
#include "datagen.h" /* RDG_genBuffer */
}
}
-static U64 BMK_getTotalFileSize(const char** fileNamesTable, unsigned nbFiles)
-{
- U64 total = 0;
- unsigned n;
- for (n=0; n<nbFiles; n++)
- total += UTIL_getFileSize(fileNamesTable[n]);
- return total;
-}
/*! BMK_loadFiles() :
Loads `buffer` with content of files listed within `fileNamesTable`.
void* dictBuffer = NULL;
size_t dictBufferSize = 0;
size_t* fileSizes = (size_t*)malloc(nbFiles * sizeof(size_t));
- U64 totalSizeToLoad = BMK_getTotalFileSize(fileNamesTable, nbFiles);
+ U64 totalSizeToLoad = UTIL_getTotalFileSize(fileNamesTable, nbFiles);
char mfName[20] = {0};
const char* displayName = NULL;
/* ********************************************************
* File related operations
**********************************************************/
-static unsigned long long DiB_getTotalFileSize(const char** fileNamesTable, unsigned nbFiles)
-{
- unsigned long long total = 0;
- unsigned n;
- for (n=0; n<nbFiles; n++)
- total += UTIL_getFileSize(fileNamesTable[n]);
- return total;
-}
-
-
static void DiB_loadFiles(void* buffer, size_t bufferSize,
size_t* fileSizes,
const char** fileNamesTable, unsigned nbFiles)
void* srcBuffer;
size_t benchedSize;
size_t* fileSizes = (size_t*)malloc(nbFiles * sizeof(size_t));
- unsigned long long totalSizeToLoad = DiB_getTotalFileSize(fileNamesTable, nbFiles);
+ unsigned long long totalSizeToLoad = UTIL_getTotalFileSize(fileNamesTable, nbFiles);
void* dictBuffer = malloc(maxDictSize);
size_t dictSize;
int result = 0;