summaryrefslogtreecommitdiff
path: root/fs/fifo.h
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-20 20:51:57 +0200
committerMiguel <m.i@gmx.at>2018-09-20 20:51:57 +0200
commitaeefdb37d1fc1c0eb7953b9c196cab09460bc167 (patch)
tree513789d7fd28b65afb594e9605975bd10ea06f74 /fs/fifo.h
parent763f85c55fdb5a2c4f5bf98e4989a69d27da6e4f (diff)
we are now prepared for piping with _pipe and _dup2
Diffstat (limited to 'fs/fifo.h')
-rw-r--r--fs/fifo.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/fifo.h b/fs/fifo.h
new file mode 100644
index 0000000..92f3b75
--- /dev/null
+++ b/fs/fifo.h
@@ -0,0 +1,23 @@
+// SIMPLE FIFO DRIVER //
+
+#ifndef FIFO_H
+#define FIFO_H
+
+#include <stdint.h>
+#include <stdbool.h>
+
+typedef struct fifo_struct
+{
+ bool (*put)(struct fifo_struct*,uint8_t);
+ uint8_t (*get)(struct fifo_struct*);
+ bool (*has)(struct fifo_struct*);
+ void *data; // opaque data
+
+}fifo;
+
+bool fifo_put(fifo*,uint8_t);
+uint8_t fifo_get(fifo*);
+bool fifo_has(fifo*);
+
+fifo fifo_create_buffered(uint8_t size);
+#endif