Add bt_common_append_file_content_to_g_string()
[babeltrace.git] / src / common / common.h
index 4a2362e34e14be0477d07f47c64c535100ce1e38..1751f20bd74ad65c47fcb07b1362906f6ac7b7d2 100644 (file)
@@ -31,6 +31,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <unistd.h>
 #include <string.h>
 
@@ -351,6 +352,15 @@ GString *bt_common_fold(const char *str, unsigned int total_length,
 BT_HIDDEN
 int bt_common_get_term_size(unsigned int *width, unsigned int *height);
 
+/*
+ * Appends the textual content of `fp` to `str`, starting from its
+ * current position to the end of the file.
+ *
+ * This function does NOT rewind `fp` once it's done or on error.
+ */
+BT_HIDDEN
+int bt_common_append_file_content_to_g_string(GString *str, FILE *fp);
+
 /*
  * Wraps read() function to handle EINTR and partial reads.
  * On success, it returns `count` received as parameter. On error, it returns a
This page took 0.023791 seconds and 4 git commands to generate.