Selaa lähdekoodia

* Added type field to cmd_t to specify 0/HUB/LEAF (both/1/2)

svn: 1798
Bryan Drewery 21 vuotta sitten
vanhempi
commit
09d6f654a6

+ 4 - 4
Makefile.in

@@ -50,22 +50,22 @@ MAKEFLAGS = -s -j4
 
 
 MAKE_LEAF = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'LD=$(LD)' \
 MAKE_LEAF = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'LD=$(LD)' \
 'CCDEPMODE=$(CCDEPMODE)' \
 'CCDEPMODE=$(CCDEPMODE)' \
-'STRIP=$(STRIP)' 'CFLGS=$(CFLGS) -DLEAF' \
+'STRIP=$(STRIP)' 'CFLGS=$(CFLGS) -DLEAF=2' \
 'LIBS=$(LIBS)' 'EGGEXEC=$(LEAFEXEC)' 'EGGBUILD=(leaf)'
 'LIBS=$(LIBS)' 'EGGEXEC=$(LEAFEXEC)' 'EGGBUILD=(leaf)'
 
 
 MAKE_DLEAF = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CCDEBUG)' 'LD=$(LDDEBUG) -g' \
 MAKE_DLEAF = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CCDEBUG)' 'LD=$(LDDEBUG) -g' \
 'CCDEPMODE=$(CCDEPMODE)' \
 'CCDEPMODE=$(CCDEPMODE)' \
-'STRIP=touch' 'CFLGS=$(DEBCXXFLAGS) -DLEAF $(CFLGS)' \
+'STRIP=touch' 'CFLGS=$(DEBCXXFLAGS) -DLEAF=2 $(CFLGS)' \
 'LIBS=$(LIBS)' 'EGGEXEC=$(LEAFEXEC)' 'EGGBUILD=(debug leaf)' 
 'LIBS=$(LIBS)' 'EGGEXEC=$(LEAFEXEC)' 'EGGBUILD=(debug leaf)' 
 
 
 MAKE_HUB = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'LD=$(LD)' \
 MAKE_HUB = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'LD=$(LD)' \
 'CCDEPMODE=$(CCDEPMODE)' \
 'CCDEPMODE=$(CCDEPMODE)' \
-'STRIP=$(STRIP)' 'CFLGS=$(CFLGS) -DHUB' \
+'STRIP=$(STRIP)' 'CFLGS=$(CFLGS) -DHUB=1' \
 'LIBS=$(LIBS)' 'EGGEXEC=$(HUBEXEC)' 'EGGBUILD=(hub)' 
 'LIBS=$(LIBS)' 'EGGEXEC=$(HUBEXEC)' 'EGGBUILD=(hub)' 
 
 
 MAKE_DHUB = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CCDEBUG)' 'LD=$(LDDEBUG) -g' \
 MAKE_DHUB = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CCDEBUG)' 'LD=$(LDDEBUG) -g' \
 'CCDEPMODE=$(CCDEPMODE)' \
 'CCDEPMODE=$(CCDEPMODE)' \
-'STRIP=touch' 'CFLGS=$(DEBCXXFLAGS) -DHUB $(CFLGS)' \
+'STRIP=touch' 'CFLGS=$(DEBCXXFLAGS) -DHUB=1 $(CFLGS)' \
 'LIBS=$(LIBS)' 'EGGEXEC=$(HUBEXEC)' 'EGGBUILD=(debug hub)'
 'LIBS=$(LIBS)' 'EGGEXEC=$(HUBEXEC)' 'EGGBUILD=(debug hub)'
 
 
 MAKE_UTILS = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CCDEBUG)' 'STRIP=touch' \
 MAKE_UTILS = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CCDEBUG)' 'STRIP=touch' \

+ 6 - 6
src/botcmd.c

@@ -868,9 +868,9 @@ static void bot_thisbot(int idx, char *par)
   strcpy(dcc[idx].nick, par);
   strcpy(dcc[idx].nick, par);
 }
 }
 
 
+#ifdef HUB
 static void bot_hublog(char *botnick, char *code, char *msg)
 static void bot_hublog(char *botnick, char *code, char *msg)
 {
 {
-#ifdef HUB
   char *par = NULL, *parp;
   char *par = NULL, *parp;
   par = parp = strdup(msg);
   par = parp = strdup(msg);
   if (egg_isdigit(par[0])) {
   if (egg_isdigit(par[0])) {
@@ -881,8 +881,8 @@ static void bot_hublog(char *botnick, char *code, char *msg)
     putlog(LOG_ERRORS, "*", "Malformed HL line from %s: %s %s", botnick, code, par);
     putlog(LOG_ERRORS, "*", "Malformed HL line from %s: %s %s", botnick, code, par);
   }
   }
   free(parp);
   free(parp);
-#endif /* HUB */
 }
 }
+#endif /* HUB */
 
 
 /* Used to send a direct msg from Tcl on one bot to Tcl on another
 /* Used to send a direct msg from Tcl on one bot to Tcl on another
  * zapf <frombot> <tobot> <code [param]>
  * zapf <frombot> <tobot> <code [param]>
@@ -1296,12 +1296,12 @@ static void bot_rsimr(char *botnick, char *code, char *msg)
 
 
 static cmd_t my_bot[] = 
 static cmd_t my_bot[] = 
 {
 {
-  {"hl",	"",	(Function) bot_hublog,  NULL},
 #ifdef HUB	/* This will only allow hubs to read the return text */
 #ifdef HUB	/* This will only allow hubs to read the return text */
-  {"r-sr",	"",	(Function) bot_rsimr,	NULL},
+  {"hl",	"",	(Function) bot_hublog,  NULL, HUB},
+  {"r-sr",	"",	(Function) bot_rsimr,	NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"r-s",	"",	(Function) bot_rsim,	NULL},
-  {NULL, 	NULL, 	NULL, 			NULL}
+  {"r-s",	"",	(Function) bot_rsim,	NULL, 0},
+  {NULL, 	NULL, 	NULL, 			NULL, 0}
 };
 };
 
 
 void init_botcmd()
 void init_botcmd()

+ 107 - 107
src/cmds.c

