summaryrefslogtreecommitdiff
path: root/multipart-replace.h
diff options
context:
space:
mode:
Diffstat (limited to 'multipart-replace.h')
-rw-r--r--multipart-replace.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/multipart-replace.h b/multipart-replace.h
new file mode 100644
index 0000000..126f6fa
--- /dev/null
+++ b/multipart-replace.h
@@ -0,0 +1,22 @@
+/* Copyright 2016 Luke Shumaker */
+
+#pragma once
+
+#include <pthread.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();