[cvslog] Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Thu Oct 18 04:07:00 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2001-10-18 09:06:54 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Modified files:
     src/Makefile.am src/chanprog.c src/eggdrop.h src/main.c
     src/misc.c src/proto.h src/script.c src/script_api.h src/tcl.c
     src/tclmisc.c src/egglib/msprintf.c
     src/mod/tclscript.mod/tclscript.c

Added files:
     src/logfile.c

Log message:

Fixed a bug in msprintf.
Added SCRIPT_FREE_VAR flag, to automatically free a script_var_t.
Added first config variables (for logging) via tclscript.mod.
Separated the logging stuff into logfile.c.
Added a command, "stoplog", which lets you close a logfile.
Removed "max-logs" since the logfiles are in a linked list (it was kind of pointless).

---------------------- diff included ----------------------
Index: eggdrop1.7/src/Makefile.am
diff -u eggdrop1.7/src/Makefile.am:1.10 eggdrop1.7/src/Makefile.am:1.11
--- eggdrop1.7/src/Makefile.am:1.10	Sun Oct 14 18:13:33 2001
+++ eggdrop1.7/src/Makefile.am	Thu Oct 18 04:06:43 2001
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.10 2001/10/14 23:13:33 stdarg Exp $
+# $Id: Makefile.am,v 1.11 2001/10/18 09:06:43 stdarg Exp $
 
 # FIXME: optionally allow a system wide install by ignoring the line below.
 bindir    = $(exec_prefix)
@@ -42,6 +42,7 @@
 		flags.h \
 		irccmp.c \
 		irccmp.h \
+		logfile.c \
 		main.c \
 		main.h \
 		match.c \
Index: eggdrop1.7/src/chanprog.c
diff -u eggdrop1.7/src/chanprog.c:1.33 eggdrop1.7/src/chanprog.c:1.34
--- eggdrop1.7/src/chanprog.c:1.33	Tue Oct 16 22:28:16 2001
+++ eggdrop1.7/src/chanprog.c	Thu Oct 18 04:06:43 2001
@@ -5,7 +5,7 @@
  *   telling the current programmed settings
  *   initializing a lot of stuff and loading the tcl scripts
  *
- * $Id: chanprog.c,v 1.33 2001/10/17 03:28:16 stdarg Exp $
+ * $Id: chanprog.c,v 1.34 2001/10/18 09:06:43 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -39,14 +39,13 @@
 #include "modules.h"
 
 extern struct userrec	*userlist;
-extern log_t		*logs;
 extern Tcl_Interp	*interp;
 extern char		 ver[], botnetnick[], firewall[],
 			 motdfile[], userfile[], helpdir[], tempdir[],
 			 moddir[], notify_new[], owner[], configfile[];
 extern time_t		 now, online_since;
 extern int		 backgrd, term_z, con_chan, cache_hit, cache_miss,
-			 firewallport, default_flags, max_logs, conmask,
+			 firewallport, default_flags, conmask,
 			 protect_readonly, make_userfile, noshare,
 			 ignore_time;
 
@@ -325,12 +324,6 @@
 	  _("notify"), notify_new);
   if (owner[0])
     dprintf(idx, "%s: %s\n", _("Permanent owner(s)"), owner);
-  for (i = 0; i < max_logs; i++)
-    if (logs[i].filename != NULL) {
-      dprintf(idx, "Logfile #%d: %s on %s (%s: %s)\n", i + 1,
-	      logs[i].filename, logs[i].chname,
-	      masktype(logs[i].mask), maskname(logs[i].mask));
-    }
   dprintf(idx, "Ignores last %d mins\n", ignore_time);
 }
 
@@ -367,28 +360,12 @@
   admin[0] = 0;
   helpdir[0] = 0;
   tempdir[0] = 0;
-  for (i = 0; i < max_logs; i++)
-    logs[i].flags |= LF_EXPIRING;
   conmask = 0;
   /* Turn off read-only variables (make them write-able) for rehash */
   protect_readonly = 0;
   /* Now read it */
   if (!readtclprog(configfile))
     fatal(_("CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)"), 0);
-  for (i = 0; i < max_logs; i++) {
-    if (logs[i].flags & LF_EXPIRING) {
-      if (logs[i].filename != NULL)
-        free_null(logs[i].filename);
-      if (logs[i].chname != NULL)
-        free_null(logs[i].chname);
-      if (logs[i].f != NULL) {
-        fclose(logs[i].f);
-        logs[i].f = NULL;
-      }
-      logs[i].mask = 0;
-      logs[i].flags = 0;
-    }
-  }
   /* We should be safe now */
   call_hook(HOOK_REHASH);
   protect_readonly = 1;
Index: eggdrop1.7/src/eggdrop.h
diff -u eggdrop1.7/src/eggdrop.h:1.46 eggdrop1.7/src/eggdrop.h:1.47
--- eggdrop1.7/src/eggdrop.h:1.46	Fri Oct 12 10:50:26 2001
+++ eggdrop1.7/src/eggdrop.h	Thu Oct 18 04:06:43 2001
@@ -4,7 +4,7 @@
  *
  *   IF YOU ALTER THIS FILE, YOU NEED TO RECOMPILE THE BOT.
  *
- * $Id: eggdrop.h,v 1.46 2001/10/12 15:50:26 tothwolf Exp $
+ * $Id: eggdrop.h,v 1.47 2001/10/18 09:06:43 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -442,18 +442,6 @@
 #define STDOUT     1
 #define STDERR     2
 
-/* Structure for internal logs */
-typedef struct {
-  char *filename;
-  unsigned int mask;		/* what to send to this log		    */
-  char *chname;			/* which channel			    */
-  char szlast[LOGLINELEN];	/* for 'Last message repeated n times'
-				   stuff in misc.c/putlog() <cybah>	    */
-  int repeats;			/* number of times szLast has been repeated */
-  unsigned int flags;		/* other flags <rtc>			    */
-  FILE *f;			/* existing file			    */
-} log_t;
-
 /* Logfile display flags
  */
 #define LOG_MSGS     0x000001	/* m   msgs/notice/ctcps		*/
@@ -480,10 +468,6 @@
 #define LOG_BOTNET   0x200000	/* t   botnet traffic			*/
 #define LOG_BOTSHARE 0x400000	/* h   share traffic			*/
 #define LOG_ALL      0x7fffff	/* (dump to all logfiles)		*/
-
-/* Internal logfile flags
- */
-#define LF_EXPIRING 0x000001	/* Logfile will be closed soon		*/
 
 #define FILEDB_HIDE     1
 #define FILEDB_UNHIDE   2
