[cvslog] (2004-10-06 00:04:45 UTC) Module eggdrop1.7: Change committed!

cvslog cvs at tsss.org
Tue Oct 5 18:04:45 CST 2004


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2004-10-06 00:04:44 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     src/Makefile.in src/botmsg.c src/chan.h src/chanprog.c
     src/chanprog.h src/cmds.c src/cmds.h src/dcc.c src/dccutil.c
     src/dccutil.h src/flags.c src/main.c src/mem.c src/misc.c
     src/misc.h src/modules.c src/net.c src/patch.h src/proto.h
     src/tcl.c src/tcldcc.c src/tclegg.h src/tclhash.c src/tclmisc.c
     src/tcluser.c src/userrec.c src/userrec.h src/users.c src/users.h
     src/compat/Makefile.in src/md5/Makefile.in
     src/mod/assoc.mod/Makefile src/mod/blowfish.mod/Makefile
     src/mod/channels.mod/Makefile src/mod/compress.mod/Makefile.in
     src/mod/console.mod/Makefile src/mod/ctcp.mod/Makefile
     src/mod/dns.mod/Makefile.in src/mod/filesys.mod/Makefile
     src/mod/irc.mod/Makefile src/mod/notes.mod/Makefile
     src/mod/seen.mod/Makefile src/mod/server.mod/Makefile
     src/mod/share.mod/Makefile src/mod/transfer.mod/Makefile
     src/mod/uptime.mod/Makefile src/mod/wire.mod/Makefile
     src/mod/woobie.mod/Makefile

Log message:

* More header-related cleanups.
* Removed config file compatability for a few settings that were removed
  earlier in 1.6 (is this compatability even necessary? it doesn't appear
  to be doing anything....).
* Moved timer stuff from chanprog to tcl.c for now.

Sorry to leave this all in a bit of an unfinished state... I don't have a
lot of time right now.

---------------------- diff included ----------------------
Index: eggdrop1.7/src/Makefile.in
diff -u eggdrop1.7/src/Makefile.in:1.9 eggdrop1.7/src/Makefile.in:1.10
--- eggdrop1.7/src/Makefile.in:1.9	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/Makefile.in	Tue Oct  5 19:04:32 2004
@@ -1,5 +1,5 @@
 # Makefile for src/
-# $Id: Makefile.in,v 1.9 2004/09/10 01:10:50 wcc Exp $
+# $Id: Makefile.in,v 1.10 2004/10/06 00:04:32 wcc Exp $
 
 SHELL = @SHELL@
 top_srcdir = @top_srcdir@
@@ -83,192 +83,197 @@
 	$(CC) $(CFLAGS) -c $<
 
 #safety hash
-bg.o: bg.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
+bg.o: bg.c main.h ../config.h ../lush.h eggdrop.h types.h ../config.h \
+  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
+  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
   ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
   compat/strcasecmp.h compat/strftime.h bg.h
-botcmd.o: botcmd.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
-  ../src/types.h botcmd.h botnet.h botmsg.h dcc.h dccutil.h help.h misc.h \
-  net.h userrec.h
-botmsg.o: botmsg.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h botmsg.h botnet.h dcc.h dccutil.h \
-  misc.h net.h
-botnet.o: botnet.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h botnet.h botmsg.h dcc.h dccutil.h \
-  dns.h net.h userrec.h
+botcmd.o: botcmd.c main.h ../config.h ../lush.h eggdrop.h types.h \
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h modules.h \
+  mod/modvals.h ../src/types.h botcmd.h botnet.h botmsg.h dcc.h dccutil.h \
+  help.h misc.h net.h userrec.h
+botmsg.o: botmsg.c main.h ../config.h ../lush.h eggdrop.h types.h \
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h botmsg.h botnet.h \
+  dcc.h dccutil.h misc.h net.h
+botnet.o: botnet.c main.h ../config.h ../lush.h eggdrop.h types.h \
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h botnet.h botmsg.h \
+  dcc.h dccutil.h dns.h net.h userrec.h
 chanprog.o: chanprog.c main.h ../config.h ../lush.h eggdrop.h types.h \
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h chanprog.h misc.h \
+  rfc1459.h userrec.h
+cmds.o: cmds.c main.h ../config.h ../lush.h eggdrop.h types.h ../config.h \
   debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
   tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
   ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
   compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
-  ../src/types.h dccutil.h dcc.h misc.h rfc1459.h userrec.h
-cmds.o: cmds.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
-  ../src/types.h cmds.h botmsg.h botnet.h dcc.h dccutil.h help.h misc.h \
-  net.h userrec.h
-dcc.o: dcc.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
+  ../src/types.h cmds.h chanprog.h botmsg.h botnet.h dcc.h dccutil.h \
+  help.h misc.h net.h userrec.h
+dcc.o: dcc.c main.h ../config.h ../lush.h eggdrop.h types.h ../config.h \
+  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
+  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
   ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
   compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
   ../src/types.h dcc.h md5/md5.h botcmd.h botmsg.h botnet.h cmds.h \
   dccutil.h dns.h help.h match.h misc.h net.h userrec.h
 dccutil.o: dccutil.c main.h ../config.h ../lush.h eggdrop.h types.h \
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h modules.h \
+  mod/modvals.h ../src/types.h dccutil.h dcc.h botmsg.h help.h misc.h \
+  net.h
+debug.o: debug.c main.h ../config.h ../lush.h eggdrop.h types.h \
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h bg.h stat.h dcc.h \
+  dccutil.h misc.h net.h
+dns.o: dns.c main.h ../config.h ../lush.h eggdrop.h types.h ../config.h \
   debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
   tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
   ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
-  ../src/types.h dccutil.h dcc.h botmsg.h help.h misc.h net.h
-debug.o: debug.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h bg.h stat.h dcc.h dccutil.h \
-  misc.h net.h
-dns.o: dns.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
   compat/strcasecmp.h compat/strftime.h dns.h dcc.h dccutil.h misc.h \
   net.h
-flags.o: flags.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h dcc.h dccutil.h misc.h rfc1459.h \
-  userent.h
-help.o: help.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
+flags.o: flags.c main.h ../config.h ../lush.h eggdrop.h types.h \
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h chanprog.h dcc.h \
+  dccutil.h misc.h rfc1459.h userent.h
+help.o: help.c main.h ../config.h ../lush.h eggdrop.h types.h ../config.h \
+  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
+  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
   ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
   compat/strcasecmp.h compat/strftime.h help.h botmsg.h dccutil.h dcc.h \
   match.h misc.h
 language.o: language.c main.h ../config.h ../lush.h eggdrop.h types.h \
-  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
-  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h dcc.h dccutil.h help.h misc.h
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h dcc.h dccutil.h \
+  help.h misc.h
 logfile.o: logfile.c main.h ../config.h ../lush.h eggdrop.h types.h \
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h stat.h dcc.h \
+  dccutil.h misc.h rfc1459.h
+main.o: main.c main.h ../config.h ../lush.h eggdrop.h types.h ../config.h \
   debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
   tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
   ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h stat.h dcc.h dccutil.h misc.h \
-  rfc1459.h
-main.o: main.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
   compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
-  ../src/types.h bg.h botmsg.h botnet.h dcc.h dccutil.h help.h misc.h \
-  net.h traffic.h userrec.h patch.h
-match.o: match.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h match.h rfc1459.h
-mem.o: mem.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
+  ../src/types.h bg.h botmsg.h botnet.h cmds.h chanprog.h dcc.h dccutil.h \
+  help.h misc.h net.h traffic.h userrec.h patch.h
+match.o: match.c main.h ../config.h ../lush.h eggdrop.h types.h \
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h match.h rfc1459.h
+mem.o: mem.c main.h ../config.h ../lush.h eggdrop.h types.h ../config.h \
+  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
+  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
   ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
   compat/strcasecmp.h compat/strftime.h mod/modvals.h ../src/types.h \
   dccutil.h dcc.h help.h
-misc.o: misc.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
+misc.o: misc.c main.h ../config.h ../lush.h eggdrop.h types.h ../config.h \
+  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
+  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
   ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
   compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
   ../src/types.h stat.h misc.h botmsg.h dcc.h dccutil.h help.h match.h \
   rfc1459.h userrec.h
 misc_file.o: misc_file.c main.h ../config.h ../lush.h eggdrop.h types.h \
-  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
-  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h stat.h
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h stat.h
 modules.o: modules.c main.h ../config.h ../lush.h eggdrop.h types.h \
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h modules.h \
+  mod/modvals.h ../src/types.h md5/md5.h botcmd.h botmsg.h botnet.h \
+  chanprog.h cmds.h dcc.h dccutil.h dns.h help.h match.h misc.h net.h \
+  rfc1459.h userent.h userrec.h
+net.o: net.c main.h ../config.h ../lush.h eggdrop.h types.h ../config.h \
   debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
   tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
   ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
-  ../src/types.h md5/md5.h botcmd.h botmsg.h botnet.h cmds.h dcc.h \
-  dccutil.h dns.h help.h match.h misc.h net.h rfc1459.h userent.h \
-  userrec.h
-net.o: net.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
   compat/strcasecmp.h compat/strftime.h net.h dcc.h dccutil.h misc.h \
   traffic.h
 rfc1459.o: rfc1459.c main.h ../config.h ../lush.h eggdrop.h types.h \
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h rfc1459.h
+tcl.o: tcl.c main.h ../config.h ../lush.h eggdrop.h types.h ../config.h \
   debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
   tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
   ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h rfc1459.h
-tcl.o: tcl.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
   compat/strcasecmp.h compat/strftime.h dcc.h misc.h
-tcldcc.o: tcldcc.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
-  ../src/types.h tcldcc.h botmsg.h botnet.h cmds.h dcc.h dccutil.h misc.h \
-  net.h userrec.h
+tcldcc.o: tcldcc.c main.h ../config.h ../lush.h eggdrop.h types.h \
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h modules.h \
+  mod/modvals.h ../src/types.h tcldcc.h botmsg.h botnet.h chanprog.h \
+  cmds.h dcc.h dccutil.h misc.h net.h userrec.h
 tclhash.o: tclhash.c main.h ../config.h ../lush.h eggdrop.h types.h \
-  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
-  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h botmsg.h dcc.h dccutil.h match.h \
-  misc.h userrec.h
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h botmsg.h dcc.h \
+  dccutil.h match.h misc.h userrec.h
 tclmisc.o: tclmisc.c main.h ../config.h ../lush.h eggdrop.h types.h \
-  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
-  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
-  ../src/types.h md5/md5.h botmsg.h dcc.h help.h match.h misc.h net.h
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h modules.h \
+  mod/modvals.h ../src/types.h md5/md5.h botmsg.h dcc.h dccutil.h help.h \
+  match.h misc.h net.h
 tcluser.o: tcluser.c main.h ../config.h ../lush.h eggdrop.h types.h \
-  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
-  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
-  ../src/types.h botmsg.h botnet.h dcc.h misc.h userrec.h
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h modules.h \
+  mod/modvals.h ../src/types.h botmsg.h botnet.h chanprog.h dcc.h misc.h \
+  userrec.h
 traffic.o: traffic.c main.h ../config.h ../lush.h eggdrop.h types.h \
-  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
-  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h traffic.h dcc.h dccutil.h
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h traffic.h dcc.h \
+  dccutil.h
 userent.o: userent.c main.h ../config.h ../lush.h eggdrop.h types.h \
-  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
-  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h userent.h botmsg.h dcc.h \
-  dccutil.h match.h misc.h rfc1459.h userrec.h
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h userent.h \
+  botmsg.h dcc.h dccutil.h match.h misc.h rfc1459.h userrec.h
 userrec.o: userrec.c main.h ../config.h ../lush.h eggdrop.h types.h \
-  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
-  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
-  ../src/types.h userrec.h botmsg.h dcc.h dccutil.h match.h misc.h \
-  rfc1459.h userent.h
-users.o: users.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
-  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
-  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
-  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
-  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
-  ../src/types.h botmsg.h botnet.h dcc.h dccutil.h match.h misc.h net.h \
-  rfc1459.h userrec.h
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h modules.h \
+  mod/modvals.h ../src/types.h userrec.h botmsg.h dcc.h dccutil.h \
+  chanprog.h match.h misc.h rfc1459.h userent.h
+users.o: users.c main.h ../config.h ../lush.h eggdrop.h types.h \
+  ../config.h debug.h logfile.h lang.h flags.h proto.h misc_file.h \
+  language.h tclegg.h tclhash.h chan.h users.h compat/compat.h \
+  compat/inet_aton.h ../src/main.h compat/snprintf.h compat/memset.h \
+  compat/memcpy.h compat/strcasecmp.h compat/strftime.h modules.h \
+  mod/modvals.h ../src/types.h botmsg.h botnet.h dcc.h dccutil.h \
+  chanprog.h match.h misc.h net.h rfc1459.h userrec.h
Index: eggdrop1.7/src/botmsg.c
diff -u eggdrop1.7/src/botmsg.c:1.7 eggdrop1.7/src/botmsg.c:1.8
--- eggdrop1.7/src/botmsg.c:1.7	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/botmsg.c	Tue Oct  5 19:04:32 2004
@@ -19,7 +19,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: botmsg.c,v 1.7 2004/09/10 01:10:50 wcc Exp $
+ * $Id: botmsg.c,v 1.8 2004/10/06 00:04:32 wcc Exp $
  */
 
 #include "main.h"
@@ -28,7 +28,7 @@
 #include "botnet.h"  /* lastbot, nextbot, getparty */
 #include "dcc.h"     /* DCC_*, DCT_*, struct dcc_t */
 #include "dccutil.h" /* dprintf */
-#include "misc.h"    /* splitc, newsplit */
+#include "misc.h"    /* splitc, newsplit, rmspace */
 #include "net.h"     /* tputs */
 
 
Index: eggdrop1.7/src/chan.h
diff -u eggdrop1.7/src/chan.h:1.1.1.1 eggdrop1.7/src/chan.h:1.2
--- eggdrop1.7/src/chan.h:1.1.1.1	Tue Aug 24 20:02:02 2004
+++ eggdrop1.7/src/chan.h	Tue Oct  5 19:04:32 2004
@@ -3,7 +3,7 @@
  *   stuff common to chan.c and mode.c
  *   users.h needs to be loaded too
  *
- * $Id: chan.h,v 1.1.1.1 2004/08/25 01:02:02 wcc Exp $
+ * $Id: chan.h,v 1.2 2004/10/06 00:04:32 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -246,11 +246,6 @@
 #define CHAN_DYNAMICINVITES 0x0010
 #define CHAN_NOUSERINVITES  0x0020
 
-/* prototypes */
-memberlist *ismember(struct chanset_t *, char *);
-struct chanset_t *findchan(const char *name);
-struct chanset_t *findchan_by_dname(const char *name);
-
 #define channel_hidden(chan) (chan->channel.mode & (CHANPRIV | CHANSEC)) /* +s or +p ? */
 #define channel_optopic(chan) (chan->channel.mode & CHANTOPIC) /* +t? */
 #define channel_djoins(chan) (chan->status & (CHANDELJN | CHANINVIS)) /* +Dd? */
Index: eggdrop1.7/src/chanprog.c
diff -u eggdrop1.7/src/chanprog.c:1.7 eggdrop1.7/src/chanprog.c:1.8
--- eggdrop1.7/src/chanprog.c:1.7	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/chanprog.c	Tue Oct  5 19:04:32 2004
@@ -1,17 +1,7 @@
-/*
- * chanprog.c -- handles:
- *   rmspace()
- *   maintaining the server list
- *   revenge punishment
- *   timers, utimers
- *   telling the current programmed settings
- *   initializing a lot of stuff and loading the tcl scripts
+/* chanprog.c
  *
- * $Id: chanprog.c,v 1.7 2004/09/10 01:10:50 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -26,651 +16,63 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: chanprog.c,v 1.8 2004/10/06 00:04:32 wcc Exp $
  */
 
 #include "main.h"
 
-#ifdef HAVE_GETRUSAGE
-#  include <sys/resource.h>
-#  ifdef HAVE_SYS_RUSAGE_H
-#    include <sys/rusage.h>
-#  endif
-#endif
-
-#ifdef HAVE_UNAME
-#  include <sys/utsname.h>
-#endif
-
-#include "modules.h"
-
-#include "dccutil.h" /* dprintf */
-#include "logfile.h" /* log_t, LF_EXPIRING, LOG_*, putlog, masktype, maskname */
-#include "misc.h"    /* strncpyz, splitnick, make_rand_str */
+#include "chanprog.h"
+#include "misc.h"    /* strncpyz, splitnick, rmspace */
 #include "rfc1459.h" /* rfc_casecmp */
