aboutsummaryrefslogtreecommitdiff
path: root/src/common/buffers.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-06 09:07:50 -0400
committerNick Mathewson <nickm@torproject.org>2017-11-02 10:00:32 -0400
commitd5ba4851bd8c05ac5a43e302506a1ed67f6be7e7 (patch)
tree58e70fe32a228057d6e6d10921134e04d01a813a /src/common/buffers.h
parent342712b9ef12c0234def9c2b4eb5c63f54c8bb5b (diff)
downloadtor-d5ba4851bd8c05ac5a43e302506a1ed67f6be7e7.tar.gz
tor-d5ba4851bd8c05ac5a43e302506a1ed67f6be7e7.zip
Add buf_t API helpers for using buffers to construct outputs.
Diffstat (limited to 'src/common/buffers.h')
-rw-r--r--src/common/buffers.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/buffers.h b/src/common/buffers.h
index 5a52b2a81c..b05c5b13d4 100644
--- a/src/common/buffers.h
+++ b/src/common/buffers.h
@@ -43,6 +43,11 @@ int buf_flush_to_socket(buf_t *buf, tor_socket_t s, size_t sz,
size_t *buf_flushlen);
int buf_add(buf_t *buf, const char *string, size_t string_len);
+void buf_add_string(buf_t *buf, const char *string);
+void buf_add_printf(buf_t *buf, const char *format, ...)
+ CHECK_PRINTF(2, 3);
+void buf_add_vprintf(buf_t *buf, const char *format, va_list args)
+ CHECK_PRINTF(2, 0);
int buf_add_compress(buf_t *buf, struct tor_compress_state_t *state,
const char *data, size_t data_len, int done);
int buf_move_to_buf(buf_t *buf_out, buf_t *buf_in, size_t *buf_flushlen);
@@ -62,6 +67,7 @@ void buf_assert_ok(buf_t *buf);
int buf_find_string_offset(const buf_t *buf, const char *s, size_t n);
void buf_pullup(buf_t *buf, size_t bytes,
const char **head_out, size_t *len_out);
+char *buf_extract(buf_t *buf, size_t *sz_out);
#ifdef BUFFERS_PRIVATE
#ifdef TOR_UNIT_TESTS