summaryrefslogtreecommitdiff
path: root/kernel/fd.h
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-08-17 21:41:21 +0200
committerMiguel <m.i@gmx.at>2018-08-17 21:41:21 +0200
commitc15925a24efe14f437d8a2699500241a58fdc8f9 (patch)
treec0db3a7d2a4f857324735df35e9cc1f0539c5f24 /kernel/fd.h
parent6fd78c2ff950310d8372ec0353553cc4a5a43e72 (diff)
cleanup and working on fifo pipes
Diffstat (limited to 'kernel/fd.h')
-rw-r--r--kernel/fd.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/fd.h b/kernel/fd.h
new file mode 100644
index 0000000..fe048f4
--- /dev/null
+++ b/kernel/fd.h
@@ -0,0 +1,30 @@
+// SIMPLE FILE DESCRIPTOR //
+
+#ifndef FD_H
+#define FD_H
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include "fifo.h"
+
+typedef struct fd_struct
+{
+ bool (*write)(struct fd_struct*,uint8_t);
+ uint8_t (*read)(struct fd_struct*);
+ bool (*has)(struct fd_struct*);
+ bool (*close)(struct fd_struct*);
+
+ void *data; // opaque data
+
+}fd;
+
+uint8_t fd_read(fd*);
+bool fd_has(fd*);
+bool fd_write(fd*,uint8_t);
+bool fd_close(fd*);
+
+fd fd_from_fifo(fifo* f);
+//fd fd_from_path(char *path);
+
+#endif