Index: eggdrop1.7/src/egglib/msprintf.c
diff -u eggdrop1.7/src/egglib/msprintf.c:1.1 eggdrop1.7/src/egglib/msprintf.c:1.2
--- eggdrop1.7/src/egglib/msprintf.c:1.1	Sat Oct 13 23:44:37 2001
+++ eggdrop1.7/src/egglib/msprintf.c	Thu Oct 18 04:06:44 2001
@@ -3,16 +3,20 @@
 
 char *msprintf(char *format, ...)
 {
-	va_list args;
 	char *output;
 	int n, len;
+	va_list args;
 
-	va_start(args, format);
 	output = (char *)malloc(128);
-	len = 127;
-	while ((n = vsnprintf(output, len, format, args)) < 0 || n >= len) {
-		len *= 2;
-		output = (char *)realloc(output, len+1);
+	len = 128;
+	while (1) {
+		va_start(args, format);
+		n = vsnprintf(output, len, format, args);
+		va_end(args);
+		if (n > -1 && n < len) return(output);
+		if (n > len) len = n+1;
+		else len *= 2;
+		output = (char *)realloc(output, len);
 	}
 	return(output);
 }
Index: eggdrop1.7/src/logfile.c
diff -u /dev/null eggdrop1.7/src/logfile.c:1.1
--- /dev/null	Thu Oct 18 04:06:54 2001
+++ eggdrop1.7/src/logfile.c	Thu Oct 18 04:06:43 2001
@@ -0,0 +1,332 @@
+#include "main.h"
+#include "mod/modvals.h"
+#include "egglib/msprintf.h"
+#include "script_api.h"
+#include "script.h"
+
+typedef struct log_b {
+	struct log_b *next;
+	char *filename;
+	int mask;
+	char *chname;
+	char *last_msg;
+	int repeats;
+	int flags;
+	FILE *fp;
+} log_t;
+
+extern int use_stderr; /* From main.c, while we're starting eggdrop. */
+extern int term_z;
+extern int backgrd;
+extern int con_chan;
+
+extern int dcc_total;
+extern struct dcc_t *dcc;
+
+static int timestamp_logs = 1; /* Add timestamp to log entries? */
+static int cycle_at = 300; /* Military time where we cycle logfiles. */
+static int keep_all_logs = 0; /* Keep all logs? */
+static int max_logsize = 0; /* Max log size in kilobytes. */
+static int quick_logs = 0; /* Check size more often? */
+static char *logfile_suffix = NULL; /* Suffix for old logfiles. */
+
+static log_t *log_list_head = NULL; /* Linked list of logfiles. */
+
+void logfile_init();
+static int logfile_minutely();
+static int logfile_5minutely();
+static int logfile_cycle();
+char *logfile_add(char *modes, char *chan, char *fname);
+int logfile_del(char *filename);
+int putlog EGG_VARARGS_DEF(int, arg1);
+static void check_logsizes();
+static void flushlog(log_t *log, char *timestamp);
+void flushlogs();
+
+/* Functions for accessing the logfiles via scripts. */
+static int script_putlog(void *cdata, char *text);
+static int script_putloglev(char *level, char *chan, char *text);
+
+static script_command_t log_script_cmds[] = {
+	{"", "putlog", script_putlog, (void *)LOG_MISC, 1, 0, "s", "text", SCRIPT_INTEGER, SCRIPT_WANTS_CD},
+	{"", "putcmdlog", script_putlog, (void *)LOG_CMDS, 1, 0, "s", "text", SCRIPT_INTEGER, SCRIPT_WANTS_CD},
+	{"", "putxferlog", script_putlog, (void *)LOG_FILES, 1, 0, "s", "text", SCRIPT_INTEGER, SCRIPT_WANTS_CD},
+	{"", "putloglev", script_putloglev, NULL, 3, 0, "sss", "level channel text", SCRIPT_INTEGER, 0},
+	{"", "logfile", (Function) logfile_add, NULL, 3, 0, "sss", "modes channel filename", SCRIPT_STRING, 0},
+	{"", "stoplog", logfile_del, NULL, 1, 0, "s", "filename", SCRIPT_INTEGER, 0},
+	0
+};
+
+static script_str_t log_script_strings[] = {
+	{"", "logfile-suffix", &logfile_suffix},
+	0
+};
+
+static script_int_t log_script_ints[] = {
+	{"", "log-time", &timestamp_logs},
+	{"", "max-logsize", &max_logsize},
+	{"", "switch-logfiles-at", &cycle_at},
+	{"", "keep-all-logs", &keep_all_logs},
+	{"", "quick-logs", &quick_logs},
+	0
+};
+
+void logfile_init()
+{
+	malloc_strcpy(logfile_suffix, ".%d%b%Y");
+	script_create_cmd_table(log_script_cmds);
+	script_link_int_table(log_script_ints);
+	script_link_str_table(log_script_strings);
+	add_hook(HOOK_MINUTELY, logfile_minutely);
+	add_hook(HOOK_5MINUTELY, logfile_5minutely);
+}
+
+static int get_timestamp(char *t)
+{
+	time_t now;
+
+	now = time(NULL);
+	/* Calculate timestamp. */
+	if (timestamp_logs) egg_strftime(t, 32, "[%H:%M] ", localtime(&now));
+	else *t = 0;
+}
+
+static int logfile_minutely()
+{
+	time_t now;
+	struct tm *nowtm;
+	int miltime;
+
+	now = time(NULL);
+	
+	if (quick_logs) {
+		flushlogs();
+		check_logsizes();
+	}
+
+	now = time(NULL);
+	nowtm = localtime(&now);
+	miltime = 100 * nowtm->tm_hour + nowtm->tm_min;
+
+	if (miltime == cycle_at) logfile_cycle();
+
+	return(0);
+}
+
+static int logfile_5minutely()
+{
+	if (!quick_logs) {
+		flushlogs();
+		check_logsizes();
+	}
+	return(0);
+}
+
+static int logfile_cycle()
+{
+	log_t *log;
+	char suffix[32];
+	char *newfname;
+
+	putlog(LOG_MISC, "*", _("Cycling logfiles"));
+	flushlogs();
+
+	/* Determine suffix for cycled logfiles. */
+	if (keep_all_logs) {
+		time_t now;
+
+		now = time(NULL);
+		egg_strftime(suffix, 32, logfile_suffix, localtime(&now));
+	}
+
+	for (log = log_list_head; log; log = log->next) {
+		fclose(log->fp);
+
+		if (keep_all_logs) newfname = msprintf("%s%s", log->filename, suffix);
+		else newfname = msprintf("%s.yesterday", log->filename);
+
+		unlink(newfname);
+		movefile(log->filename, newfname);
+		free(newfname);
+	}
+	return(0);
+}
+
+static int script_putlog(void *cdata, char *text)
+{
+	return putlog((int) cdata, "*", "%s", text);
+}
+
+static int script_putloglev(char *level, char *chan, char *text)
+{
+	int lev = 0;
+
+	lev = logmodes(level);
+	if (!lev) return(-1);
+	return putlog(lev, chan, "%s", text);
+}
+
+char *logfile_add(char *modes, char *chan, char *fname)
+{
+	FILE *fp;
+	log_t *log;
+
+	/* Get rid of any duplicates. */
+	logfile_del(fname);
+
+	/* Test the filename. */
+	fp = fopen(fname, "a");
+	if (!fp) return("");
+
+	log = (log_t *)calloc(1, sizeof(*log));
+	malloc_strcpy(log->filename, fname);
+	malloc_strcpy(log->chname, chan);
+	malloc_strcpy(log->last_msg, "");
+	log->mask = logmodes(modes);
+	log->fp = fp;
+
+	log->next = log_list_head;
+	log_list_head = log;
+
+	return(log->filename);
+}
+
+int logfile_del(char *filename)
+{
+	log_t *log, *prev;
+	char timestamp[32];
+
+	prev = NULL;
+	for (log = log_list_head; log; log = log->next) {
+		if (!strcmp(log->filename, filename)) break;
+		prev = log;
+	}
+	if (!log) return(1);
+	if (prev) prev->next = log->next;
+	else log_list_head = log->next;
+	get_timestamp(timestamp);
+	flushlog(log, timestamp);
+	fclose(log->fp);
+	free(log->last_msg);
+	free(log->filename);
+	free(log);
+	return(0);
+}
+
+/* Log something
+ * putlog(level,channel_name,format,...);
+ */
+int putlog EGG_VARARGS_DEF(int, arg1)
+{
+  int i, type, len;
+  log_t *log;
+  char *format, *chname, *out;
+  char timestamp[32];
+  va_list va;
+
+
+	len = 128;
+	out = (char *)malloc(len);
+	while (1) {
+		type = EGG_VARARGS_START(int, arg1, va);
+		chname = va_arg(va, char *);
+		format = va_arg(va, char *);
+		i = vsnprintf(out, len, format, va);
+		if (i > -1 && i < len) break;
+		if (i > len) i = len+1;
+		else len *= 2;
+		out = (char *)realloc(out, len);
+	}
+	len = i;
+
+  va_end(va);
+
+	get_timestamp(timestamp);
+	for (log = log_list_head; log; log = log->next) {
+		/* If this log doesn't match, skip it. */
+		if (!(log->mask & type)) continue;
+		if (chname[0] != '*' && log->chname[0] != '*' && irccmp(chname, log->chname)) continue;
+
+		/* If it's a repeat message, don't write it again. */
+		if (!egg_strcasecmp(out, log->last_msg)) {
+			log->repeats++;
+			continue;
+		}
+
+		/* If there was a repeated message, write the count. */
+		if (log->repeats) {
+			fprintf(log->fp, "%s", timestamp);
+			fprintf(log->fp, _("Last message repeated %d time(s).\n"), log->repeats);
+			log->repeats = 0;
+		}
+
+		/* Save this msg to check for repeats next time. */
+		realloc_strcpy(log->last_msg, out);
+
+		/* Now output to the file. */
+		fprintf(log->fp, "%s%s\n", timestamp, out);
+	}
+
+  for (i = 0; i < dcc_total; i++)
+    if ((dcc[i].type == &DCC_CHAT) && (dcc[i].u.chat->con_flags & type)) {
+      if ((chname[0] == '*') || (dcc[i].u.chat->con_chan[0] == '*') ||
+	  (!irccmp(chname, dcc[i].u.chat->con_chan)))
+	dprintf(i, "%s%s\n", timestamp, out);
+    }
+  if ((!backgrd) && (!con_chan) && (!term_z))
+    dprintf(DP_STDOUT, "%s%s\n", timestamp, out);
+  else if ((type & LOG_MISC) && use_stderr) {
+    dprintf(DP_STDERR, "%s%s\n", timestamp, out);
+  }
+
+  free(out);
+  return(len);
+}
+
+static void check_logsizes()
+{
+	int size;
+	char *newfname;
+	log_t *log;
+
+	if (keep_all_logs || max_logsize <= 0) return;
+
+	for (log = log_list_head; log; log = log->next) {
+		size = ftell(log->fp) / 1024; /* Size in kilobytes. */
+		if (size < max_logsize) continue;
+
+		/* It's too big. */
+		putlog(LOG_MISC, "*", _("Cycling logfile %s, over max-logsize (%d kilobytes)"), log->filename, size);
+		fflush(log->fp);
+		fclose(log->fp);
+
+		newfname = msprintf("%s.yesterday", log->filename);
+		unlink(newfname);
+		movefile(log->filename, newfname);
+		free(newfname);
+	}
+}
+
+static void flushlog(log_t *log, char *timestamp)
+{
+	if (log->repeats) {
+		fprintf(log->fp, "%s", timestamp);
+		fprintf(log->fp, _("Last message repeated %d time(s).\n"), log->repeats);
+		log->repeats = 0;
+		realloc_strcpy(log->last_msg, "");
+	}
+	fflush(log->fp);
+}
+
+/* Flush the logfiles to disk
+ */
+void flushlogs()
+{
+	char timestamp[32];
+	log_t *log;
+
+	get_timestamp(timestamp);
+	for (log = log_list_head; log; log = log->next) {
+		flushlog(log, timestamp);
+	}
+}
Index: eggdrop1.7/src/main.c
diff -u eggdrop1.7/src/main.c:1.89 eggdrop1.7/src/main.c:1.90
--- eggdrop1.7/src/main.c:1.89	Wed Oct 17 01:08:11 2001
+++ eggdrop1.7/src/main.c	Thu Oct 18 04:06:43 2001
@@ -5,7 +5,7 @@
  *   command line arguments
  *   context and assert debugging
  *
- * $Id: main.c,v 1.89 2001/10/17 06:08:11 stdarg Exp $
+ * $Id: main.c,v 1.90 2001/10/18 09:06:43 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -73,7 +73,6 @@
 extern struct dcc_t	*dcc;
 extern struct userrec	*userlist;
 extern struct chanset_t	*chanset;
-extern log_t		*logs;
 extern Tcl_Interp	*interp;
 extern tcl_timer_t	*timer,
 			*utimer;
@@ -103,9 +102,6 @@
 char	configfile[121] = "eggdrop.conf"; /* Name of the config file */
 char	helpdir[121];		/* Directory of help files (if used) */
 char	textdir[121] = "";	/* Directory for text files that get dumped */
-int	keep_all_logs = 0;	/* Never erase logfiles, no matter how old
-				   they are? */
-char	logfile_suffix[21] = ".%d%b%Y"; /* Format of logfile suffix. */
 time_t	online_since;		/* Unix-time that the bot loaded up */
 int	make_userfile = 0;	/* Using bot in make-userfile mode? (first
 				   user to 'hello' becomes master) */
@@ -116,7 +112,6 @@
 				   save the userfile? */
 int	notify_users_at = 0;	/* How many minutes past the hour to
 				   notify users of notes? */
-int	switch_logfiles_at = 300; /* When (military time) to switch logfiles */
 char	version[81];		/* Version info (long form) */
 char	ver[41];		/* Version info (short form) */
 char	egg_xtra[2048];		/* Patch info */
@@ -522,10 +517,6 @@
     miltime = (nowtm.tm_hour * 100) + (nowtm.tm_min);
     if (((int) (nowtm.tm_min / 5) * 5) == (nowtm.tm_min)) {	/* 5 min */
       call_hook(HOOK_5MINUTELY);
-      if (!quick_logs) {
-	flushlogs();
-	check_logsize();
-      }
       if (!miltime) {	/* At midnight */
 	char s[25];
 	int j;
@@ -533,47 +524,17 @@
 	strncpyz(s, ctime(&now), sizeof s);
 	putlog(LOG_ALL, "*", "--- %.11s%s", s, s + 20);
 	call_hook(HOOK_BACKUP);
-	for (j = 0; j < max_logs; j++) {
-	  if (logs[j].filename != NULL && logs[j].f != NULL) {
-	    fclose(logs[j].f);
-	    logs[j].f = NULL;
-	  }
-	}
+	call_hook(HOOK_DAILY);
       }
     }
     if (nowtm.tm_min == notify_users_at)
       call_hook(HOOK_HOURLY);
-    /* These no longer need checking since they are all check vs minutely
-     * settings and we only get this far on the minute.
-     */
-    if (miltime == switch_logfiles_at) {
-      call_hook(HOOK_DAILY);
-      if (!keep_all_logs) {
-	putlog(LOG_MISC, "*", _("Switching logfiles..."));
-	for (i = 0; i < max_logs; i++)
-	  if (logs[i].filename) {
-	    char s[1024];
-
-	    if (logs[i].f) {
-	      fclose(logs[i].f);
-	      logs[i].f = NULL;
-	    }
-	    egg_snprintf(s, sizeof s, "%s.yesterday", logs[i].filename);
-	    unlink(s);
-	    movefile(logs[i].filename, s);
-	  }
-      }
-    }
   }
 }
 
 static void core_minutely()
 {
   check_bind_time(&nowtm);
-  if (quick_logs != 0) {
-    flushlogs();
-    check_logsize();
-  }
 }
 
 static void core_hourly()
