summaryrefslogtreecommitdiff
path: root/src/basic/fileio.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/fileio.h')
-rw-r--r--src/basic/fileio.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/basic/fileio.h b/src/basic/fileio.h
index 989b904c26..2e8148ff24 100644
--- a/src/basic/fileio.h
+++ b/src/basic/fileio.h
@@ -25,10 +25,14 @@
#include "macro.h"
+typedef enum {
+ WRITE_STRING_FILE_CREATE = 1,
+ WRITE_STRING_FILE_ATOMIC = 2,
+ WRITE_STRING_FILE_AVOID_NEWLINE = 4,
+} WriteStringFileFlags;
+
int write_string_stream(FILE *f, const char *line, bool enforce_newline);
-int write_string_file(const char *fn, const char *line);
-int write_string_file_no_create(const char *fn, const char *line);
-int write_string_file_atomic(const char *fn, const char *line);
+int write_string_file(const char *fn, const char *line, WriteStringFileFlags flags);
int read_one_line_file(const char *fn, char **line);
int read_full_file(const char *fn, char **contents, size_t *size);