Internal function used to check if the HEADER is a valid .pnm header.
| 96 | |
| 97 | // Internal function used to check if the HEADER is a valid .pnm header. |
| 98 | ILboolean iCheckPnm(char Header[2]) |
| 99 | { |
| 100 | if (Header[0] != 'P') |
| 101 | return IL_FALSE; |
| 102 | switch (Header[1]) |
| 103 | { |
| 104 | case '1': |
| 105 | case '2': |
| 106 | case '3': |
| 107 | case '4': |
| 108 | case '5': |
| 109 | case '6': |
| 110 | return IL_TRUE; |
| 111 | } |
| 112 | |
| 113 | return IL_FALSE; |
| 114 | } |
| 115 | |
| 116 | |
| 117 | // Reads a file |