@@ -4280,141 +4280,141 @@ static void cmd_quit(int idx, char *text)
  */
  */
 cmd_t C_dcc[] =
 cmd_t C_dcc[] =
 {
 {
-  {"+host",		"o|o",	(Function) cmd_pls_host,	NULL},
-  {"+ignore",		"m",	(Function) cmd_pls_ignore,	NULL},
-  {"+user",		"m",	(Function) cmd_pls_user,	NULL},
+  {"+host",		"o|o",	(Function) cmd_pls_host,	NULL, 0},
+  {"+ignore",		"m",	(Function) cmd_pls_ignore,	NULL, 0},
+  {"+user",		"m",	(Function) cmd_pls_user,	NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"-bot",		"a",	(Function) cmd_mns_user,	NULL},
+  {"-bot",		"a",	(Function) cmd_mns_user,	NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"-host",		"",	(Function) cmd_mns_host,	NULL},
-  {"-ignore",		"m",	(Function) cmd_mns_ignore,	NULL},
-  {"-user",		"m",	(Function) cmd_mns_user,	NULL},
-  {"addlog",		"mo|o",	(Function) cmd_addlog,		NULL},
-/*  {"putlog",		"mo|o",	(Function) cmd_addlog,		NULL}, */
-  {"about",		"",	(Function) cmd_about,		NULL},
-  {"addline",		"",	(Function) cmd_addline,		NULL},
-  {"away",		"",	(Function) cmd_away,		NULL},
-  {"back",		"",	(Function) cmd_back,		NULL},
+  {"-host",		"",	(Function) cmd_mns_host,	NULL, 0},
+  {"-ignore",		"m",	(Function) cmd_mns_ignore,	NULL, 0},
+  {"-user",		"m",	(Function) cmd_mns_user,	NULL, 0},
+  {"addlog",		"mo|o",	(Function) cmd_addlog,		NULL, 0},
+/*  {"putlog",		"mo|o",	(Function) cmd_addlog,		NULL, 0}, */
+  {"about",		"",	(Function) cmd_about,		NULL, 0},
+  {"addline",		"",	(Function) cmd_addline,		NULL, 0},
+  {"away",		"",	(Function) cmd_away,		NULL, 0},
+  {"back",		"",	(Function) cmd_back,		NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"backup",		"m|m",	(Function) cmd_backup,		NULL},
-  {"boot",		"m",	(Function) cmd_boot,		NULL},
-  {"botconfig",		"n",	(Function) cmd_botconfig,	NULL},
-  {"bots",		"m",	(Function) cmd_bots,		NULL},
-  {"downbots",		"m",	(Function) cmd_downbots,	NULL},
-  {"bottree",		"n",	(Function) cmd_bottree,		NULL},
-  {"chaddr",		"a",	(Function) cmd_chaddr,		NULL},
+  {"backup",		"m|m",	(Function) cmd_backup,		NULL, HUB},
+  {"boot",		"m",	(Function) cmd_boot,		NULL, HUB},
+  {"botconfig",		"n",	(Function) cmd_botconfig,	NULL, HUB},
+  {"bots",		"m",	(Function) cmd_bots,		NULL, HUB},
+  {"downbots",		"m",	(Function) cmd_downbots,	NULL, HUB},
+  {"bottree",		"n",	(Function) cmd_bottree,		NULL, HUB},
+  {"chaddr",		"a",	(Function) cmd_chaddr,		NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"chat",		"",	(Function) cmd_chat,		NULL},
-  {"chattr",		"m|m",	(Function) cmd_chattr,		NULL},
+  {"chat",		"",	(Function) cmd_chat,		NULL, 0},
+  {"chattr",		"m|m",	(Function) cmd_chattr,		NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"chhandle",		"m",	(Function) cmd_chhandle,	NULL},
-/*  {"chnick",		"m",	(Function) cmd_chhandle,	NULL}, */
-  {"chpass",		"m",	(Function) cmd_chpass,		NULL},
-  {"chsecpass",		"n",	(Function) cmd_chsecpass,	NULL},
-  {"cmdpass",           "a",    (Function) cmd_cmdpass,         NULL},
+  {"chhandle",		"m",	(Function) cmd_chhandle,	NULL, HUB},
+/*  {"chnick",		"m",	(Function) cmd_chhandle,	NULL, HUB}, */
+  {"chpass",		"m",	(Function) cmd_chpass,		NULL, HUB},
+  {"chsecpass",		"n",	(Function) cmd_chsecpass,	NULL, HUB},
+  {"cmdpass",           "a",    (Function) cmd_cmdpass,         NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"color",		"",     (Function) cmd_color,           NULL},
-  {"comment",		"m|m",	(Function) cmd_comment,		NULL},
+  {"color",		"",     (Function) cmd_color,           NULL, 0},
+  {"comment",		"m|m",	(Function) cmd_comment,		NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"config",		"n",	(Function) cmd_config,		NULL},
+  {"config",		"n",	(Function) cmd_config,		NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"console",		"-|-",	(Function) cmd_console,		NULL},
-  {"date",		"",	(Function) cmd_date,		NULL},
-  {"dccstat",		"a",	(Function) cmd_dccstat,		NULL},
-  {"debug",		"a",	(Function) cmd_debug,		NULL},
-  {"timers",		"a",	(Function) cmd_timers,		NULL},
-  {"die",		"n",	(Function) cmd_die,		NULL},
-  {"echo",		"",	(Function) cmd_echo,		NULL},
-  {"login",		"",	(Function) cmd_login,		NULL},
-  {"fixcodes",		"",	(Function) cmd_fixcodes,	NULL},
-  {"handle",		"",	(Function) cmd_handle,		NULL},
-  {"nohelp",		"-|-",	(Function) cmd_nohelp,		NULL},
-  {"help",		"-|-",	(Function) cmd_help,		NULL},
-  {"ignores",		"m",	(Function) cmd_ignores,		NULL},
+  {"console",		"-|-",	(Function) cmd_console,		NULL, 0},
+  {"date",		"",	(Function) cmd_date,		NULL, 0},
+  {"dccstat",		"a",	(Function) cmd_dccstat,		NULL, 0},
+  {"debug",		"a",	(Function) cmd_debug,		NULL, 0},
+  {"timers",		"a",	(Function) cmd_timers,		NULL, 0},
+  {"die",		"n",	(Function) cmd_die,		NULL, 0},
+  {"echo",		"",	(Function) cmd_echo,		NULL, 0},
+  {"login",		"",	(Function) cmd_login,		NULL, 0},
+  {"fixcodes",		"",	(Function) cmd_fixcodes,	NULL, 0},
+  {"handle",		"",	(Function) cmd_handle,		NULL, 0},
+  {"nohelp",		"-|-",	(Function) cmd_nohelp,		NULL, 0},
+  {"help",		"-|-",	(Function) cmd_help,		NULL, 0},
+  {"ignores",		"m",	(Function) cmd_ignores,		NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"link",		"n",	(Function) cmd_link,		NULL},
+  {"link",		"n",	(Function) cmd_link,		NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"match",		"m|m",	(Function) cmd_match,		NULL},
-  {"matchbot",		"m|m",	(Function) cmd_matchbot,	NULL},
-  {"me",		"",	(Function) cmd_me,		NULL},
-  {"motd",		"",	(Function) cmd_motd,		NULL},
+  {"match",		"m|m",	(Function) cmd_match,		NULL, 0},
+  {"matchbot",		"m|m",	(Function) cmd_matchbot,	NULL, 0},
+  {"me",		"",	(Function) cmd_me,		NULL, 0},
+  {"motd",		"",	(Function) cmd_motd,		NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"newleaf",		"n",	(Function) cmd_newleaf,		NULL},
-  {"nopass",		"m",	(Function) cmd_nopass,		NULL},
+  {"newleaf",		"n",	(Function) cmd_newleaf,		NULL, HUB},
+  {"nopass",		"m",	(Function) cmd_nopass,		NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"newpass",		"",	(Function) cmd_newpass,		NULL},
-  {"secpass",		"",	(Function) cmd_secpass,		NULL},
-/*  {"nick",		"",	(Function) cmd_handle,		NULL}, */
-  {"page",		"",	(Function) cmd_page,		NULL},
-  {"quit",		"",	(Function) cmd_quit,		NULL},
-  {"relay",		"i",	(Function) cmd_relay,		NULL},
+  {"newpass",		"",	(Function) cmd_newpass,		NULL, 0},
+  {"secpass",		"",	(Function) cmd_secpass,		NULL, 0},
+/*  {"nick",		"",	(Function) cmd_handle,		NULL, 0}, */
+  {"page",		"",	(Function) cmd_page,		NULL, 0},
+  {"quit",		"",	(Function) cmd_quit,		NULL, 0},
+  {"relay",		"i",	(Function) cmd_relay,		NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"reload",		"m|m",	(Function) cmd_reload,		NULL},
+  {"reload",		"m|m",	(Function) cmd_reload,		NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"restart",		"m",	(Function) cmd_restart,		NULL},
+  {"restart",		"m",	(Function) cmd_restart,		NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"save",		"m|m",	(Function) cmd_save,		NULL},
+  {"save",		"m|m",	(Function) cmd_save,		NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"simul",		"a",	(Function) cmd_simul,		NULL},
-  {"status",		"m|m",	(Function) cmd_status,		NULL},
-  {"strip",		"",	(Function) cmd_strip,		NULL},
-  {"su",		"a",	(Function) cmd_su,		NULL},
+  {"simul",		"a",	(Function) cmd_simul,		NULL, 0},
+  {"status",		"m|m",	(Function) cmd_status,		NULL, 0},
+  {"strip",		"",	(Function) cmd_strip,		NULL, 0},
+  {"su",		"a",	(Function) cmd_su,		NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"trace",		"n",	(Function) cmd_trace,		NULL},
+  {"trace",		"n",	(Function) cmd_trace,		NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"traffic",		"m",	(Function) cmd_traffic,		NULL},
-  {"unlink",		"m",	(Function) cmd_unlink,		NULL},
-  {"update",		"a",	(Function) cmd_update,		NULL},
+  {"traffic",		"m",	(Function) cmd_traffic,		NULL, 0},
+  {"unlink",		"m",	(Function) cmd_unlink,		NULL, 0},
+  {"update",		"a",	(Function) cmd_update,		NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"netcrontab",	"a",	(Function) cmd_netcrontab,	NULL},
+  {"netcrontab",	"a",	(Function) cmd_netcrontab,	NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"uptime",		"m|m",	(Function) cmd_uptime,		NULL},
+  {"uptime",		"m|m",	(Function) cmd_uptime,		NULL, 0},
 #ifndef CYGWIN_HACKS
 #ifndef CYGWIN_HACKS
-  {"crontab",		"a",	(Function) cmd_crontab,		NULL},
+  {"crontab",		"a",	(Function) cmd_crontab,		NULL, 0},
 #endif /* !CYGWIN_HACKS */
 #endif /* !CYGWIN_HACKS */
-  {"dns",               "",      (Function) cmd_dns,             NULL},
+  {"dns",		"",	(Function) cmd_dns,             NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"who",		"n",	(Function) cmd_who,		NULL},
+  {"who",		"n",	(Function) cmd_who,		NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"whois",		"",	(Function) cmd_whois,		NULL},
-  {"whom",		"",	(Function) cmd_whom,		NULL},
-  {"whoami",		"",	(Function) cmd_whoami,		NULL},
-  {"botjump",           "m",    (Function) cmd_botjump,         NULL},
-  {"botmsg",		"o",    (Function) cmd_botmsg,          NULL},
-  {"netmsg", 		"n", 	(Function) cmd_netmsg, 		NULL},
-  {"botnick", 		"m", 	(Function) cmd_botnick, 	NULL},
-  {"netnick", 		"m", 	(Function) cmd_netnick, 	NULL},
+  {"whois",		"",	(Function) cmd_whois,		NULL, 0},
+  {"whom",		"",	(Function) cmd_whom,		NULL, 0},
+  {"whoami",		"",	(Function) cmd_whoami,		NULL, 0},
+  {"botjump",           "m",    (Function) cmd_botjump,         NULL, 0},
+  {"botmsg",		"o",    (Function) cmd_botmsg,          NULL, 0},
+  {"netmsg", 		"n", 	(Function) cmd_netmsg, 		NULL, 0},
+  {"botnick", 		"m", 	(Function) cmd_botnick, 	NULL, 0},
+  {"netnick", 		"m", 	(Function) cmd_netnick, 	NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"netw", 		"n", 	(Function) cmd_netw, 		NULL},
-  {"netps", 		"n", 	(Function) cmd_netps, 		NULL},
-  {"netlast", 		"n", 	(Function) cmd_netlast, 	NULL},
-  {"netlag", 		"m", 	(Function) cmd_netlag, 		NULL},
+  {"netw", 		"n", 	(Function) cmd_netw, 		NULL, HUB},
+  {"netps", 		"n", 	(Function) cmd_netps, 		NULL, HUB},
+  {"netlast", 		"n", 	(Function) cmd_netlast, 	NULL, HUB},
+  {"netlag", 		"m", 	(Function) cmd_netlag, 		NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"botserver",		"m",	(Function) cmd_botserver,	NULL},
-  {"netserver", 	"m", 	(Function) cmd_netserver, 	NULL},
-  {"timesync",		"a",	(Function) cmd_timesync,	NULL},
+  {"botserver",		"m",	(Function) cmd_botserver,	NULL, 0},
+  {"netserver", 	"m", 	(Function) cmd_netserver, 	NULL, 0},
+  {"timesync",		"a",	(Function) cmd_timesync,	NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"botversion", 	"o", 	(Function) cmd_botversion, 	NULL},
-  {"netversion", 	"o", 	(Function) cmd_netversion, 	NULL},
+  {"botversion", 	"o", 	(Function) cmd_botversion, 	NULL, HUB},
+  {"netversion", 	"o", 	(Function) cmd_netversion, 	NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {"userlist", 		"m", 	(Function) cmd_userlist, 	NULL},
-  {"ps", 		"n", 	(Function) cmd_ps, 		NULL},
-  {"last", 		"n", 	(Function) cmd_last, 		NULL},
-  {"exec", 		"a", 	(Function) cmd_exec, 		NULL},
-  {"w", 		"n", 	(Function) cmd_w, 		NULL},
-  {"channels", 		"", 	(Function) cmd_channels, 	NULL},
-  {"randstring", 	"", 	(Function) cmd_randstring, 	NULL},
-  {"md5",		"",	(Function) cmd_md5,		NULL},
-  {"sha1",		"",	(Function) cmd_sha1,		NULL},
-  {"conf",		"a",	(Function) cmd_conf,		NULL},
-  {"encrypt",		"",	(Function) cmd_encrypt,		NULL},
-  {"decrypt",		"",	(Function) cmd_decrypt,		NULL},
+  {"userlist", 		"m", 	(Function) cmd_userlist, 	NULL, 0},
+  {"ps", 		"n", 	(Function) cmd_ps, 		NULL, 0},
+  {"last", 		"n", 	(Function) cmd_last, 		NULL, 0},
+  {"exec", 		"a", 	(Function) cmd_exec, 		NULL, 0},
+  {"w", 		"n", 	(Function) cmd_w, 		NULL, 0},
+  {"channels", 		"", 	(Function) cmd_channels, 	NULL, 0},
+  {"randstring", 	"", 	(Function) cmd_randstring, 	NULL, 0},
+  {"md5",		"",	(Function) cmd_md5,		NULL, 0},
+  {"sha1",		"",	(Function) cmd_sha1,		NULL, 0},
+  {"conf",		"a",	(Function) cmd_conf,		NULL, 0},
+  {"encrypt",		"",	(Function) cmd_encrypt,		NULL, 0},
+  {"decrypt",		"",	(Function) cmd_decrypt,		NULL, 0},
 #ifdef HUB
 #ifdef HUB
-  {"botcmd",		"i",	(Function) cmd_botcmd, 		NULL},
-  {"bc",		"i",	(Function) cmd_botcmd, 		NULL},
-  {"hublevel", 		"a", 	(Function) cmd_hublevel, 	NULL},
-  {"lagged", 		"m", 	(Function) cmd_lagged, 		NULL},
-  {"uplink", 		"a", 	(Function) cmd_uplink, 		NULL},
+  {"botcmd",		"i",	(Function) cmd_botcmd, 		NULL, HUB},
+  {"bc",		"i",	(Function) cmd_botcmd, 		NULL, HUB},
+  {"hublevel", 		"a", 	(Function) cmd_hublevel, 	NULL, HUB},
+  {"lagged", 		"m", 	(Function) cmd_lagged, 		NULL, HUB},
+  {"uplink", 		"a", 	(Function) cmd_uplink, 		NULL, HUB},
 #endif /* HUB */
 #endif /* HUB */
-  {NULL,		NULL,	NULL,				NULL}
+  {NULL,		NULL,	NULL,				NULL, 0}
 };
 };

+ 1 - 0
src/cmds.h

@@ -9,6 +9,7 @@ typedef struct {
   const char          *flags;
   const char          *flags;
   Function      func;
   Function      func;
   const char          *funcname;
   const char          *funcname;
+  int type;
 } cmd_t;
 } cmd_t;
 
 
 typedef struct {
 typedef struct {

+ 17 - 17
src/mod/channels.mod/channels.c

@@ -755,8 +755,8 @@ static int channels_chon(char *handle, int idx)
 
 
 static cmd_t my_chon[] =
 static cmd_t my_chon[] =
 {
 {
-  {"*",		"",	(Function) channels_chon,	"channels:chon"},
-  {NULL,	NULL,	NULL,				NULL}
+  {"*",		"",	(Function) channels_chon,	"channels:chon", 0},
+  {NULL,	NULL,	NULL,				NULL, 0}
 };
 };
 
 
 void channels_report(int idx, int details)
 void channels_report(int idx, int details)
@@ -887,26 +887,26 @@ void channels_report(int idx, int details)
 }
 }
 
 
 cmd_t channels_bot[] = {
 cmd_t channels_bot[] = {
-  {"cjoin",	"", 	(Function) got_cjoin, 	NULL},
-  {"cpart",	"", 	(Function) got_cpart, 	NULL},
-  {"cset",	"", 	(Function) got_cset,  	NULL},
+  {"cjoin",	"", 	(Function) got_cjoin, 	NULL, 0},
+  {"cpart",	"", 	(Function) got_cpart, 	NULL, 0},
+  {"cset",	"", 	(Function) got_cset,  	NULL, 0},
 #ifdef LEAF
 #ifdef LEAF
-  {"cycle",	"", 	(Function) got_cycle, 	NULL},
-  {"down",	"", 	(Function) got_down,  	NULL},
+  {"cycle",	"", 	(Function) got_cycle, 	NULL, LEAF},
+  {"down",	"", 	(Function) got_down,  	NULL, LEAF},
 #endif /* LEAF */
 #endif /* LEAF */
-  {"rl",	"", 	(Function) got_role,  	NULL},
-  {"kl",	"", 	(Function) got_kl,    	NULL},
-  {"sj",	"", 	(Function) got_sj,    	NULL},
-  {"sp",	"", 	(Function) got_sp,    	NULL},
-  {"jn",	"", 	(Function) got_jn,    	NULL},
+  {"rl",	"", 	(Function) got_role,  	NULL, 0},
+  {"kl",	"", 	(Function) got_kl,    	NULL, 0},
+  {"sj",	"", 	(Function) got_sj,    	NULL, 0},
+  {"sp",	"", 	(Function) got_sp,    	NULL, 0},
+  {"jn",	"", 	(Function) got_jn,    	NULL, 0},
 /*
 /*
 #ifdef HUB
 #ifdef HUB
-  {"o1", "", (Function) got_o1, NULL},
-  {"kl", "", (Function) got_kl, NULL},
+  {"o1", "", (Function) got_o1, NULL, 0},
+  {"kl", "", (Function) got_kl, NULL, 0},
 #endif
 #endif
-  {"ltp", "", (Function) got_locktopic, NULL},
+  {"ltp", "", (Function) got_locktopic, NULL, 0},
 */
 */
-  {NULL, 	NULL, 	NULL, 			NULL}
+  {NULL, 	NULL, 	NULL, 			NULL, 0}
 };
 };
 
 
 
 
