Anope IRC Services  Version 1.8
Macros | Functions | Variables
botserv.c File Reference
#include "services.h"
#include "pseudo.h"
Include dependency graph for botserv.c:

Go to the source code of this file.

Macros

#define SAFE(x)
 
#define SAFE(x)
 

Functions

static UserDataget_user_data (Channel *c, User *u)
 
static void check_ban (ChannelInfo *ci, User *u, int ttbtype)
 
static void bot_kick (ChannelInfo *ci, User *u, int message,...)
 
E void moduleAddBotServCmds (void)
 
void get_botserv_stats (long *nrec, long *memuse)
 
void bs_init (void)
 
void botserv (User *u, char *buf)
 
void botmsgs (User *u, BotInfo *bi, char *buf)
 
void botchanmsgs (User *u, ChannelInfo *ci, char *buf)
 
void load_bs_dbase (void)
 
void save_bs_dbase (void)
 
void save_bs_rdb_dbase (void)
 
void insert_bot (BotInfo *bi)
 
BotInfomakebot (char *nick)
 
BotInfofindbot (char *nick)
 
void unassign (User *u, ChannelInfo *ci)
 
static BanDataget_ban_data (Channel *c, User *u)
 
void bot_join (ChannelInfo *ci)
 
void bot_rejoin_all (BotInfo *bi)
 
void bot_raw_ban (User *requester, ChannelInfo *ci, char *nick, char *reason)
 
void bot_raw_kick (User *requester, ChannelInfo *ci, char *nick, char *reason)
 
void bot_raw_mode (User *requester, ChannelInfo *ci, char *mode, char *nick)
 
char * normalizeBuffer (char *buf)
 

Variables

BotInfobotlists [256]
 
int nbots = 0
 

Macro Definition Documentation

#define SAFE (   x)
Value:
do { \
if ((x) < 0) { \
if (!forceload) \
fatal("Read error on %s", BotDBName); \
failed = 1; \
break; \
} \
} while (0)
E void E void E void fatal(const char *fmt,...) FORMAT(printf
E int forceload
Definition: extern.h:780
E char * BotDBName
Definition: extern.h:335

Definition at line 478 of file botserv.c.

Referenced by load_bs_dbase(), and save_bs_dbase().

#define SAFE (   x)
Value:
do { \
if ((x) < 0) { \
log_perror("Write error on %s", BotDBName); \
if (time(NULL) - lastwarn > WarningTimeout) { \
anope_cmd_global(NULL, "Write error on %s: %s", BotDBName, \
strerror(errno)); \
lastwarn = time(NULL); \
} \
return; \
} \
} while (0)
E int WarningTimeout
Definition: extern.h:347
E void restore_db(dbFILE *f)
Definition: datafiles.c:318
E char * strerror(int errnum)
Definition: compat.c:123
static time_t lastwarn
Definition: datafiles.c:19
E void E void log_perror(const char *fmt,...) FORMAT(printf
E char * BotDBName
Definition: extern.h:335
E void anope_cmd_global(char *source, const char *fmt,...)
Definition: ircd.c:506

Definition at line 478 of file botserv.c.

Function Documentation

void bot_join ( ChannelInfo ci)
static void bot_kick ( ChannelInfo ci,
User u,
int  message,
  ... 
)
static
void bot_raw_ban ( User requester,
ChannelInfo ci,
char *  nick,
char *  reason 
)
void bot_raw_kick ( User requester,
ChannelInfo ci,
char *  nick,
char *  reason 
)
void bot_raw_mode ( User requester,
ChannelInfo ci,
char *  mode,
char *  nick 
)
void bot_rejoin_all ( BotInfo bi)

Definition at line 814 of file botserv.c.

References chaninfo_::bi, bot_join(), BSMinUsers, chaninfo_::c, chanlists, chaninfo_::next, and channel_::usercount.

Referenced by do_bot(), and m_kill().

void botchanmsgs ( User u,
ChannelInfo ci,
char *  buf 
)
void botmsgs ( User u,
BotInfo bi,
char *  buf 
)

Definition at line 107 of file botserv.c.

References anope_cmd_ctcp(), botinfo_::nick, user_::nick, and stricmp().

Referenced by m_privmsg().

void botserv ( User u,
char *  buf 
)

Definition at line 82 of file botserv.c.

References anope_cmd_ctcp(), BOTSERV, mod_run_cmd(), user_::nick, notice_lang(), s_BotServ, skeleton, and stricmp().

Referenced by m_privmsg().

void bs_init ( void  )

Definition at line 71 of file botserv.c.

References moduleAddBotServCmds(), and s_BotServ.

Referenced by init_secondary().

static void check_ban ( ChannelInfo ci,
User u,
int  ttbtype 
)
static
BotInfo* findbot ( char *  nick)
static BanData* get_ban_data ( Channel c,
User u 
)
static
void get_botserv_stats ( long *  nrec,
long *  memuse 
)

Definition at line 45 of file botserv.c.

References botinfo_::host, botinfo_::next, botinfo_::nick, botinfo_::real, and botinfo_::user.

Referenced by do_stats().

static UserData * get_user_data ( Channel c,
User u 
)
static

Definition at line 707 of file botserv.c.

References BSKeepData, channel_::c_userlist::next, scalloc(), and channel_::users.

Referenced by botchanmsgs().

void insert_bot ( BotInfo bi)

Definition at line 559 of file botserv.c.

References botinfo_::next, botinfo_::nick, botinfo_::prev, stricmp(), and tolower.

Referenced by makebot().

void load_bs_dbase ( void  )
BotInfo* makebot ( char *  nick)
void moduleAddBotServCmds ( void  )

Definition at line 36 of file botserv.c.

References BotServCoreModules, BotServCoreNumber, and modules_core_init().

Referenced by bs_init().

char* normalizeBuffer ( char *  buf)

Normalize buffer stripping control characters and colors

Parameters
Astring to be parsed for control and color codes
Returns
A string stripped of control and color codes

Definition at line 1101 of file botserv.c.

References smalloc().

Referenced by bahamut_cmd_ctcp(), botchanmsgs(), charybdis_cmd_ctcp(), delete_user(), do_nick(), dreamforge_cmd_ctcp(), hsreq_load_db(), hybrid_cmd_ctcp(), inspircd_cmd_ctcp(), moduleGetConfigDirective(), plexus_cmd_ctcp(), ptlink_cmd_ctcp(), rageircd_cmd_ctcp(), ratbox_cmd_ctcp(), shadowircd_cmd_ctcp(), solidircd_cmd_ctcp(), ultimate2_cmd_ctcp(), ultimate3_cmd_ctcp(), unreal_cmd_ctcp(), and viagra_cmd_ctcp().

void save_bs_dbase ( void  )
void save_bs_rdb_dbase ( void  )
void unassign ( User u,
ChannelInfo ci 
)

Variable Documentation

BotInfo* botlists[256]

Definition at line 22 of file botserv.c.

int nbots = 0

Definition at line 23 of file botserv.c.

Referenced by makebot().