Răsfoiți Sursa

* Removed tcl_set/tcl_get from user entries
* Removed more misc tcl code


svn: 605

Bryan Drewery 22 ani în urmă
părinte
comite
08073dab0b
16 a modificat fișierele cu 12 adăugiri și 460 ștergeri
  1. 0 1
      src/botmsg.c
  2. 0 13
      src/chanprog.c
  3. 0 1
      src/dcc.c
  4. 0 1
      src/dccutil.c
  5. 0 13
      src/debug.c
  6. 0 30
      src/dns.c
  7. 0 28
      src/flags.c
  8. 0 1
      src/misc.c
  9. 0 57
      src/mod/console.mod/console.c
  10. 1 2
      src/mod/notes.mod/notes.c
  11. 3 0
      src/mod/notes.mod/notes.h
  12. 0 66
      src/mod/transfer.mod/transfer.c
  13. 0 12
      src/tclegg.h
  14. 0 223
      src/userent.c
  15. 8 8
      src/users.c
  16. 0 4
      src/users.h

+ 0 - 1
src/botmsg.c

@@ -16,7 +16,6 @@ extern int		 dcc_total, tands;
 extern char		 botnetnick[];
 extern time_t now;
 extern party_t		*party;
-extern Tcl_Interp	*interp;
 extern struct userrec	*userlist;
 
 static char	OBUF[SGRAB-110];

+ 0 - 13
src/chanprog.c

@@ -20,7 +20,6 @@
 #include "modules.h"
 
 extern struct userrec	*userlist;
-extern Tcl_Interp	*interp;
 extern char		 ver[], botnetnick[], firewall[], myip[], 
 			 motdfile[], userfile[], tempdir[],
 			 notify_new[], owner[], 
@@ -343,18 +342,6 @@ void tell_verbose_status(int idx)
     dprintf(idx, "Admin: %s\n", admin);
 
   dprintf(idx, "OS: %s %s\n", uni_t, vers_t);
-
-  /* info library */
-  dprintf(idx, "%s %s\n", MISC_TCLLIBRARY,
-	  ((interp) && (Tcl_Eval(interp, "info library") == TCL_OK)) ?
-	  interp->result : "*unknown*");
-
-  /* info tclversion/patchlevel */
-  dprintf(idx, "%s %s (%s %s)\n", MISC_TCLVERSION,
-	  ((interp) && (Tcl_Eval(interp, "info patchlevel") == TCL_OK)) ?
-	  interp->result : (Tcl_Eval(interp, "info tclversion") == TCL_OK) ?
-	  interp->result : "*unknown*", MISC_TCLHVERSION,
-	  TCL_PATCH_LEVEL ? TCL_PATCH_LEVEL : "*unknown*");
 }
 
 /* Show all internal state variables

+ 0 - 1
src/dcc.c

@@ -21,7 +21,6 @@
 
 extern struct userrec	*userlist;
 extern struct chanset_t	*chanset;
-extern Tcl_Interp	*interp;
 extern time_t		 now, buildts;
 extern int		 egg_numver, connect_timeout, conmask, backgrd,
 			 max_dcc, default_flags, debug_output,

+ 0 - 1
src/dccutil.c

@@ -24,7 +24,6 @@ extern unsigned long     notalloc;
 extern char		 botnetnick[], version[];
 extern time_t		 now;
 extern sock_list	*socklist;
-extern Tcl_Interp	*interp;
 
 static struct portmap 	*root = NULL;
 

+ 0 - 13
src/debug.c

@@ -22,8 +22,6 @@ extern int 		 sdebug, backgrd, do_restart;
 extern char		 tempdir[], origbotname[], ver[];
 extern time_t		 now, buildts;
 extern jmp_buf           alarmret;
-extern Tcl_Interp       *interp;
-
 
 void setlimits()
 {
@@ -153,17 +151,6 @@ void write_debug()
 
     egg_strftime(date, sizeof date, "%c %Z", gmtime(&buildts));
     dprintf(-x, "Build: %s (%lu)\n", date, buildts);
-    /* info library */
-    dprintf(-x, "Tcl library: %s\n",
-            ((interp) && (Tcl_Eval(interp, "info library") == TCL_OK)) ?
-            interp->result : "*unknown*");
-
-    /* info tclversion/patchlevel */
-    dprintf(-x, "Tcl version: %s (header version %s)\n",
-            ((interp) && (Tcl_Eval(interp, "info patchlevel") == TCL_OK)) ?
-     interp->result : (Tcl_Eval(interp, "info tclversion") == TCL_OK) ?
-     interp->result : "*unknown*", TCL_PATCH_LEVEL ? TCL_PATCH_LEVEL :
-     "*unknown*");
 
 #ifdef CCFLAGS
     dprintf(-x, "Compile flags: %s\n", CCFLAGS);

