* Reads length bytes from filename into buffer. * * @param filename Then name of the file to read. * @param buffer The buffer to read into. * @param length The amount of bytes to read. * @return The amount of bytes truly read, or 0 if there was a failure. */
| 879 | * @return The amount of bytes truly read, or 0 if there was a failure. |
| 880 | */ |
| 881 | uint32 File_ReadBlockFile_Ex(enum SearchDirectory dir, const char *filename, void *buffer, uint32 length) |
| 882 | { |
| 883 | uint8 index; |
| 884 | |
| 885 | index = File_Open_Ex(dir, filename, FILE_MODE_READ); |
| 886 | if (index == FILE_INVALID) return 0; |
| 887 | length = File_Read(index, buffer, length); |
| 888 | File_Close(index); |
| 889 | return length; |
| 890 | } |
| 891 | |
| 892 | /** |
| 893 | * Reads the whole file in the memory. |
nothing calls this directly
no test coverage detected