@@ -632,6 +593,7 @@
 int init_dcc_max(), init_userent(), init_misc(), init_net(),
  init_modules(), init_tcl(int, char **);
 void timer_init();
+void logfile_init();
 void botnet_init();
 void dns_init();
 void script_init();
@@ -752,6 +714,7 @@
     fatal(_("ERROR: Eggdrop will not run as root!"), 0);
 
   script_init();
+  logfile_init();
   timer_init();
   dns_init();
   binds_init();
Index: eggdrop1.7/src/misc.c
diff -u eggdrop1.7/src/misc.c:1.49 eggdrop1.7/src/misc.c:1.50
--- eggdrop1.7/src/misc.c:1.49	Sat Oct 13 10:55:33 2001
+++ eggdrop1.7/src/misc.c	Thu Oct 18 04:06:43 2001
@@ -1,13 +1,12 @@
 /*
  * misc.c -- handles:
  *   split() maskhost() dumplots() daysago() days() daysdur()
- *   logging things
  *   queueing output for the bot (msg and help)
  *   resync buffers for sharebots
  *   help system
  *   motd display and %var substitution
  *
- * $Id: misc.c,v 1.49 2001/10/13 15:55:33 tothwolf Exp $
+ * $Id: misc.c,v 1.50 2001/10/18 09:06:43 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -44,18 +43,13 @@
 extern struct chanset_t	*chanset;
 extern char		 helpdir[], version[], origbotname[], botname[],
 			 admin[], motdfile[], ver[], botnetnick[],
-			 bannerfile[], logfile_suffix[], textdir[];
+			 bannerfile[], textdir[];
 extern int		 backgrd, con_chan, term_z, use_stderr, dcc_total,
-			 keep_all_logs, quick_logs, strict_host;
+			 strict_host;
 extern time_t		 now;
 extern Tcl_Interp	*interp;
 
 
-int	 shtime = 1;		/* Whether or not to display the time
-				   with console output */
-log_t	*logs = 0;		/* Logfiles */
-int	 max_logs = 5;		/* Current maximum log files */
-int	 max_logsize = 0;	/* Maximum logfile size, 0 for no limit */
 int	 conmask = LOG_MODES | LOG_CMDS | LOG_MISC; /* Console mask */
 int	 debug_output = 0;	/* Disply output to server to LOG_SERVEROUT */
 