+ 0 - 30
src/dns.c

@@ -20,7 +20,6 @@ extern int		 dcc_total;
 extern int		 resolve_timeout;
 extern time_t		 now;
 extern jmp_buf		 alarmret;
-extern Tcl_Interp	*interp;
 
 devent_t	*dns_events = NULL;
 
@@ -189,35 +188,6 @@ void dcc_dnshostbyip(IP ip)
 }
 
 
-/*
- *   Tcl events
- */
-
-static void dns_tcl_iporhostres(IP ip, char *hostn, int ok, void *other)
-{
-  devent_tclinfo_t *tclinfo = (devent_tclinfo_t *) other;
-
-  if (Tcl_VarEval(interp, tclinfo->proc, " ", iptostr(htonl(ip)), " ",
-		  hostn, ok ? " 1" : " 0", tclinfo->paras, NULL) == TCL_ERROR)
-    putlog(LOG_MISC, "*", DCC_TCLERROR, tclinfo->proc, interp->result);
-
-  /* Free the memory. It will be unused after this event call. */
-  free(tclinfo->proc);
-  if (tclinfo->paras)
-    free(tclinfo->paras);
-  free(tclinfo);
-}
-
-devent_type DNS_TCLEVENT_HOSTBYIP = {
-  "TCLEVENT_HOSTBYIP",
-  dns_tcl_iporhostres
-};
-
-devent_type DNS_TCLEVENT_IPBYHOST = {
-  "TCLEVENT_IPBYHOST",
-  dns_tcl_iporhostres
-};
-
 
 /*
  *    Event functions

+ 0 - 28
src/flags.c

@@ -720,32 +720,6 @@ static int botfl_set(struct userrec *u, struct user_entry *e, void *buf)
   return 1;
 }
 
-static int botfl_tcl_get(Tcl_Interp *interp, struct userrec *u,
-			 struct user_entry *e, int argc, char **argv)
-{
-  char x[100];
-  struct flag_record fr = {FR_BOT, 0, 0, 0, 0, 0};
-
-  fr.bot = e->u.ulong;
-  build_flags(x, &fr, NULL);
-  Tcl_AppendResult(interp, x, NULL);
-  return TCL_OK;
-}
-
-static int botfl_tcl_set(Tcl_Interp *irp, struct userrec *u,
-			 struct user_entry *e, int argc, char **argv)
-{
-  struct flag_record fr = {FR_BOT, 0, 0, 0, 0, 0};
-
-  BADARGS(4, 4, " handle BOTFL flags");
-  if (u->flags & USER_BOT) {
-    /* Silently ignore for users */
-    break_down_flags(argv[3], &fr, NULL);
-    botfl_set(u, e, (void *) fr.bot);
-  }
-  return TCL_OK;
-}
-
 static void botfl_display(int idx, struct user_entry *e, struct userrec *u)
 {
   struct flag_record fr = {FR_BOT, 0, 0, 0, 0, 0};
@@ -767,8 +741,6 @@ struct user_entry_type USERENTRY_BOTFL =
   botfl_kill,
   def_get,
   botfl_set,
-  botfl_tcl_get,
-  botfl_tcl_set,
   botfl_display,
   "BOTFL"
 };

