| 1 |
michael |
5052 |
#ifndef IRC_H |
| 2 |
|
|
#define IRC_H |
| 3 |
|
|
|
| 4 |
|
|
#include "inet.h" |
| 5 |
|
|
|
| 6 |
|
|
#define NICKMAX 32 + 1 |
| 7 |
|
|
#define MSGLENMAX 512 + 1 |
| 8 |
|
|
|
| 9 |
|
|
|
| 10 |
|
|
struct bopm_sockaddr |
| 11 |
|
|
{ |
| 12 |
|
|
struct sockaddr_in sa4; |
| 13 |
|
|
}; |
| 14 |
|
|
|
| 15 |
|
|
|
| 16 |
|
|
struct bopm_ircaddr |
| 17 |
|
|
{ |
| 18 |
|
|
struct in_addr in4; |
| 19 |
|
|
}; |
| 20 |
|
|
|
| 21 |
|
|
|
| 22 |
|
|
struct UserInfo |
| 23 |
|
|
{ |
| 24 |
|
|
char *irc_nick; |
| 25 |
|
|
char *irc_username; |
| 26 |
|
|
char *irc_hostname; |
| 27 |
|
|
}; |
| 28 |
|
|
|
| 29 |
|
|
typedef void (*irc_command) (char **, unsigned int, char *, struct UserInfo *); |
| 30 |
|
|
|
| 31 |
|
|
struct CommandHash |
| 32 |
|
|
{ |
| 33 |
|
|
char *command; |
| 34 |
|
|
irc_command handler; |
| 35 |
|
|
}; |
| 36 |
|
|
|
| 37 |
|
|
|
| 38 |
|
|
extern void irc_send(char *, ...); |
| 39 |
|
|
extern void irc_send_channels(char *, ...); |
| 40 |
|
|
extern void irc_cycle(void); |
| 41 |
|
|
extern void irc_timer(void); |
| 42 |
|
|
|
| 43 |
|
|
|
| 44 |
|
|
#define copy_s_addr(a, b) \ |
| 45 |
|
|
do { \ |
| 46 |
|
|
((uint32_t *)a)[0] = ((uint32_t *)b)[0]; \ |
| 47 |
|
|
((uint32_t *)a)[1] = ((uint32_t *)b)[1]; \ |
| 48 |
|
|
((uint32_t *)a)[2] = ((uint32_t *)b)[2]; \ |
| 49 |
|
|
((uint32_t *)a)[3] = ((uint32_t *)b)[3]; \ |
| 50 |
|
|
} while(0) |
| 51 |
|
|
|
| 52 |
|
|
#endif |