-#include "userrec.h" /* clear_userlist, count_users */
+#include "userrec.h" /* clear_userlist */
 
 
 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, protect_readonly, make_userfile,
-           noshare, ignore_time;
-
-
-tcl_timer_t *timer = NULL;        /* Minutely timer               */
-tcl_timer_t *utimer = NULL;       /* Secondly timer               */
-unsigned long timer_id = 1;       /* Next timer will have this ID */
-struct chanset_t *chanset = NULL; /* Channel list                 */
-char admin[121] = "";             /* Admin info                   */
-char origbotname[NICKLEN + 1];    /* Bot's nick                   */
-char botname[NICKLEN + 1];        /* Primary botname              */
-
+extern char owner[];
+extern int noshare;
 
-/* Remove leading and trailing whitespaces.
- */
-void rmspace(char *s)
-{
-  register char *p = NULL, *q = NULL;
 
-  if (!s || !*s)
-    return;
+struct chanset_t *chanset = NULL; /* Channel list. */
 
-  /* Remove trailing whitespaces. */
-  for (q = s + strlen(s) - 1; q >= s && egg_isspace(*q); q--);
-  *(q + 1) = 0;
 
-  /* Remove leading whitespaces. */
-  for (p = s; egg_isspace(*p); p++);
-
-  if (p != s)
-    memmove(s, p, q - p + 2);
-}
-
-
-/* Returns memberfields if the nick is in the member list.
- */
+/* Returns memberfields if the nick is in the member list. */
 memberlist *ismember(struct chanset_t *chan, char *nick)
 {
   register memberlist *x;
 
-  for (x = chan->channel.member; x && x->nick[0]; x = x->next)
+  for (x = chan->channel.member; x && x->nick[0]; x = x->next) {
     if (!rfc_casecmp(x->nick, nick))
       return x;
+  }
   return NULL;
 }
 
-/* Find a chanset by channel name as the server knows it (ie !ABCDEchannel)
- */
+/* Find a chanset by channel name as the server knows it (ie !ABCDEchannel) */
 struct chanset_t *findchan(const char *name)
 {
   register struct chanset_t *chan;
 
-  for (chan = chanset; chan; chan = chan->next)
+  for (chan = chanset; chan; chan = chan->next) {
     if (!rfc_casecmp(chan->name, name))
       return chan;
+  }
   return NULL;
 }
 
-/* Find a chanset by display name (ie !channel)
- */
+/* Find a chanset by display name (ie !channel) */
 struct chanset_t *findchan_by_dname(const char *name)
 {
   register struct chanset_t *chan;
 
-  for (chan = chanset; chan; chan = chan->next)
+  for (chan = chanset; chan; chan = chan->next) {
     if (!rfc_casecmp(chan->dname, name))
       return chan;
-  return NULL;
-}
-
-
-/*
- *    "caching" functions
- */
-
-/* Shortcut for get_user_by_host -- might have user record in one
- * of the channel caches.
- */
-struct userrec *check_chanlist(const char *host)
-{
-  char *nick, *uhost, buf[UHOSTLEN];
-  register memberlist *m;
-  register struct chanset_t *chan;
-
-  strncpyz(buf, host, sizeof buf);
-  uhost = buf;
-  nick = splitnick(&uhost);
-  for (chan = chanset; chan; chan = chan->next)
-    for (m = chan->channel.member; m && m->nick[0]; m = m->next)
-      if (!rfc_casecmp(nick, m->nick) && !egg_strcasecmp(uhost, m->userhost))
-        return m->user;
-  return NULL;
-}
-
-/* Shortcut for get_user_by_handle -- might have user record in channels
- */
-struct userrec *check_chanlist_hand(const char *hand)
-{
-  register struct chanset_t *chan;
-  register memberlist *m;
-
-  for (chan = chanset; chan; chan = chan->next)
-    for (m = chan->channel.member; m && m->nick[0]; m = m->next)
-      if (m->user && !egg_strcasecmp(m->user->handle, hand))
-        return m->user;
-  return NULL;
-}
-
-/* Clear the user pointers in the chanlists.
- *
- * Necessary when a hostmask is added/removed, a user is added or a new
- * userfile is loaded.
- */
-void clear_chanlist(void)
-{
-  register memberlist *m;
-  register struct chanset_t *chan;
-
-  for (chan = chanset; chan; chan = chan->next)
-    for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
-      m->user = NULL;
-      m->tried_getuser = 0;
-    }
-}
-
-/* Clear the user pointer of a specific nick in the chanlists.
- *
- * Necessary when a hostmask is added/removed, a nick changes, etc.
- * Does not completely invalidate the channel cache like clear_chanlist().
- */
-void clear_chanlist_member(const char *nick)
-{
-  register memberlist *m;
-  register struct chanset_t *chan;
-
-  for (chan = chanset; chan; chan = chan->next)
-    for (m = chan->channel.member; m && m->nick[0]; m = m->next)
-      if (!rfc_casecmp(m->nick, nick)) {
-        m->user = NULL;
-        m->tried_getuser = 0;
-        break;
-      }
-}
-
-/* If this user at host is in a channel, set it (it was null)
- */
-void set_chanlist(const char *host, struct userrec *rec)
-{
-  char *nick, *uhost, buf[UHOSTLEN];
-  register memberlist *m;
-  register struct chanset_t *chan;
-
-  strncpyz(buf, host, sizeof buf);
-  uhost = buf;
-  nick = splitnick(&uhost);
-  for (chan = chanset; chan; chan = chan->next)
-    for (m = chan->channel.member; m && m->nick[0]; m = m->next)
-      if (!rfc_casecmp(nick, m->nick) && !egg_strcasecmp(uhost, m->userhost))
-        m->user = rec;
-}
-
-/* Calculate the memory we should be using
- */
-int expmem_chanprog()
-{
-  register int tot = 0;
-  register tcl_timer_t *t;
-
-  for (t = timer; t; t = t->next)
-    tot += sizeof(tcl_timer_t) + strlen(t->cmd) + 1;
-  for (t = utimer; t; t = t->next)
-    tot += sizeof(tcl_timer_t) + strlen(t->cmd) + 1;
-  return tot;
-}
-
-/* Dump uptime info out to dcc (guppy 9Jan99)
- */
-void tell_verbose_uptime(int idx)
-{
-  char s[256], s1[121];
-  time_t now2, hr, min;
-
-  now2 = now - online_since;
-  s[0] = 0;
-  if (now2 > 86400) {
-    /* days */
-    sprintf(s, "%d day", (int) (now2 / 86400));
-    if ((int) (now2 / 86400) >= 2)
-      strcat(s, "s");
-    strcat(s, ", ");
-    now2 -= (((int) (now2 / 86400)) * 86400);
-  }
-  hr = (time_t) ((int) now2 / 3600);
-  now2 -= (hr * 3600);
-  min = (time_t) ((int) now2 / 60);
-  sprintf(&s[strlen(s)], "%02d:%02d", (int) hr, (int) min);
-  s1[0] = 0;
-  if (backgrd)
-    strcpy(s1, MISC_BACKGROUND);
-  else {
-    if (term_z)
-      strcpy(s1, MISC_TERMMODE);
-    else if (con_chan)
-      strcpy(s1, MISC_STATMODE);
-    else
-      strcpy(s1, MISC_LOGMODE);
-  }
-  dprintf(idx, "%s %s  (%s)\n", MISC_ONLINEFOR, s, s1);
-}
-
-/* Dump status info out to dcc
- */
-void tell_verbose_status(int idx)
-{
-  char s[256], s1[121], s2[81];
-  char *vers_t, *uni_t;
-  int i;
-  time_t now2 = now - online_since, hr, min;
-#ifdef HAVE_GETRUSAGE
-  struct rusage ru;
-#else
-#  ifdef HAVE_CLOCK
-  clock_t cl;
-#  endif
-#endif
-#ifdef HAVE_UNAME
-  struct utsname un;
-
-  if (!uname(&un) < 0) {
-#endif
-    vers_t = " ";
-    uni_t  = "*unknown*";
-#ifdef HAVE_UNAME
-  } else {
-    vers_t = un.release;
-    uni_t  = un.sysname;
-  }
-#endif
-
-  i = count_users(userlist);
-  dprintf(idx, "I am %s, running %s: %d user%s (mem: %uk).\n",
-          botnetnick, ver, i, i == 1 ? "" : "s",
-          (int) (expected_memory() / 1024));
-
-  s[0] = 0;
-  if (now2 > 86400) {
-    /* days */
-    sprintf(s, "%d day", (int) (now2 / 86400));
-    if ((int) (now2 / 86400) >= 2)
-      strcat(s, "s");
-    strcat(s, ", ");
-    now2 -= (((int) (now2 / 86400)) * 86400);
-  }
-  hr = (time_t) ((int) now2 / 3600);
-  now2 -= (hr * 3600);
-  min = (time_t) ((int) now2 / 60);
-  sprintf(&s[strlen(s)], "%02d:%02d", (int) hr, (int) min);
-  s1[0] = 0;
-  if (backgrd)
-    strcpy(s1, MISC_BACKGROUND);
-  else {
-    if (term_z)
-      strcpy(s1, MISC_TERMMODE);
-    else if (con_chan)
-      strcpy(s1, MISC_STATMODE);
-    else
-      strcpy(s1, MISC_LOGMODE);
-  }
-#ifdef HAVE_GETRUSAGE
-  getrusage(RUSAGE_SELF, &ru);
-  hr = (int) ((ru.ru_utime.tv_sec + ru.ru_stime.tv_sec) / 60);
-  min = (int) ((ru.ru_utime.tv_sec + ru.ru_stime.tv_sec) - (hr * 60));
-  sprintf(s2, "CPU: %02d:%02d", (int) hr, (int) min);    /* Actally min/sec */
-#else
-#  ifdef HAVE_CLOCK
-  cl = (clock() / CLOCKS_PER_SEC);
-  hr = (int) (cl / 60);
-  min = (int) (cl - (hr * 60));
-  sprintf(s2, "CPU: %02d:%02d", (int) hr, (int) min);    /* Actually min/sec */
-#  else
-  sprintf(s2, "CPU: unknown");
-#  endif
-#endif
-  dprintf(idx, "%s %s (%s) - %s - %s: %4.1f%%\n", MISC_ONLINEFOR,
-          s, s1, s2, MISC_CACHEHIT,
-          100.0 * ((float) cache_hit) / ((float) (cache_hit + cache_miss)));
-
-  if (admin[0])
-    dprintf(idx, "Admin: %s\n", admin);
-
-  dprintf(idx, "Config file: %s\n", configfile);
-  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*");
-
-#ifdef HAVE_TCL_THREADS
-  dprintf(idx, "Tcl is threaded.\n");
-#endif
-
-}
-
-/* Show all internal state variables
- */
-void tell_settings(int idx)
-{
-  char s[1024];
-  int i;
-  struct flag_record fr = { FR_GLOBAL, 0, 0, 0, 0, 0 };
-
-  dprintf(idx, "Botnet nickname: %s\n", botnetnick);
-  if (firewall[0])
-    dprintf(idx, "Firewall: %s:%d\n", firewall, firewallport);
-  dprintf(idx, "Userfile: %s\n", userfile);
-  dprintf(idx, "Motd: %s\n",  motdfile);
-  dprintf(idx, "Directories:\n");
-#ifndef STATIC
-  dprintf(idx, "  Help   : %s\n", helpdir);
-  dprintf(idx, "  Temp   : %s\n", tempdir);
-  dprintf(idx, "  Modules: %s\n", moddir);
-#else
-  dprintf(idx, "  Help: %s\n", helpdir);
-  dprintf(idx, "  Temp: %s\n", tempdir);
-#endif
-  fr.global = default_flags;
-
-  build_flags(s, &fr, NULL);
-  dprintf(idx, "%s [%s], %s: %s\n", MISC_NEWUSERFLAGS, s,
-          MISC_NOTIFY, notify_new);
-  if (owner[0])
-    dprintf(idx, "%s: %s\n", MISC_PERMOWNER, 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 minute%s.\n", ignore_time,
-          (ignore_time != 1) ? "s" : "");
-}
-
-void reaffirm_owners()
-{
-  char *p, *q, s[121];
-  struct userrec *u;
-
-  /* Please stop breaking this function. */
-  if (owner[0]) {
-    q = owner;
-    p = strchr(q, ',');
-    while (p) {
-      strncpyz(s, q, (p - q) + 1);
-      rmspace(s);
-      u = get_user_by_handle(userlist, s);
-      if (u)
-        u->flags = sanity_check(u->flags | USER_OWNER);
-      q = p + 1;
-      p = strchr(q, ',');
-    }
-    strcpy(s, q);
-    rmspace(s);
-    u = get_user_by_handle(userlist, s);
-    if (u)
-      u->flags = sanity_check(u->flags | USER_OWNER);
-  }
-}
-
-void chanprog()
-{
-  int i;
-  FILE *f;
-  char s[161], rands[8];
-
-  admin[0]   = 0;
-  helpdir[0] = 0;
-  tempdir[0] = 0;
-  conmask    = 0;
-
-  for (i = 0; i < max_logs; i++)
-    logs[i].flags |= LF_EXPIRING;
-
-  /* Turn off read-only variables (make them write-able) for rehash */
-  protect_readonly = 0;
-
-  /* Now read it */
-  if (!readtclprog(configfile))
-    fatal(MISC_NOCONFIGFILE, 0);
-
-  for (i = 0; i < max_logs; i++) {
-    if (logs[i].flags & LF_EXPIRING) {
-      if (logs[i].filename != NULL) {
-        nfree(logs[i].filename);
-        logs[i].filename = NULL;
-      }
-      if (logs[i].chname != NULL) {
-        nfree(logs[i].chname);
-        logs[i].chname = NULL;
-      }
-      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;
-
-  if (!botnetnick[0])
-    strncpyz(botnetnick, origbotname, HANDLEN + 1);
-
-  if (!botnetnick[0])
-    fatal("I don't have a botnet nick!!\n", 0);
-
-  if (!userfile[0])
-    fatal(MISC_NOUSERFILE2, 0);
-
-  if (!readuserfile(userfile, &userlist)) {
-    if (!make_userfile) {
-      char tmp[178];
-
-      egg_snprintf(tmp, sizeof tmp, MISC_NOUSERFILE, configfile);
-      fatal(tmp, 0);
-    }
-    printf("\n\n%s\n", MISC_NOUSERFILE2);
-    if (module_find("server", 0, 0))
-      printf(MISC_USERFCREATE1, origbotname);
-    printf("%s\n\n", MISC_USERFCREATE2);
-  } else if (make_userfile) {
-    make_userfile = 0;
-    printf("%s\n", MISC_USERFEXISTS);
-  }
-
-  if (helpdir[0])
-    if (helpdir[strlen(helpdir) - 1] != '/')
-      strcat(helpdir, "/");
-
-  if (tempdir[0])
-    if (tempdir[strlen(tempdir) - 1] != '/')
-      strcat(tempdir, "/");
-
-  /* Test tempdir: it's vital. */
-
-  /* Possible file race condition solved by using a random string
-   * and the process id in the filename.
-   * FIXME: This race is only partitially fixed. We could still be
-   *        overwriting an existing file / following a malicious
-   *        link.
-   */
-  make_rand_str(rands, 7); /* create random string */
-  sprintf(s, "%s.test-%u-%s", tempdir, getpid(), rands);
-  f = fopen(s, "w");
-  if (f == NULL)
-    fatal(MISC_CANTWRITETEMP, 0);
-  fclose(f);
-  unlink(s);
-  reaffirm_owners();
-  check_tcl_event("userfile-loaded");
-}
-
-/* Reload the user file from disk
- */
-void reload()
-{
-  if (!file_readable(userfile)) {
-    putlog(LOG_MISC, "*", MISC_CANTRELOADUSER);
-    return;
-  }
-
-  noshare = 1;
-  clear_userlist(userlist);
-  noshare = 0;
-  userlist = NULL;
-  if (!readuserfile(userfile, &userlist))
-    fatal(MISC_MISSINGUSERF, 0);
-  reaffirm_owners();
-  check_tcl_event("userfile-loaded");
-  call_hook(HOOK_READ_USERFILE);
-}
-
-void rehash()
-{
-  call_hook(HOOK_PRE_REHASH);
-  noshare = 1;
-  clear_userlist(userlist);
-  noshare = 0;
-  userlist = NULL;
-  chanprog();
-}
-
-/*
- *    Brief venture into timers
- */
-
-/* Add a timer
- */
-unsigned long add_timer(tcl_timer_t ** stack, int elapse, char *cmd,
-                        unsigned long prev_id)
-{
-  tcl_timer_t *old = (*stack);
-
-  *stack = nmalloc(sizeof **stack);
-  (*stack)->next = old;
-  (*stack)->mins = elapse;
-  (*stack)->cmd = nmalloc(strlen(cmd) + 1);
-  strcpy((*stack)->cmd, cmd);
-  /* If it's just being added back and already had an id,
-   * don't create a new one.
-   */
-  if (prev_id > 0)
-    (*stack)->id = prev_id;
-  else
-    (*stack)->id = timer_id++;
-  return (*stack)->id;
-}
-
-/* Remove a timer, by id
- */
-int remove_timer(tcl_timer_t ** stack, unsigned long id)
-{
-  tcl_timer_t *old;
-  int ok = 0;
-
-  while (*stack) {
-    if ((*stack)->id == id) {
-      ok++;
-      old = *stack;
-      *stack = ((*stack)->next);
-      nfree(old->cmd);
-      nfree(old);
-    } else
-      stack = &((*stack)->next);
-  }
-  return ok;
-}
-
-/* Check timers, execute the ones that have expired.
- */
-void do_check_timers(tcl_timer_t ** stack)
-{
-  tcl_timer_t *mark = *stack, *old = NULL;
-  char x[16];
-
-  /* New timers could be added by a Tcl script inside a current timer
-   * so i'll just clear out the timer list completely, and add any
-   * unexpired timers back on.
-   */
-  *stack = NULL;
-  while (mark) {
-    if (mark->mins > 0)
-      mark->mins--;
-    old = mark;
-    mark = mark->next;
-    if (!old->mins) {
-      egg_snprintf(x, sizeof x, "timer%lu", old->id);
-      do_tcl(x, old->cmd);
-      nfree(old->cmd);
-      nfree(old);
-    } else {
-      old->next = *stack;
-      *stack = old;
-    }
-  }
-}
-
-/* Wipe all timers.
- */
-void wipe_timers(Tcl_Interp *irp, tcl_timer_t **stack)
-{
-  tcl_timer_t *mark = *stack, *old;
-
-  while (mark) {
-    old = mark;
-    mark = mark->next;
-    nfree(old->cmd);
-    nfree(old);
-  }
-  *stack = NULL;
-}
-
-/* Return list of timers
- */
-void list_timers(Tcl_Interp *irp, tcl_timer_t *stack)
-{
-  char mins[10], id[16], *x;
-  EGG_CONST char *argv[3];
-  tcl_timer_t *mark;
-
-  for (mark = stack; mark; mark = mark->next) {
-    egg_snprintf(mins, sizeof mins, "%u", mark->mins);
-    egg_snprintf(id, sizeof id, "timer%lu", mark->id);
-    argv[0] = mins;
-    argv[1] = mark->cmd;
-    argv[2] = id;
-    x = Tcl_Merge(3, argv);
-    Tcl_AppendElement(irp, x);
-    Tcl_Free((char *) x);
   }
+  return NULL;
 }
 
-/* Oddly enough, written by Sup (former(?) Eggdrop coder)
- */
+/* Oddly enough, written by Sup (former(?) Eggdrop coder) */
 int isowner(char *name)
 {
   register char *ptr = NULL, *s = NULL, *n = NULL;
@@ -697,3 +99,30 @@
 
   return 0;
 }
+
+void reaffirm_owners()
+{
+  char *p, *q, s[121];
+  struct userrec *u;
+
+  /* Please stop breaking this function. */
+  if (!owner[0])
+    return;
+
+  q = owner;
+  p = strchr(q, ',');
+  while (p) {
+    strncpyz(s, q, (p - q) + 1);
+    rmspace(s);
+    u = get_user_by_handle(userlist, s);
+    if (u)
+      u->flags = sanity_check(u->flags | USER_OWNER);
+    q = p + 1;
+    p = strchr(q, ',');
+  }
+  strcpy(s, q);
+  rmspace(s);
+  u = get_user_by_handle(userlist, s);
+  if (u)
+    u->flags = sanity_check(u->flags | USER_OWNER);
+}
Index: eggdrop1.7/src/chanprog.h
diff -u eggdrop1.7/src/chanprog.h:1.1 eggdrop1.7/src/chanprog.h:1.2
--- eggdrop1.7/src/chanprog.h:1.1	Wed Aug 25 22:21:13 2004
+++ eggdrop1.7/src/chanprog.h	Tue Oct  5 19:04:32 2004
@@ -0,0 +1,33 @@
+/* chanprog.h
+ *
+ * Copyright (C) 2004 Eggheads Development Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: chanprog.h,v 1.2 2004/10/06 00:04:32 wcc Exp $
+ */
+
+#ifndef _EGG_CHANPROG_H
+#define _EGG_CHANPROG_H
+
+#ifndef MAKING_MODS
+memberlist *ismember(struct chanset_t *, char *);
+struct chanset_t *findchan(const char *name);
+struct chanset_t *findchan_by_dname(const char *name);
+int isowner(char *);
+void reaffirm_owners();
+#endif
+
+#endif /* !_EGG_CHANPROG_H */
Index: eggdrop1.7/src/cmds.c
diff -u eggdrop1.7/src/cmds.c:1.13 eggdrop1.7/src/cmds.c:1.14
--- eggdrop1.7/src/cmds.c:1.13	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/cmds.c	Tue Oct  5 19:04:32 2004
@@ -17,36 +17,55 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: cmds.c,v 1.13 2004/09/10 01:10:50 wcc Exp $
+ * $Id: cmds.c,v 1.14 2004/10/06 00:04:32 wcc Exp $
  */
 
 #include "main.h"
 #include "modules.h"
 #include <ctype.h>
 
+#ifdef HAVE_UNAME
+#  include <sys/utsname.h>
+#endif
+
+#ifdef HAVE_GETRUSAGE
+#  include <sys/resource.h>
+#  ifdef HAVE_SYS_RUSAGE_H
+#    include <sys/rusage.h>
+#  endif
+#endif
+
 #include "cmds.h"
-#include "botmsg.h"  /* simple_sprintf, botnet_send_* */
-#include "botnet.h"  /* answer_local_whom, lastbot, nextbot, tell_bots,
-                      * tell_bottree, botlink, botunlink, tandem_relay */
-#include "dcc.h"     /* DCC_*, DCT_*, STRIP_*, STAT_*, BSTAT_*, struct chat_info,
-                      * struct dcc_t */
-#include "dccutil.h" /* get_data_ptr, dprintf, chanout_but, dcc_chatter, lostdcc,
-                      * tell_dcc, not_away, set_away, do_boot, flush_lines, show_motd */
-#include "help.h"    /* debug_help */
-#include "logfile.h" /* LOG_*, putlog, logmodes, masktype, maskname */
-#include "misc.h"    /* my_strcpy, splitcn, strncpyz, newsplit, dumplots, kill_bot */
-#include "net.h"     /* killsock, tell_netdebug */
-#include "userrec.h" /* adduser, addhost_by_handle, u_pass_match, delhost_by_handle,
-                      * deluser, change_handle, correct_handle, write_userfile */
+#include "chanprog.h" /* ismember, findchan_by_dname, reload */
+#include "botmsg.h"   /* simple_sprintf, botnet_send_* */
+#include "botnet.h"   /* answer_local_whom, lastbot, nextbot, tell_bots,
+                       * tell_bottree, botlink, botunlink, tandem_relay */
+#include "dcc.h"      /* DCC_*, DCT_*, STRIP_*, STAT_*, BSTAT_*, struct chat_info,
+                       * struct dcc_t */
+#include "dccutil.h"  /* get_data_ptr, dprintf, chanout_but, dcc_chatter, lostdcc,
+                       * tell_dcc, not_away, set_away, do_boot, flush_lines, show_motd */
+#include "help.h"     /* debug_help */
+#include "logfile.h"  /* LOG_*, putlog, logmodes, masktype, maskname */
+#include "misc.h"     /* my_strcpy, splitcn, strncpyz, newsplit, dumplots, kill_bot */
+#include "net.h"      /* killsock, tell_netdebug */
+#include "userrec.h"  /* adduser, addhost_by_handle, u_pass_match, delhost_by_handle,
+                       * deluser, change_handle, correct_handle, write_userfile,
+                       * count_users */
+#include "users.h"    /* reload */
+
 
 extern struct chanset_t *chanset;
 extern struct dcc_t *dcc;
 extern struct userrec *userlist;
 extern tcl_timer_t *timer, *utimer;
-extern int dcc_total, remote_boots, backgrd, make_userfile, do_restart,
-           conmask, require_p, must_be_owner, strict_ident;
+extern log_t *logs;
+extern int dcc_total, remote_boots, backgrd, make_userfile, do_restart, term_z,
+           con_chan, conmask, require_p, must_be_owner, strict_ident, firewallport,
+           cache_hit, cache_miss, default_flags, max_logs, ignore_time;
 extern Tcl_Interp *interp;
-extern char botnetnick[], origbotname[], ver[], network[], owner[], quit_msg[];
+extern char botnetnick[], origbotname[], ver[], network[], owner[], quit_msg[],
+            firewall[], motdfile[], userfile[], moddir[], notify_new[], admin[],
+            tempdir[], helpdir[], configfile[];
 extern time_t now, online_since;
 extern module_entry *module_list;
 
@@ -235,6 +254,145 @@
   }
 }
 
