Checks if the file specified in FileName is a valid TPL file.
| 57 | |
| 58 | //! Checks if the file specified in FileName is a valid TPL file. |
| 59 | ILboolean 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. |
no test coverage detected