util: add new write_string_filef() helper
This new helper combines asprintf() and write_string_file() in one, which is useful at various places to shorten the code a bit.
This commit is contained in:
@@ -39,6 +39,8 @@ static inline int write_string_file(const char *fn, const char *line, WriteStrin
|
||||
return write_string_file_ts(fn, line, flags, NULL);
|
||||
}
|
||||
|
||||
int write_string_filef(const char *fn, WriteStringFileFlags flags, const char *format, ...) _printf_(3, 4);
|
||||
|
||||
int read_one_line_file(const char *fn, char **line);
|
||||
int read_full_file(const char *fn, char **contents, size_t *size);
|
||||
int read_full_stream(FILE *f, char **contents, size_t *size);
|
||||
|
||||
Reference in New Issue
Block a user