+/* Dump status info out to dcc */
+void tell_verbose_status(int idx)
+{
+  char s[256], s1[121], s2[81];
+  char *vers_t, *uni_t;
+  int i;
+  time_t now2 = now - online_since, hr, min;
+#ifdef HAVE_GETRUSAGE
+  struct rusage ru;
+#else
+#  ifdef HAVE_CLOCK
+  clock_t cl;
+#  endif
+#endif
+#ifdef HAVE_UNAME
+  struct utsname un;
+
+  if (!uname(&un) < 0) {
+#endif
+    vers_t = " ";
+    uni_t  = "*unknown*";
+#ifdef HAVE_UNAME
+  } else {
+    vers_t = un.release;
+    uni_t  = un.sysname;
+  }
+#endif
+
+  i = count_users(userlist);
+  dprintf(idx, "I am %s, running %s: %d user%s (mem: %uk).\n",
+          botnetnick, ver, i, i == 1 ? "" : "s",
+          (int) (expected_memory() / 1024));
+
+  s[0] = 0;
+  if (now2 > 86400) {
+    /* days */
+    sprintf(s, "%d day", (int) (now2 / 86400));
+    if ((int) (now2 / 86400) >= 2)
+      strcat(s, "s");
+    strcat(s, ", ");
+    now2 -= (((int) (now2 / 86400)) * 86400);
+  }
+  hr = (time_t) ((int) now2 / 3600);
+  now2 -= (hr * 3600);
+  min = (time_t) ((int) now2 / 60);
+  sprintf(&s[strlen(s)], "%02d:%02d", (int) hr, (int) min);
+  s1[0] = 0;
+  if (backgrd)
+    strcpy(s1, MISC_BACKGROUND);
+  else {
+    if (term_z)
+      strcpy(s1, MISC_TERMMODE);
+    else if (con_chan)
+      strcpy(s1, MISC_STATMODE);
+    else
+      strcpy(s1, MISC_LOGMODE);
+  }
+#ifdef HAVE_GETRUSAGE
+  getrusage(RUSAGE_SELF, &ru);
+  hr = (int) ((ru.ru_utime.tv_sec + ru.ru_stime.tv_sec) / 60);
+  min = (int) ((ru.ru_utime.tv_sec + ru.ru_stime.tv_sec) - (hr * 60));
+  sprintf(s2, "CPU: %02d:%02d", (int) hr, (int) min);    /* Actally min/sec */
+#else
+#  ifdef HAVE_CLOCK
+  cl = (clock() / CLOCKS_PER_SEC);
+  hr = (int) (cl / 60);
+  min = (int) (cl - (hr * 60));
+  sprintf(s2, "CPU: %02d:%02d", (int) hr, (int) min);    /* Actually min/sec */
+#  else
+  sprintf(s2, "CPU: unknown");
+#  endif
+#endif
+  dprintf(idx, "%s %s (%s) - %s - %s: %4.1f%%\n", MISC_ONLINEFOR,
+          s, s1, s2, MISC_CACHEHIT,
+          100.0 * ((float) cache_hit) / ((float) (cache_hit + cache_miss)));
+
+  if (admin[0])
+    dprintf(idx, "Admin: %s\n", admin);
+
+  dprintf(idx, "Config file: %s\n", configfile);
+  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*");
+
+#ifdef HAVE_TCL_THREADS
+  dprintf(idx, "Tcl is threaded.\n");
+#endif
+
+}
+
+/* Show config setting values */
+void tell_settings(int idx)
+{
+  char s[1024];
+  int i;
+  struct flag_record fr = { FR_GLOBAL, 0, 0, 0, 0, 0 };
+
+  dprintf(idx, "Botnet nickname: %s\n", botnetnick);
+  if (firewall[0])
+    dprintf(idx, "Firewall: %s:%d\n", firewall, firewallport);
+  dprintf(idx, "Userfile: %s\n", userfile);
+  dprintf(idx, "Motd: %s\n",  motdfile);
+  dprintf(idx, "Directories:\n");
+#ifndef STATIC
+  dprintf(idx, "  Help   : %s\n", helpdir);
+  dprintf(idx, "  Temp   : %s\n", tempdir);
+  dprintf(idx, "  Modules: %s\n", moddir);
+#else
+  dprintf(idx, "  Help: %s\n", helpdir);
+  dprintf(idx, "  Temp: %s\n", tempdir);
+#endif
+  fr.global = default_flags;
+
+  build_flags(s, &fr, NULL);
+  dprintf(idx, "%s [%s], %s: %s\n", MISC_NEWUSERFLAGS, s,
+          MISC_NOTIFY, notify_new);
+  if (owner[0])
+    dprintf(idx, "%s: %s\n", MISC_PERMOWNER, 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 minute%s.\n", ignore_time,
+          (ignore_time != 1) ? "s" : "");
+}
+
 static void cmd_botinfo(struct userrec *u, int idx, char *par)
 {
   char s[512], s2[32];
@@ -510,8 +668,37 @@
 
 static void cmd_uptime(struct userrec *u, int idx, char *par)
 {
+  char s[256], s1[121];
+  time_t now2, hr, min;
+
   putlog(LOG_CMDS, "*", "#%s# uptime", dcc[idx].nick);
-  tell_verbose_uptime(idx);
+
+  now2 = now - online_since;
+  s[0] = 0;
+  if (now2 > 86400) {
+    /* days */
+    sprintf(s, "%d day", (int) (now2 / 86400));
+    if ((int) (now2 / 86400) >= 2)
+      strcat(s, "s");
+    strcat(s, ", ");
+    now2 -= (((int) (now2 / 86400)) * 86400);
+  }
+  hr = (time_t) ((int) now2 / 3600);
+  now2 -= (hr * 3600);
+  min = (time_t) ((int) now2 / 60);
+  sprintf(&s[strlen(s)], "%02d:%02d", (int) hr, (int) min);
+  s1[0] = 0;
+  if (backgrd)
+    strcpy(s1, MISC_BACKGROUND);
+  else {
+    if (term_z)
+      strcpy(s1, MISC_TERMMODE);
+    else if (con_chan)
+      strcpy(s1, MISC_STATMODE);
+    else
+      strcpy(s1, MISC_LOGMODE);
+  }
+  dprintf(idx, "%s %s  (%s)\n", MISC_ONLINEFOR, s, s1);
 }
 
 static void cmd_status(struct userrec *u, int idx, char *par)
Index: eggdrop1.7/src/cmds.h
diff -u eggdrop1.7/src/cmds.h:1.3 eggdrop1.7/src/cmds.h:1.4
--- eggdrop1.7/src/cmds.h:1.3	Fri Aug 27 05:01:17 2004
+++ eggdrop1.7/src/cmds.h	Tue Oct  5 19:04:32 2004
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: cmds.h,v 1.3 2004/08/27 10:01:17 wcc Exp $
+ * $Id: cmds.h,v 1.4 2004/10/06 00:04:32 wcc Exp $
  */
 
 #ifndef _EGG_CMDS_H
@@ -28,6 +28,8 @@
 
 
 #ifndef MAKING_MODS
+void tell_verbose_status(int);
+void tell_settings(int);
 int check_dcc_attrs(struct userrec *, int);
 int check_dcc_chanattrs(struct userrec *, char *, int, int);
 int stripmodes(char *);
Index: eggdrop1.7/src/compat/Makefile.in
diff -u eggdrop1.7/src/compat/Makefile.in:1.6 eggdrop1.7/src/compat/Makefile.in:1.7
--- eggdrop1.7/src/compat/Makefile.in:1.6	Mon Aug 30 18:58:23 2004
+++ eggdrop1.7/src/compat/Makefile.in	Tue Oct  5 19:04:33 2004
@@ -1,6 +1,6 @@
 # Makefile for src/compat/
 #
-# $Id: Makefile.in,v 1.6 2004/08/30 23:58:23 wcc Exp $
+# $Id: Makefile.in,v 1.7 2004/10/06 00:04:33 wcc Exp $
 
 SHELL = @SHELL@
 top_srcdir = @top_srcdir@
@@ -43,56 +43,62 @@
 #safety hash
 gnu_strftime.o: gnu_strftime.c ../../config.h
 inet_aton.o: inet_aton.c ../../src/main.h ../../config.h ../../lush.h \
-  ../../src/eggdrop.h ../../src/types.h ../../src/debug.h \
+  ../../src/eggdrop.h ../../src/types.h ../../config.h ../../src/debug.h \
   ../../src/logfile.h ../../src/lang.h ../../src/flags.h \
   ../../src/proto.h ../../src/misc_file.h ../../src/language.h \
   ../../src/tclegg.h ../../src/tclhash.h ../../src/chan.h \
   ../../src/users.h ../../src/compat/compat.h \
-  ../../src/compat/inet_aton.h ../../src/compat/snprintf.h \
-  ../../src/compat/memset.h ../../src/compat/memcpy.h \
-  ../../src/compat/strcasecmp.h ../../src/compat/strftime.h inet_aton.h
+  ../../src/compat/inet_aton.h ../../src/main.h \
+  ../../src/compat/snprintf.h ../../src/compat/memset.h \
+  ../../src/compat/memcpy.h ../../src/compat/strcasecmp.h \
+  ../../src/compat/strftime.h inet_aton.h
 memcpy.o: memcpy.c ../../src/main.h ../../config.h ../../lush.h \
-  ../../src/eggdrop.h ../../src/types.h ../../src/debug.h \
+  ../../src/eggdrop.h ../../src/types.h ../../config.h ../../src/debug.h \
   ../../src/logfile.h ../../src/lang.h ../../src/flags.h \
   ../../src/proto.h ../../src/misc_file.h ../../src/language.h \
   ../../src/tclegg.h ../../src/tclhash.h ../../src/chan.h \
   ../../src/users.h ../../src/compat/compat.h \
-  ../../src/compat/inet_aton.h ../../src/compat/snprintf.h \
-  ../../src/compat/memset.h ../../src/compat/memcpy.h \
-  ../../src/compat/strcasecmp.h ../../src/compat/strftime.h memcpy.h
+  ../../src/compat/inet_aton.h ../../src/main.h \
+  ../../src/compat/snprintf.h ../../src/compat/memset.h \
+  ../../src/compat/memcpy.h ../../src/compat/strcasecmp.h \
+  ../../src/compat/strftime.h memcpy.h
 memset.o: memset.c ../../src/main.h ../../config.h ../../lush.h \
-  ../../src/eggdrop.h ../../src/types.h ../../src/debug.h \
+  ../../src/eggdrop.h ../../src/types.h ../../config.h ../../src/debug.h \
   ../../src/logfile.h ../../src/lang.h ../../src/flags.h \
   ../../src/proto.h ../../src/misc_file.h ../../src/language.h \
   ../../src/tclegg.h ../../src/tclhash.h ../../src/chan.h \
   ../../src/users.h ../../src/compat/compat.h \
-  ../../src/compat/inet_aton.h ../../src/compat/snprintf.h \
-  ../../src/compat/memset.h ../../src/compat/memcpy.h \
-  ../../src/compat/strcasecmp.h ../../src/compat/strftime.h memset.h
+  ../../src/compat/inet_aton.h ../../src/main.h \
+  ../../src/compat/snprintf.h ../../src/compat/memset.h \
+  ../../src/compat/memcpy.h ../../src/compat/strcasecmp.h \
+  ../../src/compat/strftime.h memset.h
 snprintf.o: snprintf.c ../../src/main.h ../../config.h ../../lush.h \
-  ../../src/eggdrop.h ../../src/types.h ../../src/debug.h \
+  ../../src/eggdrop.h ../../src/types.h ../../config.h ../../src/debug.h \
   ../../src/logfile.h ../../src/lang.h ../../src/flags.h \
   ../../src/proto.h ../../src/misc_file.h ../../src/language.h \
   ../../src/tclegg.h ../../src/tclhash.h ../../src/chan.h \
   ../../src/users.h ../../src/compat/compat.h \
-  ../../src/compat/inet_aton.h ../../src/compat/snprintf.h \
-  ../../src/compat/memset.h ../../src/compat/memcpy.h \
-  ../../src/compat/strcasecmp.h ../../src/compat/strftime.h snprintf.h
+  ../../src/compat/inet_aton.h ../../src/main.h \
+  ../../src/compat/snprintf.h ../../src/compat/memset.h \
+  ../../src/compat/memcpy.h ../../src/compat/strcasecmp.h \
+  ../../src/compat/strftime.h snprintf.h
 strcasecmp.o: strcasecmp.c ../../src/main.h ../../config.h ../../lush.h \
-  ../../src/eggdrop.h ../../src/types.h ../../src/debug.h \
+  ../../src/eggdrop.h ../../src/types.h ../../config.h ../../src/debug.h \
   ../../src/logfile.h ../../src/lang.h ../../src/flags.h \
   ../../src/proto.h ../../src/misc_file.h ../../src/language.h \
   ../../src/tclegg.h ../../src/tclhash.h ../../src/chan.h \
   ../../src/users.h ../../src/compat/compat.h \
-  ../../src/compat/inet_aton.h ../../src/compat/snprintf.h \
-  ../../src/compat/memset.h ../../src/compat/memcpy.h \
-  ../../src/compat/strcasecmp.h ../../src/compat/strftime.h memcpy.h
+  ../../src/compat/inet_aton.h ../../src/main.h \
+  ../../src/compat/snprintf.h ../../src/compat/memset.h \
+  ../../src/compat/memcpy.h ../../src/compat/strcasecmp.h \
+  ../../src/compat/strftime.h memcpy.h
 strftime.o: strftime.c ../../src/main.h ../../config.h ../../lush.h \
-  ../../src/eggdrop.h ../../src/types.h ../../src/debug.h \
+  ../../src/eggdrop.h ../../src/types.h ../../config.h ../../src/debug.h \
   ../../src/logfile.h ../../src/lang.h ../../src/flags.h \
   ../../src/proto.h ../../src/misc_file.h ../../src/language.h \
   ../../src/tclegg.h ../../src/tclhash.h ../../src/chan.h \
   ../../src/users.h ../../src/compat/compat.h \
-  ../../src/compat/inet_aton.h ../../src/compat/snprintf.h \
-  ../../src/compat/memset.h ../../src/compat/memcpy.h \
-  ../../src/compat/strcasecmp.h ../../src/compat/strftime.h strftime.h
+  ../../src/compat/inet_aton.h ../../src/main.h \
+  ../../src/compat/snprintf.h ../../src/compat/memset.h \
+  ../../src/compat/memcpy.h ../../src/compat/strcasecmp.h \
+  ../../src/compat/strftime.h strftime.h
Index: eggdrop1.7/src/dcc.c
diff -u eggdrop1.7/src/dcc.c:1.9 eggdrop1.7/src/dcc.c:1.10
--- eggdrop1.7/src/dcc.c:1.9	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/dcc.c	Tue Oct  5 19:04:32 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: dcc.c,v 1.9 2004/09/10 01:10:50 wcc Exp $
+ * $Id: dcc.c,v 1.10 2004/10/06 00:04:32 wcc Exp $
  */
 
 #include "main.h"
@@ -26,25 +26,26 @@
 #include "modules.h"
 
 #include "dcc.h"
-#include "md5/md5.h" /* MD5 challenge/response stuff */
-#include "botcmd.h"  /* bot_share, botcmd_t */
-#include "botmsg.h"  /* add_note, simple_sprintf, botnet_send_*, *_in_subtree,
-                      * NEAT_BOTNET */
-#include "botnet.h"  /* nextbot, in_chain, dump_links, addbot, rembot, findbot,
-                      * unvia */
-#include "cmds.h"    /* check_dcc_attrs */
-#include "dccutil.h" /* get_data_ptr, dprintf, chatout, chanout_but, dcc_chatter,
-                      * lostdcc, makepass, not_away, do_boot, detect_dcc_flood,
-                      * flush_lines, new_dcc, add_cr, changeover_dcc, show_banner */
-#include "dns.h"     /* RES_*, dcc_dnshostbyip */
-#include "help.h"    /* help_subst */
-#include "logfile.h" /* putlog, LOG_* */
-#include "match.h"   /* wild_match */
-#include "misc.h"    /* splitc, strncpyz, newsplit */
-#include "net.h"     /* SOCK_*, EGG_OPTION_*, neterror, getsock, killsock, answer,
-                      * open_telnet, tputs, open_telnet_raw, iptostr, sockoptions */
-#include "userrec.h" /* adduser, u_pass_match, deluser, correct_handle,
-                      * write_userfile, touch_laston */
+#include "md5/md5.h"  /* MD5 challenge/response stuff */
+#include "botcmd.h"   /* bot_share, botcmd_t */
+#include "botmsg.h"   /* add_note, simple_sprintf, botnet_send_*, *_in_subtree,
+                       * NEAT_BOTNET */
+#include "botnet.h"   /* nextbot, in_chain, dump_links, addbot, rembot, findbot,
+                       * unvia */
+#include "chanprog.h" /* reaffirm_owners */
+#include "cmds.h"     /* check_dcc_attrs */
+#include "dccutil.h"  /* get_data_ptr, dprintf, chatout, chanout_but, dcc_chatter,
+                       * lostdcc, makepass, not_away, do_boot, detect_dcc_flood,
+                       * flush_lines, new_dcc, add_cr, changeover_dcc, show_banner */
+#include "dns.h"      /* RES_*, dcc_dnshostbyip */
+#include "help.h"     /* help_subst */
+#include "logfile.h"  /* putlog, LOG_* */
+#include "match.h"    /* wild_match */
+#include "misc.h"     /* splitc, strncpyz, newsplit, rmspace */
+#include "net.h"      /* SOCK_*, EGG_OPTION_*, neterror, getsock, killsock, answer,
+                       * open_telnet, tputs, open_telnet_raw, iptostr, sockoptions */
+#include "userrec.h"  /* adduser, u_pass_match, deluser, correct_handle,
+                       * write_userfile, touch_laston */
 
 
 extern struct userrec *userlist;
@@ -58,7 +59,6 @@
 
 struct dcc_t *dcc = NULL;   /* DCC list                                      */
 int dcc_total = 0;          /* Total dcc's                                   */
-char tempdir[121] = "";     /* Temp directory (default: CWD)                 */
 int require_p = 0;          /* Require +p flag to access party line?         */
 int allow_new_telnets = 0;  /* Allow new users to add themselves via telnet? */
 int stealth_telnets = 0;    /* Just display 'Nickname' prompt for telnets.   */
Index: eggdrop1.7/src/dccutil.c
diff -u eggdrop1.7/src/dccutil.c:1.7 eggdrop1.7/src/dccutil.c:1.8
--- eggdrop1.7/src/dccutil.c:1.7	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/dccutil.c	Tue Oct  5 19:04:32 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: dccutil.c,v 1.7 2004/09/10 01:10:50 wcc Exp $
+ * $Id: dccutil.c,v 1.8 2004/10/06 00:04:32 wcc Exp $
  */
 
 #include <sys/stat.h>
@@ -84,6 +84,32 @@
   return tot;
 }
 
