mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-09 12:13:12 +02:00
find_command(char *cmd, int flags) / find_command_simple(char *cmd)
This commit is contained in:
@@ -51,7 +51,6 @@ typedef struct Class {
|
||||
|
||||
extern aClass *classes;
|
||||
|
||||
extern aClass *find_class(int);
|
||||
extern int get_client_class(Client *);
|
||||
extern int get_client_ping(Client *);
|
||||
extern int get_con_freq(aClass *);
|
||||
|
||||
+2
-2
@@ -158,8 +158,8 @@ extern MODVAR struct list_head oper_list;
|
||||
extern MODVAR struct list_head unknown_list;
|
||||
extern MODVAR struct list_head global_server_list;
|
||||
extern MODVAR struct list_head dead_list;
|
||||
extern RealCommand *find_Command(char *cmd, int flags);
|
||||
extern RealCommand *find_Command_simple(char *cmd);
|
||||
extern RealCommand *find_command(char *cmd, int flags);
|
||||
extern RealCommand *find_command_simple(char *cmd);
|
||||
extern Channel *find_channel(char *, Channel *);
|
||||
extern Membership *find_membership_link(Membership *lp, Channel *ptr);
|
||||
extern Member *find_member_link(Member *, Client *);
|
||||
|
||||
+4
-4
@@ -89,7 +89,7 @@ static Command *CommandAddInternal(Module *module, char *cmd, CmdFunc func, Alia
|
||||
Command *command = NULL;
|
||||
RealCommand *c;
|
||||
|
||||
if (find_Command_simple(cmd))
|
||||
if (find_command_simple(cmd))
|
||||
{
|
||||
if (module)
|
||||
module->errorcode = MODERR_EXISTS;
|
||||
@@ -193,7 +193,7 @@ void do_cmd(Client *client, MessageTag *mtags, char *cmd, int parc, char *parv[]
|
||||
{
|
||||
RealCommand *cmptr;
|
||||
|
||||
cmptr = find_Command_simple(cmd);
|
||||
cmptr = find_command_simple(cmd);
|
||||
if (cmptr)
|
||||
(*cmptr->func) (client, mtags, parc, parv);
|
||||
}
|
||||
@@ -241,7 +241,7 @@ static RealCommand *add_Command_backend(char *cmd)
|
||||
*/
|
||||
|
||||
/** Find a command by name and flags */
|
||||
RealCommand *find_Command(char *cmd, int flags)
|
||||
RealCommand *find_command(char *cmd, int flags)
|
||||
{
|
||||
RealCommand *p;
|
||||
for (p = CommandHash[toupper(*cmd)]; p; p = p->next) {
|
||||
@@ -260,7 +260,7 @@ RealCommand *find_Command(char *cmd, int flags)
|
||||
}
|
||||
|
||||
/** Find a command by name (no access rights check) */
|
||||
RealCommand *find_Command_simple(char *cmd)
|
||||
RealCommand *find_command_simple(char *cmd)
|
||||
{
|
||||
RealCommand *c;
|
||||
|
||||
|
||||
+5
-5
@@ -1712,7 +1712,7 @@ static void do_weird_shun_stuff()
|
||||
{
|
||||
RealCommand *cmptr;
|
||||
|
||||
if ((cmptr = find_Command_simple("PART")))
|
||||
if ((cmptr = find_command_simple("PART")))
|
||||
{
|
||||
if (ALLOW_PART_IF_SHUNNED)
|
||||
cmptr->flags |= CMD_SHUN;
|
||||
@@ -2361,7 +2361,7 @@ void config_rehash()
|
||||
safe_free(log_ptr);
|
||||
}
|
||||
for (alias_ptr = conf_alias; alias_ptr; alias_ptr = (ConfigItem_alias *)next) {
|
||||
RealCommand *cmptr = find_Command(alias_ptr->alias, 0);
|
||||
RealCommand *cmptr = find_command(alias_ptr->alias, 0);
|
||||
ConfigItem_alias_format *fmt;
|
||||
next = (ListStruct *)alias_ptr->next;
|
||||
safe_free(alias_ptr->nick);
|
||||
@@ -9064,9 +9064,9 @@ int _conf_alias(ConfigFile *conf, ConfigEntry *ce)
|
||||
ConfigEntry *cep, *cepp;
|
||||
RealCommand *cmptr;
|
||||
|
||||
if ((cmptr = find_Command(ce->ce_vardata, CMD_ALIAS)))
|
||||
if ((cmptr = find_command(ce->ce_vardata, CMD_ALIAS)))
|
||||
CommandDelX(NULL, cmptr);
|
||||
if (find_Command_simple(ce->ce_vardata))
|
||||
if (find_command_simple(ce->ce_vardata))
|
||||
{
|
||||
config_warn("%s:%i: Alias '%s' would conflict with command (or server token) '%s', alias not added.",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum,
|
||||
@@ -9157,7 +9157,7 @@ int _test_alias(ConfigFile *conf, ConfigEntry *ce) {
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
|
||||
errors++;
|
||||
}
|
||||
else if (!find_Command(ce->ce_vardata, CMD_ALIAS) && find_Command(ce->ce_vardata, 0)) {
|
||||
else if (!find_command(ce->ce_vardata, CMD_ALIAS) && find_command(ce->ce_vardata, 0)) {
|
||||
config_status("%s:%i: %s is an existing command, can not add alias",
|
||||
ce->ce_fileptr->cf_filename, ce->ce_varlinenum, ce->ce_vardata);
|
||||
errors++;
|
||||
|
||||
+1
-1
@@ -1260,7 +1260,7 @@ int InitUnrealIRCd(int argc, char *argv[])
|
||||
umodes_check_for_changes();
|
||||
charsys_check_for_changes();
|
||||
clicap_init();
|
||||
if (!find_Command_simple("PRIVMSG"))
|
||||
if (!find_command_simple("PRIVMSG"))
|
||||
{
|
||||
config_error("Someone forgot to load modules with proper commands in them. READ THE DOCUMENTATION");
|
||||
exit(-4);
|
||||
|
||||
+1
-1
@@ -1084,7 +1084,7 @@ CommandOverride *CommandOverrideAddEx(Module *module, char *name, int priority,
|
||||
RealCommand *p;
|
||||
CommandOverride *ovr;
|
||||
|
||||
if (!(p = find_Command_simple(name)))
|
||||
if (!(p = find_command_simple(name)))
|
||||
{
|
||||
if (module)
|
||||
module->errorcode = MODERR_NOTFOUND;
|
||||
|
||||
+1
-1
@@ -374,7 +374,7 @@ static void parse2(Client *cptr, Client **fromptr, MessageTag *mtags, char *ch)
|
||||
flags |= CMD_VIRUS;
|
||||
if (IsOper(from))
|
||||
flags |= CMD_OPER;
|
||||
cmptr = find_Command(ch, flags);
|
||||
cmptr = find_command(ch, flags);
|
||||
if (!cmptr || !(cmptr->flags & CMD_NOLAG))
|
||||
{
|
||||
/* Add fake lag (doing this early in the code, so we don't forget) */
|
||||
|
||||
Reference in New Issue
Block a user