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

Function ilIsValidTpl

DevIL/src-IL/src/il_tpl.cpp:59–79  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

57
58//! Checks if the file specified in FileName is a valid TPL file.
59ILboolean ilIsValidTpl(ILconst_string FileName)
60{
61 ILHANDLE TplFile;
62 ILboolean bTpl = IL_FALSE;
63
64 if (!iCheckExtension(FileName, IL_TEXT("tpl"))) {
65 ilSetError(IL_INVALID_EXTENSION);
66 return bTpl;
67 }
68
69 TplFile = iopenr(FileName);
70 if (TplFile == NULL) {
71 ilSetError(IL_COULD_NOT_OPEN_FILE);
72 return bTpl;
73 }
74
75 bTpl = ilIsValidTplF(TplFile);
76 icloser(TplFile);
77
78 return bTpl;
79}
80
81
82//! Checks if the ILHANDLE contains a valid TPL file at the current position.

Callers 1

ILAPIENTRY ilIsValidFunction · 0.85

Calls 3

iCheckExtensionFunction · 0.85
ilSetErrorFunction · 0.85
ilIsValidTplFFunction · 0.85

Tested by

no test coverage detected