1 #ifndef _ClientSocket_h
2 #define _ClientSocket_h
6 #define SOCKET_FLAG_DEAD 0x01
7 #define SOCKET_FLAG_CONNECTED 0x02
8 #define SOCKET_FLAG_READY 0x04
9 #define SOCKET_FLAG_PREFERED 0x08 /* prefered bot to send datas to the IRC World (NOTICE's WHO's etc pp) */
19 char buffer[BUF_SIZ*2]; //we need to store up to 2 full commands at once
20 unsigned int bufferpos;
24 struct UserNode *user;
28 struct ClientSocket *next;
31 struct ClientSocket* create_socket(char *host, int port, char *pass, struct UserNode *user);
32 int connect_socket(struct ClientSocket *client);
33 int close_socket(struct ClientSocket *client);
34 int write_socket(struct ClientSocket *client, char* msg, int len);
35 void socket_loop(int timeout_seconds);
36 void putsock(struct ClientSocket *client, const char *text, ...) PRINTF_LIKE(2, 3);
37 struct ClientSocket* getBots(int flags, struct ClientSocket* last_bot);