+ 0 - 1
src/misc.c

@@ -48,7 +48,6 @@ extern int		 backgrd, term_z, use_stderr, dcc_total, timesync,
 			 strict_host, loading,
                          localhub;
 extern time_t		 now;
-extern Tcl_Interp	*interp;
 extern struct cfg_entry	CFG_MOTD, CFG_LOGIN, CFG_BADPROCESS, CFG_PROCESSLIST, CFG_PROMISC, 
 			CFG_TRACE, CFG_HIJACK;
 

+ 0 - 57
src/mod/console.mod/console.c

@@ -13,7 +13,6 @@
 
 static Function *global = NULL;
 static int console_autosave = 1;
-static int force_channel = 0;
 static int info_party = 1;
 
 struct console_info {
@@ -178,60 +177,6 @@ static int console_gotshare(struct userrec *u, struct user_entry *e, char *par,
   return 1;
 }
 
-static int console_tcl_get(Tcl_Interp *irp, struct userrec *u,
-			   struct user_entry *e, int argc, char **argv)
-{
-  char work[1024];
-  struct console_info *i = e->u.extra;
-
-  simple_sprintf(work, "%s %s %s %d %d %d %d",
-		 i->channel, masktype(i->conflags),
-		 stripmasktype(i->stripflags), i->echoflags,
-		 i->page, i->conchan, i->colour);
-  Tcl_AppendResult(irp, work, NULL);
-  return TCL_OK;
-}
-
-static int console_tcl_set(Tcl_Interp *irp, struct userrec *u,
-		    struct user_entry *e, int argc, char **argv)
-{
-  struct console_info *i = e->u.extra;
-  int l;
-
-  BADARGS(4, 9, " handle CONSOLE channel flags strip echo page conchan");
-  if (!i) {
-    i = malloc(sizeof(struct console_info));
-    egg_bzero(i, sizeof(struct console_info));
-  }
-  if (i->channel)
-    free(i->channel);
-  l = strlen(argv[3]);
-  if (l > 80)
-    l = 80;
-  i->channel = malloc(l + 1);
-  strncpy(i->channel, argv[3], l);
-  i->channel[l] = 0;
-  if (argc > 4) {
-    i->conflags = logmodes(argv[4]);
-    if (argc > 5) {
-      i->stripflags = stripmodes(argv[5]);
-      if (argc > 6) {
-	i->echoflags = (argv[6][0] == '1') ? 1 : 0;
-	if (argc > 7) {
-	  i->page = atoi(argv[7]);
-	  if (argc > 8) {
-	    i->conchan = atoi(argv[8]);
-            if (argc > 9)
-              i->colour = atoi(argv[9]);
-          }  
-	}
-      }
-    }
-  }
-  set_user(&USERENTRY_CONSOLE, u, i);
-  return TCL_OK;
-}
-
 static void console_display(int idx, struct user_entry *e, struct userrec *u)
 {
   struct console_info *i = e->u.extra;
@@ -278,8 +223,6 @@ static struct user_entry_type USERENTRY_CONSOLE =
   console_kill,
   NULL,
   console_set,
-  console_tcl_get,
-  console_tcl_set,
   console_display,
   "CONSOLE"
 };

+ 1 - 2
src/mod/notes.mod/notes.c

@@ -35,8 +35,6 @@ static struct user_entry_type USERENTRY_FWD =
   NULL,
   NULL,
   NULL,
-  NULL,
-  NULL,
   fwd_display,
   "FWD"
 };
@@ -937,6 +935,7 @@ static Function notes_table[] =
   (Function) 0,
   (Function) notes_report,
   (Function) cmd_note,
