From 784ec83696d9ecedc10ede022a035e671dd21607 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Mon, 25 Feb 2019 13:02:25 -0800 Subject: Rewrite and refactor C half. No more shared memory! It's fast! Three C modules: - tabfs (main thread; talks to FUSE) - common (tabfs<->ws communication helpers) - ws (side thread; talks to browser over WebSocket) It's single-threaded, but I don't think that matters anyway. --- fs/common.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 fs/common.h (limited to 'fs/common.h') diff --git a/fs/common.h b/fs/common.h new file mode 100644 index 0000000..79fd9f3 --- /dev/null +++ b/fs/common.h @@ -0,0 +1,18 @@ +#ifndef COMMON_H +#define COMMON_H + +#include + +#define DEBUG(...) + +void common_init(); + +typedef int (*fd_set_filler_fn_t)(fd_set*, fd_set*, fd_set*); + +void common_send_tabfs_to_ws(char *request_data); +char *common_receive_tabfs_to_ws(fd_set_filler_fn_t filler); + +void common_send_ws_to_tabfs(char *response_data); +char *common_receive_ws_to_tabfs(); + +#endif -- cgit v1.2.3