Mercurial > trustbridge
diff common/listutil.c @ 769:44257ecdae6d
Make Read File public
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 10 Jul 2014 19:11:09 +0200 |
parents | aa48ea7ead1f |
children | 7861950f7637 |
line wrap: on
line diff
--- a/common/listutil.c Thu Jul 10 19:10:23 2014 +0200 +++ b/common/listutil.c Thu Jul 10 19:11:09 2014 +0200 @@ -34,24 +34,13 @@ #define MAX_FILESIZE (MAX_LINE_LENGTH * MAX_LINES) -/** - * @brief Read a file into memory. - * - * The caller needs to free data - * - * @param[in] fileName Name of the file. - * @param[out] data the file content - * @param[out] size size in bytes of the file content. - * @param[in] max_size the maximum amount of bytes to read. - * - * @return 0 on success an error code otherwise. - */ #define READ_FILE_UNREADABLE -1 #define READ_FILE_TOO_LARGE -2 #define READ_FILE_NO_MEMORY -3 #define READ_FILE_READ_FAILED -4 #define READ_FILE_INVALID_CALL -5 -static int read_file(const char *file_name, char **data, size_t *size, +int +read_file(const char *file_name, char **data, size_t *size, const size_t max_size) { FILE *f;