+/* Returns the DCC table index for an IDX, but only if the DCT_VALIDIDX
+ * flag is set; -1 if not valid or non-existant.
+ */
+int findidx(int z)
+{
+  int j;
+
+  for (j = 0; j < dcc_total; j++) {
+    if (dcc[j].sock == z && (dcc[j].type->flags & DCT_VALIDIDX))
+      return j;
+  }
+  return -1;
+}
+
+/* Returns the DCC table index for an IDX; -1 if non-existant. */
+int findanyidx(int z)
+{
+  int j;
+
+  for (j = 0; j < dcc_total; j++) {
+    if (dcc[j].sock == z)
+      return j;
+  }
+  return -1;
+}
+
 
 /* Replace \n with \r\n. */
 char *add_cr(char *buf)
Index: eggdrop1.7/src/dccutil.h
diff -u eggdrop1.7/src/dccutil.h:1.5 eggdrop1.7/src/dccutil.h:1.6
--- eggdrop1.7/src/dccutil.h:1.5	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/dccutil.h	Tue Oct  5 19:04:32 2004
@@ -1,4 +1,4 @@
-/* dccutil.h: prototypes for functions in dccutil.c
+/* dccutil.h
  *
  * Copyright (C) 2004 Eggheads Development Team
  *
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: dccutil.h,v 1.5 2004/09/10 01:10:50 wcc Exp $
+ * $Id: dccutil.h,v 1.6 2004/10/06 00:04:32 wcc Exp $
  */
 
 #ifndef _EGG_DCCUTIL_H
@@ -48,6 +48,8 @@
 #endif
 
 #ifndef MAKING_MODS
+int findidx(int);
+int findanyidx(int);
 char *add_cr(char *);
 void remove_crlf(char **);
 void show_banner(int);
Index: eggdrop1.7/src/flags.c
diff -u eggdrop1.7/src/flags.c:1.5 eggdrop1.7/src/flags.c:1.6
--- eggdrop1.7/src/flags.c:1.5	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/flags.c	Tue Oct  5 19:04:32 2004
@@ -1,12 +1,7 @@
-/*
- * flags.c -- handles:
- *   all the flag matching/conversion functions in one neat package :)
+/* flags.c
  *
- * $Id: flags.c,v 1.5 2004/09/10 01:10:50 wcc Exp $
- */
-/*
  * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
+ * Copyright (C) 1999-2004 Eggheads Development Team
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -21,15 +16,18 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * $Id: flags.c,v 1.6 2004/10/06 00:04:32 wcc Exp $
  */
 
 #include "main.h"
 
-#include "dcc.h"     /* struct dcc_t */
-#include "dccutil.h" /* shareout */
-#include "misc.h"    /* strncpyz */
-#include "rfc1459.h" /* rfc_casecmp */
-#include "userent.h" /* list_type_kill */
+#include "chanprog.h" /* findchan_by_dname */
+#include "dcc.h"      /* struct dcc_t */
+#include "dccutil.h"  /* shareout */
+#include "misc.h"     /* strncpyz */
+#include "rfc1459.h"  /* rfc_casecmp */
+#include "userent.h"  /* list_type_kill */
 
 extern int raw_log, require_p, noshare, allow_dk_cmds;
 extern struct dcc_t *dcc;
Index: eggdrop1.7/src/main.c
diff -u eggdrop1.7/src/main.c:1.12 eggdrop1.7/src/main.c:1.13
--- eggdrop1.7/src/main.c:1.12	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/main.c	Tue Oct  5 19:04:32 2004
@@ -19,7 +19,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: main.c,v 1.12 2004/09/10 01:10:50 wcc Exp $
+ * $Id: main.c,v 1.13 2004/10/06 00:04:32 wcc Exp $
  */
 
 #include "main.h"
@@ -40,18 +40,20 @@
 #include "modules.h"
 #include "bg.h"
 
