summaryrefslogtreecommitdiffstats
path: root/src/iochannel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/iochannel.h')
-rw-r--r--src/iochannel.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/iochannel.h b/src/iochannel.h
new file mode 100644
index 00000000..f97fabba
--- /dev/null
+++ b/src/iochannel.h
@@ -0,0 +1,20 @@
+#ifndef fooiochannelhfoo
+#define fooiochannelhfoo
+
+#include <sys/types.h>
+#include "mainloop.h"
+
+struct iochannel;
+
+struct iochannel* iochannel_new(struct mainloop*m, int ifd, int ofd);
+void iochannel_free(struct iochannel*io);
+
+ssize_t iochannel_write(struct iochannel*io, const void*data, size_t l);
+ssize_t iochannel_read(struct iochannel*io, void*data, size_t l);
+
+int iochannel_is_readable(struct iochannel*io);
+int iochannel_is_writable(struct iochannel*io);
+
+void iochannel_set_callback(struct iochannel*io, void (*callback)(struct iochannel*io, void *userdata), void *userdata);
+
+#endif