diff options
Diffstat (limited to 'src/multipart-replace.h')
-rw-r--r-- | src/multipart-replace.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/multipart-replace.h b/src/multipart-replace.h new file mode 100644 index 0000000..2aa5e61 --- /dev/null +++ b/src/multipart-replace.h @@ -0,0 +1,26 @@ +/* Copyright 2016 Luke Shumaker */ + +#pragma once + +#include <pthread.h> +#include <stdbool.h> + +struct frame { + ssize_t len; + size_t cap; + char *buf; +}; + +struct multipart_replace_stream { + struct frame a, b; + struct frame *front, *back; + pthread_rwlock_t frontlock; + long framecount; +}; + +void multipart_replace_reader(struct multipart_replace_stream *s, int fd, const char *boundary); +void multipart_replace_writer(struct multipart_replace_stream *s, int fd, const char *boundary); +void init_multipart_replace_stream(struct multipart_replace_stream *s); +void destroy_multipart_replace_stream(struct multipart_replace_stream *s); + +extern bool running; |