-#include "botmsg.h"  /* botnet_send_* */
-#include "botnet.h"  /* check_botnet_pings */
-#include "dcc.h"     /* DCC_*, STRIP_*, STAT_*, struct chat_info, struct dcc_t */
-#include "dccutil.h" /* dprintf, dcc_chatter, lostdcc, tell_dcc, new_dcc,
-                      * dcc_remove_lost */
-#include "help.h"    /* add_help_reference, help_expmem */
-#include "logfile.h" /* log_t, LOG_*, putlog, logfile_init, logfile_expmem, flushlogs,
-                      * check_logsize */
-#include "misc.h"    /* strncpyz, newsplit */
-#include "net.h"     /* SOCK_*, getmyip, setsock, killsock, dequeue_sockets, sockgets */
-#include "traffic.h" /* traffic_update_out, traffic_reset, init_traffic */
-#include "userrec.h" /* adduser, count_users, write_userfile */
+#include "botmsg.h"   /* botnet_send_* */
+#include "botnet.h"   /* check_botnet_pings */
+#include "cmds.h"     /* tell_verbose_status */
+#include "chanprog.h" /* reaffirm_owners */
+#include "dcc.h"      /* DCC_*, STRIP_*, STAT_*, struct chat_info, struct dcc_t */
+#include "dccutil.h"  /* dprintf, dcc_chatter, lostdcc, tell_dcc, new_dcc,
+                       * dcc_remove_lost */
+#include "help.h"     /* add_help_reference, help_expmem */
+#include "logfile.h"  /* log_t, LOG_*, LF_EXPIRING, putlog, logfile_init, logfile_expmem,
+                       * flushlogs, check_logsize */
+#include "misc.h"     /* strncpyz, newsplit, make_rand_str */
+#include "net.h"      /* SOCK_*, getmyip, setsock, killsock, dequeue_sockets, sockgets */
+#include "traffic.h"  /* traffic_update_out, traffic_reset, init_traffic */
+#include "userrec.h"  /* adduser, count_users, write_userfile */
 
 #ifndef ENABLE_STRIP
 #  include <sys/resource.h>
@@ -67,8 +69,9 @@
 #endif
 
 
-extern char origbotname[], userfile[], botnetnick[];
-extern int dcc_total, conmask, cache_hit, cache_miss, max_logs, quick_logs;
+extern char userfile[], botnetnick[];
+extern int dcc_total, conmask, cache_hit, cache_miss, max_logs, quick_logs,
+           protect_readonly, noshare;
 extern struct dcc_t *dcc;
 extern struct userrec *userlist;
 extern struct chanset_t *chanset;
@@ -109,6 +112,8 @@
 char pid_file[120];                    /* Name of the pid file.     */
 char helpdir[121] = "help/";           /* Directory of help files.  */
 char textdir[121] = "text/";           /* Directory for text files. */
+char tempdir[121] = "";                /* Directory for temp files. */
+char admin[121] = "";                  /* Admin info.               */
 
 int keep_all_logs = 0;                 /* Never erase logfiles?     */
 char logfile_suffix[21] = ".%d%b%Y";   /* Format of logfile suffix. */
@@ -122,13 +127,20 @@
 int die_on_sigterm = 1;   /* Die if bot receives SIGTERM                     */
 int resolve_timeout = 15; /* Hostname/address lookup timeout                 */
 
+char origbotname[NICKLEN + 1]; /* Bot's nick.      */
+char botname[NICKLEN + 1];     /* Primary botname. */
+
 int do_restart = 0;  /* .restart has been called; restart ASAP. */
+
 time_t now;
+static time_t then;
+static int lastmin = 99;
+static struct tm nowtm;
 time_t online_since; /* Time that the bot was started.          */
-char quit_msg[1024]; /* Quit message.                           */
+
+char quit_msg[1024]; /* Quit message. */
 
 
-int expmem_chanprog();
 int expmem_users();
 int expmem_dccutil();
 int expmem_botnet();
@@ -170,7 +182,7 @@
 {
   int tot;
 
-  tot = expmem_chanprog() + expmem_users() + expmem_dccutil() +
+  tot = expmem_users() + expmem_dccutil() +
         expmem_botnet() + expmem_tcl() + expmem_tclhash() + expmem_net() +
         expmem_modules(0) + expmem_language() + expmem_tcldcc() +
         logfile_expmem() + help_expmem();
@@ -237,15 +249,15 @@
   check_tcl_event("sigterm");
   if (die_on_sigterm) {
     botnet_send_chat(-1, botnetnick, "ACK, I've been terminated!");
-    fatal("TERMINATE SIGNAL -- SIGNING OFF", 0);
+    fatal("RECEIVED TERMINATE SIGNAL -- SIGNING OFF!", 0);
   } else
-    putlog(LOG_MISC, "*", "RECEIVED TERMINATE SIGNAL (IGNORING)");
+    putlog(LOG_MISC, "*", "Received TERM signal (ignoring).");
 }
 
 static void got_quit(int z)
 {
   check_tcl_event("sigquit");
-  putlog(LOG_MISC, "*", "RECEIVED QUIT SIGNAL (IGNORING)");
+  putlog(LOG_MISC, "*", "Received QUIT signal (ignoring).");
   return;
 }
 
@@ -261,17 +273,14 @@
   return;
 }
 
-/* A call to resolver (gethostbyname, etc) timed out
- */
+/* A call to resolver (gethostbyname, etc) timed out. */
 static void got_alarm(int z)
 {
   longjmp(alarmret, 1);
-
-  /* -Never reached- */
+  /* Never reached. */
 }
 
-/* Got ILL signal -- log context and continue
- */
+/* Got ILL signal -- log context and continue. */
 static void got_ill(int z)
 {
   check_tcl_event("sigill");
@@ -280,12 +289,13 @@
          cx_line[cx_ptr], (cx_note[cx_ptr][0]) ? cx_note[cx_ptr] : "");
 #endif
 }
+
 static void do_arg(char *s)
 {
   char x[1024], *z = x;
   int i;
 
-  if (s[0] == '-')
+  if (s[0] == '-') {
     for (i = 1; i < strlen(s); i++) {
       switch (s[i]) {
       case 'n':
@@ -311,17 +321,19 @@
           printf("  (patches: %s)\n", z);
         bg_send_quit(BG_ABORT);
         exit(0);
-        break;                  /* this should never be reached */
+        break; /* This should never be reached. */
       case 'h':
         printf("\n%s\n\n", version);
         printf(EGG_USAGE);
         printf("\n");
         bg_send_quit(BG_ABORT);
         exit(0);
-        break;                  /* this should never be reached */
+        break; /* This should never be reached. */
       }
-    } else
+    }
+  } else {
     strncpyz(configfile, s, sizeof configfile);
+  }
 }
 
 void backup_userfile(void)
@@ -333,10 +345,108 @@
   copyfile(userfile, s);
 }
 
