diff options
| author | Miguel <m.i@gmx.at> | 2018-09-18 03:03:28 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-18 03:03:28 +0200 |
| commit | 2d91384197847a7e8fe2c3f548918a8277d3086d (patch) | |
| tree | 7c93404e290a0ffbdaf9a8a94766d7bd0fd6e4f2 /fs/fd.h | |
| parent | 06e6e427c76bdb88a7f72dd04411d95a4bda3270 (diff) | |
sysfs, errno, improve foolshell, etc
Diffstat (limited to 'fs/fd.h')
| -rw-r--r-- | fs/fd.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -7,6 +7,7 @@ #include <stdbool.h> #include "fifo.h" +#include "ringbuffer.h" /* typedef struct @@ -27,7 +28,8 @@ typedef struct enum FD_TYPE{ FD_TYPE_FIFO_BUFFERED=1, FD_TYPE_EXT2_FILE=2, - FD_TYPE_EXT2_DIR=3 + FD_TYPE_EXT2_DIR=3, + FD_TYPE_SYSFS=4 }; typedef struct fd_struct @@ -35,6 +37,7 @@ typedef struct fd_struct bool (*write)(struct fd_struct*,uint8_t); uint8_t (*read)(struct fd_struct*); bool (*has)(struct fd_struct*); + bool (*eof)(struct fd_struct*); bool (*close)(struct fd_struct*); uint8_t type; @@ -43,10 +46,11 @@ typedef struct fd_struct uint8_t fd_read(fd*); bool fd_has(fd*); +bool fd_eof(fd*); bool fd_write(fd*,uint8_t); bool fd_close(fd*); fd fd_from_fifo(fifo* f); fd fd_from_path(char *path); -//fd fd_from_sysfs(void(*g)(void (*f)(char *fmt, ...))); +fd fd_from_sysfs(void(*g)(ringbuffer *r,void (*f)(ringbuffer *r,char *fmt, ...))); #endif |