+  (Function) num_notes,
 };
 
 char *notes_start(Function * global_funcs)

+ 3 - 0
src/mod/notes.mod/notes.h

@@ -64,6 +64,9 @@ static int match_note_ignore(struct userrec *, char *);
 static void notes_read(char *, char *, char *, int);
 static void notes_del(char *, char *, char *, int);
 static void fwd_display(int, struct user_entry *, struct userrec *);
+#else
+#define num_notes ((int(*)(char *user))notes_funcs[5])
+
 #endif				/* MAKING_NOTES */
 
 #endif				/* _EGG_MOD_NOTES_H */

+ 0 - 66
src/mod/transfer.mod/transfer.c

@@ -1545,31 +1545,6 @@ static int fstat_set(struct userrec *u, struct user_entry *e, void *buf)
   return 1;
 }
 
-static int fstat_tcl_get(Tcl_Interp *irp, struct userrec *u,
-			 struct user_entry *e, int argc, char **argv)
-{
-  register struct filesys_stats *fs;
-  char d[50];
-
-  BADARGS(3, 4, " handle FSTAT ?u/d?");
-  fs = e->u.extra;
-  if (argc == 3)
-    egg_snprintf(d, sizeof d, "%u %u %u %u", fs->uploads, fs->upload_ks,
-                 fs->dnloads, fs->dnload_ks);
-  else
-    switch (argv[3][0]) {
-    case 'u':
-      egg_snprintf(d, sizeof d, "%u %u", fs->uploads, fs->upload_ks);
-      break;
-    case 'd':
-      egg_snprintf(d, sizeof d, "%u %u", fs->dnloads, fs->dnload_ks);
-      break;
-    }
-
-  Tcl_AppendResult(irp, d, NULL);
-  return TCL_OK;
-}
-
 static int fstat_kill(struct user_entry *e)
 {
   if (e->u.extra)
@@ -1594,8 +1569,6 @@ static int fstat_dupuser(struct userrec *u, struct userrec *o,
 			 struct user_entry *e);
 static void stats_add_dnload(struct userrec *u, unsigned long bytes);
 static void stats_add_upload(struct userrec *u, unsigned long bytes);
-static int fstat_tcl_set(Tcl_Interp *irp, struct userrec *u,
-			 struct user_entry *e, int argc, char **argv);
 
 static struct user_entry_type USERENTRY_FSTAT =
 {
@@ -1608,8 +1581,6 @@ static struct user_entry_type USERENTRY_FSTAT =
   fstat_kill,
   NULL,
   fstat_set,
-  fstat_tcl_get,
-  fstat_tcl_set,
   fstat_display,
   "FSTAT"
 };
@@ -1703,43 +1674,6 @@ static void stats_add_upload(struct userrec *u, unsigned long bytes)
   }
 }
 
-static int fstat_tcl_set(Tcl_Interp *irp, struct userrec *u,
-			 struct user_entry *e, int argc, char **argv)
-{
-  register struct filesys_stats *fs;
-  int f = 0, k = 0;
-
-  BADARGS(4, 6, " handle FSTAT u/d ?files ?ks??");
-  if (argc > 4)
-    f = atoi(argv[4]);
-  if (argc > 5)
-    k = atoi(argv[5]);
-  switch (argv[3][0]) {
-  case 'u':
-  case 'd':
-    if (!(fs = e->u.extra)) {
-      fs = malloc(sizeof(struct filesys_stats));
-      egg_bzero(fs, sizeof(struct filesys_stats));
-    }
-    switch (argv[3][0]) {
-    case 'u':
-      fs->uploads = f;
-      fs->upload_ks = k;
-      break;
-    case 'd':
-      fs->dnloads = f;
-      fs->dnload_ks = k;
-      break;
-    }
-    set_user (&USERENTRY_FSTAT, u, fs);
-    break;
-  case 'r':
-    set_user (&USERENTRY_FSTAT, u, NULL);
-    break;
-  }
-  return TCL_OK;
-}
-
 
 /*
  *    CTCP functions

+ 0 - 12
src/tclegg.h

@@ -13,18 +13,6 @@
 #  include "proto.h"		/* This file needs this */
 #endif
 