-/* Timer info */
-static int lastmin = 99;
-static time_t then;
-static struct tm nowtm;
+static void readconfig()
+{
+  int i;
+  FILE *f;
+  char s[161], rands[8];
+
+  admin[0] = helpdir[0] = tempdir[0] = 0;
+
+  for (i = 0; i < max_logs; i++)
+    logs[i].flags |= LF_EXPIRING;
+
+  /* Turn off read-only variables (make them write-able) for rehash. */
+  protect_readonly = 0;
+
+  /* Now read it */
+  if (!readtclprog(configfile))
+    fatal(MISC_NOCONFIGFILE, 0);
+
+  for (i = 0; i < max_logs; i++) {
+    if (!(logs[i].flags & LF_EXPIRING))
+      continue;
+    if (logs[i].filename != NULL) {
+      nfree(logs[i].filename);
+      logs[i].filename = NULL;
+    }
+    if (logs[i].chname != NULL) {
+      nfree(logs[i].chname);
+      logs[i].chname = NULL;
+    }
+    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;
+
+  if (!botnetnick[0])
+    strncpyz(botnetnick, origbotname, HANDLEN + 1);
+
+  if (!botnetnick[0])
+    fatal("I don't have a botnet nick!\n", 0);
+
+  if (!userfile[0])
+    fatal(MISC_NOUSERFILE2, 0);
+
+  if (!readuserfile(userfile, &userlist)) {
+    if (!make_userfile) {
+      char tmp[178];
+
+      egg_snprintf(tmp, sizeof tmp, MISC_NOUSERFILE, configfile);
+      fatal(tmp, 0);
+    }
+    printf("\n\n%s\n", MISC_NOUSERFILE2);
+    if (module_find("server", 0, 0))
+      printf(MISC_USERFCREATE1, origbotname);
+    printf("%s\n\n", MISC_USERFCREATE2);
+  } else if (make_userfile) {
+    make_userfile = 0;
+    printf("%s\n", MISC_USERFEXISTS);
+  }
+
+  if (helpdir[0])
+    if (helpdir[strlen(helpdir) - 1] != '/')
+      strcat(helpdir, "/");
+
+  if (tempdir[0])
+    if (tempdir[strlen(tempdir) - 1] != '/')
+      strcat(tempdir, "/");
+
+  /* Test tempdir: it's vital.
+   *
+   * Possible file race condition solved by using a random string
+   * and the process id in the filename.
+   * FIXME: This race is only partitially fixed. We could still be
+   *        overwriting an existing file / following a malicious
+   *        link.
+   */
+  make_rand_str(rands, 7); /* create random string */
+  sprintf(s, "%s.test-%u-%s", tempdir, getpid(), rands);
+  f = fopen(s, "w");
+  if (f == NULL)
+    fatal(MISC_CANTWRITETEMP, 0);
+  fclose(f);
+  unlink(s);
+  reaffirm_owners();
+  check_tcl_event("userfile-loaded");
+}
+
+static void rehash()
+{
+  call_hook(HOOK_PRE_REHASH);
+  noshare = 1;
+  clear_userlist(userlist);
+  noshare = 0;
+  userlist = NULL;
+  readconfig();
+}
 
 /* Called once a second.
  *
@@ -347,9 +457,9 @@
   static int cnt = 0;
   int miltime;
 
-  do_check_timers(&utimer);     /* Secondly timers */
+  check_timers(&utimer); /* Secondly timers */
   cnt++;
-  if (cnt >= 10) {              /* Every 10 seconds */
+  if (cnt >= 10) { /* Every 10 seconds */
     cnt = 0;
     check_expired_dcc();
     if (con_chan && !backgrd) {
@@ -368,7 +478,7 @@
     lastmin = (lastmin + 1) % 60;
     call_hook(HOOK_MINUTELY);
     check_expired_ignores();
-    autolink_cycle(NULL);       /* Attempt autolinks */
+    autolink_cycle(NULL); /* Attempt autolinks. */
     /* In case for some reason more than 1 min has passed: */
     while (nowtm.tm_min != lastmin) {
       /* Timer drift, dammit */
@@ -433,7 +543,7 @@
 static void core_minutely()
 {
   check_tcl_time(&nowtm);
-  do_check_timers(&timer);
+  check_timers(&timer);
   if (quick_logs != 0) {
     flushlogs();
     check_logsize();
@@ -504,22 +614,25 @@
 int main(int argc, char **argv)
 {
   int xx, i;
+#ifdef STOP_UAC
+  int nvpair[2];
+#endif
   char buf[520], s[25];
   FILE *f;
   struct sigaction sv;
   struct chanset_t *chan;
-
 #ifndef ENABLE_STRIP
-  /* Make sure it can write core, if you make debug. Else it's pretty
-   * useless (dw)
-   */
-  {
-    struct rlimit cdlim;
+  struct rlimit cdlim;
+#endif
 
-    cdlim.rlim_cur = RLIM_INFINITY;
-    cdlim.rlim_max = RLIM_INFINITY;
-    setrlimit(RLIMIT_CORE, &cdlim);
-  }
+  /* Don't allow Eggdrop to run as root. */
+  if (((int) getuid() == 0) || ((int) geteuid() == 0))
+    fatal("ERROR: Eggdrop will not run as root!", 0);
+
+#ifndef ENABLE_STRIP
+  cdlim.rlim_cur = RLIM_INFINITY;
+  cdlim.rlim_max = RLIM_INFINITY;
+  setrlimit(RLIMIT_CORE, &cdlim);
 #endif
 
   /* Initialise context list */
@@ -537,13 +650,9 @@
   strcat(egg_version, egg_xtra);
 
 #ifdef STOP_UAC
-  {
-    int nvpair[2];
-
-    nvpair[0] = SSIN_UACPROC;
-    nvpair[1] = UAC_NOPRINT;
-    setsysinfo(SSI_NVPAIRS, (char *) nvpair, 1, NULL, 0);
-  }
+  nvpair[0] = SSIN_UACPROC;
+  nvpair[1] = UAC_NOPRINT;
+  setsysinfo(SSI_NVPAIRS, (char *) nvpair, 1, NULL, 0);
 #endif
 
   /* Set up error traps: */
@@ -588,10 +697,6 @@
       do_arg(argv[i]);
   printf("\n%s\n", version);
 
-  /* Don't allow eggdrop to run as root */
-  if (((int) getuid() == 0) || ((int) geteuid() == 0))
-    fatal("ERROR: Eggdrop will not run as root!", 0);
-
   init_dcc_max();
   init_userent();
   logfile_init(0);
@@ -614,7 +719,7 @@
   strncpyz(s, ctime(&now), sizeof s);
   strcpy(&s[11], &s[20]);
   putlog(LOG_ALL, "*", "--- Loading %s (%s)", ver, s);
-  chanprog();
+  readconfig();
   if (!encrypt_pass) {
     printf(MOD_NOCRYPT);
     bg_send_quit(BG_ABORT);
Index: eggdrop1.7/src/md5/Makefile.in
diff -u eggdrop1.7/src/md5/Makefile.in:1.6 eggdrop1.7/src/md5/Makefile.in:1.7
--- eggdrop1.7/src/md5/Makefile.in:1.6	Mon Aug 30 18:58:23 2004
+++ eggdrop1.7/src/md5/Makefile.in	Tue Oct  5 19:04:33 2004
@@ -1,5 +1,5 @@
 # Makefile for src/md5/
-# $Id: Makefile.in,v 1.6 2004/08/30 23:58:23 wcc Exp $
+# $Id: Makefile.in,v 1.7 2004/10/06 00:04:33 wcc Exp $
 
 SHELL = @SHELL@
 top_srcdir = @top_srcdir@
@@ -42,10 +42,11 @@
 #safety hash
 md5c.o: md5c.c md5.h ../../src/compat/compat.h \
   ../../src/compat/inet_aton.h ../../src/main.h ../../config.h \
-  ../../lush.h ../../src/eggdrop.h ../../src/types.h ../../src/debug.h \
-  ../../src/logfile.h ../../src/lang.h ../../src/flags.h \
-  ../../src/proto.h ../../src/misc_file.h ../../src/language.h \
-  ../../src/tclegg.h ../../src/tclhash.h ../../src/chan.h \
-  ../../src/users.h ../../src/compat/snprintf.h ../../src/compat/memset.h \
+  ../../lush.h ../../src/eggdrop.h ../../src/types.h ../../config.h \
+  ../../src/debug.h ../../src/logfile.h ../../src/lang.h \
+  ../../src/flags.h ../../src/proto.h ../../src/misc_file.h \
+  ../../src/language.h ../../src/tclegg.h ../../src/tclhash.h \
+  ../../src/chan.h ../../src/users.h ../../src/compat/compat.h \
+  ../../src/compat/snprintf.h ../../src/compat/memset.h \
   ../../src/compat/memcpy.h ../../src/compat/strcasecmp.h \
   ../../src/compat/strftime.h
Index: eggdrop1.7/src/mem.c
diff -u eggdrop1.7/src/mem.c:1.7 eggdrop1.7/src/mem.c:1.8
--- eggdrop1.7/src/mem.c:1.7	Tue Aug 31 17:56:12 2004
+++ eggdrop1.7/src/mem.c	Tue Oct  5 19:04:32 2004
@@ -3,7 +3,7 @@
  *   memory allocation and deallocation
  *   keeping track of what memory is being used by whom
  *
- * $Id: mem.c,v 1.7 2004/08/31 22:56:12 wcc Exp $
+ * $Id: mem.c,v 1.8 2004/10/06 00:04:32 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -126,18 +126,17 @@
   module_entry *me;
 
   exp[0] = expmem_language();
-  exp[1] = expmem_chanprog();
-  exp[2] = expmem_users();
-  exp[3] = expmem_net();
-  exp[4] = expmem_dccutil();
-  exp[5] = expmem_botnet();
-  exp[6] = expmem_tcl();
-  exp[7] = expmem_tclhash();
-  exp[8] = expmem_modules(1);
-  exp[9] = expmem_tcldcc();
-  exp[10] = expmem_dns();
-  exp[11] = help_expmem();
-  exp[12] = logfile_expmem();
+  exp[1] = expmem_users();
+  exp[2] = expmem_net();
+  exp[3] = expmem_dccutil();
+  exp[4] = expmem_botnet();
+  exp[5] = expmem_tcl();
+  exp[6] = expmem_tclhash();
+  exp[7] = expmem_modules(1);
+  exp[8] = expmem_tcldcc();
+  exp[9] = expmem_dns();
+  exp[10] = help_expmem();
+  exp[11] = logfile_expmem();
 
   for (me = module_list; me; me = me->next)
     me->mem_work = 0;
@@ -153,30 +152,28 @@
     l = memtbl[i].size;
     if (!strcmp(fn, "language.c"))
       use[0] += l;
-    else if (!strcmp(fn, "chanprog.c"))
-      use[1] += l;
     else if (!strcmp(fn, "userrec.c"))
-      use[2] += l;
+      use[1] += l;
     else if (!strcmp(fn, "net.c"))
-      use[3] += l;
+      use[0] += l;
     else if (!strcmp(fn, "dccutil.c"))
-      use[4] += l;
+      use[3] += l;
     else if (!strcmp(fn, "botnet.c"))
-      use[5] += l;
+      use[4] += l;
     else if (!strcmp(fn, "tcl.c"))
-      use[6] += l;
+      use[5] += l;
     else if (!strcmp(fn, "tclhash.c"))
-      use[7] += l;
+      use[6] += l;
     else if (!strcmp(fn, "modules.c"))
-      use[8] += l;
+      use[7] += l;
     else if (!strcmp(fn, "tcldcc.c"))
-      use[0] += l;
+      use[8] += l;
     else if (!strcmp(fn, "dns.c"))
-      use[10] += l;
+      use[9] += l;
     else if (!strcmp(fn, "help.c"))
-      use[11] += l;
+      use[10] += l;
     else if (!strcmp(fn, "logfile.c"))
-      use[12] += l;
+      use[11] += l;
     else if (p) {
       for (me = module_list; me; me = me->next)
         if (!strcmp(fn, me->name))
@@ -191,39 +188,36 @@
         strcpy(fn, "language.c");
         break;
       case 1:
-        strcpy(fn, "chanprog.c");
-        break;
-      case 2:
         strcpy(fn, "userrec.c");
         break;
-      case 3:
+      case 2:
         strcpy(fn, "net.c");
         break;
-      case 4:
+      case 3:
         strcpy(fn, "dccutil.c");
         break;
-      case 5:
+      case 4:
         strcpy(fn, "botnet.c");
         break;
-      case 6:
+      case 5:
         strcpy(fn, "tcl.c");
         break;
-      case 7:
+      case 6:
         strcpy(fn, "tclhash.c");
         break;
-      case 8:
+      case 7:
         strcpy(fn, "modules.c");
         break;
-      case 9:
+      case 8:
         strcpy(fn, "tcldcc.c");
         break;
-      case 10:
+      case 9:
         strcpy(fn, "dns.c");
         break;
-      case 11:
+      case 10:
         strcpy(fn, "help.c");
         break;
-      case 12:
+      case 11:
         strcpy(fn, "logfile.c");
         break;
     }
Index: eggdrop1.7/src/misc.c
diff -u eggdrop1.7/src/misc.c:1.12 eggdrop1.7/src/misc.c:1.13
--- eggdrop1.7/src/misc.c:1.12	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/misc.c	Tue Oct  5 19:04:33 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: misc.c,v 1.12 2004/09/10 01:10:50 wcc Exp $
+ * $Id: misc.c,v 1.13 2004/10/06 00:04:33 wcc Exp $
  */
 
 #include "main.h"
@@ -40,11 +40,8 @@
 #include "userrec.h" /* write_userfile */
 
 
-extern struct dcc_t *dcc;
-extern struct chanset_t *chanset;
 extern char botnetnick[];
-extern int con_chan, strict_ident;
-extern time_t now;
+extern int strict_ident;
 
 
 int my_strcpy(register char *a, register char *b)
@@ -149,6 +146,25 @@
   return r;
 }
 
+/* Remove leading and trailing whitespace. */
+void rmspace(char *s)
+{
+  register char *p = NULL, *q = NULL;
+
+  if (!s || !*s)
+    return;
+
+  /* Remove trailing whitespace. */
+  for (q = s + strlen(s) - 1; q >= s && egg_isspace(*q); q--);
+  *(q + 1) = 0;
+
+  /* Remove leading whitespace. */
+  for (p = s; egg_isspace(*p); p++);
+
+  if (p != s)
+    memmove(s, p, q - p + 2);
+}
+
 /* Creates a mask from a nick!user at host.
  * Examples:
  *   abc!user at a.b.host -> *!user@*.b.host
Index: eggdrop1.7/src/misc.h
diff -u eggdrop1.7/src/misc.h:1.4 eggdrop1.7/src/misc.h:1.5
--- eggdrop1.7/src/misc.h:1.4	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/misc.h	Tue Oct  5 19:04:33 2004
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: misc.h,v 1.4 2004/09/10 01:10:50 wcc Exp $
+ * $Id: misc.h,v 1.5 2004/10/06 00:04:33 wcc Exp $
  */
 
 #ifndef _EGG_MISC_H
@@ -61,6 +61,7 @@
 void splitc(char *, char *, char);
 void splitcn(char *, char *, char, size_t);
 char *newsplit(char **);
+void rmspace(char *);
 void maskhost(const char *, char *, int);
 char *splitnick(char **);
 void dumplots(int, const char *, char *);
Index: eggdrop1.7/src/mod/assoc.mod/Makefile
diff -u eggdrop1.7/src/mod/assoc.mod/Makefile:1.6 eggdrop1.7/src/mod/assoc.mod/Makefile:1.7
--- eggdrop1.7/src/mod/assoc.mod/Makefile:1.6	Thu Sep  9 20:10:51 2004
+++ eggdrop1.7/src/mod/assoc.mod/Makefile	Tue Oct  5 19:04:33 2004
@@ -1,5 +1,5 @@
 # Makefile for src/mod/assoc.mod/.
-# $Id: Makefile,v 1.6 2004/09/10 01:10:51 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:33 wcc Exp $
 
 MOD_NAME = assoc
 srcdir = .
@@ -35,13 +35,14 @@
 #safety hash
 ../assoc.o: assoc.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h assoc.h
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h assoc.h
Index: eggdrop1.7/src/mod/blowfish.mod/Makefile
diff -u eggdrop1.7/src/mod/blowfish.mod/Makefile:1.6 eggdrop1.7/src/mod/blowfish.mod/Makefile:1.7
--- eggdrop1.7/src/mod/blowfish.mod/Makefile:1.6	Thu Sep  9 20:10:51 2004
+++ eggdrop1.7/src/mod/blowfish.mod/Makefile	Tue Oct  5 19:04:33 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/blowfish.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:51 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:33 wcc Exp $
 
 MOD_NAME = blowfish
 srcdir = .
@@ -36,13 +36,15 @@
 #safety hash
 ../blowfish.o: blowfish.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h blowfish.h bf_tab.h
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h \
+  blowfish.h bf_tab.h
Index: eggdrop1.7/src/mod/channels.mod/Makefile
diff -u eggdrop1.7/src/mod/channels.mod/Makefile:1.6 eggdrop1.7/src/mod/channels.mod/Makefile:1.7
--- eggdrop1.7/src/mod/channels.mod/Makefile:1.6	Thu Sep  9 20:10:51 2004
+++ eggdrop1.7/src/mod/channels.mod/Makefile	Tue Oct  5 19:04:33 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/channels.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:51 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:33 wcc Exp $
 
 MOD_NAME = channels
 srcdir = .
@@ -36,14 +36,15 @@
 #safety hash
 ../channels.o: channels.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h channels.h cmdschan.c tclchan.c userchan.c \
-  udefchan.c
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h \
+  channels.h cmdschan.c tclchan.c userchan.c udefchan.c
Index: eggdrop1.7/src/mod/compress.mod/Makefile.in
diff -u eggdrop1.7/src/mod/compress.mod/Makefile.in:1.6 eggdrop1.7/src/mod/compress.mod/Makefile.in:1.7
--- eggdrop1.7/src/mod/compress.mod/Makefile.in:1.6	Thu Sep  9 20:10:51 2004
+++ eggdrop1.7/src/mod/compress.mod/Makefile.in	Tue Oct  5 19:04:33 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/compress.mod/.
 #
-# $Id: Makefile.in,v 1.6 2004/09/10 01:10:51 wcc Exp $
+# $Id: Makefile.in,v 1.7 2004/10/06 00:04:33 wcc Exp $
 
 MOD_NAME = compress
 ZLIB = @ZLIB@
@@ -40,14 +40,15 @@
 #safety hash
 ../compress.o: compress.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h ../../../src/mod/share.mod/share.h compress.h \
-  tclcompress.c
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h \
+  ../../../src/mod/share.mod/share.h compress.h tclcompress.c
Index: eggdrop1.7/src/mod/console.mod/Makefile
diff -u eggdrop1.7/src/mod/console.mod/Makefile:1.6 eggdrop1.7/src/mod/console.mod/Makefile:1.7
--- eggdrop1.7/src/mod/console.mod/Makefile:1.6	Thu Sep  9 20:10:51 2004
+++ eggdrop1.7/src/mod/console.mod/Makefile	Tue Oct  5 19:04:33 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/console.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:51 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:33 wcc Exp $
 
 MOD_NAME = console
 srcdir = .
@@ -36,13 +36,14 @@
 #safety hash
 ../console.o: console.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h console.h
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h console.h
Index: eggdrop1.7/src/mod/ctcp.mod/Makefile
diff -u eggdrop1.7/src/mod/ctcp.mod/Makefile:1.6 eggdrop1.7/src/mod/ctcp.mod/Makefile:1.7
--- eggdrop1.7/src/mod/ctcp.mod/Makefile:1.6	Thu Sep  9 20:10:51 2004
+++ eggdrop1.7/src/mod/ctcp.mod/Makefile	Tue Oct  5 19:04:33 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/ctcp.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:51 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:33 wcc Exp $
 
 MOD_NAME = ctcp
 srcdir = .
@@ -36,13 +36,15 @@
 #safety hash
 ../ctcp.o: ctcp.c ctcp.h ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h ../../../src/mod/server.mod/server.h
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h \
+  ../../../src/mod/server.mod/server.h
Index: eggdrop1.7/src/mod/dns.mod/Makefile.in
diff -u eggdrop1.7/src/mod/dns.mod/Makefile.in:1.6 eggdrop1.7/src/mod/dns.mod/Makefile.in:1.7
--- eggdrop1.7/src/mod/dns.mod/Makefile.in:1.6	Thu Sep  9 20:10:51 2004
+++ eggdrop1.7/src/mod/dns.mod/Makefile.in	Tue Oct  5 19:04:33 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/dns.mod/.
 #
-# $Id: Makefile.in,v 1.6 2004/09/10 01:10:51 wcc Exp $
+# $Id: Makefile.in,v 1.7 2004/10/06 00:04:33 wcc Exp $
 
 MOD_NAME = dns
 RESLIB = @RESLIB@
@@ -41,13 +41,15 @@
 #safety hash
 ../dns.o: dns.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h dns.h coredns.c
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h dns.h \
+  coredns.c
Index: eggdrop1.7/src/mod/filesys.mod/Makefile
diff -u eggdrop1.7/src/mod/filesys.mod/Makefile:1.6 eggdrop1.7/src/mod/filesys.mod/Makefile:1.7
--- eggdrop1.7/src/mod/filesys.mod/Makefile:1.6	Thu Sep  9 20:10:51 2004
+++ eggdrop1.7/src/mod/filesys.mod/Makefile	Tue Oct  5 19:04:33 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/filesys.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:51 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:33 wcc Exp $
 
 MOD_NAME = filesys
 srcdir = .
@@ -36,16 +36,17 @@
 #safety hash
 ../filesys.o: filesys.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h filedb3.h filesys.h \
-  ../../../src/mod/transfer.mod/transfer.h files.h dbcompat.h filelist.h \
-  ../../../src/cmds.h files.c ../../../src/stat.h filedb3.c tclfiles.c \
-  dbcompat.c filelist.c
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h filedb3.h \
+  filesys.h ../../../src/lang.h ../../../src/mod/transfer.mod/transfer.h \
+  files.h dbcompat.h filelist.h ../../../src/cmds.h files.c \
+  ../../../src/stat.h filedb3.c tclfiles.c dbcompat.c filelist.c
Index: eggdrop1.7/src/mod/irc.mod/Makefile
diff -u eggdrop1.7/src/mod/irc.mod/Makefile:1.6 eggdrop1.7/src/mod/irc.mod/Makefile:1.7
--- eggdrop1.7/src/mod/irc.mod/Makefile:1.6	Thu Sep  9 20:10:51 2004
+++ eggdrop1.7/src/mod/irc.mod/Makefile	Tue Oct  5 19:04:34 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/irc.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:51 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:34 wcc Exp $
 
 MOD_NAME = irc
 srcdir = .
@@ -36,15 +36,17 @@
 #safety hash
 ../irc.o: irc.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h irc.h ../../../src/mod/server.mod/server.h \
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h irc.h \
+  ../../../src/mod/server.mod/server.h \
   ../../../src/mod/channels.mod/channels.h chan.c mode.c cmdsirc.c \
   msgcmds.c tclirc.c
Index: eggdrop1.7/src/mod/notes.mod/Makefile
diff -u eggdrop1.7/src/mod/notes.mod/Makefile:1.6 eggdrop1.7/src/mod/notes.mod/Makefile:1.7
--- eggdrop1.7/src/mod/notes.mod/Makefile:1.6	Thu Sep  9 20:10:51 2004
+++ eggdrop1.7/src/mod/notes.mod/Makefile	Tue Oct  5 19:04:34 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/notes.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:51 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:34 wcc Exp $
 
 MOD_NAME = notes
 srcdir = .
@@ -36,13 +36,15 @@
 #safety hash
 ../notes.o: notes.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h notes.h cmdsnote.c
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h notes.h \
+  cmdsnote.c
Index: eggdrop1.7/src/mod/seen.mod/Makefile
diff -u eggdrop1.7/src/mod/seen.mod/Makefile:1.6 eggdrop1.7/src/mod/seen.mod/Makefile:1.7
--- eggdrop1.7/src/mod/seen.mod/Makefile:1.6	Thu Sep  9 20:10:51 2004
+++ eggdrop1.7/src/mod/seen.mod/Makefile	Tue Oct  5 19:04:34 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/seen.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:51 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:34 wcc Exp $
 
 MOD_NAME = seen
 srcdir = .
@@ -36,13 +36,16 @@
 #safety hash
 ../seen.o: seen.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h ../../../src/mod/channels.mod/channels.h
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h \
+  ../../../src/users.h ../../../src/chan.h \
+  ../../../src/mod/channels.mod/channels.h
Index: eggdrop1.7/src/mod/server.mod/Makefile
diff -u eggdrop1.7/src/mod/server.mod/Makefile:1.6 eggdrop1.7/src/mod/server.mod/Makefile:1.7
--- eggdrop1.7/src/mod/server.mod/Makefile:1.6	Thu Sep  9 20:10:51 2004
+++ eggdrop1.7/src/mod/server.mod/Makefile	Tue Oct  5 19:04:34 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/server.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:51 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:34 wcc Exp $
 
 MOD_NAME = server
 srcdir = .
@@ -36,13 +36,15 @@
 #safety hash
 ../server.o: server.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h server.h servmsg.c cmdsserv.c tclserv.c
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h server.h \
+  servmsg.c cmdsserv.c tclserv.c
Index: eggdrop1.7/src/mod/share.mod/Makefile
diff -u eggdrop1.7/src/mod/share.mod/Makefile:1.6 eggdrop1.7/src/mod/share.mod/Makefile:1.7
--- eggdrop1.7/src/mod/share.mod/Makefile:1.6	Thu Sep  9 20:10:52 2004
+++ eggdrop1.7/src/mod/share.mod/Makefile	Tue Oct  5 19:04:34 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/share.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:52 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:34 wcc Exp $
 
 MOD_NAME = share
 srcdir = .
@@ -36,15 +36,18 @@
 #safety hash
 ../share.o: share.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h ../../../src/mod/transfer.mod/transfer.h \
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h \
+  ../../../src/chan.h ../../../src/users.h \
+  ../../../src/mod/transfer.mod/transfer.h \
   ../../../src/mod/channels.mod/channels.h ../../../src/botcmd.h share.h \
   uf_features.c
Index: eggdrop1.7/src/mod/transfer.mod/Makefile
diff -u eggdrop1.7/src/mod/transfer.mod/Makefile:1.6 eggdrop1.7/src/mod/transfer.mod/Makefile:1.7
--- eggdrop1.7/src/mod/transfer.mod/Makefile:1.6	Thu Sep  9 20:10:52 2004
+++ eggdrop1.7/src/mod/transfer.mod/Makefile	Tue Oct  5 19:04:34 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/transfer.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:52 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:34 wcc Exp $
 
 MOD_NAME = transfer
 srcdir = .
@@ -36,14 +36,16 @@
 #safety hash
 ../transfer.o: transfer.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h transfer.h transferfstat.c transferqueue.c \
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h \
+  ../../../src/users.h transfer.h transferfstat.c transferqueue.c \
   tcltransfer.c
Index: eggdrop1.7/src/mod/uptime.mod/Makefile
diff -u eggdrop1.7/src/mod/uptime.mod/Makefile:1.6 eggdrop1.7/src/mod/uptime.mod/Makefile:1.7
--- eggdrop1.7/src/mod/uptime.mod/Makefile:1.6	Thu Sep  9 20:10:52 2004
+++ eggdrop1.7/src/mod/uptime.mod/Makefile	Tue Oct  5 19:04:34 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/uptime.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:52 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:34 wcc Exp $
 
 MOD_NAME = uptime
 srcdir = .
@@ -36,13 +36,14 @@
 #safety hash
 ../uptime.o: uptime.c uptime.h ../module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h ../server.mod/server.h
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../modvals.h ../../../src/types.h \
+  ../../../src/botmsg.h ../../../src/dcc.h ../../../src/dccutil.h \
+  ../../../src/dcc.h ../../../src/dns.h ../../../src/logfile.h \
+  ../../../src/misc.h ../../../src/net.h ../server.mod/server.h
Index: eggdrop1.7/src/mod/wire.mod/Makefile
diff -u eggdrop1.7/src/mod/wire.mod/Makefile:1.6 eggdrop1.7/src/mod/wire.mod/Makefile:1.7
--- eggdrop1.7/src/mod/wire.mod/Makefile:1.6	Thu Sep  9 20:10:52 2004
+++ eggdrop1.7/src/mod/wire.mod/Makefile	Tue Oct  5 19:04:34 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/wire.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:52 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:34 wcc Exp $
 
 MOD_NAME = wire
 srcdir = .
@@ -36,13 +36,15 @@
 #safety hash
 ../wire.o: wire.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h wire.h
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h \
+  ../../../src/users.h ../../../src/chan.h wire.h
Index: eggdrop1.7/src/mod/woobie.mod/Makefile
diff -u eggdrop1.7/src/mod/woobie.mod/Makefile:1.6 eggdrop1.7/src/mod/woobie.mod/Makefile:1.7
--- eggdrop1.7/src/mod/woobie.mod/Makefile:1.6	Thu Sep  9 20:10:52 2004
+++ eggdrop1.7/src/mod/woobie.mod/Makefile	Tue Oct  5 19:04:34 2004
@@ -1,6 +1,6 @@
 # Makefile for src/mod/woobie.mod/.
 #
-# $Id: Makefile,v 1.6 2004/09/10 01:10:52 wcc Exp $
+# $Id: Makefile,v 1.7 2004/10/06 00:04:34 wcc Exp $
 
 MOD_NAME = woobie
 srcdir = .
@@ -36,13 +36,14 @@
 #safety hash
 ../woobie.o: woobie.c ../../../src/mod/module.h ../../../src/main.h \
   ../../../config.h ../../../lush.h ../../../src/eggdrop.h \
-  ../../../src/types.h ../../../src/debug.h ../../../src/logfile.h \
-  ../../../src/lang.h ../../../src/flags.h ../../../src/language.h \
-  ../../../src/tclegg.h ../../../src/tclhash.h ../../../src/chan.h \
-  ../../../src/users.h ../../../src/compat/compat.h \
-  ../../../src/compat/inet_aton.h ../../../src/compat/snprintf.h \
-  ../../../src/compat/memset.h ../../../src/compat/memcpy.h \
-  ../../../src/compat/strcasecmp.h ../../../src/compat/strftime.h \
-  ../../../src/mod/modvals.h ../../../src/botmsg.h ../../../src/dcc.h \
-  ../../../src/dccutil.h ../../../src/dns.h ../../../src/misc.h \
-  ../../../src/net.h
+  ../../../src/types.h ../../../config.h ../../../src/debug.h \
+  ../../../src/logfile.h ../../../src/lang.h ../../../src/flags.h \
+  ../../../src/language.h ../../../src/tclegg.h ../../../src/tclhash.h \
+  ../../../src/chan.h ../../../src/users.h ../../../src/compat/compat.h \
+  ../../../src/compat/inet_aton.h ../../../src/main.h \
+  ../../../src/compat/snprintf.h ../../../src/compat/memset.h \
+  ../../../src/compat/memcpy.h ../../../src/compat/strcasecmp.h \
+  ../../../src/compat/strftime.h ../../../src/mod/modvals.h \
+  ../../../src/types.h ../../../src/botmsg.h ../../../src/dcc.h \
+  ../../../src/dccutil.h ../../../src/dcc.h ../../../src/dns.h \
+  ../../../src/logfile.h ../../../src/misc.h ../../../src/net.h
Index: eggdrop1.7/src/modules.c
diff -u eggdrop1.7/src/modules.c:1.10 eggdrop1.7/src/modules.c:1.11
--- eggdrop1.7/src/modules.c:1.10	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/modules.c	Tue Oct  5 19:04:33 2004
@@ -19,7 +19,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: modules.c,v 1.10 2004/09/10 01:10:50 wcc Exp $
+ * $Id: modules.c,v 1.11 2004/10/06 00:04:33 wcc Exp $
  */
 
 #include <ctype.h>
@@ -31,6 +31,7 @@
 #include "botcmd.h"
 #include "botmsg.h"
 #include "botnet.h"
+#include "chanprog.h"
 #include "cmds.h"
 #include "dcc.h"
 #include "dccutil.h"
Index: eggdrop1.7/src/net.c
diff -u eggdrop1.7/src/net.c:1.10 eggdrop1.7/src/net.c:1.11
--- eggdrop1.7/src/net.c:1.10	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/net.c	Tue Oct  5 19:04:33 2004
@@ -3,7 +3,7 @@
  * This is hereby released into the public domain.
  * Robey Pointer, robey at netcom.com
  *
- * $Id: net.c,v 1.10 2004/09/10 01:10:50 wcc Exp $
+ * $Id: net.c,v 1.11 2004/10/06 00:04:33 wcc Exp $
  */
 
 #include <fcntl.h>
@@ -26,7 +26,7 @@
 
 #include "net.h"
 #include "dcc.h"     /* struct dcc_t */
-#include "dccutil.h" /* dprintf */
+#include "dccutil.h" /* dprintf, findanyidx */
 #include "misc.h"    /* strncpyz, extracthostname */
 #include "logfile.h" /* putlog, LOG_* */
 #include "traffic.h" /* traffic_update_out */
Index: eggdrop1.7/src/patch.h
diff -u eggdrop1.7/src/patch.h:1.17 eggdrop1.7/src/patch.h:1.18
--- eggdrop1.7/src/patch.h:1.17	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/patch.h	Tue Oct  5 19:04:33 2004
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.17 2004/09/10 01:10:50 wcc Exp $
+ * $Id: patch.h,v 1.18 2004/10/06 00:04:33 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1094778620");            /* current unixtime */
+patch("1097020834");            /* current unixtime */
 /*
  *
  *
  */
-patch("morecleanups");
+patch("morecleanups2");
 /*
  *
  *
Index: eggdrop1.7/src/proto.h
diff -u eggdrop1.7/src/proto.h:1.11 eggdrop1.7/src/proto.h:1.12
--- eggdrop1.7/src/proto.h:1.11	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/proto.h	Tue Oct  5 19:04:33 2004
@@ -7,7 +7,7 @@
  * because they use structures in those
  * (saves including those .h files EVERY time) - Beldin
  *
- * $Id: proto.h,v 1.11 2004/09/10 01:10:50 wcc Exp $
+ * $Id: proto.h,v 1.12 2004/10/06 00:04:33 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -48,23 +48,6 @@
 extern int (*match_noterej) (struct userrec *, char *);
 #endif
 
-/* chanprog.c */
-void tell_verbose_uptime(int);
-void tell_verbose_status(int);
-void tell_settings(int);
-int isowner(char *);
-void reaffirm_owners();
-void rehash();
-void reload();
-void chanprog();
-void check_timers();
-void check_utimers();
-void rmspace(char *s);
-void check_timers();
-void set_chanlist(const char *host, struct userrec *rec);
-void clear_chanlist(void);
-void clear_chanlist_member(const char *nick);
-
 /* mem.c */
 void *n_malloc(int, const char *, int);
 void *n_realloc(void *, int, const char *, int);
@@ -78,8 +61,6 @@
 void unprotect_tcl();
 void do_tcl(char *, char *);
 int readtclprog(char *fname);
-int findidx(int);
-int findanyidx(int);
 
 /* users.c */
 void addignore(char *, char *, char *, time_t);
Index: eggdrop1.7/src/tcl.c
diff -u eggdrop1.7/src/tcl.c:1.8 eggdrop1.7/src/tcl.c:1.9
--- eggdrop1.7/src/tcl.c:1.8	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/tcl.c	Tue Oct  5 19:04:33 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: tcl.c,v 1.8 2004/09/10 01:10:50 wcc Exp $
+ * $Id: tcl.c,v 1.9 2004/10/06 00:04:33 wcc Exp $
  */
 
 #include <stdlib.h>             /* getenv()                             */
@@ -60,12 +60,12 @@
            dupwait_timeout, egg_numver, share_unlinks, protect_telnet,
            sort_users, resolve_timeout, default_uflags, userfile_perm, tands;
 extern struct dcc_t *dcc;
-extern tcl_timer_t *timer, *utimer;
-Tcl_Interp *interp;
-
-
-int protect_readonly = 0; /* Enable read-only protection? */
 
+Tcl_Interp *interp;
+tcl_timer_t *timer = NULL;        /* Minutely timer               */
+tcl_timer_t *utimer = NULL;       /* Secondly timer               */
+unsigned long timer_id = 1;       /* Next timer will have this ID */
+int protect_readonly = 0;         /* Enable read-only protection? */
 char whois_fields[1025] = "";
 int dcc_flood_thr = 3;
 int use_invites = 0;
@@ -85,26 +85,121 @@
 int utftot = 0;
 int clientdata_stuff = 0;
 
-/* Compatability for removed settings.*/
-int strict_servernames = 0, enable_simul = 1, use_console_r = 0, debug_output = 0;
-
 
 /* Prototypes for Tcl */
 Tcl_Interp *Tcl_CreateInterp();
 
 int expmem_tcl()
 {
-  return strtot + utftot + clientdata_stuff;
+  tcl_timer_t *t;
+  int tot = 0;
+
+  for (t = timer; t; t = t->next)
+    tot += sizeof(tcl_timer_t) + strlen(t->cmd) + 1;
+  for (t = utimer; t; t = t->next)
+    tot += sizeof(tcl_timer_t) + strlen(t->cmd) + 1;
+  tot += strtot + utftot + clientdata_stuff;
+  return tot;
+}
+
+/* Add a timer. */
+unsigned long add_timer(tcl_timer_t **stack, int elapse, char *cmd,
+                        unsigned long prev_id)
+{
+  tcl_timer_t *old = (*stack);
+
+  *stack = nmalloc(sizeof **stack);
+  (*stack)->next = old;
+  (*stack)->mins = elapse;
+  (*stack)->cmd = nmalloc(strlen(cmd) + 1);
+  strcpy((*stack)->cmd, cmd);
+  /* If it's just being added back and already had an id,
+   * don't create a new one.
+   */
+  if (prev_id > 0)
+    (*stack)->id = prev_id;
+  else
+    (*stack)->id = timer_id++;
+  return (*stack)->id;
+}
+
+/* Remove a timer, by id. */
+int remove_timer(tcl_timer_t **stack, unsigned long id)
+{
+  tcl_timer_t *old;
+  int ok = 0;
+
+  while (*stack) {
+    if ((*stack)->id == id) {
+      ok++;
+      old = *stack;
+      *stack = ((*stack)->next);
+      nfree(old->cmd);
+      nfree(old);
+    } else
+      stack = &((*stack)->next);
+  }
+  return ok;
 }
 
-int findidx(int z)
+/* Check timers, execute the ones that have expired. */
+void check_timers(tcl_timer_t **stack)
 {
-  int j;
+  tcl_timer_t *mark = *stack, *old = NULL;
+  char x[16];
 
-  for (j = 0; j < dcc_total; j++)
-    if ((dcc[j].sock == z) && (dcc[j].type->flags & DCT_VALIDIDX))
-      return j;
-  return -1;
+  /* New timers could be added by a Tcl script inside a current timer so just
+   * clear out the timer list completely, and add any unexpired timers back on.
+   */
+  *stack = NULL;
+  while (mark) {
+    if (mark->mins > 0)
+      mark->mins--;
+    old = mark;
+    mark = mark->next;
+    if (!old->mins) {
+      egg_snprintf(x, sizeof x, "timer%lu", old->id);
+      do_tcl(x, old->cmd);
+      nfree(old->cmd);
+      nfree(old);
+    } else {
+      old->next = *stack;
+      *stack = old;
+    }
+  }
+}
+
+/* Wipe all timers. */
+void wipe_timers(Tcl_Interp *irp, tcl_timer_t **stack)
+{
+  tcl_timer_t *mark = *stack, *old;
+
+  while (mark) {
+    old = mark;
+    mark = mark->next;
+    nfree(old->cmd);
+    nfree(old);
+  }
+  *stack = NULL;
+}
+
+/* Return list of timers. */
+void list_timers(Tcl_Interp *irp, tcl_timer_t *stack)
+{
+  char mins[10], id[16], *x;
+  EGG_CONST char *argv[3];
+  tcl_timer_t *mark;
+
+  for (mark = stack; mark; mark = mark->next) {
+    egg_snprintf(mins, sizeof mins, "%u", mark->mins);
+    egg_snprintf(id, sizeof id, "timer%lu", mark->id);
+    argv[0] = mins;
+    argv[1] = mark->cmd;
+    argv[2] = id;
+    x = Tcl_Merge(3, argv);
+    Tcl_AppendElement(irp, x);
+    Tcl_Free((char *) x);
+  }
 }
 
 static void botnet_change(char *new)
@@ -517,10 +612,6 @@
   {"userfile-perm",         &userfile_perm,        0},
   {"copy-to-tmp",           &copy_to_tmp,          0},
   {"quiet-reject",          &quiet_reject,         0},
-  {"strict-servernames",    &strict_servernames,   0}, /* compat */
-  {"enable-simul",          &enable_simul,         0}, /* compat */
-  {"debug-output",          &debug_output,         0}, /* compat */
-  {"use-console-r",         &use_console_r,        0}, /* compat */
   {NULL,                    NULL,                  0}
 };
 
Index: eggdrop1.7/src/tcldcc.c
diff -u eggdrop1.7/src/tcldcc.c:1.10 eggdrop1.7/src/tcldcc.c:1.11
--- eggdrop1.7/src/tcldcc.c:1.10	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/tcldcc.c	Tue Oct  5 19:04:33 2004
@@ -17,25 +17,26 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: tcldcc.c,v 1.10 2004/09/10 01:10:50 wcc Exp $
+ * $Id: tcldcc.c,v 1.11 2004/10/06 00:04:33 wcc Exp $
  */
 
 #include "main.h"
 #include "modules.h"
 
 #include "tcldcc.h"
-#include "botmsg.h"  /* int_to_base10, botnet_send_* */
-#include "botnet.h"  /* lastbot, nextbot, botlink, butunlink */
-#include "cmds.h"    /* stripmodes, stripmasktype */
-#include "dcc.h"     /* DCC_*, DCT_*, LSTN_*, STAT_*, PLSTAT_*, EGG_OPTION_*,
-                      * struct script_info, struct dcc_t */
-#include "dccutil.h" /* get_data_ptr, chatout, chanout_but, lostdcc, killtransfer,
-                      * not_away, set_away, do_boot, new_dcc */
-#include "logfile.h" /* LOG_*, putlog, logmodes, masktype */
-#include "misc.h"    /* splitc, strncpyz, dumplots */
-#include "net.h"     /* SOCK_*, getmyip, neterror, getsock, killsock, open_listen,
-                      * tputs, open_telnet_raw, sockoptions */
-#include "userrec.h" /* write_userfile */
+#include "botmsg.h"   /* int_to_base10, botnet_send_* */
+#include "botnet.h"   /* lastbot, nextbot, botlink, butunlink */
+#include "chanprog.h" /* findchan_by_dname */
+#include "cmds.h"     /* stripmodes, stripmasktype */
+#include "dcc.h"      /* DCC_*, DCT_*, LSTN_*, STAT_*, PLSTAT_*, EGG_OPTION_*,
+                       * struct script_info, struct dcc_t */
+#include "dccutil.h"  /* get_data_ptr, chatout, chanout_but, lostdcc, killtransfer,
+                       * not_away, set_away, do_boot, new_dcc, findidx */
+#include "logfile.h"  /* LOG_*, putlog, logmodes, masktype */
+#include "misc.h"     /* splitc, strncpyz, dumplots */
+#include "net.h"      /* SOCK_*, getmyip, neterror, getsock, killsock, open_listen,
+                       * tputs, open_telnet_raw, sockoptions */
+#include "userrec.h"  /* write_userfile */
 
 
 extern Tcl_Interp *interp;
Index: eggdrop1.7/src/tclegg.h
diff -u eggdrop1.7/src/tclegg.h:1.1.1.1 eggdrop1.7/src/tclegg.h:1.2
--- eggdrop1.7/src/tclegg.h:1.1.1.1	Tue Aug 24 20:02:05 2004
+++ eggdrop1.7/src/tclegg.h	Tue Oct  5 19:04:33 2004
@@ -2,7 +2,7 @@
  * tclegg.h
  *   stuff used by tcl.c and tclhash.c
  *
- * $Id: tclegg.h,v 1.1.1.1 2004/08/25 01:02:05 wcc Exp $
+ * $Id: tclegg.h,v 1.2 2004/10/06 00:04:33 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -83,12 +83,6 @@
         }                                                               \
 } while (0)
 
-unsigned long add_timer(tcl_timer_t **, int, char *, unsigned long);
-int remove_timer(tcl_timer_t **, unsigned long);
-void list_timers(Tcl_Interp *, tcl_timer_t *);
-void wipe_timers(Tcl_Interp *, tcl_timer_t **);
-void do_check_timers(tcl_timer_t **);
-
 typedef struct _tcl_strings {
   char *name;
   char *buf;
@@ -119,6 +113,12 @@
   void *cdata;
 } cd_tcl_cmd;
 
+unsigned long add_timer(tcl_timer_t **, int, char *, unsigned long);
+int remove_timer(tcl_timer_t **, unsigned long);
+void check_timers(tcl_timer_t **);
+void wipe_timers(Tcl_Interp *, tcl_timer_t **);
+void list_timers(Tcl_Interp *, tcl_timer_t *);
+
 void add_tcl_commands(tcl_cmds *);
 void add_cd_tcl_cmds(cd_tcl_cmd *);
 void rem_tcl_commands(tcl_cmds *);
Index: eggdrop1.7/src/tclhash.c
diff -u eggdrop1.7/src/tclhash.c:1.11 eggdrop1.7/src/tclhash.c:1.12
--- eggdrop1.7/src/tclhash.c:1.11	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/tclhash.c	Tue Oct  5 19:04:33 2004
@@ -7,7 +7,7 @@
  *   (non-Tcl) procedure lookups for msg/dcc/file commands
  *   (Tcl) binding internal procedures to msg/dcc/file commands
  *
- * $Id: tclhash.c,v 1.11 2004/09/10 01:10:50 wcc Exp $
+ * $Id: tclhash.c,v 1.12 2004/10/06 00:04:33 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -35,7 +35,7 @@
 #include "tclhash.h"
 #include "botmsg.h"  /* int_to_base10 */
 #include "dcc.h"     /* struct dcc_t */
-#include "dccutil.h" /* dprintf */
+#include "dccutil.h" /* dprintf, findidx, findanyidx */
 #include "logfile.h" /* putlog, LOG_* */
 #include "match.h"   /* wild_match_per */
 #include "misc.h"    /* newsplit */
@@ -610,16 +610,6 @@
   return TCL_OK;
 }
 
-int findanyidx(register int z)
-{
-  register int j;
-
-  for (j = 0; j < dcc_total; j++)
-    if (dcc[j].sock == z)
-      return j;
-  return -1;
-}
-
 static int builtin_charidx STDVAR
 {
   Function F = (Function) cd;
Index: eggdrop1.7/src/tclmisc.c
diff -u eggdrop1.7/src/tclmisc.c:1.11 eggdrop1.7/src/tclmisc.c:1.12
--- eggdrop1.7/src/tclmisc.c:1.11	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/tclmisc.c	Tue Oct  5 19:04:33 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: tclmisc.c,v 1.11 2004/09/10 01:10:50 wcc Exp $
+ * $Id: tclmisc.c,v 1.12 2004/10/06 00:04:33 wcc Exp $
  */
 
 #include "main.h"
@@ -43,6 +43,7 @@
 #include "md5/md5.h"
 #include "botmsg.h"  /* add_note */
 #include "dcc.h"     /* STRIP_*, strip_mirc_codes, struct dcc_t */
+#include "dccutil.h" /* findidx */
 #include "logfile.h" /* LOG_*, putlog */
 #include "help.h"    /* showhelp, tellhelp */
 #include "match.h"   /* wild_match_per, reload_help_data */
Index: eggdrop1.7/src/tcluser.c
diff -u eggdrop1.7/src/tcluser.c:1.6 eggdrop1.7/src/tcluser.c:1.7
--- eggdrop1.7/src/tcluser.c:1.6	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/tcluser.c	Tue Oct  5 19:04:33 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: tcluser.c,v 1.6 2004/09/10 01:10:50 wcc Exp $
+ * $Id: tcluser.c,v 1.7 2004/10/06 00:04:33 wcc Exp $
  */
 
 #include "main.h"
@@ -25,12 +25,15 @@
 #include "chan.h"
 #include "modules.h"
 
-#include "botmsg.h"  /* int_to_base10 */
-#include "botnet.h"  /* nextbot */
-#include "dcc.h"     /* DCC_*, BSTAT_*, struct dcc_t */
-#include "misc.h"    /* strncpyz */
-#include "userrec.h" /* adduser, u_pass_match, delhost_by_handle, count_users,
-                      * deluser, change_handle, write_userfile */
+#include "botmsg.h"   /* int_to_base10 */
+#include "botnet.h"   /* nextbot */
+#include "chanprog.h" /* findchan_by_dname, reload */
+#include "dcc.h"      /* DCC_*, BSTAT_*, struct dcc_t */
+#include "misc.h"     /* strncpyz */
+#include "userrec.h"  /* adduser, u_pass_match, delhost_by_handle, count_users,
+                       * deluser, change_handle, write_userfile */
+#include "users.h"    /* reload */
+
 
 extern Tcl_Interp *interp;
 extern struct userrec *userlist;
Index: eggdrop1.7/src/userrec.c
diff -u eggdrop1.7/src/userrec.c:1.11 eggdrop1.7/src/userrec.c:1.12
--- eggdrop1.7/src/userrec.c:1.11	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/userrec.c	Tue Oct  5 19:04:33 2004
@@ -4,7 +4,7 @@
  *   a bunch of functions to find and change user records
  *   change and check user (and channel-specific) flags
  *
- * $Id: userrec.c,v 1.11 2004/09/10 01:10:50 wcc Exp $
+ * $Id: userrec.c,v 1.12 2004/10/06 00:04:33 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -32,14 +32,15 @@
 #include "modules.h"
 
 #include "userrec.h"
-#include "botmsg.h"  /* simple_sprintf, botnet_send_* */
-#include "dcc.h"     /* DCC_*, struct dcc_t */
-#include "dccutil.h" /* shareout, chanout_but */
-#include "logfile.h" /* putlog, LOG_* */
-#include "match.h"   /* wild_match */
-#include "misc.h"    /* strncpyz, str_escape */
-#include "rfc1459.h" /* rfc_casecmp */
-#include "userent.h" /* list_type_expmem */
+#include "botmsg.h"   /* simple_sprintf, botnet_send_* */
+#include "dcc.h"      /* DCC_*, struct dcc_t */
+#include "dccutil.h"  /* shareout, chanout_but */
+#include "chanprog.h" /* findchan_by_dname */
+#include "logfile.h"  /* putlog, LOG_* */
+#include "match.h"    /* wild_match */
+#include "misc.h"     /* strncpyz, str_escape, rmspace */
+#include "rfc1459.h"  /* rfc_casecmp */
+#include "userent.h"  /* list_type_expmem */
 
 extern struct dcc_t *dcc;
 extern struct chanset_t *chanset;
@@ -55,8 +56,102 @@
 struct igrec *global_ign = NULL;
 int cache_hit = 0, cache_miss = 0; /* temporary cache accounting    */
 int strict_ident = 1;
-int userfile_perm = 0600;         /* Userfile permissions
-                                   * (default rw-------) */
+int userfile_perm = 0600;          /* Userfile permissions (default rw-------) */
+
+
+void set_chanlist(const char *host, struct userrec *rec)
+{
+  char *nick, *uhost, buf[UHOSTLEN];
+  register memberlist *m;
+  register struct chanset_t *chan;
+
+  strncpyz(buf, host, sizeof buf);
+  uhost = buf;
+  nick = splitnick(&uhost);
+  for (chan = chanset; chan; chan = chan->next) {
+    for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
+      if (!rfc_casecmp(nick, m->nick) && !egg_strcasecmp(uhost, m->userhost))
+        m->user = rec;
+    }
+  }
+}
+
+/* Clear the user pointers in the chanlists.
+ *
+ * Necessary when a hostmask is added/removed, a user is added or a new
+ * userfile is loaded.
+ */
+void clear_chanlist(void)
+{
+  register memberlist *m;
+  register struct chanset_t *chan;
+
+  for (chan = chanset; chan; chan = chan->next) {
+    for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
+      m->user = NULL;
+      m->tried_getuser = 0;
+    }
+  }
+}
+
+/* Shortcut for get_user_by_host -- might have user record in one of the
+ * channel caches.
+ */
+struct userrec *check_chanlist(const char *host)
+{
+  char *nick, *uhost, buf[UHOSTLEN];
+  register memberlist *m;
+  register struct chanset_t *chan;
+
+  strncpyz(buf, host, sizeof buf);
+  uhost = buf;
+  nick = splitnick(&uhost);
+  for (chan = chanset; chan; chan = chan->next) {
+    for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
+      if (!rfc_casecmp(nick, m->nick) && !egg_strcasecmp(uhost, m->userhost))
+        return m->user;
+    }
+  }
+  return NULL;
+}
+
+/* Shortcut for get_user_by_handle --  might have user record in one of the
+ * channel caches.
+ */
+struct userrec *check_chanlist_hand(const char *hand)
+{
+  register struct chanset_t *chan;
+  register memberlist *m;
+
+  for (chan = chanset; chan; chan = chan->next) {
+    for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
+      if (m->user && !egg_strcasecmp(m->user->handle, hand))
+        return m->user;
+    }
+  }
+  return NULL;
+}
+
+/* Clear the user pointer of a specific nick in the chanlists.
+ *
+ * Necessary when a hostmask is added/removed, a nick changes, etc.
+ * Does not completely invalidate the channel cache like clear_chanlist().
+ */
+void clear_chanlist_member(const char *nick)
+{
+  register memberlist *m;
+  register struct chanset_t *chan;
+
+  for (chan = chanset; chan; chan = chan->next) {
+    for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
+      if (!rfc_casecmp(m->nick, nick)) {
+        m->user = NULL;
+        m->tried_getuser = 0;
+        break;
+      }
+    }
+  }
+}
 
 void *_user_malloc(int size, const char *file, int line)
 {
Index: eggdrop1.7/src/userrec.h
diff -u eggdrop1.7/src/userrec.h:1.2 eggdrop1.7/src/userrec.h:1.3
--- eggdrop1.7/src/userrec.h:1.2	Fri Aug 27 05:01:17 2004
+++ eggdrop1.7/src/userrec.h	Tue Oct  5 19:04:33 2004
@@ -16,13 +16,16 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: userrec.h,v 1.2 2004/08/27 10:01:17 wcc Exp $
+ * $Id: userrec.h,v 1.3 2004/10/06 00:04:33 wcc Exp $
  */
 
 #ifndef _EGG_USERREC_H
 #define _EGG_USERREC_H
 
 #ifndef MAKING_MODS
+void set_chanlist(const char *, struct userrec *);
+void clear_chanlist(void);
+void clear_chanlist_member(const char *);
 struct userrec *adduser(struct userrec *, char *, char *, char *, int);
 void addhost_by_handle(char *, char *);
 void clear_masks(struct maskrec *);
Index: eggdrop1.7/src/users.c
diff -u eggdrop1.7/src/users.c:1.9 eggdrop1.7/src/users.c:1.10
--- eggdrop1.7/src/users.c:1.9	Thu Sep  9 20:10:50 2004
+++ eggdrop1.7/src/users.c	Tue Oct  5 19:04:33 2004
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: users.c,v 1.9 2004/09/10 01:10:50 wcc Exp $
+ * $Id: users.c,v 1.10 2004/10/06 00:04:33 wcc Exp $
  */
 
 #include "main.h"
@@ -28,17 +28,18 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#include "botmsg.h"  /* botnet_send_* */
-#include "botnet.h"  /* nextbot, in_chain, botlink, rembot */
-#include "dcc.h"     /* DCC_*, struct dcc_t */
-#include "dccutil.h" /* dprintf, chatout, shareout, lostdcc */
-#include "logfile.h" /* putlog, LOG_* */
-#include "match.h"   /* wild_match */
-#include "misc.h"    /* DAY_*, splitc, newsplit, strncpyz, days, str_escape,
-                      * strchr_unescape */
-#include "net.h"     /* killsock */
-#include "rfc1459.h" /* rfc_casecmp */
-#include "userrec.h" /* adduser, clear_masks */
+#include "botmsg.h"   /* botnet_send_* */
+#include "botnet.h"   /* nextbot, in_chain, botlink, rembot */
+#include "dcc.h"      /* DCC_*, struct dcc_t */
+#include "dccutil.h"  /* dprintf, chatout, shareout, lostdcc */
+#include "chanprog.h" /* findchan_by_dname */
+#include "logfile.h"  /* putlog, LOG_* */
+#include "match.h"    /* wild_match */
+#include "misc.h"     /* DAY_*, splitc, newsplit, strncpyz, days, str_escape,
+                       * strchr_unescape, rmspace */
+#include "net.h"      /* killsock */
+#include "rfc1459.h"  /* rfc_casecmp */
+#include "userrec.h"  /* adduser, clear_masks, clear_chanlist */
 
 #include "users.h"
 
@@ -640,6 +641,27 @@
   dprintf(idx, MISC_FOUNDMATCH, cnt, cnt == 1 ? "" : MISC_MATCH_PLURAL);
 }
 
