summaryrefslogtreecommitdiff
path: root/src/or/buffers.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-08-08 12:23:39 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-05 13:57:51 -0400
commit5921b465e7764d35b3f128cf0cf096eca3226688 (patch)
tree51f77fb0284b14bad8121043b00582e050b581c0 /src/or/buffers.h
parentf28e314b0d5a6d4c677b87378cea70dc6524546b (diff)
downloadtor-5921b465e7764d35b3f128cf0cf096eca3226688.tar.gz
tor-5921b465e7764d35b3f128cf0cf096eca3226688.zip
Make buffers.c independent of or.h
Also, put ext_or function in new module; it had accidentally gotten into proto_socks.c
Diffstat (limited to 'src/or/buffers.h')
-rw-r--r--src/or/buffers.h18
1 files changed, 13 insertions, 5 deletions
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);