@@ -945,7 +945,7 @@ void channels_init()
 #endif /* HUB */
 #endif /* HUB */
   timer_create_secs(10, "channels_timers", (Function) channels_timers);
   timer_create_secs(10, "channels_timers", (Function) channels_timers);
 
 
-  add_builtins("dcc", C_dcc_irc);
+  add_builtins("dcc", C_dcc_channels);
   add_builtins("bot", channels_bot);
   add_builtins("bot", channels_bot);
   add_builtins("chon", my_chon);
   add_builtins("chon", my_chon);
 }
 }

+ 27 - 27
src/mod/channels.mod/cmdschan.c

@@ -1377,32 +1377,32 @@ static void cmd_chanset(int idx, char *par)
  *
  *
  * NOTE: As with msg commands, the function is responsible for any logging.
  * NOTE: As with msg commands, the function is responsible for any logging.
  */
  */
-static cmd_t C_dcc_irc[] =
+static cmd_t C_dcc_channels[] =
 {
 {
-  {"+ban",	"o|o",	(Function) cmd_pls_ban,		NULL},
-  {"+exempt",	"o|o",	(Function) cmd_pls_exempt,		NULL},
-  {"+invite",	"o|o",	(Function) cmd_pls_invite,		NULL},
-  {"+chan",	"n",	(Function) cmd_pls_chan,		NULL},
-  {"+chrec",	"m|m",	(Function) cmd_pls_chrec,		NULL},
-  {"-ban",	"o|o",	(Function) cmd_mns_ban,		NULL},
-  {"-chan",	"n",	(Function) cmd_mns_chan,		NULL},
-  {"-chrec",	"m|m",	(Function) cmd_mns_chrec,		NULL},
-  {"-exempt",	"o|o",	(Function) cmd_mns_exempt,		NULL},
-  {"-invite",	"o|o",	(Function) cmd_mns_invite,		NULL},
-  {"bans",	"o|o",	(Function) cmd_bans,		NULL},
-  {"botjoin",	"n",	(Function) cmd_botjoin,		NULL},
-  {"botpart",	"n",	(Function) cmd_botpart,		NULL},
-  {"exempts",	"o|o",	(Function) cmd_exempts,		NULL},
-  {"invites",	"o|o",	(Function) cmd_invites,		NULL},
-  {"chaninfo",	"m|m",	(Function) cmd_chaninfo,		NULL},
-  {"chanset",	"m|m",	(Function) cmd_chanset,		NULL},
-  {"chinfo",	"m|m",	(Function) cmd_chinfo,		NULL},
-  {"cycle", 	"n|n",	(Function) cmd_cycle,		NULL},
-  {"down",	"n|n",	(Function) cmd_down,		NULL},
-  {"info",	"",	(Function) cmd_info,		NULL},
-  {"slowjoin",  "n",    (Function) cmd_slowjoin,		NULL},
-  {"slowpart",  "n|n",  (Function) cmd_slowpart,  		NULL},
-  {"stick",	"o|o",	(Function) cmd_stick,		NULL},
-  {"unstick",	"o|o",	(Function) cmd_unstick,		NULL},
-  {NULL,	NULL,	NULL,			NULL}
+  {"+ban",	"o|o",	(Function) cmd_pls_ban,		NULL, 0},
+  {"+exempt",	"o|o",	(Function) cmd_pls_exempt,	NULL, 0},
+  {"+invite",	"o|o",	(Function) cmd_pls_invite,	NULL, 0},
+  {"+chan",	"n",	(Function) cmd_pls_chan,	NULL, 0},
+  {"+chrec",	"m|m",	(Function) cmd_pls_chrec,	NULL, 0},
+  {"-ban",	"o|o",	(Function) cmd_mns_ban,		NULL, 0},
+  {"-chan",	"n",	(Function) cmd_mns_chan,	NULL, 0},
+  {"-chrec",	"m|m",	(Function) cmd_mns_chrec,	NULL, 0},
+  {"-exempt",	"o|o",	(Function) cmd_mns_exempt,	NULL, 0},
+  {"-invite",	"o|o",	(Function) cmd_mns_invite,	NULL, 0},
+  {"bans",	"o|o",	(Function) cmd_bans,		NULL, 0},
+  {"botjoin",	"n",	(Function) cmd_botjoin,		NULL, 0},
+  {"botpart",	"n",	(Function) cmd_botpart,		NULL, 0},
+  {"exempts",	"o|o",	(Function) cmd_exempts,		NULL, 0},
+  {"invites",	"o|o",	(Function) cmd_invites,		NULL, 0},
+  {"chaninfo",	"m|m",	(Function) cmd_chaninfo,	NULL, 0},
+  {"chanset",	"m|m",	(Function) cmd_chanset,		NULL, 0},
+  {"chinfo",	"m|m",	(Function) cmd_chinfo,		NULL, 0},
+  {"cycle", 	"n|n",	(Function) cmd_cycle,		NULL, 0},
+  {"down",	"n|n",	(Function) cmd_down,		NULL, 0},
+  {"info",	"",	(Function) cmd_info,		NULL, 0},
+  {"slowjoin",  "n",    (Function) cmd_slowjoin,	NULL, 0},
+  {"slowpart",  "n|n",  (Function) cmd_slowpart,  	NULL, 0},
+  {"stick",	"o|o",	(Function) cmd_stick,		NULL, 0},
+  {"unstick",	"o|o",	(Function) cmd_unstick,		NULL, 0},
+  {NULL,	NULL,	NULL,			NULL, 0}
 };
 };

