]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - libcharybdis/commio.h
dlink -> rb_dlink
[irc/rqf/shadowircd.git] / libcharybdis / commio.h
index c8d44d4cb45919414ea05ed0d06b9849fc80e311..db65ca0c59a2ace9ea065b1a57fd609ce38aefd1 100644 (file)
@@ -21,7 +21,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: commio.h 3229 2007-03-05 17:23:07Z nenolod $
+ *  $Id: commio.h 3354 2007-04-03 09:21:31Z nenolod $
  */
 
 #ifndef INCLUDED_commio_h
 #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 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 * */
 typedef void CNCB(int fd, int, void *);
@@ -76,8 +82,6 @@ typedef enum fdlist_t
 }
 fdlist_t;
 
-typedef struct _fde fde_t;
-
 
 extern int highest_fd;
 extern int number_fd;
@@ -96,16 +100,24 @@ struct _fde
        fdlist_t list;          /* Which list this FD should sit on */
        int comm_index;         /* where in the poll list we live */
        char desc[FD_DESC_SZ];
+
        PF *read_handler;
        void *read_data;
+
        PF *write_handler;
        void *write_data;
+
        PF *timeout_handler;
        void *timeout_data;
        time_t timeout;
+
        PF *flush_handler;
        void *flush_data;
        time_t flush_timeout;
+
+       IOFuncRead *read_impl;
+       IOFuncWrite *write_impl;
+
        struct DNSQuery *dns_query;
        struct
        {
@@ -188,6 +200,9 @@ extern void mangle_mapped_sockaddr(struct sockaddr *in);
 #define mangle_mapped_sockaddr(x) 
 #endif
 
+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 */