@@ -75,23 +69,6 @@
 void init_misc()
 {
   static int last = 0;
-
-  if (max_logs < 1)
-    max_logs = 1;
-  if (logs)
-    logs = realloc(logs, max_logs * sizeof(log_t));
-  else
-    logs = malloc(max_logs * sizeof(log_t));
-  for (; last < max_logs; last++) {
-    logs[last].filename = logs[last].chname = NULL;
-    logs[last].mask = 0;
-    logs[last].f = NULL;
-    /* Added by cybah  */
-    logs[last].szlast[0] = 0;
-    logs[last].repeats = 0;
-    /* Added by rtc  */
-    logs[last].flags = 0;
-  }
 }
 
 
@@ -472,211 +449,6 @@
   mins = (int) ((now - (hrs * 3600)) / 60);
   sprintf(s, "%02d:%02d", hrs, mins);
   strcat(out, s);
-}
-
-
-/*
- *    Logging functions
- */
-
-/* Log something
- * putlog(level,channel_name,format,...);
- */
-void putlog EGG_VARARGS_DEF(int, arg1)
-{
-  int i, type;
-  char *format, *chname, s[LOGLINELEN], s1[256], *out;
-  time_t tt;
-  char ct[81], *s2;
-  struct tm *t = localtime(&now);
-  va_list va;
-
-  type = EGG_VARARGS_START(int, arg1, va);
-  chname = va_arg(va, char *);
-  format = va_arg(va, char *);
-
-  /* Format log entry at offset 8, then i can prepend the timestamp */
-  out = &s[8];
-  /* No need to check if out should be null-terminated here,
-   * just do it! <cybah>
-   */
-  egg_vsnprintf(out, LOGLINEMAX - 8, format, va);
-  out[LOGLINEMAX - 8] = 0;
-  tt = now;
-  if (keep_all_logs) {
-    if (!logfile_suffix[0])
-      egg_strftime(ct, 12, ".%d%b%Y", localtime(&tt));
-    else {
-      egg_strftime(ct, 80, logfile_suffix, localtime(&tt));
-      ct[80] = 0;
-      s2 = ct;
-      /* replace spaces by underscores */
-      while (s2[0]) {
-	if (s2[0] == ' ')
-	  s2[0] = '_';
-	s2++;
-      }
-    }
-  }
-  if ((out[0]) && (shtime)) {
-    egg_strftime(s1, 9, "[%H:%M] ", localtime(&tt));
-    strncpy(&s[0], s1, 8);
-    out = s;
-  }
-  strcat(out, "\n");
-  if (!use_stderr) {
-    for (i = 0; i < max_logs; i++) {
-      if ((logs[i].filename != NULL) && (logs[i].mask & type) &&
-	  ((chname[0] == '*') || (logs[i].chname[0] == '*') ||
-	   (!irccmp(chname, logs[i].chname)))) {
-	if (logs[i].f == NULL) {
-	  /* Open this logfile */
-	  if (keep_all_logs) {
-	    egg_snprintf(s1, 256, "%s%s", logs[i].filename, ct);
-	    logs[i].f = fopen(s1, "a+");
-	  } else
-	    logs[i].f = fopen(logs[i].filename, "a+");
-	}
-	if (logs[i].f != NULL) {
-	  /* Check if this is the same as the last line added to
-	   * the log. <cybah>
-	   */
-	  if (!egg_strcasecmp(out + 8, logs[i].szlast)) {
-	    /* It is a repeat, so increment repeats */
-	    logs[i].repeats++;
-	  } else {
-	    /* Not a repeat, check if there were any repeat
-	     * lines previously...
-	     */
-	    if (logs[i].repeats > 0) {
-	      /* Yep.. so display 'last message repeated x times'
-	       * then reset repeats. We want the current time here,
-	       * so put that in the file first.
-	       */
-	      if (t) {
-		fprintf(logs[i].f, "[%2.2d:%2.2d] ", t->tm_hour, t->tm_min);
-		fprintf(logs[i].f, _("Last message repeated %d time(s).\n"), logs[i].repeats);
-	      } else {
-		fprintf(logs[i].f, "[??:??] ");
-		fprintf(logs[i].f, _("Last message repeated %d time(s).\n"), logs[i].repeats);
-	      }
-	      logs[i].repeats = 0;
-	      /* No need to reset logs[i].szlast here
-	       * because we update it later on...
-	       */
-	    }
-	    fputs(out, logs[i].f);
-	    strncpyz(logs[i].szlast, out + 8, LOGLINEMAX);
-	  }
-	}
-      }
-    }
-  }
-  for (i = 0; i < dcc_total; i++)
-    if ((dcc[i].type == &DCC_CHAT) && (dcc[i].u.chat->con_flags & type)) {
-      if ((chname[0] == '*') || (dcc[i].u.chat->con_chan[0] == '*') ||
-	  (!irccmp(chname, dcc[i].u.chat->con_chan)))
-	dprintf(i, "%s", out);
-    }
-  if ((!backgrd) && (!con_chan) && (!term_z))
-    dprintf(DP_STDOUT, "%s", out);
-  else if ((type & LOG_MISC) && use_stderr) {
-    if (shtime)
-      out += 8;
-    dprintf(DP_STDERR, "%s", s);
-  }
-  va_end(va);
-}
-
-/* Called as soon as the logfile suffix changes. All logs are closed
- * and the new suffix is stored in `logfile_suffix'.
- */
-void logsuffix_change(char *s)
-{
-  int	 i;
-  char	*s2 = logfile_suffix;
-
-  debug0("Logfile suffix changed. Closing all open logs.");
-  strcpy(logfile_suffix, s);
-  while (s2[0]) {
-    if (s2[0] == ' ')
-      s2[0] = '_';
-    s2++;
-  }
-  for (i = 0; i < max_logs; i++) {
-    if (logs[i].f) {
-      fflush(logs[i].f);
-      fclose(logs[i].f);
-      logs[i].f = NULL;
-    }
-  }
-}
-
-void check_logsize()
-{
-  struct stat ss;
-  int i;
-/* int x=1; */
-  char buf[1024];		/* Should be plenty */
-
-  if (!keep_all_logs && max_logsize > 0) {
-    for (i = 0; i < max_logs; i++) {
-      if (logs[i].filename) {
-	if (stat(logs[i].filename, &ss) != 0) {
-	  break;
-	}
-	if ((ss.st_size >> 10) > max_logsize) {
-	  if (logs[i].f) {
-	    /* write to the log before closing it huh.. */
-	    putlog(LOG_MISC, "*", _("Cycling logfile %s, over max-logsize (%d)"), logs[i].filename, ss.st_size);
-	    fflush(logs[i].f);
-	    fclose(logs[i].f);
-	    logs[i].f = NULL;
-	  }
-
-	  egg_snprintf(buf, sizeof buf, "%s.yesterday", logs[i].filename);
-	  buf[1023] = 0;
-	  unlink(buf);
-	  movefile(logs[i].filename, buf);
-	}
-      }
-    }
-  }
-}
-
-/* Flush the logfiles to disk
- */
-void flushlogs()
-{
-  int i;
-  struct tm *t = localtime(&now);
-
-  /* Logs may not be initialised yet. */
-  if (!logs)
-    return;
-
-  /* Now also checks to see if there's a repeat message and
-   * displays the 'last message repeated...' stuff too <cybah>
-   */
-  for (i = 0; i < max_logs; i++) {
-    if (logs[i].f != NULL) {
-       if ((logs[i].repeats > 0) && quick_logs) {
-         /* Repeat.. if quicklogs used then display 'last message
-          * repeated x times' and reset repeats.
-	  */
-	if (t) {
-	  fprintf(logs[i].f, "[%2.2d:%2.2d] ", t->tm_hour, t->tm_min);
-	  fprintf(logs[i].f, _("Last message repeated %d time(s).\n"), logs[i].repeats);
-	} else {
-	  fprintf(logs[i].f, "[??:??] ");
-	  fprintf(logs[i].f, _("Last message repeated %d time(s).\n"), logs[i].repeats);
-	}
-	/* Reset repeats */
-	logs[i].repeats = 0;
-      }
-      fflush(logs[i].f);
-    }
-  }
 }
 
 