+ 4 - 4
src/mod/console.mod/console.c

@@ -373,13 +373,13 @@ console_dostore(int idx)
 }
 }
 
 
 static cmd_t mychon[] = {
 static cmd_t mychon[] = {
-  {"*", "", (Function) console_chon, "console:chon"},
-  {NULL, NULL, NULL, NULL}
+  {"*", "", (Function) console_chon, "console:chon", 0},
+  {NULL, NULL, NULL, NULL, 0}
 };
 };
 
 
 static cmd_t mydcc[] = {
 static cmd_t mydcc[] = {
-  {"store", "", (Function) console_store, NULL},
-  {NULL, NULL, NULL, NULL}
+  {"store", "", (Function) console_store, NULL, 0},
+  {NULL, NULL, NULL, NULL, 0}
 };
 };
 
 
 void
 void

+ 15 - 15
src/mod/ctcp.mod/ctcp.c

@@ -601,21 +601,21 @@ static int ctcp_CHAT(char *nick, char *uhost, struct userrec *u, char *object, c
 
 
 static cmd_t myctcp[] =
 static cmd_t myctcp[] =
 {
 {
-  {"CLIENTINFO", 	"", 	(Function) ctcp_CLIENTINFO, 	NULL},
-  {"FINGER", 		"", 	(Function) ctcp_FINGER, 		NULL},
-  {"WHOAMI", 		"", 	(Function) ctcp_WHOAMI, 		NULL},
-  {"OP", 		"", 	(Function) ctcp_OP, 		NULL},
-  {"OPS", 		"", 	(Function) ctcp_OP, 		NULL},
-  {"INVITE", 		"",	(Function) ctcp_INVITE_UNBAN, 	NULL},
-  {"UNBAN", 		"", 	(Function) ctcp_INVITE_UNBAN, 	NULL},
-  {"ERRMSG", 		"", 	(Function) ctcp_ECHO, 		NULL},
-  {"USERINFO", 		"", 	(Function) ctcp_USERINFO, 		NULL},
-  {"ECHO", 		"", 	(Function) ctcp_ECHO, 		NULL},
-  {"VERSION", 		"", 	(Function) ctcp_VERSION, 		NULL},
-  {"PING", 		"", 	(Function) ctcp_PING, 		NULL},
-  {"TIME", 		"", 	(Function) ctcp_TIME, 		NULL},
-  {"CHAT",		"",	(Function) ctcp_CHAT,		NULL},
-  {NULL,		NULL,	NULL,			NULL}
+  {"CLIENTINFO", 	"", 	(Function) ctcp_CLIENTINFO, 	NULL, LEAF},
+  {"FINGER", 		"", 	(Function) ctcp_FINGER, 	NULL, LEAF},
+  {"WHOAMI", 		"", 	(Function) ctcp_WHOAMI, 	NULL, LEAF},
+  {"OP", 		"", 	(Function) ctcp_OP, 		NULL, LEAF},
+  {"OPS", 		"", 	(Function) ctcp_OP, 		NULL, LEAF},
+  {"INVITE", 		"",	(Function) ctcp_INVITE_UNBAN, 	NULL, LEAF},
+  {"UNBAN", 		"", 	(Function) ctcp_INVITE_UNBAN, 	NULL, LEAF},
+  {"ERRMSG", 		"", 	(Function) ctcp_ECHO, 		NULL, LEAF},
+  {"USERINFO", 		"", 	(Function) ctcp_USERINFO, 	NULL, LEAF},
+  {"ECHO", 		"", 	(Function) ctcp_ECHO, 		NULL, LEAF},
+  {"VERSION", 		"", 	(Function) ctcp_VERSION, 	NULL, LEAF},
+  {"PING", 		"", 	(Function) ctcp_PING, 		NULL, LEAF},
+  {"TIME", 		"", 	(Function) ctcp_TIME, 		NULL, LEAF},
+  {"CHAT",		"",	(Function) ctcp_CHAT,		NULL, LEAF},
+  {NULL,		NULL,	NULL,			NULL, 0}
 };
 };
 #endif /* LEAF */
 #endif /* LEAF */
 
 

+ 32 - 32
src/mod/irc.mod/chan.c

@@ -3008,38 +3008,38 @@ static int gotnotice(char *from, char *msg)
 static cmd_t irc_raw[] =
 static cmd_t irc_raw[] =
 {
 {
 #ifdef CACHE
 #ifdef CACHE
-  {"302",       "",     (Function) got302,      "irc:302"},
-  {"341",       "",     (Function) got341,      "irc:341"},
+  {"302",       "",     (Function) got302,      "irc:302", LEAF},
+  {"341",       "",     (Function) got341,      "irc:341", LEAF},
 #endif /* CACHE */
 #endif /* CACHE */
-  {"324",	"",	(Function) got324,	"irc:324"},
-  {"352",	"",	(Function) got352,	"irc:352"},
-  {"354",	"",	(Function) got354,	"irc:354"},
-  {"315",	"",	(Function) got315,	"irc:315"},
-  {"367",	"",	(Function) got367,	"irc:367"},
-  {"368",	"",	(Function) got368,	"irc:368"},
-  {"403",	"",	(Function) got403,	"irc:403"},
-  {"405",	"",	(Function) got405,	"irc:405"},
-  {"471",	"",	(Function) got471,	"irc:471"},
-  {"473",	"",	(Function) got473,	"irc:473"},
-  {"474",	"",	(Function) got474,	"irc:474"},
-  {"475",	"",	(Function) got475,	"irc:475"},
-  {"INVITE",	"",	(Function) gotinvite,	"irc:invite"},
-  {"TOPIC",	"",	(Function) gottopic,	"irc:topic"},
-  {"331",	"",	(Function) got331,	"irc:331"},
-  {"332",	"",	(Function) got332,	"irc:332"},
-  {"JOIN",	"",	(Function) gotjoin,	"irc:join"},
-  {"PART",	"",	(Function) gotpart,	"irc:part"},
-  {"KICK",	"",	(Function) gotkick,	"irc:kick"},
-  {"NICK",	"",	(Function) gotnick,	"irc:nick"},
-  {"QUIT",	"",	(Function) gotquit,	"irc:quit"},
-  {"PRIVMSG",	"",	(Function) gotmsg,	"irc:msg"},
-  {"NOTICE",	"",	(Function) gotnotice,	"irc:notice"},
-  {"MODE",	"",	(Function) gotmode,	"irc:mode"},
-  {"346",	"",	(Function) got346,	"irc:346"},
-  {"347",	"",	(Function) got347,	"irc:347"},
-  {"348",	"",	(Function) got348,	"irc:348"},
-  {"349",	"",	(Function) got349,	"irc:349"},
-  {"353",	"",	(Function) got353,	"irc:353"},
-  {NULL,	NULL,	NULL,			NULL}
+  {"324",	"",	(Function) got324,	"irc:324", LEAF},
+  {"352",	"",	(Function) got352,	"irc:352", LEAF},
+  {"354",	"",	(Function) got354,	"irc:354", LEAF},
+  {"315",	"",	(Function) got315,	"irc:315", LEAF},
+  {"367",	"",	(Function) got367,	"irc:367", LEAF},
+  {"368",	"",	(Function) got368,	"irc:368", LEAF},
+  {"403",	"",	(Function) got403,	"irc:403", LEAF},
+  {"405",	"",	(Function) got405,	"irc:405", LEAF},
+  {"471",	"",	(Function) got471,	"irc:471", LEAF},
+  {"473",	"",	(Function) got473,	"irc:473", LEAF},
+  {"474",	"",	(Function) got474,	"irc:474", LEAF},
+  {"475",	"",	(Function) got475,	"irc:475", LEAF},
+  {"INVITE",	"",	(Function) gotinvite,	"irc:invite", LEAF},
+  {"TOPIC",	"",	(Function) gottopic,	"irc:topic", LEAF},
+  {"331",	"",	(Function) got331,	"irc:331", LEAF},
+  {"332",	"",	(Function) got332,	"irc:332", LEAF},
+  {"JOIN",	"",	(Function) gotjoin,	"irc:join", LEAF},
+  {"PART",	"",	(Function) gotpart,	"irc:part", LEAF},
+  {"KICK",	"",	(Function) gotkick,	"irc:kick", LEAF},
+  {"NICK",	"",	(Function) gotnick,	"irc:nick", LEAF},
+  {"QUIT",	"",	(Function) gotquit,	"irc:quit", LEAF},
+  {"PRIVMSG",	"",	(Function) gotmsg,	"irc:msg", LEAF},
+  {"NOTICE",	"",	(Function) gotnotice,	"irc:notice", LEAF},
+  {"MODE",	"",	(Function) gotmode,	"irc:mode", LEAF},
+  {"346",	"",	(Function) got346,	"irc:346", LEAF},
+  {"347",	"",	(Function) got347,	"irc:347", LEAF},
+  {"348",	"",	(Function) got348,	"irc:348", LEAF},
+  {"349",	"",	(Function) got349,	"irc:349", LEAF},
+  {"353",	"",	(Function) got353,	"irc:353", LEAF},
+  {NULL,	NULL,	NULL,			NULL, 0}
 };
 };
 #endif /* LEAF */
 #endif /* LEAF */

+ 26 - 26
src/mod/irc.mod/cmdsirc.c

@@ -1690,34 +1690,34 @@ static void cmd_reset(int idx, char *par)
 
 
 static cmd_t irc_dcc[] =
 static cmd_t irc_dcc[] =
 {
 {
-  {"act",		"o|o",	 (Function) cmd_act,		NULL},
-  {"adduser",		"m|m",	 (Function) cmd_adduser,	NULL},
-  {"authed",		"n",	 (Function) cmd_authed,		NULL},
-  {"channel",		"o|o",	 (Function) cmd_channel,	NULL},
-  {"deluser",		"m|m",	 (Function) cmd_deluser,	NULL},
-  {"deop",		"o|o",	 (Function) cmd_deop,		NULL},
-  {"devoice",		"o|o",	 (Function) cmd_devoice,	NULL},
-  {"getkey",            "o|o",   (Function) cmd_getkey,         NULL},
-  {"find",		"",	 (Function) cmd_find,		NULL},
-  {"invite",		"o|o",	 (Function) cmd_invite,		NULL},
+  {"act",		"o|o",	 (Function) cmd_act,		NULL, LEAF},
+  {"adduser",		"m|m",	 (Function) cmd_adduser,	NULL, LEAF},
+  {"authed",		"n",	 (Function) cmd_authed,		NULL, LEAF},
+  {"channel",		"o|o",	 (Function) cmd_channel,	NULL, LEAF},
+  {"deluser",		"m|m",	 (Function) cmd_deluser,	NULL, LEAF},
+  {"deop",		"o|o",	 (Function) cmd_deop,		NULL, LEAF},
+  {"devoice",		"o|o",	 (Function) cmd_devoice,	NULL, LEAF},
+  {"getkey",            "o|o",   (Function) cmd_getkey,         NULL, LEAF},
+  {"find",		"",	 (Function) cmd_find,		NULL, LEAF},
+  {"invite",		"o|o",	 (Function) cmd_invite,		NULL, LEAF},
 #ifdef CACHE
 #ifdef CACHE
-  {"iop",		"o|o",	 (Function) cmd_iop,		NULL},
+  {"iop",		"o|o",	 (Function) cmd_iop,		NULL, LEAF},
 #endif /* CACHE */
 #endif /* CACHE */
-  {"kick",		"o|o",	 (Function) cmd_kick,		NULL},
-  {"kickban",		"o|o",	 (Function) cmd_kickban,	NULL},
-  {"mdop",              "n|n",	 (Function) cmd_mdop,		NULL},
-  {"mop",		"n|m",	 (Function) cmd_mop,		NULL},
-  {"msg",		"o",	 (Function) cmd_msg,		NULL},
-  {"op",		"o|o",	 (Function) cmd_op,		NULL},
-  {"reset",		"m|m",	 (Function) cmd_reset,		NULL},
-  {"resetbans",		"o|o",	 (Function) cmd_resetbans,	NULL},
-  {"resetexempts",	"o|o",	 (Function) cmd_resetexempts,	NULL},
-  {"resetinvites",	"o|o",	 (Function) cmd_resetinvites,	NULL},
-  {"say",		"o|o",	 (Function) cmd_say,		NULL},
-  {"swhois",		"n",	 (Function) cmd_swhois,		NULL},
-  {"topic",		"o|o",	 (Function) cmd_topic,		NULL},
-  {"voice",		"o|o",	 (Function) cmd_voice,		NULL},
-  {NULL,		NULL,	 NULL,				NULL}
+  {"kick",		"o|o",	 (Function) cmd_kick,		NULL, LEAF},
+  {"kickban",		"o|o",	 (Function) cmd_kickban,	NULL, LEAF},
+  {"mdop",              "n|n",	 (Function) cmd_mdop,		NULL, LEAF},
+  {"mop",		"n|m",	 (Function) cmd_mop,		NULL, LEAF},
+  {"msg",		"o",	 (Function) cmd_msg,		NULL, LEAF},
+  {"op",		"o|o",	 (Function) cmd_op,		NULL, LEAF},
+  {"reset",		"m|m",	 (Function) cmd_reset,		NULL, LEAF},
+  {"resetbans",		"o|o",	 (Function) cmd_resetbans,	NULL, LEAF},
+  {"resetexempts",	"o|o",	 (Function) cmd_resetexempts,	NULL, LEAF},
+  {"resetinvites",	"o|o",	 (Function) cmd_resetinvites,	NULL, LEAF},
+  {"say",		"o|o",	 (Function) cmd_say,		NULL, LEAF},
+  {"swhois",		"n",	 (Function) cmd_swhois,		NULL, LEAF},
+  {"topic",		"o|o",	 (Function) cmd_topic,		NULL, LEAF},
+  {"voice",		"o|o",	 (Function) cmd_voice,		NULL, LEAF},
+  {NULL,		NULL,	 NULL,				NULL, 0}
 };
 };
 
 
 #endif /* LEAF */
 #endif /* LEAF */

+ 3 - 3
src/mod/irc.mod/irc.c

@@ -1513,9 +1513,9 @@ do_nettype()
 }
 }
 
 
 static cmd_t irc_bot[] = {
 static cmd_t irc_bot[] = {
-  {"dp", "", (Function) mdop_request, NULL},
-  {"gi", "", (Function) getin_request, NULL},
-  {NULL, NULL, NULL, NULL}
+  {"dp", "", (Function) mdop_request, NULL, LEAF},
+  {"gi", "", (Function) getin_request, NULL, LEAF},
+  {NULL, NULL, NULL, NULL, 0}
 };
 };
 
 
 static void
 static void

