mirror of
https://github.com/anope/anope.git
synced 2026-06-25 16:46:37 +02:00
dfec5ed8a7
git-svn-id: svn://svn.anope.org/anope/trunk@296 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@185 5417fbe8-f217-4b02-8779-1006273d7864
79 lines
1.6 KiB
C
79 lines
1.6 KiB
C
/* RDB functions.
|
|
*
|
|
* (C) 2003 Anope Team
|
|
* Contact us at info@anope.org
|
|
*
|
|
* Please read COPYING and README for furhter details.
|
|
*
|
|
* Based on the original code of Epona by Lara.
|
|
* Based on the original code of Services by Andy Church.
|
|
*
|
|
* $Id$
|
|
*
|
|
*/
|
|
#include "services.h"
|
|
|
|
#ifdef USE_MYSQL
|
|
#define RDB_MYSQL(x) x
|
|
#else
|
|
#define RDB_MYSQL(x)
|
|
#endif
|
|
|
|
void rdb_init(void)
|
|
{
|
|
RDB_MYSQL(db_mysql_init());
|
|
}
|
|
|
|
void rdb_end(void)
|
|
{
|
|
RDB_MYSQL(db_mysql_end());
|
|
}
|
|
|
|
/* BotServ */
|
|
void rdb_bs_add_bot(BotInfo *bi)
|
|
{
|
|
RDB_MYSQL(db_mysql_bs_add_bot(bi));
|
|
}
|
|
|
|
void rdb_bs_del_bot(BotInfo *bi)
|
|
{
|
|
RDB_MYSQL(db_mysql_bs_del_bot(bi));
|
|
}
|
|
|
|
void rdb_bs_change_bot(BotInfo *bi, char *newnick, char *newuser, char *newhost, char *newreal)
|
|
{
|
|
RDB_MYSQL(db_mysql_bs_chg_bot(bi, newnick, newuser, newhost, newreal));
|
|
}
|
|
|
|
void rdb_bs_change_bot_chancount(BotInfo *bi)
|
|
{
|
|
RDB_MYSQL(db_mysql_bs_chg_bot_chancount(bi));
|
|
}
|
|
|
|
void rdb_bs_change_bot_flags(BotInfo *bi)
|
|
{
|
|
RDB_MYSQL(db_mysql_bs_chg_bot_flags(bi));
|
|
}
|
|
|
|
void rdb_cs_add_access(ChannelInfo *ci, ChanAccess *access)
|
|
{
|
|
RDB_MYSQL(db_mysql_cs_add_access(ci, access));
|
|
}
|
|
|
|
void rdb_cs_del_access(ChanAccess *access)
|
|
{
|
|
ChannelInfo *ci, *found;
|
|
ChanAccess *caccess;
|
|
int i, y;
|
|
/* Need to fetch channel manually since ChanAccess has no member for it */
|
|
for (i = 0; i < 256; i++) {
|
|
for (ci = chanlists[i]; ci; ci = ci->next) {
|
|
for (caccess = ci->access, y = 0; y < ci->accesscount; caccess++, y++) {
|
|
if (caccess == access) { found = ci; }
|
|
}
|
|
}
|
|
}
|
|
if (!found) return;
|
|
RDB_MYSQL(db_mysql_cs_del_access(found, access));
|
|
}
|