-/* Used for stub functions:
- */
-
-#define BADARGS(nl, nh, example)	do {				\
-	if ((argc < (nl)) || (argc > (nh))) {				\
-		Tcl_AppendResult(irp, "wrong # args: should be \"",	\
-				 argv[0], (example), "\"", NULL);	\
-		return TCL_ERROR;					\
-	}								\
-} while (0)
-
-
 typedef struct _tcl_coups {
   char *name;
   int *lptr;

+ 0 - 223
src/userent.c

@@ -136,21 +136,6 @@ int def_gotshare(struct userrec *u, struct user_entry *e,
   return e->type->set(u, e, data);
 }
 
-int def_tcl_get(Tcl_Interp * interp, struct userrec *u,
-		struct user_entry *e, int argc, char **argv)
-{
-  Tcl_AppendResult(interp, e->u.string, NULL);
-  return TCL_OK;
-}
-
-int def_tcl_set(Tcl_Interp * irp, struct userrec *u,
-		struct user_entry *e, int argc, char **argv)
-{
-  BADARGS(4, 4, " handle type setting");
-  e->type->set(u, e, argv[3]);
-  return TCL_OK;
-}
-
 void def_display(int idx, struct user_entry *e, struct userrec *u)
 {
   dprintf(idx, "  %s: %s\n", e->type->name, e->u.string);
@@ -180,8 +165,6 @@ struct user_entry_type USERENTRY_COMMENT =
   def_kill,
   def_get,
   def_set,
-  def_tcl_get,
-  def_tcl_set,
   comment_display,
   "COMMENT"
 };
@@ -197,8 +180,6 @@ struct user_entry_type USERENTRY_INFO =
   def_kill,
   def_get,
   def_set,
-  def_tcl_get,
-  def_tcl_set,
   def_display,
   "INFO"
 };
@@ -239,8 +220,6 @@ struct user_entry_type USERENTRY_ADDED = {
   def_kill,
   def_get,
   def_set,
-  0,
-  0,
   added_display,
   "ADDED"
 };
@@ -448,8 +427,6 @@ struct user_entry_type USERENTRY_CONFIG = {
   config_kill,
   def_get,
   config_set,
-  0,
-  0,
   config_display,
   "CONFIG"
 };
@@ -505,8 +482,6 @@ struct user_entry_type USERENTRY_STATS = {
   def_kill,
   def_get,
   def_set,
-  0,
-  0,
   stats_display,
   "STATS"
 };
@@ -553,8 +528,6 @@ struct user_entry_type USERENTRY_MODIFIED =
   def_kill,
   def_get,
   def_set,
-  0,
-  0,
   modified_display,
   "MODIFIED"
 };
@@ -589,14 +562,6 @@ int pass_set(struct userrec *u, struct user_entry *e, void *buf)
   return 1;
 }
 
-static int pass_tcl_set(Tcl_Interp * irp, struct userrec *u,
-			struct user_entry *e, int argc, char **argv)
-{
-  BADARGS(3, 4, " handle PASS ?newpass?");
-  pass_set(u, e, argc == 3 ? NULL : argv[3]);
-  return TCL_OK;
-}
-
 struct user_entry_type USERENTRY_PASS =
 {
   0,
@@ -608,8 +573,6 @@ struct user_entry_type USERENTRY_PASS =
   def_kill,
   def_get,
   pass_set,
-  def_tcl_get,
-  pass_tcl_set,
   0,
   "PASS"
 };
@@ -645,8 +608,6 @@ struct user_entry_type USERENTRY_SECPASS =
   def_kill,
   def_get,
   def_set,