Index: eggdrop1.7/src/mod/tclscript.mod/tclscript.c
diff -u eggdrop1.7/src/mod/tclscript.mod/tclscript.c:1.8 eggdrop1.7/src/mod/tclscript.mod/tclscript.c:1.9
--- eggdrop1.7/src/mod/tclscript.mod/tclscript.c:1.8	Wed Oct 17 01:08:12 2001
+++ eggdrop1.7/src/mod/tclscript.mod/tclscript.c	Thu Oct 18 04:06:44 2001
@@ -24,7 +24,7 @@
 } my_callback_cd_t;
 
 static int my_command_handler(ClientData client_data, Tcl_Interp *myinterp, int objc, Tcl_Obj *CONST objv[]);
-static Tcl_Obj *my_resolve_one_var(Tcl_Interp *myinterp, script_var_t *v);
+static Tcl_Obj *my_resolve_var(Tcl_Interp *myinterp, script_var_t *v);
 
 static Tcl_Interp *ginterp; /* Our global interpreter. */
 static char *my_syntax_error = "syntax error";
@@ -77,7 +77,8 @@
 	char *newname;
 
 	if (flags & SCRIPT_READ_ONLY) f |= TCL_LINK_READ_ONLY;
-	newname = msprintf("%s(%s)", i->class, i->name);
+	if (i->class && strlen(i->class)) newname = msprintf("%s(%s)", i->class, i->name);
+	else newname = msprintf("%s", i->name);
 	Tcl_LinkVar(interp, newname, (char *)i->ptr, f);
 	free(newname);
 	return(0);
