IRC Class Reference

#include <IRC.h>

Collaboration diagram for IRC:

Collaboration graph
[legend]

List of all members.

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_userchan_users
irc_command_hookhooks


Detailed Description

Definition at line 59 of file IRC.h.


Constructor & Destructor Documentation

IRC::IRC (  ) 

Definition at line 45 of file IRC.cc.

References chan_users, connected, cur_nick, hooks, sentnick, sentpass, and sentuser.

IRC::~IRC (  ) 

Definition at line 56 of file IRC.cc.

References delete_irc_command_hook(), and hooks.


Member Function Documentation

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.

Here is the caller graph for this function:

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 
)

Definition at line 767 of file IRC.cc.

References connected, and dataout.

Here is the caller graph for this function:

int IRC::privmsg ( const char *  fmt,
  ... 
)

Definition at line 775 of file IRC.cc.

References connected, and dataout.

int IRC::notice ( const char *  target,
const char *  message 
)

Definition at line 745 of file IRC.cc.

References connected, and dataout.

Here is the caller graph for this function:

int IRC::notice ( const char *  fmt,
  ... 
)

Definition at line 753 of file IRC.cc.

References connected, and dataout.

int IRC::join ( const char *  channel  ) 

Definition at line 790 of file IRC.cc.

References connected, and dataout.

Here is the caller graph for this function:

int IRC::part ( const char *  channel  ) 

Definition at line 798 of file IRC.cc.

References connected, and dataout.

int IRC::kick ( const char *  channel,
const char *  nick 
)

Definition at line 806 of file IRC.cc.

References connected, and dataout.

int IRC::kick ( const char *  channel,
const char *  nick,
const char *  message 
)

Definition at line 822 of file IRC.cc.

References connected, and dataout.

int IRC::mode ( const char *  modes  ) 

Definition at line 841 of file IRC.cc.

References connected, and cur_nick.

int IRC::mode ( const char *  channel,
const char *  modes,
const char *  targets 
)

Definition at line 830 of file IRC.cc.

References connected, and dataout.

int IRC::nick ( const char *  newnick  ) 

Definition at line 849 of file IRC.cc.

References connected, and dataout.

int IRC::quit ( const char *  quit_message  ) 

Definition at line 184 of file IRC.cc.

References connected, and dataout.

Here is the caller graph for this function:

int IRC::raw ( const char *  data  ) 

Definition at line 814 of file IRC.cc.

References connected, and dataout.

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.

Here is the caller graph for this function:

int IRC::message_loop (  ) 

Definition at line 198 of file IRC.cc.

References connected, irc_socket, SOCKET_ERROR, and split_to_replies().

Here is the caller graph for this function:

int IRC::is_op ( const char *  channel,
const char *  nick 
)

int IRC::is_voice ( const char *  channel,
const char *  nick 
)

const char * IRC::current_nick ( void   ) 

Definition at line 857 of file IRC.cc.

References cur_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.

Here is the caller graph for this function:

void IRC::parse_irc_reply ( char *  data  )  [private]

void IRC::split_to_replies ( char *  data  )  [private]

Definition at line 223 of file IRC.cc.

References p, and parse_irc_reply().

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

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.

Here is the caller graph for this function:


Member Data Documentation

int IRC::irc_socket [private]

Definition at line 91 of file IRC.h.

bool IRC::connected [private]

Definition at line 92 of file IRC.h.

bool IRC::sentnick [private]

Definition at line 93 of file IRC.h.

bool IRC::sentpass [private]

Definition at line 94 of file IRC.h.

bool IRC::sentuser [private]

Definition at line 95 of file IRC.h.

char* IRC::cur_nick [private]

Definition at line 96 of file IRC.h.

FILE* IRC::dataout [private]

Definition at line 97 of file IRC.h.

FILE* IRC::datain [private]

Definition at line 98 of file IRC.h.

Definition at line 99 of file IRC.h.

Definition at line 100 of file IRC.h.


The documentation for this class was generated from the following files:

Generated on Fri Dec 4 23:23:55 2009 for OpenCog Framework by  doxygen 1.5.6