+ 21 - 21
src/mod/irc.mod/msgcmds.c

@@ -451,17 +451,17 @@ static int msg_pls_bd(char *nick, char *host, struct userrec *u, char *par)
 
 
 static cmd_t C_msg[] =
 static cmd_t C_msg[] =
 {
 {
-  {"auth?",		"",	(Function) msg_authstart,	NULL},
-  {"auth",		"",	(Function) msg_auth,		NULL},
-  {"+auth",		"",	(Function) msg_pls_auth,	NULL},
-  {"unauth",		"",	(Function) msg_unauth,		NULL},
-//  {"bd",		"",	(Function) msg_bd,		NULL},
-  {"+bd",		"",	(Function) msg_pls_bd,		NULL},
-  {"ident",   		"",	(Function) msg_ident,		NULL},
-  {"invite",		"",	(Function) msg_invite,		NULL},
-  {"op",		"",	(Function) msg_op,		NULL},
-  {"pass",		"",	(Function) msg_pass,		NULL},
-  {NULL,		NULL,	NULL,				NULL}
+  {"auth?",		"",	(Function) msg_authstart,	NULL, LEAF},
+  {"auth",		"",	(Function) msg_auth,		NULL, LEAF},
+  {"+auth",		"",	(Function) msg_pls_auth,	NULL, LEAF},
+  {"unauth",		"",	(Function) msg_unauth,		NULL, LEAF},
+//  {"bd",		"",	(Function) msg_bd,		NULL, LEAF},
+  {"+bd",		"",	(Function) msg_pls_bd,		NULL, LEAF},
+  {"ident",   		"",	(Function) msg_ident,		NULL, LEAF},
+  {"invite",		"",	(Function) msg_invite,		NULL, LEAF},
+  {"op",		"",	(Function) msg_op,		NULL, LEAF},
+  {"pass",		"",	(Function) msg_pass,		NULL, LEAF},
+  {NULL,		NULL,	NULL,				NULL, 0}
 };
 };
 
 
 static int msgc_test(char *nick, char *host, struct userrec *u, char *chname, char *par)
 static int msgc_test(char *nick, char *host, struct userrec *u, char *chname, char *par)
