MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / File_ReadFile

Function File_ReadFile

src/file.c:964–975  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

962 * @return The length of the file.
963 */
964uint32 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.

Callers 1

Calls 3

File_GetSizeFunction · 0.85
File_ReadFunction · 0.85
File_CloseFunction · 0.85

Tested by

no test coverage detected