From 5921b465e7764d35b3f128cf0cf096eca3226688 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 8 Aug 2017 12:23:39 -0400 Subject: Make buffers.c independent of or.h Also, put ext_or function in new module; it had accidentally gotten into proto_socks.c --- src/or/buffers.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/or/buffers.h') diff --git a/src/or/buffers.h b/src/or/buffers.h index e710ac64a4..35fa46593b 100644 --- a/src/or/buffers.h +++ b/src/or/buffers.h @@ -12,8 +12,17 @@ #ifndef TOR_BUFFERS_H #define TOR_BUFFERS_H +#include "compat.h" +#include "compat.h" +#include "torint.h" #include "testsupport.h" +typedef struct buf_t buf_t; + +struct tor_tls_t; +struct tor_compress_state_t; +struct ext_or_cmd_t; + buf_t *buf_new(void); buf_t *buf_new_with_capacity(size_t size); size_t buf_get_default_chunk_size(const buf_t *buf); @@ -30,13 +39,14 @@ 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 *socket_error); -int read_to_buf_tls(tor_tls_t *tls, size_t at_most, buf_t *buf); +int read_to_buf_tls(struct tor_tls_t *tls, size_t at_most, buf_t *buf); int flush_buf(tor_socket_t s, buf_t *buf, size_t sz, size_t *buf_flushlen); -int flush_buf_tls(tor_tls_t *tls, buf_t *buf, size_t sz, size_t *buf_flushlen); +int flush_buf_tls(struct tor_tls_t *tls, 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, tor_compress_state_t *state, +int write_to_buf_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); @@ -47,8 +57,6 @@ int fetch_from_buf_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 fetch_ext_or_command_from_buf(buf_t *buf, ext_or_cmd_t **out); - int buf_set_to_copy(buf_t **output, const buf_t *input); -- cgit v1.2.3-54-g00ecf