summaryrefslogtreecommitdiff
path: root/fs/fifo.h
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-10-22 19:50:38 +0200
committerAnton Kling <anton@kling.gg>2023-10-22 19:50:38 +0200
commit4e09bca9e34c226b6d7e34b4fa11248405fd988e (patch)
tree80f156b7940d9d19971395f335530170c69516c7 /fs/fifo.h
Move everything into a new repo.
Diffstat (limited to 'fs/fifo.h')
-rw-r--r--fs/fifo.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/fs/fifo.h b/fs/fifo.h
new file mode 100644
index 0000000..ee91ba1
--- /dev/null
+++ b/fs/fifo.h
@@ -0,0 +1,26 @@
+#ifndef FIFO_H
+#define FIFO_H
+#include "vfs.h"
+#include <stddef.h>
+#include <stdint.h>
+
+typedef struct {
+ char *buffer;
+ uint64_t buffer_len;
+ uint64_t write_len;
+ uint8_t is_blocking;
+ uint8_t has_data;
+ uint8_t can_write;
+} FIFO_FILE;
+
+int create_fifo(void);
+FIFO_FILE *create_fifo_object(void);
+int fifo_object_write(uint8_t *buffer, uint64_t offset, uint64_t len,
+ FIFO_FILE *file);
+int fifo_object_read(uint8_t *buffer, uint64_t offset, uint64_t len,
+ FIFO_FILE *file);
+int fifo_write(uint8_t *buffer, uint64_t offset, uint64_t len,
+ vfs_fd_t *fd);
+int fifo_read(uint8_t *buffer, uint64_t offset, uint64_t len,
+ vfs_fd_t *fd);
+#endif