#ifndef __AGNI_SOCK_CONN_H #define __AGNI_SOCK_CONN_H #include #include #include #include #include #include "util.h" #include "debug.h" #define IRC_BUF_IN_SIZE 1024*64 #define IRC_BUF_OUT_SIZE 512 /* Reads ins and spils out IRC lines ended with \r\n. */ //?what will happend if there is no string consumer? typedef struct irc_buf { int out_size; int max_out_size; int in_size; int max_in_size; char *buf_in; char *buf_out; int ready;//if 1 there is one full line } irc_buf; irc_buf* irc_buf_create(); //put string inside in reverse order =P int irc_buf_puts(irc_buf *ib, char *in_buf, int sz); int irc_buf_putc(irc_buf *ib, char c); int irc_buf_sz(irc_buf *ib); int irc_buf_ready(irc_buf *ib); char *irc_buf_line(irc_buf *ib); int irc_buf_destroy(irc_buf *ib); int irc_connect(char *hostname, char *port); #endif