diff options
Diffstat (limited to 'src/common/buffers.h')
-rw-r--r-- | src/common/buffers.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/common/buffers.h b/src/common/buffers.h index 77cc9ce0fb..73a688cff9 100644 --- a/src/common/buffers.h +++ b/src/common/buffers.h @@ -35,27 +35,27 @@ size_t buf_slack(const buf_t *buf); uint32_t buf_get_oldest_chunk_timestamp(const buf_t *buf, uint32_t now); size_t buf_get_total_allocation(void); -int read_to_buf(tor_socket_t s, size_t at_most, buf_t *buf, int *reached_eof, +int buf_read_from_socket(tor_socket_t s, size_t at_most, buf_t *buf, int *reached_eof, int *socket_error); -int flush_buf(tor_socket_t s, buf_t *buf, size_t sz, size_t *buf_flushlen); +int buf_flush_to_socket(tor_socket_t s, buf_t *buf, size_t sz, size_t *buf_flushlen); -int write_to_buf(const char *string, size_t string_len, buf_t *buf); -int write_to_buf_compress(buf_t *buf, struct tor_compress_state_t *state, +int buf_add(const char *string, size_t string_len, buf_t *buf); +int buf_add_compress(buf_t *buf, struct tor_compress_state_t *state, const char *data, size_t data_len, int done); -int move_buf_to_buf(buf_t *buf_out, buf_t *buf_in, size_t *buf_flushlen); -void peek_from_buf(char *string, size_t string_len, const buf_t *buf); -void buf_remove_from_front(buf_t *buf, size_t n); -int fetch_from_buf(char *string, size_t string_len, buf_t *buf); -int fetch_from_buf_line(buf_t *buf, char *data_out, size_t *data_len); +int buf_move_to_buf(buf_t *buf_out, buf_t *buf_in, size_t *buf_flushlen); +void buf_peek(char *string, size_t string_len, const buf_t *buf); +void buf_drain(buf_t *buf, size_t n); +int buf_get_bytes(char *string, size_t string_len, buf_t *buf); +int buf_get_line(buf_t *buf, char *data_out, size_t *data_len); #define PEEK_BUF_STARTSWITH_MAX 16 -int peek_buf_startswith(const buf_t *buf, const char *cmd); +int buf_peek_startswith(const buf_t *buf, const char *cmd); int buf_set_to_copy(buf_t **output, const buf_t *input); -void assert_buf_ok(buf_t *buf); +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, |