Просмотр исходного кода

* Removed some useless/obsolete TCL functions and code

svn: 156
Bryan Drewery 22 лет назад
Родитель
Сommit
c8d3f909f3
6 измененных файлов с 6 добавлено и 1490 удалено
  1. 1 1
      src/dccutil.c
  2. 0 2
      src/main.c
  3. 0 34
      src/tcl.c
  4. 2 940
      src/tcldcc.c
  5. 1 325
      src/tclmisc.c
  6. 2 188
      src/tcluser.c

+ 1 - 1
src/dccutil.c

@@ -25,7 +25,7 @@ extern time_t		 now;
 extern sock_list	*socklist;
 extern Tcl_Interp	*interp;
 
-struct portmap *root = NULL;
+static struct portmap *root = NULL;
 
 char	motdfile[121] = "text/motd";	/* File where the motd is stored */
 int	connect_timeout = 15;		/* How long to wait before a telnet

+ 0 - 2
src/main.c

@@ -1727,10 +1727,8 @@ Context;
   while (1) {
     int socket_cleanup = 0;
 
-#if !defined(HAVE_PRE7_5_TCL)
     /* Process a single tcl event */
     Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT);
-#endif
 
     /* Lets move some of this here, reducing the numer of actual
      * calls to periodic_timers

+ 0 - 34
src/tcl.c

@@ -430,27 +430,17 @@ static tcl_strings def_tcl_strings[] =
   {"botnet-nick",	botnetnick,	HANDLEN,	0},
   {"origbotname",       origbotname,    HANDLEN,        0},
   {"userfile",		userfile,	120,		STR_PROTECT},
-  {"motd",		motdfile,	120,		STR_PROTECT},
   {"admin",		admin,		120,		0},
-  {"temp-path",		tempdir,	120,		STR_DIR | STR_PROTECT},
-  {"text-path",		textdir,	120,		STR_DIR | STR_PROTECT},
-  {"notify-newusers",	notify_new,	120,		0},
   {"owner",		owner,		120,		STR_PROTECT},
   {"my-ip",		myip,		120,		0},
   {"my-hostname",       hostname,       120,            0},
   {"my-ip6",            myip6,          120,            0},
   {"my-hostname6",      hostname6,      120,            0},
-  {"network",		network,	40,		0},
-  {"whois-fields",	whois_fields,	1024,		0},
   {"nat-ip",		natip,		120,		0},
   {"username",		botuser,	10,		0},
   {"version",		egg_version,	0,		STR_PROTECT},
   {"firewall",		firewall,	120,		0},
-/* confvar patch by aaronwl */
-  {"config",		configfile,	0,		0},
-  {"telnet-banner",	bannerfile,	120,		STR_PROTECT},
   {"pidfile",		pid_file,       120,		STR_PROTECT},
-/*settings made by installer */
   {"dcc_prefix",	dcc_prefix,	1,		0},
   {NULL,		NULL,		0,		0}
 };
