/* commands, and where they go */ /*************************************************************************/ /* it's a waste of time to edit this file now -- you can do a binding */ /* to get the same effect: */ /* bind dcc o status *status <- makes '.status' only require 'o' */ /* that's easier to do and doesn't require a recompile. */ /*************************************************************************/ /* access required */ #define NEED_PARTY 1 #define NEED_XFER 2 #define NEED_OP 4 #define NEED_MASTER 8 #define NEED_OWNER 16 #define END_FIELD { NULL, NULL, -1 } #define CMD_LEAVE (Function)(-1) typedef int (*Function)(); typedef struct { char *name; Function func; int access; } cmd_t; /* stupid function prototypes */ int msg_die(), msg_hello(), msg_help(), msg_ident(), msg_info(), msg_invite(), msg_jump(), msg_memory(), msg_op(), msg_pass(), msg_rehash(), msg_reset(), msg_status(), msg_who(), msg_whois(), msg_email(), msg_notes(), msg_go(); /* MSG COMMANDS */ /* function call should be: int msg_cmd("handle","nick","user@host","params"); function is responsible for any logging (return 1 if successful, 0 if not) */ cmd_t C_msg[]={ { "die", msg_die, NEED_OWNER }, { "email", msg_email, 0 }, { "go", msg_go, NEED_OP }, { "hello", msg_hello, 0 }, { "help", msg_help, 0 }, { "ident", msg_ident, 0 }, { "info", msg_info, 0 }, { "invite", msg_invite, NEED_OP }, { "jump", msg_jump, NEED_MASTER }, { "memory", msg_memory, NEED_MASTER }, { "notes", msg_notes, 0 }, { "op", msg_op, NEED_OP }, { "pass", msg_pass, 0 }, { "rehash", msg_rehash, NEED_MASTER }, { "reset", msg_reset, NEED_MASTER }, { "status", msg_status, NEED_MASTER }, { "who", msg_who, 0 }, { "whois", msg_whois, 0 }, END_FIELD }; /* function prototypes, take two */ int cmd_pls_ban(), cmd_pls_bot(), cmd_chat(), cmd_pls_host(), cmd_pls_ignore(), cmd_pls_user(), cmd_mns_ban(), cmd_mns_host(), cmd_botinfo(), cmd_chinfo(), cmd_mns_ignore(), cmd_mns_user(), cmd_talk(), cmd_act(), cmd_addlog(), cmd_away(), cmd_bans(), cmd_boot(), cmd_bots(), cmd_chaddr(), cmd_channel(), cmd_chpass(), cmd_comment(), cmd_console(), cmd_dccstat(), cmd_debug(), cmd_define(), cmd_die(), cmd_deop(), cmd_dump(), cmd_edit(), cmd_email(), cmd_exec(), cmd_files(), cmd_handle(), cmd_help(), cmd_ignores(), cmd_info(), cmd_invite(), cmd_jump(), cmd_kick(), cmd_kickban(), cmd_link(), cmd_match(), cmd_me(), cmd_msg(), cmd_motd(), cmd_newpass(), cmd_note(), cmd_op(), cmd_rehash(), cmd_relay(), cmd_reset(), cmd_resetbans(), cmd_save(), cmd_say(), cmd_servers(), cmd_set(), cmd_simul(), cmd_status(), cmd_trace(), cmd_unlink(), cmd_who(), cmd_whois(), cmd_whom(), cmd_chemail(), cmd_echo(), cmd_pls_kick(), cmd_mns_kick(), cmd_bottree(), cmd_pls_reject(), cmd_notes(), cmd_mns_reject(), cmd_mns_common(), cmd_topic(), cmd_banner(), cmd_nick(), cmd_chattr(), cmd_adduser(); #ifdef TCL int cmd_tcl(), cmd_binds(); #endif /* DCC CHAT COMMANDS */ /* function call should be: int cmd_whatever(idx,z,"parameters"); as with msg commands, function is responsible for any logging */ cmd_t C_dcc[]={ { "+ban", cmd_pls_ban, NEED_OP }, { "+bot", cmd_pls_bot, NEED_MASTER }, { "+host",cmd_pls_host, NEED_MASTER }, { "+ignore", cmd_pls_ignore, NEED_MASTER }, { "+user", cmd_pls_user, NEED_MASTER }, { "-ban", cmd_mns_ban, NEED_OP }, { "-bot", cmd_mns_user, NEED_MASTER }, { "-host", cmd_mns_host, NEED_MASTER }, { "-ignore", cmd_mns_ignore, NEED_MASTER }, { "-user", cmd_mns_user, NEED_MASTER }, { "///", cmd_talk, 0 }, { "act", cmd_act, NEED_OP }, { "addlog", cmd_addlog, NEED_OP }, { "adduser", cmd_adduser, NEED_MASTER }, { "away", cmd_away, 0 }, { "banner", cmd_banner, NEED_MASTER }, { "bans", cmd_bans, NEED_OP }, #ifdef TCL { "binds", cmd_binds, NEED_MASTER }, #endif { "boot", cmd_boot, NEED_MASTER }, { "botinfo", cmd_botinfo, 0 }, { "bots", cmd_bots, 0 }, { "bottree", cmd_bottree, 0 }, { "chaddr", cmd_chaddr, NEED_OP }, { "channel", cmd_channel, NEED_OP }, { "chat", cmd_chat, 0 }, { "chattr", cmd_chattr, NEED_MASTER }, { "chemail", cmd_chemail, NEED_MASTER }, { "chinfo", cmd_chinfo, NEED_MASTER }, { "chpass", cmd_chpass, NEED_MASTER }, { "comment", cmd_comment, NEED_MASTER }, { "console", cmd_console, NEED_OP }, { "dccstat", cmd_dccstat, NEED_MASTER }, { "debug", cmd_debug, NEED_MASTER }, #ifndef TCL { "define", cmd_define, NEED_OWNER }, #endif { "deop", cmd_deop, NEED_OP }, { "die", cmd_die, NEED_OWNER }, { "dump", cmd_dump, NEED_OP }, { "echo", cmd_echo, 0 }, { "edit", cmd_edit, NEED_OWNER }, { "email", cmd_email, 0 }, #ifdef EXEC { "exec", cmd_exec, NEED_OWNER }, #endif { "files", cmd_files, 0 }, { "handle", cmd_handle, NEED_MASTER }, { "help", cmd_help, 0 }, { "ignores", cmd_ignores, NEED_MASTER }, { "info", cmd_info, 0 }, { "invite", cmd_invite, NEED_OP }, { "jump", cmd_jump, NEED_MASTER }, { "kick", cmd_kick, NEED_OP }, { "kickban", cmd_kickban, NEED_OP }, { "link", cmd_link, NEED_MASTER }, { "match", cmd_match, NEED_OP }, { "me", cmd_me, 0 }, { "motd", cmd_motd, 0 }, { "msg", cmd_msg, NEED_OP }, { "newpass", cmd_newpass, 0 }, { "nick", cmd_nick, NEED_OP }, { "note", cmd_note, 0 }, { "notes", cmd_notes, 0 }, { "op", cmd_op, NEED_OP }, { "quit", CMD_LEAVE, 0 }, { "rehash", cmd_rehash, NEED_MASTER }, { "relay", cmd_relay, NEED_MASTER }, { "reset", cmd_reset, NEED_MASTER }, { "resetbans", cmd_resetbans, NEED_OP }, { "save", cmd_save, NEED_MASTER }, { "say", cmd_say, NEED_OP }, { "servers", cmd_servers, NEED_OP }, { "set", cmd_set, NEED_OWNER }, #ifdef SIMUL { "simul", cmd_simul, NEED_OWNER }, #endif { "status", cmd_status, NEED_MASTER }, #ifdef TCL { "tcl", cmd_tcl, NEED_OWNER }, #endif { "topic", cmd_topic, NEED_OP }, { "trace", cmd_trace, NEED_MASTER }, { "unlink", cmd_unlink, NEED_MASTER }, { "who", cmd_who, 0 }, { "whois", cmd_whois, NEED_OP }, { "whom", cmd_whom, 0 }, END_FIELD }; /* bleh. */ int cmd_chdir(), cmd_desc(), cmd_get(), cmd_file_help(), cmd_hide(), cmd_import(), cmd_ls(), cmd_mv(), cmd_pwd(), cmd_rm(), cmd_cp(), cmd_mkdir(), cmd_rmdir(), cmd_pending(), cmd_cancel(); /* FILE AREA COMMANDS */ /* function call should be: int cmd_whatever(idx,z,"parameters"); as with msg commands, function is responsible for any logging */ cmd_t C_file[]={ { "cancel", cmd_cancel, 0 }, { "cd", cmd_chdir, 0 }, { "chdir", cmd_chdir, 0 }, { "cp", cmd_cp, NEED_MASTER }, { "desc", cmd_desc, 0 }, { "get", cmd_get, 0 }, { "help", cmd_file_help, 0 }, { "hide", cmd_hide, NEED_MASTER }, { "import", cmd_import, NEED_MASTER }, { "ls", cmd_ls, 0 }, { "mkdir", cmd_mkdir, NEED_MASTER }, { "mv", cmd_mv, NEED_MASTER }, { "note", cmd_note, 0 }, /* same as in normal area */ { "pending", cmd_pending, 0 }, { "pwd", cmd_pwd, 0 }, { "quit", CMD_LEAVE, 0 }, { "rm", cmd_rm, NEED_MASTER }, { "rmdir", cmd_rmdir, NEED_MASTER }, END_FIELD }; /* this sucks!! */ int tand_end_user(), tand_end_userlist(), tand_pls_attr(), tand_pls_ban(), tand_pls_host(), tand_pls_ignore(), tand_mns_attr(), tand_mns_ban(), tand_mns_host(), tand_mns_ignore(), tand_ackuser(), tand_act(), tand_op(), tand_bye(), tand_chat(), tand_chcomment(), tand_chemail(), tand_zapfbroad(), tand_chdccdir(), tand_chinfo(), tand_chhand(), tand_chpass(), tand_trying(), tand_comment(), tand_email(), tand_handshake(), tand_info(), tand_dccdir(), tand_host(), tand_killuser(), tand_laston(), tand_link_cmd(), tand_linked(), tand_newuser(), tand_ping(), tand_pong(), tand_end_trying(), tand_zapf(), tand_priv(), tand_reject(), tand_resync(), tand_resync_no(), tand_resyncq(), tand_trace(), tand_traced(), tand_ufno(), tand_ufyes(), tand_unlink_cmd(), tand_unlinked(), tand_userfileq(), tand_user(), tand_version(), tand_whoq(), tand_whom(), tand_who(), tand_nlinked(), tand_thisbot(), tand_infoq(), tand_motd(), tand_opno(), tand_chan(), tand_actchan(), tand_chattr(); /* TANDEM BOT COMMANDS */ /* function call should be: int tand_whatever(idx,z,"parameters"); */ cmd_t C_tand[]={ { "*trying", tand_end_trying, 0 }, { "*user", tand_end_user, 0 }, { "*userlist", tand_end_userlist, 0 }, { "+ban", tand_pls_ban, 0 }, { "+host", tand_pls_host, 0 }, { "+ignore", tand_pls_ignore, 0 }, { "-ban", tand_mns_ban, 0 }, { "-host", tand_mns_host, 0 }, { "-ignore", tand_mns_ignore, 0 }, { "ackuser", tand_ackuser, 0 }, { "act", tand_act, 0 }, { "actchan", tand_actchan, 0 }, { "bye", tand_bye, 0 }, { "chan", tand_chan, 0 }, { "chat", tand_chat, 0 }, { "chcomment", tand_chcomment, 0 }, { "chdccdir", tand_chdccdir, 0 }, { "chemail", tand_chemail, 0 }, { "chattr", tand_chattr, 0 }, { "chhand", tand_chhand, 0 }, { "chinfo", tand_chinfo, 0 }, { "chpass", tand_chpass, 0 }, { "comment", tand_comment, 0 }, { "dccdir", tand_dccdir, 0 }, { "email", tand_email, 0 }, { "handshake", tand_handshake, 0 }, { "host", tand_host, 0 }, { "info", tand_info, 0 }, { "info?", tand_infoq, 0 }, { "killuser", tand_killuser, 0 }, { "laston", tand_laston, 0 }, { "link", tand_link_cmd, 0 }, { "linked", tand_linked, 0 }, { "motd", tand_motd, 0 }, { "newuser", tand_newuser, 0 }, { "nlinked", tand_nlinked, 0 }, { "op", tand_op, 0 }, { "op-no", tand_opno, 0 }, { "ping", tand_ping, 0 }, { "pong", tand_pong, 0 }, { "priv", tand_priv, 0 }, { "reject", tand_reject, 0 }, { "resync!", tand_resync, 0 }, { "resync-no", tand_resync_no, 0 }, { "resync?", tand_resyncq, 0 }, { "thisbot", tand_thisbot, 0 }, { "trace", tand_trace, 0 }, { "traced", tand_traced, 0 }, { "trying", tand_trying, 0 }, { "uf-no", tand_ufno, 0 }, { "uf-yes", tand_ufyes, 0 }, { "unlink", tand_unlink_cmd, 0 }, { "unlinked", tand_unlinked, 0 }, { "user", tand_user, 0 }, { "userfile?", tand_userfileq, 0 }, { "version", tand_version, 0 }, { "who", tand_who, 0 }, { "who?", tand_whoq, 0 }, { "whom", tand_whom, 0 }, { "zapf", tand_zapf, 0 }, { "zapf-broad", tand_zapfbroad, 0 }, END_FIELD };