@@ -89,7 +90,8 @@
 	char *newname;
 
 	if (flags & SCRIPT_READ_ONLY) f |= TCL_LINK_READ_ONLY;
-	newname = msprintf("%s(%s)", str->class, str->name);
+	if (str->class && strlen(str->class)) newname = msprintf("%s(%s)", str->class, str->name);
+	else newname = msprintf("%s", str->name);
 	Tcl_LinkVar(interp, newname, (char *)str->ptr, TCL_LINK_STRING);
 	free(newname);
 	return(0);
@@ -100,7 +102,8 @@
 {
 	char *newname;
 
-	newname = msprintf("%s(%s)", str->class, str->name);
+	if (str->class && strlen(str->class)) newname = msprintf("%s(%s)", str->class, str->name);
+	else newname = msprintf("%s", str->name);
 	Tcl_UnlinkVar(interp, newname);
 	free(newname);
 	return(0);
@@ -127,7 +130,7 @@
 		var.type = me->syntax[i];
 		var.value = (void *)al[i];
 		var.len = -1;
-		arg = my_resolve_one_var(cd->myinterp, &var);
+		arg = my_resolve_var(cd->myinterp, &var);
 		Tcl_ListObjAppendElement(cd->myinterp, final_command, arg);
 	}
 
@@ -180,11 +183,43 @@
 	return(0);
 }
 
-static Tcl_Obj *my_resolve_one_var(Tcl_Interp *myinterp, script_var_t *v)
+static Tcl_Obj *my_resolve_var(Tcl_Interp *myinterp, script_var_t *v)
 {
 	Tcl_Obj *result;
 
 	result = NULL;
+	if (v->type & SCRIPT_ARRAY) {
+		Tcl_Obj *element;
+		int i;
+
+		result = Tcl_NewListObj(0, NULL);
+		if ((v->type & SCRIPT_TYPE_MASK) == SCRIPT_VAR) {
+			script_var_t *v_list;
+
+			v_list = (script_var_t *)v->value;
+			for (i = 0; i < v->len; i++) {
+				element = my_resolve_var(myinterp, v_list+i);
+				Tcl_ListObjAppendElement(myinterp, result, element);
+			}
+		}
+		else {
+			script_var_t v_sub;
+			void **values;
+
+			v_sub.type = v->type & (~SCRIPT_ARRAY);
+			v_sub.len = -1;
+			values = (void **)v->value;
+			for (i = 0; i < v->len; i++) {
+				v_sub.value = values[i];
+				element = my_resolve_var(myinterp, &v_sub);
+				Tcl_ListObjAppendElement(myinterp, result, element);
+			}
+		}
+		/* Whew */
+		if (v->type & SCRIPT_FREE) free(v->value);
+		if (v->type & SCRIPT_FREE_VAR) free(v);
+		return(result);
+	}
 	switch (v->type & SCRIPT_TYPE_MASK) {
 		case SCRIPT_INTEGER:
 			result = Tcl_NewIntObj((int) v->value);
@@ -220,6 +255,7 @@
 			/* Default: just pass a string with an error message. */
 			result = Tcl_NewStringObj("unsupported type", -1);
 	}
+	if (v->type & SCRIPT_FREE_VAR) free(v);
 	return(result);
 }
 
@@ -387,7 +423,7 @@
 	}
 
 	my_err = retval.type & SCRIPT_ERROR;
-	tcl_retval = my_resolve_one_var(myinterp, &retval);
+	tcl_retval = my_resolve_var(myinterp, &retval);
 
 	if (tcl_retval) Tcl_SetObjResult(myinterp, tcl_retval);
 
Index: eggdrop1.7/src/proto.h
diff -u eggdrop1.7/src/proto.h:1.57 eggdrop1.7/src/proto.h:1.58
--- eggdrop1.7/src/proto.h:1.57	Wed Oct 17 21:57:51 2001
+++ eggdrop1.7/src/proto.h	Thu Oct 18 04:06:43 2001
@@ -7,7 +7,7 @@
  * because they use structures in those
  * (saves including those .h files EVERY time) - Beldin
  *
- * $Id: proto.h,v 1.57 2001/10/18 02:57:51 stdarg Exp $
+ * $Id: proto.h,v 1.58 2001/10/18 09:06:43 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -170,7 +170,7 @@
 /* misc.c */
 int egg_strcatn(char *dst, const char *src, size_t max);
 int my_strcpy(char *, char *);
-void putlog EGG_VARARGS(int, arg1);
+int putlog EGG_VARARGS(int, arg1);
 void flushlogs();
 void check_logsize();
 void maskhost(const char *, char *);
Index: eggdrop1.7/src/script.c
diff -u eggdrop1.7/src/script.c:1.5 eggdrop1.7/src/script.c:1.6
--- eggdrop1.7/src/script.c:1.5	Mon Oct 15 21:42:32 2001
+++ eggdrop1.7/src/script.c	Thu Oct 18 04:06:43 2001
@@ -31,6 +31,18 @@
 	return(0);
 }
 
