// Reads a file ILboolean ilLoadIlbm(ILconst_string FileName) { ILHANDLE IlbmFile; ILboolean bIlbm = IL_FALSE; IlbmFile = iopenr(FileName); if (IlbmFile == NULL) { ilSetError(IL_COULD_NOT_OPEN_FILE); return bIlbm; } bIlbm = ilLoadIlbmF(IlbmFile); icloser(IlbmFile); return bIlbm; }
//! Reads an already-opened IFF file ILboolean ilLoadIffF(ILHANDLE File) { ILuint FirstPos; ILboolean bRet; iSetInputFile(File); FirstPos = itell(); bRet = iLoadIffInternal(); iseek(FirstPos, IL_SEEK_SET); // Lbm files can have the .iff extension as well, so if Iff-loading failed, // try to load it as a Lbm. if (bRet == IL_FALSE) return ilLoadIlbmF(File); return bRet; }