MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / _File_Init_Callback

Function _File_Init_Callback

src/file.c:443–460  ·  view source on GitHub ↗

* Callback for processing files found in data/ directory. * * @param name The name of the file. * @param path The relative path of the file. * @param size The file size (bytes). * @return True if the processing went OK. */

Source from the content-addressed store, hash-verified

441 * @return True if the processing went OK.
442 */
443static bool _File_Init_Callback(const char *name, const char *path, uint32 size)
444{
445 char *ext;
446 FileInfo *fileInfo;
447
448 fileInfo = _File_Init_AddFileInRootDir(name, size);
449 if (fileInfo == NULL) return false;
450 ext = strrchr(path, '.');
451 if (ext != NULL) {
452 if (strcasecmp(ext, ".pak") == 0) {
453 if (!_File_Init_ProcessPak(path, size, fileInfo)) {
454 Warning("Failed to process PAK file %s\n", path);
455 return false;
456 }
457 }
458 }
459 return true;
460}
461
462static bool File_MakeDirectory(char *dir)
463{

Callers

nothing calls this directly

Calls 3

_File_Init_ProcessPakFunction · 0.85
WarningFunction · 0.50

Tested by

no test coverage detected