+static int my_link_int(void *ignore, script_int_t *i, int flags)
+{
+	add_event(SCRIPT_EVENT_LINK_INT, (int) i, flags, 0);
+	return(0);
+}
+
+static int my_link_str(void *ignore, script_str_t *str, int flags)
+{
+	add_event(SCRIPT_EVENT_LINK_STR, (int) str, flags, 0);
+	return(0);
+}
+
 static int my_playback(void *ignore, Function *table)
 {
 	script_event_t *event;
@@ -54,6 +66,8 @@
 static registry_simple_chain_t my_functions[] = {
 	{"script", NULL, 0},
 	{"create cmd", my_create_cmd, 2},
+	{"link int", my_link_int, 2},
+	{"link str", my_link_str, 2},
 	{"playback", my_playback, 2},
 	0
 };
Index: eggdrop1.7/src/script_api.h
diff -u eggdrop1.7/src/script_api.h:1.5 eggdrop1.7/src/script_api.h:1.6
--- eggdrop1.7/src/script_api.h:1.5	Wed Oct 17 01:08:11 2001
+++ eggdrop1.7/src/script_api.h	Thu Oct 18 04:06:43 2001
@@ -33,8 +33,9 @@
 
 /* Flags for variables. */
 #define SCRIPT_FREE	256
-#define SCRIPT_ARRAY	512
-#define SCRIPT_ERROR	1024
+#define SCRIPT_FREE_VAR	512
+#define SCRIPT_ARRAY	1024
+#define SCRIPT_ERROR	2048
 
 /* Types for variables. */
 #define SCRIPT_STRING	((int)'s')
@@ -43,6 +44,7 @@
 #define SCRIPT_CALLBACK	((int)'c')
 #define SCRIPT_USER	((int)'U')
 #define SCRIPT_BYTES	((int)'b')
+#define SCRIPT_VAR	((int)'v')
 #define SCRIPT_TYPE_MASK	255
 
 typedef struct script_callback_b {
Index: eggdrop1.7/src/tcl.c
diff -u eggdrop1.7/src/tcl.c:1.47 eggdrop1.7/src/tcl.c:1.48
--- eggdrop1.7/src/tcl.c:1.47	Tue Oct 16 22:28:16 2001
+++ eggdrop1.7/src/tcl.c	Thu Oct 18 04:06:43 2001
@@ -4,7 +4,7 @@
  *   Tcl initialization
  *   getting and setting Tcl/eggdrop variables
  *
- * $Id: tcl.c,v 1.47 2001/10/17 03:28:16 stdarg Exp $
+ * $Id: tcl.c,v 1.48 2001/10/18 09:06:43 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -45,24 +45,23 @@
 
 extern time_t	online_since;
 extern int	backgrd, flood_telnet_thr, flood_telnet_time;
-extern int	shtime, share_greet, require_p, keep_all_logs;
+extern int	shtime, share_greet, require_p;
 extern int	allow_new_telnets, stealth_telnets;
-extern int	default_flags, conmask, switch_logfiles_at, connect_timeout;
+extern int	default_flags, conmask, connect_timeout;
 extern int	firewallport, notify_users_at, flood_thr, ignore_time;
 extern int	reserved_port_min, reserved_port_max;
 extern char	origbotname[], botuser[], motdfile[], admin[], userfile[],
 		firewall[], helpdir[], notify_new[], myip[],
 		moddir[], tempdir[], owner[], network[], botnetnick[],
 		bannerfile[], egg_version[], natip[], configfile[],
-		logfile_suffix[], textdir[], myip6[];
-extern int	die_on_sighup, die_on_sigterm, max_logs, max_logsize,
+		textdir[], myip6[];
+extern int	die_on_sighup, die_on_sigterm,
 		enable_simul, dcc_total, debug_output, identtimeout,
 		protect_telnet, dupwait_timeout, egg_numver, share_unlinks,
 		sort_users, tands, resolve_timeout, userfile_perm,
 		default_uflags, strict_host;
 extern struct dcc_t	*dcc;
 extern tcl_timer_t	*timer, *utimer;
-extern log_t		*logs;
 
 int	    protect_readonly = 0;	/* turn on/off readonly protection */
 char	    whois_fields[1025] = "";	/* fields to display in a .whois */
@@ -77,8 +76,6 @@
 int	    must_be_owner = 1;
 int	    max_dcc = 20;		/* needs at least 4 or 5 just to
 					   get started. 20 should be enough   */
-int	    quick_logs = 0;		/* quick write logs? (flush them
-					   every min instead of every 5	      */
 int	    par_telnet_flood = 1;       /* trigger telnet flood for +f
 					   ppl? - dw			      */
 int	    quiet_save = 0;             /* quiet-save patch by Lucas	      */
@@ -87,68 +84,6 @@
 Tcl_Interp *Tcl_CreateInterp();
 
 
-/*
- *      Logging
- */
-
-/* logfile [<modes> <channel> <filename>] */
-static int tcl_logfile STDVAR
-{
-  int i;
-  char s[151];
-
-  BADARGS(1, 4, " ?logModes channel logFile?");
-  if (argc == 1) {
-    /* They just want a list of the logfiles and modes */
-    for (i = 0; i < max_logs; i++)
-      if (logs[i].filename != NULL) {
-	strcpy(s, masktype(logs[i].mask));
-	strcat(s, " ");
-	strcat(s, logs[i].chname);
-	strcat(s, " ");
-	strcat(s, logs[i].filename);
-	Tcl_AppendElement(interp, s);
-      }
-    return TCL_OK;
-  }
-  BADARGS(4, 4, " ?logModes channel logFile?");
-  for (i = 0; i < max_logs; i++)
-    if ((logs[i].filename != NULL) && (!strcmp(logs[i].filename, argv[3]))) {
-      logs[i].flags &= ~LF_EXPIRING;
-      logs[i].mask = logmodes(argv[1]);
-      free_null(logs[i].chname);
-      if (!logs[i].mask) {
-	/* ending logfile */
-	free_null(logs[i].filename);
-	if (logs[i].f != NULL) {
-	  fclose(logs[i].f);
-	  logs[i].f = NULL;
-	}
-        logs[i].flags = 0;
-      } else
-	malloc_strcpy(logs[i].chname, argv[2]);
-      Tcl_AppendResult(interp, argv[3], NULL);
-      return TCL_OK;
-    }
-  /* Do not add logfiles without any flags to log ++rtc */
-  if (!logmodes (argv [1])) {
-    Tcl_AppendResult (interp, "can't remove \"", argv[3],
-                     "\" from list: no such logfile", NULL);
-    return TCL_ERROR;
-  }
-  for (i = 0; i < max_logs; i++)
-    if (logs[i].filename == NULL) {
-      logs[i].flags = 0;
-      logs[i].mask = logmodes(argv[1]);
-      malloc_strcpy(logs[i].filename, argv[3]);
-      malloc_strcpy(logs[i].chname, argv[2]);
-      Tcl_AppendResult(interp, argv[3], NULL);
-      return TCL_OK;
-    }
-  Tcl_AppendResult(interp, "reached max # of logfiles", NULL);
-  return TCL_ERROR;
-}
-
 int findidx(int z)
 {
   int j;
@@ -275,11 +210,6 @@
 	    return "you can't DECREASE max-dcc";
 	  max_dcc = l;
 	  init_dcc_max();
-	} else if ((int *) ii->var == &max_logs) {
-	  if (l < max_logs)
-	    return "you can't DECREASE max-logs";
-	  max_logs = l;
-	  init_misc();
 	} else
 	  *(ii->var) = (int) l;
       }
@@ -322,8 +252,6 @@
 	s[abs(st->max)] = 0;
       if (st->str == botnetnick)
 	botnet_change(s);
-      else if (st->str == logfile_suffix)
-	logsuffix_change(s);
       else if (st->str == firewall) {
 	splitc(firewall, s, ':');
 	if (!firewall[0])
@@ -395,7 +323,6 @@
 /* confvar patch by aaronwl */
   {"config",		configfile,	0,		0},
   {"telnet-banner",	bannerfile,	120,		STR_PROTECT},
-  {"logfile-suffix",	logfile_suffix,	20,		0},
   {NULL,		NULL,		0,		0}
 };
 
@@ -405,12 +332,10 @@
   {"ignore-time",		&ignore_time,		0},
   {"dcc-flood-thr",		&dcc_flood_thr,		0},
   {"hourly-updates",		&notify_users_at,	0},
-  {"switch-logfiles-at",	&switch_logfiles_at,	0},
   {"connect-timeout",		&connect_timeout,	0},
   {"reserved-port",		&reserved_port_min,		0},
   /* booleans (really just ints) */
   {"require-p",			&require_p,		0},
-  {"keep-all-logs",		&keep_all_logs,		0},
   {"open-telnets",		&allow_new_telnets,	0},
   {"stealth-telnets",		&stealth_telnets,	0},
   {"uptime",			(int *) &online_since,	2},
@@ -422,16 +347,12 @@
   {"die-on-sigterm",		&die_on_sigterm,	1},
   {"remote-boots",		&remote_boots,		1},
   {"max-dcc",			&max_dcc,		0},
-  {"max-logs",			&max_logs,		0},
-  {"max-logsize",		&max_logsize,		0},
-  {"quick-logs",		&quick_logs,		0},
   {"enable-simul",		&enable_simul,		1},
   {"debug-output",		&debug_output,		1},
   {"protect-telnet",		&protect_telnet,	0},
   {"sort-users",		&sort_users,		0},
   {"ident-timeout",		&identtimeout,		0},
   {"share-unlinks",		&share_unlinks,		0},
-  {"log-time",			&shtime,		0},
   {"allow-dk-cmds",		&allow_dk_cmds,		0},
   {"resolve-timeout",		&resolve_timeout,	0},
   {"must-be-owner",		&must_be_owner,		1},
@@ -524,7 +445,6 @@
   init_traces();
 
   /* Add new commands */
-  Tcl_CreateCommand(interp, "logfile", tcl_logfile, NULL, NULL);
   add_tcl_commands(tcluser_cmds);
   add_tcl_commands(tcldcc_cmds);
   add_tcl_commands(tclmisc_cmds);
Index: eggdrop1.7/src/tclmisc.c
diff -u eggdrop1.7/src/tclmisc.c:1.33 eggdrop1.7/src/tclmisc.c:1.34
--- eggdrop1.7/src/tclmisc.c:1.33	Wed Oct 17 01:08:11 2001
+++ eggdrop1.7/src/tclmisc.c	Thu Oct 18 04:06:43 2001
@@ -3,7 +3,7 @@
  *   Tcl stubs for file system commands
  *   Tcl stubs for everything else
  *
- * $Id: tclmisc.c,v 1.33 2001/10/17 06:08:11 stdarg Exp $
+ * $Id: tclmisc.c,v 1.34 2001/10/18 09:06:43 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -40,53 +40,6 @@
 extern time_t		 now;
 extern module_entry	*module_list;
 
-
-static int tcl_putlog STDVAR
-{
-  char logtext[501];
-
-  BADARGS(2, 2, " text");
-  strncpyz(logtext, argv[1], sizeof logtext);
-  putlog(LOG_MISC, "*", "%s", logtext);
-  return TCL_OK;
-}
-
-static int tcl_putcmdlog STDVAR
-{
-  char logtext[501];
-
-  BADARGS(2, 2, " text");
-  strncpyz(logtext, argv[1], sizeof logtext);
-  putlog(LOG_CMDS, "*", "%s", logtext);
-  return TCL_OK;
-}
-
-static int tcl_putxferlog STDVAR
-{
-  char logtext[501];
-
-  BADARGS(2, 2, " text");
-  strncpyz(logtext, argv[1], sizeof logtext);
-  putlog(LOG_FILES, "*", "%s", logtext);
-  return TCL_OK;
-}
-
-static int tcl_putloglev STDVAR
-{
-  int lev = 0;
-  char logtext[501];
-
-  BADARGS(4, 4, " level channel text");
-  lev = logmodes(argv[1]);
-  if (!lev) {
-    Tcl_AppendResult(irp, "No valid log-level given", NULL);
-    return TCL_ERROR;
-  }
-  strncpyz(logtext, argv[3], sizeof logtext);
-  putlog(lev, argv[2], "%s", logtext);
-  return TCL_OK;
-}
-
 static int tcl_binds STDVAR
 {
   tcl_bind_list_t	*tl, *tl_kind;
@@ -476,10 +429,6 @@
 
 tcl_cmds tclmisc_cmds[] =
 {
-  {"putlog",		tcl_putlog},
-  {"putcmdlog",		tcl_putcmdlog},
-  {"putxferlog",	tcl_putxferlog},
-  {"putloglev",		tcl_putloglev},
   {"unixtime",		tcl_unixtime},
   {"strftime",          tcl_strftime},
   {"ctime",		tcl_ctime},
----------------------- End of diff -----------------------



More information about the Changes mailing list