#define FNET_TRANSLATION 3 #define MAX_IRC_MSG_LEN 512 #define streq(x,y) !strcmp(x,y) #define streq_i(x,y) !strcasecmp(x,y) /**** main.c */ extern char url[256]; extern char usernick[32]; extern char *rx_buf; extern unsigned short rxbuflen; extern unsigned char err; extern unsigned char trip; extern unsigned int txbuflen; extern char *tx_buf; /* clears the transmit buffer. */ void txbuf_init(void); /* appends a string to the transmit buffer, updates txbuflen. */ void txbuf_append_str(const char *str); /* clears the transmit buffer, then appends a string to it. */ void txbuf_set_str(const char *str); /* as txbuf_set_str2(), but multiple strings. */ void txbuf_set_str2(const char *s1, const char *s2); void txbuf_set_str3(const char *s1, const char *s2, const char *s3); /* sends whatever's in the transmit buffer, then clears it. if nothing was in the buffer, nothing gets sent. */ void txbuf_send(void); /* sends a string. clears transmit buffer first, then clears it again on exit. */ void txbuf_send_str(const char *str); void print_error(unsigned char err); /**** irc.c */ #define MAX_MSG_ARGS 8 extern char *msg_src, *msg_cmd, *msg_dest, *msg_text; extern char *msg_args[MAX_MSG_ARGS]; extern int msg_argcount; /* call this once, right after TCP connection is established. */ void irc_register(void); /* does all the work. doesn't return until we get disconnected from the IRC server (via /quit or error). */ void irc_loop(void); void print_errnum(void); /**** cmd.c */ void cmd_command(const char *cmd); void cmd_execute(void);