@@ -459,16 +449,10 @@ static tcl_strings def_tcl_strings[] =
 static tcl_ints def_tcl_ints[] =
 {
   {"localhub",			&localhub,		2},
-  {"ignore-time",		&ignore_time,		0},
   {"handlen",			&handlen,		2},
   {"dcc-flood-thr",		&dcc_flood_thr,		0},
-  {"hourly-updates",		&notify_users_at,	0},
-  {"connect-timeout",		&connect_timeout,	0},
   {"reserved-port",		&reserved_port_min,		0},
   /* booleans (really just ints) */
-  {"open-telnets",		&allow_new_telnets,	0},
-  {"use-telnet-banner",		&use_telnet_banner,	0},
-  {"uptime",			(int *) &online_since,	2},
   {"console",			&conmask,		0},
   {"default-flags",		&default_flags,		0},
   /* moved from eggdrop.h */
@@ -476,24 +460,13 @@ static tcl_ints def_tcl_ints[] =
   {"die-on-sighup",		&die_on_sighup,		1},
   {"die-on-sigterm",		&die_on_sigterm,	1},
   {"remote-boots",		&remote_boots,		1},
-  {"max-dcc",			&max_dcc,		0},
-  {"enable-simul",		&enable_simul,		1},
   {"debug-output",		&debug_output,		1},
   {"protect-telnet",		&protect_telnet,	0},
-  {"dcc-sanitycheck",		&dcc_sanitycheck,	0},
   {"sort-users",		&sort_users,		0},
   {"ident-timeout",		&identtimeout,		0},
-  {"share-unlinks",		&share_unlinks,		0},
-  {"allow-dk-cmds",		&allow_dk_cmds,		0},
   {"resolve-timeout",		&resolve_timeout,	0},
-  {"must-be-owner",		&must_be_owner,		1},
-  {"use-exempts",		&use_exempts,		0},			/* Jason/drummer */
-  {"use-invites",		&use_invites,		0},			/* Jason/drummer */
-  {"quiet-save",		&quiet_save,		0},			/* Lucas */
-  {"force-expire",		&force_expire,		0},			/* Rufus */
   {"dupwait-timeout",		&dupwait_timeout,	0},
   {"strict-host",		&strict_host,		0}, 			/* drummer */
-  {"userfile-perm",		&userfile_perm,		0},
   {NULL,			NULL,			0}	/* arthur2 */
 };
 
@@ -535,21 +508,17 @@ void init_tcl(int argc, char **argv)
   int i;
   char *langEnv;
 #endif
-#ifndef HAVE_PRE7_5_TCL
   int j;
   char pver[1024] = "";
-#endif
 
 /* This must be done *BEFORE* Tcl_SetSystemEncoding(),
  * or Tcl_SetSystemEncoding() will cause a segfault.
  */
-#ifndef HAVE_PRE7_5_TCL
   /* This is used for 'info nameofexecutable'.
    * The filename in argv[0] must exist in a directory listed in
    * the environment variable PATH for it to register anything.
    */
   Tcl_FindExecutable(argv[0]);
-#endif
 
   /* Initialize the interpreter */
   interp = Tcl_CreateInterp();
@@ -638,7 +607,6 @@ resetPath:
   Tcl_GetEncoding(NULL, "iso8859-1");
 #endif
 
-#ifndef HAVE_PRE7_5_TCL
   /* Add eggdrop to Tcl's package list */
   for (j = 0; j <= strlen(egg_version); j++) {
     if ((egg_version[j] == ' ') || (egg_version[j] == '+'))
@@ -646,7 +614,6 @@ resetPath:
     pver[strlen(pver)] = egg_version[j];
   }
   Tcl_PkgProvide(interp, "eggdrop", pver);
-#endif
 
   /* Initialize binds and traces */
   Context;
@@ -656,7 +623,6 @@ resetPath:
   add_tcl_commands(tcluser_cmds);
   add_tcl_commands(tcldcc_cmds);
   add_tcl_commands(tclmisc_cmds);
-  add_tcl_objcommands(tclmisc_objcmds);
   add_tcl_commands(tcldns_cmds);
   Context;
 }

Разница между файлами не показана из-за своего большого размера
+ 2 - 940
src/tcldcc.c


+ 1 - 325
src/tclmisc.c

@@ -38,192 +38,6 @@ static int tcl_putlog STDVAR
   return TCL_OK;
 }
 
