File containing the bot data structure and related functions. More...
Go to the source code of this file.
Data Structures | |
struct | Bot_Command |
Struct used to add custom commands to the bot. More... | |
struct | IRC_Bot |
Struct holding relevant data to the actual bot. More... | |
Macros | |
#define | BOT_MAX_COMMANDS 128 |
Maximum amount of Bot_Command structures in IRC_Bot. More... | |
#define | BOT_MAX_MSGLEN 512 |
Maximum length of stored message received from server. More... | |
#define | BOT_MAX_CHANNEL_LEN 64 |
Max characters in channel name. More... | |
#define | BOT_MAX_CHANNEL_AMT 128 |
Max channels the bot can join. More... | |
Typedefs | |
typedef int(* | fp_cmd_t) (struct IRC_Bot *) |
Function pointer used in Bot_Command to execute custom functions. More... | |
typedef struct Bot_Command | Bot_Command |
Struct used to add custom commands to the bot. More... | |
typedef struct IRC_Bot | IRC_Bot |
Struct holding relevant data to the actual bot. More... | |
Functions | |
IRC_Bot * | bot_create (const char nick[]) |
Create and populate a new IRC_Bot structure. More... | |
int | bot_add_command (IRC_Bot *bot, const char name[], fp_cmd_t callback) |
Add Bot_Command to the IRC_Bot. More... | |
int | bot_connect (IRC_Bot *bot, const char address[], const char port[]) |
Connect IRC_Bot to the server. More... | |
int | bot_disconnect (IRC_Bot *bot) |
Disconnect IRC_Bot from the server. More... | |
int | bot_call (IRC_Bot *bot, const char cmd[]) |
Call (execute) a Bot_Command. More... | |
int | bot_send (IRC_Bot *bot, const char msg[]) |
Send a text message to connected server. More... | |
int | bot_read (IRC_Bot *bot) |
Read incoming messages from server, one message at a time. More... | |
int | bot_join (IRC_Bot *bot, const char channel[]) |
Join an IRC channel. More... | |
int | bot_leave (IRC_Bot *bot, const char channel[]) |
Leave an IRC channel. More... | |
File containing the bot data structure and related functions.
#define BOT_MAX_CHANNEL_AMT 128 |
Max channels the bot can join.
#define BOT_MAX_CHANNEL_LEN 64 |
Max characters in channel name.
#define BOT_MAX_COMMANDS 128 |
Maximum amount of Bot_Command structures in IRC_Bot.
#define BOT_MAX_MSGLEN 512 |
Maximum length of stored message received from server.
typedef struct Bot_Command Bot_Command |
Struct used to add custom commands to the bot.
typedef int(* fp_cmd_t) (struct IRC_Bot *) |
Function pointer used in Bot_Command to execute custom functions.
Add Bot_Command to the IRC_Bot.
bot | pointer to IRC_Bot object |
name | command name |
callback | function pointer to be called when executing this command |
int bot_call | ( | IRC_Bot * | bot, |
const char | cmd[] | ||
) |
Call (execute) a Bot_Command.
bot | pointer to IRC_Bot object |
cmd | command name to be called |
int bot_connect | ( | IRC_Bot * | bot, |
const char | address[], | ||
const char | port[] | ||
) |
IRC_Bot* bot_create | ( | const char | nick[] | ) |
int bot_disconnect | ( | IRC_Bot * | bot | ) |
int bot_join | ( | IRC_Bot * | bot, |
const char | channel[] | ||
) |
Join an IRC channel.
bot | pointer to IRC_Bot object |
channel | channel to join |
int bot_leave | ( | IRC_Bot * | bot, |
const char | channel[] | ||
) |
Leave an IRC channel.
bot | pointer to IRC_Bot object |
channel | channel to leave |
int bot_read | ( | IRC_Bot * | bot | ) |
Read incoming messages from server, one message at a time.
bot | pointer to IRC_Bot object |