Checks if the file specified in FileName is a valid Sun file.
| 49 | |
| 50 | //! Checks if the file specified in FileName is a valid Sun file. |
| 51 | ILboolean ilIsValidSun(ILconst_string FileName) |
| 52 | { |
| 53 | ILHANDLE SunFile; |
| 54 | ILboolean bSun = IL_FALSE; |
| 55 | |
| 56 | if (!iCheckExtension(FileName, IL_TEXT("sun")) && !iCheckExtension(FileName, IL_TEXT("ras")) && |
| 57 | !iCheckExtension(FileName, IL_TEXT("im1")) && !iCheckExtension(FileName, IL_TEXT("im8")) && |
| 58 | !iCheckExtension(FileName, IL_TEXT("im24")) && !iCheckExtension(FileName, IL_TEXT("im32")) && |
| 59 | !iCheckExtension(FileName, IL_TEXT("rs"))) { // Lots of names possible... |
| 60 | ilSetError(IL_INVALID_EXTENSION); |
| 61 | return bSun; |
| 62 | } |
| 63 | |
| 64 | SunFile = iopenr(FileName); |
| 65 | if (SunFile == NULL) { |
| 66 | ilSetError(IL_COULD_NOT_OPEN_FILE); |
| 67 | return bSun; |
| 68 | } |
| 69 | |
| 70 | bSun = ilIsValidSunF(SunFile); |
| 71 | icloser(SunFile); |
| 72 | |
| 73 | return bSun; |
| 74 | } |
| 75 | |
| 76 | |
| 77 | //! Checks if the ILHANDLE contains a valid Sun file at the current position. |
no test coverage detected