-  0,
-  0,
   secpass_display,
   "SECPASS"
 };
@@ -723,59 +684,6 @@ static int laston_set(struct userrec *u, struct user_entry *e, void *buf)
   return 1;
 }
 
-static int laston_tcl_get(Tcl_Interp * irp, struct userrec *u,
-			  struct user_entry *e, int argc, char **argv)
-{
-  struct laston_info *li = (struct laston_info *) e->u.extra;
-  char number[20];
-  struct chanuserrec *cr;
-
-  BADARGS(3, 4, " handle LASTON ?channel?");
-  if (argc == 4) {
-    for (cr = u->chanrec; cr; cr = cr->next)
-      if (!rfc_casecmp(cr->channel, argv[3])) {
-	Tcl_AppendResult(irp, int_to_base10(cr->laston), NULL);
-	break;
-      }
-    if (!cr)
-      Tcl_AppendResult(irp, "0", NULL);
-  } else {
-    sprintf(number, "%lu ", li->laston);
-    Tcl_AppendResult(irp, number, li->lastonplace, NULL);
-  }
-  return TCL_OK;
-}
-
-static int laston_tcl_set(Tcl_Interp * irp, struct userrec *u,
-			  struct user_entry *e, int argc, char **argv)
-{
-  struct laston_info *li;
-  struct chanuserrec *cr;
-
-  BADARGS(4, 5, " handle LASTON time ?place?");
-
-  if ((argc == 5) && argv[4][0] && strchr(CHANMETA, argv[4][0])) {
-    /* Search for matching channel */
-    for (cr = u->chanrec; cr; cr = cr->next)
-      if (!rfc_casecmp(cr->channel, argv[4])) {
-	cr->laston = atoi(argv[3]);
-	break;
-      }
-  }
-  /* Save globally */
-  li = malloc(sizeof(struct laston_info));
-
-  if (argc == 5) {
-    li->lastonplace = strdup(argv[4]);
-  } else {
-    li->lastonplace = malloc(1);
-    li->lastonplace[0] = 0;
-  }
-  li->laston = atoi(argv[3]);
-  set_user(&USERENTRY_LASTON, u, li);
-  return TCL_OK;
-}
-
 static int laston_dupuser(struct userrec *new, struct userrec *old,
 			  struct user_entry *e)
 {
@@ -802,8 +710,6 @@ struct user_entry_type USERENTRY_LASTON =
   laston_kill,
   def_get,
   laston_set,
-  laston_tcl_get,
-  laston_tcl_set,
   0,
   "LASTON"
 };
@@ -927,51 +833,6 @@ static int botaddr_set(struct userrec *u, struct user_entry *e, void *buf)
   return 1;
 }
 
-static int botaddr_tcl_get(Tcl_Interp *interp, struct userrec *u,
-			   struct user_entry *e, int argc, char **argv)
-{
-  register struct bot_addr *bi = (struct bot_addr *) e->u.extra;
-  char number[20];
-
-  Context;
-  sprintf(number, STR(" %d"), bi->telnet_port);
-  Tcl_AppendResult(interp, bi->address, number, NULL);
-  sprintf(number, STR(" %d"), bi->relay_port);
-  Tcl_AppendResult(interp, number, NULL);
-  sprintf(number, STR(" %d"), bi->hublevel);
-  Tcl_AppendResult(interp, number, NULL);
-  Tcl_AppendResult(interp, bi->uplink, NULL);
-  return TCL_OK;
-}
-
-static int botaddr_tcl_set(Tcl_Interp *irp, struct userrec *u,
-			   struct user_entry *e, int argc, char **argv)
-{
-  register struct bot_addr *bi = (struct bot_addr *) e->u.extra;
-
-  BADARGS(4, 6, " handle type address ?telnetport ?relayport??");
-  if (u->flags & USER_BOT) {
-    /* Silently ignore for users */
-    if (!bi) {
-      bi = malloc(sizeof(struct bot_addr));
-      egg_bzero(bi, sizeof (struct bot_addr));
-    } else {
-      free(bi->address);
-    }
-    bi->address = strdup(argv[3]);
-    if (argc > 4)
-      bi->telnet_port = atoi(argv[4]);
-    if (argc > 5)
-      bi->relay_port = atoi(argv[5]);
-    if (!bi->telnet_port)
-      bi->telnet_port = 3333;
-    if (!bi->relay_port)
-      bi->relay_port = bi->telnet_port;
-    botaddr_set(u, e, bi);
-  }
-  return TCL_OK;
-}
-
 static void botaddr_display(int idx, struct user_entry *e, struct userrec *u)
 {
 #ifdef HUB
@@ -1046,8 +907,6 @@ struct user_entry_type USERENTRY_BOTADDR =
   botaddr_kill,
   def_get,
   botaddr_set,
-  botaddr_tcl_get,
-  botaddr_tcl_set,
   botaddr_display,
   "BOTADDR"
 };
