* Reads the whole file into buffer. * * @param filename The name of the file to open. * @param buf The buffer to read into. * @return The length of the file. */
| 962 | * @return The length of the file. |
| 963 | */ |
| 964 | uint32 File_ReadFile(const char *filename, void *buf) |
| 965 | { |
| 966 | uint8 index; |
| 967 | uint32 length; |
| 968 | |
| 969 | index = File_Open(filename, FILE_MODE_READ); |
| 970 | length = File_GetSize(index); |
| 971 | File_Read(index, buf, length); |
| 972 | File_Close(index); |
| 973 | |
| 974 | return length; |
| 975 | } |
| 976 | |
| 977 | /** |
| 978 | * Open a chunk file (starting with FORM) for reading. |
no test coverage detected