diff options
author | Brandon Williams <bmwill@google.com> | 2017-10-16 10:55:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-17 10:51:29 +0900 |
commit | 5d2124b34a11967b56bfeb57556be5e4583172c8 (patch) | |
tree | 5f4a2c5923b639c8b499608ef93cc038c3889043 /pkt-line.h | |
parent | 0cd83283dfd2a22b3f95cbee6eaef196e6bde77d (diff) | |
download | git-5d2124b34a11967b56bfeb57556be5e4583172c8.tar.gz |
pkt-line: add packet_write function
Add a function which can be used to write the contents of an arbitrary
buffer. This makes it easy to build up data in a buffer before writing
the packet instead of formatting the entire contents of the packet using
'packet_write_fmt()'.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pkt-line.h')
-rw-r--r-- | pkt-line.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pkt-line.h b/pkt-line.h index 66ef610fc4..3dad583e2d 100644 --- a/pkt-line.h +++ b/pkt-line.h @@ -22,6 +22,7 @@ void packet_flush(int fd); void packet_write_fmt(int fd, const char *fmt, ...) __attribute__((format (printf, 2, 3))); void packet_buf_flush(struct strbuf *buf); +void packet_write(int fd_out, const char *buf, size_t size); void packet_buf_write(struct strbuf *buf, const char *fmt, ...) __attribute__((format (printf, 2, 3))); int packet_flush_gently(int fd); int packet_write_fmt_gently(int fd, const char *fmt, ...) __attribute__((format (printf, 2, 3))); |