aboutsummaryrefslogtreecommitdiffstats
path: root/fs/common.h
diff options
context:
space:
mode:
authorOmar Rizwan <omar.rizwan@gmail.com>2019-02-25 13:02:25 -0800
committerOmar Rizwan <omar.rizwan@gmail.com>2019-02-25 13:02:25 -0800
commit784ec83696d9ecedc10ede022a035e671dd21607 (patch)
treea459ee535e22ce53c344dc53452050d511428a67 /fs/common.h
parent90181466bd12553abef43f165b7b8a2c7ad2f1c3 (diff)
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.
Diffstat (limited to 'fs/common.h')
-rw-r--r--fs/common.h18
1 files changed, 18 insertions, 0 deletions
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 <sys/types.h>
+
+#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