Functions

commands.h File Reference

#include "modules.h"
Include dependency graph for commands.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

MDE Commandlookup_cmd (Command *list, char *name)
void run_cmd (char *service, User *u, Command *list, char *name)
void help_cmd (char *service, User *u, Command *list, char *name)
void do_run_cmd (char *service, User *u, Command *c, const char *cmd)
MDE void do_help_limited (char *service, User *u, Command *c)
void do_help_cmd (char *service, User *u, Command *c, const char *cmd)
MDE void mod_help_cmd (char *service, User *u, CommandHash *cmdTable[], const char *cmd)
MDE void mod_run_cmd (char *service, User *u, CommandHash *cmdTable[], const char *cmd)

Function Documentation

void do_help_cmd ( char *  service,
User u,
Command c,
const char *  cmd 
)
MDE void do_help_limited ( char *  service,
User u,
Command c 
)

Output the 'Limited to' line for the given command

Parameters:
service Services Client
u User Struct
c Command Struct
Returns:
void

Definition at line 137 of file commands.c.

References Command_::has_priv, is_host_remover(), is_host_setter(), is_oper(), is_services_admin(), is_services_oper(), is_services_root(), and notice_lang().

Referenced by do_help_cmd(), and myHelpResonse().

void do_run_cmd ( char *  service,
User u,
Command c,
const char *  cmd 
)

Run the given command

Parameters:
services Services Client
u User Struct
c Command Struct
cmd Command
Returns:
void

Definition at line 85 of file commands.c.

References alog(), checkDefCon(), current, DEFCON_OPER_ONLY, DEFCON_SILENT_OPER_ONLY, findModule(), Command_::has_priv, is_oper(), MOD_CONT, mod_current_module, mod_current_module_name, Command_::mod_name, Command_::next, user_::nick, notice_lang(), and Command_::routine.

Referenced by mod_run_cmd(), and run_cmd().

void help_cmd ( char *  service,
User u,
Command list,
char *  cmd 
)

Find the Help Command

Parameters:
services Services Client
u User Struct
c Command Struct
cmd Command
Returns:
void

Definition at line 250 of file commands.c.

References c, do_help_cmd(), and lookup_cmd().

MDE Command* lookup_cmd ( Command list,
char *  cmd 
)

Return the Command corresponding to the given name, or NULL if no such command exists.

Parameters:
list Command struct
cmd Command to look up
Returns:
Command Struct for the given cmd

Definition at line 27 of file commands.c.

References c, Command_::name, and stricmp().

Referenced by help_cmd(), and run_cmd().

MDE void mod_help_cmd ( char *  service,
User u,
CommandHash cmdTable[],
const char *  cmd 
)

Find the Help Command

Parameters:
services Services Client
u User Struct
Command Hash Table
cmd Command
Returns:
void

Definition at line 266 of file commands.c.

References c, do_help_cmd(), and findCommand().

Referenced by do_help().

MDE void mod_run_cmd ( char *  service,
User u,
CommandHash cmdTable[],
const char *  cmd 
)

Run the routine for the given command, if it exists and the user has privilege to do so; if not, print an appropriate error message.

Parameters:
services Services Client
u User Struct
Command Hash Table
cmd Command
Returns:
void

Definition at line 67 of file commands.c.

References c, do_run_cmd(), and findCommand().

Referenced by botserv(), catserv(), chanserv(), helpserv(), hostserv(), memoserv(), nickserv(), and operserv().

void run_cmd ( char *  service,
User u,
Command list,
char *  cmd 
)

Run the routine for the given command, if it exists and the user has privilege to do so; if not, print an appropriate error message.

Parameters:
services Services Client
u User Struct
list Command struct
cmd Command
Returns:
void

Definition at line 50 of file commands.c.

References c, do_run_cmd(), and lookup_cmd().