adds vectored function for text and binary
[src/app-framework-binder.git] / src / afb-ws.h
index 49deaac..af435ea 100644 (file)
@@ -18,6 +18,8 @@
 #pragma once
 
 struct afb_ws;
+struct sd_event;
+struct iovec;
 
 struct afb_ws_itf
 {
@@ -28,7 +30,7 @@ struct afb_ws_itf
        void (*on_hangup) (void *); /* optional, it is safe too call afb_ws_destroy within the callback */
 };
 
-extern struct afb_ws *afb_ws_create(int fd, const struct afb_ws_itf *itf, void *closure);
+extern struct afb_ws *afb_ws_create(struct sd_event *eloop, int fd, const struct afb_ws_itf *itf, void *closure);
 extern void afb_ws_destroy(struct afb_ws *ws);
 extern void afb_ws_hangup(struct afb_ws *ws);
 extern int afb_ws_close(struct afb_ws *ws, uint16_t code, const char *reason);
@@ -36,4 +38,6 @@ extern int afb_ws_error(struct afb_ws *ws, uint16_t code, const char *reason);
 extern int afb_ws_text(struct afb_ws *ws, const char *text, size_t length);
 extern int afb_ws_texts(struct afb_ws *ws, ...);
 extern int afb_ws_binary(struct afb_ws *ws, const void *data, size_t length);
+extern int afb_ws_text_v(struct afb_ws *ws, const struct iovec *iovec, int count);
+extern int afb_ws_binary_v(struct afb_ws *ws, const struct iovec *iovec, int count);