mirror of
https://github.com/anope/anope.git
synced 2026-07-01 10:26:38 +02:00
Merge commit 'cbx/anopeng-charfix' into anopeng
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1408 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
+14
-14
@@ -76,9 +76,9 @@ E void bot_join(ChannelInfo *ci);
|
||||
E char *normalizeBuffer(const char *);
|
||||
E void insert_bot(BotInfo * bi);
|
||||
|
||||
E void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick, char *reason);
|
||||
E void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick, char *reason);
|
||||
E void bot_raw_mode(User * requester, ChannelInfo * ci, char *mode, char *nick);
|
||||
E void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick, const char *reason);
|
||||
E void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick, const char *reason);
|
||||
E void bot_raw_mode(User * requester, ChannelInfo * ci, const char *mode, char *nick);
|
||||
|
||||
/**** channels.c ****/
|
||||
|
||||
@@ -583,15 +583,15 @@ E void helpserv_init(void);
|
||||
|
||||
/**** hostserv.c ****/
|
||||
E void hostserv_init(void);
|
||||
E void addHostCore(char *nick, char *vIdent, char *vhost, char *creator, int32 tmp_time);
|
||||
E void addHostCore(char *nick, char *vIdent, char *vhost, const char *creator, int32 tmp_time);
|
||||
E char *getvIdent(char *nick);
|
||||
E char *getvHost(char *nick);
|
||||
E int is_host_remover(User * u);
|
||||
E int is_host_setter(User *u);
|
||||
E HostCore *hostCoreListHead();
|
||||
E HostCore *findHostCore(HostCore * head, char *nick, bool *found);
|
||||
E HostCore *createHostCorelist(HostCore * next, char *nick, char *vIdent, char *vHost, char *creator, int32 tmp_time);
|
||||
E HostCore *insertHostCore(HostCore * head, HostCore * prev, char *nick, char *vIdent, char *vHost, char *creator, int32 tmp_time);
|
||||
E HostCore *createHostCorelist(HostCore * next, char *nick, char *vIdent, char *vHost, const char *creator, int32 tmp_time);
|
||||
E HostCore *insertHostCore(HostCore * head, HostCore * prev, char *nick, char *vIdent, char *vHost, const char *creator, int32 tmp_time);
|
||||
E HostCore *deleteHostCore(HostCore * head, HostCore * prev);
|
||||
E void set_lastmask(User * u);
|
||||
|
||||
@@ -674,8 +674,8 @@ E const char version_build[];
|
||||
E char *version_protocol;
|
||||
E const char version_flags[];
|
||||
|
||||
E char *services_dir;
|
||||
E char *log_filename;
|
||||
E const char *services_dir;
|
||||
E const char *log_filename;
|
||||
E int debug;
|
||||
E int readonly;
|
||||
E int logchan;
|
||||
@@ -804,8 +804,8 @@ E void modules_core_init(int number, char **list);
|
||||
E void modules_unload_all(bool fini, bool unload_proto); /* Read warnings near function source */
|
||||
E void moduleCallBackRun(void);
|
||||
E void moduleCleanStruct(ModuleData **moduleData);
|
||||
E void ModuleDatabaseBackup(char *dbname);
|
||||
E void ModuleRemoveBackups(char *dbname);
|
||||
E void ModuleDatabaseBackup(const char *dbname);
|
||||
E void ModuleRemoveBackups(const char *dbname);
|
||||
|
||||
/**** news.c ****/
|
||||
|
||||
@@ -895,7 +895,7 @@ E int nick_is_services_oper(NickCore *nc);
|
||||
E int add_akill(User *u, char *mask, const char *by, const time_t expires, const char *reason);
|
||||
E int check_akill(const char *nick, const char *username, const char *host, const char *vhost, const char *ip);
|
||||
E void expire_akills(void);
|
||||
E void oper_global(char *nick, char *fmt, ...);
|
||||
E void oper_global(char *nick, const char *fmt, ...);
|
||||
|
||||
E int add_sgline(User *u, char *mask, const char *by, const time_t expires, const char *reason);
|
||||
E int check_sgline(const char *nick, const char *realname);
|
||||
@@ -936,7 +936,7 @@ E void process(void);
|
||||
E void send_cmd(const char *source, const char *fmt, ...) FORMAT(printf,2,3);
|
||||
E void send_cmd(const std::string &source, const char *fmt, ...) FORMAT(printf,2,3);
|
||||
|
||||
E void notice_server(char *source, Server * s, char *fmt, ...)
|
||||
E void notice_server(char *source, Server * s, const char *fmt, ...)
|
||||
FORMAT(printf,3,4);
|
||||
E void notice_user(char *source, User *u, const char *fmt, ...)
|
||||
FORMAT(printf,3,4);
|
||||
@@ -1029,7 +1029,7 @@ E char *sgets(char *buf, int len, ano_socket_t s);
|
||||
E char *sgets2(char *buf, int len, ano_socket_t s);
|
||||
E int sread(ano_socket_t s, char *buf, int len);
|
||||
E int sputs(char *str, ano_socket_t s);
|
||||
E int sockprintf(ano_socket_t s, char *fmt, ...);
|
||||
E int sockprintf(ano_socket_t s, const char *fmt, ...);
|
||||
E int conn(const char *host, int port, const char *lhost, int lport);
|
||||
E void disconn(ano_socket_t s);
|
||||
|
||||
@@ -1128,7 +1128,7 @@ E void anope_cmd_svswatch(const char *sender, const char *nick, const char *parm
|
||||
|
||||
E char *common_get_vident(User *u);
|
||||
E char *common_get_vhost(User *u);
|
||||
E char *send_token(char *token1, char *token2);
|
||||
E const char *send_token(const char *token1, const char *token2);
|
||||
E char *base64enc(long i);
|
||||
E long base64dec(char *b64);
|
||||
E long base64dects(const char *ts);
|
||||
|
||||
+7
-7
@@ -269,7 +269,7 @@ MDE Module *createModule(char *filename); /* Create a new module, using t
|
||||
int destroyModule(Module *m); /* Delete the module */
|
||||
int addModule(Module *m); /* Add a module to the module hash */
|
||||
int delModule(Module *m); /* Remove a module from the module hash */
|
||||
MDE Module *findModule(char *name); /* Find a module */
|
||||
MDE Module *findModule(const char *name); /* Find a module */
|
||||
int loadModule(Module *m,User *u); /* Load the given module into the program */
|
||||
int encryption_module_init(void); /* Load the encryption module */
|
||||
int protocol_module_init(void); /* Load the IRCD Protocol Module up*/
|
||||
@@ -338,7 +338,7 @@ int delEventHandler(EvtMessageHash * msgEvtTable[], EvtMessage * evm, char *mod_
|
||||
int destroyEventHandler(EvtMessage * evm);
|
||||
int addEventHandler(EvtMessageHash * msgEvtTable[], EvtMessage * evm);
|
||||
|
||||
MDE EvtHook *createEventHook(char *name, int (*func) (int argc, char **argv));
|
||||
MDE EvtHook *createEventHook(const char *name, int (*func) (int argc, char **argv));
|
||||
EvtHook *findEventHook(EvtHookHash * HookEvtTable[], const char *name);
|
||||
int addCoreEventHook(EvtHookHash * HookEvtTable[], EvtHook * evh);
|
||||
MDE int moduleAddEventHook(EvtHook * evh);
|
||||
@@ -354,12 +354,12 @@ MDE void moduleDeleteLanguage(int langNumber);
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
MDE int moduleAddCallback(char *name,time_t when,int (*func)(int argc, char *argv[]),int argc, char **argv);
|
||||
MDE int moduleAddCallback(const char *name,time_t when,int (*func)(int argc, char *argv[]),int argc, char **argv);
|
||||
MDE void moduleDelCallback(char *name);
|
||||
|
||||
MDE char *moduleGetData(ModuleData **md, char *key); /* Get the value for this key from this struct */
|
||||
MDE int moduleAddData(ModuleData **md, char *key, char *value); /* Set the value for this key for this struct */
|
||||
MDE void moduleDelData(ModuleData **md, char *key); /* Delete this key/value pair */
|
||||
MDE char *moduleGetData(ModuleData **md, const char *key); /* Get the value for this key from this struct */
|
||||
MDE int moduleAddData(ModuleData **md, const char *key, char *value); /* Set the value for this key for this struct */
|
||||
MDE void moduleDelData(ModuleData **md, const char *key); /* Delete this key/value pair */
|
||||
MDE void moduleDelAllData(ModuleData **md); /* Delete all key/value pairs for this module for this struct */
|
||||
void moduleDelAllDataMod(Module *m); /* remove all module data from all structs for this module */
|
||||
int moduleDataDebug(ModuleData **md); /* Allow for debug output of a moduleData struct */
|
||||
@@ -375,7 +375,7 @@ MDE void handleModuleOperationQueue(void);
|
||||
/* Some IRCD protocol module support functions */
|
||||
|
||||
/** Update the protect deatials, could be either protect or admin etc.. */
|
||||
MDE void updateProtectDetails(char *level_info_protect_word, char *level_info_protectme_word, char *fant_protect_add, char *fant_protect_del, char *level_protect_word, char *protect_set_mode, char *protect_unset_mode);
|
||||
MDE void updateProtectDetails(const char *level_info_protect_word, const char *level_info_protectme_word, const char *fant_protect_add, const char *fant_protect_del, const char *level_protect_word, const char *protect_set_mode, const char *protect_unset_mode);
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
|
||||
+36
-36
@@ -264,42 +264,42 @@ typedef struct ircdvars_ IRCDVar;
|
||||
typedef struct ircdcapab_ IRCDCAPAB;
|
||||
|
||||
struct ircdvars_ {
|
||||
char *name; /* Name of the ChanServ command */
|
||||
char *nickservmode; /* Mode used by NickServ */
|
||||
char *chanservmode; /* Mode used by ChanServ */
|
||||
char *memoservmode; /* Mode used by MemoServ */
|
||||
char *hostservmode; /* Mode used by HostServ */
|
||||
char *operservmode; /* Mode used by OperServ */
|
||||
char *botservmode; /* Mode used by BotServ */
|
||||
char *helpservmode; /* Mode used by HelpServ */
|
||||
char *devnullmode; /* Mode used by Dev/Null */
|
||||
char *globalmode; /* Mode used by Global */
|
||||
char *nickservaliasmode; /* Mode used by NickServ Alias */
|
||||
char *chanservaliasmode; /* Mode used by ChanServ Alias */
|
||||
char *memoservaliasmode; /* Mode used by MemoServ Alias */
|
||||
char *hostservaliasmode; /* Mode used by HostServ Alias */
|
||||
char *operservaliasmode; /* Mode used by OperServ Alias */
|
||||
char *botservaliasmode; /* Mode used by BotServ Alias */
|
||||
char *helpservaliasmode; /* Mode used by HelpServ Alias */
|
||||
char *devnullvaliasmode; /* Mode used by Dev/Null Alias */
|
||||
char *globalaliasmode; /* Mode used by Global Alias */
|
||||
char *botserv_bot_mode; /* Mode used by BotServ Bots */
|
||||
const char *name; /* Name of the ChanServ command */
|
||||
const char *nickservmode; /* Mode used by NickServ */
|
||||
const char *chanservmode; /* Mode used by ChanServ */
|
||||
const char *memoservmode; /* Mode used by MemoServ */
|
||||
const char *hostservmode; /* Mode used by HostServ */
|
||||
const char *operservmode; /* Mode used by OperServ */
|
||||
const char *botservmode; /* Mode used by BotServ */
|
||||
const char *helpservmode; /* Mode used by HelpServ */
|
||||
const char *devnullmode; /* Mode used by Dev/Null */
|
||||
const char *globalmode; /* Mode used by Global */
|
||||
const char *nickservaliasmode; /* Mode used by NickServ Alias */
|
||||
const char *chanservaliasmode; /* Mode used by ChanServ Alias */
|
||||
const char *memoservaliasmode; /* Mode used by MemoServ Alias */
|
||||
const char *hostservaliasmode; /* Mode used by HostServ Alias */
|
||||
const char *operservaliasmode; /* Mode used by OperServ Alias */
|
||||
const char *botservaliasmode; /* Mode used by BotServ Alias */
|
||||
const char *helpservaliasmode; /* Mode used by HelpServ Alias */
|
||||
const char *devnullvaliasmode; /* Mode used by Dev/Null Alias */
|
||||
const char *globalaliasmode; /* Mode used by Global Alias */
|
||||
const char *botserv_bot_mode; /* Mode used by BotServ Bots */
|
||||
int max_symbols; /* Chan Max Symbols */
|
||||
char *modestoremove; /* Channel Modes to remove */
|
||||
char *botchanumode; /* Modes set when botserv joins a channel */
|
||||
const char *modestoremove; /* Channel Modes to remove */
|
||||
const char *botchanumode; /* Modes set when botserv joins a channel */
|
||||
int svsnick; /* Supports SVSNICK */
|
||||
int vhost; /* Supports vhost */
|
||||
int owner; /* Supports Owner */
|
||||
char *ownerset; /* Mode to set for owner */
|
||||
char *ownerunset; /* Mode to unset for a owner */
|
||||
char *adminset; /* Mode to set for admin */
|
||||
char *adminunset; /* Mode to unset for admin */
|
||||
char *modeonreg; /* Mode on Register */
|
||||
char *rootmodeonid; /* Mode on ID for ROOTS */
|
||||
char *adminmodeonid; /* Mode on ID for ADMINS */
|
||||
char *opermodeonid; /* Mode on ID for OPERS */
|
||||
char *modeonunreg; /* Mode on Unregister */
|
||||
char *modeonnick; /* Mode on nick change */
|
||||
const char *ownerset; /* Mode to set for owner */
|
||||
const char *ownerunset; /* Mode to unset for a owner */
|
||||
const char *adminset; /* Mode to set for admin */
|
||||
const char *adminunset; /* Mode to unset for admin */
|
||||
const char *modeonreg; /* Mode on Register */
|
||||
const char *rootmodeonid; /* Mode on ID for ROOTS */
|
||||
const char *adminmodeonid; /* Mode on ID for ADMINS */
|
||||
const char *opermodeonid; /* Mode on ID for OPERS */
|
||||
const char *modeonunreg; /* Mode on Unregister */
|
||||
const char *modeonnick; /* Mode on nick change */
|
||||
int sgline; /* Supports SGline */
|
||||
int sqline; /* Supports SQline */
|
||||
int szline; /* Supports SZline */
|
||||
@@ -347,7 +347,7 @@ struct ircdvars_ {
|
||||
int sjoininvchar; /* use single quotes to define it */
|
||||
int svsmode_ucmode; /* Can remove User Channel Modes with SVSMODE */
|
||||
int sglineenforce;
|
||||
char *vhostchar; /* char used for vhosting */
|
||||
const char *vhostchar; /* char used for vhosting */
|
||||
int ts6; /* ircd is TS6 */
|
||||
int supporthelper; /* +h helper umodes */
|
||||
int p10; /* ircd is P10 */
|
||||
@@ -356,7 +356,7 @@ struct ircdvars_ {
|
||||
int cidrchanbei; /* channel bans/excepts/invites support CIDR (syntax: +b *!*@192.168.0.0/15)
|
||||
* 0 for no support, 1 for strict cidr support, anything else
|
||||
* for ircd specific support (nefarious only cares about first /mask) */
|
||||
char *globaltldprefix; /* TLD prefix used for Global */
|
||||
const char *globaltldprefix; /* TLD prefix used for Global */
|
||||
};
|
||||
|
||||
struct ircdcapab_ {
|
||||
@@ -775,7 +775,7 @@ struct chaninfo_ {
|
||||
struct csmodeutil_ {
|
||||
const char *name; /* Name of the ChanServ command */
|
||||
const char *bsname; /* Name of the BotServ fantasy command */
|
||||
char *mode; /* Mode (ie. +o) */
|
||||
const char *mode; /* Mode (ie. +o) */
|
||||
int32 notice; /* Notice flag (for the damn OPNOTICE) */
|
||||
int level; /* Level required to use the command */
|
||||
int levelself; /* Level required to use the command for himself */
|
||||
@@ -1174,7 +1174,7 @@ typedef struct ircd_modes_ {
|
||||
|
||||
typedef struct capabinfo_ CapabInfo;
|
||||
struct capabinfo_ {
|
||||
char *token;
|
||||
const char *token;
|
||||
uint32 flag;
|
||||
};
|
||||
|
||||
|
||||
+6
-6
@@ -413,7 +413,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
|
||||
if (cmd && (cmd[0] == *BSFantasyCharacter)) {
|
||||
char *params = strtok(NULL, "");
|
||||
char *event_name = EVENT_BOT_FANTASY_NO_ACCESS;
|
||||
const char *event_name = EVENT_BOT_FANTASY_NO_ACCESS;
|
||||
|
||||
/* Strip off the fantasy character */
|
||||
cmd++;
|
||||
@@ -832,7 +832,7 @@ static void bot_kick(ChannelInfo * ci, User * u, int message, ...)
|
||||
/* Makes a simple ban and kicks the target */
|
||||
|
||||
void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick,
|
||||
char *reason)
|
||||
const char *reason)
|
||||
{
|
||||
int ac;
|
||||
const char *av[4];
|
||||
@@ -890,7 +890,7 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick,
|
||||
kav[2] = ci->bi->nick;
|
||||
} else {
|
||||
if (strlen(reason) > 200)
|
||||
reason[200] = '\0';
|
||||
*((char **)&reason[200]) = '\0'; // Unsafe cast -- will review later -- CyberBotX
|
||||
kav[2] = reason;
|
||||
}
|
||||
|
||||
@@ -912,7 +912,7 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick,
|
||||
/* Makes a kick with a "dynamic" reason ;) */
|
||||
|
||||
void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick,
|
||||
char *reason)
|
||||
const char *reason)
|
||||
{
|
||||
const char *av[3];
|
||||
User *u = finduser(nick);
|
||||
@@ -939,7 +939,7 @@ void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick,
|
||||
av[2] = ci->bi->nick;
|
||||
} else {
|
||||
if (strlen(reason) > 200)
|
||||
reason[200] = '\0';
|
||||
*((char **)&reason[200]) = '\0'; // Unsafe cast -- will review later -- CyberBotX
|
||||
av[2] = reason;
|
||||
}
|
||||
|
||||
@@ -958,7 +958,7 @@ void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick,
|
||||
|
||||
/* Makes a mode operation on a channel for a nick */
|
||||
|
||||
void bot_raw_mode(User * requester, ChannelInfo * ci, char *mode,
|
||||
void bot_raw_mode(User * requester, ChannelInfo * ci, const char *mode,
|
||||
char *nick)
|
||||
{
|
||||
const char *av[4];
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
+5
-5
@@ -6,8 +6,8 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_xop(User * u, char *xname, int xlev, int *xmsgs);
|
||||
int do_xop(User * u, const char *xname, int xlev, int *xmsgs);
|
||||
int do_aop(User * u);
|
||||
int do_hop(User * u);
|
||||
int do_sop(User * u);
|
||||
@@ -235,7 +235,7 @@ int xop_list_callback(User * u, int num, va_list args)
|
||||
}
|
||||
|
||||
|
||||
int do_xop(User * u, char *xname, int xlev, int *xmsgs)
|
||||
int do_xop(User * u, const char *xname, int xlev, int *xmsgs)
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
char *cmd = strtok(NULL, " ");
|
||||
@@ -500,7 +500,7 @@ int do_xop(User * u, char *xname, int xlev, int *xmsgs)
|
||||
}
|
||||
|
||||
send_event(EVENT_ACCESS_CLEAR, 2, ci->name, u->nick);
|
||||
|
||||
|
||||
notice_lang(s_ChanServ, u, xmsgs[13], ci->name);
|
||||
} else {
|
||||
syntax_error(s_ChanServ, u, xname, xmsgs[0]);
|
||||
|
||||
+3
-3
@@ -579,7 +579,7 @@ int write_string(const char *s, dbFILE * f)
|
||||
* @param ext Extention
|
||||
* @return void
|
||||
*/
|
||||
static void rename_database(char *name, char *ext)
|
||||
static void rename_database(const char *name, char *ext)
|
||||
{
|
||||
|
||||
char destpath[PATH_MAX];
|
||||
@@ -728,7 +728,7 @@ void backup_databases(void)
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
void ModuleDatabaseBackup(char *dbname)
|
||||
void ModuleDatabaseBackup(const char *dbname)
|
||||
{
|
||||
|
||||
time_t t;
|
||||
@@ -762,7 +762,7 @@ void ModuleDatabaseBackup(char *dbname)
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
void ModuleRemoveBackups(char *dbname)
|
||||
void ModuleRemoveBackups(const char *dbname)
|
||||
{
|
||||
char ext[9];
|
||||
char path[PATH_MAX];
|
||||
|
||||
+1
-1
@@ -294,7 +294,7 @@ EvtMessage *createEventHandler(char *name,
|
||||
* @param func a pointer to the function to call when we recive this message
|
||||
* @return a new Message object
|
||||
**/
|
||||
EvtHook *createEventHook(char *name, int (*func) (int argc, char **argv))
|
||||
EvtHook *createEventHook(const char *name, int (*func) (int argc, char **argv))
|
||||
{
|
||||
EvtHook *evh = NULL;
|
||||
if (!func) {
|
||||
|
||||
+3
-3
@@ -99,7 +99,7 @@ HostCore *hostCoreListHead()
|
||||
* @return HostCore
|
||||
*/
|
||||
HostCore *createHostCorelist(HostCore * next, char *nick, char *vIdent,
|
||||
char *vHost, char *creator, int32 tmp_time)
|
||||
char *vHost, const char *creator, int32 tmp_time)
|
||||
{
|
||||
|
||||
next = (HostCore *)malloc(sizeof(HostCore));
|
||||
@@ -180,7 +180,7 @@ HostCore *findHostCore(HostCore * head, char *nick, bool* found)
|
||||
|
||||
/*************************************************************************/
|
||||
HostCore *insertHostCore(HostCore * head, HostCore * prev, char *nick,
|
||||
char *vIdent, char *vHost, char *creator,
|
||||
char *vIdent, char *vHost, const char *creator,
|
||||
int32 tmp_time)
|
||||
{
|
||||
|
||||
@@ -258,7 +258,7 @@ HostCore *deleteHostCore(HostCore * head, HostCore * prev)
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
void addHostCore(char *nick, char *vIdent, char *vhost, char *creator,
|
||||
void addHostCore(char *nick, char *vIdent, char *vhost, const char *creator,
|
||||
int32 tmp_time)
|
||||
{
|
||||
HostCore *tmp;
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@
|
||||
/******** Global variables! ********/
|
||||
|
||||
/* Command-line options: (note that configuration variables are in config.c) */
|
||||
char *services_dir = SERVICES_DIR; /* -dir dirname */
|
||||
char *log_filename = LOG_FILENAME; /* -log filename */
|
||||
const char *services_dir = SERVICES_DIR; /* -dir dirname */
|
||||
const char *log_filename = LOG_FILENAME; /* -log filename */
|
||||
int debug = 0; /* -debug */
|
||||
int readonly = 0; /* -readonly */
|
||||
int logchan = 0; /* -logchan */
|
||||
|
||||
+1
-1
@@ -1088,7 +1088,7 @@ u_int32_t getrandom32(void)
|
||||
* @param token2
|
||||
* @return token to send
|
||||
*/
|
||||
char *send_token(char *token1, char *token2)
|
||||
const char *send_token(const char *token1, const char *token2)
|
||||
{
|
||||
if (UseTokens && ircd->token && ircdcap->token) {
|
||||
return token2;
|
||||
|
||||
+10
-10
@@ -435,7 +435,7 @@ int delModule(Module * m)
|
||||
* @param name the name of the module to find
|
||||
* @return a pointer to the module found, or NULL
|
||||
*/
|
||||
Module *findModule(char *name)
|
||||
Module *findModule(const char *name)
|
||||
{
|
||||
int idx;
|
||||
ModuleHash *current = NULL;
|
||||
@@ -1695,7 +1695,7 @@ void moduleAddAuthor(const char *author)
|
||||
* @return MOD_ERR_OK on success, anything else on fail.
|
||||
* @see moduleDelCallBack
|
||||
**/
|
||||
int moduleAddCallback(char *name, time_t when,
|
||||
int moduleAddCallback(const char *name, time_t when,
|
||||
int (*func) (int argc, char *argv[]), int argc,
|
||||
char **argv)
|
||||
{
|
||||
@@ -2121,7 +2121,7 @@ int moduleDataDebug(ModuleData ** md)
|
||||
* @param value The value for the key/value pair, this is what will be stored for you
|
||||
* @return MOD_ERR_OK will be returned on success
|
||||
**/
|
||||
int moduleAddData(ModuleData ** md, char *key, char *value)
|
||||
int moduleAddData(ModuleData ** md, const char *key, char *value)
|
||||
{
|
||||
ModuleData *newData = NULL;
|
||||
|
||||
@@ -2162,7 +2162,7 @@ int moduleAddData(ModuleData ** md, char *key, char *value)
|
||||
* @param key The key to find the data for
|
||||
* @return the value paired to the given key will be returned, or NULL
|
||||
**/
|
||||
char *moduleGetData(ModuleData ** md, char *key)
|
||||
char *moduleGetData(ModuleData ** md, const char *key)
|
||||
{
|
||||
/* See comment in moduleAddData... -GD */
|
||||
char *mod_name = sstrdup(mod_current_module_name);
|
||||
@@ -2197,7 +2197,7 @@ char *moduleGetData(ModuleData ** md, char *key)
|
||||
* @param md The module data for the struct to be used
|
||||
* @param key The key to delete the key/value pair for
|
||||
**/
|
||||
void moduleDelData(ModuleData ** md, char *key)
|
||||
void moduleDelData(ModuleData ** md, const char *key)
|
||||
{
|
||||
/* See comment in moduleAddData... -GD */
|
||||
char *mod_name = sstrdup(mod_current_module_name);
|
||||
@@ -2408,11 +2408,11 @@ const char *ano_moderr(void)
|
||||
/**
|
||||
* Allow ircd protocol files to update the protect level info tables.
|
||||
**/
|
||||
void updateProtectDetails(char *level_info_protect_word,
|
||||
char *level_info_protectme_word,
|
||||
char *fant_protect_add, char *fant_protect_del,
|
||||
char *level_protect_word, char *protect_set_mode,
|
||||
char *protect_unset_mode)
|
||||
void updateProtectDetails(const char *level_info_protect_word,
|
||||
const char *level_info_protectme_word,
|
||||
const char *fant_protect_add, const char *fant_protect_del,
|
||||
const char *level_protect_word, const char *protect_set_mode,
|
||||
const char *protect_unset_mode)
|
||||
{
|
||||
int i = 0;
|
||||
CSModeUtil ptr;
|
||||
|
||||
@@ -587,7 +587,7 @@ void hs_help(User * u)
|
||||
void hsreq_load_db(void)
|
||||
{
|
||||
FILE *fp;
|
||||
char *filename;
|
||||
const char *filename;
|
||||
char readbuf[1024];
|
||||
char *nick, *vident, *vhost, *creator, *tmp;
|
||||
int32 tmp_time;
|
||||
@@ -646,7 +646,7 @@ void hsreq_load_db(void)
|
||||
void hsreq_save_db(void)
|
||||
{
|
||||
FILE *fp;
|
||||
char *filename;
|
||||
const char *filename;
|
||||
const char *vident;
|
||||
HostCore *current;
|
||||
|
||||
|
||||
+3
-3
@@ -42,7 +42,7 @@ NewsItem *news = NULL;
|
||||
|
||||
struct newsmsgs {
|
||||
int16 type;
|
||||
char *name;
|
||||
const char *name;
|
||||
int msgs[MSG_MAX + 1];
|
||||
};
|
||||
|
||||
@@ -91,7 +91,7 @@ struct newsmsgs msgarray[] = {
|
||||
}
|
||||
};
|
||||
|
||||
static int *findmsgs(int16 type, char **type_name)
|
||||
static int *findmsgs(int16 type, const char **type_name)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < lenof(msgarray); i++) {
|
||||
@@ -362,7 +362,7 @@ void do_news(User * u, short type)
|
||||
{
|
||||
int is_servadmin = is_services_admin(u);
|
||||
char *cmd = strtok(NULL, " ");
|
||||
char *type_name;
|
||||
const char *type_name;
|
||||
int *msgs;
|
||||
|
||||
msgs = findmsgs(type, &type_name);
|
||||
|
||||
+1
-1
@@ -687,7 +687,7 @@ Server *server_global(Server * s, char *msg)
|
||||
|
||||
}
|
||||
|
||||
void oper_global(char *nick, char *fmt, ...)
|
||||
void oper_global(char *nick, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char msg[2048]; /* largest valid message is 512, this should cover any global */
|
||||
|
||||
@@ -678,7 +678,7 @@ class RatboxProto : public IRCDTS6Proto
|
||||
{
|
||||
if (UseTS6) {
|
||||
BotInfo *bi = findbot(nick);
|
||||
ratbox_cmd_tmode(nick, chan, "%s %s", ircd->botchanumode, bi ? bi->uid : nick);
|
||||
ratbox_cmd_tmode(nick, chan, "%s %s", ircd->botchanumode, bi ? bi->uid.c_str() : nick);
|
||||
}
|
||||
else SendMode(findbot(nick), chan, "%s %s", ircd->botchanumode, nick);
|
||||
}
|
||||
|
||||
+2
-1
@@ -54,6 +54,7 @@ void send_cmd(const char *source, const char *fmt, ...)
|
||||
|
||||
/*
|
||||
* Copypasta version that accepts std::string source.
|
||||
*/
|
||||
void send_cmd(const std::string &source, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
@@ -91,7 +92,7 @@ void send_cmd(const std::string &source, const char *fmt, ...)
|
||||
* @param ... any number of parameters
|
||||
* @return void
|
||||
*/
|
||||
void notice_server(char *source, Server * s, char *fmt, ...)
|
||||
void notice_server(char *source, Server * s, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE];
|
||||
|
||||
+5
-5
@@ -6,9 +6,9 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -499,7 +499,7 @@ int sputs(char *str, ano_socket_t s)
|
||||
* @param ... various args
|
||||
* @return int
|
||||
*/
|
||||
int sockprintf(ano_socket_t s, char *fmt, ...)
|
||||
int sockprintf(ano_socket_t s, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[16384]; /* Really huge, to try and avoid truncation */
|
||||
@@ -713,7 +713,7 @@ char *ano_sockstrerror(int error)
|
||||
|
||||
/* Microsoft decided not to use sequential numbers for the error codes,
|
||||
* so we can't just use the array index for the code. But, at least
|
||||
* use a binary search to make it as fast as possible.
|
||||
* use a binary search to make it as fast as possible.
|
||||
*/
|
||||
while (start <= stop) {
|
||||
mid = (start + stop) / 2;
|
||||
|
||||
Reference in New Issue
Block a user