#include <IRC.h>

Public Member Functions | |
| IRC () | |
| ~IRC () | |
| int | start (const char *server, int port, const char *nick, const char *user, const char *name, const char *pass) |
| void | disconnect () |
| int | privmsg (const char *target, const char *message) |
| int | privmsg (const char *fmt,...) |
| int | notice (const char *target, const char *message) |
| int | notice (const char *fmt,...) |
| int | join (const char *channel) |
| int | part (const char *channel) |
| int | kick (const char *channel, const char *nick) |
| int | kick (const char *channel, const char *nick, const char *message) |
| int | mode (const char *modes) |
| int | mode (const char *channel, const char *modes, const char *targets) |
| int | nick (const char *newnick) |
| int | quit (const char *quit_message) |
| int | raw (const char *data) |
| void | hook_irc_command (const char *cmd_name, int(*function_ptr)(const char *, irc_reply_data *, void *)) |
| int | message_loop () |
| int | is_op (const char *channel, const char *nick) |
| int | is_voice (const char *channel, const char *nick) |
| const char * | current_nick (void) |
Private Member Functions | |
| void | call_hook (const char *irc_command, const char *params, irc_reply_data *hostd) |
| void | parse_irc_reply (char *data) |
| void | split_to_replies (char *data) |
| void | insert_irc_command_hook (irc_command_hook *hook, const char *cmd_name, int(*function_ptr)(const char *, irc_reply_data *, void *)) |
| void | delete_irc_command_hook (irc_command_hook *cmd_hook) |
Private Attributes | |
| int | irc_socket |
| bool | connected |
| bool | sentnick |
| bool | sentpass |
| bool | sentuser |
| char * | cur_nick |
| FILE * | dataout |
| FILE * | datain |
| channel_user * | chan_users |
| irc_command_hook * | hooks |
Definition at line 59 of file IRC.h.
| IRC::IRC | ( | ) |
| IRC::~IRC | ( | ) |
| int IRC::start | ( | const char * | server, | |
| int | port, | |||
| const char * | nick, | |||
| const char * | user, | |||
| const char * | name, | |||
| const char * | pass | |||
| ) |
Definition at line 109 of file IRC.cc.
References closesocket, connected, cur_nick, dataout, INVALID_SOCKET, irc_socket, and SOCKET_ERROR.

| void IRC::disconnect | ( | ) |
Definition at line 169 of file IRC.cc.
References closesocket, connected, dataout, irc_socket, and quit().
| int IRC::privmsg | ( | const char * | target, | |
| const char * | message | |||
| ) |
| int IRC::privmsg | ( | const char * | fmt, | |
| ... | ||||
| ) |
| int IRC::notice | ( | const char * | target, | |
| const char * | message | |||
| ) |
| int IRC::notice | ( | const char * | fmt, | |
| ... | ||||
| ) |
| int IRC::join | ( | const char * | channel | ) |
| int IRC::part | ( | const char * | channel | ) |
| int IRC::kick | ( | const char * | channel, | |
| const char * | nick | |||
| ) |
| int IRC::kick | ( | const char * | channel, | |
| const char * | nick, | |||
| const char * | message | |||
| ) |
| int IRC::mode | ( | const char * | modes | ) |
| int IRC::mode | ( | const char * | channel, | |
| const char * | modes, | |||
| const char * | targets | |||
| ) |
| int IRC::nick | ( | const char * | newnick | ) |
| int IRC::quit | ( | const char * | quit_message | ) |
| int IRC::raw | ( | const char * | data | ) |
| void IRC::hook_irc_command | ( | const char * | cmd_name, | |
| int(*)(const char *, irc_reply_data *, void *) | function_ptr | |||
| ) |
Definition at line 84 of file IRC.cc.
References irc_command_hook::function, hooks, insert_irc_command_hook(), irc_command_hook::irc_command, and irc_command_hook::next.

| int IRC::message_loop | ( | ) |
Definition at line 198 of file IRC.cc.
References connected, irc_socket, SOCKET_ERROR, and split_to_replies().

| int IRC::is_op | ( | const char * | channel, | |
| const char * | nick | |||
| ) |
Definition at line 235 of file IRC.cc.
References chan_users, channel_user::channel, channel_user::flags, IRC_USER_OP, channel_user::next, and channel_user::nick.
| int IRC::is_voice | ( | const char * | channel, | |
| const char * | nick | |||
| ) |
Definition at line 253 of file IRC.cc.
References chan_users, channel_user::channel, channel_user::flags, IRC_USER_VOICE, channel_user::next, and channel_user::nick.
| void IRC::call_hook | ( | const char * | irc_command, | |
| const char * | params, | |||
| irc_reply_data * | hostd | |||
| ) | [private] |
Definition at line 723 of file IRC.cc.
References irc_command_hook::function, hooks, irc_command_hook::irc_command, irc_command_hook::next, and p.

| void IRC::parse_irc_reply | ( | char * | data | ) | [private] |
Definition at line 271 of file IRC.cc.
References call_hook(), chan_users, channel_user::channel, cur_nick, d(), dataout, channel_user::flags, irc_reply_data::host, irc_reply_data::ident, IRC_USER_OP, IRC_USER_VOICE, channel_user::next, channel_user::nick, irc_reply_data::nick, p, combo::id::plus, and irc_reply_data::target.

| void IRC::split_to_replies | ( | char * | data | ) | [private] |
Definition at line 223 of file IRC.cc.
References p, and parse_irc_reply().

| void IRC::insert_irc_command_hook | ( | irc_command_hook * | hook, | |
| const char * | cmd_name, | |||
| int(*)(const char *, irc_reply_data *, void *) | function_ptr | |||
| ) | [private] |
Definition at line 62 of file IRC.cc.
References irc_command_hook::function, irc_command_hook::irc_command, and irc_command_hook::next.

| void IRC::delete_irc_command_hook | ( | irc_command_hook * | cmd_hook | ) | [private] |
Definition at line 100 of file IRC.cc.
References irc_command_hook::irc_command, and irc_command_hook::next.

int IRC::irc_socket [private] |
bool IRC::connected [private] |
bool IRC::sentnick [private] |
bool IRC::sentpass [private] |
bool IRC::sentuser [private] |
char* IRC::cur_nick [private] |
FILE* IRC::dataout [private] |
FILE* IRC::datain [private] |
channel_user* IRC::chan_users [private] |
irc_command_hook* IRC::hooks [private] |
1.5.6