]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - libcharybdis/commio.h
dlink -> rb_dlink
[irc/rqf/shadowircd.git] / libcharybdis / commio.h
index 3100e6f8093f61eb6dbc4c4ee9e88eee447f9ab7..db65ca0c59a2ace9ea065b1a57fd609ce38aefd1 100644 (file)
 #include "ircd_defs.h"
 #include "tools.h"
 
+typedef struct _fde fde_t;
+
 /* Callback for completed IO events */
 typedef void PF(int fd, void *);
 
 /* virtual function types for I/O --nenolod */
-typedef void IOFuncRead(int fd, void *buf, size_t count);
-typedef void IOFuncWrite(int fd, const void *buf, size_t count);
+typedef int IOFuncRead(fde_t *, void *buf, size_t count);
+typedef int IOFuncWrite(fde_t *, const void *buf, size_t count);
 
 /* Callback for completed connections */
 /* int fd, int status, void * */
@@ -80,8 +82,6 @@ typedef enum fdlist_t
 }
 fdlist_t;
 
-typedef struct _fde fde_t;
-
 
 extern int highest_fd;
 extern int number_fd;
@@ -115,8 +115,8 @@ struct _fde
        void *flush_data;
        time_t flush_timeout;
 
-       IOReadFunc *read_impl;
-       IOWriteFunc *write_impl;
+       IOFuncRead *read_impl;
+       IOFuncWrite *write_impl;
 
        struct DNSQuery *dns_query;
        struct
@@ -203,5 +203,6 @@ extern void mangle_mapped_sockaddr(struct sockaddr *in);
 extern int comm_get_maxconnections(void);
 
 extern fde_t *comm_locate_fd(int fd);
+extern fde_t *comm_add_fd(int fd);
 
 #endif /* INCLUDED_commio_h */