-static int tcl_binds STDVAR
-{
-  tcl_bind_list_t	*tl, *tl_kind;
-  tcl_bind_mask_t	*tm;
-  tcl_cmd_t		*tc;
-  char			*g, flg[100], hits[11];
-  int			 matching = 0;
-#if (((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) || (TCL_MAJOR_VERSION > 8))
-    CONST char *list[5];
-#else
-    char *list[5];
-#endif
-
-  BADARGS(1, 2, " ?type/mask?");
-  if (argv[1])
-    tl_kind = find_bind_table(argv[1]);
-  else
-    tl_kind = NULL;
-  if (!tl_kind && argv[1])
-    matching = 1;
-  for (tl = tl_kind ? tl_kind : bind_table_list; tl;
-       tl = tl_kind ? 0 : tl->next) {
-    if (tl->flags & HT_DELETED)
-      continue;
-    for (tm = tl->first; tm; tm = tm->next) {
-      if (tm->flags & TBM_DELETED)
-	continue;
-      for (tc = tm->first; tc; tc = tc->next) {
-	if (tc->attributes & TC_DELETED)
-	  continue;
-        if (matching &&
-	    !wild_match_per(argv[1], tl->name) &&
-            !wild_match_per(argv[1], tm->mask) &&
-            !wild_match_per(argv[1], tc->func_name))
-          continue;
-	build_flags(flg, &(tc->flags), NULL);
-        egg_snprintf(hits, sizeof hits, "%i", (int) tc->hits);
-        list[0] = tl->name;
-        list[1] = flg;
-        list[2] = tm->mask;
-        list[3] = hits;
-        list[4] = tc->func_name;
-        g = Tcl_Merge(5, list);
-        Tcl_AppendElement(irp, g);
-        Tcl_Free((char *) g);
-      }
-    }
-  }
-  return TCL_OK;
-}
-
-static int tcl_timer STDVAR
-{
-  unsigned long x;
-  char s[16];
-
-  BADARGS(3, 3, " minutes command");
-  if (atoi(argv[1]) < 0) {
-    Tcl_AppendResult(irp, "time value must be positive", NULL);
-    return TCL_ERROR;
-  }
-  if (argv[2][0] != '#') {
-    x = add_timer(&timer, atoi(argv[1]), argv[2], 0L);
-    egg_snprintf(s, sizeof s, "timer%lu", x);
-    Tcl_AppendResult(irp, s, NULL);
-  }
-  return TCL_OK;
-}
-static int tcl_ischanhub STDVAR
-{
-#ifdef HUB
-  Tcl_AppendResult(irp, "0", NULL);
-  return TCL_OK;
-#endif
-  if (ischanhub()) 
-    Tcl_AppendResult(irp, "1", NULL);
-  else 
-    Tcl_AppendResult(irp, "0", NULL);
-  return TCL_OK;
-}
-
-static int tcl_utimer STDVAR
-{
-  unsigned long x;
-  char s[16];
-
-  BADARGS(3, 3, " seconds command");
-  if (atoi(argv[1]) < 0) {
-    Tcl_AppendResult(irp, "time value must be positive", NULL);
-    return TCL_ERROR;
-  }
-  if (argv[2][0] != '#') {
-    x = add_timer(&utimer, atoi(argv[1]), argv[2], 0L);
-    egg_snprintf(s, sizeof s, "timer%lu", x);
-    Tcl_AppendResult(irp, s, NULL);
-  }
-  return TCL_OK;
-}
-
-static int tcl_killtimer STDVAR
-{
-  BADARGS(2, 2, " timerID");
-  if (strncmp(argv[1], "timer", 5)) {
-    Tcl_AppendResult(irp, "argument is not a timerID", NULL);
-    return TCL_ERROR;
-  }
-  if (remove_timer(&timer, atol(&argv[1][5])))
-    return TCL_OK;
-  Tcl_AppendResult(irp, "invalid timerID", NULL);
-  return TCL_ERROR;
-}
-
-static int tcl_killutimer STDVAR
-{
-  BADARGS(2, 2, " timerID");
-  if (strncmp(argv[1], "timer", 5)) {
-    Tcl_AppendResult(irp, "argument is not a timerID", NULL);
-    return TCL_ERROR;
-  }
-  if (remove_timer(&utimer, atol(&argv[1][5])))
-    return TCL_OK;
-  Tcl_AppendResult(irp, "invalid timerID", NULL);
-  return TCL_ERROR;
-}
-
-static int tcl_timers STDVAR
-{
-  BADARGS(1, 1, "");
-  list_timers(irp, timer);
-  return TCL_OK;
-}
-
-static int tcl_utimers STDVAR
-{
-  BADARGS(1, 1, "");
-  list_timers(irp, utimer);
-  return TCL_OK;
-}
-
-static int tcl_duration STDVAR
-{
-  char s[70];
-  unsigned long sec, tmp;
-
-  BADARGS(2, 2, " seconds");
-  if (atol(argv[1]) <= 0) {
-    Tcl_AppendResult(irp, "0 seconds", NULL);
-    return TCL_OK;
-  }
-  sec = atol(argv[1]);
-  s[0] = 0;
-  if (sec >= 31536000) {
-    tmp = (sec / 31536000);
-    sprintf(s, "%lu year%s ", tmp, (tmp == 1) ? "" : "s");
-    sec -= (tmp * 31536000);
-  }
-  if (sec >= 604800) {
-    tmp = (sec / 604800);
-    sprintf(&s[strlen(s)], "%lu week%s ", tmp, (tmp == 1) ? "" : "s");
-    sec -= (tmp * 604800);
-  }
-  if (sec >= 86400) {
-    tmp = (sec / 86400);
-    sprintf(&s[strlen(s)], "%lu day%s ", tmp, (tmp == 1) ? "" : "s");
-    sec -= (tmp * 86400);
-  }
-  if (sec >= 3600) {
-    tmp = (sec / 3600);
-    sprintf(&s[strlen(s)], "%lu hour%s ", tmp, (tmp == 1) ? "" : "s");
-    sec -= (tmp * 3600);
-  }
-  if (sec >= 60) {
-    tmp = (sec / 60);
-    sprintf(&s[strlen(s)], "%lu minute%s ", tmp, (tmp == 1) ? "" : "s");
-    sec -= (tmp * 60);
-  }
-  if (sec > 0) {
-    tmp = (sec);
-    sprintf(&s[strlen(s)], "%lu second%s", tmp, (tmp == 1) ? "" : "s");
-  }
-  if (strlen(s) > 0 && s[strlen(s) - 1] == ' ')
-    s[strlen(s) - 1] = 0;
-  Tcl_AppendResult(irp, s, NULL);
-  return TCL_OK;
-}
-
 static int tcl_unixtime STDVAR
 {
   char s[11];
@@ -292,27 +106,6 @@ static int tcl_rand STDVAR
   return TCL_OK;
 }
 