+/* Reload the user file from disk. */
+void reload()
+{
+  if (!file_readable(userfile)) {
+    putlog(LOG_MISC, "*", MISC_CANTRELOADUSER);
+    return;
+  }
+
+  noshare = 1;
+  clear_userlist(userlist);
+  noshare = 0;
+
+  userlist = NULL;
+  if (!readuserfile(userfile, &userlist))
+    fatal(MISC_MISSINGUSERF, 0);
+
+  reaffirm_owners();
+  check_tcl_event("userfile-loaded");
+  call_hook(HOOK_READ_USERFILE);
+}
+
 /*
  * tagged lines in the user file:
  * * OLD:
Index: eggdrop1.7/src/users.h
diff -u eggdrop1.7/src/users.h:1.1.1.1 eggdrop1.7/src/users.h:1.2
--- eggdrop1.7/src/users.h:1.1.1.1	Tue Aug 24 20:02:04 2004
+++ eggdrop1.7/src/users.h	Tue Oct  5 19:04:33 2004
@@ -2,7 +2,7 @@
  * users.h
  *   structures and definitions used by users.c and userrec.c
  *
- * $Id: users.h,v 1.1.1.1 2004/08/25 01:02:04 wcc Exp $
+ * $Id: users.h,v 1.2 2004/10/06 00:04:33 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -197,4 +197,8 @@
 void def_display(int idx, struct user_entry *e);
 int def_dupuser(struct userrec *new, struct userrec *old, struct user_entry *e);
 
+#ifndef MAKING_MODS
+void reload();
+#endif
+
 #endif /* _EGG_USERS_H */
----------------------- End of diff -----------------------



More information about the Changes mailing list