@@ -1094,32 +953,6 @@ int xtra_set(struct userrec *u, struct user_entry *e, void *buf)
   }
   return TCL_OK;
 }
-static int xtra_tcl_set(Tcl_Interp * irp, struct userrec *u,
-                        struct user_entry *e, int argc, char **argv)
-{
-  struct xtra_key *xk;
-  int l;
-
-  BADARGS(4, 5, " handle type key ?value?");
-  xk = malloc(sizeof(struct xtra_key));
-  l = strlen(argv[3]);
-  egg_bzero(xk, sizeof (struct xtra_key));
-  if (l > 500)
-    l = 500;
-  xk->key = malloc(l + 1);
-  strncpyz(xk->key, argv[3], l + 1);
-
-  if (argc == 5) {
-    int k = strlen(argv[4]);
-
-    if (k > 500 - l)
-      k = 500 - l;
-    xk->data = malloc(k + 1);
-    strncpyz(xk->data, argv[4], k + 1);
-  }
-  xtra_set(u, e, xk);
-  return TCL_OK;
-}
 
 int xtra_unpack(struct userrec *u, struct user_entry *e)
 {
@@ -1256,36 +1089,6 @@ int xtra_kill(struct user_entry *e)
   free(e);
   return 1;
 }
-static int xtra_tcl_get(Tcl_Interp *irp, struct userrec *u,
-                        struct user_entry *e, int argc, char **argv)
-{
-  struct xtra_key *x;
-
-  BADARGS(3, 4, " handle XTRA ?key?");
-  if (argc == 4) {
-    for (x = e->u.extra; x; x = x->next)
-      if (!egg_strcasecmp(argv[3], x->key)) {
-        Tcl_AppendResult(irp, x->data, NULL);
-        return TCL_OK;
-      }
-    return TCL_OK;
-  }
-  for (x = e->u.extra; x; x = x->next) {
-    char *p;
-#if ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))
-    CONST char *list[2];
-#else
-    char *list[2];
-#endif
-
-    list[0] = x->key;
-    list[1] = x->data;
-    p = Tcl_Merge(2, list);
-    Tcl_AppendElement(irp, p);
-    Tcl_Free((char *) p);
-  }
-  return TCL_OK;
-}
 
 struct user_entry_type USERENTRY_XTRA =
 {
@@ -1298,8 +1101,6 @@ struct user_entry_type USERENTRY_XTRA =
   xtra_kill,
   def_get,
   xtra_set,
-  xtra_tcl_get,
-  xtra_tcl_set,
   xtra_display,
   "XTRA"
 };
@@ -1415,28 +1216,6 @@ static int hosts_set(struct userrec *u, struct user_entry *e, void *buf)
   return 1;
 }
 