@@ -741,15 +741,15 @@ static int msgc_invite(char *nick, char *host, struct userrec *u, char *chname,
 
 
 static cmd_t C_msgc[] =
 static cmd_t C_msgc[] =
 {
 {
-//  {"test",		"a",	(Function) msgc_test,		NULL},
-  {"channels",		"",	(Function) msgc_channels,	NULL},
-  {"getkey",		"",	(Function) msgc_getkey,		NULL},
-  {"help",		"",	(Function) msgc_help,		NULL},
-  {"invite",		"",	(Function) msgc_invite,		NULL},
-  {"md5",		"",	(Function) msgc_md5,		NULL},
-  {"op",		"",	(Function) msgc_op,		NULL},
-  {"sha1",		"",	(Function) msgc_sha1,		NULL},
-  {"voice",		"",	(Function) msgc_voice,		NULL},
-  {NULL,		NULL,	NULL,				NULL}
+//  {"test",		"a",	(Function) msgc_test,		NULL, LEAF},
+  {"channels",		"",	(Function) msgc_channels,	NULL, LEAF},
+  {"getkey",		"",	(Function) msgc_getkey,		NULL, LEAF},
+  {"help",		"",	(Function) msgc_help,		NULL, LEAF},
+  {"invite",		"",	(Function) msgc_invite,		NULL, LEAF},
+  {"md5",		"",	(Function) msgc_md5,		NULL, LEAF},
+  {"op",		"",	(Function) msgc_op,		NULL, LEAF},
+  {"sha1",		"",	(Function) msgc_sha1,		NULL, LEAF},
+  {"voice",		"",	(Function) msgc_voice,		NULL, LEAF},
+  {NULL,		NULL,	NULL,				NULL, 0}
 };
 };
 #endif /* LEAF */
 #endif /* LEAF */

+ 4 - 4
src/mod/notes.mod/cmdsnote.c

@@ -94,8 +94,8 @@ static void cmd_note(int idx, char *par)
 
 
 static cmd_t notes_cmds[] =
 static cmd_t notes_cmds[] =
 {
 {
-  {"fwd",	"m",	(Function) cmd_fwd,		NULL},
-  {"notes",	"",	(Function) cmd_notes,		NULL},
-  {"note",	"",	(Function) cmd_note,		NULL},
-  {NULL,	NULL,	NULL,				NULL}
+  {"fwd",	"m",	(Function) cmd_fwd,		NULL, 0},
+  {"notes",	"",	(Function) cmd_notes,		NULL, 0},
+  {"note",	"",	(Function) cmd_note,		NULL, 0},
+  {NULL,	NULL,	NULL,				NULL, 0}
 };
 };

+ 6 - 6
src/mod/notes.mod/notes.c

@@ -725,20 +725,20 @@ int notes_chon(int idx)
 
 
 static cmd_t notes_nkch[] =
 static cmd_t notes_nkch[] =
 {
 {
-  {"*",		"",	(Function) notes_change,	"notes"},
-  {NULL,	NULL,	NULL,				NULL}
+  {"*",		"",	(Function) notes_change,	"notes", 0},
+  {NULL,	NULL,	NULL,				NULL, 0}
 };
 };
 
 
 static cmd_t notes_away[] =
 static cmd_t notes_away[] =
 {
 {
-  {"*",		"",	(Function) away_notes,		"notes"},
-  {NULL,	NULL,	NULL,				NULL}
+  {"*",		"",	(Function) away_notes,		"notes", 0},
+  {NULL,	NULL,	NULL,				NULL, 0}
 };
 };
 
 
 static cmd_t notes_msgs[] =
 static cmd_t notes_msgs[] =
 {
 {
-  {"notes",	"",	(Function) msg_notes,		NULL},
-  {NULL,	NULL,	NULL,				NULL}
+  {"notes",	"",	(Function) msg_notes,		NULL, LEAF},
+  {NULL,	NULL,	NULL,				NULL, 0}
 };
 };
 
 
 static int notes_server_setup(char *mod)
 static int notes_server_setup(char *mod)

+ 5 - 5
src/mod/server.mod/cmdsserv.c

@@ -117,11 +117,11 @@ static void cmd_clearqueue(int idx, char *par)
  */
  */
 static cmd_t C_dcc_serv[] =
 static cmd_t C_dcc_serv[] =
 {
 {
-  {"clearqueue",	"m",	(Function) cmd_clearqueue,	NULL},
-  {"dump",		"a",	(Function) cmd_dump,		NULL},
-  {"jump",		"m",	(Function) cmd_jump,		NULL},
-  {"servers",		"m",	(Function) cmd_servers,		NULL},
-  {NULL,		NULL,	NULL,				NULL}
+  {"clearqueue",	"m",	(Function) cmd_clearqueue,	NULL, LEAF},
+  {"dump",		"a",	(Function) cmd_dump,		NULL, LEAF},
+  {"jump",		"m",	(Function) cmd_jump,		NULL, LEAF},
+  {"servers",		"m",	(Function) cmd_servers,		NULL, LEAF},
+  {NULL,		NULL,	NULL,				NULL, 0}
 };
 };
 
 
 #endif /* LEAF */
 #endif /* LEAF */

+ 2 - 2
src/mod/server.mod/server.c

@@ -1010,8 +1010,8 @@ static void msgq_clear(struct msgq_head *qh)
 
 
 static cmd_t my_ctcps[] =
 static cmd_t my_ctcps[] =
 {
 {
-  {"DCC",	"",	(Function) ctcp_DCC_CHAT,		"server:DCC"},
-  {NULL,	NULL,	NULL,			NULL}
+  {"DCC",	"",	(Function) ctcp_DCC_CHAT,		"server:DCC", LEAF},
+  {NULL,	NULL,	NULL,			NULL, 0}
 };
 };
 
 
 void server_init()
 void server_init()

+ 31 - 31
src/mod/server.mod/servmsg.c

@@ -1281,39 +1281,39 @@ static int got406(char *from, char *msg)
  
  
 static cmd_t my_raw_binds[] =
 static cmd_t my_raw_binds[] =
 {
 {
-  {"PRIVMSG",	"",	(Function) gotmsg,		NULL},
-  {"NOTICE",	"",	(Function) gotnotice,		NULL},
-  {"MODE",	"",	(Function) gotmode,		NULL},
-  {"PING",	"",	(Function) gotping,		NULL},
-  {"PONG",	"",	(Function) gotpong,		NULL},
-  {"WALLOPS",	"",	(Function) gotwall,		NULL},
-  {"001",	"",	(Function) got001,		NULL},
-  {"005",	"",	(Function) got005,		NULL},
-  {"303",	"",	(Function) got303,		NULL},
-  {"432",	"",	(Function) got432,		NULL},
-  {"433",	"",	(Function) got433,		NULL},
-  {"437",	"",	(Function) got437,		NULL},
-  {"438",	"",	(Function) got438,		NULL},
-  {"451",	"",	(Function) got451,		NULL},
-  {"442",	"",	(Function) got442,		NULL},
-  {"NICK",	"",	(Function) gotnick,		NULL},
-  {"ERROR",	"",	(Function) goterror,		NULL},
+  {"PRIVMSG",	"",	(Function) gotmsg,		NULL, LEAF},
+  {"NOTICE",	"",	(Function) gotnotice,		NULL, LEAF},
+  {"MODE",	"",	(Function) gotmode,		NULL, LEAF},
+  {"PING",	"",	(Function) gotping,		NULL, LEAF},
+  {"PONG",	"",	(Function) gotpong,		NULL, LEAF},
+  {"WALLOPS",	"",	(Function) gotwall,		NULL, LEAF},
+  {"001",	"",	(Function) got001,		NULL, LEAF},
+  {"005",	"",	(Function) got005,		NULL, LEAF},
+  {"303",	"",	(Function) got303,		NULL, LEAF},
+  {"432",	"",	(Function) got432,		NULL, LEAF},
+  {"433",	"",	(Function) got433,		NULL, LEAF},
+  {"437",	"",	(Function) got437,		NULL, LEAF},
+  {"438",	"",	(Function) got438,		NULL, LEAF},
+  {"451",	"",	(Function) got451,		NULL, LEAF},
+  {"442",	"",	(Function) got442,		NULL, LEAF},
+  {"NICK",	"",	(Function) gotnick,		NULL, LEAF},
+  {"ERROR",	"",	(Function) goterror,		NULL, LEAF},
 /* ircu2.10.10 has a bug when a client is throttled ERROR is sent wrong */
 /* ircu2.10.10 has a bug when a client is throttled ERROR is sent wrong */
-  {"ERROR:",	"",	(Function) goterror,		NULL},
-  {"KICK",	"",	(Function) gotkick,		NULL},
+  {"ERROR:",	"",	(Function) goterror,		NULL, LEAF},
+  {"KICK",	"",	(Function) gotkick,		NULL, LEAF},
   /* WHOIS RAWS */
   /* WHOIS RAWS */
-  {"311", 	"", 	(Function) got311, 		NULL},	/* ident host * :realname */
-  {"314",	"",	(Function) got311,		NULL},	/* "" -WHOWAS */
-  {"319",	"",	(Function) got319,		NULL},	/* :#channels */
-  {"312",	"",	(Function) got312,		NULL},	/* server :gecos */
-  {"301",	"",	(Function) got301,		NULL},	/* :away msg */
-  {"313",	"",	(Function) got313,		NULL},	/* :ircop */
-  {"317",	"",	(Function) got317,		NULL},	/* idle, signon :idle-eng, signon-eng */
-  {"401",	"",	(Function) got401,		NULL},
-  {"406",	"",	(Function) got406,		NULL},
-  {"318",	"",	(Function) whoispenalty,	NULL},	/* :End of /WHOIS */
-  {"369",	"",	(Function) got369,		NULL},	/* :End of /WHOWAS */
-  {NULL,	NULL,	NULL,				NULL}
+  {"311", 	"", 	(Function) got311, 		NULL, LEAF},	/* ident host * :realname */
+  {"314",	"",	(Function) got311,		NULL, LEAF},	/* "" -WHOWAS */
+  {"319",	"",	(Function) got319,		NULL, LEAF},	/* :#channels */
+  {"312",	"",	(Function) got312,		NULL, LEAF},	/* server :gecos */
+  {"301",	"",	(Function) got301,		NULL, LEAF},	/* :away msg */
+  {"313",	"",	(Function) got313,		NULL, LEAF},	/* :ircop */
+  {"317",	"",	(Function) got317,		NULL, LEAF},	/* idle, signon :idle-eng, signon-eng */
+  {"401",	"",	(Function) got401,		NULL, LEAF},
+  {"406",	"",	(Function) got406,		NULL, LEAF},
+  {"318",	"",	(Function) whoispenalty,	NULL, LEAF},	/* :End of /WHOIS */
+  {"369",	"",	(Function) got369,		NULL, LEAF},	/* :End of /WHOWAS */
+  {NULL,	NULL,	NULL,				NULL, 0}
 };
 };
 
 
 static void server_dns_callback(int, void *, const char *, char **);
 static void server_dns_callback(int, void *, const char *, char **);

+ 4 - 4
src/mod/update.mod/update.c

@@ -207,8 +207,8 @@ static void got_nu(char *botnick, char *code, char *par)
 }
 }
 
 
 static cmd_t update_bot[] = {
 static cmd_t update_bot[] = {
-  {"nu?",    "", (Function) got_nu, NULL}, 
-  {NULL, NULL, NULL, NULL}
+  {"nu?",    "", (Function) got_nu, NULL, 0}, 
+  {NULL, NULL, NULL, NULL, 0}
 };
 };
 
 
 
 
@@ -448,8 +448,8 @@ static void cmd_bupdate(int idx, char *par)
 
 
 cmd_t update_cmds[] =
 cmd_t update_cmds[] =
 {
 {
-  {"bupdate",		"a",	(Function) cmd_bupdate,		NULL},
-  {NULL,		NULL,	NULL,				NULL}
+  {"bupdate",		"a",	(Function) cmd_bupdate,		NULL, HUB},
+  {NULL,		NULL,	NULL,				NULL, 0}
 };
 };
 #endif /* HUB */
 #endif /* HUB */