-static int tcl_sendnote STDVAR
-{
-  char s[5], from[NOTENAMELEN + 1], to[NOTENAMELEN + 1], msg[451];
-
-  BADARGS(4, 4, " from to message");
-  strncpyz(from, argv[1], sizeof from);
-  strncpyz(to, argv[2], sizeof to);
-  strncpyz(msg, argv[3], sizeof msg);
-  egg_snprintf(s, sizeof s, "%d", add_note(to, from, msg, -1, 0));
-  Tcl_AppendResult(irp, s, NULL);
-  return TCL_OK;
-}
-
-#ifdef HUB
-static int tcl_backup STDVAR
-{
-  BADARGS(1, 1, "");
-  call_hook(HOOK_BACKUP);
-  return TCL_OK;
-}
-#endif
 static int tcl_timesync STDVAR
 {
   char buf[50];
@@ -321,6 +114,7 @@ static int tcl_timesync STDVAR
   Tcl_AppendResult(irp, buf, NULL);
   return TCL_OK;
 }
+
 static int tcl_die STDVAR
 {
   char s[1024];
@@ -337,134 +131,16 @@ static int tcl_die STDVAR
   return TCL_OK;
 }
 
-static int tcl_loadmodule STDVAR
-{
-  const char *p;
-
-  BADARGS(2, 2, " module-name");
-  p = module_load(argv[1]);
-  if (p && strcmp(p, MOD_ALREADYLOAD) && !strcmp(argv[0], "loadmodule"))
-    putlog(LOG_MISC, "*", "%s %s: %s", MOD_CANTLOADMOD, argv[1], p);
-  Tcl_AppendResult(irp, p, NULL);
-  return TCL_OK;
-}
-
-static int tcl_unloadmodule STDVAR
-{
-  BADARGS(2, 2, " module-name");
-  Tcl_AppendResult(irp, module_unload(argv[1], botnetnick), NULL);
-  return TCL_OK;
-}
-
-static int tcl_unames STDVAR
-{
-  char *unix_n, *vers_n;
-#ifdef HAVE_UNAME
-  struct utsname un;
-
-  if (uname(&un) < 0) {
-#endif
-    unix_n = "*unkown*";
-    vers_n = "";
-#ifdef HAVE_UNAME
-  } else {
-    unix_n = un.sysname;
-    vers_n = un.release;
-  }
-#endif
-  Tcl_AppendResult(irp, unix_n, " ", vers_n, NULL);
-  return TCL_OK;
-}
-
-static int tcl_callevent STDVAR
-{
-  BADARGS(2, 2, " event");
-  check_tcl_event(argv[1]);
-  return TCL_OK;
-}
-
-#if (TCL_MAJOR_VERSION >= 8)
-static int tcl_md5(cd, irp, objc, objv)
-ClientData cd;
-Tcl_Interp *irp;
-int objc;
-Tcl_Obj *CONST objv[];
-{
-#else
-static int tcl_md5 STDVAR
-{
-#endif
-  MD5_CTX       md5context;
-  char digest_string[33], *string;
-  unsigned char digest[16];
-  int i, len;
-
-#if (TCL_MAJOR_VERSION >= 8)
-  if (objc != 2) {
-    Tcl_WrongNumArgs(irp, 1, objv, "string");
-    return TCL_ERROR;
-  }
-
-#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 1)
-  string = Tcl_GetStringFromObj(objv[1], &len);
-#else
-  string = Tcl_GetByteArrayFromObj(objv[1], &len);
-#endif
-
-#else
-  BADARGS(2, 2, " string");
-  string = argv[1];
-  len = strlen(argv[1]);
-#endif
-
-  MD5_Init(&md5context);
-  MD5_Update(&md5context, (unsigned char *)string, len);
-  MD5_Final(digest, &md5context);
-  for(i=0; i<16; i++)
-    sprintf(digest_string + (i*2), "%.2x", digest[i]);
-  Tcl_AppendResult(irp, digest_string, NULL);
-  return TCL_OK;
-}
-
-tcl_cmds tclmisc_objcmds[] =
-{
-#if (TCL_MAJOR_VERSION >= 8)
-  {"md5",	tcl_md5},
-#endif
-  {NULL,	NULL}
-};
-
 tcl_cmds tclmisc_cmds[] =
 {
   {"putlog",		tcl_putlog},
-  {"timer",		tcl_timer},
-  {"utimer",		tcl_utimer},
-  {"killtimer",		tcl_killtimer},
-  {"killutimer",	tcl_killutimer},
-  {"timers",		tcl_timers},
-  {"utimers",		tcl_utimers},
   {"unixtime",		tcl_unixtime},
   {"strftime",          tcl_strftime},
   {"ctime",		tcl_ctime},
   {"myip",		tcl_myip},
   {"rand",		tcl_rand},
-  {"sendnote",		tcl_sendnote},
-#ifdef HUB
-  {"backup",		tcl_backup},
-#endif
-  {"ischanhub",		tcl_ischanhub},
   {"timesync",		tcl_timesync},
   {"exit",		tcl_die},
   {"die",		tcl_die},
-  {"unames",		tcl_unames},
-  {"unloadmodule",	tcl_unloadmodule},
-  {"loadmodule",	tcl_loadmodule},
-  {"checkmodule",	tcl_loadmodule},
-  {"duration",		tcl_duration},
-#if (TCL_MAJOR_VERSION < 8)
-  {"md5",		tcl_md5},
-#endif
-  {"binds",		tcl_binds},
-  {"callevent",		tcl_callevent},
   {NULL,		NULL}
 };

+ 2 - 188
src/tcluser.c

@@ -19,41 +19,6 @@ extern char		 origbotname[], botnetnick[];
 extern time_t		 now;
 
 
-static int tcl_countusers STDVAR
-{
-  BADARGS(1, 1, "");
-  Tcl_AppendResult(irp, int_to_base10(count_users(userlist)), NULL);
-  return TCL_OK;
-}
-
-static int tcl_validuser STDVAR
-{
-  BADARGS(2, 2, " handle");
-  Tcl_AppendResult(irp, get_user_by_handle(userlist, argv[1]) ? "1" : "0",
-		   NULL);
-  return TCL_OK;
-}
-
-static int tcl_finduser STDVAR
-{
-  struct userrec *u;
-
-  BADARGS(2, 2, " nick!user@host");
-  u = get_user_by_host(argv[1]);
-  Tcl_AppendResult(irp, u ? u->handle : "*", NULL);
-  return TCL_OK;
-}
-
-static int tcl_passwdOk STDVAR
-{
-  struct userrec *u;
-
-  BADARGS(3, 3, " handle passwd");
-  Tcl_AppendResult(irp, ((u = get_user_by_handle(userlist, argv[1])) &&
-			 u_pass_match(u, argv[2])) ? "1" : "0", NULL);
-  return TCL_OK;
-}
-
 static int tcl_chattr STDVAR
 {
   char *chan, *chg, work[100];
@@ -124,109 +89,6 @@ static int tcl_chattr STDVAR
   return TCL_OK;
 }
 
-static int tcl_botattr STDVAR
-{
-  char *chan, *chg, work[100];
-  struct flag_record pls, mns, user;
-  struct userrec *u;
-
-  BADARGS(2, 4, " bot-handle ?changes? ?channel?");
-  u = get_user_by_handle(userlist, argv[1]);
-  if ((argv[1][0] == '*') || !u || !(u->flags & USER_BOT)) {
-    Tcl_AppendResult(irp, "*", NULL);
-    return TCL_OK;
-  }
-  if (argc == 4) {
-    user.match = FR_BOT | FR_CHAN;
-    chan = argv[3];
-    chg = argv[2];
-  } else if (argc == 3 && argv[2][0] &&
-             strchr(CHANMETA, argv[2][0]) != NULL) {
-    /* We need todo extra checking here to stop us mixing up +channel's
-     * with flags. <cybah>
-     */
-    if (!findchan_by_dname(argv[2]) && argv[2][0] != '+') {
-      /* Channel doesnt exist, and it cant possibly be flags as there
-       * is no + at the start of the string.
-       */
-      Tcl_AppendResult(irp, "no such channel", NULL);
-      return TCL_ERROR;
-    } else if(findchan_by_dname(argv[2])) {
-      /* Channel exists */
-      user.match = FR_BOT | FR_CHAN;
-      chan = argv[2];
-      chg = NULL;
-    } else {
-      /* 3rd possibility... channel doesnt exist, does start with a +.
-       * In this case we assume the string is flags.
-       */
-      user.match = FR_BOT;
-      chan = NULL;
-      chg = argv[2];
-    }
-  } else {
-    user.match = FR_BOT;
-    chan = NULL;
-    if (argc < 3)
-    chg = NULL;
-    else
-      chg = argv[2];
-  }
-  if (chan && !findchan_by_dname(chan)) {
-    Tcl_AppendResult(irp, "no such channel", NULL);
-    return TCL_ERROR;
-  }
-  get_user_flagrec(u, &user, chan);
-  /* Make changes */
-  if (chg) {
-    pls.match = user.match;
-    break_down_flags(chg, &pls, &mns);
-    /* No-one can change these flags on-the-fly */
-    if (chan) {
-      pls.chan &= BOT_SHARE;
-      mns.chan &= BOT_SHARE;
-    }
-    user.bot = sanity_check((user.bot | pls.bot) & ~mns.bot);
-    if (chan) {
-      user.chan = (user.chan | pls.chan) & ~mns.chan;
-      user.udef_chan = (user.udef_chan | pls.udef_chan) & ~mns.udef_chan;
-    }
-    set_user_flagrec(u, &user, chan);
-  }
-  /* Retrieve current flags and return them */
-  build_flags(work, &user, NULL);
-  Tcl_AppendResult(irp, work, NULL);
-  return TCL_OK;
-}
-
-static int tcl_matchattr STDVAR
-{
-  struct userrec *u;
-  struct flag_record plus, minus, user;
-  int ok = 0, f;
-
-  BADARGS(3, 4, " handle flags ?channel?");
-  if ((u = get_user_by_handle(userlist, argv[1]))) {
-    user.match = FR_GLOBAL | (argc == 4 ? FR_CHAN : 0) | FR_BOT;
-    get_user_flagrec(u, &user, argv[3]);
-    plus.match = user.match;
-    break_down_flags(argv[2], &plus, &minus);
-    f = (minus.global || minus.udef_global || minus.chan ||
-	 minus.udef_chan || minus.bot);
-    if (flagrec_eq(&plus, &user)) {
-      if (!f)
-	ok = 1;
-      else {
-	minus.match = plus.match ^ (FR_AND | FR_OR);
-	if (!flagrec_eq(&minus, &user))
-	  ok = 1;
-      }
-    }
-  }
-  Tcl_AppendResult(irp, ok ? "1" : "0", NULL);
-  return TCL_OK;
-}
-
 static int tcl_adduser STDVAR
 {
   BADARGS(2, 3, " handle ?hostmask?");
@@ -241,45 +103,6 @@ static int tcl_adduser STDVAR
   return TCL_OK;
 }
 
-static int tcl_addbot STDVAR
-{
-  struct bot_addr *bi;
-  char *p, *q;
-
-  BADARGS(3, 3, " handle address");
-  if (strlen(argv[1]) > HANDLEN)
-     argv[1][HANDLEN] = 0;
-  if (get_user_by_handle(userlist, argv[1]))
-     Tcl_AppendResult(irp, "0", NULL);
-  else if (argv[1][0] == '*')
-     Tcl_AppendResult(irp, "0", NULL);
-  else {
-    userlist = adduser(userlist, argv[1], "none", "-", USER_BOT);
-    bi = user_malloc(sizeof(struct bot_addr));
-    q = strchr(argv[2], ':');
-    if (!q) {
-      bi->address = user_malloc(strlen(argv[2]) + 1);
-      strcpy(bi->address, argv[2]);
-      bi->telnet_port = 3333;
-      bi->relay_port = 3333;
-    } else {
-      bi->address = user_malloc(q - argv[2] + 1);
-      strncpy(bi->address, argv[2], q - argv[2]);
-      bi->address[q - argv[2]] = 0;
-      p = q + 1;
-      bi->telnet_port = atoi(p);
-      q = strchr(p, '/');
-      if (!q)
-	bi->relay_port = bi->telnet_port;
-      else
-	bi->relay_port = atoi(q + 1);
-    }
-    set_user(&USERENTRY_BOTADDR, get_user_by_handle(userlist, argv[1]), bi);
-    Tcl_AppendResult(irp, "1", NULL);
-  }
-  return TCL_OK;
-}
-
 static int tcl_deluser STDVAR
 {
   BADARGS(2, 2, " handle");
@@ -338,7 +161,6 @@ static int tcl_userlist STDVAR
 }
 
 #ifdef HUB
-
 static int tcl_save STDVAR
 {
   write_userfile(-1);
@@ -350,7 +172,7 @@ static int tcl_reload STDVAR
   reload();
   return TCL_OK;
 }
-#endif
+#endif /* HUB */
 
 static int tcl_chhandle STDVAR
 {
@@ -542,23 +364,15 @@ static int tcl_setuser STDVAR
 
 tcl_cmds tcluser_cmds[] =
 {
-  {"countusers",	tcl_countusers},
-  {"validuser",		tcl_validuser},
-  {"finduser",		tcl_finduser},
-  {"passwdok",		tcl_passwdOk},
   {"chattr",		tcl_chattr},
-  {"botattr",		tcl_botattr},
-  {"matchattr",		tcl_matchattr},
-  {"matchchanattr",	tcl_matchattr},
   {"adduser",		tcl_adduser},
-  {"addbot",		tcl_addbot},
   {"deluser",		tcl_deluser},
   {"delhost",		tcl_delhost},
   {"userlist",		tcl_userlist},
 #ifdef HUB
   {"save",		tcl_save},
   {"reload",		tcl_reload},
-#endif
+#endif /* HUB */
   {"chhandle",		tcl_chhandle},
   {"chnick",		tcl_chhandle},
   {"getting-users",	tcl_getting_users},

Некоторые файлы не были показаны из-за большого количества измененных файлов