diff options
author | Lennart Poettering <lennart@poettering.net> | 2003-12-23 00:05:15 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2003-12-23 00:05:15 +0000 |
commit | 33f01df1c95b43b66e2f0bab2b972dd9e03faeb5 (patch) | |
tree | 053f3bcff15d9161e6b2f0c942941052de5fb14f /src/buffio.h | |
parent | 51c0330ea15a28d2d7c83a746458dfd5cf1770bc (diff) |
it compiles and works basically
git-svn-id: file:///home/lennart/svn/public/ivam2/trunk@9 dbf6933d-3bce-0310-9bcc-ed052ba35b35
Diffstat (limited to 'src/buffio.h')
-rw-r--r-- | src/buffio.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/buffio.h b/src/buffio.h index a340385..e0a2d0a 100644 --- a/src/buffio.h +++ b/src/buffio.h @@ -1,14 +1,18 @@ #ifndef foobuffiohfoo #define foobuffiohfoo +#include <inttypes.h> +#include <sys/types.h> + struct buffio { - int fd; + int ifd; + int ofd; uint8_t *input_buf; - size_t input_max_length, input_index, input_length; + size_t input_max_length, input_index, input_length, input_watermark; uint8_t *output_buf; - size_t output_max_length, output_index, output_length; + size_t output_max_length, output_index, output_length, output_watermark; int b_read_cb, b_write_cb; @@ -19,7 +23,7 @@ struct buffio { void (*input_ready_cb) (struct buffio *b, void *user); }; -struct buffio buffio_new(int fd); +struct buffio* buffio_new(int ifd, int ofd); void buffio_free(struct buffio *b); int buffio_write(struct buffio *b, const uint8_t *d, size_t l); @@ -28,5 +32,8 @@ int buffio_print(struct buffio *b, const char *s); int buffio_command(struct buffio *b, const char *c); void buffio_flush_input(struct buffio *b); int buffio_find_input(struct buffio *b, const char *c); +char *buffio_read_line(struct buffio *b, char *c, size_t l); + +void buffio_dump(struct buffio *b); #endif |