-static int hosts_tcl_get(Tcl_Interp *irp, struct userrec *u,
-			 struct user_entry *e, int argc, char **argv)
-{
-  struct list_type *x;
-
-  BADARGS(3, 3, " handle HOSTS");
-  for (x = e->u.list; x; x = x->next)
-    Tcl_AppendElement(irp, x->extra);
-  return TCL_OK;
-}
-
-static int hosts_tcl_set(Tcl_Interp * irp, struct userrec *u,
-			 struct user_entry *e, int argc, char **argv)
-{
-  BADARGS(3, 4, " handle HOSTS ?host?");
-  if (argc == 4)
-    addhost_by_handle(u->handle, argv[3]);
-  else
-    addhost_by_handle(u->handle, "none"); /* drummer */
-  return TCL_OK;
-}
-
 static int hosts_gotshare(struct userrec *u, struct user_entry *e,
 			  char *buf, int idx)
 {
@@ -1455,8 +1234,6 @@ struct user_entry_type USERENTRY_HOSTS =
   hosts_kill,
   def_get,
   hosts_set,
-  hosts_tcl_get,
-  hosts_tcl_set,
   hosts_display,
   "HOSTS"
 };

+ 8 - 8
src/users.c

@@ -26,7 +26,6 @@ extern struct userrec *userlist, *lastuser;
 extern struct chanset_t *chanset;
 extern int dcc_total, noshare, egg_numver;
 extern char botnetnick[], tempdir[];
-extern Tcl_Interp *interp;
 extern time_t now;
 
 char userfile[121] = "";	/* where the user records are stored */
@@ -447,21 +446,23 @@ void tell_user(int idx, struct userrec *u, int master)
 {
   char s[81], s1[81];
   char format[81];
-  int n;
+  int n = 0;
   time_t now2;
   struct chanuserrec *ch;
   struct chanset_t *chan;
   struct user_entry *ue;
   struct laston_info *li;
   struct flag_record fr = {FR_GLOBAL, 0, 0, 0, 0, 0};
+  module_entry *me = module_find("notes", 0, 0);
+  if (me) {
+    Function *func = me->funcs;
+    n = (func[5]) (u->handle);
+  }
+
 
   fr.global = u->flags;
   fr.udef_global = u->flags_udef;
   build_flags(s, &fr, NULL);
-  Tcl_SetVar(interp, "user", u->handle, 0);
-  n = 0;
-  if (Tcl_VarEval(interp, "notes ", "$user", NULL) == TCL_OK)
-    n = atoi(interp->result);
   li = get_user(&USERENTRY_LASTON, u);
   if (!li || !li->laston)
     strcpy(s1, "never");
@@ -822,9 +823,8 @@ int readuserfile(char *file, struct userrec **ret)
              options[strlen(options) - 1] = 0;
 /* Above is a hack to remove { } */
 //             putlog(LOG_MISC, "*", "TCL_CHANNEL_ADD: (%s) %s", chan, options);
-             if ((func[37]) (interp, chan, options) != TCL_OK) {	/* tcl_channel_add() */
+             if ((func[37]) (0, chan, options) != TCL_OK) {	/* tcl_channel_add() */
                putlog(LOG_MISC, "*", "Tcl error in userfile on line %d", line);
-               putlog(LOG_MISC, "*", "%s", Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY));
                free(my_ptr);
                return 0;
              }

+ 0 - 4
src/users.h

@@ -37,10 +37,6 @@ struct user_entry_type {
   int (*kill) (struct user_entry *);
   void *(*get) (struct userrec *, struct user_entry *);
   int (*set) (struct userrec *, struct user_entry *, void *);
-  int (*tcl_get) (Tcl_Interp *, struct userrec *, struct user_entry *,
-		  int, char **);
-  int (*tcl_set) (Tcl_Interp *, struct userrec *, struct user_entry *,
-		  int, char **);
   void (*display) (int idx, struct user_entry *, struct userrec *);
   char *name;
 };