[cvslog] Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Thu Oct 18 20:56:01 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2001-10-19 01:55:19 UTC
Commited by: Tothwolf <tothwolf at techmonkeys.org>

Modified files:
     acinclude.m4 configure.ac src/botcmd.c src/botmsg.c src/botnet.c
     src/chanprog.c src/cmds.c src/dcc.c src/dccutil.c src/dns.c
     src/eggdrop.h src/logfile.c src/main.c src/misc.c src/modules.c
     src/net.c src/stat.h src/tcl.c src/tcldcc.c src/tclhash.c
     src/tclmisc.c src/tcluser.c src/userent.c src/userrec.c
     src/users.c src/adns/setup.c src/adns/types.c
     src/compat/Makefile.am src/compat/compat.h src/compat/inet_aton.c
     src/compat/inet_aton.h src/compat/inet_ntop.c
     src/compat/inet_ntop.h src/compat/inet_pton.c
     src/compat/inet_pton.h src/compat/snprintf.c
     src/compat/snprintf.h src/compat/strcasecmp.c
     src/compat/strcasecmp.h src/compat/strftime.c
     src/compat/strftime.h src/mod/module.h src/mod/assoc.mod/assoc.c
     src/mod/blowfish.mod/bf_tab.h src/mod/blowfish.mod/blowfish.c
     src/mod/blowfish.mod/blowfish.h src/mod/channels.mod/channels.c
     src/mod/channels.mod/cmdschan.c src/mod/channels.mod/tclchan.c
     src/mod/channels.mod/udefchan.c src/mod/channels.mod/userchan.c
     src/mod/compress.mod/compress.c src/mod/ctcp.mod/ctcp.c
     src/mod/filesys.mod/filedb3.c src/mod/filesys.mod/files.c
     src/mod/filesys.mod/filesys.c src/mod/irc.mod/chan.c
     src/mod/irc.mod/cmdsirc.c src/mod/irc.mod/irc.c
     src/mod/irc.mod/mode.c src/mod/irc.mod/msgcmds.c
     src/mod/irc.mod/tclirc.c src/mod/notes.mod/cmdsnote.c
     src/mod/notes.mod/notes.c src/mod/server.mod/cmdsserv.c
     src/mod/server.mod/server.c src/mod/server.mod/servmsg.c
     src/mod/server.mod/tclserv.c src/mod/share.mod/share.c
     src/mod/transfer.mod/transfer.c src/mod/transfer.mod/transfer.h

Added files:
     src/compat/memcpy.c src/compat/memcpy.h src/compat/memset.c
     src/compat/memset.h src/compat/strncasecmp.c
     src/compat/strncasecmp.h

Removed files:
     src/compat/gnu_strftime.c

Log message:

* removed obsolete EGG_CHECK_FUNC_VSPRINTF autoconf macro
* removed obsolete EGG_HEADER_STDC autoconf macro
* added EGG_C_LONG_LONG autoconf macro
* added EGG_FUNC_C99_VSNPRINTF autoconf macro
* added EGG_REPLACE_SNPRINTF autoconf macro
* added EGG_TYPE_32BIT autoconf macro

* removed unused dlfcn.h header check from configure.ac
* removed AC_CHECK_SIZEOF long and int from configure.ac
* added many required autoconf macros to configure.ac
* added AC_REPLACE_FUNCS to configure.ac for compat functions
* many configure.ac cleanups

* updated compat/snprintf.c with latest version from Samba
* added code to link libm with compat library for snprintf.c
* added support for LIBOBJS to compat/Makefile.am
* added memset back to compat
* added memcpy back to compat
* many compat cleanups

* renamed egg_strcasecmp() to strcasecmp()
* renamed egg_strncasecmp() to strncasecmp()
* renamed egg_snprintf() to snprintf()
* renamed egg_vsnprintf() to vsnprintf()
* renamed egg_strftime() to strftime()
* renamed egg_inet_aton() to inet_aton()
* renamed egg_inet_ntop() to inet_ntop()
* renamed egg_inet_pton() to inet_pton()

* exported strftime() for modules
* exported inet_ntop() for modules
* exported inet_pton() for modules
* exported vasprintf() for modules
* exported asprintf() for modules

* renamed u_32bit_t typedef to u_32int_t
* extended stat.h to support standard bits and checks

* major function changes:
  + egg_strcasecmp -> strcasecmp
  + egg_strncasecmp -> strncasecmp
  + egg_snprintf -> snprintf
  + egg_vsnprintf -> vsnprintf
  + egg_strftime -> strftime
  + egg_inet_aton -> inet_aton
  + egg_inet_ntop -> inet_ntop
  + egg_inet_pton -> inet_pton

---------------------- diff included ----------------------
Index: eggdrop1.7/acinclude.m4
diff -u eggdrop1.7/acinclude.m4:1.7 eggdrop1.7/acinclude.m4:1.8
--- eggdrop1.7/acinclude.m4:1.7	Sun Oct 14 14:30:49 2001
+++ eggdrop1.7/acinclude.m4	Thu Oct 18 20:55:04 2001
@@ -1,7 +1,7 @@
 dnl acinclude.m4
 dnl   macros autoconf uses when building configure from configure.in
 dnl
-dnl $Id: acinclude.m4,v 1.7 2001/10/14 19:30:49 ite Exp $
+dnl $Id: acinclude.m4,v 1.8 2001/10/19 01:55:04 tothwolf Exp $
 dnl
 
 
@@ -225,36 +225,95 @@
 ])
 
 
-dnl  EGG_CHECK_FUNC_VSPRINTF()
+dnl  EGG_C_LONG_LONG
 dnl
-AC_DEFUN(EGG_CHECK_FUNC_VSPRINTF, [dnl
-AC_CHECK_FUNCS(vsprintf)
-if test "$ac_cv_func_vsprintf" = "no"
+AC_DEFUN(EGG_C_LONG_LONG, [dnl
+# Code borrowed from Samba
+AC_CACHE_CHECK([for long long], egg_cv_have_long_long, [
+AC_TRY_RUN([
+#include <stdio.h>
+int main() {
+	long long x = 1000000;
+	x *= x;
+	exit(((x / 1000000) == 1000000) ? 0: 1);
+}
+],
+egg_cv_have_long_long="yes",
+egg_cv_have_long_long="no",
+egg_cv_have_long_long="cross")])
+if test "$egg_cv_have_long_long" = "yes"
 then
-  cat << 'EOF' >&2
-configure: error:
+  AC_DEFINE(HAVE_LONG_LONG, 1,
+	    [Define if system supports long long])
+fi
+])
 
-  Your system does not have the sprintf/vsprintf libraries.
-  These are required to compile almost anything.  Sorry.
 
-EOF
-  exit 1
+dnl  EGG_FUNC_C99_VSNPRINTF
+dnl
+AC_DEFUN(EGG_FUNC_C99_VSNPRINTF, [dnl
+# Code borrowed from Samba
+AC_CACHE_CHECK([for C99 vsnprintf], egg_cv_have_c99_vsnprintf, [
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <stdarg.h>
+void foo(const char *format, ...) { 
+	va_list ap;
+	int len;
+	char buf[5];
+
+	va_start(ap, format);
+	len = vsnprintf(0, 0, format, ap);
+	va_end(ap);
+	if (len != 5) exit(1);
+
+	if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
+
+	exit(0);
+}
+int main(){
+	foo("hello");
+}
+],
+egg_cv_have_c99_vsnprintf="yes",
+egg_cv_have_c99_vsnprintf="no",
+egg_cv_have_c99_vsnprintf="cross")])
+if test "$egg_cv_have_c99_vsnprintf" = "yes"
+then
+  AC_DEFINE(HAVE_C99_VSNPRINTF, 1,
+            [Define if vsnprintf is C99 compliant])
+  egg_replace_snprintf=yes
 fi
 ])
 
 
-dnl  EGG_HEADER_STDC()
+dnl  EGG_REPLACE_SNPRINTF
 dnl
-AC_DEFUN(EGG_HEADER_STDC, [dnl
-if test "$ac_cv_header_stdc" = "no"
+AC_DEFUN(EGG_REPLACE_SNPRINTF, [dnl
+if test "${egg_replace_snprintf-x}" = "yes"
 then
-  cat << 'EOF' >&2
-configure: error:
+  AC_LIBOBJ(snprintf)
+  SNPRINTF_LIBS="-lm"
+fi
+AC_SUBST(SNPRINTF_LIBS)
+])
 
-  Your system must support ANSI C Header files.
 
-EOF
-  exit 1
+dnl  EGG_TYPE_32BIT()
+dnl
+AC_DEFUN(EGG_TYPE_32BIT, [dnl
+AC_CHECK_SIZEOF(unsigned int, 4)
+if test "$ac_cv_sizeof_unsigned_int" = 4
+then
+  AC_DEFINE(UNSIGNED_INT32, 1,
+            [Define this if an unsigned int is 32 bits])
+else
+  AC_CHECK_SIZEOF(unsigned long, 4)
+  if test "$ac_cv_sizeof_unsigned_long" = 4
+  then
+    AC_DEFINE(UNSIGNED_LONG32, 1,
+              [Define this if an unsigned long is 32 bits])
+  fi
 fi
 ])
 
@@ -1125,6 +1184,7 @@
                              debug="$enableval", debug=yes)
 if test "$debug" = "yes"
 then
+  # FIXME: this should be done along with `--with-efence'
   AC_CHECK_LIB(efence, malloc)
   EGG_DEBUG="-DDEBUG"
 fi
Index: eggdrop1.7/configure.ac
diff -u eggdrop1.7/configure.ac:1.1 eggdrop1.7/configure.ac:1.2
--- eggdrop1.7/configure.ac:1.1	Sun Oct 14 09:16:03 2001
+++ eggdrop1.7/configure.ac	Thu Oct 18 20:55:04 2001
@@ -22,6 +22,15 @@
 AC_ISC_POSIX
 AC_MINIX
 
+# Checks for compiler characteristics
+AC_PROG_CC_STDC
+AC_C_BIGENDIAN
+AC_C_CONST
+AC_C_VOLATILE
+AC_C_INLINE
+AC_C_LONG_DOUBLE
+EGG_C_LONG_LONG
+
 # Gettext support
 EGG_GNU_GETTEXT
 
@@ -47,32 +56,42 @@
 
 # Checks for header files
 AC_HEADER_DIRENT
+AC_HEADER_STAT
+AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(sys/time.h)
 AC_HEADER_TIME
-AC_CHECK_HEADERS(sys/select.h sys/rusage.h unistd.h dlfcn.h stdarg.h std_args.h strings.h limits.h)
-EGG_INADDR_LOOPBACK
+AC_CHECK_HEADERS(string.h strings.h ctype.h stdlib.h limits.h unistd.h)
+AC_CHECK_HEADERS(sys/rusage.h sys/select.h stdarg.h std_args.h)
 
-# Checks for typedefs, structures, and compiler characteristics
+# Checks for types and structures
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
+EGG_TYPE_32BIT
 EGG_TYPE_SOCKLEN_T
-AC_C_CONST
-AC_C_BIGENDIAN
-AC_C_INLINE
-AC_CHECK_SIZEOF(long, 0)
-AC_CHECK_SIZEOF(int, 0)
+EGG_INADDR_LOOPBACK
 
 # Checks for library functions
-AC_CHECK_FUNCS(clock getrusage setpgid uname sigaction sigemptyset rename strcasecmp strncasecmp getdtablesize random srandom dlopen dprintf snprintf vsnprintf isascii inet_aton strftime fsync inet_pton inet_ntop)
-EGG_CHECK_FUNC_VSPRINTF
+AC_CHECK_FUNCS(clock dprintf fsync getdtablesize getrusage isascii)
+AC_CHECK_FUNCS(random srandom rename setpgid sigaction sigemptyset uname)
+
+# Check for these functions, and replace those not found
+AC_REPLACE_FUNCS(memcpy memset strcasecmp strncasecmp strftime)
+AC_REPLACE_FUNCS(inet_aton inet_ntop inet_pton)
+
+# These all share a common file: snprintf.c
+AC_CHECK_FUNCS(vsnprintf snprintf asprintf vasprintf,,egg_replace_snprintf="yes")
+
+# Check if vsnprintf is C99 compliant
+EGG_FUNC_C99_VSNPRINTF
 
-# Make sure we have stdc headers, since we can't compile without them
-EGG_HEADER_STDC
+# Check if we need to compile all or part of snprintf.c
+EGG_REPLACE_SNPRINTF
 
 # Checks for cygwin
 EGG_CYGWIN
 
+# Checks for IPV6
 EGG_IPV6_SUPPORTED
 EGG_IPV6_OPTIONS
 
Index: eggdrop1.7/src/adns/setup.c
diff -u eggdrop1.7/src/adns/setup.c:1.3 eggdrop1.7/src/adns/setup.c:1.4
--- eggdrop1.7/src/adns/setup.c:1.3	Fri Aug 10 09:50:31 2001
+++ eggdrop1.7/src/adns/setup.c	Thu Oct 18 20:55:05 2001
@@ -108,7 +108,7 @@
 static void ccf_nameserver(adns_state ads, const char *fn, int lno, const char *buf) {
   struct in_addr ia;
   
-  if (!egg_inet_aton(buf,&ia)) {
+  if (!inet_aton(buf,&ia)) {
     configparseerr(ads,fn,lno,"invalid nameserver address `%s'",buf);
     return;
   }
@@ -170,14 +170,14 @@
     slash= strchr(tbuf,'/');
     if (slash) *slash++= 0;
     
-    if (!egg_inet_aton(tbuf,&base)) {
+    if (!inet_aton(tbuf,&base)) {
       configparseerr(ads,fn,lno,"invalid address `%s' in sortlist",tbuf);
       continue;
     }
 
     if (slash) {
       if (strchr(slash,'.')) {
-	if (!egg_inet_aton(slash,&mask)) {
+	if (!inet_aton(slash,&mask)) {
 	  configparseerr(ads,fn,lno,"invalid mask `%s' in sortlist",slash);
 	  continue;
 	}
Index: eggdrop1.7/src/adns/types.c
diff -u eggdrop1.7/src/adns/types.c:1.1 eggdrop1.7/src/adns/types.c:1.2
--- eggdrop1.7/src/adns/types.c:1.1	Thu Jul 26 12:06:39 2001
+++ eggdrop1.7/src/adns/types.c	Thu Oct 18 20:55:05 2001
@@ -285,7 +285,7 @@
   struct in6_addr rr= *rrp;
   char ia[IP6STRLEN];
 
-  assert(egg_inet_ntop(AF_INET6, &rr, ia, IP6STRLEN) != NULL);
+  assert(inet_ntop(AF_INET6, &rr, ia, IP6STRLEN) != NULL);
   CSP_ADDSTR(ia);
   return adns_s_ok;
 }
@@ -355,7 +355,7 @@
     {
        char ip[IP6STRLEN];
 	CSP_ADDSTR("INET6 ");
-       assert(egg_inet_ntop(AF_INET6, rrp->addr.inet6.sin6_addr.s6_addr, ip, IP6STRLEN) != NULL);
+       assert(inet_ntop(AF_INET6, rrp->addr.inet6.sin6_addr.s6_addr, ip, IP6STRLEN) != NULL);
        CSP_ADDSTR(ip);
        break;
     }
@@ -814,7 +814,7 @@
     ap->len= sizeof(struct sockaddr_in6);
     memset(&ap->addr,0,sizeof(ap->addr.inet6));
     ap->addr.inet6.sin6_family=AF_INET6;
-    egg_inet_pton(AF_INET6, ip6, ap->addr.inet6.sin6_addr.s6_addr);
+    inet_pton(AF_INET6, ip6, ap->addr.inet6.sin6_addr.s6_addr);
   }
 
   st= adns__mkquery_frdgram(pai->ads, &pai->qu->vb, &id,
Index: eggdrop1.7/src/botcmd.c
diff -u eggdrop1.7/src/botcmd.c:1.24 eggdrop1.7/src/botcmd.c:1.25
--- eggdrop1.7/src/botcmd.c:1.24	Sat Oct  6 23:02:54 2001
+++ eggdrop1.7/src/botcmd.c	Thu Oct 18 20:55:04 2001
@@ -3,7 +3,7 @@
  *   commands that comes across the botnet
  *   userfile transfer and update commands from sharebots
  *
- * $Id: botcmd.c,v 1.24 2001/10/07 04:02:54 stdarg Exp $
+ * $Id: botcmd.c,v 1.25 2001/10/19 01:55:04 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -238,7 +238,7 @@
   if (!to[0])
     return;			/* Silently ignore notes to '@bot' this
 				 * is legacy code */
-  if (!egg_strcasecmp(tobot, botnetnick)) {		/* For me! */
+  if (!strcasecmp(tobot, botnetnick)) {		/* For me! */
     if (p == from)
       add_note(to, from, par, -2, 0);
     else {
@@ -429,7 +429,7 @@
     from = TBUF;
   }
   to = newsplit(&par);
-  if (!egg_strcasecmp(to, botnetnick))
+  if (!strcasecmp(to, botnetnick))
     to[0] = 0;			/* (for me) */
 #ifndef NO_OLD_BOTNET
   if (b_numver(idx) < NEAT_BOTNET)
@@ -523,7 +523,7 @@
   from = newsplit(&par);
   bot = newsplit(&par);
 
-  if (!egg_strcasecmp(bot, botnetnick)) {
+  if (!strcasecmp(bot, botnetnick)) {
     if ((rfrom = strchr(from, ':')))
       rfrom++;
     else
@@ -552,7 +552,7 @@
   from = newsplit(&par);
   bot = newsplit(&par);
   undes = newsplit(&par);
-  if (!egg_strcasecmp(bot, botnetnick)) {
+  if (!strcasecmp(bot, botnetnick)) {
     if ((rfrom = strchr(from, ':')))
       rfrom++;
     else
@@ -637,7 +637,7 @@
     simple_sprintf(s, "%s %s (%s)", _("Disconnected"), dcc[idx].nick,
 		   _("invalid bot"));
     dprintf(idx, "error invalid eggnet protocol for 'nlinked'\n");
-  } else if ((in_chain(newbot)) || (!egg_strcasecmp(newbot, botnetnick))) {
+  } else if ((in_chain(newbot)) || (!strcasecmp(newbot, botnetnick))) {
     /* Loop! */
     putlog(LOG_BOTS, "*", "%s %s (mutual: %s)",
 	   _("Loop detected"), dcc[idx].nick, newbot);
@@ -755,7 +755,7 @@
   dest = newsplit(&par);
   simple_sprintf(TBUF, "%s:%s", par, botnetnick);
   botnet_send_traced(idx, from, TBUF);
-  if (egg_strcasecmp(dest, botnetnick) && ((i = nextbot(dest)) > 0))
+  if (strcasecmp(dest, botnetnick) && ((i = nextbot(dest)) > 0))
     botnet_send_trace(i, from, dest, par);
 }
 
@@ -774,7 +774,7 @@
     *p = 0;
     p++;
   }
-  if (!egg_strcasecmp(p, botnetnick)) {
+  if (!strcasecmp(p, botnetnick)) {
     time_t t = 0;
     char *p = par, *ss = TBUF;
 
@@ -793,7 +793,7 @@
     }
     for (i = 0; i < dcc_total; i++)
       if ((dcc[i].type->flags & DCT_CHAT) &&
-	  (!egg_strcasecmp(dcc[i].nick, to)) &&
+	  (!strcasecmp(dcc[i].nick, to)) &&
 	  ((sock == (-1)) || (sock == dcc[i].sock))) {
 	if (t) {
 	  dprintf(i, "%s -> %s (%lu secs)\n", _("Trace result"), p, now - t);
@@ -837,7 +837,7 @@
     if (i < 0) {
       botnet_send_priv(idx, botnetnick, from, NULL, "%s %s (%s)",
 		       _("Cant unlink"), who, _("doesnt exist"));
-    } else if (!egg_strcasecmp(dcc[i].nick, who)) {
+    } else if (!strcasecmp(dcc[i].nick, who)) {
       char s[1024];
 
       /* I'm the connection to the rejected bot */
@@ -856,7 +856,7 @@
     }
   } else {			/* Rejecting user */
     *destbot++ = 0;
-    if (!egg_strcasecmp(destbot, botnetnick)) {
+    if (!strcasecmp(destbot, botnetnick)) {
       /* Kick someone here! */
       int ok = 0;
 
@@ -877,7 +877,7 @@
 	ok = 1;
       }
       for (i = 0; (i < dcc_total) && (!ok); i++)
-	if ((!egg_strcasecmp(who, dcc[i].nick)) &&
+	if ((!strcasecmp(who, dcc[i].nick)) &&
 	    (dcc[i].type->flags & DCT_CHAT)) {
 	  u = get_user_by_handle(userlist, dcc[i].nick);
 	  if (u && (u->flags & USER_OWNER)) {
@@ -899,7 +899,7 @@
 
 static void bot_thisbot(int idx, char *par)
 {
-  if (egg_strcasecmp(par, dcc[idx].nick)) {
+  if (strcasecmp(par, dcc[idx].nick)) {
     char s[1024];
 
     putlog(LOG_BOTS, "*", _("Wrong bot--wanted %s, got %s"), dcc[idx].nick, par);
@@ -947,7 +947,7 @@
     fake_alert(idx, "direction", from);
     return;
   }
-  if (!egg_strcasecmp(to, botnetnick)) {
+  if (!strcasecmp(to, botnetnick)) {
     /* For me! */
     char *opcode;
 
@@ -990,7 +990,7 @@
   struct flag_record fr = {FR_BOT, USER_BOT, 0, 0, 0, 0};
 
   who = newsplit(&par);
-  if (!par[0] || !egg_strcasecmp(par, botnetnick)) {
+  if (!par[0] || !strcasecmp(par, botnetnick)) {
     int irc = 0;
 
     p = strchr(who, ':');
@@ -1052,7 +1052,7 @@
     tobot++;
   else
     tobot = to;			/* Bot wants a file?! :) */
-  if (egg_strcasecmp(tobot, botnetnick)) {	/* for me! */
+  if (strcasecmp(tobot, botnetnick)) {	/* for me! */
     p = strchr(to, ':');
     if (p != NULL) {
       *p = 0;
@@ -1082,7 +1082,7 @@
   if ((path = strchr(tobot, ':'))) {
     *path++ = 0;
 
-    if (!egg_strcasecmp(tobot, botnetnick)) {	/* For me! */
+    if (!strcasecmp(tobot, botnetnick)) {	/* For me! */
       /* Process this */
       module_entry *fs = module_find("filesys", 0, 0);
 
@@ -1117,7 +1117,7 @@
   } else {
     tobot = to;
   }
-  if (!egg_strcasecmp(tobot, botnetnick)) {		/* For me! */
+  if (!strcasecmp(tobot, botnetnick)) {		/* For me! */
     nfn = strrchr(botpath, '/');
     if (nfn == NULL) {
       nfn = strrchr(botpath, ':');
@@ -1431,7 +1431,7 @@
 
   if (nextbot(frombot) != sock)
     fake_alert(sock, "versions-direction", frombot);
-  else if (egg_strcasecmp(tobot = newsplit(&par), botnetnick)) {
+  else if (strcasecmp(tobot = newsplit(&par), botnetnick)) {
     if ((sock = nextbot(tobot)) >= 0)
       dprintf(sock, "v %s %s %s\n", frombot, tobot, par);
   } else {
Index: eggdrop1.7/src/botmsg.c
diff -u eggdrop1.7/src/botmsg.c:1.24 eggdrop1.7/src/botmsg.c:1.25
--- eggdrop1.7/src/botmsg.c:1.24	Fri Aug 10 18:51:20 2001
+++ eggdrop1.7/src/botmsg.c	Thu Oct 18 20:55:04 2001
@@ -5,7 +5,7 @@
  *
  * by Darrin Smith (beldin at light.iinet.net.au)
  *
- * $Id: botmsg.c,v 1.24 2001/08/10 23:51:20 ite Exp $
+ * $Id: botmsg.c,v 1.25 2001/10/19 01:55:04 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -51,7 +51,7 @@
 
   x = EGG_VARARGS_START(int, arg1, va);
   format = va_arg(va, char *);
-  egg_vsnprintf(s, 511, format, va);
+  vsnprintf(s, 511, format, va);
   va_end(va);
   s[sizeof(s)-1] = 0;
 
@@ -302,7 +302,7 @@
   to = va_arg(va, char *);
   tobot = va_arg(va, char *);
   format = va_arg(va, char *);
-  egg_vsnprintf(tbuf, 450, format, va);
+  vsnprintf(tbuf, 450, format, va);
   va_end(va);
   tbuf[sizeof(tbuf)-1] = 0;
 
@@ -786,9 +786,9 @@
     x[20] = 0;
     *p = '@';
     p++;
-    if (!egg_strcasecmp(p, botnetnick))	/* To me?? */
+    if (!strcasecmp(p, botnetnick))	/* To me?? */
       return add_note(x, from, msg, idx, echo); /* Start over, dimwit. */
-    if (egg_strcasecmp(from, botnetnick)) {
+    if (strcasecmp(from, botnetnick)) {
       if (strlen(from) > 40)
 	from[40] = 0;
       if (strchr(from, '@')) {
@@ -850,7 +850,7 @@
   for (i = 0; i < dcc_total; i++) {
     if ((dcc[i].type->flags & DCT_GETNOTES) &&
 	((sock == (-1)) || (sock == dcc[i].sock)) &&
-	(!egg_strcasecmp(dcc[i].nick, to))) {
+	(!strcasecmp(dcc[i].nick, to))) {
       int aok = 1;
 
       if (dcc[i].type == &DCC_CHAT)
@@ -877,7 +877,7 @@
 	  else if (*from == '@')
 	    fr = p + 1;
 	}
-	if (idx == -2 || (!egg_strcasecmp(from, botnetnick)))
+	if (idx == -2 || (!strcasecmp(from, botnetnick)))
 	  dprintf(i, "*** [%s] %s%s\n", fr, l ? work : "", msg);
 	else
 	  dprintf(i, "%cNote [%s]: %s%s\n", 7, fr, l ? work : "", msg);
Index: eggdrop1.7/src/botnet.c
diff -u eggdrop1.7/src/botnet.c:1.44 eggdrop1.7/src/botnet.c:1.45
--- eggdrop1.7/src/botnet.c:1.44	Fri Oct 12 10:50:25 2001
+++ eggdrop1.7/src/botnet.c	Thu Oct 18 20:55:04 2001
@@ -7,7 +7,7 @@
  *   linking, unlinking, and relaying to another bot
  *   pinging the bots periodically and checking leaf status
  *
- * $Id: botnet.c,v 1.44 2001/10/12 15:50:25 tothwolf Exp $
+ * $Id: botnet.c,v 1.45 2001/10/19 01:55:04 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -110,7 +110,7 @@
   tand_t *ptr;
 
   for (ptr = tandbot; ptr; ptr = ptr->next)
-    if (!egg_strcasecmp(ptr->bot, who))
+    if (!strcasecmp(ptr->bot, who))
       return ptr;
   return NULL;
 }
@@ -122,7 +122,7 @@
   tand_t **ptr = &tandbot, *ptr2;
 
   while (*ptr) {
-    if (!egg_strcasecmp((*ptr)->bot, who))
+    if (!strcasecmp((*ptr)->bot, who))
       putlog(LOG_BOTS, "*", "!!! Duplicate botnet bot entry!!");
     ptr = &((*ptr)->next);
   }
@@ -135,7 +135,7 @@
   *ptr = ptr2;
   /* May be via itself */
   ptr2->via = findbot(from);
-  if (!egg_strcasecmp(next, botnetnick))
+  if (!strcasecmp(next, botnetnick))
     ptr2->uplink = (tand_t *) 1;
   else
     ptr2->uplink = findbot(next);
@@ -163,8 +163,8 @@
   int i;
 
   for (i = 0; i < parties; i++) {
-    if ((!egg_strcasecmp(party[i].bot, bot)) &&
-	(!egg_strcasecmp(party[i].nick, nick)))
+    if ((!strcasecmp(party[i].bot, bot)) &&
+	(!strcasecmp(party[i].nick, nick)))
       return party[i].sock;
   }
   return 0;
@@ -179,7 +179,7 @@
 
   for (i = 0; i < parties; i++) {
     /* Just changing the channel of someone already on? */
-    if (!egg_strcasecmp(party[i].bot, bot) &&
+    if (!strcasecmp(party[i].bot, bot) &&
 	(party[i].sock == sock)) {
       int oldchan = party[i].chan;
 
@@ -232,7 +232,7 @@
   int i;
 
   for (i = 0; i < parties; i++) {
-    if ((!egg_strcasecmp(party[i].bot, bot)) &&
+    if ((!strcasecmp(party[i].bot, bot)) &&
 	(party[i].sock == sock)) {
       party[i].status |= add;
       party[i].status &= ~rem;
@@ -247,7 +247,7 @@
   int i;
 
   for (i = 0; i < parties; i++) {
-    if ((!egg_strcasecmp(party[i].bot, bot)) &&
+    if ((!strcasecmp(party[i].bot, bot)) &&
 	(party[i].sock == sock)) {
       party[i].timer = (now - (time_t) secs);
     }
@@ -261,7 +261,7 @@
   int i;
 
   for (i = 0; i < parties; i++) {
-    if (!egg_strcasecmp(party[i].bot, bot) &&
+    if (!strcasecmp(party[i].bot, bot) &&
 	(party[i].sock == sock)) {
       return i;
     }
@@ -276,8 +276,8 @@
   int i, ok = 0;
 
   for (i = 0; i < parties; i++) {
-    if ((!egg_strcasecmp(party[i].bot, bot)) &&
-	(!egg_strcasecmp(party[i].nick, nick))) {
+    if ((!strcasecmp(party[i].bot, bot)) &&
+	(!strcasecmp(party[i].nick, nick))) {
       party[i].timer = now;
       ok = 1;
     }
@@ -293,7 +293,7 @@
   int i;
 
   for (i = 0; i < parties; i++) {
-    if (!egg_strcasecmp(party[i].bot, bot) && (party[i].sock == sock)) {
+    if (!strcasecmp(party[i].bot, bot) && (party[i].sock == sock)) {
       strcpy(work, party[i].nick);
       strncpy(party[i].nick, nick, HANDLEN);
       party[i].nick[HANDLEN] = 0;
@@ -311,7 +311,7 @@
   int i;
 
   for (i = 0; i < parties; i++) {
-    if ((!egg_strcasecmp(party[i].bot, bot)) &&
+    if ((!strcasecmp(party[i].bot, bot)) &&
 	(party[i].sock == sock)) {
       if (party[i].away)
 	free(party[i].away);
@@ -330,7 +330,7 @@
   tand_t **ptr = &tandbot, *ptr2;
 
   while (*ptr) {
-    if (!egg_strcasecmp((*ptr)->bot, who))
+    if (!strcasecmp((*ptr)->bot, who))
       break;
     ptr = &((*ptr)->next);
   }
@@ -352,7 +352,7 @@
   int i;
 
   for (i = 0; i < parties; i++)
-    if ((!egg_strcasecmp(party[i].bot, bot)) &&
+    if ((!strcasecmp(party[i].bot, bot)) &&
 	(party[i].sock == sock)) {
       parties--;
       if (party[i].from)
@@ -380,7 +380,7 @@
   int i;
 
   for (i = 0; i < parties; i++)
-    if (!egg_strcasecmp(party[i].bot, bot)) {
+    if (!strcasecmp(party[i].bot, bot)) {
       if (party[i].chan >= 0) {
         check_tcl_chpt(bot, party[i].nick, party[i].sock, party[i].chan);
       }
@@ -427,7 +427,7 @@
     return -1;
 
   for (j = 0; j < dcc_total; j++)
-    if (bot->via && !egg_strcasecmp(bot->via->bot, dcc[j].nick) &&
+    if (bot->via && !strcasecmp(bot->via->bot, dcc[j].nick) &&
 	(dcc[j].type == &DCC_BOT))
       return j;
   return -1;			/* We're not connected to 'via' */
@@ -854,7 +854,7 @@
 {
   if (findbot(who))
     return 1;
-  if (!egg_strcasecmp(who, botnetnick))
+  if (!strcasecmp(who, botnetnick))
     return 1;
   return 0;
 }
@@ -883,7 +883,7 @@
   if (!bot)
     return 0;
   for (i = 0; i < parties; i++)
-    if (!egg_strcasecmp(party[i].bot, bot->bot))
+    if (!strcasecmp(party[i].bot, bot->bot))
       nr++;
   for (b = tandbot; b; b = b->next)
     if (b->bot && (b->uplink == bot))
@@ -903,7 +903,7 @@
   if (nick[0] == '*')
     dprintf(idx, "%s\n", _("Unlinking all bots..."));
   for (i = 0; i < dcc_total; i++) {
-    if ((nick[0] == '*') || !egg_strcasecmp(dcc[i].nick, nick)) {
+    if ((nick[0] == '*') || !strcasecmp(dcc[i].nick, nick)) {
       if (dcc[i].type == &DCC_FORK_BOT) {
 	if (idx >= 0)
 	  dprintf(idx, "%s: %s -> %s.\n", _("Killed link attempt to"),
@@ -1013,7 +1013,7 @@
   if (!u || !(u->flags & USER_BOT)) {
     if (idx >= 0)
       dprintf(idx, _("%s is not a known bot.\n"), nick);
-  } else if (!egg_strcasecmp(nick, botnetnick)) {
+  } else if (!strcasecmp(nick, botnetnick)) {
     if (idx >= 0)
       dprintf(idx, _("Link to myself?  Oh boy, Freud would have a field day.\n"));
   } else if (in_chain(nick) && (idx != -3)) {
@@ -1152,7 +1152,7 @@
     dprintf(idx, "%s %s\n", nick, _("is not a known bot."));
     return;
   }
-  if (!egg_strcasecmp(nick, botnetnick)) {
+  if (!strcasecmp(nick, botnetnick)) {
     dprintf(idx, "%s\n", _("Relay to myself?  What on EARTH would be the point?!"));
     return;
   }
@@ -1282,7 +1282,7 @@
     lostdcc(idx);
     return;
   }
-  if (!egg_strcasecmp(buf, "*bye*")) {
+  if (!strcasecmp(buf, "*bye*")) {
     /* Disconnect */
     struct chat_info *ci = dcc[idx].u.relay->chat;
 
@@ -1487,7 +1487,7 @@
 {
   struct chat_info *ci;
 
-  if (egg_strcasecmp(buf, "*bye*")) {
+  if (strcasecmp(buf, "*bye*")) {
     dprintf(-dcc[idx].u.relay->sock, "%s\n", buf);
     return;
   }
Index: eggdrop1.7/src/chanprog.c
diff -u eggdrop1.7/src/chanprog.c:1.34 eggdrop1.7/src/chanprog.c:1.35
--- eggdrop1.7/src/chanprog.c:1.34	Thu Oct 18 04:06:43 2001
+++ eggdrop1.7/src/chanprog.c	Thu Oct 18 20:55:04 2001
@@ -5,7 +5,7 @@
  *   telling the current programmed settings
  *   initializing a lot of stuff and loading the tcl scripts
  *
- * $Id: chanprog.c,v 1.34 2001/10/18 09:06:43 stdarg Exp $
+ * $Id: chanprog.c,v 1.35 2001/10/19 01:55:04 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -133,7 +133,7 @@
   uhost = strtok(NULL, "!");
   for (chan = chanset; chan; chan = chan->next)
     for (m = chan->channel.member; m && m->nick[0]; m = m->next)
-      if (!irccmp(nick, m->nick) && !egg_strcasecmp(uhost, m->userhost))
+      if (!irccmp(nick, m->nick) && !strcasecmp(uhost, m->userhost))
 	return m->user;
   return NULL;
 }
@@ -147,7 +147,7 @@
 
   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))
+      if (m->user && !strcasecmp(m->user->handle, hand))
 	return m->user;
   return NULL;
 }
@@ -198,7 +198,7 @@
   uhost = strtok(NULL, "!");
   for (chan = chanset; chan; chan = chan->next)
     for (m = chan->channel.member; m && m->nick[0]; m = m->next)
-      if (!irccmp(nick, m->nick) && !egg_strcasecmp(uhost, m->userhost))
+      if (!irccmp(nick, m->nick) && !strcasecmp(uhost, m->userhost))
 	m->user = rec;
 }
 
@@ -376,7 +376,7 @@
     if (!make_userfile) {
       char tmp[178];
 
-      egg_snprintf(tmp, sizeof tmp, _("USER FILE NOT FOUND!  (try ./eggdrop -m %s to make one)\n"), configfile);
+      snprintf(tmp, sizeof tmp, _("USER FILE NOT FOUND!  (try ./eggdrop -m %s to make one)\n"), configfile);
       fatal(tmp, 0);
     }
     printf(_("\n\nSTARTING BOT IN USERFILE CREATION MODE.\n\
@@ -474,7 +474,7 @@
       pb++;
     }
     pl = (unsigned int) pb - (unsigned int) pa;
-    if (pl == nl && !egg_strncasecmp(pa, name, nl))
+    if (pl == nl && !strncasecmp(pa, name, nl))
       return (1);
     while (1) {
       if ((*pb == 0) || ((*pb != ',') && (*pb != ' ')))
Index: eggdrop1.7/src/cmds.c
diff -u eggdrop1.7/src/cmds.c:1.73 eggdrop1.7/src/cmds.c:1.74
--- eggdrop1.7/src/cmds.c:1.73	Mon Oct 15 04:27:07 2001
+++ eggdrop1.7/src/cmds.c	Thu Oct 18 20:55:04 2001
@@ -3,7 +3,7 @@
  *   commands from a user via dcc
  *   (split in 2, this portion contains no-irc commands)
  *
- * $Id: cmds.c,v 1.73 2001/10/15 09:27:07 stdarg Exp $
+ * $Id: cmds.c,v 1.74 2001/10/19 01:55:04 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -69,7 +69,7 @@
 	char s[UHOSTLEN];
 	struct userrec *u;
 
-	egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+	snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
 	u = get_user_by_host(s);
 	if (u) {
 	  dprintf(idx, _("(Can't add hostmask for %1$s because it matches %2$s)\n"),
@@ -77,9 +77,9 @@
 	  return 0;
 	}
 	if (strchr("~^+=-", m->userhost[0]))
-	  egg_snprintf(s, sizeof s, "*!%s%s", strict_host ? "?" : "", m->userhost+1);
+	  snprintf(s, sizeof s, "*!%s%s", strict_host ? "?" : "", m->userhost+1);
 	else
-	  egg_snprintf(s, sizeof s, "*!%s", m->userhost);
+	  snprintf(s, sizeof s, "*!%s", m->userhost);
 	dprintf(idx, _("(Added hostmask for %1$s from %2$s)\n"), nick, chan->dname);
 	addhost_by_handle(nick, s);
 	return 1;
@@ -148,7 +148,7 @@
 	ok = 1;
 	dprintf(idx, "Bots connected:\n");
       }
-      egg_strftime(s, 14, "%d %b %H:%M", localtime(&dcc[i].timeval));
+      strftime(s, 14, "%d %b %H:%M", localtime(&dcc[i].timeval));
       spaces[len = HANDLEN - strlen(dcc[i].nick)] = 0;
       if (atr & USER_OWNER) {
 	dprintf(idx, "  [%.2lu]  %s%c%s%s (%s) %s\n",
@@ -342,7 +342,7 @@
 
   if (par[0]) {
     putlog(LOG_CMDS, "*", "#%s# motd %s", dcc[idx].nick, par);
-    if (!egg_strcasecmp(par, botnetnick))
+    if (!strcasecmp(par, botnetnick))
       show_motd(idx);
     else {
       i = nextbot(par);
@@ -473,7 +473,7 @@
       return;
     }
     putlog(LOG_CMDS, "*", "#%s# who %s", dcc[idx].nick, par);
-    if (!egg_strcasecmp(par, botnetnick))
+    if (!strcasecmp(par, botnetnick))
       tell_who(u, idx, dcc[idx].u.chat->channel);
     else {
       i = nextbot(par);
@@ -563,7 +563,7 @@
 {
   int atr = u ? u->flags : 0;
 
-  if (!egg_strcasecmp(par, "all")) {
+  if (!strcasecmp(par, "all")) {
     if (!(atr & USER_MASTER)) {
       dprintf(idx, "You do not have Bot Master privileges.\n");
       return;
@@ -601,7 +601,7 @@
     char whonick[HANDLEN + 1];
 
     splitcn(whonick, who, '@', HANDLEN + 1);
-    if (!egg_strcasecmp(who, botnetnick)) {
+    if (!strcasecmp(who, botnetnick)) {
       cmd_boot(u, idx, whonick);
       return;
     }
@@ -620,11 +620,11 @@
     return;
   }
   for (i = 0; i < dcc_total; i++)
-    if (!egg_strcasecmp(dcc[i].nick, who)
+    if (!strcasecmp(dcc[i].nick, who)
         && !ok && (dcc[i].type->flags & DCT_CANBOOT)) {
       u2 = get_user_by_handle(userlist, dcc[i].nick);
       if (u2 && (u2->flags & USER_OWNER)
-          && egg_strcasecmp(dcc[idx].nick, who)) {
+          && strcasecmp(dcc[idx].nick, who)) {
         dprintf(idx, "Can't boot the bot owner.\n");
         return;
       }
@@ -667,7 +667,7 @@
    */
   if (nick[0] && !strchr(CHANMETA "+-*", nick[0]) && glob_master(fr)) {
     for (i = 0; i < dcc_total; i++)
-      if (!egg_strcasecmp(nick, dcc[i].nick) &&
+      if (!strcasecmp(nick, dcc[i].nick) &&
 	  (dcc[i].type == &DCC_CHAT) && (!ok)) {
 	ok = 1;
 	dest = i;
@@ -850,7 +850,7 @@
     dprintf(idx, "Bizarre quantum forces prevent nicknames from starting with %c\n",
            newhand[0]);
   else if (get_user_by_handle(userlist, newhand) &&
-          egg_strcasecmp(hand, newhand))
+          strcasecmp(hand, newhand))
     dprintf(idx, "Somebody is already using %s.\n", newhand);
   else {
     u2 = get_user_by_handle(userlist, hand);
@@ -861,11 +861,11 @@
     else if ((bot_flags(u2) & BOT_SHARE) && !(atr & USER_OWNER))
       dprintf(idx, "You can't change shared bot's nick.\n");
     else if ((atr2 & USER_OWNER) && !(atr & USER_OWNER) &&
-            egg_strcasecmp(dcc[idx].nick, hand))
+            strcasecmp(dcc[idx].nick, hand))
       dprintf(idx, "Can't change the bot owner's handle.\n");
-    else if (isowner(hand) && egg_strcasecmp(dcc[idx].nick, hand))
+    else if (isowner(hand) && strcasecmp(dcc[idx].nick, hand))
       dprintf(idx, "Can't change the permanent bot owner's handle.\n");
-    else if (!egg_strcasecmp(newhand, botnetnick) && (!(atr2 & USER_BOT) ||
+    else if (!strcasecmp(newhand, botnetnick) && (!(atr2 & USER_BOT) ||
              nextbot(hand) != -1))
       dprintf(idx, "Hey! That's MY name!\n");
     else if (change_handle(u2, newhand)) {
@@ -895,9 +895,9 @@
     dprintf(idx, "Bizarre quantum forces prevent handle from starting with '%c'\n",
 	    newhandle[0]);
   } else if (get_user_by_handle(userlist, newhandle) &&
-	     egg_strcasecmp(dcc[idx].nick, newhandle)) {
+	     strcasecmp(dcc[idx].nick, newhandle)) {
     dprintf(idx, "Somebody is already using %s.\n", newhandle);
-  } else if (!egg_strcasecmp(newhandle, botnetnick)) {
+  } else if (!strcasecmp(newhandle, botnetnick)) {
     dprintf(idx, "Hey!  That's MY name!\n");
   } else {
     strncpyz(oldhandle, dcc[idx].nick, sizeof oldhandle);
@@ -927,9 +927,9 @@
     else if ((bot_flags(u) & BOT_SHARE) && !(atr & USER_OWNER))
       dprintf(idx, "You can't change shared bot's password.\n");
     else if ((u->flags & USER_OWNER) && !(atr & USER_OWNER) &&
-	     egg_strcasecmp(handle, dcc[idx].nick))
+	     strcasecmp(handle, dcc[idx].nick))
       dprintf(idx, "Can't change the bot owner's password.\n");
-    else if (isowner(handle) && egg_strcasecmp(dcc[idx].nick, handle))
+    else if (isowner(handle) && strcasecmp(dcc[idx].nick, handle))
       dprintf(idx, "Can't change the permanent bot owner's password.\n");
     else if (!par[0]) {
       putlog(LOG_CMDS, "*", "#%s# chpass %s [nothing]", dcc[idx].nick,
@@ -1038,12 +1038,12 @@
     return;
   }
   if ((u1->flags & USER_OWNER) && !(u && (u->flags & USER_OWNER)) &&
-      egg_strcasecmp(handle, dcc[idx].nick)) {
+      strcasecmp(handle, dcc[idx].nick)) {
     dprintf(idx, "Can't change comment on the bot owner.\n");
     return;
   }
   putlog(LOG_CMDS, "*", "#%s# comment %s %s", dcc[idx].nick, handle, par);
-  if (!egg_strcasecmp(par, "none")) {
+  if (!strcasecmp(par, "none")) {
     dprintf(idx, "Okay, comment blanked.\n");
     set_user(&USERENTRY_COMMENT, u1, NULL);
     return;
@@ -1091,15 +1091,15 @@
 
   putlog(LOG_CMDS, "*", "#%s# die %s", dcc[idx].nick, par);
   if (par[0]) {
-    egg_snprintf(s1, sizeof s1, "%s (%s: %s)", _("BOT SHUTDOWN"), dcc[idx].nick,
+    snprintf(s1, sizeof s1, "%s (%s: %s)", _("BOT SHUTDOWN"), dcc[idx].nick,
 		 par);
-    egg_snprintf(s2, sizeof s2, "%s %s!%s (%s)", _("DIE BY"), dcc[idx].nick, 
+    snprintf(s2, sizeof s2, "%s %s!%s (%s)", _("DIE BY"), dcc[idx].nick, 
 		 dcc[idx].host, par);
     strncpyz(quit_msg, par, 1024);
   } else {
-    egg_snprintf(s1, sizeof s1, "%s (%s %s)", _("BOT SHUTDOWN"), _("Authorized by"),
+    snprintf(s1, sizeof s1, "%s (%s %s)", _("BOT SHUTDOWN"), _("Authorized by"),
 		 dcc[idx].nick);
-    egg_snprintf(s2, sizeof s2, "%s %s!%s (%s)", _("DIE BY"), dcc[idx].nick, 
+    snprintf(s2, sizeof s2, "%s %s!%s (%s)", _("DIE BY"), dcc[idx].nick, 
 		 dcc[idx].host, _("requested"));
     strncpyz(quit_msg, dcc[idx].nick, 1024);
   }
@@ -1108,7 +1108,7 @@
 
 static void cmd_debug(struct userrec *u, int idx, char *par)
 {
-  if (!egg_strcasecmp(par, "help")) {
+  if (!strcasecmp(par, "help")) {
     putlog(LOG_CMDS, "*", "#%s# debug help", dcc[idx].nick);
     debug_help(idx);
   } else {
@@ -1133,7 +1133,7 @@
     return;
   }
   for (i = 0; i < dcc_total; i++)
-    if (!egg_strcasecmp(nick, dcc[i].nick) && !ok &&
+    if (!strcasecmp(nick, dcc[i].nick) && !ok &&
 	(dcc[i].type->flags & DCT_SIMUL)) {
       putlog(LOG_CMDS, "*", "#%s# simul %s %s", dcc[idx].nick, nick, par);
       if (dcc[i].type && dcc[i].type->activity) {
@@ -1156,7 +1156,7 @@
   }
   putlog(LOG_CMDS, "*", "#%s# link %s", dcc[idx].nick, par);
   s = newsplit(&par);
-  if (!par[0] || !egg_strcasecmp(par, botnetnick))
+  if (!par[0] || !strcasecmp(par, botnetnick))
     botlink(dcc[idx].nick, idx, s);
   else {
     char x[40];
@@ -1190,7 +1190,7 @@
   /* If we're directly connected to that bot, just do it
    * (is nike gunna sue?)
    */
-  if (!egg_strcasecmp(dcc[i].nick, bot))
+  if (!strcasecmp(dcc[i].nick, bot))
     botunlink(idx, bot, par);
   else {
     char x[40];
@@ -1233,7 +1233,7 @@
     dprintf(idx, "Usage: trace <botname>\n");
     return;
   }
-  if (!egg_strcasecmp(par, botnetnick)) {
+  if (!strcasecmp(par, botnetnick)) {
     dprintf(idx, "That's me!  Hiya! :)\n");
     return;
   }
@@ -1284,7 +1284,7 @@
   }
   for (i = 0; i < dcc_total; i++) {
     if ((dcc[i].type->flags & DCT_MASTER) &&
-	(!egg_strcasecmp(u->handle, dcc[i].nick))) {
+	(!strcasecmp(u->handle, dcc[i].nick))) {
       stat = dcc[i].status;
       if ((dcc[i].type == &DCC_CHAT) &&
 	  ((u->flags & (USER_OP | USER_MASTER | USER_OWNER |
@@ -1373,7 +1373,7 @@
 	}
       }
     }
-    if (dcc[i].type == &DCC_BOT && !egg_strcasecmp(u->handle, dcc[i].nick)) {
+    if (dcc[i].type == &DCC_BOT && !strcasecmp(u->handle, dcc[i].nick)) {
       if ((dcc[i].status & STAT_LEAF) && !(u->flags & BOT_LEAF))
 	dcc[i].status &= ~(STAT_LEAF | STAT_WARNED);
       if (!(dcc[i].status & STAT_LEAF) && (u->flags & BOT_LEAF))
@@ -1393,7 +1393,7 @@
     return 0;
   for (i = 0; i < dcc_total; i++) {
     if ((dcc[i].type->flags & DCT_MASTER) &&
-	!egg_strcasecmp(u->handle, dcc[i].nick)) {
+	!strcasecmp(u->handle, dcc[i].nick)) {
       if ((dcc[i].type == &DCC_CHAT) &&
 	  ((chflags & (USER_OP | USER_MASTER | USER_OWNER))
 	   != (ochatr & (USER_OP | USER_MASTER | USER_OWNER))))
@@ -1651,7 +1651,7 @@
   }
   for (idx2 = 0; idx2 < dcc_total; idx2++)
     if (dcc[idx2].type != &DCC_RELAY && dcc[idx2].type != &DCC_FORK_BOT &&
-	!egg_strcasecmp(dcc[idx2].nick, hand))
+	!strcasecmp(dcc[idx2].nick, hand))
       break;
   if (idx2 != dcc_total) {
     dprintf(idx, "You may not change the attributes of a directly linked bot.\n");
@@ -1781,7 +1781,7 @@
   module_entry *me;
 
   arg = newsplit(&par);
-  if (!egg_strcasecmp(arg, "off")) {
+  if (!strcasecmp(arg, "off")) {
     /* Turn chat off */
     if (dcc[idx].u.chat->channel < 0) {
       dprintf(idx, "You weren't in chat anyway!\n");
@@ -1822,7 +1822,7 @@
       }
     } else {
       if (((arg[0] < '0') || (arg[0] > '9')) && (arg[0])) {
-	if (!egg_strcasecmp(arg, "on"))
+	if (!strcasecmp(arg, "on"))
 	  newchan = 0;
 	else {
 	  Tcl_SetVar(interp, "chan", arg, 0);
@@ -1898,10 +1898,10 @@
 	    "on" : "off");
     return;
   }
-  if (!egg_strcasecmp(par, "on")) {
+  if (!strcasecmp(par, "on")) {
     dprintf(idx, "Echo turned on.\n");
     dcc[idx].status |= STAT_ECHO;
-  } else if (!egg_strcasecmp(par, "off")) {
+  } else if (!strcasecmp(par, "off")) {
     dprintf(idx, "Echo turned off.\n");
     dcc[idx].status &= ~STAT_ECHO;
   } else {
@@ -2010,7 +2010,7 @@
   if ((nick[0] != '+') && (nick[0] != '-') && u &&
       (u->flags & USER_MASTER)) {
     for (i = 0; i < dcc_total; i++)
-      if (!egg_strcasecmp(nick, dcc[i].nick) && dcc[i].type == &DCC_CHAT &&
+      if (!strcasecmp(nick, dcc[i].nick) && dcc[i].type == &DCC_CHAT &&
 	  !ok) {
 	ok = 1;
 	dest = i;
@@ -2179,7 +2179,7 @@
     return;
   }
   a = atoi(par);
-  if ((!a && !par[0]) || !egg_strcasecmp(par, "off")) {
+  if ((!a && !par[0]) || !strcasecmp(par, "off")) {
     dcc[idx].status &= ~STAT_PAGE;
     dcc[idx].u.chat->max_line = 0x7ffffff;	/* flush_lines needs this */
     while (dcc[idx].u.chat->buffer)
@@ -2413,7 +2413,7 @@
     dprintf(idx, "Someone already exists by that name.\n");
   else if (strchr(BADNICKCHARS, handle[0]) != NULL)
     dprintf(idx, "You can't start a nick with '%c'.\n", handle[0]);
-  else if (!egg_strcasecmp(handle, botnetnick))
+  else if (!strcasecmp(handle, botnetnick))
     dprintf(idx, "Hey! That's MY name!\n");
   else {
     putlog(LOG_CMDS, "*", "#%s# +user %s %s", dcc[idx].nick, handle, host);
@@ -2453,7 +2453,7 @@
     }
     for (idx2 = 0; idx2 < dcc_total; idx2++)
       if (dcc[idx2].type != &DCC_RELAY && dcc[idx2].type != &DCC_FORK_BOT &&
-          !egg_strcasecmp(dcc[idx2].nick, handle))
+          !strcasecmp(dcc[idx2].nick, handle))
         break;
     if (idx2 != dcc_total) {
       dprintf(idx, "You can't remove a directly linked bot.\n");
@@ -2498,7 +2498,7 @@
     dprintf(idx, "No such user.\n");
     return;
   }
-  if (egg_strcasecmp(handle, dcc[idx].nick)) {
+  if (strcasecmp(handle, dcc[idx].nick)) {
     get_user_flagrec(u, &fr, NULL);
     if ((u->flags & USER_BOTMAST) && !(u->flags & USER_MASTER) &&
 	!(u2->flags & USER_BOT) && !chan_master(fr)) {
@@ -2511,7 +2511,7 @@
       return;
     }
     if ((u2->flags & (USER_OWNER|USER_MASTER)) &&
-	!(u->flags & USER_OWNER) && egg_strcasecmp(handle, dcc[idx].nick)) {
+	!(u->flags & USER_OWNER) && strcasecmp(handle, dcc[idx].nick)) {
       dprintf(idx, "Can't add hostmasks to the bot owner/master.\n");
       return;
     }
@@ -2527,7 +2527,7 @@
     }
   }
   for (q = get_user(&USERENTRY_HOSTS, u); q; q = q->next)
-    if (!egg_strcasecmp(q->extra, host)) {
+    if (!strcasecmp(q->extra, host)) {
       dprintf(idx, "That hostmask is already there.\n");
       return;
     }
@@ -2569,7 +2569,7 @@
     return;
   }
 
-  if (egg_strcasecmp(handle, dcc[idx].nick)) {
+  if (strcasecmp(handle, dcc[idx].nick)) {
     if (!(u2->flags & USER_BOT) && !(u->flags & USER_MASTER) &&
 	!chan_master(fr)) {
       dprintf(idx, _("You can't remove hostmasks from non-bots.\n"));
Index: eggdrop1.7/src/compat/Makefile.am
diff -u eggdrop1.7/src/compat/Makefile.am:1.3 eggdrop1.7/src/compat/Makefile.am:1.4
--- eggdrop1.7/src/compat/Makefile.am:1.3	Sun Oct 14 05:22:50 2001
+++ eggdrop1.7/src/compat/Makefile.am	Thu Oct 18 20:55:05 2001
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.3 2001/10/14 10:22:50 tothwolf Exp $
+# $Id: Makefile.am,v 1.4 2001/10/19 01:55:05 tothwolf Exp $
 
 ## libcompat is built as convenience library
 
@@ -6,19 +6,19 @@
 
 INCLUDES		= -I$(top_builddir) -I$(top_srcdir)
 
-noinst_LTLIBRARIES = libcompat.la
-libcompat_la_SOURCES = compat.h \
-		gnu_strftime.c \
-		inet_aton.c \
-		inet_aton.h \
-		inet_ntop.c \
-		inet_ntop.h \
-		inet_pton.c \
-		inet_pton.h \
-		snprintf.c \
-		snprintf.h \
-		strcasecmp.c \
-		strcasecmp.h \
-		strftime.c \
-		strftime.h
+noinst_LTLIBRARIES	= libcompat.la
+
+# LIBOBJS files are automatically added to the 'make dist' tarball
+libcompat_la_LIBADD	= @LIBOBJS@ $(SNPRINTF_LIBS)
+
+libcompat_la_SOURCES	= compat.h \
+			inet_aton.h \
+			inet_ntop.h \
+			inet_pton.h \
+			memcpy.h \
+			memset.h \
+			snprintf.h \
+			strcasecmp.h \
+			strncasecmp.h \
+			strftime.h
 
Index: eggdrop1.7/src/compat/compat.h
diff -u eggdrop1.7/src/compat/compat.h:1.5 eggdrop1.7/src/compat/compat.h:1.6
--- eggdrop1.7/src/compat/compat.h:1.5	Wed Oct 10 05:44:04 2001
+++ eggdrop1.7/src/compat/compat.h	Thu Oct 18 20:55:06 2001
@@ -1,8 +1,8 @@
 /*
  * compat.h
- *   wrap-around header for all compability functions.
+ *   prototypes for compability functions
  *
- * $Id: compat.h,v 1.5 2001/10/10 10:44:04 tothwolf Exp $
+ * $Id: compat.h,v 1.6 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (C) 2000, 2001 Eggheads Development Team
@@ -21,17 +21,20 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
+#ifndef _EGG_COMPAT_H
+#define _EGG_COMPAT_H
 
-#ifndef _EGG_COMPAT_COMPAT_H
-#define _EGG_COMPAT_COMPAT_H
-
-#include "config.h"
-
-#include "inet_aton.h"
-#include "snprintf.h"
+/*
+ * Include prototypes
+ */
+#include "memcpy.h"
+#include "memset.h"
 #include "strcasecmp.h"
+#include "strncasecmp.h"
+#include "snprintf.h"
 #include "strftime.h"
-#include "inet_pton.h"
+#include "inet_aton.h"
 #include "inet_ntop.h"
+#include "inet_pton.h"
 
-#endif	/* !__EGG_COMPAT_COMPAT_H */
+#endif				/* !_EGG_COMPAT_H */
Index: eggdrop1.7/src/compat/gnu_strftime.c
diff -u eggdrop1.7/src/compat/gnu_strftime.c:1.1 eggdrop1.7/src/compat/gnu_strftime.c:removed
--- eggdrop1.7/src/compat/gnu_strftime.c:1.1	Mon Sep 18 05:06:14 2000
+++ eggdrop1.7/src/compat/gnu_strftime.c	Thu Oct 18 20:55:19 2001
@@ -1,1257 +0,0 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,98 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library 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
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifdef _LIBC
-# define HAVE_LIMITS_H 1
-# define HAVE_MBLEN 1
-# define HAVE_MBRLEN 1
-# define HAVE_STRUCT_ERA_ENTRY 1
-# define HAVE_TM_GMTOFF 1
-# define HAVE_TM_ZONE 1
-# define HAVE_TZNAME 1
-# define HAVE_TZSET 1
-# define MULTIBYTE_IS_FORMAT_SAFE 1
-# define STDC_HEADERS 1
-# include "../locale/localeinfo.h"
-#endif
-
-#if defined emacs && !defined HAVE_BCOPY
-# define HAVE_MEMCPY 1
-#endif
-
-#include <ctype.h>
-#include <sys/types.h>		/* Some systems define `time_t' here.  */
-
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# ifdef HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-#if HAVE_TZNAME
-extern char *tzname[];
-#endif
-
-/* Do multibyte processing if multibytes are supported, unless
-   multibyte sequences are safe in formats.  Multibyte sequences are
-   safe if they cannot contain byte sequences that look like format
-   conversion specifications.  The GNU C Library uses UTF8 multibyte
-   encoding, which is safe for formats, but strftime.c can be used
-   with other C libraries that use unsafe encodings.  */
-#define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE)
-
-#if DO_MULTIBYTE
-# if HAVE_MBRLEN
-#  include <wchar.h>
-# else
-   /* Simulate mbrlen with mblen as best we can.  */
-#  define mbstate_t int
-#  define mbrlen(s, n, ps) mblen (s, n)
-#  define mbsinit(ps) (*(ps) == 0)
-# endif
-  static const mbstate_t mbstate_zero;
-#endif
-
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#if STDC_HEADERS
-# include <stddef.h>
-# include <stdlib.h>
-# include <string.h>
-#else
-# ifndef HAVE_MEMCPY
-#  define memcpy(d, s, n) bcopy ((s), (d), (n))
-# endif
-#endif
-
-#ifdef _LIBC
-# define MEMPCPY(d, s, n) __mempcpy (d, s, n)
-#else
-# ifndef HAVE_MEMPCPY
-#  define MEMPCPY(d, s, n) ((void *) ((char *) memcpy (d, s, n) + (n)))
-# endif
-#endif
-
-#ifndef __P
-# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
-#  define __P(args) args
-# else
-#  define __P(args) ()
-# endif  /* GCC.  */
-#endif  /* Not __P.  */
-
-#ifndef PTR
-# ifdef __STDC__
-#  define PTR void *
-# else
-#  define PTR char *
-# endif
-#endif
-
-#ifndef CHAR_BIT
-# define CHAR_BIT 8
-#endif
-
-#ifndef NULL
-# define NULL 0
-#endif
-
-#define TYPE_SIGNED(t) ((t) -1 < 0)
-
-/* Bound on length of the string representing an integer value of type t.
-   Subtract one for the sign bit if t is signed;
-   302 / 1000 is log10 (2) rounded up;
-   add one for integer division truncation;
-   add one more for a minus sign if t is signed.  */
-#define INT_STRLEN_BOUND(t) \
- ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 + 1 + TYPE_SIGNED (t))
-
-#define TM_YEAR_BASE 1900
-
-#ifndef __isleap
-/* Nonzero if YEAR is a leap year (every 4 years,
-   except every 100th isn't, and every 400th is).  */
-# define __isleap(year)	\
-  ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
-#endif
-
-
-#ifdef _LIBC
-# define my_strftime_gmtime_r __gmtime_r
-# define my_strftime_localtime_r __localtime_r
-# define tzname __tzname
-# define tzset __tzset
-#else
-
-/* If we're a strftime substitute in a GNU program, then prefer gmtime
-   to gmtime_r, since many gmtime_r implementations are buggy.
-   Similarly for localtime_r.  */
-
-# if ! HAVE_TM_GMTOFF
-static struct tm *my_strftime_gmtime_r __P ((const time_t *, struct tm *));
-static struct tm *
-my_strftime_gmtime_r (t, tp)
-     const time_t *t;
-     struct tm *tp;
-{
-  struct tm *l = gmtime (t);
-  if (! l)
-    return 0;
-  *tp = *l;
-  return tp;
-}
-# endif /* ! HAVE_TM_GMTOFF */
-
-static struct tm *my_strftime_localtime_r __P ((const time_t *, struct tm *));
-static struct tm *
-my_strftime_localtime_r (t, tp)
-     const time_t *t;
-     struct tm *tp;
-{
-  struct tm *l = localtime (t);
-  if (! l)
-    return 0;
-  *tp = *l;
-  return tp;
-}
-#endif /* ! defined _LIBC */
-
-
-#if !defined memset && !defined HAVE_MEMSET && !defined _LIBC
-/* Some systems lack the `memset' function and we don't want to
-   introduce additional dependencies.  */
-/* The SGI compiler reportedly barfs on the trailing null
-   if we use a string constant as the initializer.  28 June 1997, rms.  */
-static const char spaces[16] = /* "                " */
-  { ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ' };
-static const char zeroes[16] = /* "0000000000000000" */
-  { '0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0' };
-
-# define memset_space(P, Len) \
-  do {									      \
-    int _len = (Len);							      \
-									      \
-    do									      \
-      {									      \
-	int _this = _len > 16 ? 16 : _len;				      \
-	(P) = MEMPCPY ((P), spaces, _this);				      \
-	_len -= _this;							      \
-      }									      \
-    while (_len > 0);							      \
-  } while (0)
-
-# define memset_zero(P, Len) \
-  do {									      \
-    int _len = (Len);							      \
-									      \
-    do									      \
-      {									      \
-	int _this = _len > 16 ? 16 : _len;				      \
-	(P) = MEMPCPY ((P), zeroes, _this);				      \
-	_len -= _this;							      \
-      }									      \
-    while (_len > 0);							      \
-  } while (0)
-#else
-# define memset_space(P, Len) (memset ((P), ' ', (Len)), (P) += (Len))
-# define memset_zero(P, Len) (memset ((P), '0', (Len)), (P) += (Len))
-#endif
-
-#define add(n, f)							      \
-  do									      \
-    {									      \
-      int _n = (n);							      \
-      int _delta = width - _n;						      \
-      int _incr = _n + (_delta > 0 ? _delta : 0);			      \
-      if (i + _incr >= maxsize)						      \
-	return 0;							      \
-      if (p)								      \
-	{								      \
-	  if (_delta > 0)						      \
-	    {								      \
-	      if (pad == '0')						      \
-		memset_zero (p, _delta);				      \
-	      else							      \
-		memset_space (p, _delta);				      \
-	    }								      \
-	  f;								      \
-	  p += _n;							      \
-	}								      \
-      i += _incr;							      \
-    } while (0)
-
-#define cpy(n, s) \
-    add ((n),								      \
-	 if (to_lowcase)						      \
-	   memcpy_lowcase (p, (s), _n);					      \
-	 else if (to_uppcase)						      \
-	   memcpy_uppcase (p, (s), _n);					      \
-	 else								      \
-	   memcpy ((PTR) p, (PTR) (s), _n))
-
-
-
-#ifdef _LIBC
-# define TOUPPER(Ch) toupper (Ch)
-# define TOLOWER(Ch) tolower (Ch)
-#else
-# define TOUPPER(Ch) (islower (Ch) ? toupper (Ch) : (Ch))
-# define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
-#endif
-/* We don't use `isdigit' here since the locale dependent
-   interpretation is not what we want here.  We only need to accept
-   the arabic digits in the ASCII range.  One day there is perhaps a
-   more reliable way to accept other sets of digits.  */
-#define ISDIGIT(Ch) ((unsigned int) (Ch) - '0' <= 9)
-
-static char *memcpy_lowcase __P ((char *dest, const char *src, size_t len));
-
-static char *
-memcpy_lowcase (dest, src, len)
-     char *dest;
-     const char *src;
-     size_t len;
-{
-  while (len-- > 0)
-    dest[len] = TOLOWER ((unsigned char) src[len]);
-  return dest;
-}
-
-static char *memcpy_uppcase __P ((char *dest, const char *src, size_t len));
-
-static char *
-memcpy_uppcase (dest, src, len)
-     char *dest;
-     const char *src;
-     size_t len;
-{
-  while (len-- > 0)
-    dest[len] = TOUPPER ((unsigned char) src[len]);
-  return dest;
-}
-
-
-#if ! HAVE_TM_GMTOFF
-/* Yield the difference between *A and *B,
-   measured in seconds, ignoring leap seconds.  */
-# define tm_diff ftime_tm_diff
-static int tm_diff __P ((const struct tm *, const struct tm *));
-static int
-tm_diff (a, b)
-     const struct tm *a;
-     const struct tm *b;
-{
-  /* Compute intervening leap days correctly even if year is negative.
-     Take care to avoid int overflow in leap day calculations,
-     but it's OK to assume that A and B are close to each other.  */
-  int a4 = (a->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (a->tm_year & 3);
-  int b4 = (b->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (b->tm_year & 3);
-  int a100 = a4 / 25 - (a4 % 25 < 0);
-  int b100 = b4 / 25 - (b4 % 25 < 0);
-  int a400 = a100 >> 2;
-  int b400 = b100 >> 2;
-  int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400);
-  int years = a->tm_year - b->tm_year;
-  int days = (365 * years + intervening_leap_days
-	      + (a->tm_yday - b->tm_yday));
-  return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour))
-		+ (a->tm_min - b->tm_min))
-	  + (a->tm_sec - b->tm_sec));
-}
-#endif /* ! HAVE_TM_GMTOFF */
-
-
-
-/* The number of days from the first day of the first ISO week of this
-   year to the year day YDAY with week day WDAY.  ISO weeks start on
-   Monday; the first ISO week has the year's first Thursday.  YDAY may
-   be as small as YDAY_MINIMUM.  */
-#define ISO_WEEK_START_WDAY 1 /* Monday */
-#define ISO_WEEK1_WDAY 4 /* Thursday */
-#define YDAY_MINIMUM (-366)
-static int iso_week_days __P ((int, int));
-#ifdef __GNUC__
-__inline__
-#endif
-static int
-iso_week_days (yday, wday)
-     int yday;
-     int wday;
-{
-  /* Add enough to the first operand of % to make it nonnegative.  */
-  int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7;
-  return (yday
-	  - (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7
-	  + ISO_WEEK1_WDAY - ISO_WEEK_START_WDAY);
-}
-
-
-#if !(defined _NL_CURRENT || HAVE_STRFTIME)
-static char const weekday_name[][10] =
-  {
-    "Sunday", "Monday", "Tuesday", "Wednesday",
-    "Thursday", "Friday", "Saturday"
-  };
-static char const month_name[][10] =
-  {
-    "January", "February", "March", "April", "May", "June",
-    "July", "August", "September", "October", "November", "December"
-  };
-#endif
-
-
-#ifdef emacs
-# define my_strftime emacs_strftimeu
-# define ut_argument , ut
-# define ut_argument_spec int ut;
-# define ut_argument_spec_iso , int ut
-#else
-# define my_strftime strftime
-# define ut_argument
-# define ut_argument_spec
-# define ut_argument_spec_iso
-/* We don't have this information in general.  */
-# define ut 0
-#endif
-
-#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
-  /* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
-     Work around this bug by copying *tp before it might be munged.  */
-  size_t _strftime_copytm __P ((char *, size_t, const char *,
-			        const struct tm * ut_argument_spec_iso));
-  size_t
-  my_strftime (s, maxsize, format, tp ut_argument)
-      char *s;
-      size_t maxsize;
-      const char *format;
-      const struct tm *tp;
-      ut_argument_spec
-  {
-    struct tm tmcopy;
-    tmcopy = *tp;
-    return _strftime_copytm (s, maxsize, format, &tmcopy ut_argument);
-  }
-# undef my_strftime
-# define my_strftime(S, Maxsize, Format, Tp) \
-  _strftime_copytm (S, Maxsize, Format, Tp)
-#endif
-
-
-/* Write information from TP into S according to the format
-   string FORMAT, writing no more that MAXSIZE characters
-   (including the terminating '\0') and returning number of
-   characters written.  If S is NULL, nothing will be written
-   anywhere, so to determine how many characters would be
-   written, use NULL for S and (size_t) UINT_MAX for MAXSIZE.  */
-size_t
-my_strftime (s, maxsize, format, tp ut_argument)
-      char *s;
-      size_t maxsize;
-      const char *format;
-      const struct tm *tp;
-      ut_argument_spec
-{
-  int hour12 = tp->tm_hour;
-#ifdef _NL_CURRENT
-  /* We cannot make the following values variables since we must delay
-     the evaluation of these values until really needed since some
-     expressions might not be valid in every situation.  The `struct tm'
-     might be generated by a strptime() call that initialized
-     only a few elements.  Dereference the pointers only if the format
-     requires this.  Then it is ok to fail if the pointers are invalid.  */
-# define a_wkday _NL_CURRENT (LC_TIME, ABDAY_1 + tp->tm_wday)
-# define f_wkday _NL_CURRENT (LC_TIME, DAY_1 + tp->tm_wday)
-# define a_month _NL_CURRENT (LC_TIME, ABMON_1 + tp->tm_mon)
-# define f_month _NL_CURRENT (LC_TIME, MON_1 + tp->tm_mon)
-# define ampm _NL_CURRENT (LC_TIME, tp->tm_hour > 11 ? PM_STR : AM_STR)
-
-# define aw_len strlen (a_wkday)
-# define am_len strlen (a_month)
-# define ap_len strlen (ampm)
-#else
-# if !HAVE_STRFTIME
-# define f_wkday (weekday_name[tp->tm_wday])
-# define f_month (month_name[tp->tm_mon])
-# define a_wkday f_wkday
-# define a_month f_month
-# define ampm ("AMPM" + 2 * (tp->tm_hour > 11))
-
-  size_t aw_len = 3;
-  size_t am_len = 3;
-  size_t ap_len = 2;
-# endif
-#endif
-  const char *zone;
-  size_t i = 0;
-  char *p = s;
-  const char *f;
-
-  zone = NULL;
-#if HAVE_TM_ZONE
-  /* The POSIX test suite assumes that setting
-     the environment variable TZ to a new value before calling strftime()
-     will influence the result (the %Z format) even if the information in
-     TP is computed with a totally different time zone.
-     This is bogus: though POSIX allows bad behavior like this,
-     POSIX does not require it.  Do the right thing instead.  */
-  zone = (const char *) tp->tm_zone;
-#endif
-#if HAVE_TZNAME
-  if (ut)
-    {
-      if (! (zone && *zone))
-	zone = "GMT";
-    }
-  else
-    {
-      /* POSIX.1 8.1.1 requires that whenever strftime() is called, the
-	 time zone names contained in the external variable `tzname' shall
-	 be set as if the tzset() function had been called.  */
-# if HAVE_TZSET
-      tzset ();
-# endif
-    }
-#endif
-
-  if (hour12 > 12)
-    hour12 -= 12;
-  else
-    if (hour12 == 0)
-      hour12 = 12;
-
-  for (f = format; *f != '\0'; ++f)
-    {
-      int pad = 0;		/* Padding for number ('-', '_', or 0).  */
-      int modifier;		/* Field modifier ('E', 'O', or 0).  */
-      int digits;		/* Max digits for numeric format.  */
-      int number_value; 	/* Numeric value to be printed.  */
-      int negative_number;	/* 1 if the number is negative.  */
-      const char *subfmt;
-      char *bufp;
-      char buf[1 + (sizeof (int) < sizeof (time_t)
-		    ? INT_STRLEN_BOUND (time_t)
-		    : INT_STRLEN_BOUND (int))];
-      int width = -1;
-      int to_lowcase = 0;
-      int to_uppcase = 0;
-      int change_case = 0;
-      int format_char;
-
-#if DO_MULTIBYTE
-
-       switch (*f)
-	{
-	case '%':
-	  break;
-
-	case '\a': case '\b': case '\t': case '\n':
-	case '\v': case '\f': case '\r':
-	case ' ': case '!': case '"': case '#': case '&': case'\'':
-	case '(': case ')': case '*': case '+': case ',': case '-':
-	case '.': case '/': case '0': case '1': case '2': case '3':
-	case '4': case '5': case '6': case '7': case '8': case '9':
-	case ':': case ';': case '<': case '=': case '>': case '?':
-	case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-	case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
-	case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
-	case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-	case 'Y': case 'Z': case '[': case'\\': case ']': case '^':
-	case '_': case 'a': case 'b': case 'c': case 'd': case 'e':
-	case 'f': case 'g': case 'h': case 'i': case 'j': case 'k':
-	case 'l': case 'm': case 'n': case 'o': case 'p': case 'q':
-	case 'r': case 's': case 't': case 'u': case 'v': case 'w':
-	case 'x': case 'y': case 'z': case '{': case '|': case '}':
-	case '~':
-	  /* The C Standard requires these 98 characters (plus '%') to
-	     be in the basic execution character set.  None of these
-	     characters can start a multibyte sequence, so they need
-	     not be analyzed further.  */
-	  add (1, *p = *f);
-	  continue;
-
-	default:
-	  /* Copy this multibyte sequence until we reach its end, find
-	     an error, or come back to the initial shift state.  */
-	  {
-	    mbstate_t mbstate = mbstate_zero;
-	    size_t len = 0;
-
-	    do
-	      {
-		size_t bytes = mbrlen (f + len, (size_t) -1, &mbstate);
-
-		if (bytes == 0)
-		  break;
-
-		if (bytes == (size_t) -2)
-		  {
-		    len += strlen (f + len);
-		    break;
-		  }
-
-		if (bytes == (size_t) -1)
-		  {
-		    len++;
-		    break;
-		  }
-
-		len += bytes;
-	      }
-	    while (! mbsinit (&mbstate));
-
-	    cpy (len, f);
-	    f += len - 1;
-	    continue;
-	  }
-	}
-
-#else /* ! DO_MULTIBYTE */
-
-      /* Either multibyte encodings are not supported, or they are
-	 safe for formats, so any non-'%' byte can be copied through.  */
-      if (*f != '%')
-	{
-	  add (1, *p = *f);
-	  continue;
-	}
-
-#endif /* ! DO_MULTIBYTE */
-
-      /* Check for flags that can modify a format.  */
-      while (1)
-	{
-	  switch (*++f)
-	    {
-	      /* This influences the number formats.  */
-	    case '_':
-	    case '-':
-	    case '0':
-	      pad = *f;
-	      continue;
-
-	      /* This changes textual output.  */
-	    case '^':
-	      to_uppcase = 1;
-	      continue;
-	    case '#':
-	      change_case = 1;
-	      continue;
-
-	    default:
-	      break;
-	    }
-	  break;
-	}
-
-      /* As a GNU extension we allow to specify the field width.  */
-      if (ISDIGIT (*f))
-	{
-	  width = 0;
-	  do
-	    {
-	      width *= 10;
-	      width += *f - '0';
-	      ++f;
-	    }
-	  while (ISDIGIT (*f));
-	}
-
-      /* Check for modifiers.  */
-      switch (*f)
-	{
-	case 'E':
-	case 'O':
-	  modifier = *f++;
-	  break;
-
-	default:
-	  modifier = 0;
-	  break;
-	}
-
-      /* Now do the specified format.  */
-      format_char = *f;
-      switch (format_char)
-	{
-#define DO_NUMBER(d, v) \
-	  digits = width == -1 ? d : width;				      \
-	  number_value = v; goto do_number
-#define DO_NUMBER_SPACEPAD(d, v) \
-	  digits = width == -1 ? d : width;				      \
-	  number_value = v; goto do_number_spacepad
-
-	case '%':
-	  if (modifier != 0)
-	    goto bad_format;
-	  add (1, *p = *f);
-	  break;
-
-	case 'a':
-	  if (modifier != 0)
-	    goto bad_format;
-	  if (change_case)
-	    {
-	      to_uppcase = 1;
-	      to_lowcase = 0;
-	    }
-#if defined _NL_CURRENT || !HAVE_STRFTIME
-	  cpy (aw_len, a_wkday);
-	  break;
-#else
-	  goto underlying_strftime;
-#endif
-
-	case 'A':
-	  if (modifier != 0)
-	    goto bad_format;
-	  if (change_case)
-	    {
-	      to_uppcase = 1;
-	      to_lowcase = 0;
-	    }
-#if defined _NL_CURRENT || !HAVE_STRFTIME
-	  cpy (strlen (f_wkday), f_wkday);
-	  break;
-#else
-	  goto underlying_strftime;
-#endif
-
-	case 'b':
-	case 'h':		/* POSIX.2 extension.  */
-	  if (modifier != 0)
-	    goto bad_format;
-#if defined _NL_CURRENT || !HAVE_STRFTIME
-	  cpy (am_len, a_month);
-	  break;
-#else
-	  goto underlying_strftime;
-#endif
-
-	case 'B':
-	  if (modifier != 0)
-	    goto bad_format;
-	  if (change_case)
-	    {
-	      to_uppcase = 1;
-	      to_lowcase = 0;
-	    }
-#if defined _NL_CURRENT || !HAVE_STRFTIME
-	  cpy (strlen (f_month), f_month);
-	  break;
-#else
-	  goto underlying_strftime;
-#endif
-
-	case 'c':
-	  if (modifier == 'O')
-	    goto bad_format;
-#ifdef _NL_CURRENT
-	  if (! (modifier == 'E'
-		 && *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT)) != '\0'))
-	    subfmt = _NL_CURRENT (LC_TIME, D_T_FMT);
-#else
-# if HAVE_STRFTIME
-	  goto underlying_strftime;
-# else
-	  subfmt = "%a %b %e %H:%M:%S %Y";
-# endif
-#endif
-
-	subformat:
-	  {
-	    char *old_start = p;
-	    size_t len = my_strftime (NULL, (size_t) -1, subfmt, tp);
-	    add (len, my_strftime (p, maxsize - i, subfmt, tp));
-
-	    if (to_uppcase)
-	      while (old_start < p)
-		{
-		  *old_start = TOUPPER ((unsigned char) *old_start);
-		  ++old_start;
-		}
-	  }
-	  break;
-
-#if HAVE_STRFTIME && ! (defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY)
-	underlying_strftime:
-	  {
-	    /* The relevant information is available only via the
-	       underlying strftime implementation, so use that.  */
-	    char ufmt[4];
-	    char *u = ufmt;
-	    char ubuf[1024]; /* enough for any single format in practice */
-	    size_t len;
-	    *u++ = '%';
-	    if (modifier != 0)
-	      *u++ = modifier;
-	    *u++ = format_char;
-	    *u = '\0';
-	    len = strftime (ubuf, sizeof ubuf, ufmt, tp);
-	    if (len == 0 && ubuf[0] != '\0')
-	      return 0;
-	    cpy (len, ubuf);
-	  }
-	  break;
-#endif
-
-	case 'C':		/* POSIX.2 extension.  */
-	  if (modifier == 'O')
-	    goto bad_format;
-	  if (modifier == 'E')
-	    {
-#if HAVE_STRUCT_ERA_ENTRY
-	      struct era_entry *era = _nl_get_era_entry (tp);
-	      if (era)
-		{
-		  size_t len = strlen (era->name_fmt);
-		  cpy (len, era->name_fmt);
-		  break;
-		}
-#else
-# if HAVE_STRFTIME
-	      goto underlying_strftime;
-# endif
-#endif
-	    }
-
-	  {
-	    int year = tp->tm_year + TM_YEAR_BASE;
-	    DO_NUMBER (1, year / 100 - (year % 100 < 0));
-	  }
-
-	case 'x':
-	  if (modifier == 'O')
-	    goto bad_format;
-#ifdef _NL_CURRENT
-	  if (! (modifier == 'E'
-		 && *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_FMT)) != '\0'))
-	    subfmt = _NL_CURRENT (LC_TIME, D_FMT);
-	  goto subformat;
-#else
-# if HAVE_STRFTIME
-	  goto underlying_strftime;
-# else
-	  /* Fall through.  */
-# endif
-#endif
-	case 'D':		/* POSIX.2 extension.  */
-	  if (modifier != 0)
-	    goto bad_format;
-	  subfmt = "%m/%d/%y";
-	  goto subformat;
-
-	case 'd':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, tp->tm_mday);
-
-	case 'e':		/* POSIX.2 extension.  */
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER_SPACEPAD (2, tp->tm_mday);
-
-	  /* All numeric formats set DIGITS and NUMBER_VALUE and then
-	     jump to one of these two labels.  */
-
-	do_number_spacepad:
-	  /* Force `_' flag unless overwritten by `0' flag.  */
-	  if (pad != '0')
-	    pad = '_';
-
-	do_number:
-	  /* Format the number according to the MODIFIER flag.  */
-
-	  if (modifier == 'O' && 0 <= number_value)
-	    {
-#ifdef _NL_CURRENT
-	      /* Get the locale specific alternate representation of
-		 the number NUMBER_VALUE.  If none exist NULL is returned.  */
-	      const char *cp = _nl_get_alt_digit (number_value);
-
-	      if (cp != NULL)
-		{
-		  size_t digitlen = strlen (cp);
-		  if (digitlen != 0)
-		    {
-		      cpy (digitlen, cp);
-		      break;
-		    }
-		}
-#else
-# if HAVE_STRFTIME
-	      goto underlying_strftime;
-# endif
-#endif
-	    }
-	  {
-	    unsigned int u = number_value;
-
-	    bufp = buf + sizeof (buf);
-	    negative_number = number_value < 0;
-
-	    if (negative_number)
-	      u = -u;
-
-	    do
-	      *--bufp = u % 10 + '0';
-	    while ((u /= 10) != 0);
-  	  }
-
-	do_number_sign_and_padding:
-	  if (negative_number)
-	    *--bufp = '-';
-
-	  if (pad != '-')
-	    {
-	      int padding = digits - (buf + sizeof (buf) - bufp);
-
-	      if (pad == '_')
-		{
-		  while (0 < padding--)
-		    *--bufp = ' ';
-		}
-	      else
-		{
-		  bufp += negative_number;
-		  while (0 < padding--)
-		    *--bufp = '0';
-		  if (negative_number)
-		    *--bufp = '-';
-		}
-	    }
-
-	  cpy (buf + sizeof (buf) - bufp, bufp);
-	  break;
-
-	case 'F':
-	  if (modifier != 0)
-	    goto bad_format;
-	  subfmt = "%Y-%m-%d";
-	  goto subformat;
-
-	case 'H':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, tp->tm_hour);
-
-	case 'I':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, hour12);
-
-	case 'k':		/* GNU extension.  */
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER_SPACEPAD (2, tp->tm_hour);
-
-	case 'l':		/* GNU extension.  */
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER_SPACEPAD (2, hour12);
-
-	case 'j':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (3, 1 + tp->tm_yday);
-
-	case 'M':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, tp->tm_min);
-
-	case 'm':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, tp->tm_mon + 1);
-
-	case 'n':		/* POSIX.2 extension.  */
-	  add (1, *p = '\n');
-	  break;
-
-	case 'P':
-	  to_lowcase = 1;
-#if !defined _NL_CURRENT && HAVE_STRFTIME
-	  format_char = 'p';
-#endif
-	  /* FALLTHROUGH */
-
-	case 'p':
-	  if (change_case)
-	    {
-	      to_uppcase = 0;
-	      to_lowcase = 1;
-	    }
-#if defined _NL_CURRENT || !HAVE_STRFTIME
-	  cpy (ap_len, ampm);
-	  break;
-#else
-	  goto underlying_strftime;
-#endif
-
-	case 'R':		/* GNU extension.  */
-	  subfmt = "%H:%M";
-	  goto subformat;
-
-	case 'r':		/* POSIX.2 extension.  */
-#ifdef _NL_CURRENT
-	  if (*(subfmt = _NL_CURRENT (LC_TIME, T_FMT_AMPM)) == '\0')
-#endif
-	    subfmt = "%I:%M:%S %p";
-	  goto subformat;
-
-	case 'S':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, tp->tm_sec);
-
-	case 's':		/* GNU extension.  */
-  	  {
-	    struct tm ltm;
-	    time_t t;
-
-	    ltm = *tp;
-	    t = mktime (&ltm);
-
-	    /* Generate string value for T using time_t arithmetic;
-	       this works even if sizeof (long) < sizeof (time_t).  */
-
-	    bufp = buf + sizeof (buf);
-	    negative_number = t < 0;
-
-	    do
-	      {
-		int d = t % 10;
-		t /= 10;
-
-		if (negative_number)
-		  {
-		    d = -d;
-
-		    /* Adjust if division truncates to minus infinity.  */
-		    if (0 < -1 % 10 && d < 0)
-		      {
-			t++;
-			d += 10;
-		      }
-		  }
-
-		*--bufp = d + '0';
-	      }
-	    while (t != 0);
-
-	    digits = 1;
-	    goto do_number_sign_and_padding;
-	  }
-
-	case 'X':
-	  if (modifier == 'O')
-	    goto bad_format;
-#ifdef _NL_CURRENT
-	  if (! (modifier == 'E'
-		 && *(subfmt = _NL_CURRENT (LC_TIME, ERA_T_FMT)) != '\0'))
-	    subfmt = _NL_CURRENT (LC_TIME, T_FMT);
-	  goto subformat;
-#else
-# if HAVE_STRFTIME
-	  goto underlying_strftime;
-# else
-	  /* Fall through.  */
-# endif
-#endif
-	case 'T':		/* POSIX.2 extension.  */
-	  subfmt = "%H:%M:%S";
-	  goto subformat;
-
-	case 't':		/* POSIX.2 extension.  */
-	  add (1, *p = '\t');
-	  break;
-
-	case 'u':		/* POSIX.2 extension.  */
-	  DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1);
-
-	case 'U':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7);
-
-	case 'V':
-	case 'g':		/* GNU extension.  */
-	case 'G':		/* GNU extension.  */
-	  if (modifier == 'E')
-	    goto bad_format;
-	  {
-	    int year = tp->tm_year + TM_YEAR_BASE;
-	    int days = iso_week_days (tp->tm_yday, tp->tm_wday);
-
-	    if (days < 0)
-	      {
-		/* This ISO week belongs to the previous year.  */
-		year--;
-		days = iso_week_days (tp->tm_yday + (365 + __isleap (year)),
-				      tp->tm_wday);
-	      }
-	    else
-	      {
-		int d = iso_week_days (tp->tm_yday - (365 + __isleap (year)),
-				       tp->tm_wday);
-		if (0 <= d)
-		  {
-		    /* This ISO week belongs to the next year.  */
-		    year++;
-		    days = d;
-		  }
-	      }
-
-	    switch (*f)
-	      {
-	      case 'g':
-		DO_NUMBER (2, (year % 100 + 100) % 100);
-
-	      case 'G':
-		DO_NUMBER (1, year);
-
-	      default:
-		DO_NUMBER (2, days / 7 + 1);
-	      }
-	  }
-
-	case 'W':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (2, (tp->tm_yday - (tp->tm_wday - 1 + 7) % 7 + 7) / 7);
-
-	case 'w':
-	  if (modifier == 'E')
-	    goto bad_format;
-
-	  DO_NUMBER (1, tp->tm_wday);
-
-	case 'Y':
-	  if (modifier == 'E')
-	    {
-#if HAVE_STRUCT_ERA_ENTRY
-	      struct era_entry *era = _nl_get_era_entry (tp);
-	      if (era)
-		{
-		  subfmt = strchr (era->name_fmt, '\0') + 1;
-		  goto subformat;
-		}
-#else
-# if HAVE_STRFTIME
-	      goto underlying_strftime;
-# endif
-#endif
-	    }
-	  if (modifier == 'O')
-	    goto bad_format;
-	  else
-	    DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
-
-	case 'y':
-	  if (modifier == 'E')
-	    {
-#if HAVE_STRUCT_ERA_ENTRY
-	      struct era_entry *era = _nl_get_era_entry (tp);
-	      if (era)
-		{
-		  int delta = tp->tm_year - era->start_date[0];
-		  DO_NUMBER (1, (era->offset
-				 + (era->direction == '-' ? -delta : delta)));
-		}
-#else
-# if HAVE_STRFTIME
-	      goto underlying_strftime;
-# endif
-#endif
-	    }
-	  DO_NUMBER (2, (tp->tm_year % 100 + 100) % 100);
-
-	case 'Z':
-	  if (change_case)
-	    {
-	      to_uppcase = 0;
-	      to_lowcase = 1;
-	    }
-
-#if HAVE_TZNAME
-	  /* The tzset() call might have changed the value.  */
-	  if (!(zone && *zone) && tp->tm_isdst >= 0)
-	    zone = tzname[tp->tm_isdst];
-#endif
-	  if (! zone)
-	    zone = "";		/* POSIX.2 requires the empty string here.  */
-
-	  cpy (strlen (zone), zone);
-	  break;
-
-	case 'z':		/* GNU extension.  */
-	  if (tp->tm_isdst < 0)
-	    break;
-
-	  {
-	    int diff;
-#if HAVE_TM_GMTOFF
-	    diff = tp->tm_gmtoff;
-#else
-	    if (ut)
-	      diff = 0;
-	    else
-	      {
-		struct tm gtm;
-		struct tm ltm;
-		time_t lt;
-
-		ltm = *tp;
-		lt = mktime (&ltm);
-
-		if (lt == (time_t) -1)
-		  {
-		    /* mktime returns -1 for errors, but -1 is also a
-		       valid time_t value.  Check whether an error really
-		       occurred.  */
-		    struct tm tm;
-
-		    if (! my_strftime_localtime_r (&lt, &tm)
-			|| ((ltm.tm_sec ^ tm.tm_sec)
-			    | (ltm.tm_min ^ tm.tm_min)
-			    | (ltm.tm_hour ^ tm.tm_hour)
-			    | (ltm.tm_mday ^ tm.tm_mday)
-			    | (ltm.tm_mon ^ tm.tm_mon)
-			    | (ltm.tm_year ^ tm.tm_year)))
-		      break;
-		  }
-
-		if (! my_strftime_gmtime_r (&lt, &gtm))
-		  break;
-
-		diff = tm_diff (&ltm, &gtm);
-	      }
-#endif
-
-	    if (diff < 0)
-	      {
-		add (1, *p = '-');
-		diff = -diff;
-	      }
-	    else
-	      add (1, *p = '+');
-
-	    diff /= 60;
-	    DO_NUMBER (4, (diff / 60) * 100 + diff % 60);
-	  }
-
-	case '\0':		/* GNU extension: % at end of format.  */
-	    --f;
-	    /* Fall through.  */
-	default:
-	  /* Unknown format; output the format, including the '%',
-	     since this is most likely the right thing to do if a
-	     multibyte string has been misparsed.  */
-	bad_format:
-	  {
-	    int flen;
-	    for (flen = 1; f[1 - flen] != '%'; flen++)
-	      continue;
-	    cpy (flen, &f[1 - flen]);
-	  }
-	  break;
-	}
-    }
-
-  if (p && maxsize != 0)
-    *p = '\0';
-  return i;
-}
-
-
-#ifdef emacs
-/* For Emacs we have a separate interface which corresponds to the normal
-   strftime function and does not have the extra information whether the
-   TP arguments comes from a `gmtime' call or not.  */
-size_t
-emacs_strftime (s, maxsize, format, tp)
-      char *s;
-      size_t maxsize;
-      const char *format;
-      const struct tm *tp;
-{
-  return my_strftime (s, maxsize, format, tp, 0);
-}
-#endif
Index: eggdrop1.7/src/compat/inet_aton.c
diff -u eggdrop1.7/src/compat/inet_aton.c:1.7 eggdrop1.7/src/compat/inet_aton.c:1.8
--- eggdrop1.7/src/compat/inet_aton.c:1.7	Wed Oct 10 05:44:04 2001
+++ eggdrop1.7/src/compat/inet_aton.c	Thu Oct 18 20:55:06 2001
@@ -1,36 +1,10 @@
 /*
- * inet_aton.c -- provides inet_aton() if necessary.
+ * inet_aton.c
+ *   provides inet_aton()
  *
- * $Id: inet_aton.c,v 1.7 2001/10/10 10:44:04 tothwolf Exp $
+ * $Id: inet_aton.c,v 1.8 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
- * Poritions Copyright (C) 2000, 2001 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.
- */
-
-#include "../main.h"
-#include "inet_aton.h"
-
-#ifndef HAVE_ISASCII
-/* Let all checks succeed if we don't have isascii(). */
-#  define isascii(x)	1
-#endif
-
-#ifndef HAVE_INET_ATON
-/*
  * ++Copyright++ 1983, 1990, 1993
  * -
  * Copyright (c) 1983, 1990, 1993
@@ -89,6 +63,15 @@
 static char rcsid[] = "$-Id: inet_addr.c,v 1.11 1999/04/29 18:19:53 drepper Exp $";
 #endif /* LIBC_SCCS and not lint */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifndef HAVE_ISASCII
+/* Let all checks succeed if we don't have isascii(). */
+# define isascii(x)	1
+#endif
+
 #include <sys/types.h>
 #include <sys/param.h>
 #include <ctype.h>
@@ -101,17 +84,17 @@
  * cannot distinguish between failure and a local broadcast address.
  */
 int
-egg_inet_aton(cp, addr)
+inet_aton(cp, addr)
 	const char *cp;
 	struct in_addr *addr;
 {
-	static const u_32bit_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff };
-	register u_32bit_t val;	/* changed from u_long --david */
+	static const u_32int_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff };
+	register u_32int_t val;	/* changed from u_long --david */
 	register int base;
 	register int n;
 	register char c;
-	u_32bit_t parts[4];
-	register u_32bit_t *pp = parts;
+	u_32int_t parts[4];
+	register u_32int_t *pp = parts;
 
 	memset(parts, 0, sizeof (parts));
 
@@ -183,4 +166,3 @@
 ret_0:
 	return (0);
 }
-#endif /* HAVE_INET_ATON */
Index: eggdrop1.7/src/compat/inet_aton.h
diff -u eggdrop1.7/src/compat/inet_aton.h:1.4 eggdrop1.7/src/compat/inet_aton.h:1.5
--- eggdrop1.7/src/compat/inet_aton.h:1.4	Thu Jul 26 12:04:33 2001
+++ eggdrop1.7/src/compat/inet_aton.h	Thu Oct 18 20:55:06 2001
@@ -2,7 +2,7 @@
  * inet_aton.h
  *   prototypes for inet_aton.c
  *
- * $Id: inet_aton.h,v 1.4 2001/07/26 17:04:33 drummer Exp $
+ * $Id: inet_aton.h,v 1.5 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (C) 2000, 2001 Eggheads Development Team
@@ -21,20 +21,19 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
+#ifndef _EGG_INET_ATON_H
+#define _EGG_INET_ATON_H
 
-#ifndef _EGG_COMPAT_INET_ATON_H
-#define _EGG_COMPAT_INET_ATON_H
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-/* #include "src/main.h" */
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
 #ifndef HAVE_INET_ATON
-/* Use our own implementation. */
-int egg_inet_aton(const char *cp, struct in_addr *addr);
-#else
-#  define egg_inet_aton	inet_aton
+int inet_aton(const char *cp, struct in_addr *addr);
 #endif
 
-#endif	/* !__EGG_COMPAT_INET_ATON_H */
+#endif				/* !_EGG_INET_ATON_H */
Index: eggdrop1.7/src/compat/inet_ntop.c
diff -u eggdrop1.7/src/compat/inet_ntop.c:1.3 eggdrop1.7/src/compat/inet_ntop.c:1.4
--- eggdrop1.7/src/compat/inet_ntop.c:1.3	Fri Aug 10 09:33:11 2001
+++ eggdrop1.7/src/compat/inet_ntop.c	Thu Oct 18 20:55:06 2001
@@ -1,7 +1,8 @@
 /*
- * inet_ntop.c -- provides inet_ntop() if necessary.
+ * inet_ntop.c
+ *   provides inet_ntop()
  *
- * $Id: inet_ntop.c,v 1.3 2001/08/10 14:33:11 drummer Exp $
+ * $Id: inet_ntop.c,v 1.4 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (c) 1996-1999 by Internet Software Consortium.
@@ -20,12 +21,14 @@
  * SOFTWARE.
  */
 
-#ifndef HAVE_INET_NTOP
-
 #if defined(LIBC_SCCS) && !defined(lint)
 static const char rcsid[] = "$BINDId: inet_ntop.c,v 1.8 1999/10/13 16:39:28 vixie Exp $";
 #endif /* LIBC_SCCS and not lint */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -37,8 +40,6 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "config.h"
-
 #ifdef SPRINTF_CHAR
 # define SPRINTF(x) strlen(sprintf/**/x)
 #else
@@ -66,7 +67,7 @@
  *	Paul Vixie, 1996.
  */
 const char *
-egg_inet_ntop(af, src, dst, size)
+inet_ntop(af, src, dst, size)
 	int af;
 	const void *src;
 	char *dst;
@@ -206,5 +207,3 @@
 	}
 	return strcpy(dst, tmp);
 }
-
-#endif
Index: eggdrop1.7/src/compat/inet_ntop.h
diff -u eggdrop1.7/src/compat/inet_ntop.h:1.2 eggdrop1.7/src/compat/inet_ntop.h:1.3
--- eggdrop1.7/src/compat/inet_ntop.h:1.2	Sun Jul 29 14:43:05 2001
+++ eggdrop1.7/src/compat/inet_ntop.h	Thu Oct 18 20:55:06 2001
@@ -2,7 +2,7 @@
  * inet_ntop.h
  *   prototypes for inet_ntop.c
  *
- * $Id: inet_ntop.h,v 1.2 2001/07/29 19:43:05 drummer Exp $
+ * $Id: inet_ntop.h,v 1.3 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (C) 2000, 2001 Eggheads Development Team
@@ -21,20 +21,19 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
+#ifndef _EGG_INET_NTOP_H
+#define _EGG_INET_NTOP_H
 
-#ifndef _EGG_COMPAT_INET_NTOP_H
-#define _EGG_COMPAT_INET_NTOP_H
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "config.h"
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
 #ifndef HAVE_INET_NTOP
-/* Use our own implementation. */
-const char *egg_inet_ntop(int af, const void *src, char *dst, socklen_t size);
-#else
-#  define egg_inet_ntop	inet_ntop
+const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
 #endif
 
-#endif	/* !__EGG_COMPAT_INET_NTOP_H */
+#endif				/* !_EGG_INET_NTOP_H */
Index: eggdrop1.7/src/compat/inet_pton.c
diff -u eggdrop1.7/src/compat/inet_pton.c:1.3 eggdrop1.7/src/compat/inet_pton.c:1.4
--- eggdrop1.7/src/compat/inet_pton.c:1.3	Tue Jul 31 11:40:41 2001
+++ eggdrop1.7/src/compat/inet_pton.c	Thu Oct 18 20:55:06 2001
@@ -1,7 +1,8 @@
 /*
- * inet_pton.c -- provides inet_pton() if necessary.
+ * inet_pton.c
+ *   provides inet_pton()
  *
- * $Id: inet_pton.c,v 1.3 2001/07/31 16:40:41 guppy Exp $
+ * $Id: inet_pton.c,v 1.4 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (c) 1996,1999 by Internet Software Consortium.
@@ -20,12 +21,14 @@
  * SOFTWARE.
  */
 
-#ifndef HAVE_INET_PTON
-
 #if defined(LIBC_SCCS) && !defined(lint)
 static const char rcsid[] = "$BINDId: inet_pton.c,v 1.7 1999/10/13 16:39:28 vixie Exp $";
 #endif /* LIBC_SCCS and not lint */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -34,8 +37,6 @@
 #include <string.h>
 #include <errno.h>
 
-#include "config.h"
-
 #define NS_INADDRSZ     4       /* IPv4 T_A */
 #define NS_IN6ADDRSZ    16      /* IPv6 T_AAAA */
 #define NS_INT16SZ      2       /* #/bytes of data in a u_int16_t */
@@ -60,7 +61,7 @@
  *	Paul Vixie, 1996.
  */
 int
-egg_inet_pton(af, src, dst)
+inet_pton(af, src, dst)
 	int af;
 	const char *src;
 	void *dst;
@@ -224,6 +225,3 @@
 	memcpy(dst, tmp, NS_IN6ADDRSZ);
 	return (1);
 }
-
-#endif
-
Index: eggdrop1.7/src/compat/inet_pton.h
diff -u eggdrop1.7/src/compat/inet_pton.h:1.2 eggdrop1.7/src/compat/inet_pton.h:1.3
--- eggdrop1.7/src/compat/inet_pton.h:1.2	Sun Jul 29 14:43:05 2001
+++ eggdrop1.7/src/compat/inet_pton.h	Thu Oct 18 20:55:06 2001
@@ -2,7 +2,7 @@
  * inet_pton.h
  *   prototypes for inet_pton.c
  *
- * $Id: inet_pton.h,v 1.2 2001/07/29 19:43:05 drummer Exp $
+ * $Id: inet_pton.h,v 1.3 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (C) 2000, 2001 Eggheads Development Team
@@ -21,20 +21,19 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
+#ifndef _EGG_INET_PTON_H
+#define _EGG_INET_PTON_H
 
-#ifndef _EGG_COMPAT_INET_PTON_H
-#define _EGG_COMPAT_INET_PTON_H
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "config.h"
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
 #ifndef HAVE_INET_PTON
-/* Use our own implementation. */
-int egg_inet_pton(int af, const char *src, void *dst);
-#else
-#  define egg_inet_pton	inet_pton
+int inet_pton(int af, const char *src, void *dst);
 #endif
 
-#endif	/* !__EGG_COMPAT_INET_PTON_H */
+#endif				/* !_EGG_INET_PTON_H */
Index: eggdrop1.7/src/compat/memcpy.c
diff -u /dev/null eggdrop1.7/src/compat/memcpy.c:1.5
--- /dev/null	Thu Oct 18 20:55:20 2001
+++ eggdrop1.7/src/compat/memcpy.c	Thu Oct 18 20:55:06 2001
@@ -0,0 +1,33 @@
+/*
+ * memcpy.c
+ *   provides memcpy()
+ *
+ * $Id: memcpy.c,v 1.5 2001/10/19 01:55:06 tothwolf Exp $
+ */
+/*
+ * Copyright (C) 1997 Robey Pointer
+ * Copyright (C) 1999, 2000, 2001 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.
+ */
+
+#include <stdio.h>
+
+void *memcpy(void *dest, const void *src, size_t n)
+{
+  while (n--)
+    *((char *) dest)++ = *((char *) src)++;
+  return dest;
+}
Index: eggdrop1.7/src/compat/memcpy.h
diff -u /dev/null eggdrop1.7/src/compat/memcpy.h:1.5
--- /dev/null	Thu Oct 18 20:55:20 2001
+++ eggdrop1.7/src/compat/memcpy.h	Thu Oct 18 20:55:06 2001
@@ -0,0 +1,37 @@
+/*
+ * memcpy.h
+ *   prototypes for memcpy.c
+ *
+ * $Id: memcpy.h,v 1.5 2001/10/19 01:55:06 tothwolf Exp $
+ */
+/*
+ * Copyright (C) 2000, 2001 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.
+ */
+#ifndef _EGG_MEMCPY_H
+#define _EGG_MEMCPY_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+
+#ifndef HAVE_MEMCPY
+void *memcpy(void *dest, const void *src, size_t n);
+#endif
+
+#endif				/* !_EGG_MEMCPY_H */
Index: eggdrop1.7/src/compat/memset.c
diff -u /dev/null eggdrop1.7/src/compat/memset.c:1.6
--- /dev/null	Thu Oct 18 20:55:20 2001
+++ eggdrop1.7/src/compat/memset.c	Thu Oct 18 20:55:06 2001
@@ -0,0 +1,33 @@
+/*
+ * memset.c
+ *   provides memset()
+ *
+ * $Id: memset.c,v 1.6 2001/10/19 01:55:06 tothwolf Exp $
+ */
+/*
+ * Copyright (C) 1997 Robey Pointer
+ * Copyright (C) 1999, 2000, 2001 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.
+ */
+
+#include <stdio.h>
+
+void *memset(void *dest, int c, size_t n)
+{
+  while (n--)
+    *((unsigned char *) dest)++ = c;
+  return dest;
+}
Index: eggdrop1.7/src/compat/memset.h
diff -u /dev/null eggdrop1.7/src/compat/memset.h:1.5
--- /dev/null	Thu Oct 18 20:55:20 2001
+++ eggdrop1.7/src/compat/memset.h	Thu Oct 18 20:55:06 2001
@@ -0,0 +1,37 @@
+/*
+ * memset.h
+ *   prototypes for memset.c
+ *
+ * $Id: memset.h,v 1.5 2001/10/19 01:55:06 tothwolf Exp $
+ */
+/*
+ * Copyright (C) 2000, 2001 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.
+ */
+#ifndef _EGG_MEMSET_H
+#define _EGG_MEMSET_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+
+#ifndef HAVE_MEMSET
+void *memset(void *dest, int c, size_t n);
+#endif
+
+#endif				/* !_EGG_MEMSET_H */
Index: eggdrop1.7/src/compat/snprintf.c
diff -u eggdrop1.7/src/compat/snprintf.c:1.5 eggdrop1.7/src/compat/snprintf.c:1.6
--- eggdrop1.7/src/compat/snprintf.c:1.5	Tue Oct  9 20:20:10 2001
+++ eggdrop1.7/src/compat/snprintf.c	Thu Oct 18 20:55:06 2001
@@ -1,31 +1,10 @@
 /*
- * snprintf.c - a portable implementation of snprintf and vsnprintf
+ * snprintf.c
+ *   provides snprintf, vsnprintf, vasprintf, and asprintf if needed
  *
- * $Id: snprintf.c,v 1.5 2001/10/10 01:20:10 ite Exp $
+ * $Id: snprintf.c,v 1.6 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
- * Portions Copyright (C) 2000, 2001 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.
- */
-
-#include "../main.h"
-#include "snprintf.h"
-
-
-/*
  * Copyright Patrick Powell 1995
  * This code is based on code written by Patrick Powell (papowell at astart.com)
  * It may be used for any purpose as long as this notice remains intact
@@ -62,9 +41,9 @@
  *    original.  Also, there is now a builtin-test, just compile with:
  *           gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm
  *    and run snprintf for results.
- *
+ * 
  *  Thomas Roessler <roessler at guug.de> 01/27/98 for mutt 0.89i
- *    The PGP code was using unsigned hexadecimal formats.
+ *    The PGP code was using unsigned hexadecimal formats. 
  *    Unfortunately, unsigned formats simply didn't work.
  *
  *  Michael Elkins <me at cs.hmc.edu> 03/05/98 for mutt 0.90.8
@@ -76,59 +55,60 @@
  *    fixed handling of %.0f
  *    added test for HAVE_LONG_DOUBLE
  *
- *  Fabian Knittel <fknittel at gmx.de> Apr 2000 for eggdrop 1.5.3
- *    Indented code to match eggdrop style. Adjusted to fit into eggdrops
- *    build environment. Added `egg_' prefixes to snprintf and vsnprintf.
+ * tridge at samba.org, idra at samba.org, April 2001
+ *    got rid of fcvt code (twas buggy and made testing harder)
+ *    added C99 semantics
  *
  **************************************************************/
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#ifdef HAVE_CTYPE_H
 #include <ctype.h>
+#endif
 #include <sys/types.h>
+#include <stdarg.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
 
-#ifndef HAVE_VSNPRINTF
-
-/* varargs declarations: */
+#if defined(HAVE_SNPRINTF) && defined(HAVE_VSNPRINTF) && defined(HAVE_C99_VSNPRINTF)
+/* only include stdio.h if we are not re-defining snprintf or vsnprintf */
+#include <stdio.h>
+ /* make the compiler happy with an empty file */
+ void dummy_snprintf(void) {} 
+#else
 
-#if defined(__STDC__)
-#  ifdef HAVE_STDARG_H
-#    include <stdarg.h>
-#  else
-#    ifdef HAVE_STD_ARGS_H
-#      include <std_args.h>
-#    endif
-#  endif
-#  include <stdarg.h>
-#  define HAVE_STDARGS		/* let's hope that works everywhere (mj) */
-#  define VA_LOCAL_DECL	va_list ap
-#  define VA_START(f)	va_start(ap, f)
-#  define VA_SHIFT(v,t)	;	/* no-op for ANSI */
-#  define VA_END	va_end(ap)
+#ifdef HAVE_LONG_DOUBLE
+#define LDOUBLE long double
 #else
-#  include <varargs.h>
-#  undef HAVE_STDARGS
-#  define VA_LOCAL_DECL	va_list ap
-#  define VA_START(f)	va_start(ap)	/* f is ignored! */
-#  define VA_SHIFT(v,t)	v = va_arg(ap,t)
-#  define VA_END	va_end(ap)
+#define LDOUBLE double
 #endif
 
-#ifdef HAVE_LONG_DOUBLE
-#define LDOUBLE	long double
+#ifdef HAVE_LONG_LONG
+#define LLONG long long
 #else
-#define LDOUBLE	double
+#define LLONG long
 #endif
 
-static void dopr(char *buffer, size_t maxlen, const char *format,
-		 va_list args);
-static void fmtstr(char *buffer, size_t * currlen, size_t maxlen,
-		   char *value, int flags, int min, int max);
-static void fmtint(char *buffer, size_t * currlen, size_t maxlen,
-		   long value, int base, int min, int max, int flags);
-static void fmtfp(char *buffer, size_t * currlen, size_t maxlen,
-		  LDOUBLE fvalue, int min, int max, int flags);
-static void dopr_outch(char *buffer, size_t * currlen, size_t maxlen,
-		       char c);
+static size_t dopr(char *buffer, size_t maxlen, const char *format, 
+		   va_list args);
+static void fmtstr(char *buffer, size_t *currlen, size_t maxlen,
+		    char *value, int flags, int min, int max);
+static void fmtint(char *buffer, size_t *currlen, size_t maxlen,
+		    long value, int base, int min, int max, int flags);
+static void fmtfp(char *buffer, size_t *currlen, size_t maxlen,
+		   LDOUBLE fvalue, int min, int max, int flags);
+static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c);
 
 /*
  * dopr(): poor man's version of doprintf
@@ -157,567 +137,807 @@
 #define DP_C_SHORT   1
 #define DP_C_LONG    2
 #define DP_C_LDOUBLE 3
+#define DP_C_LLONG   4
 
-#define char_to_int(p) (p - '0')
-#define MAX(p,q) ((p >= q) ? p : q)
+#define char_to_int(p) ((p)- '0')
+#ifndef MAX
+#define MAX(p,q) (((p) >= (q)) ? (p) : (q))
+#endif
 
-static void dopr(char *buffer, size_t maxlen, const char *format,
-		 va_list args)
+static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args)
 {
-  char ch;
-  long value;
-  LDOUBLE fvalue;
-  char *strvalue;
-  int min;
-  int max;
-  int state;
-  int flags;
-  int cflags;
-  size_t currlen;
-
-  state = DP_S_DEFAULT;
-  currlen = flags = cflags = min = 0;
-  max = -1;
-  ch = *format++;
-
-  while (state != DP_S_DONE) {
-    if ((ch == '\0') || (currlen >= maxlen))
-      state = DP_S_DONE;
-
-    switch (state) {
-    case DP_S_DEFAULT:
-      if (ch == '%')
-	state = DP_S_FLAGS;
-      else
-	dopr_outch(buffer, &currlen, maxlen, ch);
-      ch = *format++;
-      break;
-    case DP_S_FLAGS:
-      switch (ch) {
-      case '-':
-	flags |= DP_F_MINUS;
-	ch = *format++;
-	break;
-      case '+':
-	flags |= DP_F_PLUS;
-	ch = *format++;
-	break;
-      case ' ':
-	flags |= DP_F_SPACE;
-	ch = *format++;
-	break;
-      case '#':
-	flags |= DP_F_NUM;
-	ch = *format++;
-	break;
-      case '0':
-	flags |= DP_F_ZERO;
-	ch = *format++;
-	break;
-      default:
-	state = DP_S_MIN;
-	break;
-      }
-      break;
-    case DP_S_MIN:
-      if (isdigit(ch)) {
-	min = 10 * min + char_to_int(ch);
-	ch = *format++;
-      } else if (ch == '*') {
-	min = va_arg(args, int);
-	ch = *format++;
-	state = DP_S_DOT;
-      } else
-	state = DP_S_DOT;
-      break;
-    case DP_S_DOT:
-      if (ch == '.') {
-	state = DP_S_MAX;
-	ch = *format++;
-      } else
-	state = DP_S_MOD;
-      break;
-    case DP_S_MAX:
-      if (isdigit(ch)) {
-	if (max < 0)
-	  max = 0;
-	max = 10 * max + char_to_int(ch);
-	ch = *format++;
-      } else if (ch == '*') {
-	max = va_arg(args, int);
-	ch = *format++;
-	state = DP_S_MOD;
-      } else
-	state = DP_S_MOD;
-      break;
-    case DP_S_MOD:
-      /* Currently, we don't support Long Long, bummer */
-      switch (ch) {
-      case 'h':
-	cflags = DP_C_SHORT;
-	ch = *format++;
-	break;
-      case 'l':
-	cflags = DP_C_LONG;
-	ch = *format++;
-	break;
-      case 'L':
-	cflags = DP_C_LDOUBLE;
-	ch = *format++;
-	break;
-      default:
-	break;
-      }
-      state = DP_S_CONV;
-      break;
-    case DP_S_CONV:
-      switch (ch) {
-      case 'd':
-      case 'i':
-	if (cflags == DP_C_SHORT)
-	  value = va_arg(args, short int);
-	else if (cflags == DP_C_LONG)
-	  value = va_arg(args, long int);
-	else
-	  value = va_arg(args, int);
-	fmtint(buffer, &currlen, maxlen, value, 10, min, max, flags);
-	break;
-      case 'o':
-	flags |= DP_F_UNSIGNED;
-	if (cflags == DP_C_SHORT)
-	  value = va_arg(args, unsigned short int);
-	else if (cflags == DP_C_LONG)
-	  value = va_arg(args, unsigned long int);
-	else
-	  value = va_arg(args, unsigned int);
-	fmtint(buffer, &currlen, maxlen, value, 8, min, max, flags);
-	break;
-      case 'u':
-	flags |= DP_F_UNSIGNED;
-	if (cflags == DP_C_SHORT)
-	  value = va_arg(args, unsigned short int);
-	else if (cflags == DP_C_LONG)
-	  value = va_arg(args, unsigned long int);
-	else
-	  value = va_arg(args, unsigned int);
-	fmtint(buffer, &currlen, maxlen, value, 10, min, max, flags);
-	break;
-      case 'X':
-	flags |= DP_F_UP;
-      case 'x':
-	flags |= DP_F_UNSIGNED;
-	if (cflags == DP_C_SHORT)
-	  value = va_arg(args, unsigned short int);
-	else if (cflags == DP_C_LONG)
-	  value = va_arg(args, unsigned long int);
-	else
-	  value = va_arg(args, unsigned int);
-	fmtint(buffer, &currlen, maxlen, value, 16, min, max, flags);
-	break;
-      case 'f':
-	if (cflags == DP_C_LDOUBLE)
-	  fvalue = va_arg(args, LDOUBLE);
-	else
-	  fvalue = va_arg(args, double);
-	/* um, floating point? */
-	fmtfp(buffer, &currlen, maxlen, fvalue, min, max, flags);
-	break;
-      case 'E':
-	flags |= DP_F_UP;
-      case 'e':
-	if (cflags == DP_C_LDOUBLE)
-	  fvalue = va_arg(args, LDOUBLE);
-	else
-	  fvalue = va_arg(args, double);
-	break;
-      case 'G':
-	flags |= DP_F_UP;
-      case 'g':
-	if (cflags == DP_C_LDOUBLE)
-	  fvalue = va_arg(args, LDOUBLE);
-	else
-	  fvalue = va_arg(args, double);
-	break;
-      case 'c':
-	dopr_outch(buffer, &currlen, maxlen, va_arg(args, int));
-	break;
-      case 's':
-	strvalue = va_arg(args, char *);
-	if (max < 0)
-	  max = maxlen;		/* ie, no max */
-	fmtstr(buffer, &currlen, maxlen, strvalue, flags, min, max);
-	break;
-      case 'p':
-	strvalue = va_arg(args, void *);
-	fmtint(buffer, &currlen, maxlen, (long) strvalue, 16, min, max,
-	       flags);
-	break;
-      case 'n':
-	if (cflags == DP_C_SHORT) {
-	  short int *num;
-	  num = va_arg(args, short int *);
-	  *num = currlen;
-	} else if (cflags == DP_C_LONG) {
-	  long int *num;
-	  num = va_arg(args, long int *);
-	  *num = currlen;
-	} else {
-	  int *num;
-	  num = va_arg(args, int *);
-	  *num = currlen;
-	}
-	break;
-      case '%':
-	dopr_outch(buffer, &currlen, maxlen, ch);
-	break;
-      case 'w':
-	/* not supported yet, treat as next char */
-	ch = *format++;
-	break;
-      default:
-	/* Unknown, skip */
-	break;
-      }
-      ch = *format++;
-      state = DP_S_DEFAULT;
-      flags = cflags = min = 0;
-      max = -1;
-      break;
-    case DP_S_DONE:
-      break;
-    default:
-      /* hmm? */
-      break;			/* some picky compilers need this */
-    }
-  }
-  if (currlen < maxlen - 1)
-    buffer[currlen] = '\0';
-  else
-    buffer[maxlen - 1] = '\0';
-}
-
-static void fmtstr(char *buffer, size_t * currlen, size_t maxlen,
-		   char *value, int flags, int min, int max)
-{
-  int padlen,
-      strln;			/* amount to pad */
-  int cnt = 0;
-
-  if (value == 0) {
-    value = "<NULL>";
-  }
-
-  for (strln = 0; value[strln]; ++strln);	/* strlen */
-  padlen = min - strln;
-  if (padlen < 0)
-    padlen = 0;
-  if (flags & DP_F_MINUS)
-    padlen = -padlen;		/* Left Justify */
-
-  while ((padlen > 0) && (cnt < max)) {
-    dopr_outch(buffer, currlen, maxlen, ' ');
-    --padlen;
-    ++cnt;
-  }
-  while (*value && (cnt < max)) {
-    dopr_outch(buffer, currlen, maxlen, *value++);
-    ++cnt;
-  }
-  while ((padlen < 0) && (cnt < max)) {
-    dopr_outch(buffer, currlen, maxlen, ' ');
-    ++padlen;
-    ++cnt;
-  }
+	char ch;
+	LLONG value;
+	LDOUBLE fvalue;
+	char *strvalue;
+	int min;
+	int max;
+	int state;
+	int flags;
+	int cflags;
+	size_t currlen;
+	
+	state = DP_S_DEFAULT;
+	currlen = flags = cflags = min = 0;
+	max = -1;
+	ch = *format++;
+	
+	while (state != DP_S_DONE) {
+		if (ch == '\0') 
+			state = DP_S_DONE;
+
+		switch(state) {
+		case DP_S_DEFAULT:
+			if (ch == '%') 
+				state = DP_S_FLAGS;
+			else 
+				dopr_outch (buffer, &currlen, maxlen, ch);
+			ch = *format++;
+			break;
+		case DP_S_FLAGS:
+			switch (ch) {
+			case '-':
+				flags |= DP_F_MINUS;
+				ch = *format++;
+				break;
+			case '+':
+				flags |= DP_F_PLUS;
+				ch = *format++;
+				break;
+			case ' ':
+				flags |= DP_F_SPACE;
+				ch = *format++;
+				break;
+			case '#':
+				flags |= DP_F_NUM;
+				ch = *format++;
+				break;
+			case '0':
+				flags |= DP_F_ZERO;
+				ch = *format++;
+				break;
+			default:
+				state = DP_S_MIN;
+				break;
+			}
+			break;
+		case DP_S_MIN:
+			if (isdigit((unsigned char)ch)) {
+				min = 10*min + char_to_int (ch);
+				ch = *format++;
+			} else if (ch == '*') {
+				min = va_arg (args, int);
+				ch = *format++;
+				state = DP_S_DOT;
+			} else {
+				state = DP_S_DOT;
+			}
+			break;
+		case DP_S_DOT:
+			if (ch == '.') {
+				state = DP_S_MAX;
+				ch = *format++;
+			} else { 
+				state = DP_S_MOD;
+			}
+			break;
+		case DP_S_MAX:
+			if (isdigit((unsigned char)ch)) {
+				if (max < 0)
+					max = 0;
+				max = 10*max + char_to_int (ch);
+				ch = *format++;
+			} else if (ch == '*') {
+				max = va_arg (args, int);
+				ch = *format++;
+				state = DP_S_MOD;
+			} else {
+				state = DP_S_MOD;
+			}
+			break;
+		case DP_S_MOD:
+			switch (ch) {
+			case 'h':
+				cflags = DP_C_SHORT;
+				ch = *format++;
+				break;
+			case 'l':
+				cflags = DP_C_LONG;
+				ch = *format++;
+				if (ch == 'l') {	/* It's a long long */
+					cflags = DP_C_LLONG;
+					ch = *format++;
+				}
+				break;
+			case 'L':
+				cflags = DP_C_LDOUBLE;
+				ch = *format++;
+				break;
+			default:
+				break;
+			}
+			state = DP_S_CONV;
+			break;
+		case DP_S_CONV:
+			switch (ch) {
+			case 'd':
+			case 'i':
+				if (cflags == DP_C_SHORT) 
+					value = va_arg (args, int);
+				else if (cflags == DP_C_LONG)
+					value = va_arg (args, long int);
+				else if (cflags == DP_C_LLONG)
+					value = va_arg (args, LLONG);
+				else
+					value = va_arg (args, int);
+				fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
+				break;
+			case 'o':
+				flags |= DP_F_UNSIGNED;
+				if (cflags == DP_C_SHORT)
+					value = va_arg (args, unsigned int);
+				else if (cflags == DP_C_LONG)
+					value = (long)va_arg (args, unsigned long int);
+				else if (cflags == DP_C_LLONG)
+					value = (long)va_arg (args, unsigned LLONG);
+				else
+					value = (long)va_arg (args, unsigned int);
+				fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags);
+				break;
+			case 'u':
+				flags |= DP_F_UNSIGNED;
+				if (cflags == DP_C_SHORT)
+					value = va_arg (args, unsigned int);
+				else if (cflags == DP_C_LONG)
+					value = (long)va_arg (args, unsigned long int);
+				else if (cflags == DP_C_LLONG)
+					value = (LLONG)va_arg (args, unsigned LLONG);
+				else
+					value = (long)va_arg (args, unsigned int);
+				fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
+				break;
+			case 'X':
+				flags |= DP_F_UP;
+			case 'x':
+				flags |= DP_F_UNSIGNED;
+				if (cflags == DP_C_SHORT)
+					value = va_arg (args, unsigned int);
+				else if (cflags == DP_C_LONG)
+					value = (long)va_arg (args, unsigned long int);
+				else if (cflags == DP_C_LLONG)
+					value = (LLONG)va_arg (args, unsigned LLONG);
+				else
+					value = (long)va_arg (args, unsigned int);
+				fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags);
+				break;
+			case 'f':
+				if (cflags == DP_C_LDOUBLE)
+					fvalue = va_arg (args, LDOUBLE);
+				else
+					fvalue = va_arg (args, double);
+				/* um, floating point? */
+				fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags);
+				break;
+			case 'E':
+				flags |= DP_F_UP;
+			case 'e':
+				if (cflags == DP_C_LDOUBLE)
+					fvalue = va_arg (args, LDOUBLE);
+				else
+					fvalue = va_arg (args, double);
+				break;
+			case 'G':
+				flags |= DP_F_UP;
+			case 'g':
+				if (cflags == DP_C_LDOUBLE)
+					fvalue = va_arg (args, LDOUBLE);
+				else
+					fvalue = va_arg (args, double);
+				break;
+			case 'c':
+				dopr_outch (buffer, &currlen, maxlen, va_arg (args, int));
+				break;
+			case 's':
+				strvalue = va_arg (args, char *);
+				if (max == -1) {
+					max = strlen(strvalue);
+				}
+				if (min > 0 && max >= 0 && min > max) max = min;
+				fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max);
+				break;
+			case 'p':
+				strvalue = va_arg (args, void *);
+				fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags);
+				break;
+			case 'n':
+				if (cflags == DP_C_SHORT) {
+					short int *num;
+					num = va_arg (args, short int *);
+					*num = currlen;
+				} else if (cflags == DP_C_LONG) {
+					long int *num;
+					num = va_arg (args, long int *);
+					*num = (long int)currlen;
+				} else if (cflags == DP_C_LLONG) {
+					LLONG *num;
+					num = va_arg (args, LLONG *);
+					*num = (LLONG)currlen;
+				} else {
+					int *num;
+					num = va_arg (args, int *);
+					*num = currlen;
+				}
+				break;
+			case '%':
+				dopr_outch (buffer, &currlen, maxlen, ch);
+				break;
+			case 'w':
+				/* not supported yet, treat as next char */
+				ch = *format++;
+				break;
+			default:
+				/* Unknown, skip */
+				break;
+			}
+			ch = *format++;
+			state = DP_S_DEFAULT;
+			flags = cflags = min = 0;
+			max = -1;
+			break;
+		case DP_S_DONE:
+			break;
+		default:
+			/* hmm? */
+			break; /* some picky compilers need this */
+		}
+	}
+	if (maxlen != 0) {
+		if (currlen < maxlen - 1) 
+			buffer[currlen] = '\0';
+		else if (maxlen > 0) 
+			buffer[maxlen - 1] = '\0';
+	}
+	
+	return currlen;
+}
+
+static void fmtstr(char *buffer, size_t *currlen, size_t maxlen,
+		    char *value, int flags, int min, int max)
+{
+	int padlen, strln;     /* amount to pad */
+	int cnt = 0;
+
+#ifdef DEBUG_SNPRINTF
+	printf("fmtstr min=%d max=%d s=[%s]\n", min, max, value);
+#endif
+	if (value == 0) {
+		value = "<NULL>";
+	}
+
+	for (strln = 0; value[strln]; ++strln); /* strlen */
+	padlen = min - strln;
+	if (padlen < 0) 
+		padlen = 0;
+	if (flags & DP_F_MINUS) 
+		padlen = -padlen; /* Left Justify */
+	
+	while ((padlen > 0) && (cnt < max)) {
+		dopr_outch (buffer, currlen, maxlen, ' ');
+		--padlen;
+		++cnt;
+	}
+	while (*value && (cnt < max)) {
+		dopr_outch (buffer, currlen, maxlen, *value++);
+		++cnt;
+	}
+	while ((padlen < 0) && (cnt < max)) {
+		dopr_outch (buffer, currlen, maxlen, ' ');
+		++padlen;
+		++cnt;
+	}
 }
 
 /* Have to handle DP_F_NUM (ie 0x and 0 alternates) */
 
-static void fmtint(char *buffer, size_t * currlen, size_t maxlen,
-		   long value, int base, int min, int max, int flags)
+static void fmtint(char *buffer, size_t *currlen, size_t maxlen,
+		    long value, int base, int min, int max, int flags)
 {
-  int signvalue = 0;
-  unsigned long uvalue;
-  char convert[20];
-  int place = 0;
-  int spadlen = 0;		/* amount to space pad */
-  int zpadlen = 0;		/* amount to zero pad */
-  int caps = 0;
-
-  if (max < 0)
-    max = 0;
-
-  uvalue = value;
-
-  if (!(flags & DP_F_UNSIGNED)) {
-    if (value < 0) {
-      signvalue = '-';
-      uvalue = -value;
-    } else if (flags & DP_F_PLUS)	/* Do a sign (+/i) */
-      signvalue = '+';
-    else if (flags & DP_F_SPACE)
-      signvalue = ' ';
-  }
-
-  if (flags & DP_F_UP)
-    caps = 1;			/* Should characters be upper case? */
-
-  do {
-    convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
-	[uvalue % (unsigned) base];
-    uvalue = (uvalue / (unsigned) base);
-  }
-  while (uvalue && (place < 20));
-  if (place == 20)
-    place--;
-  convert[place] = 0;
-
-  zpadlen = max - place;
-  spadlen = min - MAX(max, place) - (signvalue ? 1 : 0);
-  if (zpadlen < 0)
-    zpadlen = 0;
-  if (spadlen < 0)
-    spadlen = 0;
-  if (flags & DP_F_ZERO) {
-    zpadlen = MAX(zpadlen, spadlen);
-    spadlen = 0;
-  }
-  if (flags & DP_F_MINUS)
-    spadlen = -spadlen;		/* Left Justifty */
+	int signvalue = 0;
+	unsigned long uvalue;
+	char convert[20];
+	int place = 0;
+	int spadlen = 0; /* amount to space pad */
+	int zpadlen = 0; /* amount to zero pad */
+	int caps = 0;
+	
+	if (max < 0)
+		max = 0;
+	
+	uvalue = value;
+	
+	if(!(flags & DP_F_UNSIGNED)) {
+		if( value < 0 ) {
+			signvalue = '-';
+			uvalue = -value;
+		} else {
+			if (flags & DP_F_PLUS)  /* Do a sign (+/i) */
+				signvalue = '+';
+			else if (flags & DP_F_SPACE)
+				signvalue = ' ';
+		}
+	}
+  
+	if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
+
+	do {
+		convert[place++] =
+			(caps? "0123456789ABCDEF":"0123456789abcdef")
+			[uvalue % (unsigned)base  ];
+		uvalue = (uvalue / (unsigned)base );
+	} while(uvalue && (place < 20));
+	if (place == 20) place--;
+	convert[place] = 0;
+
+	zpadlen = max - place;
+	spadlen = min - MAX (max, place) - (signvalue ? 1 : 0);
+	if (zpadlen < 0) zpadlen = 0;
+	if (spadlen < 0) spadlen = 0;
+	if (flags & DP_F_ZERO) {
+		zpadlen = MAX(zpadlen, spadlen);
+		spadlen = 0;
+	}
+	if (flags & DP_F_MINUS) 
+		spadlen = -spadlen; /* Left Justifty */
 
 #ifdef DEBUG_SNPRINTF
-  dprint(1,
-	 (debugfile, "zpad: %d, spad: %d, min: %d, max: %d, place: %d\n",
-	  zpadlen, spadlen, min, max, place));
-#endif
-
-  /* Spaces */
-  while (spadlen > 0) {
-    dopr_outch(buffer, currlen, maxlen, ' ');
-    --spadlen;
-  }
-
-  /* Sign */
-  if (signvalue)
-    dopr_outch(buffer, currlen, maxlen, signvalue);
-
-  /* Zeros */
-  if (zpadlen > 0) {
-    while (zpadlen > 0) {
-      dopr_outch(buffer, currlen, maxlen, '0');
-      --zpadlen;
-    }
-  }
-
-  /* Digits */
-  while (place > 0)
-    dopr_outch(buffer, currlen, maxlen, convert[--place]);
-
-  /* Left Justified spaces */
-  while (spadlen < 0) {
-    dopr_outch(buffer, currlen, maxlen, ' ');
-    ++spadlen;
-  }
+	printf("zpad: %d, spad: %d, min: %d, max: %d, place: %d\n",
+	       zpadlen, spadlen, min, max, place);
+#endif
+
+	/* Spaces */
+	while (spadlen > 0) {
+		dopr_outch (buffer, currlen, maxlen, ' ');
+		--spadlen;
+	}
+
+	/* Sign */
+	if (signvalue) 
+		dopr_outch (buffer, currlen, maxlen, signvalue);
+
+	/* Zeros */
+	if (zpadlen > 0) {
+		while (zpadlen > 0) {
+			dopr_outch (buffer, currlen, maxlen, '0');
+			--zpadlen;
+		}
+	}
+
+	/* Digits */
+	while (place > 0) 
+		dopr_outch (buffer, currlen, maxlen, convert[--place]);
+  
+	/* Left Justified spaces */
+	while (spadlen < 0) {
+		dopr_outch (buffer, currlen, maxlen, ' ');
+		++spadlen;
+	}
 }
 
 static LDOUBLE abs_val(LDOUBLE value)
 {
-  LDOUBLE result = value;
-
-  if (value < 0)
-    result = -value;
+	LDOUBLE result = value;
 
-  return result;
+	if (value < 0)
+		result = -value;
+	
+	return result;
 }
 
-static LDOUBLE pow10(int exp)
+static LDOUBLE POW10(int exp)
 {
-  LDOUBLE result = 1;
+	LDOUBLE result = 1;
+	
+	while (exp) {
+		result *= 10;
+		exp--;
+	}
+  
+	return result;
+}
 
-  while (exp) {
-    result *= 10;
-    exp--;
-  }
+static LLONG ROUND(LDOUBLE value)
+{
+	LLONG intpart;
 
-  return result;
+	intpart = (LLONG)value;
+	value = value - intpart;
+	if (value >= 0.5) intpart++;
+	
+	return intpart;
 }
 
-static long round(LDOUBLE value)
+/* a replacement for modf that doesn't need the math library. Should
+   be portable, but slow */
+static double my_modf(double x0, double *iptr)
 {
-  long intpart;
+	int i;
+	long l;
+	double x = x0;
+	double f = 1.0;
+
+	for (i=0;i<100;i++) {
+		l = (long)x;
+		if (l <= (x+1) && l >= (x-1)) break;
+		x *= 0.1;
+		f *= 10.0;
+	}
 
-  intpart = value;
-  value = value - intpart;
-  if (value >= 0.5)
-    intpart++;
+	if (i == 100) {
+		/* yikes! the number is beyond what we can handle. What do we do? */
+		(*iptr) = 0;
+		return 0;
+	}
+
+	if (i != 0) {
+		double i2;
+		double ret;
+
+		ret = my_modf(x0-l*f, &i2);
+		(*iptr) = l*f + i2;
+		return ret;
+	} 
 
-  return intpart;
+	(*iptr) = l;
+	return x - (*iptr);
 }
 
-static void fmtfp(char *buffer, size_t * currlen, size_t maxlen,
-		  LDOUBLE fvalue, int min, int max, int flags)
+
+static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
+		   LDOUBLE fvalue, int min, int max, int flags)
 {
-  int signvalue = 0;
-  LDOUBLE ufvalue;
-  char iconvert[20];
-  char fconvert[20];
-  int iplace = 0;
-  int fplace = 0;
-  int padlen = 0;		/* amount to pad */
-  int zpadlen = 0;
-  int caps = 0;
-  long intpart;
-  long fracpart;
+	int signvalue = 0;
+	double ufvalue;
+	char iconvert[311];
+	char fconvert[311];
+	int iplace = 0;
+	int fplace = 0;
+	int padlen = 0; /* amount to pad */
+	int zpadlen = 0; 
+	int caps = 0;
+	int index;
+	double intpart;
+	double fracpart;
+	double temp;
+  
+	/* 
+	 * AIX manpage says the default is 0, but Solaris says the default
+	 * is 6, and sprintf on AIX defaults to 6
+	 */
+	if (max < 0)
+		max = 6;
 
-  /*
-   * AIX manpage says the default is 0, but Solaris says the default
-   * is 6, and sprintf on AIX defaults to 6
-   */
-  if (max < 0)
-    max = 6;
+	ufvalue = abs_val (fvalue);
 
-  ufvalue = abs_val(fvalue);
+	if (fvalue < 0) {
+		signvalue = '-';
+	} else {
+		if (flags & DP_F_PLUS) { /* Do a sign (+/i) */
+			signvalue = '+';
+		} else {
+			if (flags & DP_F_SPACE)
+				signvalue = ' ';
+		}
+	}
 
-  if (fvalue < 0)
-    signvalue = '-';
-  else if (flags & DP_F_PLUS)	/* Do a sign (+/i) */
-    signvalue = '+';
-  else if (flags & DP_F_SPACE)
-    signvalue = ' ';
+#if 0
+	if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
+#endif
 
 #if 0
-  if (flags & DP_F_UP)
-    caps = 1;			/* Should characters be upper case? */
+	 if (max == 0) ufvalue += 0.5; /* if max = 0 we must round */
+#endif
+
+	/* 
+	 * Sorry, we only support 16 digits past the decimal because of our 
+	 * conversion method
+	 */
+	if (max > 16)
+		max = 16;
+
+	/* We "cheat" by converting the fractional part to integer by
+	 * multiplying by a factor of 10
+	 */
+
+	temp = ufvalue;
+	my_modf(temp, &intpart);
+
+	fracpart = ROUND((POW10(max)) * (ufvalue - intpart));
+	
+	if (fracpart >= POW10(max)) {
+		intpart++;
+		fracpart -= POW10(max);
+	}
+
+
+	/* Convert integer part */
+	do {
+		temp = intpart;
+		my_modf(intpart*0.1, &intpart);
+		temp = temp*0.1;
+		index = (int) ((temp -intpart +0.05)* 10.0);
+		/* index = (int) (((double)(temp*0.1) -intpart +0.05) *10.0); */
+		/* printf ("%llf, %f, %x\n", temp, intpart, index); */
+		iconvert[iplace++] =
+			(caps? "0123456789ABCDEF":"0123456789abcdef")[index];
+	} while (intpart && (iplace < 311));
+	if (iplace == 311) iplace--;
+	iconvert[iplace] = 0;
+
+	/* Convert fractional part */
+	if (fracpart)
+	{
+		do {
+			temp = fracpart;
+			my_modf(fracpart*0.1, &fracpart);
+			temp = temp*0.1;
+			index = (int) ((temp -fracpart +0.05)* 10.0);
+			/* index = (int) ((((temp/10) -fracpart) +0.05) *10); */
+			/* printf ("%lf, %lf, %ld\n", temp, fracpart, index); */
+			fconvert[fplace++] =
+			(caps? "0123456789ABCDEF":"0123456789abcdef")[index];
+		} while(fracpart && (fplace < 311));
+		if (fplace == 311) fplace--;
+	}
+	fconvert[fplace] = 0;
+  
+	/* -1 for decimal point, another -1 if we are printing a sign */
+	padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0); 
+	zpadlen = max - fplace;
+	if (zpadlen < 0) zpadlen = 0;
+	if (padlen < 0) 
+		padlen = 0;
+	if (flags & DP_F_MINUS) 
+		padlen = -padlen; /* Left Justifty */
+	
+	if ((flags & DP_F_ZERO) && (padlen > 0)) {
+		if (signvalue) {
+			dopr_outch (buffer, currlen, maxlen, signvalue);
+			--padlen;
+			signvalue = 0;
+		}
+		while (padlen > 0) {
+			dopr_outch (buffer, currlen, maxlen, '0');
+			--padlen;
+		}
+	}
+	while (padlen > 0) {
+		dopr_outch (buffer, currlen, maxlen, ' ');
+		--padlen;
+	}
+	if (signvalue) 
+		dopr_outch (buffer, currlen, maxlen, signvalue);
+	
+	while (iplace > 0) 
+		dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]);
+
+#ifdef DEBUG_SNPRINTF
+	printf("fmtfp: fplace=%d zpadlen=%d\n", fplace, zpadlen);
 #endif
 
-  intpart = ufvalue;
+	/*
+	 * Decimal point.  This should probably use locale to find the correct
+	 * char to print out.
+	 */
+	if (max > 0) {
+		dopr_outch (buffer, currlen, maxlen, '.');
+		
+		while (fplace > 0) 
+			dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]);
+	}
+	
+	while (zpadlen > 0) {
+		dopr_outch (buffer, currlen, maxlen, '0');
+		--zpadlen;
+	}
+
+	while (padlen < 0) {
+		dopr_outch (buffer, currlen, maxlen, ' ');
+		++padlen;
+	}
+}
+
+static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c)
+{
+	if (*currlen < maxlen) {
+		buffer[(*currlen)] = c;
+	}
+	(*currlen)++;
+}
+
+#if !defined(HAVE_VSNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
+ int vsnprintf (char *str, size_t count, const char *fmt, va_list args)
+{
+	return dopr(str, count, fmt, args);
+}
+#endif
+
+#if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
+ int snprintf(char *str,size_t count,const char *fmt,...)
+{
+	size_t ret;
+	va_list ap;
+    
+	va_start(ap, fmt);
+	ret = vsnprintf(str, count, fmt, ap);
+	va_end(ap);
+	return ret;
+}
+#endif
+
+#endif 
+
+#ifndef HAVE_VASPRINTF
+ int vasprintf(char **ptr, const char *format, va_list ap)
+{
+	int ret;
+	
+	ret = vsnprintf(NULL, 0, format, ap);
+	if (ret <= 0) return ret;
+
+	(*ptr) = (char *)malloc(ret+1);
+	if (!*ptr) return -1;
+	ret = vsnprintf(*ptr, ret+1, format, ap);
+
+	return ret;
+}
+#endif
+
+
+#ifndef HAVE_ASPRINTF
+ int asprintf(char **ptr, const char *format, ...)
+{
+	va_list ap;
+	int ret;
+	
+	va_start(ap, format);
+	ret = vasprintf(ptr, format, ap);
+	va_end(ap);
+
+	return ret;
+}
+#endif
+
+#ifdef TEST_SNPRINTF
+
+ int sprintf(char *str,const char *fmt,...);
+
+ int main (void)
+{
+	char buf1[1024];
+	char buf2[1024];
+	char *fp_fmt[] = {
+		"%1.1f",
+		"%-1.5f",
+		"%1.5f",
+		"%123.9f",
+		"%10.5f",
+		"% 10.5f",
+		"%+22.9f",
+		"%+4.9f",
+		"%01.3f",
+		"%4f",
+		"%3.1f",
+		"%3.2f",
+		"%.0f",
+		"%f",
+		"-16.16f",
+		NULL
+	};
+	double fp_nums[] = { 6442452944.1234, -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996, 
+			     0.9996, 1.996, 4.136,  0};
+	char *int_fmt[] = {
+		"%-1.5d",
+		"%1.5d",
+		"%123.9d",
+		"%5.5d",
+		"%10.5d",
+		"% 10.5d",
+		"%+22.33d",
+		"%01.3d",
+		"%4d",
+		"%d",
+		NULL
+	};
+	long int_nums[] = { -1, 134, 91340, 341, 0203, 0};
+	char *str_fmt[] = {
+		"10.5s",
+		"5.10s",
+		"10.1s",
+		"0.10s",
+		"10.0s",
+		"1.10s",
+		"%s",
+		"%.1s",
+		"%.10s",
+		"%10s",
+		NULL
+	};
+	char *str_vals[] = {"hello", "a", "", "a longer string", NULL};
+	int x, y;
+	int fail = 0;
+	int num = 0;
+
+	printf ("Testing snprintf format codes against system sprintf...\n");
+
+	for (x = 0; fp_fmt[x] ; x++) {
+		for (y = 0; fp_nums[y] != 0 ; y++) {
+			int l1 = snprintf(NULL, 0, fp_fmt[x], fp_nums[y]);
+			int l2 = snprintf(buf1, sizeof(buf1), fp_fmt[x], fp_nums[y]);
+			sprintf (buf2, fp_fmt[x], fp_nums[y]);
+			if (strcmp (buf1, buf2)) {
+				printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n", 
+				       fp_fmt[x], buf1, buf2);
+				fail++;
+			}
+			if (l1 != l2) {
+				printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, fp_fmt[x]);
+				fail++;
+			}
+			num++;
+		}
+	}
+
+	for (x = 0; int_fmt[x] ; x++) {
+		for (y = 0; int_nums[y] != 0 ; y++) {
+			int l1 = snprintf(NULL, 0, int_fmt[x], int_nums[y]);
+			int l2 = snprintf(buf1, sizeof(buf1), int_fmt[x], int_nums[y]);
+			sprintf (buf2, int_fmt[x], int_nums[y]);
+			if (strcmp (buf1, buf2)) {
+				printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n", 
+				       int_fmt[x], buf1, buf2);
+				fail++;
+			}
+			if (l1 != l2) {
+				printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, int_fmt[x]);
+				fail++;
+			}
+			num++;
+		}
+	}
+
+	for (x = 0; str_fmt[x] ; x++) {
+		for (y = 0; str_vals[y] != 0 ; y++) {
+			int l1 = snprintf(NULL, 0, str_fmt[x], str_vals[y]);
+			int l2 = snprintf(buf1, sizeof(buf1), str_fmt[x], str_vals[y]);
+			sprintf (buf2, str_fmt[x], str_vals[y]);
+			if (strcmp (buf1, buf2)) {
+				printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n", 
+				       str_fmt[x], buf1, buf2);
+				fail++;
+			}
+			if (l1 != l2) {
+				printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, str_fmt[x]);
+				fail++;
+			}
+			num++;
+		}
+	}
+
+	printf ("%d tests failed out of %d.\n", fail, num);
+
+	printf("seeing how many digits we support\n");
+	{
+		double v0 = 0.12345678901234567890123456789012345678901;
+		for (x=0; x<100; x++) {
+			snprintf(buf1, sizeof(buf1), "%1.1f", v0*pow(10, x));
+			sprintf(buf2,                "%1.1f", v0*pow(10, x));
+			if (strcmp(buf1, buf2)) {
+				printf("we seem to support %d digits\n", x-1);
+				break;
+			}
+		}
+	}
 
-  /*
-   * Sorry, we only support 9 digits past the decimal because of our
-   * conversion method
-   */
-  if (max > 9)
-    max = 9;
-
-  /* We "cheat" by converting the fractional part to integer by
-   * multiplying by a factor of 10
-   */
-  fracpart = round((pow10(max)) * (ufvalue - intpart));
-
-  if (fracpart >= pow10(max)) {
-    intpart++;
-    fracpart -= pow10(max);
-  }
-
-  /* Convert integer part */
-  do {
-    iconvert[iplace++] =
-	(caps ? "0123456789ABCDEF" : "0123456789abcdef")[intpart % 10];
-    intpart = (intpart / 10);
-  }
-  while (intpart && (iplace < 20));
-  if (iplace == 20)
-    iplace--;
-  iconvert[iplace] = 0;
-
-  /* Convert fractional part */
-  do {
-    fconvert[fplace++] =
-	(caps ? "0123456789ABCDEF" : "0123456789abcdef")[fracpart % 10];
-    fracpart = (fracpart / 10);
-  }
-  while (fracpart && (fplace < 20));
-  if (fplace == 20)
-    fplace--;
-  fconvert[fplace] = 0;
-
-  /* -1 for decimal point, another -1 if we are printing a sign */
-  padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);
-  zpadlen = max - fplace;
-  if (zpadlen < 0)
-    zpadlen = 0;
-  if (padlen < 0)
-    padlen = 0;
-  if (flags & DP_F_MINUS)
-    padlen = -padlen;		/* Left Justifty */
-
-  if ((flags & DP_F_ZERO) && (padlen > 0)) {
-    if (signvalue) {
-      dopr_outch(buffer, currlen, maxlen, signvalue);
-      --padlen;
-      signvalue = 0;
-    }
-    while (padlen > 0) {
-      dopr_outch(buffer, currlen, maxlen, '0');
-      --padlen;
-    }
-  }
-  while (padlen > 0) {
-    dopr_outch(buffer, currlen, maxlen, ' ');
-    --padlen;
-  }
-  if (signvalue)
-    dopr_outch(buffer, currlen, maxlen, signvalue);
-
-  while (iplace > 0)
-    dopr_outch(buffer, currlen, maxlen, iconvert[--iplace]);
-
-  /*
-   * Decimal point.  This should probably use locale to find the correct
-   * char to print out.
-   */
-  if (max > 0) {
-    dopr_outch(buffer, currlen, maxlen, '.');
-
-    while (fplace > 0)
-      dopr_outch(buffer, currlen, maxlen, fconvert[--fplace]);
-  }
-
-  while (zpadlen > 0) {
-    dopr_outch(buffer, currlen, maxlen, '0');
-    --zpadlen;
-  }
-
-  while (padlen < 0) {
-    dopr_outch(buffer, currlen, maxlen, ' ');
-    ++padlen;
-  }
-}
-
-static void dopr_outch(char *buffer, size_t * currlen, size_t maxlen,
-		       char c)
-{
-  if (*currlen < maxlen)
-    buffer[(*currlen)++] = c;
-}
-
-int egg_vsnprintf(char *str, size_t count, const char *fmt, va_list args)
-{
-  str[0] = 0;
-  dopr(str, count, fmt, args);
-  return (strlen(str));
-}
-#endif				/* !HAVE_VSNPRINTF */
-
-#ifndef HAVE_SNPRINTF
-#  ifdef HAVE_STDARGS
-int egg_snprintf(char *str, size_t count, const char *fmt, ...)
-#  else
-int egg_snprintf(va_alist) va_dcl
-#  endif
-{
-#  ifndef HAVE_STDARGS
-  char *str;
-  size_t count;
-  char *fmt;
-#  endif
-  VA_LOCAL_DECL;
-
-  VA_START(fmt);
-  VA_SHIFT(str, char *);
-  VA_SHIFT(count, size_t);
-  VA_SHIFT(fmt, char *);
-  (void) egg_vsnprintf(str, count, fmt, ap);
-  VA_END;
-  return (strlen(str));
+	return 0;
 }
-#endif				/* !HAVE_SNPRINTF */
+#endif /* SNPRINTF_TEST */
Index: eggdrop1.7/src/compat/snprintf.h
diff -u eggdrop1.7/src/compat/snprintf.h:1.7 eggdrop1.7/src/compat/snprintf.h:1.8
--- eggdrop1.7/src/compat/snprintf.h:1.7	Wed Apr 11 21:39:44 2001
+++ eggdrop1.7/src/compat/snprintf.h	Thu Oct 18 20:55:06 2001
@@ -1,8 +1,8 @@
 /*
  * snprintf.h
- *   header file for snprintf.c
+ *   prototypes for snprintf.c
  *
- * $Id: snprintf.h,v 1.7 2001/04/12 02:39:44 guppy Exp $
+ * $Id: snprintf.h,v 1.8 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (C) 2000, 2001 Eggheads Development Team
@@ -21,33 +21,30 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
+#ifndef _EGG_SNPRINTF_H
+#define _EGG_SNPRINTF_H
 
-#ifndef _EGG_COMPAT_SNPRINTF_H_
-#define _EGG_COMPAT_SNPRINTF_H_
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "src/main.h"
 #include <stdio.h>
+#include <stdarg.h>		/* FIXME: possible varargs.h conflicts */
 
-/* Use the system libraries version of vsnprintf() if available. Otherwise
- * use our own.
- */
-#ifndef HAVE_VSNPRINTF
-int egg_vsnprintf(char *str, size_t count, const char *fmt, va_list ap);
-#else
-#  define egg_vsnprintf	vsnprintf
+#if !defined(HAVE_VSNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
+int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
 #endif
 
-/* Use the system libraries version of snprintf() if available. Otherwise
- * use our own.
- */
-#ifndef HAVE_SNPRINTF
-#  ifdef __STDC__
-int egg_snprintf(char *str, size_t count, const char *fmt, ...);
-#  else
-int egg_snprintf();
-#  endif
-#else
-#  define egg_snprintf	snprintf
+#if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
+int snprintf(char *str, size_t count, const char *fmt, ...);
+#endif
+
+#ifndef HAVE_VASPRINTF
+int vasprintf(char **ptr, const char *format, va_list ap);
+#endif
+
+#ifndef HAVE_ASPRINTF
+int asprintf(char **ptr, const char *format, ...);
 #endif
 
-#endif	/* !_EGG_COMPAT_SNPRINTF_H_ */
+#endif				/* !_EGG_SNPRINTF_H */
Index: eggdrop1.7/src/compat/strcasecmp.c
diff -u eggdrop1.7/src/compat/strcasecmp.c:1.4 eggdrop1.7/src/compat/strcasecmp.c:1.5
--- eggdrop1.7/src/compat/strcasecmp.c:1.4	Wed Oct 10 05:44:04 2001
+++ eggdrop1.7/src/compat/strcasecmp.c	Thu Oct 18 20:55:06 2001
@@ -1,7 +1,8 @@
 /*
- * strcasecmp.c -- provides strcasecmp() and strncasecmp if necessary.
+ * strcasecmp.c
+ *   provides strcasecmp()
  *
- * $Id: strcasecmp.c,v 1.4 2001/10/10 10:44:04 tothwolf Exp $
+ * $Id: strcasecmp.c,v 1.5 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -22,10 +23,9 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-#include "../main.h"
+#include <ctype.h>
 
-#ifndef HAVE_STRCASECMP
-int egg_strcasecmp(const char *s1, const char *s2)
+int strcasecmp(const char *s1, const char *s2)
 {
   while ((*s1) && (*s2) && (toupper(*s1) == toupper(*s2))) {
     s1++;
@@ -33,17 +33,3 @@
   }
   return toupper(*s1) - toupper(*s2);
 }
-#endif /* !HAVE_STRCASECMP */
-
-#ifndef HAVE_STRNCASECMP
-int egg_strncasecmp(const char *s1, const char *s2, size_t n)
-{
-  if (!n)
-    return 0;
-  while (--n && (*s1) && (*s2) && (toupper(*s1) == toupper(*s2))) {
-    s1++;
-    s2++;
-  }
-  return toupper(*s1) - toupper(*s2);
-}
-#endif /* !HAVE_STRNCASECMP */
Index: eggdrop1.7/src/compat/strcasecmp.h
diff -u eggdrop1.7/src/compat/strcasecmp.h:1.3 eggdrop1.7/src/compat/strcasecmp.h:1.4
--- eggdrop1.7/src/compat/strcasecmp.h:1.3	Wed Apr 11 21:39:44 2001
+++ eggdrop1.7/src/compat/strcasecmp.h	Thu Oct 18 20:55:06 2001
@@ -2,7 +2,7 @@
  * strcasecmp.h
  *   prototypes for strcasecmp.c
  *
- * $Id: strcasecmp.h,v 1.3 2001/04/12 02:39:44 guppy Exp $
+ * $Id: strcasecmp.h,v 1.4 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (C) 2000, 2001 Eggheads Development Team
@@ -21,26 +21,15 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
+#ifndef _EGG_STRCASECMP_H
+#define _EGG_STRCASECMP_H
 
-#ifndef _EGG_COMPAT_STRCASECMP_H
-#define _EGG_COMPAT_STRCASECMP_H
-
-#include "src/main.h"
-#include <ctype.h>
-
-
-#ifndef HAVE_STRCASECMP
-/* Use our own implementation. */
-int egg_strcasecmp(const char *, const char *);
-#else
-#  define egg_strcasecmp	strcasecmp
+#ifdef HAVE_CONFIG_H
+# include "config.h"
 #endif
 
-#ifndef HAVE_STRNCASECMP
-/* Use our own implementation. */
-int egg_strncasecmp(const char *, const char *, size_t);
-#else
-#  define egg_strncasecmp	strncasecmp
+#ifndef HAVE_STRCASECMP
+int strcasecmp(const char *, const char *);
 #endif
 
-#endif	/* !__EGG_COMPAT_STRCASECMP_H */
+#endif				/* !_EGG_STRCASECMP_H */
Index: eggdrop1.7/src/compat/strftime.c
diff -u eggdrop1.7/src/compat/strftime.c:1.2 eggdrop1.7/src/compat/strftime.c:1.3
--- eggdrop1.7/src/compat/strftime.c:1.2	Wed Apr 11 21:39:44 2001
+++ eggdrop1.7/src/compat/strftime.c	Thu Oct 18 20:55:06 2001
@@ -1,35 +1,1257 @@
-/*
- * strftime.c
- *   Portable strftime implementation. Uses GNU's strftime().
- *
- * $Id: strftime.c,v 1.2 2001/04/12 02:39:44 guppy Exp $
- */
-/*
- * Copyright (C) 2000, 2001 Eggheads Development Team
- * Written by Fabian Knittel
- *
- * 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.
- */
-
-#include "src/main.h"
-#include "strftime.h"
-
-#ifndef HAVE_STRFTIME
-#  undef emacs
-#  undef _LIBC
-#  define strftime	egg_strftime
+/* Copyright (C) 1991,92,93,94,95,96,97,98 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-#  include "gnu_strftime.c"
-#endif	/* !HAVE_STRFTIME */
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef _LIBC
+# define HAVE_LIMITS_H 1
+# define HAVE_MBLEN 1
+# define HAVE_MBRLEN 1
+# define HAVE_STRUCT_ERA_ENTRY 1
+# define HAVE_TM_GMTOFF 1
+# define HAVE_TM_ZONE 1
+# define HAVE_TZNAME 1
+# define HAVE_TZSET 1
+# define MULTIBYTE_IS_FORMAT_SAFE 1
+# define STDC_HEADERS 1
+# include "../locale/localeinfo.h"
+#endif
+
+#if defined emacs && !defined HAVE_BCOPY
+# define HAVE_MEMCPY 1
+#endif
+
+#include <ctype.h>
+#include <sys/types.h>		/* Some systems define `time_t' here.  */
+
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+#if HAVE_TZNAME
+extern char *tzname[];
+#endif
+
+/* Do multibyte processing if multibytes are supported, unless
+   multibyte sequences are safe in formats.  Multibyte sequences are
+   safe if they cannot contain byte sequences that look like format
+   conversion specifications.  The GNU C Library uses UTF8 multibyte
+   encoding, which is safe for formats, but strftime.c can be used
+   with other C libraries that use unsafe encodings.  */
+#define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE)
+
+#if DO_MULTIBYTE
+# if HAVE_MBRLEN
+#  include <wchar.h>
+# else
+   /* Simulate mbrlen with mblen as best we can.  */
+#  define mbstate_t int
+#  define mbrlen(s, n, ps) mblen (s, n)
+#  define mbsinit(ps) (*(ps) == 0)
+# endif
+  static const mbstate_t mbstate_zero;
+#endif
+
+#if HAVE_LIMITS_H
+# include <limits.h>
+#endif
+
+#if STDC_HEADERS
+# include <stddef.h>
+# include <stdlib.h>
+# include <string.h>
+#else
+# ifndef HAVE_MEMCPY
+#  define memcpy(d, s, n) bcopy ((s), (d), (n))
+# endif
+#endif
+
+#ifdef _LIBC
+# define MEMPCPY(d, s, n) __mempcpy (d, s, n)
+#else
+# ifndef HAVE_MEMPCPY
+#  define MEMPCPY(d, s, n) ((void *) ((char *) memcpy (d, s, n) + (n)))
+# endif
+#endif
+
+#ifndef __P
+# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
+#  define __P(args) args
+# else
+#  define __P(args) ()
+# endif  /* GCC.  */
+#endif  /* Not __P.  */
+
+#ifndef PTR
+# ifdef __STDC__
+#  define PTR void *
+# else
+#  define PTR char *
+# endif
+#endif
+
+#ifndef CHAR_BIT
+# define CHAR_BIT 8
+#endif
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+#define TYPE_SIGNED(t) ((t) -1 < 0)
+
+/* Bound on length of the string representing an integer value of type t.
+   Subtract one for the sign bit if t is signed;
+   302 / 1000 is log10 (2) rounded up;
+   add one for integer division truncation;
+   add one more for a minus sign if t is signed.  */
+#define INT_STRLEN_BOUND(t) \
+ ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 + 1 + TYPE_SIGNED (t))
+
+#define TM_YEAR_BASE 1900
+
+#ifndef __isleap
+/* Nonzero if YEAR is a leap year (every 4 years,
+   except every 100th isn't, and every 400th is).  */
+# define __isleap(year)	\
+  ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
+#endif
+
+
+#ifdef _LIBC
+# define my_strftime_gmtime_r __gmtime_r
+# define my_strftime_localtime_r __localtime_r
+# define tzname __tzname
+# define tzset __tzset
+#else
+
+/* If we're a strftime substitute in a GNU program, then prefer gmtime
+   to gmtime_r, since many gmtime_r implementations are buggy.
+   Similarly for localtime_r.  */
+
+# if ! HAVE_TM_GMTOFF
+static struct tm *my_strftime_gmtime_r __P ((const time_t *, struct tm *));
+static struct tm *
+my_strftime_gmtime_r (t, tp)
+     const time_t *t;
+     struct tm *tp;
+{
+  struct tm *l = gmtime (t);
+  if (! l)
+    return 0;
+  *tp = *l;
+  return tp;
+}
+# endif /* ! HAVE_TM_GMTOFF */
+
+static struct tm *my_strftime_localtime_r __P ((const time_t *, struct tm *));
+static struct tm *
+my_strftime_localtime_r (t, tp)
+     const time_t *t;
+     struct tm *tp;
+{
+  struct tm *l = localtime (t);
+  if (! l)
+    return 0;
+  *tp = *l;
+  return tp;
+}
+#endif /* ! defined _LIBC */
+
+
+#if !defined memset && !defined HAVE_MEMSET && !defined _LIBC
+/* Some systems lack the `memset' function and we don't want to
+   introduce additional dependencies.  */
+/* The SGI compiler reportedly barfs on the trailing null
+   if we use a string constant as the initializer.  28 June 1997, rms.  */
+static const char spaces[16] = /* "                " */
+  { ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ' };
+static const char zeroes[16] = /* "0000000000000000" */
+  { '0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0' };
+
+# define memset_space(P, Len) \
+  do {									      \
+    int _len = (Len);							      \
+									      \
+    do									      \
+      {									      \
+	int _this = _len > 16 ? 16 : _len;				      \
+	(P) = MEMPCPY ((P), spaces, _this);				      \
+	_len -= _this;							      \
+      }									      \
+    while (_len > 0);							      \
+  } while (0)
+
+# define memset_zero(P, Len) \
+  do {									      \
+    int _len = (Len);							      \
+									      \
+    do									      \
+      {									      \
+	int _this = _len > 16 ? 16 : _len;				      \
+	(P) = MEMPCPY ((P), zeroes, _this);				      \
+	_len -= _this;							      \
+      }									      \
+    while (_len > 0);							      \
+  } while (0)
+#else
+# define memset_space(P, Len) (memset ((P), ' ', (Len)), (P) += (Len))
+# define memset_zero(P, Len) (memset ((P), '0', (Len)), (P) += (Len))
+#endif
+
+#define add(n, f)							      \
+  do									      \
+    {									      \
+      int _n = (n);							      \
+      int _delta = width - _n;						      \
+      int _incr = _n + (_delta > 0 ? _delta : 0);			      \
+      if (i + _incr >= maxsize)						      \
+	return 0;							      \
+      if (p)								      \
+	{								      \
+	  if (_delta > 0)						      \
+	    {								      \
+	      if (pad == '0')						      \
+		memset_zero (p, _delta);				      \
+	      else							      \
+		memset_space (p, _delta);				      \
+	    }								      \
+	  f;								      \
+	  p += _n;							      \
+	}								      \
+      i += _incr;							      \
+    } while (0)
+
+#define cpy(n, s) \
+    add ((n),								      \
+	 if (to_lowcase)						      \
+	   memcpy_lowcase (p, (s), _n);					      \
+	 else if (to_uppcase)						      \
+	   memcpy_uppcase (p, (s), _n);					      \
+	 else								      \
+	   memcpy ((PTR) p, (PTR) (s), _n))
+
+
+
+#ifdef _LIBC
+# define TOUPPER(Ch) toupper (Ch)
+# define TOLOWER(Ch) tolower (Ch)
+#else
+# define TOUPPER(Ch) (islower (Ch) ? toupper (Ch) : (Ch))
+# define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
+#endif
+/* We don't use `isdigit' here since the locale dependent
+   interpretation is not what we want here.  We only need to accept
+   the arabic digits in the ASCII range.  One day there is perhaps a
+   more reliable way to accept other sets of digits.  */
+#define ISDIGIT(Ch) ((unsigned int) (Ch) - '0' <= 9)
+
+static char *memcpy_lowcase __P ((char *dest, const char *src, size_t len));
+
+static char *
+memcpy_lowcase (dest, src, len)
+     char *dest;
+     const char *src;
+     size_t len;
+{
+  while (len-- > 0)
+    dest[len] = TOLOWER ((unsigned char) src[len]);
+  return dest;
+}
+
+static char *memcpy_uppcase __P ((char *dest, const char *src, size_t len));
+
+static char *
+memcpy_uppcase (dest, src, len)
+     char *dest;
+     const char *src;
+     size_t len;
+{
+  while (len-- > 0)
+    dest[len] = TOUPPER ((unsigned char) src[len]);
+  return dest;
+}
+
+
+#if ! HAVE_TM_GMTOFF
+/* Yield the difference between *A and *B,
+   measured in seconds, ignoring leap seconds.  */
+# define tm_diff ftime_tm_diff
+static int tm_diff __P ((const struct tm *, const struct tm *));
+static int
+tm_diff (a, b)
+     const struct tm *a;
+     const struct tm *b;
+{
+  /* Compute intervening leap days correctly even if year is negative.
+     Take care to avoid int overflow in leap day calculations,
+     but it's OK to assume that A and B are close to each other.  */
+  int a4 = (a->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (a->tm_year & 3);
+  int b4 = (b->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (b->tm_year & 3);
+  int a100 = a4 / 25 - (a4 % 25 < 0);
+  int b100 = b4 / 25 - (b4 % 25 < 0);
+  int a400 = a100 >> 2;
+  int b400 = b100 >> 2;
+  int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400);
+  int years = a->tm_year - b->tm_year;
+  int days = (365 * years + intervening_leap_days
+	      + (a->tm_yday - b->tm_yday));
+  return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour))
+		+ (a->tm_min - b->tm_min))
+	  + (a->tm_sec - b->tm_sec));
+}
+#endif /* ! HAVE_TM_GMTOFF */
+
+
+
+/* The number of days from the first day of the first ISO week of this
+   year to the year day YDAY with week day WDAY.  ISO weeks start on
+   Monday; the first ISO week has the year's first Thursday.  YDAY may
+   be as small as YDAY_MINIMUM.  */
+#define ISO_WEEK_START_WDAY 1 /* Monday */
+#define ISO_WEEK1_WDAY 4 /* Thursday */
+#define YDAY_MINIMUM (-366)
+static int iso_week_days __P ((int, int));
+#ifdef __GNUC__
+__inline__
+#endif
+static int
+iso_week_days (yday, wday)
+     int yday;
+     int wday;
+{
+  /* Add enough to the first operand of % to make it nonnegative.  */
+  int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7;
+  return (yday
+	  - (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7
+	  + ISO_WEEK1_WDAY - ISO_WEEK_START_WDAY);
+}
+
+
+#if !(defined _NL_CURRENT || HAVE_STRFTIME)
+static char const weekday_name[][10] =
+  {
+    "Sunday", "Monday", "Tuesday", "Wednesday",
+    "Thursday", "Friday", "Saturday"
+  };
+static char const month_name[][10] =
+  {
+    "January", "February", "March", "April", "May", "June",
+    "July", "August", "September", "October", "November", "December"
+  };
+#endif
+
+
+#ifdef emacs
+# define my_strftime emacs_strftimeu
+# define ut_argument , ut
+# define ut_argument_spec int ut;
+# define ut_argument_spec_iso , int ut
+#else
+# define my_strftime strftime
+# define ut_argument
+# define ut_argument_spec
+# define ut_argument_spec_iso
+/* We don't have this information in general.  */
+# define ut 0
+#endif
+
+#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
+  /* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
+     Work around this bug by copying *tp before it might be munged.  */
+  size_t _strftime_copytm __P ((char *, size_t, const char *,
+			        const struct tm * ut_argument_spec_iso));
+  size_t
+  my_strftime (s, maxsize, format, tp ut_argument)
+      char *s;
+      size_t maxsize;
+      const char *format;
+      const struct tm *tp;
+      ut_argument_spec
+  {
+    struct tm tmcopy;
+    tmcopy = *tp;
+    return _strftime_copytm (s, maxsize, format, &tmcopy ut_argument);
+  }
+# undef my_strftime
+# define my_strftime(S, Maxsize, Format, Tp) \
+  _strftime_copytm (S, Maxsize, Format, Tp)
+#endif
+
+
+/* Write information from TP into S according to the format
+   string FORMAT, writing no more that MAXSIZE characters
+   (including the terminating '\0') and returning number of
+   characters written.  If S is NULL, nothing will be written
+   anywhere, so to determine how many characters would be
+   written, use NULL for S and (size_t) UINT_MAX for MAXSIZE.  */
+size_t
+my_strftime (s, maxsize, format, tp ut_argument)
+      char *s;
+      size_t maxsize;
+      const char *format;
+      const struct tm *tp;
+      ut_argument_spec
+{
+  int hour12 = tp->tm_hour;
+#ifdef _NL_CURRENT
+  /* We cannot make the following values variables since we must delay
+     the evaluation of these values until really needed since some
+     expressions might not be valid in every situation.  The `struct tm'
+     might be generated by a strptime() call that initialized
+     only a few elements.  Dereference the pointers only if the format
+     requires this.  Then it is ok to fail if the pointers are invalid.  */
+# define a_wkday _NL_CURRENT (LC_TIME, ABDAY_1 + tp->tm_wday)
+# define f_wkday _NL_CURRENT (LC_TIME, DAY_1 + tp->tm_wday)
+# define a_month _NL_CURRENT (LC_TIME, ABMON_1 + tp->tm_mon)
+# define f_month _NL_CURRENT (LC_TIME, MON_1 + tp->tm_mon)
+# define ampm _NL_CURRENT (LC_TIME, tp->tm_hour > 11 ? PM_STR : AM_STR)
+
+# define aw_len strlen (a_wkday)
+# define am_len strlen (a_month)
+# define ap_len strlen (ampm)
+#else
+# if !HAVE_STRFTIME
+# define f_wkday (weekday_name[tp->tm_wday])
+# define f_month (month_name[tp->tm_mon])
+# define a_wkday f_wkday
+# define a_month f_month
+# define ampm ("AMPM" + 2 * (tp->tm_hour > 11))
+
+  size_t aw_len = 3;
+  size_t am_len = 3;
+  size_t ap_len = 2;
+# endif
+#endif
+  const char *zone;
+  size_t i = 0;
+  char *p = s;
+  const char *f;
+
+  zone = NULL;
+#if HAVE_TM_ZONE
+  /* The POSIX test suite assumes that setting
+     the environment variable TZ to a new value before calling strftime()
+     will influence the result (the %Z format) even if the information in
+     TP is computed with a totally different time zone.
+     This is bogus: though POSIX allows bad behavior like this,
+     POSIX does not require it.  Do the right thing instead.  */
+  zone = (const char *) tp->tm_zone;
+#endif
+#if HAVE_TZNAME
+  if (ut)
+    {
+      if (! (zone && *zone))
+	zone = "GMT";
+    }
+  else
+    {
+      /* POSIX.1 8.1.1 requires that whenever strftime() is called, the
+	 time zone names contained in the external variable `tzname' shall
+	 be set as if the tzset() function had been called.  */
+# if HAVE_TZSET
+      tzset ();
+# endif
+    }
+#endif
+
+  if (hour12 > 12)
+    hour12 -= 12;
+  else
+    if (hour12 == 0)
+      hour12 = 12;
+
+  for (f = format; *f != '\0'; ++f)
+    {
+      int pad = 0;		/* Padding for number ('-', '_', or 0).  */
+      int modifier;		/* Field modifier ('E', 'O', or 0).  */
+      int digits;		/* Max digits for numeric format.  */
+      int number_value; 	/* Numeric value to be printed.  */
+      int negative_number;	/* 1 if the number is negative.  */
+      const char *subfmt;
+      char *bufp;
+      char buf[1 + (sizeof (int) < sizeof (time_t)
+		    ? INT_STRLEN_BOUND (time_t)
+		    : INT_STRLEN_BOUND (int))];
+      int width = -1;
+      int to_lowcase = 0;
+      int to_uppcase = 0;
+      int change_case = 0;
+      int format_char;
+
+#if DO_MULTIBYTE
+
+       switch (*f)
+	{
+	case '%':
+	  break;
+
+	case '\a': case '\b': case '\t': case '\n':
+	case '\v': case '\f': case '\r':
+	case ' ': case '!': case '"': case '#': case '&': case'\'':
+	case '(': case ')': case '*': case '+': case ',': case '-':
+	case '.': case '/': case '0': case '1': case '2': case '3':
+	case '4': case '5': case '6': case '7': case '8': case '9':
+	case ':': case ';': case '<': case '=': case '>': case '?':
+	case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+	case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+	case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+	case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+	case 'Y': case 'Z': case '[': case'\\': case ']': case '^':
+	case '_': case 'a': case 'b': case 'c': case 'd': case 'e':
+	case 'f': case 'g': case 'h': case 'i': case 'j': case 'k':
+	case 'l': case 'm': case 'n': case 'o': case 'p': case 'q':
+	case 'r': case 's': case 't': case 'u': case 'v': case 'w':
+	case 'x': case 'y': case 'z': case '{': case '|': case '}':
+	case '~':
+	  /* The C Standard requires these 98 characters (plus '%') to
+	     be in the basic execution character set.  None of these
+	     characters can start a multibyte sequence, so they need
+	     not be analyzed further.  */
+	  add (1, *p = *f);
+	  continue;
+
+	default:
+	  /* Copy this multibyte sequence until we reach its end, find
+	     an error, or come back to the initial shift state.  */
+	  {
+	    mbstate_t mbstate = mbstate_zero;
+	    size_t len = 0;
+
+	    do
+	      {
+		size_t bytes = mbrlen (f + len, (size_t) -1, &mbstate);
+
+		if (bytes == 0)
+		  break;
+
+		if (bytes == (size_t) -2)
+		  {
+		    len += strlen (f + len);
+		    break;
+		  }
+
+		if (bytes == (size_t) -1)
+		  {
+		    len++;
+		    break;
+		  }
+
+		len += bytes;
+	      }
+	    while (! mbsinit (&mbstate));
+
+	    cpy (len, f);
+	    f += len - 1;
+	    continue;
+	  }
+	}
+
+#else /* ! DO_MULTIBYTE */
+
+      /* Either multibyte encodings are not supported, or they are
+	 safe for formats, so any non-'%' byte can be copied through.  */
+      if (*f != '%')
+	{
+	  add (1, *p = *f);
+	  continue;
+	}
+
+#endif /* ! DO_MULTIBYTE */
+
+      /* Check for flags that can modify a format.  */
+      while (1)
+	{
+	  switch (*++f)
+	    {
+	      /* This influences the number formats.  */
+	    case '_':
+	    case '-':
+	    case '0':
+	      pad = *f;
+	      continue;
+
+	      /* This changes textual output.  */
+	    case '^':
+	      to_uppcase = 1;
+	      continue;
+	    case '#':
+	      change_case = 1;
+	      continue;
+
+	    default:
+	      break;
+	    }
+	  break;
+	}
+
+      /* As a GNU extension we allow to specify the field width.  */
+      if (ISDIGIT (*f))
+	{
+	  width = 0;
+	  do
+	    {
+	      width *= 10;
+	      width += *f - '0';
+	      ++f;
+	    }
+	  while (ISDIGIT (*f));
+	}
+
+      /* Check for modifiers.  */
+      switch (*f)
+	{
+	case 'E':
+	case 'O':
+	  modifier = *f++;
+	  break;
+
+	default:
+	  modifier = 0;
+	  break;
+	}
+
+      /* Now do the specified format.  */
+      format_char = *f;
+      switch (format_char)
+	{
+#define DO_NUMBER(d, v) \
+	  digits = width == -1 ? d : width;				      \
+	  number_value = v; goto do_number
+#define DO_NUMBER_SPACEPAD(d, v) \
+	  digits = width == -1 ? d : width;				      \
+	  number_value = v; goto do_number_spacepad
+
+	case '%':
+	  if (modifier != 0)
+	    goto bad_format;
+	  add (1, *p = *f);
+	  break;
+
+	case 'a':
+	  if (modifier != 0)
+	    goto bad_format;
+	  if (change_case)
+	    {
+	      to_uppcase = 1;
+	      to_lowcase = 0;
+	    }
+#if defined _NL_CURRENT || !HAVE_STRFTIME
+	  cpy (aw_len, a_wkday);
+	  break;
+#else
+	  goto underlying_strftime;
+#endif
+
+	case 'A':
+	  if (modifier != 0)
+	    goto bad_format;
+	  if (change_case)
+	    {
+	      to_uppcase = 1;
+	      to_lowcase = 0;
+	    }
+#if defined _NL_CURRENT || !HAVE_STRFTIME
+	  cpy (strlen (f_wkday), f_wkday);
+	  break;
+#else
+	  goto underlying_strftime;
+#endif
+
+	case 'b':
+	case 'h':		/* POSIX.2 extension.  */
+	  if (modifier != 0)
+	    goto bad_format;
+#if defined _NL_CURRENT || !HAVE_STRFTIME
+	  cpy (am_len, a_month);
+	  break;
+#else
+	  goto underlying_strftime;
+#endif
+
+	case 'B':
+	  if (modifier != 0)
+	    goto bad_format;
+	  if (change_case)
+	    {
+	      to_uppcase = 1;
+	      to_lowcase = 0;
+	    }
+#if defined _NL_CURRENT || !HAVE_STRFTIME
+	  cpy (strlen (f_month), f_month);
+	  break;
+#else
+	  goto underlying_strftime;
+#endif
+
+	case 'c':
+	  if (modifier == 'O')
+	    goto bad_format;
+#ifdef _NL_CURRENT
+	  if (! (modifier == 'E'
+		 && *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT)) != '\0'))
+	    subfmt = _NL_CURRENT (LC_TIME, D_T_FMT);
+#else
+# if HAVE_STRFTIME
+	  goto underlying_strftime;
+# else
+	  subfmt = "%a %b %e %H:%M:%S %Y";
+# endif
+#endif
+
+	subformat:
+	  {
+	    char *old_start = p;
+	    size_t len = my_strftime (NULL, (size_t) -1, subfmt, tp);
+	    add (len, my_strftime (p, maxsize - i, subfmt, tp));
+
+	    if (to_uppcase)
+	      while (old_start < p)
+		{
+		  *old_start = TOUPPER ((unsigned char) *old_start);
+		  ++old_start;
+		}
+	  }
+	  break;
+
+#if HAVE_STRFTIME && ! (defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY)
+	underlying_strftime:
+	  {
+	    /* The relevant information is available only via the
+	       underlying strftime implementation, so use that.  */
+	    char ufmt[4];
+	    char *u = ufmt;
+	    char ubuf[1024]; /* enough for any single format in practice */
+	    size_t len;
+	    *u++ = '%';
+	    if (modifier != 0)
+	      *u++ = modifier;
+	    *u++ = format_char;
+	    *u = '\0';
+	    len = strftime (ubuf, sizeof ubuf, ufmt, tp);
+	    if (len == 0 && ubuf[0] != '\0')
+	      return 0;
+	    cpy (len, ubuf);
+	  }
+	  break;
+#endif
+
+	case 'C':		/* POSIX.2 extension.  */
+	  if (modifier == 'O')
+	    goto bad_format;
+	  if (modifier == 'E')
+	    {
+#if HAVE_STRUCT_ERA_ENTRY
+	      struct era_entry *era = _nl_get_era_entry (tp);
+	      if (era)
+		{
+		  size_t len = strlen (era->name_fmt);
+		  cpy (len, era->name_fmt);
+		  break;
+		}
+#else
+# if HAVE_STRFTIME
+	      goto underlying_strftime;
+# endif
+#endif
+	    }
+
+	  {
+	    int year = tp->tm_year + TM_YEAR_BASE;
+	    DO_NUMBER (1, year / 100 - (year % 100 < 0));
+	  }
+
+	case 'x':
+	  if (modifier == 'O')
+	    goto bad_format;
+#ifdef _NL_CURRENT
+	  if (! (modifier == 'E'
+		 && *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_FMT)) != '\0'))
+	    subfmt = _NL_CURRENT (LC_TIME, D_FMT);
+	  goto subformat;
+#else
+# if HAVE_STRFTIME
+	  goto underlying_strftime;
+# else
+	  /* Fall through.  */
+# endif
+#endif
+	case 'D':		/* POSIX.2 extension.  */
+	  if (modifier != 0)
+	    goto bad_format;
+	  subfmt = "%m/%d/%y";
+	  goto subformat;
+
+	case 'd':
+	  if (modifier == 'E')
+	    goto bad_format;
+
+	  DO_NUMBER (2, tp->tm_mday);
+
+	case 'e':		/* POSIX.2 extension.  */
+	  if (modifier == 'E')
+	    goto bad_format;
+
+	  DO_NUMBER_SPACEPAD (2, tp->tm_mday);
+
+	  /* All numeric formats set DIGITS and NUMBER_VALUE and then
+	     jump to one of these two labels.  */
+
+	do_number_spacepad:
+	  /* Force `_' flag unless overwritten by `0' flag.  */
+	  if (pad != '0')
+	    pad = '_';
+
+	do_number:
+	  /* Format the number according to the MODIFIER flag.  */
+
+	  if (modifier == 'O' && 0 <= number_value)
+	    {
+#ifdef _NL_CURRENT
+	      /* Get the locale specific alternate representation of
+		 the number NUMBER_VALUE.  If none exist NULL is returned.  */
+	      const char *cp = _nl_get_alt_digit (number_value);
+
+	      if (cp != NULL)
+		{
+		  size_t digitlen = strlen (cp);
+		  if (digitlen != 0)
+		    {
+		      cpy (digitlen, cp);
+		      break;
+		    }
+		}
+#else
+# if HAVE_STRFTIME
+	      goto underlying_strftime;
+# endif
+#endif
+	    }
+	  {
+	    unsigned int u = number_value;
+
+	    bufp = buf + sizeof (buf);
+	    negative_number = number_value < 0;
+
+	    if (negative_number)
+	      u = -u;
+
+	    do
+	      *--bufp = u % 10 + '0';
+	    while ((u /= 10) != 0);
+  	  }
+
+	do_number_sign_and_padding:
+	  if (negative_number)
+	    *--bufp = '-';
+
+	  if (pad != '-')
+	    {
+	      int padding = digits - (buf + sizeof (buf) - bufp);
+
+	      if (pad == '_')
+		{
+		  while (0 < padding--)
+		    *--bufp = ' ';
+		}
+	      else
+		{
+		  bufp += negative_number;
+		  while (0 < padding--)
+		    *--bufp = '0';
+		  if (negative_number)
+		    *--bufp = '-';
+		}
+	    }
+
+	  cpy (buf + sizeof (buf) - bufp, bufp);
+	  break;
+
+	case 'F':
+	  if (modifier != 0)
+	    goto bad_format;
+	  subfmt = "%Y-%m-%d";
+	  goto subformat;
+
+	case 'H':
+	  if (modifier == 'E')
+	    goto bad_format;
+
+	  DO_NUMBER (2, tp->tm_hour);
+
+	case 'I':
+	  if (modifier == 'E')
+	    goto bad_format;
+
+	  DO_NUMBER (2, hour12);
+
+	case 'k':		/* GNU extension.  */
+	  if (modifier == 'E')
+	    goto bad_format;
+
+	  DO_NUMBER_SPACEPAD (2, tp->tm_hour);
+
+	case 'l':		/* GNU extension.  */
+	  if (modifier == 'E')
+	    goto bad_format;
+
+	  DO_NUMBER_SPACEPAD (2, hour12);
+
+	case 'j':
+	  if (modifier == 'E')
+	    goto bad_format;
+
+	  DO_NUMBER (3, 1 + tp->tm_yday);
+
+	case 'M':
+	  if (modifier == 'E')
+	    goto bad_format;
+
+	  DO_NUMBER (2, tp->tm_min);
+
+	case 'm':
+	  if (modifier == 'E')
+	    goto bad_format;
+
+	  DO_NUMBER (2, tp->tm_mon + 1);
+
+	case 'n':		/* POSIX.2 extension.  */
+	  add (1, *p = '\n');
+	  break;
+
+	case 'P':
+	  to_lowcase = 1;
+#if !defined _NL_CURRENT && HAVE_STRFTIME
+	  format_char = 'p';
+#endif
+	  /* FALLTHROUGH */
+
+	case 'p':
+	  if (change_case)
+	    {
+	      to_uppcase = 0;
+	      to_lowcase = 1;
+	    }
+#if defined _NL_CURRENT || !HAVE_STRFTIME
+	  cpy (ap_len, ampm);
+	  break;
+#else
+	  goto underlying_strftime;
+#endif
+
+	case 'R':		/* GNU extension.  */
+	  subfmt = "%H:%M";
+	  goto subformat;
+
+	case 'r':		/* POSIX.2 extension.  */
+#ifdef _NL_CURRENT
+	  if (*(subfmt = _NL_CURRENT (LC_TIME, T_FMT_AMPM)) == '\0')
+#endif
+	    subfmt = "%I:%M:%S %p";
+	  goto subformat;
+
+	case 'S':
+	  if (modifier == 'E')
+	    goto bad_format;
+
+	  DO_NUMBER (2, tp->tm_sec);
+
+	case 's':		/* GNU extension.  */
+  	  {
+	    struct tm ltm;
+	    time_t t;
+
+	    ltm = *tp;
+	    t = mktime (&ltm);
+
+	    /* Generate string value for T using time_t arithmetic;
+	       this works even if sizeof (long) < sizeof (time_t).  */
+
+	    bufp = buf + sizeof (buf);
+	    negative_number = t < 0;
+
+	    do
+	      {
+		int d = t % 10;
+		t /= 10;
+
+		if (negative_number)
+		  {
+		    d = -d;
+
+		    /* Adjust if division truncates to minus infinity.  */
+		    if (0 < -1 % 10 && d < 0)
+		      {
+			t++;
+			d += 10;
+		      }
+		  }
+
+		*--bufp = d + '0';
+	      }
+	    while (t != 0);
+
+	    digits = 1;
+	    goto do_number_sign_and_padding;
+	  }
+
+	case 'X':
+	  if (modifier == 'O')
+	    goto bad_format;
+#ifdef _NL_CURRENT
+	  if (! (modifier == 'E'
+		 && *(subfmt = _NL_CURRENT (LC_TIME, ERA_T_FMT)) != '\0'))
+	    subfmt = _NL_CURRENT (LC_TIME, T_FMT);
+	  goto subformat;
+#else
+# if HAVE_STRFTIME
+	  goto underlying_strftime;
+# else
+	  /* Fall through.  */
+# endif
+#endif
+	case 'T':		/* POSIX.2 extension.  */
+	  subfmt = "%H:%M:%S";
+	  goto subformat;
+
+	case 't':		/* POSIX.2 extension.  */
+	  add (1, *p = '\t');
+	  break;
+
+	case 'u':		/* POSIX.2 extension.  */
+	  DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1);
+
+	case 'U':
+	  if (modifier == 'E')
+	    goto bad_format;
+
+	  DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7);
+
+	case 'V':
+	case 'g':		/* GNU extension.  */
+	case 'G':		/* GNU extension.  */
+	  if (modifier == 'E')
+	    goto bad_format;
+	  {
+	    int year = tp->tm_year + TM_YEAR_BASE;
+	    int days = iso_week_days (tp->tm_yday, tp->tm_wday);
+
+	    if (days < 0)
+	      {
+		/* This ISO week belongs to the previous year.  */
+		year--;
+		days = iso_week_days (tp->tm_yday + (365 + __isleap (year)),
+				      tp->tm_wday);
+	      }
+	    else
+	      {
+		int d = iso_week_days (tp->tm_yday - (365 + __isleap (year)),
+				       tp->tm_wday);
+		if (0 <= d)
+		  {
+		    /* This ISO week belongs to the next year.  */
+		    year++;
+		    days = d;
+		  }
+	      }
+
+	    switch (*f)
+	      {
+	      case 'g':
+		DO_NUMBER (2, (year % 100 + 100) % 100);
+
+	      case 'G':
+		DO_NUMBER (1, year);
+
+	      default:
+		DO_NUMBER (2, days / 7 + 1);
+	      }
+	  }
+
+	case 'W':
+	  if (modifier == 'E')
+	    goto bad_format;
+
+	  DO_NUMBER (2, (tp->tm_yday - (tp->tm_wday - 1 + 7) % 7 + 7) / 7);
+
+	case 'w':
+	  if (modifier == 'E')
+	    goto bad_format;
+
+	  DO_NUMBER (1, tp->tm_wday);
+
+	case 'Y':
+	  if (modifier == 'E')
+	    {
+#if HAVE_STRUCT_ERA_ENTRY
+	      struct era_entry *era = _nl_get_era_entry (tp);
+	      if (era)
+		{
+		  subfmt = strchr (era->name_fmt, '\0') + 1;
+		  goto subformat;
+		}
+#else
+# if HAVE_STRFTIME
+	      goto underlying_strftime;
+# endif
+#endif
+	    }
+	  if (modifier == 'O')
+	    goto bad_format;
+	  else
+	    DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+	case 'y':
+	  if (modifier == 'E')
+	    {
+#if HAVE_STRUCT_ERA_ENTRY
+	      struct era_entry *era = _nl_get_era_entry (tp);
+	      if (era)
+		{
+		  int delta = tp->tm_year - era->start_date[0];
+		  DO_NUMBER (1, (era->offset
+				 + (era->direction == '-' ? -delta : delta)));
+		}
+#else
+# if HAVE_STRFTIME
+	      goto underlying_strftime;
+# endif
+#endif
+	    }
+	  DO_NUMBER (2, (tp->tm_year % 100 + 100) % 100);
+
+	case 'Z':
+	  if (change_case)
+	    {
+	      to_uppcase = 0;
+	      to_lowcase = 1;
+	    }
+
+#if HAVE_TZNAME
+	  /* The tzset() call might have changed the value.  */
+	  if (!(zone && *zone) && tp->tm_isdst >= 0)
+	    zone = tzname[tp->tm_isdst];
+#endif
+	  if (! zone)
+	    zone = "";		/* POSIX.2 requires the empty string here.  */
+
+	  cpy (strlen (zone), zone);
+	  break;
+
+	case 'z':		/* GNU extension.  */
+	  if (tp->tm_isdst < 0)
+	    break;
+
+	  {
+	    int diff;
+#if HAVE_TM_GMTOFF
+	    diff = tp->tm_gmtoff;
+#else
+	    if (ut)
+	      diff = 0;
+	    else
+	      {
+		struct tm gtm;
+		struct tm ltm;
+		time_t lt;
+
+		ltm = *tp;
+		lt = mktime (&ltm);
+
+		if (lt == (time_t) -1)
+		  {
+		    /* mktime returns -1 for errors, but -1 is also a
+		       valid time_t value.  Check whether an error really
+		       occurred.  */
+		    struct tm tm;
+
+		    if (! my_strftime_localtime_r (&lt, &tm)
+			|| ((ltm.tm_sec ^ tm.tm_sec)
+			    | (ltm.tm_min ^ tm.tm_min)
+			    | (ltm.tm_hour ^ tm.tm_hour)
+			    | (ltm.tm_mday ^ tm.tm_mday)
+			    | (ltm.tm_mon ^ tm.tm_mon)
+			    | (ltm.tm_year ^ tm.tm_year)))
+		      break;
+		  }
+
+		if (! my_strftime_gmtime_r (&lt, &gtm))
+		  break;
+
+		diff = tm_diff (&ltm, &gtm);
+	      }
+#endif
+
+	    if (diff < 0)
+	      {
+		add (1, *p = '-');
+		diff = -diff;
+	      }
+	    else
+	      add (1, *p = '+');
+
+	    diff /= 60;
+	    DO_NUMBER (4, (diff / 60) * 100 + diff % 60);
+	  }
+
+	case '\0':		/* GNU extension: % at end of format.  */
+	    --f;
+	    /* Fall through.  */
+	default:
+	  /* Unknown format; output the format, including the '%',
+	     since this is most likely the right thing to do if a
+	     multibyte string has been misparsed.  */
+	bad_format:
+	  {
+	    int flen;
+	    for (flen = 1; f[1 - flen] != '%'; flen++)
+	      continue;
+	    cpy (flen, &f[1 - flen]);
+	  }
+	  break;
+	}
+    }
+
+  if (p && maxsize != 0)
+    *p = '\0';
+  return i;
+}
+
+
+#ifdef emacs
+/* For Emacs we have a separate interface which corresponds to the normal
+   strftime function and does not have the extra information whether the
+   TP arguments comes from a `gmtime' call or not.  */
+size_t
+emacs_strftime (s, maxsize, format, tp)
+      char *s;
+      size_t maxsize;
+      const char *format;
+      const struct tm *tp;
+{
+  return my_strftime (s, maxsize, format, tp, 0);
+}
+#endif
Index: eggdrop1.7/src/compat/strftime.h
diff -u eggdrop1.7/src/compat/strftime.h:1.1 eggdrop1.7/src/compat/strftime.h:1.2
--- eggdrop1.7/src/compat/strftime.h:1.1	Tue Sep 12 10:34:01 2000
+++ eggdrop1.7/src/compat/strftime.h	Thu Oct 18 20:55:06 2001
@@ -1,42 +1,39 @@
 /*
  * strftime.h
- *   header file for strftime.c
+ *   prototypes for strftime.c
  *
- * $Id: strftime.h,v 1.1 2000/09/12 15:34:01 fabian Exp $
+ * $Id: strftime.h,v 1.2 2001/10/19 01:55:06 tothwolf Exp $
  */
-/* 
- * Copyright (C) 2000  Eggheads
- * Written by Fabian Knittel
- * 
+/*
+ * Copyright (C) 2000, 2001 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.
  */
+#ifndef _EGG_STRFTIME_H
+#define _EGG_STRFTIME_H
 
-#ifndef _EGG_COMPAT_STRFTIME_H_
-#define _EGG_COMPAT_STRFTIME_H_
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "src/main.h"
+#include <stdio.h>
 #include <time.h>
 
-/* Use the system libraries version of strftime() if available. Otherwise
- * use our own.
- */
 #ifndef HAVE_STRFTIME
-size_t egg_strftime(char *s, size_t maxsize, const char *format,
-		    const struct tm *tp);
-#else
-#  define egg_strftime	strftime
+size_t strftime(char *s, size_t maxsize, const char *format,
+		const struct tm *tp);
 #endif
 
-#endif	/* !_EGG_COMPAT_STRFTIME_H_ */
+#endif			/* !_EGG_STRFTIME_H */
Index: eggdrop1.7/src/compat/strncasecmp.c
diff -u /dev/null eggdrop1.7/src/compat/strncasecmp.c:1.1
--- /dev/null	Thu Oct 18 20:55:20 2001
+++ eggdrop1.7/src/compat/strncasecmp.c	Thu Oct 18 20:55:06 2001
@@ -0,0 +1,38 @@
+/*
+ * strcasecmp.c
+ *   provides strncasecmp()
+ *
+ * $Id: strncasecmp.c,v 1.1 2001/10/19 01:55:06 tothwolf Exp $
+ */
+/*
+ * Copyright (C) 1997 Robey Pointer
+ * Copyright (C) 1999, 2000, 2001 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.
+ */
+
+#include <stdio.h>
+#include <ctype.h>
+
+int strncasecmp(const char *s1, const char *s2, size_t n)
+{
+  if (!n)
+    return 0;
+  while (--n && (*s1) && (*s2) && (toupper(*s1) == toupper(*s2))) {
+    s1++;
+    s2++;
+  }
+  return toupper(*s1) - toupper(*s2);
+}
Index: eggdrop1.7/src/compat/strncasecmp.h
diff -u /dev/null eggdrop1.7/src/compat/strncasecmp.h:1.1
--- /dev/null	Thu Oct 18 20:55:20 2001
+++ eggdrop1.7/src/compat/strncasecmp.h	Thu Oct 18 20:55:06 2001
@@ -0,0 +1,37 @@
+/*
+ * strncasecmp.h
+ *   prototypes for strncasecmp.c
+ *
+ * $Id: strncasecmp.h,v 1.1 2001/10/19 01:55:06 tothwolf Exp $
+ */
+/*
+ * Copyright (C) 2000, 2001 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.
+ */
+#ifndef _EGG_STRNCASECMP_H
+#define _EGG_STRNCASECMP_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+
+#ifndef HAVE_STRNCASECMP
+int strncasecmp(const char *, const char *, size_t);
+#endif
+
+#endif				/* !_EGG_STRNCASECMP_H */
Index: eggdrop1.7/src/dcc.c
diff -u eggdrop1.7/src/dcc.c:1.59 eggdrop1.7/src/dcc.c:1.60
--- eggdrop1.7/src/dcc.c:1.59	Fri Oct 12 10:50:26 2001
+++ eggdrop1.7/src/dcc.c	Thu Oct 18 20:55:05 2001
@@ -4,7 +4,7 @@
  *   disconnect on a dcc socket
  *   ...and that's it!  (but it's a LOT)
  *
- * $Id: dcc.c,v 1.59 2001/10/12 15:50:26 tothwolf Exp $
+ * $Id: dcc.c,v 1.60 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -204,7 +204,7 @@
   addbot(dcc[idx].nick, dcc[idx].nick, botnetnick, '-',
 	 dcc[idx].u.bot->numver);
   check_tcl_link(dcc[idx].nick, botnetnick);
-  egg_snprintf(x, sizeof x, "v %d", dcc[idx].u.bot->numver);
+  snprintf(x, sizeof x, "v %d", dcc[idx].u.bot->numver);
   bot_share(idx, x);
   dprintf(idx, "el\n");
 }
@@ -215,7 +215,7 @@
 
   if (dcc[idx].port >= dcc[idx].u.bot->port + 3) {
     if (dcc[idx].u.bot->linker[0]) {
-      egg_snprintf(s, sizeof s, "Couldn't link to %s.", dcc[idx].nick);
+      snprintf(s, sizeof s, "Couldn't link to %s.", dcc[idx].nick);
       strcpy(s1, dcc[idx].u.bot->linker);
       add_note(s1, botnetnick, s, -2, 0);
     }
@@ -264,7 +264,7 @@
       if (i > 0) {
 	bots = bots_in_subtree(findbot(dcc[idx].nick));
 	users = users_in_subtree(findbot(dcc[idx].nick));
-	egg_snprintf(x, sizeof x,
+	snprintf(x, sizeof x,
 		      "Unlinked %s (restructure) (lost %d bot%s and %d user%s)",
 		      dcc[i].nick, bots, (bots != 1) ? "s" : "",
 		      users, (users != 1) ? "s" : "");
@@ -316,14 +316,14 @@
 
   strip_telnet(dcc[idx].sock, buf, &x);
   code = newsplit(&buf);
-  if (!egg_strcasecmp(code, "*hello!")) {
+  if (!strcasecmp(code, "*hello!")) {
     greet_new_bot(idx);
-  } else if (!egg_strcasecmp(code, "version") || !egg_strcasecmp(code, "v")) {
+  } else if (!strcasecmp(code, "version") || !strcasecmp(code, "v")) {
     bot_version(idx, buf);
-  } else if (!egg_strcasecmp(code, "badpass")) {
+  } else if (!strcasecmp(code, "badpass")) {
     /* We entered the wrong password */
     putlog(LOG_BOTS, "*", _("Bad password on connect attempt to %s."), dcc[idx].nick);
-  } else if (!egg_strcasecmp(code, "passreq")) {
+  } else if (!strcasecmp(code, "passreq")) {
     char *pass = get_user(&USERENTRY_PASS, u);
 
     if (!pass || !strcmp(pass, "-")) {
@@ -339,7 +339,7 @@
         dprintf(idx, "%s\n", pass);
       }
     }
-  } else if (!egg_strcasecmp(code, "error")) {
+  } else if (!strcasecmp(code, "error")) {
     putlog(LOG_BOTS, "*", _("ERROR linking %s: %s"), dcc[idx].nick, buf);
   }
   /* Ignore otherwise */
@@ -409,7 +409,7 @@
   } else
     msg = "";
   for (f = i = 0; C_bot[i].name && !f; i++) {
-    int y = egg_strcasecmp(code, C_bot[i].name);
+    int y = strcasecmp(code, C_bot[i].name);
 
     if (!y) {
       /* Found a match */
@@ -427,7 +427,7 @@
 
   bots = bots_in_subtree(findbot(dcc[idx].nick));
   users = users_in_subtree(findbot(dcc[idx].nick));
-  egg_snprintf(x, sizeof x,
+  snprintf(x, sizeof x,
 	       "Lost bot: %s (lost %d bot%s and %d user%s)",
   		 dcc[idx].nick, bots, (bots != 1) ? "s" : "", users,
 		 (users != 1) ? "s" : "");
@@ -503,7 +503,7 @@
 
   MD5_Init(&md5context);
 
-  egg_snprintf(digest_string, 33, "<%x%x@", getpid(),
+  snprintf(digest_string, 33, "<%x%x@", getpid(),
 	       (unsigned int) dcc[idx].timeval);
   MD5_Update(&md5context, (unsigned char *) digest_string,
 	    strlen(digest_string));
@@ -531,7 +531,7 @@
   atr = dcc[idx].user ? dcc[idx].user->flags : 0;
 
   /* Check for MD5 digest from remote _bot_. <cybah> */
-  if ((atr & USER_BOT) && !egg_strncasecmp(buf, "digest ", 7)) {
+  if ((atr & USER_BOT) && !strncasecmp(buf, "digest ", 7)) {
     if(dcc_bot_check_digest(idx, buf+7)) {
       free(dcc[idx].u.chat);
       dcc[idx].type = &DCC_BOT_NEW;
@@ -974,7 +974,7 @@
   get_user_flagrec(get_user_by_host(floodhost), &fr, NULL);
   if (!flood_telnet_thr || (glob_friend(fr) && !par_telnet_flood))
     return 0;			/* No flood protection */
-  if (egg_strcasecmp(lasttelnethost, floodhost)) {	/* New... */
+  if (strcasecmp(lasttelnethost, floodhost)) {	/* New... */
     strcpy(lasttelnethost, floodhost);
     lasttelnettime = now;
     lasttelnets = 0;
@@ -1185,7 +1185,7 @@
 
   /* Still duplicate? */
   if (in_chain(dcc[idx].nick)) {
-    egg_snprintf(x, sizeof x, "%s!%s", dcc[idx].nick, dcc[idx].host);
+    snprintf(x, sizeof x, "%s!%s", dcc[idx].nick, dcc[idx].host);
     dprintf(idx, "error Already connected.\n");
     putlog(LOG_BOTS, "*", _("Refused telnet connection from %s (duplicate)"), x);
     killsock(dcc[idx].sock);
@@ -1236,7 +1236,7 @@
   assert(who);
   for (idx = 0; idx < dcc_total; idx++)
     if ((dcc[idx].type == &DCC_DUPWAIT) &&
-	!egg_strcasecmp(dcc[idx].nick, who)) {
+	!strcasecmp(dcc[idx].nick, who)) {
       dcc_telnet_pass(idx, dcc[idx].u.dupwait->atr);
       break;
     }
@@ -1275,7 +1275,7 @@
     return;
   }
   dcc[idx].status &= ~(STAT_BOTONLY | STAT_USRONLY);
-  if ((!egg_strcasecmp(buf, "NEW")) &&
+  if ((!strcasecmp(buf, "NEW")) &&
       ((allow_new_telnets) || (make_userfile))) {
     dcc[idx].type = &DCC_TELNET_NEW;
     dcc[idx].timeval = now;
@@ -1307,7 +1307,7 @@
   correct_handle(buf);
   strcpy(dcc[idx].nick, buf);
   if (glob_bot(fr)) {
-    if (!egg_strcasecmp(botnetnick, dcc[idx].nick)) {
+    if (!strcasecmp(botnetnick, dcc[idx].nick)) {
       dprintf(idx, "error You cannot link using my botnetnick.\n");
       putlog(LOG_BOTS, "*", _("Refused telnet connection from %s (tried using my botnetnick)"), dcc[idx].host);
       killsock(dcc[idx].sock);
@@ -1473,7 +1473,7 @@
     dprintf(idx, "\nSorry, that nickname is taken already.\n");
     dprintf(idx, "Try another one please:\n");
     return;
-  } else if (!egg_strcasecmp(buf, botnetnick)) {
+  } else if (!strcasecmp(buf, botnetnick)) {
     dprintf(idx, "Sorry, can't use my name for a nick.\n");
   } else {
     if (make_userfile)
@@ -1916,7 +1916,7 @@
     return;
   }
   strncpyz(dcc[i].host, host, UHOSTLEN);
-  egg_snprintf(x, sizeof x, "-telnet!%s", dcc[i].host);
+  snprintf(x, sizeof x, "-telnet!%s", dcc[i].host);
   if (protect_telnet && !make_userfile) {
     struct userrec *u;
     int ok = 1;
Index: eggdrop1.7/src/dccutil.c
diff -u eggdrop1.7/src/dccutil.c:1.38 eggdrop1.7/src/dccutil.c:1.39
--- eggdrop1.7/src/dccutil.c:1.38	Thu Oct 11 06:34:19 2001
+++ eggdrop1.7/src/dccutil.c	Thu Oct 18 20:55:05 2001
@@ -6,7 +6,7 @@
  *   memory management for dcc structures
  *   timeout checking for dcc connections
  *
- * $Id: dccutil.c,v 1.38 2001/10/11 11:34:19 tothwolf Exp $
+ * $Id: dccutil.c,v 1.39 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -96,7 +96,7 @@
 
   idx = EGG_VARARGS_START(int, arg1, va);
   format = va_arg(va, char *);
-  egg_vsnprintf(buf, 1023, format, va);
+  vsnprintf(buf, 1023, format, va);
   va_end(va);
   /* We can not use the return value vsnprintf() to determine where
    * to null terminate. The C99 standard specifies that vsnprintf()
@@ -161,7 +161,7 @@
   va_list va;
 
   format = EGG_VARARGS_START(char *, arg1, va);
-  egg_vsnprintf(s, 511, format, va);
+  vsnprintf(s, 511, format, va);
   va_end(va);
   len = strlen(s);
   if (len > 511)
@@ -187,7 +187,7 @@
   x = EGG_VARARGS_START(int, arg1, va);
   chan = va_arg(va, int);
   format = va_arg(va, char *);
-  egg_vsnprintf(s, 511, format, va);
+  vsnprintf(s, 511, format, va);
   va_end(va);
   len = strlen(s);
   if (len > 511)
@@ -460,7 +460,7 @@
 	  (chat->channel >= 0)) {
 	char x[1024];
 
-	egg_snprintf(x, sizeof x, _("%s has been forcibly removed for flooding.\n"), dcc[idx].nick);
+	snprintf(x, sizeof x, _("%s has been forcibly removed for flooding.\n"), dcc[idx].nick);
 	chanout_but(idx, chat->channel, "*** %s", x);
 	if (chat->channel < 100000)
 	  botnet_send_part_idx(idx, x);
@@ -495,7 +495,7 @@
       (dcc[idx].u.chat->channel >= 0)) {
     char x[1024];
 
-    egg_snprintf(x, sizeof x, _("%s booted %s from the party line%s%s\n"), by, dcc[idx].nick,
+    snprintf(x, sizeof x, _("%s booted %s from the party line%s%s\n"), by, dcc[idx].nick,
 		 reason[0] ? ": " : "", reason);
     chanout_but(idx, dcc[idx].u.chat->channel, "*** %s.\n", x);
     if (dcc[idx].u.chat->channel < 100000)
Index: eggdrop1.7/src/dns.c
diff -u eggdrop1.7/src/dns.c:1.28 eggdrop1.7/src/dns.c:1.29
--- eggdrop1.7/src/dns.c:1.28	Tue Oct 16 22:28:16 2001
+++ eggdrop1.7/src/dns.c	Thu Oct 18 20:55:05 2001
@@ -4,7 +4,7 @@
  *   provides the code used by the bot if the DNS module is not loaded
  *   DNS script commands
  *
- * $Id: dns.c,v 1.28 2001/10/17 03:28:16 stdarg Exp $
+ * $Id: dns.c,v 1.29 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Written by Fabian Knittel <fknittel at gmx.de>
@@ -125,7 +125,7 @@
   for (idx = 0; idx < dcc_total; idx++) {
     if ((dcc[idx].type == &DCC_DNSWAIT) &&
         (dcc[idx].u.dns->dns_type == RES_HOSTBYIP) &&
-        (!egg_strcasecmp(dcc[idx].u.dns->host, ip))) {
+        (!strcasecmp(dcc[idx].u.dns->host, ip))) {
 debug3("|DNS| idx: %d, dcchostbyip: %s is %s", idx, ip, hostn);
       free(dcc[idx].u.dns->host);
       dcc[idx].u.dns->host = calloc(1, strlen(hostn) + 1);
@@ -148,7 +148,7 @@
   for (idx = 0; idx < dcc_total; idx++) {
     if ((dcc[idx].type == &DCC_DNSWAIT) &&
         (dcc[idx].u.dns->dns_type == RES_IPBYHOST) &&
-        !egg_strcasecmp(dcc[idx].u.dns->host, hostn)) {
+        !strcasecmp(dcc[idx].u.dns->host, hostn)) {
 debug3("|DNS| idx: %d, dccipbyhost: %s is %s", idx, ip, hostn);
       free(dcc[idx].u.dns->host);
       dcc[idx].u.dns->host = calloc(1, strlen(ip) + 1);
@@ -179,7 +179,7 @@
     if (de->type && (de->type == &DNS_DCCEVENT_IPBYHOST) &&
 	(de->lookup == RES_IPBYHOST)) {
       if (de->hostname &&
-	  !egg_strcasecmp(de->hostname, hostn))
+	  !strcasecmp(de->hostname, hostn))
 	/* No need to add anymore. */
 	return;
     }
@@ -206,7 +206,7 @@
   for (de = dns_events; de; de = de->next) {
     if (de->type && (de->type == &DNS_DCCEVENT_HOSTBYIP) &&
 	(de->lookup == RES_HOSTBYIP)) {
-      if (!egg_strcasecmp(de->hostname, ip))
+      if (!strcasecmp(de->hostname, ip))
 	/* No need to add anymore. */
 	return;
     }
@@ -302,7 +302,7 @@
     nde = de->next;
     if ((de->lookup == RES_HOSTBYIP) &&
 	(!de->hostname || !(de->hostname[0]) ||
-	(!egg_strcasecmp(de->hostname, ip)))) {
+	(!strcasecmp(de->hostname, ip)))) {
       /* Remove the event from the list here, to avoid conflicts if one of
        * the event handlers re-adds another event. */
       if (ode)
@@ -333,7 +333,7 @@
     nde = de->next;
     if ((de->lookup == RES_IPBYHOST) &&
 	(!de->hostname || !(de->hostname[0]) ||
-	 !egg_strcasecmp(de->hostname, hostn))) {
+	 !strcasecmp(de->hostname, hostn))) {
       /* Remove the event from the list here, to avoid conflicts if one of
        * the event handlers re-adds another event. */
       if (ode)
@@ -373,10 +373,10 @@
 
   if (!setjmp(alarmret)) {
     alarm(resolve_timeout);
-    if (egg_inet_aton(ip, &addr))
+    if (inet_aton(ip, &addr))
 	hp = gethostbyaddr((char *) &addr, sizeof addr, AF_INET);
 #ifdef IPV6
-    else if (egg_inet_pton(AF_INET6, ip, &addr6))
+    else if (inet_pton(AF_INET6, ip, &addr6))
 	hp = gethostbyaddr((char *) &addr6, sizeof addr6, AF_INET6);
 #endif
     else
@@ -402,13 +402,13 @@
 
   /* Check if someone passed us an IPv4 address as hostname
    * and return it straight away */
-  if (egg_inet_aton(host, &inaddr)) {
+  if (inet_aton(host, &inaddr)) {
     call_ipbyhost(host, host, 1);
     return;
   }
 #ifdef IPV6
   /* Check if someone passed us an IPv6 address as hostname... */
-  if (egg_inet_pton(AF_INET6, host, &in6addr)) {
+  if (inet_pton(AF_INET6, host, &in6addr)) {
     call_ipbyhost(host, host, 1);
     return;
   }
@@ -418,11 +418,11 @@
     char *p;
     int type;
 
-    if (!egg_strncasecmp("ipv6%", host, 5)) {
+    if (!strncasecmp("ipv6%", host, 5)) {
 	type = AF_INET6;
 	p = host + 5;
 debug1("|DNS| checking only AAAA record for %s", p);
-    } else if (!egg_strncasecmp("ipv4%", host, 5)) {
+    } else if (!strncasecmp("ipv4%", host, 5)) {
 	type = AF_INET;
 	p = host + 5;
 debug1("|DNS| checking only A record for %s", p);
@@ -443,7 +443,7 @@
 
     if (hp) {
       char tmp[ADDRLEN];
-      egg_inet_ntop(hp->h_addrtype, hp->h_addr_list[0], tmp, ADDRLEN-1);
+      inet_ntop(hp->h_addrtype, hp->h_addr_list[0], tmp, ADDRLEN-1);
       call_ipbyhost(host, tmp, 1);
       return;
     }
@@ -466,9 +466,9 @@
   struct in6_addr inaddr6;
 #endif
 
-  if (egg_inet_aton(iporhost, &inaddr)
+  if (inet_aton(iporhost, &inaddr)
 #ifdef IPV6
-	|| egg_inet_pton(AF_INET6, iporhost, &inaddr6)
+	|| inet_pton(AF_INET6, iporhost, &inaddr6)
 #endif
       )
     script_dnshostbyip(iporhost, callback);
@@ -492,7 +492,7 @@
 #endif
     char *origname;
 
-    if (egg_inet_pton(AF_INET, ip, &in.sin_addr)) {
+    if (inet_pton(AF_INET, ip, &in.sin_addr)) {
 debug1("|DNS| adns_dns_hostbyip(\"%s\") (IPv4)", ip);
 	malloc_strcpy(origname, ip);
 	in.sin_family = AF_INET;
@@ -504,7 +504,7 @@
 	    call_hostbyip(ip, ip, 0);
 	}
 #ifdef IPV6
-    } else if (egg_inet_pton(AF_INET6, ip, &in6.sin6_addr)) {
+    } else if (inet_pton(AF_INET6, ip, &in6.sin6_addr)) {
 debug1("|DNS| adns_dns_hostbyip(\"%s\") (IPv6)", ip);
 	malloc_strcpy(origname, ip);
 	in6.sin6_family = AF_INET6;
@@ -532,9 +532,9 @@
     
 debug1("|DNS| adns_dns_ipbyhost(\"%s\");", host);
 
-    if (egg_inet_pton(AF_INET, host, &in.sin_addr)
+    if (inet_pton(AF_INET, host, &in.sin_addr)
 #ifdef IPV6
-	|| egg_inet_pton(AF_INET6, host, &in6.sin6_addr)
+	|| inet_pton(AF_INET6, host, &in6.sin6_addr)
 #endif
 	) {
 	/* It's an IP! */
@@ -544,7 +544,7 @@
 	char *origname;
 	int type, r;
 	malloc_strcpy(origname, host);
-	if (!egg_strncasecmp("ipv6%", host, 5)) {
+	if (!strncasecmp("ipv6%", host, 5)) {
 #ifdef IPV6
 	    type = adns_r_addr6;
 	    p = host + 5;
@@ -554,7 +554,7 @@
 	    call_ipbyhost(host, "0.0.0.0", 0);
 	    return;
 #endif
-	} else if (!egg_strncasecmp("ipv4%", host, 5)) {
+	} else if (!strncasecmp("ipv4%", host, 5)) {
 	    type = adns_r_addr;
 	    p = host + 5;
 debug1("|DNS| checking only A record for %s", p);
Index: eggdrop1.7/src/eggdrop.h
diff -u eggdrop1.7/src/eggdrop.h:1.47 eggdrop1.7/src/eggdrop.h:1.48
--- eggdrop1.7/src/eggdrop.h:1.47	Thu Oct 18 04:06:43 2001
+++ eggdrop1.7/src/eggdrop.h	Thu Oct 18 20:55:05 2001
@@ -4,7 +4,7 @@
  *
  *   IF YOU ALTER THIS FILE, YOU NEED TO RECOMPILE THE BOT.
  *
- * $Id: eggdrop.h,v 1.47 2001/10/18 09:06:43 stdarg Exp $
+ * $Id: eggdrop.h,v 1.48 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -184,22 +184,23 @@
 #  define ContextNote(note)	{}
 #endif
 
-/* 32 bit type */
-#if (SIZEOF_INT == 4)
-typedef unsigned int		u_32bit_t;
+/* 32 bit type
+ */
+#ifdef UNSIGNED_LONG32
+typedef unsigned long  u_32int_t;
 #else
-#  if (SIZEOF_LONG == 4)
-typedef unsigned long		u_32bit_t;
-#  else
-#    include "cant/find/32bit/type"
-#  endif
+# ifdef UNSIGNED_INT32
+typedef unsigned int   u_32int_t;
+# else
+typedef unsigned long  u_32int_t;
+# endif
 #endif
 
 typedef unsigned short int	u_16bit_t;
 typedef unsigned char		u_8bit_t;
 
 /* IP type */
-typedef u_32bit_t		IP;
+typedef u_32int_t		IP;
 
 #define debug0(x)		putlog(LOG_DEBUG,"*",x)
 #define debug1(x,a1)		putlog(LOG_DEBUG,"*",x,a1)
Index: eggdrop1.7/src/logfile.c
diff -u eggdrop1.7/src/logfile.c:1.3 eggdrop1.7/src/logfile.c:1.4
--- eggdrop1.7/src/logfile.c:1.3	Thu Oct 18 06:18:44 2001
+++ eggdrop1.7/src/logfile.c	Thu Oct 18 20:55:05 2001
@@ -87,7 +87,7 @@
 
 	now = time(NULL);
 	/* Calculate timestamp. */
-	if (timestamp_logs) egg_strftime(t, 32, "[%H:%M] ", localtime(&now));
+	if (timestamp_logs) strftime(t, 32, "[%H:%M] ", localtime(&now));
 	else *t = 0;
 }
 
@@ -136,7 +136,7 @@
 		time_t now;
 
 		now = time(NULL);
-		egg_strftime(suffix, 32, logfile_suffix, localtime(&now));
+		strftime(suffix, 32, logfile_suffix, localtime(&now));
 	}
 
 	prev = NULL;
@@ -259,7 +259,7 @@
 		if (chname[0] != '*' && log->chname[0] != '*' && irccmp(chname, log->chname)) continue;
 
 		/* If it's a repeat message, don't write it again. */
-		if (!egg_strcasecmp(out, log->last_msg)) {
+		if (!strcasecmp(out, log->last_msg)) {
 			log->repeats++;
 			continue;
 		}
Index: eggdrop1.7/src/main.c
diff -u eggdrop1.7/src/main.c:1.90 eggdrop1.7/src/main.c:1.91
--- eggdrop1.7/src/main.c:1.90	Thu Oct 18 04:06:43 2001
+++ eggdrop1.7/src/main.c	Thu Oct 18 20:55:05 2001
@@ -5,7 +5,7 @@
  *   command line arguments
  *   context and assert debugging
  *
- * $Id: main.c,v 1.90 2001/10/18 09:06:43 stdarg Exp $
+ * $Id: main.c,v 1.91 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -383,7 +383,7 @@
   if (!module) {
     strncpyz(x, p ? p + 1 : file, sizeof x);
   } else
-    egg_snprintf(x, 31, "%s:%s", module, p ? p + 1 : file);
+    snprintf(x, 31, "%s:%s", module, p ? p + 1 : file);
   cx_ptr = ((cx_ptr + 1) & 15);
   strcpy(cx_file[cx_ptr], x);
   cx_line[cx_ptr] = line;
@@ -401,7 +401,7 @@
   if (!module) {
     strncpyz(x, p ? p + 1 : file, sizeof x);
   } else
-    egg_snprintf(x, 31, "%s:%s", module, p ? p + 1 : file);
+    snprintf(x, 31, "%s:%s", module, p ? p + 1 : file);
   cx_ptr = ((cx_ptr + 1) & 15);
   strcpy(cx_file[cx_ptr], x);
   cx_line[cx_ptr] = line;
@@ -465,7 +465,7 @@
   char s[125];
 
   putlog(LOG_MISC, "*", _("Backing up user file..."));
-  egg_snprintf(s, sizeof s, "%s~bak", userfile);
+  snprintf(s, sizeof s, "%s~bak", userfile);
   copyfile(userfile, s);
 }
 
@@ -653,8 +653,8 @@
   
 #include "patch.h"
   /* Version info! */
-  egg_snprintf(ver, sizeof ver, "eggdrop v%s", egg_version);
-  egg_snprintf(version, sizeof version, "Eggdrop v%s (C)1997 Robey Pointer (C)2001 Eggheads",
+  snprintf(ver, sizeof ver, "eggdrop v%s", egg_version);
+  snprintf(version, sizeof version, "Eggdrop v%s (C)1997 Robey Pointer (C)2001 Eggheads",
 	       egg_version);
   /* Now add on the patchlevel (for Tcl) */
   sprintf(&egg_version[strlen(egg_version)], " %u", egg_numver);
@@ -748,7 +748,7 @@
 	 botnetnick, i, count_users(userlist));
   cache_miss = 0;
   cache_hit = 0;
-  egg_snprintf(pid_file, sizeof pid_file, "pid.%s", botnetnick);
+  snprintf(pid_file, sizeof pid_file, "pid.%s", botnetnick);
 
   /* Check for pre-existing eggdrop! */
   f = fopen(pid_file, "r");
Index: eggdrop1.7/src/misc.c
diff -u eggdrop1.7/src/misc.c:1.50 eggdrop1.7/src/misc.c:1.51
--- eggdrop1.7/src/misc.c:1.50	Thu Oct 18 04:06:43 2001
+++ eggdrop1.7/src/misc.c	Thu Oct 18 20:55:05 2001
@@ -6,7 +6,7 @@
  *   help system
  *   motd display and %var substitution
  *
- * $Id: misc.c,v 1.50 2001/10/18 09:06:43 stdarg Exp $
+ * $Id: misc.c,v 1.51 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -412,7 +412,7 @@
     sprintf(out, "%d day%s ago", days, (days == 1) ? "" : "s");
     return;
   }
-  egg_strftime(out, 6, "%H:%M", localtime(&then));
+  strftime(out, 6, "%H:%M", localtime(&then));
 }
 
 /* Convert an interval (in seconds) to one of:
@@ -426,7 +426,7 @@
     sprintf(out, "in %d day%s", days, (days == 1) ? "" : "s");
     return;
   }
-  egg_strftime(out, 9, "at %H:%M", localtime(&now));
+  strftime(out, 9, "at %H:%M", localtime(&now));
 }
 
 /* Convert an interval (in seconds) to one of:
@@ -624,7 +624,7 @@
     case 'U':
 #ifdef HAVE_UNAME
       if (!uname(&uname_info)) {
-	egg_snprintf(sub, sizeof sub, "%s %s", uname_info.sysname,
+	snprintf(sub, sizeof sub, "%s %s", uname_info.sysname,
 		       uname_info.release);
 	towrite = sub;
       } else
@@ -644,7 +644,7 @@
       towrite = admin;
       break;
     case 'T':
-      egg_strftime(sub, 6, "%H:%M", localtime(&now));
+      strftime(sub, 6, "%H:%M", localtime(&now));
       towrite = sub;
       break;
     case 'N':
@@ -681,7 +681,7 @@
 	q += 2;
 	/* Now q is the string and p is where the rest of the fcn expects */
 	if (!strncmp(q, "help=", 5)) {
-	  if (topic && egg_strcasecmp(q + 5, topic))
+	  if (topic && strcasecmp(q + 5, topic))
 	    blind |= 2;
 	  else
 	    blind &= ~2;
@@ -697,7 +697,7 @@
 	      blind &= ~1;
 	  } else if (q[0] == '-') {
 	    blind &= ~1;
-	  } else if (!egg_strcasecmp(q, "end")) {
+	  } else if (!strcasecmp(q, "end")) {
 	    blind &= ~1;
 	    subwidth = 70;
 	    if (cols) {
@@ -707,7 +707,7 @@
 	      cols = 0;
 	      towrite = sub;
 	    }
-	  } else if (!egg_strcasecmp(q, "center"))
+	  } else if (!strcasecmp(q, "center"))
 	    center = 1;
 	  else if (!strncmp(q, "cols=", 5)) {
 	    char *r;
@@ -821,11 +821,11 @@
   current->next = help_list;
   current->first = NULL;
   help_list = current;
-  egg_snprintf(s, sizeof s, "%smsg/%s", helpdir, file);
+  snprintf(s, sizeof s, "%smsg/%s", helpdir, file);
   scan_help_file(current, s, 0);
-  egg_snprintf(s, sizeof s, "%s%s", helpdir, file);
+  snprintf(s, sizeof s, "%s%s", helpdir, file);
   scan_help_file(current, s, 1);
-  egg_snprintf(s, sizeof s, "%sset/%s", helpdir, file);
+  snprintf(s, sizeof s, "%sset/%s", helpdir, file);
   scan_help_file(current, s, 2);
 }
 
@@ -900,14 +900,14 @@
       for (item = current->first; item; item = item->next)
 	if (!strcmp(item->name, file)) {
 	  if (!item->type && !dcc) {
-	    egg_snprintf(s, sizeof s, "%smsg/%s", helpdir, current->name);
+	    snprintf(s, sizeof s, "%smsg/%s", helpdir, current->name);
 	    if ((f = fopen(s, "r")))
 	      return f;
 	  } else if (dcc && item->type) {
 	    if (item->type == 1)
-	      egg_snprintf(s, sizeof s, "%s%s", helpdir, current->name);
+	      snprintf(s, sizeof s, "%s%s", helpdir, current->name);
 	    else
-	      egg_snprintf(s, sizeof s, "%sset/%s", helpdir, current->name);
+	      snprintf(s, sizeof s, "%sset/%s", helpdir, current->name);
 	    if ((f = fopen(s, "r")))
 	      return f;
 	  }
@@ -1004,9 +1004,9 @@
     for (item = current->first; item; item = item->next)
       if (wild_match(match, item->name) && item->type) {
 	if (item->type == 1)
-	  egg_snprintf(s, sizeof s, "%s%s", helpdir, current->name);
+	  snprintf(s, sizeof s, "%s%s", helpdir, current->name);
 	else
-	  egg_snprintf(s, sizeof s, "%sset/%s", helpdir, current->name);
+	  snprintf(s, sizeof s, "%sset/%s", helpdir, current->name);
 	if ((f = fopen(s, "r")))
 	  display_tellhelp(idx, item->name, f, flags);
       }
@@ -1029,9 +1029,9 @@
       if (!strcmp(match, item->name) && item->type) {
 
 	if (item->type == 1)
-	  egg_snprintf(s, sizeof s, "%s%s", helpdir, current->name);
+	  snprintf(s, sizeof s, "%s%s", helpdir, current->name);
 	else
-	  egg_snprintf(s, sizeof s, "%sset/%s", helpdir, current->name);
+	  snprintf(s, sizeof s, "%sset/%s", helpdir, current->name);
 	if ((f = fopen(s, "r")))
 	  display_tellhelp(idx, item->name, f, flags);
       }
Index: eggdrop1.7/src/mod/assoc.mod/assoc.c
diff -u eggdrop1.7/src/mod/assoc.mod/assoc.c:1.25 eggdrop1.7/src/mod/assoc.mod/assoc.c:1.26
--- eggdrop1.7/src/mod/assoc.mod/assoc.c:1.25	Tue Oct 16 19:43:32 2001
+++ eggdrop1.7/src/mod/assoc.mod/assoc.c	Thu Oct 18 20:55:06 2001
@@ -2,7 +2,7 @@
  * assoc.c -- part of assoc.mod
  *   the assoc code, moved here mainly from botnet.c for module work
  *
- * $Id: assoc.c,v 1.25 2001/10/17 00:43:32 stdarg Exp $
+ * $Id: assoc.c,v 1.26 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -65,7 +65,7 @@
 {
   char x[1024];
 
-  if (!egg_strcasecmp(via, botnetnick)) {
+  if (!strcasecmp(via, botnetnick)) {
     int idx = nextbot(bot);
     assoc_t *a;
 
@@ -113,7 +113,7 @@
   assoc_t *a, *b, *old = NULL;
 
   for (a = assoc; a; a = a->next) {
-    if (name[0] != 0 && !egg_strcasecmp(a->name, name)) {
+    if (name[0] != 0 && !strcasecmp(a->name, name)) {
       kill_assoc(a->channel);
       add_assoc(name, chan);
       return;
@@ -153,7 +153,7 @@
   assoc_t *a;
 
   for (a = assoc; a; a = a->next)
-    if (!egg_strcasecmp(a->name, name))
+    if (!strcasecmp(a->name, name))
       return a->channel;
   return -1;
 }
@@ -307,7 +307,7 @@
   int linking = 0, chan;
 
   if ((idx >= 0) && !(bot_flags(dcc[idx].user) & BOT_ISOLATE)) {
-    if (!egg_strcasecmp(dcc[idx].nick, botnick))
+    if (!strcasecmp(dcc[idx].nick, botnick))
       linking = b_status(idx) & STAT_LINKING;
     s = newsplit(&par);
     chan = base64_to_int(s);
Index: eggdrop1.7/src/mod/blowfish.mod/bf_tab.h
diff -u eggdrop1.7/src/mod/blowfish.mod/bf_tab.h:1.4 eggdrop1.7/src/mod/blowfish.mod/bf_tab.h:1.5
--- eggdrop1.7/src/mod/blowfish.mod/bf_tab.h:1.4	Wed Apr 11 21:39:44 2001
+++ eggdrop1.7/src/mod/blowfish.mod/bf_tab.h	Thu Oct 18 20:55:06 2001
@@ -2,7 +2,7 @@
  * bf_tab.h -- part of blowfish.mod
  *   Blowfish P-box and S-box tables
  *
- * $Id: bf_tab.h,v 1.4 2001/04/12 02:39:44 guppy Exp $
+ * $Id: bf_tab.h,v 1.5 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (C) 1999, 2000, 2001 Eggheads Development Team
@@ -25,7 +25,7 @@
 #ifndef _EGG_MOD_BLOWFISH_BF_TAB_H
 #define _EGG_MOD_BLOWFISH_BF_TAB_H
 
-static u_32bit_t initbf_P[bf_N + 2] =
+static u_32int_t initbf_P[bf_N + 2] =
 {
   0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
   0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
@@ -33,7 +33,7 @@
   0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
   0x9216d5d9, 0x8979fb1b,
 };
-static u_32bit_t initbf_S[4][256] =
+static u_32int_t initbf_S[4][256] =
 {
   {
     0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
Index: eggdrop1.7/src/mod/blowfish.mod/blowfish.c
diff -u eggdrop1.7/src/mod/blowfish.mod/blowfish.c:1.25 eggdrop1.7/src/mod/blowfish.mod/blowfish.c:1.26
--- eggdrop1.7/src/mod/blowfish.mod/blowfish.c:1.25	Sun Oct 14 17:35:25 2001
+++ eggdrop1.7/src/mod/blowfish.mod/blowfish.c	Thu Oct 18 20:55:06 2001
@@ -2,7 +2,7 @@
  * blowfish.c -- part of blowfish.mod
  *   encryption and decryption of passwords
  *
- * $Id: blowfish.c,v 1.25 2001/10/14 22:35:25 ite Exp $
+ * $Id: blowfish.c,v 1.26 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -51,19 +51,19 @@
 
 /* Keep a set of rotating P & S boxes */
 static struct box_t {
-  u_32bit_t *P;
-  u_32bit_t **S;
+  u_32int_t *P;
+  u_32int_t **S;
   char key[81];
   char keybytes;
   time_t lastuse;
 } box[BOXES];
 
-/* static u_32bit_t bf_P[bf_N+2]; */
-/* static u_32bit_t bf_S[4][256]; */
-static u_32bit_t *bf_P;
-static u_32bit_t **bf_S;
+/* static u_32int_t bf_P[bf_N+2]; */
+/* static u_32int_t bf_S[4][256]; */
+static u_32int_t *bf_P;
+static u_32int_t **bf_S;
 
-static void blowfish_encipher(u_32bit_t * xl, u_32bit_t * xr)
+static void blowfish_encipher(u_32int_t * xl, u_32int_t * xr)
 {
   union aword Xl;
   union aword Xr;
@@ -94,7 +94,7 @@
   *xl = Xr.word;
 }
 
-static void blowfish_decipher(u_32bit_t * xl, u_32bit_t * xr)
+static void blowfish_decipher(u_32int_t * xl, u_32int_t * xr)
 {
   union aword Xl;
   union aword Xr;
@@ -148,9 +148,9 @@
 {
   int i, j, bx;
   time_t lowest;
-  u_32bit_t data;
-  u_32bit_t datal;
-  u_32bit_t datar;
+  u_32int_t data;
+  u_32int_t datal;
+  u_32int_t datar;
   union aword temp;
 
   /* drummer: Fixes crash if key is longer than 80 char. This may cause the key
@@ -195,10 +195,10 @@
   }
   /* Initialize new buffer */
   /* uh... this is over 4k */
-  box[bx].P = (u_32bit_t *) malloc((bf_N + 2) * sizeof(u_32bit_t));
-  box[bx].S = (u_32bit_t **) malloc(4 * sizeof(u_32bit_t *));
+  box[bx].P = (u_32int_t *) malloc((bf_N + 2) * sizeof(u_32int_t));
+  box[bx].S = (u_32int_t **) malloc(4 * sizeof(u_32int_t *));
   for (i = 0; i < 4; i++)
-    box[bx].S[i] = (u_32bit_t *) malloc(256 * sizeof(u_32bit_t));
+    box[bx].S[i] = (u_32int_t *) malloc(256 * sizeof(u_32int_t));
   bf_P = box[bx].P;
   bf_S = box[bx].S;
   box[bx].keybytes = keybytes;
@@ -265,7 +265,7 @@
 
 static void blowfish_encrypt_pass(char *text, char *new)
 {
-  u_32bit_t left, right;
+  u_32int_t left, right;
   int n;
   char *p;
 
@@ -294,7 +294,7 @@
  */
 static char *encrypt_string(char *key, char *str)
 {
-  u_32bit_t left, right;
+  u_32int_t left, right;
   unsigned char *p;
   char *s, *dest, *d;
   int i;
@@ -341,7 +341,7 @@
  */
 static char *decrypt_string(char *key, char *str)
 {
-  u_32bit_t left, right;
+  u_32int_t left, right;
   char *p, *s, *dest, *d;
   int i;
 
Index: eggdrop1.7/src/mod/blowfish.mod/blowfish.h
diff -u eggdrop1.7/src/mod/blowfish.mod/blowfish.h:1.6 eggdrop1.7/src/mod/blowfish.mod/blowfish.h:1.7
--- eggdrop1.7/src/mod/blowfish.mod/blowfish.h:1.6	Wed Apr 11 21:39:44 2001
+++ eggdrop1.7/src/mod/blowfish.mod/blowfish.h	Thu Oct 18 20:55:06 2001
@@ -1,7 +1,7 @@
 /*
  * blowfish.h -- part of blowfish.mod
  *
- * $Id: blowfish.h,v 1.6 2001/04/12 02:39:44 guppy Exp $
+ * $Id: blowfish.h,v 1.7 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -32,7 +32,7 @@
 #define KEYBYTES	 8
 
 union aword {
-  u_32bit_t word;
+  u_32int_t word;
   u_8bit_t byte[4];
   struct {
 #ifdef WORDS_BIGENDIAN
Index: eggdrop1.7/src/mod/channels.mod/channels.c
diff -u eggdrop1.7/src/mod/channels.mod/channels.c:1.64 eggdrop1.7/src/mod/channels.mod/channels.c:1.65
--- eggdrop1.7/src/mod/channels.mod/channels.c:1.64	Thu Oct 11 13:24:02 2001
+++ eggdrop1.7/src/mod/channels.mod/channels.c	Thu Oct 18 20:55:07 2001
@@ -2,7 +2,7 @@
  * channels.c -- part of channels.mod
  *   support for channels within the bot
  *
- * $Id: channels.c,v 1.64 2001/10/11 18:24:02 tothwolf Exp $
+ * $Id: channels.c,v 1.65 2001/10/19 01:55:07 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -487,7 +487,7 @@
   char s[125];
 
   putlog(LOG_MISC, "*", "Backing up channel file...");
-  egg_snprintf(s, sizeof s, "%s~bak", chanfile);
+  snprintf(s, sizeof s, "%s~bak", chanfile);
   copyfile(chanfile, s);
 }
 
Index: eggdrop1.7/src/mod/channels.mod/cmdschan.c
diff -u eggdrop1.7/src/mod/channels.mod/cmdschan.c:1.55 eggdrop1.7/src/mod/channels.mod/cmdschan.c:1.56
--- eggdrop1.7/src/mod/channels.mod/cmdschan.c:1.55	Thu Oct 11 13:24:02 2001
+++ eggdrop1.7/src/mod/channels.mod/cmdschan.c	Thu Oct 18 20:55:07 2001
@@ -2,7 +2,7 @@
  * cmdschan.c -- part of channels.mod
  *   commands from a user via dcc that cause server interaction
  *
- * $Id: cmdschan.c,v 1.55 2001/10/11 18:24:02 tothwolf Exp $
+ * $Id: cmdschan.c,v 1.56 2001/10/19 01:55:07 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -101,15 +101,15 @@
     /* Fix missing ! or @ BEFORE checking against myself */
     if (!strchr(who, '!')) {
       if (!strchr(who, '@'))
-	egg_snprintf(s, sizeof s, "%s!*@*", who);	/* Lame nick ban */
+	snprintf(s, sizeof s, "%s!*@*", who);	/* Lame nick ban */
       else
-	egg_snprintf(s, sizeof s, "*!%s", who);
+	snprintf(s, sizeof s, "*!%s", who);
     } else if (!strchr(who, '@'))
-      egg_snprintf(s, sizeof s, "%s@*", who);	/* brain-dead? */
+      snprintf(s, sizeof s, "%s@*", who);	/* brain-dead? */
     else
       strncpyz(s, who, sizeof s);
     if ((me = module_find("server", 0, 0)) && me->funcs)
-      egg_snprintf(s1, sizeof s1, "%s!%s", me->funcs[SERVER_BOTNAME],
+      snprintf(s1, sizeof s1, "%s!%s", me->funcs[SERVER_BOTNAME],
 	            me->funcs[SERVER_BOTUSERHOST]);
     else
       s1[0] = 0;
@@ -237,11 +237,11 @@
     /* Fix missing ! or @ BEFORE checking against myself */
     if (!strchr(who, '!')) {
       if (!strchr(who, '@'))
-	egg_snprintf(s, sizeof s, "%s!*@*", who);	/* Lame nick exempt */
+	snprintf(s, sizeof s, "%s!*@*", who);	/* Lame nick exempt */
       else
-	egg_snprintf(s, sizeof s, "*!%s", who);
+	snprintf(s, sizeof s, "*!%s", who);
     } else if (!strchr(who, '@'))
-      egg_snprintf(s, sizeof s, "%s@*", who);		/* brain-dead? */
+      snprintf(s, sizeof s, "%s@*", who);		/* brain-dead? */
     else
       strncpyz(s, who, sizeof s);
 
@@ -358,11 +358,11 @@
     /* Fix missing ! or @ BEFORE checking against myself */
     if (!strchr(who, '!')) {
       if (!strchr(who, '@'))
-	egg_snprintf(s, sizeof s, "%s!*@*", who);	/* Lame nick invite */
+	snprintf(s, sizeof s, "%s!*@*", who);	/* Lame nick invite */
       else
-	egg_snprintf(s, sizeof s, "*!%s", who);
+	snprintf(s, sizeof s, "*!%s", who);
     } else if (!strchr(who, '@'))
-      egg_snprintf(s, sizeof s, "%s@*", who);		/* brain-dead? */
+      snprintf(s, sizeof s, "%s@*", who);		/* brain-dead? */
     else
       strncpyz(s, who, sizeof s);
 
@@ -441,7 +441,7 @@
     chan = findchan_by_dname(chname);
   if (chan) {
     if (atoi(ban) > 0) {
-      egg_snprintf(s, sizeof s, "%d", -i);
+      snprintf(s, sizeof s, "%d", -i);
       j = u_delban(chan, s, 1);
       if (j > 0) {
 	putlog(LOG_CMDS, "*", "#%s# (%s) -ban %s", dcc[idx].nick,
@@ -530,7 +530,7 @@
     chan = findchan_by_dname(chname);
   if (chan) {
     if (atoi(exempt) > 0) {
-      egg_snprintf(s, sizeof s, "%d", -i);
+      snprintf(s, sizeof s, "%d", -i);
       j = u_delexempt(chan, s, 1);
       if (j > 0) {
 	putlog(LOG_CMDS, "*", "#%s# (%s) -exempt %s", dcc[idx].nick,
@@ -619,7 +619,7 @@
     chan = findchan_by_dname(chname);
   if (chan) {
     if (atoi(invite) > 0) {
-      egg_snprintf(s, sizeof s, "%d", -i);
+      snprintf(s, sizeof s, "%d", -i);
       j = u_delinvite(chan, s, 1);
       if (j > 0) {
 	putlog(LOG_CMDS, "*", "#%s# (%s) -invite %s", dcc[idx].nick,
@@ -671,7 +671,7 @@
 
 static void cmd_bans(struct userrec *u, int idx, char *par)
 {
-  if (!egg_strcasecmp(par, "all")) {
+  if (!strcasecmp(par, "all")) {
     putlog(LOG_CMDS, "*", "#%s# bans all", dcc[idx].nick);
     tell_bans(idx, 1, "");
   } else {
@@ -686,7 +686,7 @@
     dprintf(idx, "This command can only be used with use-exempts enabled.\n");
     return;
   }
-  if (!egg_strcasecmp(par, "all")) {
+  if (!strcasecmp(par, "all")) {
     putlog(LOG_CMDS, "*", "#%s# exempts all", dcc[idx].nick);
     tell_exempts(idx, 1, "");
   } else {
@@ -701,7 +701,7 @@
     dprintf(idx, "This command can only be used with use-invites enabled.\n");
     return;
   }
-  if (!egg_strcasecmp(par, "all")) {
+  if (!strcasecmp(par, "all")) {
     putlog(LOG_CMDS, "*", "#%s# invites all", dcc[idx].nick);
     tell_invites(idx, 1, "");
   } else {
@@ -754,7 +754,7 @@
     dprintf(idx, "Your info line is locked.  Sorry.\n");
     return;
   }
-  if (!egg_strcasecmp(par, "none")) {
+  if (!strcasecmp(par, "none")) {
     if (chname) {
       par[0] = 0;
       set_handle_chaninfo(userlist, dcc[idx].nick, chname, NULL);
@@ -826,7 +826,7 @@
   }
   putlog(LOG_CMDS, "*", "#%s# chinfo %s %s %s", dcc[idx].nick, handle,
 	 chname ? chname : par, chname ? par : "");
-  if (!egg_strcasecmp(par, "none"))
+  if (!strcasecmp(par, "none"))
     par[0] = 0;
   if (chname) {
     set_handle_chaninfo(userlist, handle, chname, par);
@@ -859,9 +859,9 @@
   strncpyz(s, newsplit(&par), sizeof s);
   strncpyz(chname, newsplit(&par), sizeof chname);
 
-  if (egg_strcasecmp(stick_type, "exempt") &&
-      egg_strcasecmp(stick_type, "invite") &&
-      egg_strcasecmp(stick_type, "ban")) {
+  if (strcasecmp(stick_type, "exempt") &&
+      strcasecmp(stick_type, "invite") &&
+      strcasecmp(stick_type, "ban")) {
     strncpyz(chname, s, sizeof chname);
     strncpyz(s, stick_type, sizeof s);
   }
@@ -871,7 +871,7 @@
     return;
   }
   /* Now deal with exemptions */
-  if (!egg_strcasecmp(stick_type, "exempt")) {
+  if (!strcasecmp(stick_type, "exempt")) {
     if (!use_exempts) {
       dprintf(idx, "This command can only be used with use-exempts enabled.\n");
       return;
@@ -893,7 +893,7 @@
       return;
     }
     if (i)
-      egg_snprintf(s, sizeof s, "%d", -i);
+      snprintf(s, sizeof s, "%d", -i);
     j = u_setsticky_exempt(chan, s, yn);
     if (j > 0) {
       putlog(LOG_CMDS, "*", "#%s# %sstick exempt %s %s", dcc[idx].nick,
@@ -904,7 +904,7 @@
     dprintf(idx, "No such exempt.\n");
     return;
   /* Now the invites */
-  } else if (!egg_strcasecmp(stick_type, "invite")) {
+  } else if (!strcasecmp(stick_type, "invite")) {
     if (!use_invites) {
       dprintf(idx, "This command can only be used with use-invites enabled.\n");
       return;
@@ -926,7 +926,7 @@
       return;
     }
     if (i)
-      egg_snprintf(s, sizeof s, "%d", -i);
+      snprintf(s, sizeof s, "%d", -i);
     j = u_setsticky_invite(chan, s, yn);
     if (j > 0) {
       putlog(LOG_CMDS, "*", "#%s# %sstick invite %s %s", dcc[idx].nick,
@@ -957,7 +957,7 @@
     return;
   }
   if (i)
-    egg_snprintf(s, sizeof s, "%d", -i);
+    snprintf(s, sizeof s, "%d", -i);
   j = u_setsticky_ban(chan, s, yn);
   if (j > 0) {
     putlog(LOG_CMDS, "*", "#%s# %sstick ban %s %s", dcc[idx].nick,
@@ -1223,9 +1223,9 @@
           tmp = 1;
         }
 	if (ii == 1)
-	  egg_snprintf(work, sizeof work, "    ");
+	  snprintf(work, sizeof work, "    ");
 	work_len = strlen(work);
-        egg_snprintf(work + work_len, sizeof(work) - work_len, " %c%s",
+        snprintf(work + work_len, sizeof(work) - work_len, " %c%s",
 		     getudef(ul->values, chan->dname) ? '+' : '-', ul->name);
         ii++;
         if (ii > 4) {
@@ -1247,7 +1247,7 @@
           dprintf(idx, "User defined channel settings:\n");
           tmp = 1;
         }
-        egg_snprintf(work + work_len, sizeof(work) - work_len, "%s: %d   ",
+        snprintf(work + work_len, sizeof(work) - work_len, "%s: %d   ",
 		     ul->name, getudef(ul->values, chan->dname));
         ii++;
         if (ii > 4) {
Index: eggdrop1.7/src/mod/channels.mod/tclchan.c
diff -u eggdrop1.7/src/mod/channels.mod/tclchan.c:1.56 eggdrop1.7/src/mod/channels.mod/tclchan.c:1.57
--- eggdrop1.7/src/mod/channels.mod/tclchan.c:1.56	Thu Oct 11 06:34:20 2001
+++ eggdrop1.7/src/mod/channels.mod/tclchan.c	Thu Oct 18 20:55:07 2001
@@ -1,7 +1,7 @@
 /*
  * tclchan.c -- part of channels.mod
  *
- * $Id: tclchan.c,v 1.56 2001/10/11 11:34:20 tothwolf Exp $
+ * $Id: tclchan.c,v 1.57 2001/10/19 01:55:07 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -510,8 +510,8 @@
     return TCL_ERROR;
   }
   if (argc == 7) {
-    if (!egg_strcasecmp(argv[6], "none"));
-    else if (!egg_strcasecmp(argv[6], "sticky"))
+    if (!strcasecmp(argv[6], "none"));
+    else if (!strcasecmp(argv[6], "sticky"))
       sticky = 1;
     else {
       Tcl_AppendResult(irp, "invalid option ", argv[6], " (must be one of: ",
@@ -545,8 +545,8 @@
 
   BADARGS(4, 6, " ban creator comment ?lifetime? ?options?");
   if (argc == 6) {
-    if (!egg_strcasecmp(argv[5], "none"));
-    else if (!egg_strcasecmp(argv[5], "sticky"))
+    if (!strcasecmp(argv[5], "none"));
+    else if (!strcasecmp(argv[5], "sticky"))
       sticky = 1;
     else {
       Tcl_AppendResult(irp, "invalid option ", argv[5], " (must be one of: ",
@@ -589,8 +589,8 @@
     return TCL_ERROR;
   }
   if (argc == 7) {
-    if (!egg_strcasecmp(argv[6], "none"));
-    else if (!egg_strcasecmp(argv[6], "sticky"))
+    if (!strcasecmp(argv[6], "none"));
+    else if (!strcasecmp(argv[6], "sticky"))
       sticky = 1;
     else {
       Tcl_AppendResult(irp, "invalid option ", argv[6], " (must be one of: ",
@@ -624,8 +624,8 @@
 
   BADARGS(4, 6, " exempt creator comment ?lifetime? ?options?");
   if (argc == 6) {
-    if (!egg_strcasecmp(argv[5], "none"));
-    else if (!egg_strcasecmp(argv[5], "sticky"))
+    if (!strcasecmp(argv[5], "none"));
+    else if (!strcasecmp(argv[5], "sticky"))
       sticky = 1;
     else {
       Tcl_AppendResult(irp, "invalid option ", argv[5], " (must be one of: ",
@@ -668,8 +668,8 @@
     return TCL_ERROR;
   }
   if (argc == 7) {
-    if (!egg_strcasecmp(argv[6], "none"));
-    else if (!egg_strcasecmp(argv[6], "sticky"))
+    if (!strcasecmp(argv[6], "none"));
+    else if (!strcasecmp(argv[6], "sticky"))
       sticky = 1;
     else {
       Tcl_AppendResult(irp, "invalid option ", argv[6], " (must be one of: ",
@@ -703,8 +703,8 @@
 
   BADARGS(4, 6, " invite creator comment ?lifetime? ?options?");
   if (argc == 6) {
-    if (!egg_strcasecmp(argv[5], "none"));
-    else if (!egg_strcasecmp(argv[5], "sticky"))
+    if (!strcasecmp(argv[5], "none"));
+    else if (!strcasecmp(argv[5], "sticky"))
       sticky = 1;
     else {
       Tcl_AppendResult(irp, "invalid option ", argv[5], " (must be one of: ",
@@ -1067,10 +1067,10 @@
       for (ul = udef; ul; ul = ul->next) {
         if (ul->type == UDEF_FLAG &&
 	     /* Direct match when set during .chanset ... */
-	    (!egg_strcasecmp(item[i] + 1, ul->name) ||
+	    (!strcasecmp(item[i] + 1, ul->name) ||
 	     /* ... or with prefix when set during chanfile load. */
 	     (!strncmp(item[i] + 1, "udef-flag-", 10) &&
-	      !egg_strcasecmp(item[i] + 11, ul->name)))) {
+	      !strcasecmp(item[i] + 11, ul->name)))) {
           if (item[i][0] == '+')
             setudef(ul, chan->dname, 1);
           else
@@ -1079,10 +1079,10 @@
 	  break;
         } else if (ul->type == UDEF_INT &&
 		    /* Direct match when set during .chanset ... */
-		   (!egg_strcasecmp(item[i], ul->name) ||
+		   (!strcasecmp(item[i], ul->name) ||
 		    /* ... or with prefix when set during chanfile load. */
 		    (!strncmp(item[i], "udef-int-", 9) &&
-		     !egg_strcasecmp(item[i] + 9, ul->name)))) {
+		     !strcasecmp(item[i] + 9, ul->name)))) {
           i++;
           if (i >= items) {
             if (irp)
@@ -1093,7 +1093,7 @@
           found = 1;
 	  break;
         }
-	else if (ul->type == UDEF_STR && (!egg_strcasecmp(item[i], ul->name) || (!strncmp(item[i], "udef-str-", 9) && !egg_strcasecmp(item[i] + 9, ul->name)))) {
+	else if (ul->type == UDEF_STR && (!strcasecmp(item[i], ul->name) || (!strncmp(item[i], "udef-str-", 9) && !strcasecmp(item[i] + 9, ul->name)))) {
 		char *val;
 		i++;
 		if (i >= items) {
@@ -1307,7 +1307,7 @@
     Tcl_AppendResult(irp, "illegal channel: ", argv[2], NULL);
     return TCL_ERROR;
   }
-  if (!egg_strcasecmp(argv[3], "none")) {
+  if (!strcasecmp(argv[3], "none")) {
     set_handle_chaninfo(userlist, argv[1], argv[2], NULL);
     return TCL_OK;
   }
@@ -1562,12 +1562,12 @@
   int type;
 
   BADARGS(3, 3, " type name");
-  if (!egg_strcasecmp(argv[1], "flag"))
+  if (!strcasecmp(argv[1], "flag"))
     type = UDEF_FLAG;
-  else if (!egg_strcasecmp(argv[1], "int"))
+  else if (!strcasecmp(argv[1], "int"))
     type = UDEF_INT;
 	/*## ADD CODE FOR STRING SETTINGS*/
-	else if (!egg_strcasecmp(argv[1], "str"))
+	else if (!strcasecmp(argv[1], "str"))
 		type = UDEF_STR;
   else {
     Tcl_AppendResult(irp, "invalid type. Must be one of: flag, int, str", NULL);
@@ -1583,19 +1583,19 @@
   int type, found = 0;
 
   BADARGS(4, 4, " type oldname newname");
-  if (!egg_strcasecmp(argv[1], "flag"))
+  if (!strcasecmp(argv[1], "flag"))
     type = UDEF_FLAG;
-  else if (!egg_strcasecmp(argv[1], "int"))
+  else if (!strcasecmp(argv[1], "int"))
     type = UDEF_INT;
 	/*## ADD CODE FOR STRING SETTINGS*/
-	else if (!egg_strcasecmp(argv[1], "str"))
+	else if (!strcasecmp(argv[1], "str"))
 		type = UDEF_STR;
   else {
     Tcl_AppendResult(irp, "invalid type. Must be one of: flag, int, str", NULL);
     return TCL_ERROR;
   }
   for (ul = udef; ul; ul = ul->next) {
-    if (ul->type == type && !egg_strcasecmp(ul->name, argv[2])) {
+    if (ul->type == type && !strcasecmp(ul->name, argv[2])) {
       free(ul->name);
       malloc_strcpy(ul->name, argv[3]);
       found = 1;
@@ -1614,12 +1614,12 @@
   int type, found = 0;
 
   BADARGS(3, 3, " type name");
-  if (!egg_strcasecmp(argv[1], "flag"))
+  if (!strcasecmp(argv[1], "flag"))
     type = UDEF_FLAG;
-  else if (!egg_strcasecmp(argv[1], "int"))
+  else if (!strcasecmp(argv[1], "int"))
     type = UDEF_INT;
 	/*## ADD CODE FOR STRING SETTINGS*/
-	else if (!egg_strcasecmp(argv[1], "str"))
+	else if (!strcasecmp(argv[1], "str"))
 		type = UDEF_STR;
   else {
     Tcl_AppendResult(irp, "invalid type. Must be one of: flag, int, str", NULL);
@@ -1629,7 +1629,7 @@
     ull = ul->next;
     if (!ull)
       break;
-    if (ull->type == type && !egg_strcasecmp(ull->name, argv[2])) {
+    if (ull->type == type && !strcasecmp(ull->name, argv[2])) {
       ul->next = ull->next;
       free(ull->name);
       free_udef_chans(ull->values, ull->type);
@@ -1638,7 +1638,7 @@
     }
   }
   if (udef) {
-    if (udef->type == type && !egg_strcasecmp(udef->name, argv[2])) {
+    if (udef->type == type && !strcasecmp(udef->name, argv[2])) {
       ul = udef->next;
       free(udef->name);
       free_udef_chans(udef->values, udef->type);
Index: eggdrop1.7/src/mod/channels.mod/udefchan.c
diff -u eggdrop1.7/src/mod/channels.mod/udefchan.c:1.8 eggdrop1.7/src/mod/channels.mod/udefchan.c:1.9
--- eggdrop1.7/src/mod/channels.mod/udefchan.c:1.8	Wed Oct 10 05:44:05 2001
+++ eggdrop1.7/src/mod/channels.mod/udefchan.c	Thu Oct 18 20:55:07 2001
@@ -2,7 +2,7 @@
  * udefchan.c -- part of channels.mod
  *   user definable channel flags/settings
  *
- * $Id: udefchan.c,v 1.8 2001/10/10 10:44:05 tothwolf Exp $
+ * $Id: udefchan.c,v 1.9 2001/10/19 01:55:07 tothwolf Exp $
  */
 /*
  * Copyright (C) 1999, 2000, 2001 Eggheads Development Team
@@ -27,7 +27,7 @@
   int val = 0;
 
   for (; ul; ul = ul->next)
-    if (!egg_strcasecmp(ul->chan, name)) {
+    if (!strcasecmp(ul->chan, name)) {
       val = ul->value;
       break;
     }
@@ -40,9 +40,9 @@
   struct udef_chans *ll;
 
   for (l = udef; l; l = l->next)
-    if (!egg_strcasecmp(l->name, name)) {
+    if (!strcasecmp(l->name, name)) {
       for (ll = l->values; ll; ll = ll->next)
-        if (!egg_strcasecmp(ll->chan, chan))
+        if (!strcasecmp(ll->chan, chan))
           return ll->value;
       break;
     }
@@ -54,7 +54,7 @@
   struct udef_chans *ul, *ul_last = NULL;
 
   for (ul = us->values; ul; ul_last = ul, ul = ul->next)
-    if (!egg_strcasecmp(ul->chan, name)) {
+    if (!strcasecmp(ul->chan, name)) {
       ul->value = value;
       return;
     }
@@ -76,7 +76,7 @@
   if (strlen(name) < 1)
     return;
   for (ul = udef; ul; ul_last = ul, ul = ul->next)
-    if (ul->name && !egg_strcasecmp(ul->name, name)) {
+    if (ul->name && !strcasecmp(ul->name, name)) {
       if (defined) {
         debug1("UDEF: %s defined", ul->name);
         ul->defined = 1;
Index: eggdrop1.7/src/mod/channels.mod/userchan.c
diff -u eggdrop1.7/src/mod/channels.mod/userchan.c:1.31 eggdrop1.7/src/mod/channels.mod/userchan.c:1.32
--- eggdrop1.7/src/mod/channels.mod/userchan.c:1.31	Sun Oct 14 08:50:30 2001
+++ eggdrop1.7/src/mod/channels.mod/userchan.c	Thu Oct 18 20:55:07 2001
@@ -1,7 +1,7 @@
 /*
  * userchan.c -- part of channels.mod
  *
- * $Id: userchan.c,v 1.31 2001/10/14 13:50:30 tothwolf Exp $
+ * $Id: userchan.c,v 1.32 2001/10/19 01:55:07 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1245,7 +1245,7 @@
   m = ismember(chan, nick);
   if (!m)
     for (m2 = chan->channel.member; m2 && m2->nick[0]; m2 = m2->next)
-      if (!egg_strcasecmp(uhost, m2->userhost)) {
+      if (!strcasecmp(uhost, m2->userhost)) {
 	m = m2;
 	break;
       }
Index: eggdrop1.7/src/mod/compress.mod/compress.c
diff -u eggdrop1.7/src/mod/compress.mod/compress.c:1.15 eggdrop1.7/src/mod/compress.mod/compress.c:1.16
--- eggdrop1.7/src/mod/compress.mod/compress.c:1.15	Sun Oct 14 18:32:01 2001
+++ eggdrop1.7/src/mod/compress.mod/compress.c	Thu Oct 18 20:55:07 2001
@@ -6,7 +6,7 @@
  * Written by Fabian Knittel <fknittel at gmx.de>. Based on zlib examples
  * by Jean-loup Gailly and Miguel Albrecht.
  *
- * $Id: compress.c,v 1.15 2001/10/14 23:32:01 ite Exp $
+ * $Id: compress.c,v 1.16 2001/10/19 01:55:07 tothwolf Exp $
  */
 /*
  * Copyright (C) 2000, 2001 Eggheads Development Team
@@ -225,7 +225,7 @@
   int   len;
 
   adjust_mode_num(&mode_num);
-  egg_snprintf(mode, sizeof mode, "wb%d", mode_num);
+  snprintf(mode, sizeof mode, "wb%d", mode_num);
 
   if (!is_file(f_src)) {
     putlog(LOG_MISC, "*", _("Failed to compress file `%s': not a file."),
Index: eggdrop1.7/src/mod/ctcp.mod/ctcp.c
diff -u eggdrop1.7/src/mod/ctcp.mod/ctcp.c:1.19 eggdrop1.7/src/mod/ctcp.mod/ctcp.c:1.20
--- eggdrop1.7/src/mod/ctcp.mod/ctcp.c:1.19	Tue Oct  9 20:20:12 2001
+++ eggdrop1.7/src/mod/ctcp.mod/ctcp.c	Thu Oct 18 20:55:07 2001
@@ -2,7 +2,7 @@
  * ctcp.c -- part of ctcp.mod
  *   all the ctcp handling (except DCC, it's special ;)
  *
- * $Id: ctcp.c,v 1.19 2001/10/10 01:20:12 ite Exp $
+ * $Id: ctcp.c,v 1.20 2001/10/19 01:55:07 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -97,29 +97,29 @@
     return 1;
   else if (!msg[0])
     p = CLIENTINFO;
-  else if (!egg_strcasecmp(msg, "sed"))
+  else if (!strcasecmp(msg, "sed"))
     p = CLIENTINFO_SED;
-  else if (!egg_strcasecmp(msg, "version"))
+  else if (!strcasecmp(msg, "version"))
     p = CLIENTINFO_VERSION;
-  else if (!egg_strcasecmp(msg, "clientinfo"))
+  else if (!strcasecmp(msg, "clientinfo"))
     p = CLIENTINFO_CLIENTINFO;
-  else if (!egg_strcasecmp(msg, "userinfo"))
+  else if (!strcasecmp(msg, "userinfo"))
     p = CLIENTINFO_USERINFO;
-  else if (!egg_strcasecmp(msg, "errmsg"))
+  else if (!strcasecmp(msg, "errmsg"))
     p = CLIENTINFO_ERRMSG;
-  else if (!egg_strcasecmp(msg, "finger"))
+  else if (!strcasecmp(msg, "finger"))
     p = CLIENTINFO_FINGER;
-  else if (!egg_strcasecmp(msg, "time"))
+  else if (!strcasecmp(msg, "time"))
     p = CLIENTINFO_TIME;
-  else if (!egg_strcasecmp(msg, "action"))
+  else if (!strcasecmp(msg, "action"))
     p = CLIENTINFO_ACTION;
-  else if (!egg_strcasecmp(msg, "dcc"))
+  else if (!strcasecmp(msg, "dcc"))
     p = CLIENTINFO_DCC;
-  else if (!egg_strcasecmp(msg, "utc"))
+  else if (!strcasecmp(msg, "utc"))
     p = CLIENTINFO_UTC;
-  else if (!egg_strcasecmp(msg, "ping"))
+  else if (!strcasecmp(msg, "ping"))
     p = CLIENTINFO_PING;
-  else if (!egg_strcasecmp(msg, "echo"))
+  else if (!strcasecmp(msg, "echo"))
     p = CLIENTINFO_ECHO;
   if (p == NULL) {
     simple_sprintf(ctcp_reply,
Index: eggdrop1.7/src/mod/filesys.mod/filedb3.c
diff -u eggdrop1.7/src/mod/filesys.mod/filedb3.c:1.23 eggdrop1.7/src/mod/filesys.mod/filedb3.c:1.24
--- eggdrop1.7/src/mod/filesys.mod/filedb3.c:1.23	Thu Oct 11 08:01:35 2001
+++ eggdrop1.7/src/mod/filesys.mod/filedb3.c	Thu Oct 18 20:55:07 2001
@@ -4,7 +4,7 @@
  *
  * Rewritten by Fabian Knittel <fknittel at gmx.de>
  *
- * $Id: filedb3.c,v 1.23 2001/10/11 13:01:35 tothwolf Exp $
+ * $Id: filedb3.c,v 1.24 2001/10/19 01:55:07 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -944,7 +944,7 @@
 	  if (fdbe->stat & FILE_HIDDEN)
 	    strcat(s2, " (hid)");
 	}
-	egg_strftime(t, 10, "%d%b%Y", localtime(&fdbe->uploaded));
+	strftime(t, 10, "%d%b%Y", localtime(&fdbe->uploaded));
 	if (fdbe->size < 1024)
 	  sprintf(s1, "%5d", fdbe->size);
 	else
Index: eggdrop1.7/src/mod/filesys.mod/files.c
diff -u eggdrop1.7/src/mod/filesys.mod/files.c:1.31 eggdrop1.7/src/mod/filesys.mod/files.c:1.32
--- eggdrop1.7/src/mod/filesys.mod/files.c:1.31	Thu Oct 11 08:01:35 2001
+++ eggdrop1.7/src/mod/filesys.mod/files.c	Thu Oct 18 20:55:07 2001
@@ -2,7 +2,7 @@
  * files.c - part of filesys.mod
  *   handles all file system commands
  *
- * $Id: files.c,v 1.31 2001/10/11 13:01:35 tothwolf Exp $
+ * $Id: files.c,v 1.32 2001/10/19 01:55:07 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -476,7 +476,7 @@
 	/* This is a link to a file on another bot... */
 	bot = malloc(strlen(fdbe->sharelink) + 1);
 	splitc(bot, fdbe->sharelink, ':');
-	if (!egg_strcasecmp(bot, botnetnick)) {
+	if (!strcasecmp(bot, botnetnick)) {
 	  dprintf(idx, "Can't get that file, it's linked to this bot!\n");
 	} else if (!in_chain(bot)) {
 	  dprintf(idx, _("%s isnt available right now.\n"), fdbe->filename);
@@ -853,7 +853,7 @@
     if (!(fdbe->stat & FILE_HIDDEN)) {
       ok = 1;
       if ((!(dcc[idx].user->flags & USER_JANITOR)) &&
-	  (egg_strcasecmp(fdbe->uploader, dcc[idx].nick)))
+	  (strcasecmp(fdbe->uploader, dcc[idx].nick)))
 	dprintf(idx, _("You didnt upload %s\n"), fdbe->filename);
       else {
 	if (desc[0]) {
@@ -1412,7 +1412,7 @@
     /* This is a link to a file on another bot... */
     bot = malloc(strlen(fdbe->sharelink) + 1);
     splitc(bot, fdbe->sharelink, ':');
-    if (!egg_strcasecmp(bot, botnetnick)) {
+    if (!strcasecmp(bot, botnetnick)) {
       /* Linked to myself *duh* */
       filedb_close(fdb);
       free_null(what);
Index: eggdrop1.7/src/mod/filesys.mod/filesys.c
diff -u eggdrop1.7/src/mod/filesys.mod/filesys.c:1.57 eggdrop1.7/src/mod/filesys.mod/filesys.c:1.58
--- eggdrop1.7/src/mod/filesys.mod/filesys.c:1.57	Wed Oct 17 21:57:51 2001
+++ eggdrop1.7/src/mod/filesys.mod/filesys.c	Thu Oct 18 20:55:07 2001
@@ -2,7 +2,7 @@
  * filesys.c -- part of filesys.mod
  *   main file of the filesys eggdrop module
  *
- * $Id: filesys.c,v 1.57 2001/10/18 02:57:51 stdarg Exp $
+ * $Id: filesys.c,v 1.58 2001/10/19 01:55:07 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -407,7 +407,7 @@
       *p = '_';
   }
 
-  if (egg_strcasecmp(nick, dcc[idx].nick))
+  if (strcasecmp(nick, dcc[idx].nick))
     dprintf(DP_HELP, "NOTICE %s :Here is %s file from %s %s...\n", nick,
 	    resend ? "the" : "a", dcc[idx].nick, resend ? "again " : "");
   dprintf(idx, "%sending: %s to %s\n", resend ? "Res" : "S", nfn, nick);
@@ -661,7 +661,7 @@
 	return;
       }
 debug1("|FILESYS| dcc send ip: (%s)", ip);
-    if (egg_inet_aton(ip, &ip4)) /* fix the format! */
+    if (inet_aton(ip, &ip4)) /* fix the format! */
 	strncpyz(dcc[i].addr, inet_ntoa(ip4), ADDRLEN);
     else
 	strncpyz(dcc[i].addr, ip, ADDRLEN);
@@ -803,13 +803,13 @@
   struct userrec *u = get_user_by_handle(userlist, handle);
   struct flag_record fr = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
 
-  if (egg_strcasecmp(object, botname))
+  if (strcasecmp(object, botname))
     return 0;
-  if (!egg_strncasecmp(text, "SEND ", 5)) {
+  if (!strncasecmp(text, "SEND ", 5)) {
     filesys_dcc_send(nick, from, u, text + 5);
     return 1;
   }
-  if (egg_strncasecmp(text, "CHAT ", 5) || !u)
+  if (strncasecmp(text, "CHAT ", 5) || !u)
     return 0;
   strcpy(buf, text + 5);
   get_user_flagrec(u, &fr, 0);
Index: eggdrop1.7/src/mod/irc.mod/chan.c
diff -u eggdrop1.7/src/mod/irc.mod/chan.c:1.77 eggdrop1.7/src/mod/irc.mod/chan.c:1.78
--- eggdrop1.7/src/mod/irc.mod/chan.c:1.77	Sat Oct 13 10:55:33 2001
+++ eggdrop1.7/src/mod/irc.mod/chan.c	Thu Oct 18 20:55:08 2001
@@ -6,7 +6,7 @@
  *   user kickban, kick, op, deop
  *   idle kicking
  *
- * $Id: chan.c,v 1.77 2001/10/13 15:55:33 tothwolf Exp $
+ * $Id: chan.c,v 1.78 2001/10/19 01:55:08 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -208,7 +208,7 @@
   /* Okay, make sure i'm not flood-checking myself */
   if (match_my_nick(floodnick))
     return 0;
-  if (!egg_strcasecmp(floodhost, botuserhost))
+  if (!strcasecmp(floodhost, botuserhost))
     return 0;
   /* My user at host (?) */
   if ((which == FLOOD_KICK) || (which == FLOOD_DEOP))
@@ -415,7 +415,7 @@
 	do_mask(chan, chan->channel.ban, b->mask, 'b');
 	b->lastactive = now;
 	if (b->desc && b->desc[0] != '@')
-	  egg_snprintf(c, sizeof c, "%s%s", _("banned: "), b->desc);
+	  snprintf(c, sizeof c, "%s%s", _("banned: "), b->desc);
 	else
 	  c[0] = 0;
 	kick_all(chan, b->mask, c[0] ? c : _("You are banned"), 0);
@@ -1481,7 +1481,7 @@
     if (l_chname > (CHANNEL_ID_LEN + 1)) {
       ch_dname = malloc(l_chname + 1);
       if (ch_dname) {
-	egg_snprintf(ch_dname, l_chname + 2, "!%s",
+	snprintf(ch_dname, l_chname + 2, "!%s",
 		     chname + (CHANNEL_ID_LEN + 1));
 	chan = findchan_by_dname(ch_dname);
 	if (!chan) {
@@ -1533,7 +1533,7 @@
       reset_chan_info(chan);
     } else {
       m = ismember(chan, nick);
-      if (m && m->split && !egg_strcasecmp(m->userhost, uhost)) {
+      if (m && m->split && !strcasecmp(m->userhost, uhost)) {
 	check_tcl_rejn(nick, uhost, u, chan->dname);
 	/* The tcl binding might have deleted the current user. Recheck. */
 	u = get_user_by_host(from);
Index: eggdrop1.7/src/mod/irc.mod/cmdsirc.c
diff -u eggdrop1.7/src/mod/irc.mod/cmdsirc.c:1.28 eggdrop1.7/src/mod/irc.mod/cmdsirc.c:1.29
--- eggdrop1.7/src/mod/irc.mod/cmdsirc.c:1.28	Thu Oct 11 13:24:02 2001
+++ eggdrop1.7/src/mod/irc.mod/cmdsirc.c	Thu Oct 18 20:55:08 2001
@@ -2,7 +2,7 @@
  * chancmds.c -- part of irc.mod
  *   handles commands direclty relating to channel interaction
  *
- * $Id: cmdsirc.c,v 1.28 2001/10/11 18:24:02 tothwolf Exp $
+ * $Id: cmdsirc.c,v 1.29 2001/10/19 01:55:08 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -60,8 +60,8 @@
   register memberlist	*m;
 
   for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
-    egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
-    if ((u = get_user_by_host(s)) && !egg_strcasecmp(u->handle, handle))
+    snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+    if ((u = get_user_by_host(s)) && !strcasecmp(u->handle, handle))
       return m->nick;
   }
   return NULL;
@@ -185,7 +185,7 @@
     if (!m)
       dprintf(idx, "%s is not on %s\n", nick, chan->dname);
     else {
-      egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+      snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
       u = get_user_by_host(s);
       get_user_flagrec(u, &victim, chan->dname);
       if ((chan_op(victim) || (glob_op(victim) && !chan_deop(victim))) &&
@@ -270,7 +270,7 @@
     dprintf(idx, "%s is not on %s.\n", nick, chan->dname);
     return;
   }
-  egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+  snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
   add_mode(chan, '+', 'v', nick);
   dprintf(idx, "Gave voice to %s on %s\n", nick, chan->dname);
 }
@@ -305,7 +305,7 @@
     dprintf(idx, "%s is not on %s.\n", nick, chan->dname);
     return;
   }
-  egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+  snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
   add_mode(chan, '-', 'v', nick);
   dprintf(idx, "Devoiced %s on %s\n", nick, chan->dname);
 }
@@ -340,7 +340,7 @@
     dprintf(idx, "%s is not on %s.\n", nick, chan->dname);
     return;
   }
-  egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+  snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
   u = get_user_by_host(s);
   get_user_flagrec(u, &victim, chan->dname);
   if (chan_deop(victim) || (glob_deop(victim) && !glob_op(victim))) {
@@ -390,7 +390,7 @@
     dprintf(idx, "I'm not going to deop myself.\n");
     return;
   }
-  egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+  snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
   u = get_user_by_host(s);
   get_user_flagrec(u, &victim, chan->dname);
   if ((chan_master(victim) || glob_master(victim)) &&
@@ -447,7 +447,7 @@
     dprintf(idx, "%s is not on %s\n", nick, chan->dname);
     return;
   }
-  egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+  snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
   u = get_user_by_host(s);
   get_user_flagrec(u, &victim, chan->dname);
   if ((chan_op(victim) || (glob_op(victim) && !chan_deop(victim))) &&
@@ -527,11 +527,11 @@
   }
   strncpyz(s, getchanmode(chan), sizeof s);
   if (channel_pending(chan))
-    egg_snprintf(s1, sizeof s1, "%s %s", _("Processing channel"), chan->dname);
+    snprintf(s1, sizeof s1, "%s %s", _("Processing channel"), chan->dname);
   else if (channel_active(chan))
-    egg_snprintf(s1, sizeof s1, "%s %s", _("Channel"), chan->dname);
+    snprintf(s1, sizeof s1, "%s %s", _("Channel"), chan->dname);
   else
-    egg_snprintf(s1, sizeof s1, "%s %s", _("Desiring channel"), chan->dname);
+    snprintf(s1, sizeof s1, "%s %s", _("Desiring channel"), chan->dname);
   dprintf(idx, "%s, %d member%s, mode %s:\n", s1, chan->channel.members,
 	  chan->channel.members == 1 ? "" : "s", s);
   if (chan->channel.topic)
@@ -547,13 +547,13 @@
     for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
       if (m->joined > 0) {
 	if ((now - (m->joined)) > 86400)
-	  egg_strftime(s, 6, "%d%b", localtime(&(m->joined)));
+	  strftime(s, 6, "%d%b", localtime(&(m->joined)));
 	else
-	  egg_strftime(s, 6, "%H:%M", localtime(&(m->joined)));
+	  strftime(s, 6, "%H:%M", localtime(&(m->joined)));
       } else
 	strncpyz(s, " --- ", sizeof s);
       if (m->user == NULL) {
-	egg_snprintf(s1, sizeof s1, "%s!%s", m->nick, m->userhost);
+	snprintf(s1, sizeof s1, "%s!%s", m->nick, m->userhost);
 	m->user = get_user_by_host(s1);
       }
       if (m->user == NULL) {
@@ -635,11 +635,11 @@
       else {
 	/* Determine idle time */
 	if (now - (m->last) > 86400)
-	  egg_snprintf(s1, sizeof s1, "%2lud", ((now - (m->last)) / 86400));
+	  snprintf(s1, sizeof s1, "%2lud", ((now - (m->last)) / 86400));
 	else if (now - (m->last) > 3600)
-	  egg_snprintf(s1, sizeof s1, "%2luh", ((now - (m->last)) / 3600));
+	  snprintf(s1, sizeof s1, "%2luh", ((now - (m->last)) / 3600));
 	else if (now - (m->last) > 180)
-	  egg_snprintf(s1, sizeof s1, "%2lum", ((now - (m->last)) / 60));
+	  snprintf(s1, sizeof s1, "%2lum", ((now - (m->last)) / 60));
 	else
 	  strncpyz(s1, "   ", sizeof s1);
 	dprintf(idx, "%c%s%s %s%s %s %c %s  %s\n", chanflag, m->nick,
@@ -833,7 +833,7 @@
   }
   if (strlen(hand) > HANDLEN)
     hand[HANDLEN] = 0;
-  egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+  snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
   u = get_user_by_host(s);
   if (u) {
     dprintf(idx, "%s is already known as %s.\n", nick, u->handle);
@@ -841,7 +841,7 @@
   }
   u = get_user_by_handle(userlist, hand);
   if (u && (u->flags & (USER_OWNER|USER_MASTER)) &&
-      !(atr & USER_OWNER) && egg_strcasecmp(dcc[idx].nick, hand)) {
+      !(atr & USER_OWNER) && strcasecmp(dcc[idx].nick, hand)) {
     dprintf(idx, "You can't add hostmasks to the bot owner/master.\n");
     return;
   }
@@ -899,7 +899,7 @@
     return;
   }
   get_user_flagrec(u, &user, chan->dname);
-  egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+  snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
   u = get_user_by_host(s);
   if (!u) {
     dprintf(idx, "%s is not a valid user.\n", nick);
@@ -913,7 +913,7 @@
    * so deluser on a channel they're not on should work
    */
   /* Shouldn't allow people to remove permanent owners (guppy 9Jan1999) */
-  if ((glob_owner(victim) && egg_strcasecmp(dcc[idx].nick, nick)) ||
+  if ((glob_owner(victim) && strcasecmp(dcc[idx].nick, nick)) ||
       isowner(u->handle)) {
     dprintf(idx, "Can't remove the bot owner!\n");
   } else if (glob_botmast(victim) && !glob_owner(user)) {
Index: eggdrop1.7/src/mod/irc.mod/irc.c
diff -u eggdrop1.7/src/mod/irc.mod/irc.c:1.69 eggdrop1.7/src/mod/irc.mod/irc.c:1.70
--- eggdrop1.7/src/mod/irc.mod/irc.c:1.69	Sat Oct 13 10:55:33 2001
+++ eggdrop1.7/src/mod/irc.mod/irc.c	Thu Oct 18 20:55:08 2001
@@ -2,7 +2,7 @@
  * irc.c -- part of irc.mod
  *   support for channels within the bot
  *
- * $Id: irc.c,v 1.69 2001/10/13 15:55:33 tothwolf Exp $
+ * $Id: irc.c,v 1.70 2001/10/19 01:55:08 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -143,7 +143,7 @@
   get_user_flagrec(u, &fr, chan->dname);
 
   /* Get current time into a string */
-  egg_strftime(ct, 7, "%d %b", localtime(&now));
+  strftime(ct, 7, "%d %b", localtime(&now));
 
   /* Put together log and kick messages */
   reason[0] = 0;
Index: eggdrop1.7/src/mod/irc.mod/mode.c
diff -u eggdrop1.7/src/mod/irc.mod/mode.c:1.56 eggdrop1.7/src/mod/irc.mod/mode.c:1.57
--- eggdrop1.7/src/mod/irc.mod/mode.c:1.56	Sun Oct 14 16:01:09 2001
+++ eggdrop1.7/src/mod/irc.mod/mode.c	Thu Oct 18 20:55:08 2001
@@ -4,7 +4,7 @@
  *   channel mode changes and the bot's reaction to them
  *   setting and getting the current wanted channel modes
  *
- * $Id: mode.c,v 1.56 2001/10/14 21:01:09 tothwolf Exp $
+ * $Id: mode.c,v 1.57 2001/10/19 01:55:08 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -655,7 +655,7 @@
       for (b = cycle ? chan->bans : global_bans; b; b = b->next) {
 	if (wild_match(b->mask, who)) {
 	  if (b->desc && b->desc[0] != '@')
-	    egg_snprintf(resn, sizeof resn, "%s%s", _("banned: "), b->desc);
+	    snprintf(resn, sizeof resn, "%s%s", _("banned: "), b->desc);
 	  else
 	    resn[0] = 0;
 	}
Index: eggdrop1.7/src/mod/irc.mod/msgcmds.c
diff -u eggdrop1.7/src/mod/irc.mod/msgcmds.c:1.30 eggdrop1.7/src/mod/irc.mod/msgcmds.c:1.31
--- eggdrop1.7/src/mod/irc.mod/msgcmds.c:1.30	Thu Oct 11 13:24:02 2001
+++ eggdrop1.7/src/mod/irc.mod/msgcmds.c	Thu Oct 18 20:55:08 2001
@@ -2,7 +2,7 @@
  * msgcmds.c -- part of irc.mod
  *   all commands entered via /MSG
  *
- * $Id: msgcmds.c,v 1.30 2001/10/11 18:24:02 tothwolf Exp $
+ * $Id: msgcmds.c,v 1.31 2001/10/19 01:55:08 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -51,7 +51,7 @@
     dprintf(DP_HELP, _("NOTICE %s :Either you are using someone elses nickname or you need to type: /MSG %s IDENT (password)\n"), nick, botname);
     return 1;
   }
-  egg_snprintf(s, sizeof s, "%s!%s", nick, h);
+  snprintf(s, sizeof s, "%s!%s", nick, h);
   if (u_match_mask(global_bans, s)) {
     dprintf(DP_HELP, "NOTICE %s :%s.\n", nick, _("You're banned, goober."));
     return 1;
@@ -59,7 +59,7 @@
   if (atr & USER_COMMON) {
     maskhost(s, host);
     strcpy(s, host);
-    egg_snprintf(host, sizeof host, "%s!%s", nick, s + 2);
+    snprintf(host, sizeof host, "%s!%s", nick, s + 2);
     userlist = adduser(userlist, handle, host, "-", USER_DEFAULT);
     putlog(LOG_MISC, "*", "%s %s (%s) -- %s",
 	   _("Introduced to"), nick, host, _("common site"));
@@ -104,7 +104,7 @@
     /* Notify the user that his/her handle was truncated. */
     dprintf(DP_HELP, _("NOTICE %s :Your nick was too long and therefore it was truncated to %s.\n"), nick, handle);
   if (notify_new[0]) {
-    egg_snprintf(s, sizeof s, _("introduced to %s from %s"), nick, host);
+    snprintf(s, sizeof s, _("introduced to %s from %s"), nick, host);
     strcpy(s1, notify_new);
     while (s1[0]) {
       p1 = strchr(s1, ',');
@@ -216,7 +216,7 @@
       struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
 
       putlog(LOG_CMDS, "*", "(%s!%s) !*! IDENT %s", nick, host, who);
-      egg_snprintf(s, sizeof s, "%s!%s", nick, host);
+      snprintf(s, sizeof s, "%s!%s", nick, host);
       maskhost(s, s1);
       dprintf(DP_HELP, "NOTICE %s :%s: %s\n", nick, _("Added hostmask"), s1);
       addhost_by_handle(who, s1);
@@ -325,7 +325,7 @@
       dprintf(DP_HELP, "NOTICE %s :%s\n", nick, _("Your info line is locked"));
       return 1;
     }
-    if (!egg_strcasecmp(par, "none")) {
+    if (!strcasecmp(par, "none")) {
       par[0] = 0;
       if (chname) {
 	set_handle_chaninfo(userlist, u->handle, chname, NULL);
@@ -412,7 +412,7 @@
   for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
     struct userrec *u;
 
-    egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+    snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
     u = get_user_by_host(s);
     info = get_user(&USERENTRY_INFO, u);
     if (u && (u->flags & USER_BOT))
@@ -486,7 +486,7 @@
     for (chan = chanset; chan && !ok; chan = chan->next) {
       m = ismember(chan, par);
       if (m) {
-	egg_snprintf(s, sizeof s, "%s!%s", par, m->userhost);
+	snprintf(s, sizeof s, "%s!%s", par, m->userhost);
 	u2 = get_user_by_host(s);
 	if (u2) {
 	  ok = 1;
@@ -506,13 +506,13 @@
   if (s2 && s2[0] && !(u2->flags & USER_BOT))
     dprintf(DP_HELP, "NOTICE %s :[%s] %s\n", nick, u2->handle, s2);
   for (xk = get_user(&USERENTRY_XTRA, u2); xk; xk = xk->next)
-    if (!egg_strcasecmp(xk->key, "EMAIL"))
+    if (!strcasecmp(xk->key, "EMAIL"))
       dprintf(DP_HELP, "NOTICE %s :[%s] email: %s\n", nick, u2->handle,
 	      xk->data);
   ok = 0;
   for (chan = chanset; chan; chan = chan->next) {
     if (hand_on_chan(chan, u2)) {
-      egg_snprintf(s1, sizeof s1, "NOTICE %s :[%s] %s %s.", nick, u2->handle,
+      snprintf(s1, sizeof s1, "NOTICE %s :[%s] %s %s.", nick, u2->handle,
 		   _("Now on channel"), chan->dname);
       ok = 1;
     } else {
@@ -524,15 +524,15 @@
 	   (glob_op(fr) && !chan_deop(fr)) ||
 	   glob_friend(fr) || chan_op(fr) || chan_friend(fr))) {
 	tt = cr->laston;
-	egg_strftime(s, 14, "%b %d %H:%M", localtime(&tt));
+	strftime(s, 14, "%b %d %H:%M", localtime(&tt));
 	ok = 1;
-	egg_snprintf(s1, sizeof s1, "NOTICE %s :[%s] %s %s on %s", nick, u2->handle,
+	snprintf(s1, sizeof s1, "NOTICE %s :[%s] %s %s on %s", nick, u2->handle,
 		     _("Last seen at"), s, chan->dname);
       }
     }
   }
   if (!ok)
-    egg_snprintf(s1, sizeof s1, "NOTICE %s :[%s] %s", nick, u2->handle, _("Never joined one of my channels."));
+    snprintf(s1, sizeof s1, "NOTICE %s :[%s] %s", nick, u2->handle, _("Never joined one of my channels."));
   if (u2->flags & USER_OP)
     strcat(s1, _("  (is a global op)"));
   if (u2->flags & USER_BOT)
@@ -852,9 +852,9 @@
   putlog(LOG_CMDS, "*", "(%s!%s) !%s! DIE", nick, host, u->handle);
   dprintf(-serv, "NOTICE %s :%s\n", nick, _("Bot shut down beginning...."));
   if (!par[0])
-    egg_snprintf(s, sizeof s, "BOT SHUTDOWN (authorized by %s)", u->handle);
+    snprintf(s, sizeof s, "BOT SHUTDOWN (authorized by %s)", u->handle);
   else
-    egg_snprintf(s, sizeof s, "BOT SHUTDOWN (%s: %s)", u->handle, par);
+    snprintf(s, sizeof s, "BOT SHUTDOWN (%s: %s)", u->handle, par);
   chatout("*** %s\n", s);
   botnet_send_chat(-1, botnetnick, s);
   botnet_send_bye();
@@ -864,7 +864,7 @@
     nuke_server(par);
   write_userfile(-1);
   sleep(1);			/* Give the server time to understand */
-  egg_snprintf(s, sizeof s, "DEAD BY REQUEST OF %s!%s", nick, host);
+  snprintf(s, sizeof s, "DEAD BY REQUEST OF %s!%s", nick, host);
   fatal(s, 0);
   return 1;
 }
Index: eggdrop1.7/src/mod/irc.mod/tclirc.c
diff -u eggdrop1.7/src/mod/irc.mod/tclirc.c:1.22 eggdrop1.7/src/mod/irc.mod/tclirc.c:1.23
--- eggdrop1.7/src/mod/irc.mod/tclirc.c:1.22	Sat Jun 30 09:51:16 2001
+++ eggdrop1.7/src/mod/irc.mod/tclirc.c	Thu Oct 18 20:55:08 2001
@@ -1,7 +1,7 @@
 /*
  * tclirc.c -- part of irc.mod
  *
- * $Id: tclirc.c,v 1.22 2001/06/30 14:51:16 guppy Exp $
+ * $Id: tclirc.c,v 1.23 2001/10/19 01:55:08 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -620,7 +620,7 @@
     for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
       simple_sprintf(s, "%s!%s", m->nick, m->userhost);
       u = get_user_by_host(s);
-      if (u && !egg_strcasecmp(u->handle, argv[1])) {
+      if (u && !strcasecmp(u->handle, argv[1])) {
 	Tcl_AppendResult(irp, m->nick, NULL);
 	return TCL_OK;
       }
Index: eggdrop1.7/src/mod/module.h
diff -u eggdrop1.7/src/mod/module.h:1.68 eggdrop1.7/src/mod/module.h:1.69
--- eggdrop1.7/src/mod/module.h:1.68	Wed Oct 17 21:57:51 2001
+++ eggdrop1.7/src/mod/module.h	Thu Oct 18 20:55:06 2001
@@ -1,7 +1,7 @@
 /*
  * module.h
  *
- * $Id: module.h,v 1.68 2001/10/18 02:57:51 stdarg Exp $
+ * $Id: module.h,v 1.69 2001/10/19 01:55:06 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -29,7 +29,7 @@
 #define MAKING_MODS
 
 /* Just include *all* the include files...it's slower but EASIER */
-#include "src/main.h"
+#include "src/main.h"		/* NOTE: when removing this, include config.h */
 #include "modvals.h"
 #include "src/tandem.h"
 #include "src/registry.h"
@@ -47,28 +47,11 @@
  * held responsible for mental break-downs caused by this file <G>
  */
 
-#undef feof
+/* #undef feof */
 #undef dprintf
 #undef Context
 #undef ContextNote
 
-/* Compability functions. */
-#ifdef egg_inet_aton
-#  undef egg_inet_aton
-#endif
-#ifdef egg_vsnprintf
-#  undef egg_vsnprintf
-#endif
-#ifdef egg_snprintf
-#  undef egg_snprintf
-#endif
-#ifdef egg_strcasecmp
-#  undef egg_strcasecmp
-#endif
-#ifdef egg_strncasecmp
-#  undef egg_strncasecmp
-#endif
-
 #if defined (__CYGWIN__) && !defined(STATIC)
 #  define EXPORT_SCOPE	__declspec(dllexport)
 #else
@@ -193,7 +176,9 @@
 #define open_telnet ((int (*) (char *, int))global[87])
 /* 88 - 91 */
 #define check_bind_event ((void * (*) (const char *))global[88])
-/* 89: my_memcpy / egg_memcpy -- UNUSED (Tothwolf) */
+#ifndef HAVE_MEMCPY
+# define memcpy ((void * (*) (void *, const void *, size_t))global[89])
+#endif
 /* #define my_atoul ((IP(*)(char *))global[90]) */
 #define my_strcpy ((int (*)(char *, const char *))global[91])
 /* 92 - 95 */
@@ -399,14 +384,26 @@
 #define sock_has_data ((int(*)(int, int))global[248])
 #define bots_in_subtree ((int (*)(tand_t *))global[249])
 #define users_in_subtree ((int (*)(tand_t *))global[250])
-#define egg_inet_aton ((int (*)(const char *cp, struct in_addr *addr))global[251])
+#ifndef HAVE_INET_ATON
+# define inet_aton ((int (*)(const char *cp, struct in_addr *addr))global[251])
+#endif
 /* 252 - 255 */
-#define egg_snprintf (global[252])
-#define egg_vsnprintf ((int (*)(char *, size_t, const char *, va_list))global[253])
-/* 254: egg_memset -- UNUSED (Tothwolf) */
-#define egg_strcasecmp ((int (*)(const char *, const char *))global[255])
+#ifndef HAVE_SNPRINTF
+# define snprintf (global[252])
+#endif
+#ifndef HAVE_VSNPRINTF
+# define vsnprintf ((int (*)(char *, size_t, const char *, va_list))global[253])
+#endif
+#ifndef HAVE_MEMSET
+# define memset ((void *(*)(void *, int, size_t))global[254])
+#endif
+#ifndef HAVE_STRCASECMP
+# define strcasecmp ((int (*)(const char *, const char *))global[255])
+#endif
 /* 256 - 259 */
-#define egg_strncasecmp ((int (*)(const char *, const char *, size_t))global[256])
+#ifndef HAVE_STRNCASECMP
+# define strncasecmp ((int (*)(const char *, const char *, size_t))global[256])
+#endif
 #define is_file ((int (*)(const char *))global[257])
 #define must_be_owner (*(int *)(global[258]))
 #define tandbot (*(tand_t **)(global[259]))
@@ -438,15 +435,31 @@
 #define kill_bot ((void (*)(char *, char *))global[273])
 #define quit_msg ((char *)(global[274]))
 #define add_bind_table2 ((bind_table_t *(*)(const char *, int, char *, int, int))global[275])
-/* 276 - 280 */
+/* 276 - 279 */
 #define del_bind_table2 ((void (*)(bind_table_t *))global[276])
 #define add_builtins2 ((void (*)(bind_table_t *, cmd_t *))global[277])
 #define rem_builtins2 ((void (*)(bind_table_t *, cmd_t *))global[278])
 #define find_bind_table2 ((bind_table_t *(*)(const char *))global[279])
+/* 280 - 283 */
 #define check_bind ((int (*)(bind_table_t *, const char *, struct flag_record *, ...))global[280])
-/* 281 - 285 */
 #define registry_lookup ((int (*)(const char *, const char *, Function *, void **))global[281])
 #define registry_add_simple_chains ((int (*)(registry_simple_chain_t *))global[282])
+#ifndef HAVE_STRFTIME
+# define strftime ((size_t (*)(char *, size_t, const char *, const struct tm *))global[283])
+#endif
+/* 284 - 287 */
+#ifndef HAVE_INET_NTOP
+# define inet_ntop ((const char (*)(int, const void *, char *, socklen_t size))global[284])
+#endif
+#ifndef HAVE_INET_PTON
+# define inet_pton ((int (*)(int, const char *, void *))global[285])
+#endif
+#ifndef HAVE_VASPRINTF
+# define vasprintf ((int (*)(char **, const char *, va_list))global[286])
+#endif
+#ifndef HAVE_ASPRINTF
+# define asprintf ((int (*)(char **, const char *, ...))global[287])
+#endif
 
 /* This is for blowfish module, couldnt be bothered making a whole new .h
  * file for it ;)
Index: eggdrop1.7/src/mod/notes.mod/cmdsnote.c
diff -u eggdrop1.7/src/mod/notes.mod/cmdsnote.c:1.14 eggdrop1.7/src/mod/notes.mod/cmdsnote.c:1.15
--- eggdrop1.7/src/mod/notes.mod/cmdsnote.c:1.14	Wed Oct 10 05:44:07 2001
+++ eggdrop1.7/src/mod/notes.mod/cmdsnote.c	Thu Oct 18 20:55:08 2001
@@ -2,7 +2,7 @@
  * cmdsnote.c -- part of notes.mod
  *   handles all notes interaction over the party line
  *
- * $Id: cmdsnote.c,v 1.14 2001/10/10 10:44:07 tothwolf Exp $
+ * $Id: cmdsnote.c,v 1.15 2001/10/19 01:55:08 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -159,7 +159,7 @@
     dprintf(idx, "%s\n", _("No such user."));
     return;
   }
-  if ((u1->flags & USER_OWNER) && egg_strcasecmp(handle, dcc[idx].nick)) {
+  if ((u1->flags & USER_OWNER) && strcasecmp(handle, dcc[idx].nick)) {
     dprintf(idx, "%s\n", _("Cant change notes forwarding of the bot owner.\n"));
     return;
   }
@@ -192,15 +192,15 @@
     return;
   }
   fcn = newsplit(&par);
-  if (!egg_strcasecmp(fcn, "index"))
+  if (!strcasecmp(fcn, "index"))
     notes_read(dcc[idx].nick, "", "+", idx);
-  else if (!egg_strcasecmp(fcn, "read")) {
-    if (!egg_strcasecmp(par, "all"))
+  else if (!strcasecmp(fcn, "read")) {
+    if (!strcasecmp(par, "all"))
       notes_read(dcc[idx].nick, "", "-", idx);
     else
       notes_read(dcc[idx].nick, "", par, idx);
-  } else if (!egg_strcasecmp(fcn, "erase")) {
-    if (!egg_strcasecmp(par, "all"))
+  } else if (!strcasecmp(fcn, "erase")) {
+    if (!strcasecmp(par, "all"))
       notes_del(dcc[idx].nick, "", "-", idx);
     else
       notes_del(dcc[idx].nick, "", par, idx);
Index: eggdrop1.7/src/mod/notes.mod/notes.c
diff -u eggdrop1.7/src/mod/notes.mod/notes.c:1.39 eggdrop1.7/src/mod/notes.mod/notes.c:1.40
--- eggdrop1.7/src/mod/notes.mod/notes.c:1.39	Tue Oct 16 19:19:17 2001
+++ eggdrop1.7/src/mod/notes.mod/notes.c	Thu Oct 18 20:55:08 2001
@@ -5,7 +5,7 @@
  *   note cmds
  *   note ignores
  *
- * $Id: notes.c,v 1.39 2001/10/17 00:19:17 stdarg Exp $
+ * $Id: notes.c,v 1.40 2001/10/19 01:55:08 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -97,7 +97,7 @@
       if ((s[0]) && (s[0] != '#') && (s[0] != ';')) {	/* Not comment */
 	s1 = s;
 	to = newsplit(&s1);
-	if (!egg_strcasecmp(to, user))
+	if (!strcasecmp(to, user))
 	  tot++;
       }
     }
@@ -114,7 +114,7 @@
   char s[513], *to, *s1;
   int tot = 0;
 
-  if (!egg_strcasecmp(oldnick, newnick))
+  if (!strcasecmp(oldnick, newnick))
     return;
   if (!notefile[0])
     return;
@@ -137,7 +137,7 @@
       if ((s[0]) && (s[0] != '#') && (s[0] != ';')) {	/* Not comment */
 	s1 = s;
 	to = newsplit(&s1);
-	if (!egg_strcasecmp(to, oldnick)) {
+	if (!strcasecmp(to, oldnick)) {
 	  tot++;
 	  fprintf(g, "%s %s\n", newnick, s1);
 	} else
@@ -225,9 +225,9 @@
     /* User is valid & has a valid forwarding address */
      strcpy(fwd, f1);		/* Only 40 bytes are stored in the userfile */
      p = strchr(fwd, '@');
-    if (p && !egg_strcasecmp(p + 1, botnetnick)) {
+    if (p && !strcasecmp(p + 1, botnetnick)) {
       *p = 0;
-      if (!egg_strcasecmp(fwd, argv[2]))
+      if (!strcasecmp(fwd, argv[2]))
 	/* They're forwarding to themselves on the same bot, llama's */
 	ok = 0;
       strcpy(fwd2, fwd);
@@ -239,7 +239,7 @@
       if ((f2 = get_user(&USERENTRY_FWD, ur2))) {
 	strcpy(fwd2, f2);
 	splitc(fwd2, fwd2, '@');
-	if (!egg_strcasecmp(fwd2, argv[2]))
+	if (!strcasecmp(fwd2, argv[2]))
 	/* They're forwarding to someone who forwards back to them! */
 	ok = 0;
       }
@@ -256,7 +256,7 @@
 	q++;
 	if ((r = strchr(q, ' '))) {
 	  *r = 0;
-	  if (!egg_strcasecmp(fwd, q))
+	  if (!strcasecmp(fwd, q))
 	    ok = 0;
 	  *r = ' ';
 	}
@@ -413,7 +413,7 @@
       if ((s[0]) && (s[0] != '#') && (s[0] != ';')) {	/* Not comment */
 	s1 = s;
 	to = newsplit(&s1);
-	if (!egg_strcasecmp(to, argv[1])) {
+	if (!strcasecmp(to, argv[1])) {
 	  read++;
 	  if (!notes_in(nl, read)) {
 	    fprintf(g, "%s %s\n", to, s1);
@@ -502,13 +502,13 @@
       if ((s[0]) && (s[0] != '#') && (s[0] != ';')) {	/* Not comment */
 	s1 = s;
 	to = newsplit(&s1);
-	if (!egg_strcasecmp(to, hand)) {
+	if (!strcasecmp(to, hand)) {
 	  int lapse;
 
 	  from = newsplit(&s1);
 	  dt = newsplit(&s1);
 	  tt = atoi(dt);
-	  egg_strftime(wt, 14, "%b %d %H:%M", localtime(&tt));
+	  strftime(wt, 14, "%b %d %H:%M", localtime(&tt));
 	  dt = wt;
 	  lapse = (int) ((now - tt) / 86400);
 	  if (lapse > note_life - 7) {
@@ -618,7 +618,7 @@
       if ((s[0]) && (s[0] != '#') && (s[0] != ';')) {	/* Not comment */
 	s1 = s;
 	to = newsplit(&s1);
-	if (!egg_strcasecmp(to, hand)) {
+	if (!strcasecmp(to, hand)) {
 	  if (!notes_in(dl, in))
 	    fprintf(g, "%s %s\n", to, s1);
 	  else
@@ -700,7 +700,7 @@
       if ((s[0]) && (s[0] != '#') && (s[0] != ';')) {	/* Not comment */
 	s1 = s;
 	to = newsplit(&s1);
-	if (!egg_strcasecmp(to, argv[1])) {
+	if (!strcasecmp(to, argv[1])) {
 	  read++;
 	  if (notes_in(nl, read)) {
 	    count++;
@@ -750,19 +750,19 @@
       return 0;
   }
   fcn = newsplit(&par);
-  if (!egg_strcasecmp(fcn, "INDEX"))
+  if (!strcasecmp(fcn, "INDEX"))
     notes_read(u->handle, nick, "+", -1);
-  else if (!egg_strcasecmp(fcn, "READ")) {
-    if (!egg_strcasecmp(par, "ALL"))
+  else if (!strcasecmp(fcn, "READ")) {
+    if (!strcasecmp(par, "ALL"))
       notes_read(u->handle, nick, "-", -1);
     else
       notes_read(u->handle, nick, par, -1);
-  } else if (!egg_strcasecmp(fcn, "ERASE")) {
-    if (!egg_strcasecmp(par, "ALL"))
+  } else if (!strcasecmp(fcn, "ERASE")) {
+    if (!strcasecmp(par, "ALL"))
       notes_del(u->handle, nick, "-", -1);
     else
       notes_del(u->handle, nick, par, -1);
-  } else if (!egg_strcasecmp(fcn, "TO")) {
+  } else if (!strcasecmp(fcn, "TO")) {
     char *to;
     int i;
     FILE *f;
@@ -783,7 +783,7 @@
       return 1;
     }
     for (i = 0; i < dcc_total; i++) {
-      if ((!egg_strcasecmp(dcc[i].nick, to)) &&
+      if ((!strcasecmp(dcc[i].nick, to)) &&
 	  (dcc[i].type->flags & DCT_GETNOTES)) {
 	int aok = 1;
 
@@ -844,7 +844,7 @@
 	  k = num_notes(u->handle);
 	  for (l = 0; l < dcc_total; l++)
 	    if ((dcc[l].type->flags & DCT_CHAT) &&
-		!egg_strcasecmp(dcc[l].nick, u->handle)) {
+		!strcasecmp(dcc[l].nick, u->handle)) {
 	      k = 0;		/* They already know they have notes */
 	      break;
 	    }
@@ -871,7 +871,7 @@
 {
   int idx = findanyidx(sock);
 
-  if (egg_strcasecmp(bot, botnetnick))
+  if (strcasecmp(bot, botnetnick))
     return;
   if (msg && msg[0])
     dprintf(idx, "%s\n", _("Notes will be stored."));
@@ -894,7 +894,7 @@
   if (notify_onjoin) { /* drummer */
     for (j = 0; j < dcc_total; j++)
       if ((dcc[j].type->flags & DCT_CHAT)
-	  && (!egg_strcasecmp(dcc[j].nick, handle))) {
+	  && (!strcasecmp(dcc[j].nick, handle))) {
 	return;			/* They already know they have notes */
       }
 
@@ -926,7 +926,7 @@
     return NULL;
   /* Search for the notes ignore list entry */
   for (xk = ue->u.extra; xk; xk = xk->next)
-    if (xk->key && !egg_strcasecmp(xk->key, NOTES_IGNKEY)) {
+    if (xk->key && !strcasecmp(xk->key, NOTES_IGNKEY)) {
       nxk = xk;
       break;
     }
Index: eggdrop1.7/src/mod/server.mod/cmdsserv.c
diff -u eggdrop1.7/src/mod/server.mod/cmdsserv.c:1.11 eggdrop1.7/src/mod/server.mod/cmdsserv.c:1.12
--- eggdrop1.7/src/mod/server.mod/cmdsserv.c:1.11	Fri Aug 10 18:51:21 2001
+++ eggdrop1.7/src/mod/server.mod/cmdsserv.c	Thu Oct 18 20:55:08 2001
@@ -2,7 +2,7 @@
  * cmdsserv.c -- part of server.mod
  *   handles commands from a user via dcc that cause server interaction
  *
- * $Id: cmdsserv.c,v 1.11 2001/08/10 23:51:21 ite Exp $
+ * $Id: cmdsserv.c,v 1.12 2001/10/19 01:55:08 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -36,11 +36,11 @@
     dprintf(idx, "My server list:\n");
     i = 0;
     for (; x; x = x->next) {
-      egg_snprintf(s, sizeof s, "%14s %20.20s:%-10d",
+      snprintf(s, sizeof s, "%14s %20.20s:%-10d",
 		   (i == curserv) ? "I am here ->" : "", x->name,
 		   x->port ? x->port : default_port);
       if (x->realname)
-	egg_snprintf(s + 46, sizeof s - 46, " (%-.20s)", x->realname);
+	snprintf(s + 46, sizeof s - 46, " (%-.20s)", x->realname);
       dprintf(idx, "%s\n", s);
       i++;
     }
@@ -91,26 +91,26 @@
     dprintf(idx, "Usage: clearqueue <mode|server|help|all>\n");
     return;
   }
-  if (!egg_strcasecmp(par, "all")) {
+  if (!strcasecmp(par, "all")) {
     msgs = modeq.tot + mq.tot + hq.tot;
     msgq_clear(&modeq);
     msgq_clear(&mq);
     msgq_clear(&hq);
     double_warned = burst = 0;
     dprintf(idx, "Removed %d msgs from all queues\n", msgs);
-  } else if (!egg_strcasecmp(par, "mode")) {
+  } else if (!strcasecmp(par, "mode")) {
     msgs = modeq.tot;
     msgq_clear(&modeq);
     if (mq.tot == 0)
       burst = 0;
     double_warned = 0;
     dprintf(idx, "Removed %d msgs from the %s queue\n", msgs, "mode");
-  } else if (!egg_strcasecmp(par, "help")) {
+  } else if (!strcasecmp(par, "help")) {
     msgs = hq.tot;
     msgq_clear(&hq);
     double_warned = 0;
     dprintf(idx, "Removed %d msgs from the %s queue\n", msgs, "help");
-  } else if (!egg_strcasecmp(par, "server")) {
+  } else if (!strcasecmp(par, "server")) {
     msgs = mq.tot;
     msgq_clear(&mq);
     if (modeq.tot == 0)
Index: eggdrop1.7/src/mod/server.mod/server.c
diff -u eggdrop1.7/src/mod/server.mod/server.c:1.90 eggdrop1.7/src/mod/server.mod/server.c:1.91
--- eggdrop1.7/src/mod/server.mod/server.c:1.90	Tue Oct 16 06:42:30 2001
+++ eggdrop1.7/src/mod/server.mod/server.c	Thu Oct 18 20:55:08 2001
@@ -2,7 +2,7 @@
  * server.c -- part of server.mod
  *   basic irc server support
  *
- * $Id: server.c,v 1.90 2001/10/16 11:42:30 tothwolf Exp $
+ * $Id: server.c,v 1.91 2001/10/19 01:55:08 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -259,7 +259,7 @@
     return 0;
   }
   penalty = (1 + i / 100);
-  if (!egg_strcasecmp(cmd, "KICK")) {
+  if (!strcasecmp(cmd, "KICK")) {
     par1 = newsplit(&msg); /* channel */
     par2 = newsplit(&msg); /* victim(s) */
     par3 = strtok(par2, ",");
@@ -273,7 +273,7 @@
       penalty += ii;
       par3 = strtok(NULL, ",");
     }
-  } else if (!egg_strcasecmp(cmd, "MODE")) {
+  } else if (!strcasecmp(cmd, "MODE")) {
     i = 0;
     par1 = newsplit(&msg); /* channel */
     par2 = newsplit(&msg); /* mode(s) */
@@ -297,7 +297,7 @@
       par3 = strtok(NULL, ",");
     }
     penalty += (ii * i);
-  } else if (!egg_strcasecmp(cmd, "TOPIC")) {
+  } else if (!strcasecmp(cmd, "TOPIC")) {
     penalty++;
     par1 = newsplit(&msg); /* channel */
     par2 = newsplit(&msg); /* topic */
@@ -308,8 +308,8 @@
         strtok(NULL, ",");
       }
     }
-  } else if (!egg_strcasecmp(cmd, "PRIVMSG") ||
-	     !egg_strcasecmp(cmd, "NOTICE")) {
+  } else if (!strcasecmp(cmd, "PRIVMSG") ||
+	     !strcasecmp(cmd, "NOTICE")) {
     par1 = newsplit(&msg); /* channel(s)/nick(s) */
     /* Add one sec penalty for each recipient */
     par3 = strtok(par1, ",");
@@ -317,7 +317,7 @@
       penalty++;
       par3 = strtok(NULL, ",");
     }
-  } else if (!egg_strcasecmp(cmd, "WHO")) {
+  } else if (!strcasecmp(cmd, "WHO")) {
     par1 = newsplit(&msg); /* masks */
     par2 = strtok(par1, ",");
     while (par2) {
@@ -327,33 +327,33 @@
 	penalty += 5;
       par2 = strtok(NULL, ",");
     }
-  } else if (!egg_strcasecmp(cmd, "AWAY")) {
+  } else if (!strcasecmp(cmd, "AWAY")) {
     if (strlen(msg) > 0)
       penalty += 2;
     else
       penalty += 1;
-  } else if (!egg_strcasecmp(cmd, "INVITE")) {
+  } else if (!strcasecmp(cmd, "INVITE")) {
     /* Successful invite receives 2 or 3 penalty points. Let's go
      * with the maximum.
      */
     penalty += 3;
-  } else if (!egg_strcasecmp(cmd, "JOIN")) {
+  } else if (!strcasecmp(cmd, "JOIN")) {
     penalty += 2;
-  } else if (!egg_strcasecmp(cmd, "PART")) {
+  } else if (!strcasecmp(cmd, "PART")) {
     penalty += 4;
-  } else if (!egg_strcasecmp(cmd, "VERSION")) {
+  } else if (!strcasecmp(cmd, "VERSION")) {
     penalty += 2;
-  } else if (!egg_strcasecmp(cmd, "TIME")) {
+  } else if (!strcasecmp(cmd, "TIME")) {
     penalty += 2;
-  } else if (!egg_strcasecmp(cmd, "TRACE")) {
+  } else if (!strcasecmp(cmd, "TRACE")) {
     penalty += 2;
-  } else if (!egg_strcasecmp(cmd, "NICK")) {
+  } else if (!strcasecmp(cmd, "NICK")) {
     penalty += 3;
-  } else if (!egg_strcasecmp(cmd, "ISON")) {
+  } else if (!strcasecmp(cmd, "ISON")) {
     penalty += 1;
-  } else if (!egg_strcasecmp(cmd, "WHOIS")) {
+  } else if (!strcasecmp(cmd, "WHOIS")) {
     penalty += 2;
-  } else if (!egg_strcasecmp(cmd, "DNS")) {
+  } else if (!strcasecmp(cmd, "DNS")) {
     penalty += 2;
   } else
     penalty++; /* just add standard-penalty */
@@ -400,7 +400,7 @@
     strncpyz(stackable, stackablecmds, sizeof stackable);
     stckbl = stackable;
     while (strlen(stckbl) > 0)
-      if (!egg_strcasecmp(newsplit(&stckbl), cmd)) {
+      if (!strcasecmp(newsplit(&stckbl), cmd)) {
         found = 1;
         break;
       }
@@ -416,7 +416,7 @@
     strncpyz(stackable, stackable2cmds, sizeof stackable);
     stckbl = stackable;
     while (strlen(stckbl) > 0)
-      if (!egg_strcasecmp(newsplit(&stckbl), cmd)) {
+      if (!strcasecmp(newsplit(&stckbl), cmd)) {
         stack_method = 2;
         break;
       }    
@@ -441,8 +441,8 @@
         && !strcmp(cmd, nextcmd) && !strcmp(msg, nextmsg)
         && ((strlen(cmd) + strlen(victims) + strlen(nextto)
 	     + strlen(msg) + 2) < 510)
-        && (egg_strcasecmp(cmd, "WHO") || who_count < MAXPENALTY - 1)) {
-      if (!egg_strcasecmp(cmd, "WHO"))
+        && (strcasecmp(cmd, "WHO") || who_count < MAXPENALTY - 1)) {
+      if (!strcasecmp(cmd, "WHO"))
         who_count++;
       if (stack_method == 1)
       	simple_sprintf(victims, "%s,%s", victims, nextto);
@@ -510,7 +510,7 @@
 
   for (m = q->head; m;) {
     changed = 0;
-    if (optimize_kicks == 2 && !egg_strncasecmp(m->msg, "KICK ", 5)) {
+    if (optimize_kicks == 2 && !strncasecmp(m->msg, "KICK ", 5)) {
       newnicks[0] = 0;
       strncpyz(buf, m->msg, sizeof buf);
       if (buf[0] && (buf[strlen(buf)-1] == '\n'))
@@ -521,17 +521,17 @@
       nicks = newsplit(&msg);
       nick = strtok(nicks, ",");
       while (nick) {
-	if (!egg_strcasecmp(nick, oldnick) &&
+	if (!strcasecmp(nick, oldnick) &&
 	    ((9 + strlen(chan) + strlen(newnicks) + strlen(newnick) +
 	  strlen(nicks) + strlen(msg)) < 510)) {
 	  if (newnick)
-	    egg_snprintf(newnicks, sizeof newnicks, "%s,%s", newnicks, newnick);
+	    snprintf(newnicks, sizeof newnicks, "%s,%s", newnicks, newnick);
 	  changed = 1;
 	} else
-	  egg_snprintf(newnicks, sizeof newnicks, ",%s", nick);
+	  snprintf(newnicks, sizeof newnicks, ",%s", nick);
 	nick = strtok(NULL, ",");
       }
-      egg_snprintf(newmsg, sizeof newmsg, "KICK %s %s %s\n", chan,
+      snprintf(newmsg, sizeof newmsg, "KICK %s %s %s\n", chan,
 		   newnicks + 1, msg);
     }
     if (changed) {
@@ -570,7 +570,7 @@
   struct chanset_t *cs;
 
   for (m = q->head; m;) {
-    if (!egg_strncasecmp(m->msg, "KICK", 4)) {
+    if (!strncasecmp(m->msg, "KICK", 4)) {
       newnicks[0] = 0;
       changed = 0;
       strncpyz(buf, m->msg, sizeof buf);
@@ -594,7 +594,7 @@
 	    found = 1;
 	}
 	if (found)
-	  egg_snprintf(newnicks, sizeof newnicks, "%s,%s", newnicks, nick);
+	  snprintf(newnicks, sizeof newnicks, "%s,%s", newnicks, nick);
 	else {
 	  putlog(LOG_SRVOUT, "*", "%s isn't on any target channel, removing "
 		 "kick...", nick);
@@ -616,7 +616,7 @@
 	    q->last = 0;
 	} else {
 	  free(m->msg);
-	  egg_snprintf(newmsg, sizeof newmsg, "KICK %s %s %s\n", chan,
+	  snprintf(newmsg, sizeof newmsg, "KICK %s %s %s\n", chan,
 		       newnicks + 1, reason);
 	  m->msg = malloc(strlen(newmsg) + 1);
 	  m->len = strlen(newmsg);
@@ -656,14 +656,14 @@
     default:
       return 0;
   }
-  if (egg_strncasecmp(h->head->msg, "KICK", 4))
+  if (strncasecmp(h->head->msg, "KICK", 4))
     return 0;
   if (optimize_kicks == 2) {
     purge_kicks(h);
     if (!h->head)
       return 1;
   }
-  if (egg_strncasecmp(h->head->msg, "KICK", 4))
+  if (strncasecmp(h->head->msg, "KICK", 4))
     return 0;
   msg = h->head;
   strncpyz(buf, msg->msg, sizeof buf);
@@ -672,12 +672,12 @@
   chan = newsplit(&reason);
   nicks = newsplit(&reason);
   while (strlen(nicks) > 0) {
-    egg_snprintf(newnicks, sizeof newnicks, "%s,%s", newnicks,
+    snprintf(newnicks, sizeof newnicks, "%s,%s", newnicks,
 		 newsplit(&nicks));
     nr++;
   }
   for (m = msg->next, lm = NULL; m && (nr < kick_method);) {
-    if (!egg_strncasecmp(m->msg, "KICK", 4)) {
+    if (!strncasecmp(m->msg, "KICK", 4)) {
       changed = 0;
       newnicks2[0] = 0;
       strncpyz(buf2, m->msg, sizeof buf2);
@@ -687,17 +687,17 @@
       newsplit(&reason2);
       chan2 = newsplit(&reason2);
       nicks = newsplit(&reason2);
-      if (!egg_strcasecmp(chan, chan2) && !egg_strcasecmp(reason, reason2)) {
+      if (!strcasecmp(chan, chan2) && !strcasecmp(reason, reason2)) {
         nick = strtok(nicks, ",");
 	while (nick) {
           if ((nr < kick_method) &&
              ((9 + strlen(chan) + strlen(newnicks) + strlen(nick) +
              strlen(reason)) < 510)) {
-            egg_snprintf(newnicks, sizeof newnicks, "%s,%s", newnicks, nick);
+            snprintf(newnicks, sizeof newnicks, "%s,%s", newnicks, nick);
             nr++;
             changed = 1;
           } else
-            egg_snprintf(newnicks2, sizeof newnicks2, "%s,%s", newnicks2, nick);
+            snprintf(newnicks2, sizeof newnicks2, "%s,%s", newnicks2, nick);
 	  nick = strtok(NULL, ",");
         }
       }
@@ -715,7 +715,7 @@
             h->last = 0;
         } else {
           free(m->msg);
-          egg_snprintf(newmsg, sizeof newmsg, "KICK %s %s %s\n", chan2,
+          snprintf(newmsg, sizeof newmsg, "KICK %s %s %s\n", chan2,
 		       newnicks2 + 1, reason);
           m->msg = malloc(strlen(newmsg) + 1);
           m->len = strlen(newmsg);
@@ -729,7 +729,7 @@
     else
       m = h->head->next;
   }
-  egg_snprintf(newmsg, sizeof newmsg, "KICK %s %s %s\n", chan, newnicks + 1,
+  snprintf(newmsg, sizeof newmsg, "KICK %s %s %s\n", chan, newnicks + 1,
 	       reason);
   tputs(serv, newmsg, strlen(newmsg));
   if (debug_output) {
@@ -782,7 +782,7 @@
   if (serv < 0)
     return;
   /* No queue for PING and PONG - drummer */
-  if (!egg_strncasecmp(buf, "PING", 4) || !egg_strncasecmp(buf, "PONG", 4)) {
+  if (!strncasecmp(buf, "PING", 4) || !strncasecmp(buf, "PONG", 4)) {
     if (buf[1] == 'I' || buf[1] == 'i')
       lastpingtime = now;	/* lagmeter */
     tputs(serv, buf, len);
@@ -830,7 +830,7 @@
     if (!doublemsg)
       for (tq = tempq.head; tq; tq = tqq) {
 	tqq = tq->next;
-	if (!egg_strcasecmp(tq->msg, buf)) {
+	if (!strcasecmp(tq->msg, buf)) {
 	  if (!double_warned) {
 	    if (buf[len - 1] == '\n')
 	      buf[len - 1] = 0;
@@ -1000,10 +1000,10 @@
   if (*ptr == (-1)) {
     for (; x; x = x->next) {
       if (x->port == *port) {
-	if (!egg_strcasecmp(x->name, serv)) {
+	if (!strcasecmp(x->name, serv)) {
 	  *ptr = i;
 	  return;
-	} else if (x->realname && !egg_strcasecmp(x->realname, serv)) {
+	} else if (x->realname && !strcasecmp(x->realname, serv)) {
 	  *ptr = i;
 	  strncpyz(serv, x->realname, sizeof serv);
 	  return;
@@ -1055,7 +1055,7 @@
 
   BADARGS(7, 7, " nick user at host handle desto/chan keyword/nick text");
   CHECKVALIDITY(server_6char);
-  egg_snprintf(x, sizeof x, "%d",
+  snprintf(x, sizeof x, "%d",
 	       F(argv[1], argv[2], argv[3], argv[4], argv[5], argv[6]));
   Tcl_AppendResult(irp, x, NULL);
   return TCL_OK;
@@ -1246,7 +1246,7 @@
   if (flags & (TCL_TRACE_READS | TCL_TRACE_UNSETS)) {
     char s[40];
 
-    egg_snprintf(s, sizeof s, "%d", nick_len);
+    snprintf(s, sizeof s, "%d", nick_len);
     Tcl_SetVar2(interp, name1, name2, s, TCL_GLOBAL_ONLY);
     if (flags & TCL_TRACE_UNSETS)
       Tcl_TraceVar(irp, name1, TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
@@ -1331,7 +1331,7 @@
     Tcl_DStringInit(&ds);
     for (q = serverlist; q; q = q->next) {
       char *z = strchr(q->name, ':');
-      egg_snprintf(x, sizeof x, "%s%s%s:%d%s%s %s",
+      snprintf(x, sizeof x, "%s%s%s:%d%s%s %s",
                    z ? "[" : "", q->name, z ? "]" : "",
 		   q->port ? q->port : default_port, q->pass ? ":" : "",
 		   q->pass ? q->pass : "", q->realname ? q->realname : "");
@@ -1399,7 +1399,7 @@
   param = newsplit(&msg);
   ip = newsplit(&msg);
   prt = newsplit(&msg);
-  if (egg_strcasecmp(action, "CHAT") || egg_strcasecmp(object, botname) || !u)
+  if (strcasecmp(action, "CHAT") || strcasecmp(object, botname) || !u)
     return 0;
   get_user_flagrec(u, &fr, 0);
   if (dcc_total == max_dcc) {
@@ -1430,7 +1430,7 @@
       return 1;
     }
 debug1("|SERVER| dcc chat ip: (%s)", ip);
-    if (egg_inet_aton(ip, &ip4))
+    if (inet_aton(ip, &ip4))
 	strncpyz(dcc[i].addr, inet_ntoa(ip4), ADDRLEN);
     else
 	strncpyz(dcc[i].addr, ip, ADDRLEN);
@@ -1457,7 +1457,7 @@
   char buf[512];
   struct flag_record fr = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
 
-  egg_snprintf(buf, sizeof buf, "%d", dcc[i].port);
+  snprintf(buf, sizeof buf, "%d", dcc[i].port);
   dcc[i].sock = getsock(0);
   if (dcc[i].sock < 0 ||
           open_telnet_dcc(dcc[i].sock, dcc[i].addr, buf) < 0) {
@@ -1571,12 +1571,12 @@
     nick_juped = 0;	/* WHY?? -- drummer */
 
     daysdur(now, server_online, s1);
-    egg_snprintf(s, sizeof s, "(connected %s)", s1);
+    snprintf(s, sizeof s, "(connected %s)", s1);
     if ((server_lag) && !(waiting_for_awake)) {
 	if (server_lag == (-1))
-	    egg_snprintf(s1, sizeof s1, " (bad pong replies)");
+	    snprintf(s1, sizeof s1, " (bad pong replies)");
 	else
-	    egg_snprintf(s1, sizeof s1, " (lag: %ds)", server_lag);
+	    snprintf(s1, sizeof s1, " (lag: %ds)", server_lag);
 	strcat(s, s1);
     }
   }
Index: eggdrop1.7/src/mod/server.mod/servmsg.c
diff -u eggdrop1.7/src/mod/server.mod/servmsg.c:1.78 eggdrop1.7/src/mod/server.mod/servmsg.c:1.79
--- eggdrop1.7/src/mod/server.mod/servmsg.c:1.78	Wed Oct 17 21:57:52 2001
+++ eggdrop1.7/src/mod/server.mod/servmsg.c	Thu Oct 18 20:55:08 2001
@@ -1,7 +1,7 @@
 /*
  * servmsg.c -- part of server.mod
  *
- * $Id: servmsg.c,v 1.78 2001/10/18 02:57:52 stdarg Exp $
+ * $Id: servmsg.c,v 1.79 2001/10/19 01:55:08 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -201,7 +201,7 @@
 	        (chan->name[0]) ? chan->name : chan->dname,
 	        chan->channel.key[0] ? chan->channel.key : chan->key_prot);
     }
-  if (egg_strcasecmp(from, dcc[servidx].host)) {
+  if (strcasecmp(from, dcc[servidx].host)) {
     putlog(LOG_MISC, "*", "(%s claims to be %s; updating server list)",
 	   dcc[servidx].host, from);
     for (i = curserv; i > 0 && x != NULL; i--)
@@ -234,7 +234,7 @@
 
   for (x = serverlist, i = 0; x; x = x->next, i++)
     if (i == curserv) {
-      if (egg_strcasecmp(from, x->realname ? x->realname : x->name))
+      if (strcasecmp(from, x->realname ? x->realname : x->name))
 	return 0;
       break;
     }
@@ -308,12 +308,12 @@
   /* Okay, make sure i'm not flood-checking myself */
   if (match_my_nick(floodnick))
     return 0;
-  if (!egg_strcasecmp(floodhost, botuserhost))
+  if (!strcasecmp(floodhost, botuserhost))
     return 0;			/* My user at host (?) */
   p = strchr(floodhost, '@');
   if (p) {
     p++;
-    if (egg_strcasecmp(lastmsghost[which], p)) {	/* New */
+    if (strcasecmp(lastmsghost[which], p)) {	/* New */
       strcpy(lastmsghost[which], p);
       lastmsgtime[which] = now;
       lastmsgs[which] = 0;
@@ -428,7 +428,7 @@
 	    if (!ignoring || trigger_on_ignore) {
 	      if (!check_tcl_ctcp(nick, uhost, u, to, code, ctcp) &&
 		  !ignoring) {
-		if (!egg_strcasecmp(code, "DCC")) {
+		if (!strcasecmp(code, "DCC")) {
 		  /* If it gets this far unhandled, it means that
 		   * the user is totally unknown.
 		   */
@@ -627,7 +627,7 @@
     if (strncmp(botname, origbotname, strlen(botname))) {
       /* See if my nickname is in use and if if my nick is right.  */
 	alt = get_altbotnick();
-	if (alt[0] && egg_strcasecmp (botname, alt))
+	if (alt[0] && strcasecmp (botname, alt))
 	  dprintf(DP_SERVER, "ISON :%s %s %s\n", botname, origbotname, alt);
 	else
           dprintf(DP_SERVER, "ISON :%s %s\n", botname, origbotname);
@@ -828,7 +828,7 @@
         putlog(LOG_MISC, "*", _("Switching back to nick %s"), origbotname);
         dprintf(DP_SERVER, "NICK %s\n", origbotname);
       } else if (alt[0] && !irccmp(nick, alt)
-		 && egg_strcasecmp(botname, origbotname)) {
+		 && strcasecmp(botname, origbotname)) {
         putlog(LOG_MISC, "*", _("Switching back to altnick %s"), alt);
         dprintf(DP_SERVER, "NICK %s\n", alt);
       }
@@ -840,7 +840,7 @@
       putlog(LOG_MISC, "*", _("Switching back to nick %s"), origbotname);
       dprintf(DP_SERVER, "NICK %s\n", origbotname);
     } else if (alt[0] && !irccmp(nick, alt) &&
-	    egg_strcasecmp(botname, origbotname)) {
+	    strcasecmp(botname, origbotname)) {
       putlog(LOG_MISC, "*", _("Switching back to altnick %s"), altnick);
       dprintf(DP_SERVER, "NICK %s\n", altnick);
     }
@@ -1031,7 +1031,7 @@
     return 0;
     
   if (match_my_nick(n2))
-    egg_snprintf(botuserhost, sizeof botuserhost, "%s@%s", u, h);
+    snprintf(botuserhost, sizeof botuserhost, "%s@%s", u, h);
   
   return 0;
 }
Index: eggdrop1.7/src/mod/server.mod/tclserv.c
diff -u eggdrop1.7/src/mod/server.mod/tclserv.c:1.10 eggdrop1.7/src/mod/server.mod/tclserv.c:1.11
--- eggdrop1.7/src/mod/server.mod/tclserv.c:1.10	Wed Oct 10 05:44:07 2001
+++ eggdrop1.7/src/mod/server.mod/tclserv.c	Thu Oct 18 20:55:08 2001
@@ -1,7 +1,7 @@
 /*
  * tclserv.c -- part of server.mod
  *
- * $Id: tclserv.c,v 1.10 2001/10/10 10:44:07 tothwolf Exp $
+ * $Id: tclserv.c,v 1.11 2001/10/19 01:55:08 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -38,7 +38,7 @@
 
   BADARGS(2, 3, " text ?options?");
   if ((argc == 3) &&
-      egg_strcasecmp(argv[2], "-next") && egg_strcasecmp(argv[2], "-normal")) {
+      strcasecmp(argv[2], "-next") && strcasecmp(argv[2], "-normal")) {
       Tcl_AppendResult(irp, "unknown putquick option: should be one of: ",
 		       "-normal -next", NULL);
     return TCL_ERROR;
@@ -51,7 +51,7 @@
    p = strchr(s, '\r');
   if (p != NULL)
     *p = 0;
-  if (argc == 3 && !egg_strcasecmp(argv[2], "-next"))
+  if (argc == 3 && !strcasecmp(argv[2], "-next"))
     dprintf(DP_MODE_NEXT, "%s\n", s);
   else
     dprintf(DP_MODE, "%s\n", s);
@@ -64,7 +64,7 @@
 
   BADARGS(2, 3, " text ?options?");
   if ((argc == 3) &&
-    egg_strcasecmp(argv[2], "-next") && egg_strcasecmp(argv[2], "-normal")) {
+    strcasecmp(argv[2], "-next") && strcasecmp(argv[2], "-normal")) {
     Tcl_AppendResult(irp, "unknown putserv option: should be one of: ",
 		     "-normal -next", NULL);
     return TCL_ERROR;
@@ -77,7 +77,7 @@
    p = strchr(s, '\r');
   if (p != NULL)
     *p = 0;
-  if (argc == 3 && !egg_strcasecmp(argv[2], "-next"))
+  if (argc == 3 && !strcasecmp(argv[2], "-next"))
     dprintf(DP_SERVER_NEXT, "%s\n", s);
   else
     dprintf(DP_SERVER, "%s\n", s);
@@ -90,7 +90,7 @@
 
   BADARGS(2, 3, " text ?options?");
   if ((argc == 3) &&
-    egg_strcasecmp(argv[2], "-next") && egg_strcasecmp(argv[2], "-normal")) {
+    strcasecmp(argv[2], "-next") && strcasecmp(argv[2], "-normal")) {
     Tcl_AppendResult(irp, "unknown puthelp option: should be one of: ",
 		     "-normal -next", NULL);
     return TCL_ERROR;
@@ -103,7 +103,7 @@
    p = strchr(s, '\r');
   if (p != NULL)
     *p = 0;
-  if (argc == 3 && !egg_strcasecmp(argv[2], "-next"))
+  if (argc == 3 && !strcasecmp(argv[2], "-next"))
     dprintf(DP_HELP_NEXT, "%s\n", s);
   else
     dprintf(DP_HELP, "%s\n", s);
Index: eggdrop1.7/src/mod/share.mod/share.c
diff -u eggdrop1.7/src/mod/share.mod/share.c:1.63 eggdrop1.7/src/mod/share.mod/share.c:1.64
--- eggdrop1.7/src/mod/share.mod/share.c:1.63	Wed Oct 17 21:57:52 2001
+++ eggdrop1.7/src/mod/share.mod/share.c	Thu Oct 18 20:55:08 2001
@@ -1,7 +1,7 @@
 /*
  * share.c -- part of share.mod
  *
- * $Id: share.c,v 1.63 2001/10/18 02:57:52 stdarg Exp $
+ * $Id: share.c,v 1.64 2001/10/19 01:55:08 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1112,7 +1112,7 @@
   int i, sock;
   FILE *f;
 
-  egg_snprintf(s, sizeof s, ".share.%s.%lu.users", botnetnick, now);
+  snprintf(s, sizeof s, ".share.%s.%lu.users", botnetnick, now);
   if (!(b_status(idx) & STAT_SHARE)) {
     dprintf(idx, "s e You didn't ask; you just started sending.\n");
     dprintf(idx, "s e Ask before sending the userfile.\n");
@@ -1306,7 +1306,7 @@
 
   code = newsplit(&msg);
   for (f = 0, i = 0; C_share[i].name && !f; i++) {
-    int y = egg_strcasecmp(code, C_share[i].name);
+    int y = strcasecmp(code, C_share[i].name);
 
     if (!y)
       /* Found a match */
@@ -1328,7 +1328,7 @@
   if (!chan || channel_shared(chan)) {
     format = va_arg(va, char *);
     strcpy(s, "s ");
-    if ((l = egg_vsnprintf(s + 2, 509, format, va)) < 0)
+    if ((l = vsnprintf(s + 2, 509, format, va)) < 0)
       s[2 + (l = 509)] = 0;
     for (i = 0; i < dcc_total; i++)
       if ((dcc[i].type->flags & DCT_BOT) &&
@@ -1359,7 +1359,7 @@
   format = va_arg(va, char *);
 
   strcpy(s, "s ");
-  if ((l = egg_vsnprintf(s + 2, 509, format, va)) < 0)
+  if ((l = vsnprintf(s + 2, 509, format, va)) < 0)
     s[2 + (l = 509)] = 0;
   for (i = 0; i < dcc_total; i++)
     if ((dcc[i].type->flags & DCT_BOT) && (i != x) &&
@@ -1427,7 +1427,7 @@
 
   for (t = tbuf; t; t = tnext) {
     tnext = t->next;
-    if (!egg_strcasecmp(t->bot, bot)) {
+    if (!strcasecmp(t->bot, bot)) {
       del_tbuf(t);
       return 1;
     }
@@ -1504,7 +1504,7 @@
   tandbuf *t;
 
   for (t = tbuf; t && t->bot[0]; t = t->next)
-    if (!egg_strcasecmp(t->bot, bot)) {
+    if (!strcasecmp(t->bot, bot)) {
       if (chan) {
 	fr.match = (FR_CHAN | FR_BOT);
 	get_user_flagrec(get_user_by_handle(userlist, bot), &fr, chan->dname);
@@ -1542,7 +1542,7 @@
   tandbuf *t;
 
   for (t = tbuf; t && t->bot[0]; t = t->next)
-    if (!egg_strcasecmp(bot, t->bot))
+    if (!strcasecmp(bot, t->bot))
       return 1;
   return 0;
 }
@@ -1555,7 +1555,7 @@
   tandbuf *t;
 
   for (t = tbuf; t && t->bot[0]; t = t->next)
-    if (!egg_strcasecmp(dcc[idx].nick, t->bot)) {
+    if (!strcasecmp(dcc[idx].nick, t->bot)) {
       for (q = t->q; q && q->msg[0]; q = q->next) {
 	dprintf(idx, "%s", q->msg);
       }
@@ -1707,7 +1707,7 @@
   int i, j = -1;
 
   for (i = 0; i < dcc_total; i++)
-    if (!egg_strcasecmp(dcc[i].nick, dcc[idx].host) &&
+    if (!strcasecmp(dcc[i].nick, dcc[idx].host) &&
 	(dcc[i].type->flags & DCT_BOT))
       j = i;
   if (j == -1)
@@ -1880,7 +1880,7 @@
   struct chanuserrec *ch;
   struct chanset_t *cst;
 
-  egg_snprintf(share_file, sizeof share_file, ".share.%s.%lu", dcc[idx].nick,
+  snprintf(share_file, sizeof share_file, ".share.%s.%lu", dcc[idx].nick,
 	       now);
   if (dcc[idx].u.bot->uff_flags & UFF_OVERRIDE) {
     debug1("NOTE: Sharing aggressively with %s, overriding its local bots.",
@@ -1932,13 +1932,13 @@
 
 	  /* Send hostmasks */
 	  for (t = get_user(&USERENTRY_HOSTS, u); t; t = t->next) {
-	    egg_snprintf(s2, sizeof s2, "s +bh %s %s\n", u->handle, t->extra);
+	    snprintf(s2, sizeof s2, "s +bh %s %s\n", u->handle, t->extra);
 	    q_tbuf(dcc[idx].nick, s2, NULL);
 	  }
 	  /* Send address */
 	  if (bi) {
 	    register char *tmp = str_escape(bi->address, ':', '\\');
-	    egg_snprintf(s2, sizeof s2, "s c BOTADDR %s %s %d %d\n", u->handle,
+	    snprintf(s2, sizeof s2, "s c BOTADDR %s %s %d %d\n", u->handle,
 			 tmp, bi->telnet_port, bi->relay_port);
 	    free(tmp);
 	  }
@@ -1948,7 +1948,7 @@
 
 	  fr.udef_global = u->flags_udef;
 	  build_flags(s1, &fr, NULL);
-	  egg_snprintf(s2, sizeof s2, "s a %s %s\n", u->handle, s1);
+	  snprintf(s2, sizeof s2, "s a %s %s\n", u->handle, s1);
 	  q_tbuf(dcc[idx].nick, s2, NULL);
 	  for (ch = u->chanrec; ch; ch = ch->next) {
 	    if ((ch->flags & ~BOT_SHARE) &&
@@ -1961,7 +1961,7 @@
 	        fr.chan = ch->flags & ~BOT_SHARE;
 	        fr.udef_chan = ch->flags_udef;
 	        build_flags(s1, &fr, NULL);
-	        egg_snprintf(s2, sizeof s2, "s a %s %s %s\n", u->handle, s1,
+	        snprintf(s2, sizeof s2, "s a %s %s %s\n", u->handle, s1,
 			     ch->channel);
 	        q_tbuf(dcc[idx].nick, s2, cst);
 	      }
@@ -1994,7 +1994,7 @@
     if (dcc[idx].status & STAT_GETTING) {
       j = 0;
       for (i = 0; i < dcc_total; i++)
-	if (!egg_strcasecmp(dcc[i].host, dcc[idx].nick) &&
+	if (!strcasecmp(dcc[i].host, dcc[idx].nick) &&
 	    ((dcc[i].type->flags & (DCT_FILETRAN | DCT_FILESEND)) ==
 	     (DCT_FILETRAN | DCT_FILESEND)))
 	  j = i;
@@ -2008,7 +2008,7 @@
     if (dcc[idx].status & STAT_SENDING) {
       j = 0;
       for (i = 0; i < dcc_total; i++)
-	if ((!egg_strcasecmp(dcc[i].host, dcc[idx].nick)) &&
+	if ((!strcasecmp(dcc[i].host, dcc[idx].nick)) &&
 	    ((dcc[i].type->flags & (DCT_FILETRAN | DCT_FILESEND))
 	     == DCT_FILETRAN))
 	  j = i;
@@ -2112,7 +2112,7 @@
 	  for (j = 0; j < dcc_total; j++)
 	    if (((dcc[j].type->flags & (DCT_FILETRAN | DCT_FILESEND))
 		 == (DCT_FILETRAN | DCT_FILESEND)) &&
-		!egg_strcasecmp(dcc[j].host, dcc[i].nick)) {
+		!strcasecmp(dcc[j].host, dcc[i].nick)) {
 	      dprintf(idx, "Downloading userlist from %s (%d%% done)\n",
 		      dcc[i].nick,
 		      (int) (100.0 * ((float) dcc[j].status) /
@@ -2127,7 +2127,7 @@
 	  for (j = 0; j < dcc_total; j++) {
 	    if (((dcc[j].type->flags & (DCT_FILETRAN | DCT_FILESEND))
 		 == DCT_FILETRAN)
-		&& !egg_strcasecmp(dcc[j].host, dcc[i].nick)) {
+		&& !strcasecmp(dcc[j].host, dcc[i].nick)) {
 	      if (dcc[j].type == &DCC_GET)
 		dprintf(idx, "Sending userlist to %s (%d%% done)\n",
 			dcc[i].nick,
Index: eggdrop1.7/src/mod/transfer.mod/transfer.c
diff -u eggdrop1.7/src/mod/transfer.mod/transfer.c:1.50 eggdrop1.7/src/mod/transfer.mod/transfer.c:1.51
--- eggdrop1.7/src/mod/transfer.mod/transfer.c:1.50	Wed Oct 17 21:57:52 2001
+++ eggdrop1.7/src/mod/transfer.mod/transfer.c	Thu Oct 18 20:55:09 2001
@@ -1,7 +1,7 @@
 /*
  * transfer.c -- part of transfer.mod
  *
- * $Id: transfer.c,v 1.50 2001/10/18 02:57:52 stdarg Exp $
+ * $Id: transfer.c,v 1.51 2001/10/19 01:55:09 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -179,7 +179,7 @@
 
   for (i = 0; i < dcc_total; i++)
     if (dcc[i].type == &DCC_GET || dcc[i].type == &DCC_GET_PENDING)
-      if (!egg_strcasecmp(dcc[i].nick, nick))
+      if (!strcasecmp(dcc[i].nick, nick))
 	x++;
   return (x >= dcc_limit);
 }
@@ -249,9 +249,9 @@
   Tcl_SetVar(interp, "_sr1", hand, 0);
   Tcl_SetVar(interp, "_sr2", nick, 0);
   Tcl_SetVar(interp, "_sr3", path, 0);
-  egg_snprintf(s, sizeof s, "%lu", acked);
+  snprintf(s, sizeof s, "%lu", acked);
   Tcl_SetVar(interp, "_sr4", s, 0);
-  egg_snprintf(s, sizeof s, "%lu", length);
+  snprintf(s, sizeof s, "%lu", length);
   Tcl_SetVar(interp, "_sr5", s, 0);
   check_tcl_bind(h, hand, &fr, " $_sr1 $_sr2 $_sr3 $_sr4 $_sr5",
 		 MATCH_MASK | BIND_USE_ATTR | BIND_STACKABLE);
@@ -303,7 +303,7 @@
     q = fileq;
     fnd = 0;
     while (q != NULL) {
-      if (!egg_strcasecmp(q->to, to)) {
+      if (!strcasecmp(q->to, to)) {
 	deq_this(q);
 	q = NULL;
 	fnd = 1;
@@ -321,7 +321,7 @@
   int x;
 
   for (q = fileq; q; q = q->next)
-    if (!egg_strcasecmp(q->to, to))
+    if (!strcasecmp(q->to, to))
       this = q;
   if (this == NULL)
     return;			/* None */
@@ -368,7 +368,7 @@
   }
   x = raw_dcc_send(s1, this->to, this->nick, s, 0);
   if (x == DCCSEND_OK) {
-    if (egg_strcasecmp(this->to, this->nick))
+    if (strcasecmp(this->to, this->nick))
       dprintf(DP_HELP, "NOTICE %s :Here is a file from %s ...\n", this->to,
 	      this->nick);
     deq_this(this);
@@ -410,7 +410,7 @@
   fileq_t *q;
 
   for (q = fileq; q; q = q->next) {
-    if (!egg_strcasecmp(q->nick, dcc[idx].nick)) {
+    if (!strcasecmp(q->nick, dcc[idx].nick)) {
       if (!cnt) {
 	spaces[HANDLEN - 9] = 0;
 	dprintf(idx, "  Send to  %s  Filename\n", spaces);
@@ -430,8 +430,8 @@
   }
   for (i = 0; i < dcc_total; i++) {
     if ((dcc[i].type == &DCC_GET_PENDING || dcc[i].type == &DCC_GET) &&
-	(!egg_strcasecmp(dcc[i].nick, dcc[idx].nick) ||
-	 !egg_strcasecmp(dcc[i].u.xfer->from, dcc[idx].nick))) {
+	(!strcasecmp(dcc[i].nick, dcc[idx].nick) ||
+	 !strcasecmp(dcc[i].u.xfer->from, dcc[idx].nick))) {
       char *nfn;
 
       if (!cnt) {
@@ -473,7 +473,7 @@
     q = fileq;
     fnd = 0;
     while (q != NULL) {
-      if (!egg_strcasecmp(dcc[idx].nick, q->nick)) {
+      if (!strcasecmp(dcc[idx].nick, q->nick)) {
 	s = realloc(s, strlen(q->dir) + strlen(q->file) + 3);
 	if (q->dir[0] == '*')
 	  sprintf(s, "%s/%s", &q->dir[1], q->file);
@@ -502,8 +502,8 @@
     free(s);
   for (i = 0; i < dcc_total; i++) {
     if ((dcc[i].type == &DCC_GET_PENDING || dcc[i].type == &DCC_GET) &&
-	(!egg_strcasecmp(dcc[i].nick, dcc[idx].nick) ||
-	 !egg_strcasecmp(dcc[i].u.xfer->from, dcc[idx].nick))) {
+	(!strcasecmp(dcc[i].nick, dcc[idx].nick) ||
+	 !strcasecmp(dcc[i].u.xfer->from, dcc[idx].nick))) {
       char *nfn = strrchr(dcc[i].u.xfer->origname, '/');
 
       if (nfn == NULL)
@@ -512,7 +512,7 @@
 	nfn++;
       if (wild_match_file(par, nfn)) {
 	dprintf(idx, "Cancelled: %s  (aborted dcc send)\n", nfn);
-	if (egg_strcasecmp(dcc[i].nick, dcc[idx].nick))
+	if (strcasecmp(dcc[i].nick, dcc[idx].nick))
 	  dprintf(DP_HELP, "NOTICE %s :Transfer of %s aborted by %s\n",
 		  dcc[i].nick, nfn, dcc[idx].nick);
 	if (dcc[i].type == &DCC_GET)
@@ -542,7 +542,7 @@
 
   BADARGS(2, 2, " handle");
   for (q = fileq; q; q = q->next) {
-    if (!egg_strcasecmp(q->nick, argv[1])) {
+    if (!strcasecmp(q->nick, argv[1])) {
       s = realloc(s, strlen(q->to) + strlen(q->dir) + strlen(q->file) + 4);
       if (q->dir[0] == '*')
 	sprintf(s, "%s %s/%s", q->to, &q->dir[1], q->file);
@@ -605,7 +605,7 @@
   i = raw_dcc_send(sys, argv[2], "*", argv[1], 0);
   if (i > 0)
     wipe_tmp_filename(sys, -1);
-  egg_snprintf(s, sizeof s, "%d", i);
+  snprintf(s, sizeof s, "%d", i);
   Tcl_AppendResult(irp, s, NULL);
   free(sys);
   return TCL_OK;
@@ -624,7 +624,7 @@
   for (i = 0; i < dcc_total; i++)
     if (dcc[i].sock == sock) {
       if (dcc[i].type == &DCC_SEND || dcc[i].type == &DCC_GET) {
-	egg_snprintf(s, sizeof s, "%lu", dcc[i].u.xfer->start_time);
+	snprintf(s, sizeof s, "%lu", dcc[i].u.xfer->start_time);
 	Tcl_AppendResult(irp, s, NULL);
       } else
 	Tcl_AppendResult(irp, "-2", NULL);  /* Not a valid file transfer,
@@ -690,7 +690,7 @@
     int x, y = 0;
 
     for (x = 0; x < dcc_total; x++)
-      if ((!egg_strcasecmp(dcc[x].nick, dcc[idx].host)) &&
+      if ((!strcasecmp(dcc[x].nick, dcc[idx].host)) &&
 	  (dcc[x].type->flags & DCT_BOT)) {
 	y = x;
 	break;
@@ -746,7 +746,7 @@
     }
     putlog(LOG_FILES, "*", "Completed dcc send %s from %s!%s",
 	   dcc[idx].u.xfer->origname, dcc[idx].nick, dcc[idx].host);
-    egg_snprintf(s, sizeof s, "%s!%s", dcc[idx].nick, dcc[idx].host);
+    snprintf(s, sizeof s, "%s!%s", dcc[idx].nick, dcc[idx].host);
     u = get_user_by_host(s);
     hand = u ? u->handle : "*";
 
@@ -788,7 +788,7 @@
     free(nfn);
     for (j = 0; j < dcc_total; j++)
       if (!ok && (dcc[j].type->flags & (DCT_GETNOTES | DCT_FILES)) &&
-	  !egg_strcasecmp(dcc[j].nick, hand)) {
+	  !strcasecmp(dcc[j].nick, hand)) {
 	ok = 1;
 	dprintf(j, "Thanks for the file!\n");
       }
@@ -804,7 +804,7 @@
     int x, y = 0;
 
     for (x = 0; x < dcc_total; x++)
-      if ((!egg_strcasecmp(dcc[x].nick, dcc[idx].host)) &&
+      if ((!strcasecmp(dcc[x].nick, dcc[idx].host)) &&
 	  (dcc[x].type->flags & DCT_BOT))
 	y = x;
     if (y) {
@@ -813,7 +813,7 @@
       unlink(dcc[idx].u.xfer->filename);
       /* Drop that bot */
       dprintf(y, "bye\n");
-      egg_snprintf(s, sizeof s, "Disconnected %s (aborted userfile transfer)",
+      snprintf(s, sizeof s, "Disconnected %s (aborted userfile transfer)",
 		   dcc[y].nick);
       botnet_send_unlinked(y, dcc[y].nick, s);
       chatout("*** %s\n", dcc[y].nick, s);
@@ -978,7 +978,7 @@
       int x, y = 0;
 
       for (x = 0; x < dcc_total; x++)
-	if (!egg_strcasecmp(dcc[x].nick, dcc[idx].host) &&
+	if (!strcasecmp(dcc[x].nick, dcc[idx].host) &&
 	    (dcc[x].type->flags & DCT_BOT))
 	  y = x;
       if (y != 0)
@@ -1036,7 +1036,7 @@
     int x, y = 0;
 
     for (x = 0; x < dcc_total; x++)
-      if (!egg_strcasecmp(dcc[x].nick, dcc[idx].host) &&
+      if (!strcasecmp(dcc[x].nick, dcc[idx].host) &&
 	  (dcc[x].type->flags & DCT_BOT))
 	y = x;
     putlog(LOG_BOTS, "*", "Lost userfile transfer; aborting.");
@@ -1044,7 +1044,7 @@
     xnick[0] = 0;
     /* Drop that bot */
     dprintf(-dcc[y].sock, "bye\n");
-    egg_snprintf(s, sizeof s, "Disconnected %s (aborted userfile transfer)",
+    snprintf(s, sizeof s, "Disconnected %s (aborted userfile transfer)",
 		 dcc[y].nick);
     botnet_send_unlinked(y, dcc[y].nick, s);
     chatout("*** %s\n", s);
@@ -1062,7 +1062,7 @@
 
     /* Call `lost' DCC trigger now.
      */
-    egg_snprintf(s, sizeof s, "%s!%s", dcc[idx].nick, dcc[idx].host);
+    snprintf(s, sizeof s, "%s!%s", dcc[idx].nick, dcc[idx].host);
     u = get_user_by_host(s);
     check_tcl_toutlost(u, dcc[idx].nick, dcc[idx].u.xfer->dir,
 		       dcc[idx].u.xfer->acked, dcc[idx].u.xfer->length,
@@ -1120,7 +1120,7 @@
     int x, y = 0;
 
     for (x = 0; x < dcc_total; x++)
-      if ((!egg_strcasecmp(dcc[x].nick, dcc[i].host)) &&
+      if ((!strcasecmp(dcc[x].nick, dcc[i].host)) &&
 	  (dcc[x].type->flags & DCT_BOT))
 	y = x;
     if (y != 0) {
@@ -1130,7 +1130,7 @@
     unlink(dcc[i].u.xfer->filename);
     putlog(LOG_BOTS, "*", "Timeout on userfile transfer.");
     dprintf(y, "bye\n");
-    egg_snprintf(xx, sizeof xx, "Disconnected %s (timed-out userfile transfer)",
+    snprintf(xx, sizeof xx, "Disconnected %s (timed-out userfile transfer)",
 		 dcc[y].nick);
     botnet_send_unlinked(y, dcc[y].nick, xx);
     chatout("*** %s\n", xx);
@@ -1153,7 +1153,7 @@
 
     /* Call DCC `timeout' trigger now.
      */
-    egg_snprintf(xx, sizeof xx, "%s!%s", dcc[i].nick, dcc[i].host);
+    snprintf(xx, sizeof xx, "%s!%s", dcc[i].nick, dcc[i].host);
     u = get_user_by_host(xx);
     check_tcl_toutlost(u, dcc[i].nick, dcc[i].u.xfer->dir,
 		       dcc[i].u.xfer->acked, dcc[i].u.xfer->length, H_tout);
@@ -1176,7 +1176,7 @@
     int x, y = 0;
 
     for (x = 0; x < dcc_total; x++)
-      if (!egg_strcasecmp(dcc[x].nick, dcc[idx].host) &&
+      if (!strcasecmp(dcc[x].nick, dcc[idx].host) &&
 	  (dcc[x].type->flags & DCT_BOT))
 	y = x;
     if (y != 0) {
@@ -1291,7 +1291,7 @@
     return;
   dcc[idx].type = &DCC_SEND;
   dcc[idx].u.xfer->start_time = now;
-  egg_snprintf(s1, sizeof s1, "%s!%s", dcc[idx].nick, dcc[idx].host);
+  snprintf(s1, sizeof s1, "%s!%s", dcc[idx].nick, dcc[idx].host);
   if (strcmp(dcc[idx].nick, "*users"))
     putlog(LOG_MISC, "*", "DCC connection: SEND %s (%s)",
 	   dcc[idx].u.xfer->origname, s1);
@@ -1534,7 +1534,7 @@
 
   fs = e->u.extra;
   l->extra = malloc(41);
-  egg_snprintf(l->extra, 41, "%09u %09u %09u %09u",
+  snprintf(l->extra, 41, "%09u %09u %09u %09u",
           fs->uploads, fs->upload_ks, fs->dnloads, fs->dnload_ks);
   l->next = NULL;
   e->u.list = l;
@@ -1596,15 +1596,15 @@
   BADARGS(3, 4, " handle FSTAT ?u/d?");
   fs = e->u.extra;
   if (argc == 3)
-    egg_snprintf(d, sizeof d, "%u %u %u %u", fs->uploads, fs->upload_ks,
+    snprintf(d, sizeof d, "%u %u %u %u", fs->uploads, fs->upload_ks,
                  fs->dnloads, fs->dnload_ks);
   else
     switch (argv[3][0]) {
     case 'u':
-      egg_snprintf(d, sizeof d, "%u %u", fs->uploads, fs->upload_ks);
+      snprintf(d, sizeof d, "%u %u", fs->uploads, fs->upload_ks);
       break;
     case 'd':
-      egg_snprintf(d, sizeof d, "%u %u", fs->dnloads, fs->dnload_ks);
+      snprintf(d, sizeof d, "%u %u", fs->dnloads, fs->dnload_ks);
       break;
     }
 
@@ -1790,7 +1790,7 @@
 
   strcpy(msg, text);
   action = newsplit(&msg);
-  if (egg_strcasecmp(action, "RESUME"))
+  if (strcasecmp(action, "RESUME"))
     return 0;
   fn = newsplit(&msg);
   port = atoi(newsplit(&msg));
Index: eggdrop1.7/src/mod/transfer.mod/transfer.h
diff -u eggdrop1.7/src/mod/transfer.mod/transfer.h:1.12 eggdrop1.7/src/mod/transfer.mod/transfer.h:1.13
--- eggdrop1.7/src/mod/transfer.mod/transfer.h:1.12	Thu Jul 26 12:04:34 2001
+++ eggdrop1.7/src/mod/transfer.mod/transfer.h	Thu Oct 18 20:55:09 2001
@@ -1,7 +1,7 @@
 /*
  * transfer.h -- part of transfer.mod
  *
- * $Id: transfer.h,v 1.12 2001/07/26 17:04:34 drummer Exp $
+ * $Id: transfer.h,v 1.13 2001/10/19 01:55:09 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -68,7 +68,7 @@
   u_16bit_t packet_id;		/* Identification ID, should be equal
 	 			   to TRANSFER_REGET_PACKETID		*/
   u_8bit_t  byte_order;		/* Byte ordering, see byte_order_test()	*/
-  u_32bit_t byte_offset;	/* Number of bytes to skip relative to
+  u_32int_t byte_offset;	/* Number of bytes to skip relative to
 				   the file beginning			*/
 } transfer_reget;
 
Index: eggdrop1.7/src/modules.c
diff -u eggdrop1.7/src/modules.c:1.75 eggdrop1.7/src/modules.c:1.76
--- eggdrop1.7/src/modules.c:1.75	Wed Oct 17 21:57:51 2001
+++ eggdrop1.7/src/modules.c	Thu Oct 18 20:55:05 2001
@@ -4,7 +4,7 @@
  * 
  * by Darrin Smith (beldin at light.iinet.net.au)
  * 
- * $Id: modules.c,v 1.75 2001/10/18 02:57:51 stdarg Exp $
+ * $Id: modules.c,v 1.76 2001/10/19 01:55:05 tothwolf Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -25,7 +25,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-#include "main.h"
+#include "main.h"		/* NOTE: when removing this, include config.h */
 #include "modules.h"
 #include "tandem.h"
 #include "registry.h"
@@ -251,7 +251,11 @@
   (Function) open_telnet,
   /* 88 - 91 */
   (Function) check_bind_event,
+#ifndef HAVE_MEMCPY
+  (Function) memcpy,
+#else
   (Function) 0,
+#endif
   (Function) 0,
   (Function) my_strcpy,
   /* 92 - 95 */
@@ -457,14 +461,38 @@
   (Function) sock_has_data,
   (Function) bots_in_subtree,
   (Function) users_in_subtree,
-  (Function) egg_inet_aton,
+#ifndef HAVE_INET_ATON
+  (Function) inet_aton,
+#else
+  (Function) 0,
+#endif
   /* 252 - 255 */
-  (Function) egg_snprintf,
-  (Function) egg_vsnprintf,
+#ifndef HAVE_SNPRINTF
+  (Function) snprintf,
+#else
+  (Function) 0,
+#endif
+#ifndef HAVE_VSNPRINTF
+  (Function) vsnprintf,
+#else
   (Function) 0,
-  (Function) egg_strcasecmp,
+#endif
+#ifndef HAVE_MEMSET
+  (Function) memset,
+#else
+  (Function) 0,
+#endif
+#ifndef HAVE_STRCASECMP
+  (Function) strcasecmp,
+#else
+  (Function) 0,
+#endif
   /* 256 - 259 */
-  (Function) egg_strncasecmp,
+#ifndef HAVE_STRNCASECMP
+  (Function) strncasecmp,
+#else
+  (Function) 0,
+#endif
   (Function) is_file,
   (Function) & must_be_owner,	/* int					*/
   (Function) & tandbot,		/* tand_t *				*/
@@ -496,15 +524,41 @@
   (Function) kill_bot,
   (Function) quit_msg,                /* char *				  */
   (Function) add_bind_table2,
-  /* 276 - 280 */
+  /* 276 - 279 */
   (Function) del_bind_table2,
   (Function) add_builtins2,
   (Function) rem_builtins2,
   (Function) find_bind_table2,
+  /* 280 - 283 */
   (Function) check_bind,
-  /* 281 - 285 */
   (Function) registry_lookup,
-  (Function) registry_add_simple_chains
+  (Function) registry_add_simple_chains,
+#ifndef HAVE_STRFTIME
+  (Function) strftime,
+#else
+  (Function) 0,
+#endif
+  /* 284 - 287 */
+#ifndef HAVE_INET_NTOP
+  (Function) inet_ntop,
+#else
+  (Function) 0,
+#endif
+#ifndef HAVE_INET_PTON
+  (Function) inet_pton,
+#else
+  (Function) 0,
+#endif
+#ifndef HAVE_VASPRINTF
+  (Function) vasprintf,
+#else
+  (Function) 0,
+#endif
+#ifndef HAVE_ASPRINTF
+  (Function) asprintf
+#else
+  (Function) 0
+#endif
 };
 
 static bind_table_t *BT_load, *BT_unload;
@@ -525,7 +579,7 @@
   
   LTDL_SET_PRELOADED_SYMBOLS();
   if (lt_dlinit() != 0) {
-    egg_snprintf(wbuf, sizeof(wbuf),
+    snprintf(wbuf, sizeof(wbuf),
 		    _("error during libtdl initialization: %s\n"),
 		    lt_dlerror());
     fatal(wbuf, 0);
@@ -543,7 +597,7 @@
   module_entry *p;
 
   for (p = module_list; p && p->name; p = p->next)
-    if (!egg_strcasecmp(name, p->name)) {
+    if (!strcasecmp(name, p->name)) {
       p->major = major;
       p->minor = minor;
       p->funcs = funcs;
@@ -651,7 +705,7 @@
 
   for (p = module_list; p && p->name; p = p->next) 
     if ((major == p->major || !major) && minor <= p->minor && 
-	!egg_strcasecmp(name, p->name))
+	!strcasecmp(name, p->name))
       return p;
   return NULL;
 }
@@ -661,11 +715,11 @@
   module_entry *p;
 
   for (p = module_list; p; p = p->next)
-    if (!egg_strcasecmp(newname, p->name))
+    if (!strcasecmp(newname, p->name))
       return 0;
 
   for (p = module_list; p && p->name; p = p->next)
-    if (!egg_strcasecmp(name, p->name)) {
+    if (!strcasecmp(name, p->name)) {
       free(p->name);
       malloc_strcpy(p->name, newname);
       return 1;
@@ -769,8 +823,8 @@
     /* special hook <drummer> */
     case HOOK_IRCCMP:
       if (func == NULL) {
-	irccmp = egg_strcasecmp;
-	ircncmp = (int (*)(const char *, const char *, int)) egg_strncasecmp;
+	irccmp = strcasecmp;
+	ircncmp = (int (*)(const char *, const char *, int)) strncasecmp;
 	irctolower = tolower;
 	irctoupper = toupper;
       } else {
@@ -863,7 +917,7 @@
   if (p && !which && details)
     dprintf(idx, _("MODULES LOADED:\n"));
   for (; p; p = p->next) {
-    if (!which || !egg_strcasecmp(which, p->name)) {
+    if (!which || !strcasecmp(which, p->name)) {
       dependancy *d;
 
       if (details)
Index: eggdrop1.7/src/net.c
diff -u eggdrop1.7/src/net.c:1.47 eggdrop1.7/src/net.c:1.48
--- eggdrop1.7/src/net.c:1.47	Wed Oct 17 21:57:51 2001
+++ eggdrop1.7/src/net.c	Thu Oct 18 20:55:05 2001
@@ -2,7 +2,7 @@
  * net.c -- handles:
  *   all raw network i/o
  * 
- * $Id: net.c,v 1.47 2001/10/18 02:57:51 stdarg Exp $
+ * $Id: net.c,v 1.48 2001/10/19 01:55:05 tothwolf Exp $
  */
 /* 
  * This is hereby released into the public domain.
@@ -109,7 +109,7 @@
 
   /* Could be pre-defined */
   if (myip6[0])
-    egg_inet_pton(AF_INET6, myip6, &ip);
+    inet_pton(AF_INET6, myip6, &ip);
   else {
     /* get system's default IPv6 ip -- FIXME!? */
     /* is there a know way?! - drummer */
@@ -354,11 +354,11 @@
     for (i = 0; i < MAXSOCKS; i++)
       if (!(socklist[i].flags & SOCK_UNUSED) && socklist[i].sock == sock)
 	socklist[i].flags |= SOCK_PROXYWAIT; /* drummer */
-    egg_snprintf(s, sizeof s, "\004\001%c%c%c%c%c%c%s", (port >> 8) % 256,
+    snprintf(s, sizeof s, "\004\001%c%c%c%c%c%c%s", (port >> 8) % 256,
 		 (port % 256), x[0], x[1], x[2], x[3], botuser);
     tputs(sock, s, strlen(botuser) + 9); /* drummer */
   } else if (proxy == PROXY_SUN) {
-    egg_snprintf(s, sizeof s, "%s %d\n", host, port);
+    snprintf(s, sizeof s, "%s %d\n", host, port);
     tputs(sock, s, strlen(s)); /* drummer */
   }
   return sock;
@@ -419,11 +419,11 @@
       
       alarm(resolve_timeout);
 
-      if (!egg_strncasecmp("ipv6%", host, 5)) {
+      if (!strncasecmp("ipv6%", host, 5)) {
 	type = AF_INET6;
 	p = host + 5;
 debug1("|NET| checking only AAAA record for %s", p);
-      } else if (!egg_strncasecmp("ipv4%", host, 5)) {
+      } else if (!strncasecmp("ipv4%", host, 5)) {
 	type = AF_INET;
 	p = host + 5;
 debug1("|NET| checking only A record for %s", p);
@@ -535,9 +535,9 @@
   name.sin6_port = htons(*port);	/* 0 = just assign us a port */
   if (!addr[0])
       name.sin6_addr = in6addr_any;
-  else if (!egg_inet_pton(AF_INET6, addr, &name.sin6_addr)) {
+  else if (!inet_pton(AF_INET6, addr, &name.sin6_addr)) {
       struct in_addr a4;
-      if (egg_inet_aton(addr, &a4))
+      if (inet_aton(addr, &a4))
           name.sin6_addr = ipv4to6(a4.s_addr);
       else
 	  name.sin6_addr = in6addr_any;
@@ -546,7 +546,7 @@
   name.sin_family = AF_INET;
   name.sin_port = htons(*port);	/* 0 = just assign us a port */
   if (addr[0])
-      egg_inet_aton(addr, &name.sin_addr);
+      inet_aton(addr, &name.sin_addr);
   else
       name.sin_addr.s_addr = INADDR_ANY;
 #endif
@@ -627,7 +627,7 @@
 	sprintf(buf, "%lu", 
 		(unsigned long int) ntohl(((uint32_t *)&sa.sin6_addr)[3]));
     else
-	egg_inet_ntop(AF_INET6, &(sa.sin6_addr), buf, sizeof buf);
+	inet_ntop(AF_INET6, &(sa.sin6_addr), buf, sizeof buf);
 #else
     sprintf(buf, "%lu", (unsigned long int) ntohl(sa.sin_addr.s_addr));
 #endif
@@ -656,11 +656,11 @@
   if (ip != NULL) {
 #ifdef IPV6
     if (IN6_IS_ADDR_V4MAPPED(&from.sin6_addr))
-	egg_inet_ntop(AF_INET, &(((uint32_t *)&from.sin6_addr)[3]), ip, ADDRMAX);
+	inet_ntop(AF_INET, &(((uint32_t *)&from.sin6_addr)[3]), ip, ADDRMAX);
     else
-	egg_inet_ntop(AF_INET6, &(from.sin6_addr), ip, ADDRMAX);
+	inet_ntop(AF_INET6, &(from.sin6_addr), ip, ADDRMAX);
 #else
-    egg_inet_ntop(AF_INET, &(from.sin_addr.s_addr), ip, ADDRMAX);
+    inet_ntop(AF_INET, &(from.sin_addr.s_addr), ip, ADDRMAX);
 #endif
     /* This is now done asynchronously. We now only provide the IP address.
      */
@@ -692,7 +692,7 @@
   if (server == NULL)
     return -3;
   /* fix the IPv4 IP format (ie: 167772161 -> 10.0.0.1) */
-  if (egg_inet_aton(server, &ia))
+  if (inet_aton(server, &ia))
     return open_telnet_raw(sock, inet_ntoa(ia), p);
   else
     return open_telnet_raw(sock, server, p);
@@ -724,18 +724,18 @@
 	if ((aw->status == adns_s_ok) && (aw->nrrs > 0)) {
 	    adns_rr_addr *rrp = aw->rrs.untyped;
 	    if (rrp->addr.sa.sa_family == AF_INET) {
-		egg_inet_ntop(AF_INET, &(rrp->addr.inet.sin_addr), name, UHOSTLEN-1);
+		inet_ntop(AF_INET, &(rrp->addr.inet.sin_addr), name, UHOSTLEN-1);
 		status = 1;
 #ifdef IPV6
 	    } else if (rrp->addr.sa.sa_family == AF_INET6) {
-		egg_inet_ntop(AF_INET6, &(rrp->addr.inet6.sin6_addr), name, UHOSTLEN-1);
+		inet_ntop(AF_INET6, &(rrp->addr.inet6.sin6_addr), name, UHOSTLEN-1);
 		status = 1;
 #endif
 	    }
 #ifdef IPV6
 	} else if ((aw->type == adns_r_addr /* af_preferred */) &&
-		    egg_strncasecmp(origname, "ipv6%", 5) &&
-		    egg_strncasecmp(origname, "ipv4%", 5)) {
+		    strncasecmp(origname, "ipv6%", 5) &&
+		    strncasecmp(origname, "ipv4%", 5)) {
 	    adns_query q6;
 	    malloc_strcpy(orign2, origname);
 	    /* ...it may be AAAA */
Index: eggdrop1.7/src/stat.h
diff -u eggdrop1.7/src/stat.h:1.2 eggdrop1.7/src/stat.h:1.3
--- eggdrop1.7/src/stat.h:1.2	Wed Apr 11 21:39:43 2001
+++ eggdrop1.7/src/stat.h	Thu Oct 18 20:55:05 2001
@@ -2,7 +2,7 @@
  * stat.h
  *  file attributes
  *
- * $Id: stat.h,v 1.2 2001/04/12 02:39:43 guppy Exp $
+ * $Id: stat.h,v 1.3 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 2000, 2001 Eggheads Development Team
@@ -21,24 +21,53 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
-
 #ifndef _EGG_STAT_H
 #define _EGG_STAT_H
 
-#ifndef S_ISDIR
-#  ifndef S_IFMT
-#    define S_IFMT	0170000	    /* Bitmask for the file type bitfields */
-#  endif
-#  ifndef S_IFDIR
-#    define S_IFDIR	0040000	    /* Directory			   */
-#  endif
-#  define S_ISDIR(m)	(((m)&(S_IFMT)) == (S_IFDIR))
-#endif
-#ifndef S_IFREG
-#  define S_IFREG	0100000     /* Regular file			   */
-#endif
-#ifndef S_IFLNK
-#  define S_IFLNK   	0120000     /* Symbolic link			   */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
 #endif
+
+#ifdef STAT_MACROS_BROKEN
+
+/* Undefine bits */
+# undef S_IFMT
+# undef S_IFSOCK
+# undef S_IFLNK
+# undef S_IFREG
+# undef S_IFBLK
+# undef S_IFDIR
+# undef S_IFCHR
+# undef S_IFIFO
+
+/* Undefine macros */
+# undef S_ISSOCK
+# undef S_ISLNK
+# undef S_ISREG
+# undef S_ISBLK
+# undef S_ISDIR
+# undef S_ISCHR
+# undef S_ISFIFO
+
+/* Define bits */
+# define S_IFMT		0170000	/* Bitmask for the file type bitfields */
+# define S_IFSOCK	0140000	/* Socket */
+# define S_IFLNK	0120000	/* Symbolic link */
+# define S_IFREG	0100000	/* Regular file */
+# define S_IFBLK	0060000	/* Block device */
+# define S_IFDIR	0040000	/* Directory */
+# define S_IFCHR	0020000	/* Character device */
+# define S_IFIFO	0010000	/* FIFO */
+
+/* Define macros */
+# define S_ISSOCK(mode)	(((mode) & (S_IFMT)) = (S_IFSOCK))
+# define S_ISLNK(mode)	(((mode) & (S_IFMT)) = (S_IFLNK))
+# define S_ISREG(mode)	(((mode) & (S_IFMT)) = (S_IFREG))
+# define S_ISBLK(mode)	(((mode) & (S_IFMT)) = (S_IFBLK))
+# define S_ISDIR(mode)	(((mode) & (S_IFMT)) = (S_IFDIR))
+# define S_ISCHR(mode)	(((mode) & (S_IFMT)) = (S_IFCHR))
+# define S_ISFIFO(mode)	(((mode) & (S_IFMT)) = (S_IFIFO))
+
+#endif			/* STAT_MACROS_BROKEN */
 
 #endif			/* _EGG_STAT_H */
Index: eggdrop1.7/src/tcl.c
diff -u eggdrop1.7/src/tcl.c:1.48 eggdrop1.7/src/tcl.c:1.49
--- eggdrop1.7/src/tcl.c:1.48	Thu Oct 18 04:06:43 2001
+++ eggdrop1.7/src/tcl.c	Thu Oct 18 20:55:05 2001
@@ -4,7 +4,7 @@
  *   Tcl initialization
  *   getting and setting Tcl/eggdrop variables
  *
- * $Id: tcl.c,v 1.48 2001/10/18 09:06:43 stdarg Exp $
+ * $Id: tcl.c,v 1.49 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -96,7 +96,7 @@
 
 static void botnet_change(char *new)
 {
-  if (egg_strcasecmp(botnetnick, new)) {
+  if (strcasecmp(botnetnick, new)) {
     /* Trying to change bot's nickname */
     if (tands > 0) {
       putlog(LOG_MISC, "*", "* Tried to change my botnet nick, but I'm still linked to a botnet.");
@@ -131,7 +131,7 @@
   coupletinfo *cp = (coupletinfo *) cdata;
 
   if (flags & (TCL_TRACE_READS | TCL_TRACE_UNSETS)) {
-    egg_snprintf(s1, sizeof s1, "%d:%d", *(cp->left), *(cp->right));
+    snprintf(s1, sizeof s1, "%d:%d", *(cp->left), *(cp->right));
     Tcl_SetVar2(interp, name1, name2, s1, TCL_GLOBAL_ONLY);
     if (flags & TCL_TRACE_UNSETS)
       Tcl_TraceVar(interp, name1,
@@ -171,9 +171,9 @@
       fr.udef_global = default_uflags;
       build_flags(s1, &fr, 0);
     } else if ((int *) ii->var == &userfile_perm) {
-      egg_snprintf(s1, sizeof s1, "0%o", userfile_perm);
+      snprintf(s1, sizeof s1, "0%o", userfile_perm);
     } else
-      egg_snprintf(s1, sizeof s1, "%d", *(int *) ii->var);
+      snprintf(s1, sizeof s1, "%d", *(int *) ii->var);
     Tcl_SetVar2(interp, name1, name2, s1, TCL_GLOBAL_ONLY);
     if (flags & TCL_TRACE_UNSETS)
       Tcl_TraceVar(interp, name1,
@@ -230,7 +230,7 @@
     if ((st->str == firewall) && (firewall[0])) {
       char s1[127];
 
-      egg_snprintf(s1, sizeof s1, "%s:%d", firewall, firewallport);
+      snprintf(s1, sizeof s1, "%s:%d", firewall, firewallport);
       Tcl_SetVar2(interp, name1, name2, s1, TCL_GLOBAL_ONLY);
     } else
       Tcl_SetVar2(interp, name1, name2, st->str, TCL_GLOBAL_ONLY);
Index: eggdrop1.7/src/tcldcc.c
diff -u eggdrop1.7/src/tcldcc.c:1.35 eggdrop1.7/src/tcldcc.c:1.36
--- eggdrop1.7/src/tcldcc.c:1.35	Mon Oct 15 04:27:08 2001
+++ eggdrop1.7/src/tcldcc.c	Thu Oct 18 20:55:05 2001
@@ -2,7 +2,7 @@
  * tcldcc.c -- handles:
  *   Tcl stubs for the dcc commands
  *
- * $Id: tcldcc.c,v 1.35 2001/10/15 09:27:08 stdarg Exp $
+ * $Id: tcldcc.c,v 1.36 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -137,8 +137,8 @@
   BADARGS(2, 2, " nickname");
   for (i = 0; i < dcc_total; i++)
     if ((dcc[i].type->flags & DCT_SIMUL) &&
-        !egg_strcasecmp(argv[1], dcc[i].nick)) {
-      egg_snprintf(s, sizeof s, "%ld", dcc[i].sock);
+        !strcasecmp(argv[1], dcc[i].nick)) {
+      snprintf(s, sizeof s, "%ld", dcc[i].sock);
       Tcl_AppendResult(irp, s, NULL);
       return TCL_OK;
     }
@@ -159,9 +159,9 @@
     return TCL_ERROR;
   }
   if (dcc[idx].type == &DCC_SCRIPT)
-    egg_snprintf(s, sizeof s, "%d", dcc[idx].u.script->u.chat->channel);
+    snprintf(s, sizeof s, "%d", dcc[idx].u.script->u.chat->channel);
   else
-    egg_snprintf(s, sizeof s, "%d", dcc[idx].u.chat->channel);
+    snprintf(s, sizeof s, "%d", dcc[idx].u.chat->channel);
   Tcl_AppendResult(irp, s, NULL);
   return TCL_OK;
 }
@@ -179,7 +179,7 @@
     return TCL_ERROR;
   }
   if (argv[2][0] < '0' || argv[2][0] > '9') {
-    if (!strcmp(argv[2], "-1") || !egg_strcasecmp(argv[2], "off"))
+    if (!strcmp(argv[2], "-1") || !strcasecmp(argv[2], "off"))
       chan = (-1);
     else {
       Tcl_SetVar(irp, "chan", argv[2], 0);
@@ -395,7 +395,7 @@
     }
   }
   if (dcc[i].status & STAT_PAGE) {
-    egg_snprintf(x, sizeof x, "%d", dcc[i].u.chat->max_line);
+    snprintf(x, sizeof x, "%d", dcc[i].u.chat->max_line);
     Tcl_AppendResult(irp, x, NULL);
   } else
     Tcl_AppendResult(irp, "0", NULL);
@@ -582,13 +582,13 @@
   BADARGS(1, 2, " ?type?");
   for (i = 0; i < dcc_total; i++) {
     if (argc == 1 ||
-	(dcc[i].type && !egg_strcasecmp(dcc[i].type->name, argv[1]))) {
-      egg_snprintf(idxstr, sizeof idxstr, "%ld", dcc[i].sock);
-      egg_snprintf(timestamp, sizeof timestamp, "%ld", dcc[i].timeval);
+	(dcc[i].type && !strcasecmp(dcc[i].type->name, argv[1]))) {
+      snprintf(idxstr, sizeof idxstr, "%ld", dcc[i].sock);
+      snprintf(timestamp, sizeof timestamp, "%ld", dcc[i].timeval);
       if (dcc[i].type && dcc[i].type->display)
 	dcc[i].type->display(i, other);
       else {
-	egg_snprintf(other, sizeof other, "?:%lX  !! ERROR !!",
+	snprintf(other, sizeof other, "?:%lX  !! ERROR !!",
 		     (long) dcc[i].type);
 	break;
       }
@@ -638,7 +638,7 @@
       if (dcc[i].u.chat->channel == chan || chan == -1) {
 	c[0] = geticon(i);
 	c[1] = 0;
-	egg_snprintf(idle, sizeof idle, "%lu", (now - dcc[i].timeval) / 60);
+	snprintf(idle, sizeof idle, "%lu", (now - dcc[i].timeval) / 60);
 	list[0] = dcc[i].nick;
 	list[1] = botnetnick;
 	list[2] = dcc[i].host;
@@ -646,7 +646,7 @@
 	list[4] = idle;
 	list[5] = dcc[i].u.chat->away ? dcc[i].u.chat->away : "";
 	if (chan == -1) {
-	  egg_snprintf(work, sizeof work, "%d", dcc[i].u.chat->channel);
+	  snprintf(work, sizeof work, "%d", dcc[i].u.chat->channel);
 	  list[6] = work;
 	}
 	p = Tcl_Merge((chan == -1) ? 7 : 6, list);
@@ -661,7 +661,7 @@
       if (party[i].timer == 0L)
 	strcpy(idle, "0");
       else
-	egg_snprintf(idle, sizeof idle, "%lu", (now - party[i].timer) / 60);
+	snprintf(idle, sizeof idle, "%lu", (now - party[i].timer) / 60);
       list[0] = party[i].nick;
       list[1] = party[i].bot;
       list[2] = party[i].from ? party[i].from : "";
@@ -669,7 +669,7 @@
       list[4] = idle;
       list[5] = party[i].status & PLSTAT_AWAY ? party[i].away : "";
       if (chan == -1) {
-	egg_snprintf(work, sizeof work, "%d", party[i].chan);
+	snprintf(work, sizeof work, "%d", party[i].chan);
 	list[6] = work;
       }
       p = Tcl_Merge((chan == -1) ? 7 : 6, list);
@@ -685,7 +685,7 @@
   char s[20];
 
   BADARGS(1, 1, "");
-  egg_snprintf(s, sizeof s, "%d", dcc_total);
+  snprintf(s, sizeof s, "%d", dcc_total);
   Tcl_AppendResult(irp, s, NULL);
   return TCL_OK;
 }
@@ -702,7 +702,7 @@
     return TCL_ERROR;
   }
   x = (now - dcc[idx].timeval);
-  egg_snprintf(s, sizeof s, "%d", x);
+  snprintf(s, sizeof s, "%d", x);
   Tcl_AppendElement(irp, s);
   return TCL_OK;
 }
@@ -762,7 +762,7 @@
     else
       botnet_send_link(i, botnetnick, bot, bot2);
   }
-  egg_snprintf(bot, sizeof bot, "%d", x);
+  snprintf(bot, sizeof bot, "%d", x);
   Tcl_AppendResult(irp, bot, NULL);
   return TCL_OK;
 }
@@ -779,12 +779,12 @@
      x = 0;
   else {
     x = 1;
-    if (!egg_strcasecmp(bot, dcc[i].nick))
+    if (!strcasecmp(bot, dcc[i].nick))
       x = botunlink(-2, bot, argv[2]);
     else
       botnet_send_unlink(i, botnetnick, lastbot(bot), bot, argv[2]);
   }
-  egg_snprintf(bot, sizeof bot, "%d", x);
+  snprintf(bot, sizeof bot, "%d", x);
   Tcl_AppendResult(irp, bot, NULL);
   return TCL_OK;
 }
@@ -820,7 +820,7 @@
   dcc[i].port = atoi(argv[2]);
   strcpy(dcc[i].nick, "*");
   strncpyz(dcc[i].host, argv[1], UHOSTMAX);
-  egg_snprintf(s, sizeof s, "%d", sock);
+  snprintf(s, sizeof s, "%d", sock);
   Tcl_AppendResult(irp, s, NULL);
   return TCL_OK;
 }
@@ -859,7 +859,7 @@
   for (i = 0; i < dcc_total; i++)
     if ((dcc[i].type == &DCC_TELNET) && (dcc[i].port == port))
       idx = i;
-  if (!egg_strcasecmp(argv[2], "off")) {
+  if (!strcasecmp(argv[2], "off")) {
     if (pmap) {
       if (pold)
 	pold->next = pmap->next;
@@ -925,7 +925,7 @@
       dcc[idx].status = LSTN_PUBLIC;
     }
     strncpyz(dcc[idx].host, argv[3], UHOSTMAX);
-    egg_snprintf(s, sizeof s, "%d", port);
+    snprintf(s, sizeof s, "%d", port);
     Tcl_AppendResult(irp, s, NULL);
     return TCL_OK;
   }
@@ -947,7 +947,7 @@
     strncpyz(dcc[idx].host, argv[3], UHOSTMAX);
   } else
     strcpy(dcc[idx].host, "*");
-  egg_snprintf(s, sizeof s, "%d", port);
+  snprintf(s, sizeof s, "%d", port);
   Tcl_AppendResult(irp, s, NULL);
   if (!pmap) {
     pmap = malloc(sizeof(struct portmap));
@@ -972,7 +972,7 @@
 
     splitc(whonick, who, '@');
     whonick[HANDLEN] = 0;
-    if (!egg_strcasecmp(who, botnetnick))
+    if (!strcasecmp(who, botnetnick))
        strncpyz(who, whonick, sizeof who);
     else if (remote_boots > 0) {
       i = nextbot(who);
@@ -985,7 +985,7 @@
   }
   for (i = 0; i < dcc_total; i++)
     if (!ok && (dcc[i].type->flags & DCT_CANBOOT) &&
-        !egg_strcasecmp(dcc[i].nick, who)) {
+        !strcasecmp(dcc[i].nick, who)) {
       do_boot(i, botnetnick, argv[2] ? argv[2] : "");
       ok = 1;
     }
Index: eggdrop1.7/src/tclhash.c
diff -u eggdrop1.7/src/tclhash.c:1.48 eggdrop1.7/src/tclhash.c:1.49
--- eggdrop1.7/src/tclhash.c:1.48	Tue Oct 16 22:28:16 2001
+++ eggdrop1.7/src/tclhash.c	Thu Oct 18 20:55:05 2001
@@ -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.48 2001/10/17 03:28:16 stdarg Exp $
+ * $Id: tclhash.c,v 1.49 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -245,7 +245,7 @@
   for (tl = bind_table_list, tl_prev = NULL; tl; tl_prev = tl, tl = tl->next) {
     if (tl->flags & HT_DELETED)
       continue;
-    v = egg_strcasecmp(tl->name, nme);
+    v = strcasecmp(tl->name, nme);
     if (!v)
       return tl;	/* Duplicate, just return old value.	*/
     if (v > 0)
@@ -332,7 +332,7 @@
   for (tl = bind_table_list; tl; tl = tl->next) {
     if (tl->flags & HT_DELETED)
       continue;
-    v = egg_strcasecmp(tl->name, nme);
+    v = strcasecmp(tl->name, nme);
     if (!v)
       return tl;
     if (v > 0)
@@ -406,7 +406,7 @@
     for (tc = tm->first; tc; tc = tc->next) {
       if (tc->attributes & TC_DELETED)
 	continue;
-      if (!egg_strcasecmp(tc->func_name, proc)) {
+      if (!strcasecmp(tc->func_name, proc)) {
 	/* Erase proc regardless of flags. */
 	tc->attributes |= TC_DELETED;
 	return 1;		/* Match.	*/
@@ -502,7 +502,7 @@
   for (tc = tm->first; tc; tc = tc->next) {
     if (tc->attributes & TC_DELETED)
       continue;
-    if (!egg_strcasecmp(tc->func_name, proc)) {
+    if (!strcasecmp(tc->func_name, proc)) {
       tc->flags.match = FR_GLOBAL | FR_CHAN;
       break_down_flags(flags, &(tc->flags), NULL);
       return 1;
@@ -762,14 +762,14 @@
 		/* Test to see if it matches. */
 		if (table->match_type & MATCH_PARTIAL) {
 			if (table->match_type & MATCH_CASE) cmp = strncmp(match, chain->mask, len);
-			else cmp = egg_strncasecmp(match, chain->mask, len);
+			else cmp = strncasecmp(match, chain->mask, len);
 		}
 		else if (table->match_type & MATCH_MASK) {
 			cmp = !wild_match_per((unsigned char *)chain->mask, (unsigned char *)match);
 		}
 		else {
 			if (table->match_type & MATCH_CASE) cmp = strcmp(match, chain->mask);
-			else cmp = egg_strcasecmp(match, chain->mask);
+			else cmp = strcasecmp(match, chain->mask);
 		}
 		if (cmp) continue; /* Doesn't match. */
 
@@ -835,10 +835,10 @@
        requirements. */
     switch (match_type & 0x03) {
     case MATCH_PARTIAL:
-      ok = !egg_strncasecmp(match, tm->mask, strlen(match));
+      ok = !strncasecmp(match, tm->mask, strlen(match));
       break;
     case MATCH_EXACT:
-      ok = !egg_strcasecmp(match, tm->mask);
+      ok = !strcasecmp(match, tm->mask);
       break;
     case MATCH_CASE:
       ok = !strcmp(match, tm->mask);
@@ -918,7 +918,7 @@
 	     only want to execute _one_ bind ... */
 	  if ((match_type & 3) != MATCH_PARTIAL ||
 	      /* ... or this is happens to be an exact match. */
-	      !egg_strcasecmp(match, tm->mask))
+	      !strcasecmp(match, tm->mask))
 	    cnt = finish = 1;
 	}
       }
@@ -983,7 +983,7 @@
   touch_laston(u, "partyline", now);
   get_user_flagrec(u, &fr, NULL);
   Tcl_SetVar(interp, "_chonof1", (char *) hand, 0);
-  egg_snprintf(s, sizeof s, "%d", sock);
+  snprintf(s, sizeof s, "%d", sock);
   Tcl_SetVar(interp, "_chonof2", (char *) s, 0);
   check_tcl_bind(tl, hand, &fr, " $_chonof1 $_chonof2", MATCH_MASK |
 		 BIND_USE_ATTR | BIND_STACKABLE | BIND_WANTRET);
@@ -994,7 +994,7 @@
 {
   char s[11];
 
-  egg_snprintf(s, sizeof s, "%d", chan);
+  snprintf(s, sizeof s, "%d", chan);
   Tcl_SetVar(interp, "_cab1", (char *) from, 0);
   Tcl_SetVar(interp, "_cab2", (char *) s, 0);
   Tcl_SetVar(interp, "_cab3", (char *) text, 0);
@@ -1034,7 +1034,7 @@
   int			x;
   struct flag_record	fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
 
-  egg_snprintf(s, sizeof s, "%ld", dcc[idx].sock);
+  snprintf(s, sizeof s, "%ld", dcc[idx].sock);
   get_user_flagrec(dcc[idx].user, &fr, dcc[idx].u.chat->con_chan);
   Tcl_SetVar(interp, "_filt1", (char *) s, 0);
   Tcl_SetVar(interp, "_filt2", (char *) text, 0);
@@ -1066,7 +1066,7 @@
   char	s[11];
   int	x;
 
-  egg_snprintf(s, sizeof s, "%d", idx);
+  snprintf(s, sizeof s, "%d", idx);
   Tcl_SetVar(interp, "_n", (char *) s, 0);
   x = Tcl_VarEval(interp, cmd, " $_n", NULL);
   if (x == TCL_ERROR)
@@ -1094,8 +1094,8 @@
   case '%':
     fr.global = USER_BOTMAST;
   }
-  egg_snprintf(s, sizeof s, "%d", chan);
-  egg_snprintf(u, sizeof u, "%d", sock);
+  snprintf(s, sizeof s, "%d", chan);
+  snprintf(u, sizeof u, "%d", sock);
   Tcl_SetVar(interp, "_chjn1", (char *) bot, 0);
   Tcl_SetVar(interp, "_chjn2", (char *) nick, 0);
   Tcl_SetVar(interp, "_chjn3", (char *) s, 0);
@@ -1111,8 +1111,8 @@
 {
   char	u[11], v[11];
 
-  egg_snprintf(u, sizeof u, "%d", sock);
-  egg_snprintf(v, sizeof v, "%d", chan);
+  snprintf(u, sizeof u, "%d", sock);
+  snprintf(v, sizeof v, "%d", chan);
   Tcl_SetVar(interp, "_chpt1", (char *) bot, 0);
   Tcl_SetVar(interp, "_chpt2", (char *) hand, 0);
   Tcl_SetVar(interp, "_chpt3", (char *) u, 0);
@@ -1127,7 +1127,7 @@
 
   check_bind(BT_away, bot, NULL, bot, idx, msg);
 
-  egg_snprintf(u, sizeof u, "%d", idx);
+  snprintf(u, sizeof u, "%d", idx);
   Tcl_SetVar(interp, "_away1", (char *) bot, 0);
   Tcl_SetVar(interp, "_away2", (char *) u, 0);
   Tcl_SetVar(interp, "_away3", msg ? (char *) msg : "", 0);
@@ -1157,9 +1157,9 @@
   else
     tl_kind = NULL;
 
-  if ((name && name[0] && !egg_strcasecmp(name, "all")) || (s && s[0] && !egg_strcasecmp(s, "all")))
+  if ((name && name[0] && !strcasecmp(name, "all")) || (s && s[0] && !strcasecmp(s, "all")))
     showall = 1;
-  if (tl_kind == NULL && name && name[0] && egg_strcasecmp(name, "all"))
+  if (tl_kind == NULL && name && name[0] && strcasecmp(name, "all"))
     patmatc = 1;
 
   dprintf(idx, _("Command bindings:\n"));
@@ -1224,7 +1224,7 @@
   char	p[1024], *l;
 
   for (i = 0; cc[i].name; i++) {
-    egg_snprintf(p, sizeof p, "*%s:%s", tl->name,
+    snprintf(p, sizeof p, "*%s:%s", tl->name,
 		   cc[i].funcname ? cc[i].funcname : cc[i].name);
     l = (char *) malloc(Tcl_ScanElement(p, &k));
     Tcl_ConvertElement(p, l, k | TCL_DONT_USE_BRACES);
@@ -1251,7 +1251,7 @@
   char	p[1024], *l;
 
   for (i = 0; cc[i].name; i++) {
-    egg_snprintf(p, sizeof p, "*%s:%s", table->name,
+    snprintf(p, sizeof p, "*%s:%s", table->name,
 		   cc[i].funcname ? cc[i].funcname : cc[i].name);
     l = (char *) malloc(Tcl_ScanElement(p, &k));
     Tcl_ConvertElement(p, l, k | TCL_DONT_USE_BRACES);
Index: eggdrop1.7/src/tclmisc.c
diff -u eggdrop1.7/src/tclmisc.c:1.34 eggdrop1.7/src/tclmisc.c:1.35
--- eggdrop1.7/src/tclmisc.c:1.34	Thu Oct 18 04:06:43 2001
+++ eggdrop1.7/src/tclmisc.c	Thu Oct 18 20:55:05 2001
@@ -3,7 +3,7 @@
  *   Tcl stubs for file system commands
  *   Tcl stubs for everything else
  *
- * $Id: tclmisc.c,v 1.34 2001/10/18 09:06:43 stdarg Exp $
+ * $Id: tclmisc.c,v 1.35 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -71,7 +71,7 @@
             !wild_match(argv[1], tc->func_name))
           continue;
 	build_flags(flg, &(tc->flags), NULL);
-        egg_snprintf(hits, sizeof hits, "%i", (int) tc->hits);
+        snprintf(hits, sizeof hits, "%i", (int) tc->hits);
         list[0] = tl->name;
         list[1] = flg;
         list[2] = tm->mask;
@@ -136,7 +136,7 @@
   char s[11];
 
   BADARGS(1, 1, "");
-  egg_snprintf(s, sizeof s, "%lu", (unsigned long) now);
+  snprintf(s, sizeof s, "%lu", (unsigned long) now);
   Tcl_AppendResult(irp, s, NULL);
   return TCL_OK;
 }
@@ -165,7 +165,7 @@
   else
     t = now;
     tm1 = localtime(&t);
-  if (egg_strftime(buf, sizeof(buf) - 1, argv[1], tm1)) {
+  if (strftime(buf, sizeof(buf) - 1, argv[1], tm1)) {
     Tcl_AppendResult(irp, buf, NULL);
     return TCL_OK;
   }
@@ -178,7 +178,7 @@
   char s[16];
 
   BADARGS(1, 1, "");
-  egg_snprintf(s, sizeof s, "%lu", iptolong(getmyip()));
+  snprintf(s, sizeof s, "%lu", iptolong(getmyip()));
   Tcl_AppendResult(irp, s, NULL);
   return TCL_OK;
 }
@@ -205,7 +205,7 @@
     return TCL_ERROR;
   }
   x = random() % (atol(argv[1]));
-  egg_snprintf(s, sizeof s, "%lu", x);
+  snprintf(s, sizeof s, "%lu", x);
   Tcl_AppendResult(irp, s, NULL);
   return TCL_OK;
 }
@@ -218,7 +218,7 @@
   strncpyz(from, argv[1], sizeof from);
   strncpyz(to, argv[2], sizeof to);
   strncpyz(msg, argv[3], sizeof msg);
-  egg_snprintf(s, sizeof s, "%d", add_note(to, from, msg, -1, 0));
+  snprintf(s, sizeof s, "%d", add_note(to, from, msg, -1, 0));
   Tcl_AppendResult(irp, s, NULL);
   return TCL_OK;
 }
@@ -265,7 +265,7 @@
 
   BADARGS(1, 2, " ?reason?");
   if (argc == 2) {
-    egg_snprintf(s, sizeof s, "BOT SHUTDOWN (%s)", argv[1]);
+    snprintf(s, sizeof s, "BOT SHUTDOWN (%s)", argv[1]);
     strncpyz(quit_msg, argv[1], 1024);
   } else {
     strncpyz(s, "BOT SHUTDOWN (No reason)", sizeof s);
@@ -325,13 +325,13 @@
   BADARGS(1, 1, "");
   for (current = module_list; current; current = current->next) {
     list[0] = current->name;
-    egg_snprintf(s, sizeof s, "%d.%d", current->major, current->minor);
+    snprintf(s, sizeof s, "%d.%d", current->major, current->minor);
     list[1] = s;
     i = 2;
     for (dep = dependancy_list; dep && (i < 100); dep = dep->next) {
       if (dep->needing == current) {
 	list2[0] = dep->needed->name;
-	egg_snprintf(s2, sizeof s2, "%d.%d", dep->major, dep->minor);
+	snprintf(s2, sizeof s2, "%d.%d", dep->major, dep->minor);
 	list2[1] = s2;
 	list[i] = Tcl_Merge(2, list2);
 	i++;
Index: eggdrop1.7/src/tcluser.c
diff -u eggdrop1.7/src/tcluser.c:1.26 eggdrop1.7/src/tcluser.c:1.27
--- eggdrop1.7/src/tcluser.c:1.26	Tue Oct 16 21:01:56 2001
+++ eggdrop1.7/src/tcluser.c	Thu Oct 18 20:55:05 2001
@@ -2,7 +2,7 @@
  * tcluser.c -- handles:
  *   Tcl stubs for the user-record-oriented commands
  *
- * $Id: tcluser.c,v 1.26 2001/10/17 02:01:56 poptix Exp $
+ * $Id: tcluser.c,v 1.27 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -405,7 +405,7 @@
       x = 0;
     else if (get_user_by_handle(userlist, newhand))
       x = 0;
-    else if (!egg_strcasecmp(botnetnick, newhand) &&
+    else if (!strcasecmp(botnetnick, newhand) &&
              (!(u->flags & USER_BOT) || nextbot (argv [1]) != -1))
       x = 0;
     else if (newhand[0] == '*')
@@ -478,9 +478,9 @@
   for (i = global_ign; i; i = i->next) {
     list[0] = i->igmask;
     list[1] = i->msg;
-    egg_snprintf(expire, sizeof expire, "%lu", i->expire);
+    snprintf(expire, sizeof expire, "%lu", i->expire);
     list[2] = expire;
-    egg_snprintf(added, sizeof added, "%lu", i->added);
+    snprintf(added, sizeof added, "%lu", i->added);
     list[3] = added;
     list[4] = i->user;
     p = Tcl_Merge(5, list);
@@ -497,7 +497,7 @@
   struct user_entry *e;
 
   BADARGS(3, 999, " handle type");
-  if (!(et = find_entry_type(argv[2])) && egg_strcasecmp(argv[2], "HANDLE")) {
+  if (!(et = find_entry_type(argv[2])) && strcasecmp(argv[2], "HANDLE")) {
     Tcl_AppendResult(irp, "No such info type: ", argv[2], NULL);
     return TCL_ERROR;
   }
@@ -508,7 +508,7 @@
     } else
       return TCL_OK;		/* silently ignore user * */
   }
-  if (!egg_strcasecmp(argv[2], "HANDLE")) {
+  if (!strcasecmp(argv[2], "HANDLE")) {
     Tcl_AppendResult(irp,u->handle, NULL);
   } else {
   e = find_user_entry(et, u);
Index: eggdrop1.7/src/userent.c
diff -u eggdrop1.7/src/userent.c:1.24 eggdrop1.7/src/userent.c:1.25
--- eggdrop1.7/src/userent.c:1.24	Thu Oct 11 13:24:01 2001
+++ eggdrop1.7/src/userent.c	Thu Oct 18 20:55:05 2001
@@ -2,7 +2,7 @@
  * userent.c -- handles:
  *   user-entry handling, new stylem more versatile.
  *
- * $Id: userent.c,v 1.24 2001/10/11 18:24:01 tothwolf Exp $
+ * $Id: userent.c,v 1.25 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -624,7 +624,7 @@
   struct xtra_key *curr, *old = NULL, *new = buf;
 
   for (curr = e->u.extra; curr; curr = curr->next) {
-    if (curr->key && !egg_strcasecmp(curr->key, new->key)) {
+    if (curr->key && !strcasecmp(curr->key, new->key)) {
       old = curr;
       break;
     }
@@ -747,7 +747,7 @@
   for (xk = e->u.extra; xk; xk = xk->next) {
     /* Ok, it's a valid xtra field entry */
     for (j = 0; j < lc; j++) {
-      if (!egg_strcasecmp(list[j], xk->key))
+      if (!strcasecmp(list[j], xk->key))
 	dprintf(idx, "  %s: %s\n", xk->key, xk->data);
     }
   }
@@ -831,7 +831,7 @@
   BADARGS(3, 4, " handle XTRA ?key?");
   if (argc == 4) {
     for (x = e->u.extra; x; x = x->next)
-      if (!egg_strcasecmp(argv[3], x->key)) {
+      if (!strcasecmp(argv[3], x->key)) {
 	Tcl_AppendResult(irp, x->data, NULL);
 	return TCL_OK;
       }
@@ -926,7 +926,7 @@
 
 static int hosts_set(struct userrec *u, struct user_entry *e, void *buf)
 {
-  if (!buf || !egg_strcasecmp(buf, "none")) {
+  if (!buf || !strcasecmp(buf, "none")) {
     /* When the bot crashes, it's in this part, not in the 'else' part */
     list_type_kill(e->u.list);
     e->u.list = NULL;
@@ -1074,7 +1074,7 @@
   struct user_entry_type *p;
 
   for (p = entry_type_list; p; p = p->next) {
-    if (!egg_strcasecmp(name, p->name))
+    if (!strcasecmp(name, p->name))
       return p;
   }
   return NULL;
@@ -1087,7 +1087,7 @@
 
   for (e = &(u->entries); *e; e = &((*e)->next)) {
     if (((*e)->type == et) ||
-	((*e)->name && !egg_strcasecmp((*e)->name, et->name))) {
+	((*e)->name && !strcasecmp((*e)->name, et->name))) {
       t = *e;
       *e = t->next;
       t->next = u->entries;
Index: eggdrop1.7/src/userrec.c
diff -u eggdrop1.7/src/userrec.c:1.37 eggdrop1.7/src/userrec.c:1.38
--- eggdrop1.7/src/userrec.c:1.37	Mon Oct 15 13:47:11 2001
+++ eggdrop1.7/src/userrec.c	Thu Oct 18 20:55:05 2001
@@ -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.37 2001/10/15 18:47:11 poptix Exp $
+ * $Id: userrec.c,v 1.38 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -93,7 +93,7 @@
   int i;
 
   for (i = 0; i < dcc_total; i++)
-    if (!egg_strcasecmp(dcc[i].nick, handle))
+    if (!strcasecmp(dcc[i].nick, handle))
       return dcc[i].user;
   return NULL;
 }
@@ -109,7 +109,7 @@
   if (!handle[0] || (handle[0] == '*'))
     return NULL;
   if (bu == userlist) {
-    if (lastuser && !egg_strcasecmp(lastuser->handle, handle)) {
+    if (lastuser && !strcasecmp(lastuser->handle, handle)) {
       cache_hit++;
       return lastuser;
     }
@@ -126,7 +126,7 @@
     cache_miss++;
   }
   for (u = bu; u; u = u->next)
-    if (!egg_strcasecmp(u->handle, handle)) {
+    if (!strcasecmp(u->handle, handle)) {
       if (bu == userlist)
 	lastuser = u;
       return u;
@@ -371,7 +371,7 @@
     if (a->flags & ~b->flags & USER_OP)
       return 0;
   }
-  return (egg_strcasecmp(a->handle, b->handle) > 0);
+  return (strcasecmp(a->handle, b->handle) > 0);
 }
 
 void sort_userlist()
@@ -468,7 +468,7 @@
   strncpyz(s, u->handle, sizeof s);
   strncpyz(u->handle, newh, sizeof u->handle);
   for (i = 0; i < dcc_total; i++)
-    if (dcc[i].type != &DCC_BOT && !egg_strcasecmp(dcc[i].nick, s)) {
+    if (dcc[i].type != &DCC_BOT && !strcasecmp(dcc[i].nick, s)) {
       strncpyz(dcc[i].nick, newh, sizeof dcc[i].nick);
       if (dcc[i].type == &DCC_CHAT && dcc[i].u.chat->channel >= 0) {
 	chanout_but(-1, dcc[i].u.chat->channel,
@@ -604,7 +604,7 @@
   int fnd = 0;
 
   while ((u != NULL) && (!fnd)) {
-    if (!egg_strcasecmp(u->handle, handle))
+    if (!strcasecmp(u->handle, handle))
       fnd = 1;
     else {
       prev = u;
@@ -732,7 +732,7 @@
       if (!irccmp(nick, m->nick)) {
   	char word[512];
 
-	egg_snprintf(word, sizeof word, "%s!%s", m->nick, m->userhost);
+	snprintf(word, sizeof word, "%s!%s", m->nick, m->userhost);
 	/* No need to check the return value ourself */
 	return get_user_by_host(word);;
       }
Index: eggdrop1.7/src/users.c
diff -u eggdrop1.7/src/users.c:1.30 eggdrop1.7/src/users.c:1.31
--- eggdrop1.7/src/users.c:1.30	Thu Oct 11 13:24:02 2001
+++ eggdrop1.7/src/users.c	Thu Oct 18 20:55:05 2001
@@ -10,7 +10,7 @@
  *
  * dprintf'ized, 9nov1995
  *
- * $Id: users.c,v 1.30 2001/10/11 18:24:02 tothwolf Exp $
+ * $Id: users.c,v 1.31 2001/10/19 01:55:05 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -478,9 +478,9 @@
   else {
     now2 = now - li->laston;
     if (now2 > 86400)
-      egg_strftime(s1, 7, "%d %b", localtime(&li->laston));
+      strftime(s1, 7, "%d %b", localtime(&li->laston));
     else
-      egg_strftime(s1, 6, "%H:%M", localtime(&li->laston));
+      strftime(s1, 6, "%H:%M", localtime(&li->laston));
   }
   spaces[l] = 0;
   dprintf(idx, "%s%s %-5s%5d %-15s %s (%-10.10s)\n", u->handle, spaces,
@@ -497,9 +497,9 @@
       else {
 	now2 = now - (ch->laston);
 	if (now2 > 86400)
-	  egg_strftime(s1, 7, "%d %b", localtime(&ch->laston));
+	  strftime(s1, 7, "%d %b", localtime(&ch->laston));
 	else
-	  egg_strftime(s1, 6, "%H:%M", localtime(&ch->laston));
+	  strftime(s1, 6, "%H:%M", localtime(&ch->laston));
       }
       fr.match = FR_CHAN;
       fr.chan = ch->flags;
@@ -853,7 +853,7 @@
 	    int ok = 0;
 
 	    for (ue = u->entries; ue && !ok; ue = ue->next)
-	      if (ue->name && !egg_strcasecmp(code + 2, ue->name)) {
+	      if (ue->name && !strcasecmp(code + 2, ue->name)) {
 		struct list_type *list;
 
 		list = malloc(sizeof(struct list_type));
@@ -923,7 +923,7 @@
 
 	      u = get_user_by_handle(bu, code);
 	      for (i = 0; i < dcc_total; i++)
-		if (!egg_strcasecmp(code, dcc[i].nick))
+		if (!strcasecmp(code, dcc[i].nick))
 		  dcc[i].user = u;
 	      u->flags_udef = fr.udef_global;
 	      /* if s starts with '/' it's got file info */
@@ -942,7 +942,7 @@
   for (u = bu; u; u = u->next) {
     struct user_entry *e;
 
-    if (!(u->flags & USER_BOT) && !egg_strcasecmp (u->handle, botnetnick)) {
+    if (!(u->flags & USER_BOT) && !strcasecmp (u->handle, botnetnick)) {
       putlog(LOG_MISC, "*", "(!) I have an user record, but without +b");
       /* u->flags |= USER_BOT; */
     }
@@ -1024,7 +1024,7 @@
 	  }
 	  /* did we make it where we're supposed to start?  yay! */
 	  if (!ready)
-	    if (!egg_strcasecmp(u->handle, start)) {
+	    if (!strcasecmp(u->handle, start)) {
 	      ready = 1;
 	      autc = NULL;
 	      /* if starting point is a +h bot, must be in 2nd cycle */
@@ -1042,7 +1042,7 @@
 	  int i;
 
 	  i = nextbot(u->handle);
-	  if ((i >= 0) && !egg_strcasecmp(dcc[i].nick, u->handle)) {
+	  if ((i >= 0) && !strcasecmp(dcc[i].nick, u->handle)) {
 	    char *p = _("rejected");
 
 	    /* we're directly connected to the offending bot?! (shudder!) */
@@ -1052,7 +1052,7 @@
 	    dprintf(i, "bye %s\n", _("Rejecting bot"));
 	    killsock(dcc[i].sock);
 	    lostdcc(i);
-	  } else if ((i < 0) && egg_strcasecmp(botnetnick, u->handle)) {
+	  } else if ((i < 0) && strcasecmp(botnetnick, u->handle)) {
 	    /* The bot is not connected, but listed in our tandem list! */
 	    putlog(LOG_BOTS, "*", "(!) BUG: rejecting not connected bot %s!",
 		   u->handle);
----------------------- End of diff -----------------------



More information about the Changes mailing list