[PATCH 2 of 6] Make Read File public
Wald Commits
scm-commit at wald.intevation.org
Thu Jul 10 19:17:03 CEST 2014
# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1405012269 -7200
# Node ID 44257ecdae6da866c5e508cb99385087961ca489
# Parent 3f290ea49d45ff79e651f544964546bbd4f87524
Make Read File public
diff -r 3f290ea49d45 -r 44257ecdae6d common/listutil.c
--- 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;
diff -r 3f290ea49d45 -r 44257ecdae6d common/listutil.h
--- a/common/listutil.h Thu Jul 10 19:10:23 2014 +0200
+++ b/common/listutil.h Thu Jul 10 19:11:09 2014 +0200
@@ -81,6 +81,20 @@
* */
char **get_certs_from_list (char *data, const size_t size);
+/**
+ * @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.
+ */
+int read_file(const char *file_name, char **data, size_t *size,
+ const size_t max_size);
#ifdef __cplusplus
}
#endif
More information about the Trustbridge-commits
mailing list