MCPcopy Create free account
hub / github.com/DentonW/DevIL / ilIsValidVtf

Function ilIsValidVtf

DevIL/src-IL/src/il_vtf.cpp:27–47  ·  view source on GitHub ↗

Checks if the file specified in FileName is a valid VTF file.

Source from the content-addressed store, hash-verified

25
26//! Checks if the file specified in FileName is a valid VTF file.
27ILboolean ilIsValidVtf(ILconst_string FileName)
28{
29 ILHANDLE VtfFile;
30 ILboolean bVtf = IL_FALSE;
31
32 if (!iCheckExtension(FileName, IL_TEXT("vtf"))) {
33 ilSetError(IL_INVALID_EXTENSION);
34 return bVtf;
35 }
36
37 VtfFile = iopenr(FileName);
38 if (VtfFile == NULL) {
39 ilSetError(IL_COULD_NOT_OPEN_FILE);
40 return bVtf;
41 }
42
43 bVtf = ilIsValidVtfF(VtfFile);
44 icloser(VtfFile);
45
46 return bVtf;
47}
48
49
50//! Checks if the ILHANDLE contains a valid VTF file at the current position.

Callers 1

ILAPIENTRY ilIsValidFunction · 0.85

Calls 3

iCheckExtensionFunction · 0.85
ilSetErrorFunction · 0.85
ilIsValidVtfFFunction · 0.85

Tested by

no test coverage detected