diff options
author | Jakob Odersky <jodersky@gmail.com> | 2014-04-08 13:18:27 +0200 |
---|---|---|
committer | Jakob Odersky <jodersky@gmail.com> | 2014-04-08 14:57:10 +0200 |
commit | 350437ef4b8ba0811d285f7454d2b54ffce6b029 (patch) | |
tree | 5084c73adbb4cc3aee9d000b3816d98a57203f36 /kernel/include/mux/io.h | |
parent | c4ebb91caf33ecf5a47785584a4231eb1e4dfa2a (diff) | |
download | mux-350437ef4b8ba0811d285f7454d2b54ffce6b029.tar.gz mux-350437ef4b8ba0811d285f7454d2b54ffce6b029.tar.bz2 mux-350437ef4b8ba0811d285f7454d2b54ffce6b029.zip |
change build structure
Diffstat (limited to 'kernel/include/mux/io.h')
-rw-r--r-- | kernel/include/mux/io.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/include/mux/io.h b/kernel/include/mux/io.h new file mode 100644 index 0000000..4ec45f5 --- /dev/null +++ b/kernel/include/mux/io.h @@ -0,0 +1,30 @@ +#ifndef MUX_IO_H +#define MUX_IO_H + +#include <stddef.h> + +typedef long ssize_t; + +struct file; +struct file_operations; + +struct file { + struct file_operations* const fops; + void* private_data; +}; + +struct file_operations { + int (*open)(struct file* file); + int (*ioctl)(struct file* file, int cmd, long args); + ssize_t (*read)(struct file* file, char* const buffer, size_t size); + ssize_t (*write)(struct file* file, const char* const buffer, size_t size); + int (*close)(struct file* file); +}; + +int open(struct file* file); +int ioctl(struct file* file, int cmd, long args); +ssize_t read(struct file* file, char* const buffer, size_t size); +ssize_t write(struct file* file, const char* const buffer, size_t size); +int close(struct file* file); + +#endif
\ No newline at end of file |