diff options
Diffstat (limited to 'strbuf.h')
-rw-r--r-- | strbuf.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -377,6 +377,8 @@ extern ssize_t strbuf_read_once(struct strbuf *, int fd, size_t hint); /** * Read the contents of a file, specified by its path. The third argument * can be used to give a hint about the file size, to avoid reallocs. + * Return the number of bytes read or a negative value if some error + * occurred while opening or reading the file. */ extern ssize_t strbuf_read_file(struct strbuf *sb, const char *path, size_t hint); @@ -387,6 +389,12 @@ extern ssize_t strbuf_read_file(struct strbuf *sb, const char *path, size_t hint extern int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint); /** + * Write the whole content of the strbuf to the stream not stopping at + * NUL bytes. + */ +extern ssize_t strbuf_write(struct strbuf *sb, FILE *stream); + +/** * Read a line from a FILE *, overwriting the existing contents of * the strbuf. The strbuf_getline*() family of functions share * this signature, but have different line termination conventions. |