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

Function ilIsValidBmp

DevIL/src-IL/src/il_bmp.cpp:23–43  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

21
22//! Checks if the file specified in FileName is a valid .bmp file.
23ILboolean ilIsValidBmp(ILconst_string CONST_RESTRICT FileName)
24{
25 ILHANDLE BitmapFile;
26 ILboolean bBitmap = IL_FALSE;
27
28 if (!iCheckExtension(FileName, IL_TEXT("bmp"))) {
29 ilSetError(IL_INVALID_EXTENSION);
30 return bBitmap;
31 }
32
33 BitmapFile = iopenr(FileName);
34 if (BitmapFile == NULL) {
35 ilSetError(IL_COULD_NOT_OPEN_FILE);
36 return bBitmap;
37 }
38
39 bBitmap = ilIsValidBmpF(BitmapFile);
40 icloser(BitmapFile);
41
42 return bBitmap;
43}
44
45
46//! Checks if the ILHANDLE contains a valid .bmp file at the current position.

Callers 1

ILAPIENTRY ilIsValidFunction · 0.85

Calls 3

iCheckExtensionFunction · 0.85
ilSetErrorFunction · 0.85
ilIsValidBmpFFunction · 0.85

Tested by

no test coverage detected