#ifndef UCORE_READ_FILE_H_ #define UCORE_READ_FILE_H_y #include /** Read the content of a file. * The returned char* is malloced memory and must be freed by the caller. * The content is terminated by a nul byte, regardless of whether the content * is binary or text. The returned length does not include this nul byte. * * @param file_name name of the file * @param length Returned length of the content read * @param max Fail if the read content length is greater than max. * @return The content read from the file, or NULL if something failed * (inspect errno to see why it failed) */ char * uc_read_file(const char *file_name, size_t *length, size_t max); #endif