Parcourir la source

* OK, TCL IS OUT, WOOOOOOOO :)
* Also fixed a ton of shadowing parameters,
got tired of it, so stopped for now..


svn: 696

Bryan Drewery il y a 22 ans
Parent
commit
84d6b39f27

+ 10 - 18
Makefile.in

@@ -19,7 +19,7 @@ DISTROFILES = config.h.in doc/ misc/ scripts/ ChangeLog Makefile.in build config
 EXCLUDES = pack/pack.cfg misc/ind doc/DEVEL src/Makefile src/compat/Makefile src/mod/Makefile \
            src/mod/dns.mod/Makefile src/mod/*.mod/.deps/ src/mod/*.mod/.cvsignore \
            src/.deps src/compat/.deps misc/commit misc/grep autotools/ \
-           config.cache config.log config.status config.h lush.h stamp.* misc/.cvsignore src/compat/.cvsignore \
+           config.cache config.log config.status config.h stamp.* misc/.cvsignore src/compat/.cvsignore \
            src/mod/.cvsignore src/.cvsignore .cvsignore misc/commit misc/fstrings \
            misc/plainh misc/grep misc/cp.sh src/settings.c src/salt.h src/salt.h.tmp
 
@@ -30,14 +30,10 @@ CCDEBUG = @DISTCC@ @CCDEBUG@
 LDDEBUG = @DISTCC@ @CCDEBUG@
 STRIP = @STRIP@
 
-# stuff for Tcl
-XREQS = @TCL_REQS@
-XLIBS = @TCL_LIBS@ @LIBS@ @ZLIB@ @SSL@ @RESLIB@
-TCLLIB = @TCLLIB@
-TCLLIBFN = @TCLLIBFN@
+LIBS = @LIBS@ @ZLIB@ @SSL@ @RESLIB@
 
 DEBCFLAGS = -DDEBUG_ASSERT -DDEBUG_MEM -g3 -ggdb3
-CFLGS = -fno-strict-aliasing -Wno-format-y2k 
+CFLGS = -fno-strict-aliasing -Wno-format-y2k
 #-Wuninitialized -W -Wnested-externs -Wdisabled-optimization -Winline
 #-Wpadded -Wshadow -finline-functions
 MAKEFLAGS = -s -j4
@@ -45,34 +41,30 @@ MAKEFLAGS = -s -j4
 MAKE_LEAF = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CC)' 'LD=$(LD)' \
 'CCDEPMODE=$(CCDEPMODE)' \
 'STRIP=$(STRIP)' 'CFLGS=$(CFLGS) -DLEAF' \
-'TCLLIB=$(TCLLIB)' 'TCLLIBFN=$(TCLLIBFN)' 'XREQS=$(XREQS)' \
-'XLIBS=$(XLIBS)' 'EGGEXEC=$(LEAFEXEC)' 'EGGBUILD=(leaf)'
+'LIBS=$(LIBS)' 'EGGEXEC=$(LEAFEXEC)' 'EGGBUILD=(leaf)'
 
 MAKE_DLEAF = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CCDEBUG)' 'LD=$(LDDEBUG) -g' \
 'CCDEPMODE=$(CCDEPMODE)' \
 'STRIP=touch' 'CFLGS=$(DEBCFLAGS) -DLEAF $(CFLGS)' \
-'TCLLIB=$(TCLLIB)' 'TCLLIBFN=$(TCLLIBFN)' 'XREQS=$(XREQS)' 'XLIBS=$(XLIBS)' \
-'EGGEXEC=$(LEAFEXEC)' 'EGGBUILD=(debug leaf)' 
+'LIBS=$(LIBS)' 'EGGEXEC=$(LEAFEXEC)' 'EGGBUILD=(debug leaf)' 
 
 MAKE_HUB = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CC)' 'LD=$(LD)' \
 'CCDEPMODE=$(CCDEPMODE)' \
 'STRIP=$(STRIP)' 'CFLGS=$(CFLGS) -DHUB' \
-'TCLLIB=$(TCLLIB)' 'TCLLIBFN=$(TCLLIBFN)' 'XREQS=$(XREQS)' \
-'XLIBS=$(XLIBS)' 'EGGEXEC=$(HUBEXEC)' 'EGGBUILD=(hub)' 
+'LIBS=$(LIBS)' 'EGGEXEC=$(HUBEXEC)' 'EGGBUILD=(hub)' 
 
 MAKE_DHUB = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CCDEBUG)' 'LD=$(LDDEBUG) -g' \
 'CCDEPMODE=$(CCDEPMODE)' \
 'STRIP=touch' 'CFLGS=$(DEBCFLAGS) -DHUB $(CFLGS)' \
-'TCLLIB=$(TCLLIB)' 'TCLLIBFN=$(TCLLIBFN)' 'XREQS=$(XREQS)' 'XLIBS=$(XLIBS)' \
-'EGGEXEC=$(HUBEXEC)' 'EGGBUILD=(debug hub)'
+'LIBS=$(LIBS)' 'EGGEXEC=$(HUBEXEC)' 'EGGBUILD=(debug hub)'
 
 MAKE_UTILS = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CCDEBUG)' 'STRIP=touch' \
 'CCDEPMODE=$(CCDEPMODE)' \
-'CFLGS=$(DEBCFLAGS) $(CFLGS)' 'XREQS=$(XREQS)' 'XLIBS=$(XLIBS)' 'LD=$(LDDEBUG) -g'
+'CFLGS=$(DEBCFLAGS) $(CFLGS)' 'LIBS=$(LIBS)' 'LD=$(LDDEBUG) -g'
 
 MAKE_UTILS_NR = $(MAKE) 'CC=$(CC)' 'STRIP=touch' \
 'CCDEPMODE=$(CCDEPMODE)' \
-'CFLGS=$(DEBCFLAGS) $(CFLGS)' 'XREQS=$(XREQS)' 'XLIBS=$(XLIBS)' 'LD=$(LD) -g'
+'CFLGS=$(DEBCFLAGS) $(CFLGS)' 'LIBS=$(LIBS)' 'LD=$(LD) -g'
 
 MAKE_CONFIG = $(MAKE) 'MAKE=$(MAKE)'
 
@@ -94,7 +86,7 @@ clean:  cleanutils
 
 distclean: clean
 	@rm -f Makefile src/Makefile src/compat/Makefile src/mod/Makefile
-	@rm -f config.cache config.log config.status config.h lush.h stamp.*
+	@rm -f config.cache config.log config.status config.h stamp.*
 	@rm -rf *-$(VERSION)/ autom4te.cache/ autoscan.log configure.scan src/salt.h.tmp
 	@rm -rf src/.deps/ src/compat/.deps/ src/mod/*.mod/.deps/
 

+ 0 - 57
autotools/configure.ac

@@ -141,63 +141,6 @@ EGG_HEADER_STDC
 #checkpoint
 AC_CACHE_SAVE 
 
-# Where is Tcl?  Is it here?
-# ---------- begin robey's Tcl thingies
-# (well, what used to be robey's Tcl thingies...)
-
-# Latest tested Tcl version to recommend if Tcl isn't found
-tclrecommendver="8.4"
-
-# Site recommended to download Tcl from
-tclrecommendsite="http://www.tcl.tk/software/tcltk/download84.html"
-
-# Tcl library filename prefixes (also used for Tcl header dir on FreeBSD)
-tcllibnames="tcl tcl8.4 tcl84 tcl8.3 tcl83 tcl8.2 tcl82 tcl8.1 tcl81 \
-	tcl8.0 tcl80"
-
-# Tcl library filename suffixes
-tcllibextensions=".a .so .so.1 .so.1.0 .so.1.2 .sl .dll .dylib"
-
-# Tcl library search paths
-tcllibpaths="${HOME}/lib ${HOME}/tcl/lib ${HOME} \
-        /usr/local/lib /usr/local/pkgs/tcl/lib \
-	/usr/lib /lib /usr/i486-linuxaout/lib \
-	/beos/system/lib /sys/lib"
-
-# Tcl header filenames
-tclheadernames="tcl.h"
-
-# Tcl header search paths
-tclheaderpaths="${HOME}/include ${HOME}/tcl/include ${HOME} \
-        /usr/local/include /usr/local/pkgs/tcl/include \
-	/usr/include /beos/system/include /beos/devel/include \
-       /sys/include"
-
-EGG_TCL_ARG_WITH
-EGG_TCL_ENV
-EGG_TCL_WITH_TCLLIB
-EGG_TCL_WITH_TCLINC
-EGG_TCL_FIND_LIBRARY
-EGG_TCL_FIND_HEADER
-EGG_TCL_CHECK_LIBRARY
-EGG_TCL_CHECK_HEADER
-EGG_TCL_DETECT_CHANGE
-
-#checkpoint
-AC_CACHE_SAVE 
-
-EGG_TCL_CHECK_VERSION
-EGG_TCL_CHECK_PRE80
-EGG_TCL_TESTLIBS
-EGG_TCL_CHECK_FREE
-EGG_TCL_CHECK_THREADS
-EGG_TCL_LIB_REQS
-EGG_TCL_LUSH
-
-#checkpoint
-AC_CACHE_SAVE 
-# ---------- end of (what used to be) robey's Tcl thingies
-
 EGG_SUBST_VERSION
 DO_PACK_CFG
 EGG_SUBST_MOD_UPDIR

+ 14 - 587
autotools/includes/acinclude.m4

@@ -355,32 +355,21 @@ else
   AC_CHECK_LIB(dns, gethostbyname)
   AC_CHECK_LIB(z, gzopen, ZLIB="-lz")
   AC_CHECK_LIB(ssl, SSL_accept, SSL="-lssl -lcrypto", SSL="", -lcrypto) 
-  AC_CHECK_LIB(dl, dlopen)
-  AC_CHECK_LIB(m, tan, EGG_MATH_LIB="-lm")
+#  AC_CHECK_LIB(m, tan, EGG_MATH_LIB="-lm")
   # This is needed for Tcl libraries compiled with thread support
-  AC_CHECK_LIB(pthread, pthread_mutex_init, [dnl
-  ac_cv_lib_pthread_pthread_mutex_init=yes
-  ac_cv_lib_pthread="-lpthread"], [dnl
-    AC_CHECK_LIB(pthread, __pthread_mutex_init, [dnl
-    ac_cv_lib_pthread_pthread_mutex_init=yes
-    ac_cv_lib_pthread="-lpthread"], [dnl
-      AC_CHECK_LIB(pthreads, pthread_mutex_init, [dnl
-      ac_cv_lib_pthread_pthread_mutex_init=yes
-      ac_cv_lib_pthread="-lpthreads"], [dnl
-        AC_CHECK_FUNC(pthread_mutex_init, [dnl
-        ac_cv_lib_pthread_pthread_mutex_init=yes
-        ac_cv_lib_pthread=""],
-        ac_cv_lib_pthread_pthread_mutex_init=no)])])])
-  if test "$SUNOS" = "yes"
-  then
-    # For suns without yp or something like that
-    AC_CHECK_LIB(dl, main)
-  else
-    if test "$HPUX" = "yes"
-    then
-      AC_CHECK_LIB(dld, shl_load)
-    fi
-  fi
+#  AC_CHECK_LIB(pthread, pthread_mutex_init, [dnl
+#  ac_cv_lib_pthread_pthread_mutex_init=yes
+#  ac_cv_lib_pthread="-lpthread"], [dnl
+#    AC_CHECK_LIB(pthread, __pthread_mutex_init, [dnl
+#    ac_cv_lib_pthread_pthread_mutex_init=yes
+#    ac_cv_lib_pthread="-lpthread"], [dnl
+#      AC_CHECK_LIB(pthreads, pthread_mutex_init, [dnl
+#      ac_cv_lib_pthread_pthread_mutex_init=yes
+#      ac_cv_lib_pthread="-lpthreads"], [dnl
+#        AC_CHECK_FUNC(pthread_mutex_init, [dnl
+#        ac_cv_lib_pthread_pthread_mutex_init=yes
+#        ac_cv_lib_pthread=""],
+#        ac_cv_lib_pthread_pthread_mutex_init=no)])])])
 fi
 ])dnl
 
@@ -488,321 +477,6 @@ fi
 ])dnl
 
 
-dnl  EGG_TCL_ARG_WITH()
-dnl
-AC_DEFUN(EGG_TCL_ARG_WITH, [dnl
-# oohh new configure --variables for those with multiple Tcl libs
-AC_ARG_WITH(tcllib, [  --with-tcllib=PATH      full path to Tcl library], tcllibname="$withval")
-AC_ARG_WITH(tclinc, [  --with-tclinc=PATH      full path to Tcl header], tclincname="$withval")
-
-WARN=0
-# Make sure either both or neither $tcllibname and $tclincname are set
-if test ! "${tcllibname-x}" = "x"
-then
-  if test "${tclincname-x}" = "x"
-  then
-    WARN=1
-    tcllibname=""
-    TCLLIB=""
-    TCLINC=""
-  fi
-else
-  if test ! "${tclincname-x}" = "x"
-  then
-    WARN=1
-    tclincname=""
-    TCLLIB=""
-    TCLINC=""
-  fi
-fi
-if test "$WARN" = 1
-then
-  cat << 'EOF' >&2
-configure: warning:
-
-  You must specify both --with-tcllib and --with-tclinc for them to work.
-  configure will now attempt to autodetect both the Tcl library and header...
-
-EOF
-fi
-])dnl
-
-
-dnl  EGG_TCL_ENV()
-dnl
-AC_DEFUN(EGG_TCL_ENV, [dnl
-WARN=0
-# Make sure either both or neither $TCLLIB and $TCLINC are set
-if test ! "${TCLLIB-x}" = "x"
-then
-  if test "${TCLINC-x}" = "x"
-  then
-    WARN=1
-    WVAR1=TCLLIB
-    WVAR2=TCLINC
-    TCLLIB=""
-  fi
-else
-  if test ! "${TCLINC-x}" = "x"
-  then
-    WARN=1
-    WVAR1=TCLINC
-    WVAR2=TCLLIB
-    TCLINC=""
-  fi
-fi
-if test "$WARN" = 1
-then
-  cat << EOF >&2
-configure: warning:
-
-  Environment variable $WVAR1 was set, but I did not detect ${WVAR2}.
-  Please set both TCLLIB and TCLINC correctly if you wish to use them.
-  configure will now attempt to autodetect both the Tcl library and header...
-
-EOF
-fi
-])dnl
-
-
-dnl  EGG_TCL_WITH_TCLLIB()
-dnl
-AC_DEFUN(EGG_TCL_WITH_TCLLIB, [dnl
-# Look for Tcl library: if $tcllibname is set, check there first
-if test ! "${tcllibname-x}" = "x"
-then
-  if test -f "$tcllibname" && test -r "$tcllibname"
-  then
-    TCLLIB=`echo $tcllibname | sed 's%/[[^/]][[^/]]*$%%'`
-    TCLLIBFN=`$BASENAME $tcllibname | cut -c4-`
-    TCLLIBEXT=".`echo $TCLLIBFN | $AWK '{j=split([$]1, i, "."); print i[[j]]}'`"
-    TCLLIBFNS=`$BASENAME $tcllibname $TCLLIBEXT | cut -c4-`
-  else
-    cat << EOF >&2
-configure: warning:
-
-  The file '$tcllibname' given to option --with-tcllib is not valid.
-  configure will now attempt to autodetect both the Tcl library and header...
-
-EOF
-    tcllibname=""
-    tclincname=""
-    TCLLIB=""
-    TCLLIBFN=""
-    TCLINC=""
-    TCLINCFN=""
-  fi
-fi
-])dnl
-
-
-dnl  EGG_TCL_WITH_TCLINC()
-dnl
-AC_DEFUN(EGG_TCL_WITH_TCLINC, [dnl
-# Look for Tcl header: if $tclincname is set, check there first
-if test ! "${tclincname-x}" = "x"
-then
-  if test -f "$tclincname" && test -r "$tclincname"
-  then
-    TCLINC=`echo $tclincname | sed 's%/[[^/]][[^/]]*$%%'`
-    TCLINCFN=`$BASENAME $tclincname`
-  else
-    cat << EOF >&2
-configure: warning:
-
-  The file '$tclincname' given to option --with-tclinc is not valid.
-  configure will now attempt to autodetect both the Tcl library and header...
-
-EOF
-    tcllibname=""
-    tclincname=""
-    TCLLIB=""
-    TCLLIBFN=""
-    TCLINC=""
-    TCLINCFN=""
-  fi
-fi
-])dnl
-
-
-dnl  EGG_TCL_FIND_LIBRARY()
-dnl
-AC_DEFUN(EGG_TCL_FIND_LIBRARY, [dnl
-# Look for Tcl library: if $TCLLIB is set, check there first
-if test "${TCLLIBFN-x}" = "x"
-then
-  if test ! "${TCLLIB-x}" = "x"
-  then
-    if test -d "$TCLLIB"
-    then
-      for tcllibfns in $tcllibnames
-      do
-        for tcllibext in $tcllibextensions
-        do
-          if test -r "$TCLLIB/lib$tcllibfns$tcllibext"
-          then
-            TCLLIBFN="$tcllibfns$tcllibext"
-            TCLLIBEXT="$tcllibext"
-            TCLLIBFNS="$tcllibfns"
-            break 2
-          fi
-        done
-      done
-    fi
-    if test "${TCLLIBFN-x}" = "x"
-    then
-      cat << 'EOF' >&2
-configure: warning:
-
-  Environment variable TCLLIB was set, but incorrect.
-  Please set both TCLLIB and TCLINC correctly if you wish to use them.
-  configure will now attempt to autodetect both the Tcl library and header...
-
-EOF
-      TCLLIB=""
-      TCLLIBFN=""
-      TCLINC=""
-      TCLINCFN=""
-    fi
-  fi
-fi
-])dnl
-
-
-dnl  EGG_TCL_FIND_HEADER()
-dnl
-AC_DEFUN(EGG_TCL_FIND_HEADER, [dnl
-# Look for Tcl header: if $TCLINC is set, check there first
-if test "${TCLINCFN-x}" = "x"
-then
-  if test ! "${TCLINC-x}" = "x"
-  then
-    if test -d "$TCLINC"
-    then
-      for tclheaderfn in $tclheadernames
-      do
-        if test -r "$TCLINC/$tclheaderfn"
-        then
-          TCLINCFN="$tclheaderfn"
-          break
-        fi
-      done
-    fi
-    if test "${TCLINCFN-x}" = "x"
-    then
-      cat << 'EOF' >&2
-configure: warning:
-
-  Environment variable TCLINC was set, but incorrect.
-  Please set both TCLLIB and TCLINC correctly if you wish to use them.
-  configure will now attempt to autodetect both the Tcl library and header...
-
-EOF
-      TCLLIB=""
-      TCLLIBFN=""
-      TCLINC=""
-      TCLINCFN=""
-    fi
-  fi
-fi
-])dnl
-
-
-dnl  EGG_TCL_CHECK_LIBRARY()
-dnl
-AC_DEFUN(EGG_TCL_CHECK_LIBRARY, [dnl
-AC_MSG_CHECKING(for Tcl library)
-
-# Attempt autodetect for $TCLLIBFN if it's not set
-if test ! "${TCLLIBFN-x}" = "x"
-then
-  AC_MSG_RESULT(using $TCLLIB/lib$TCLLIBFN)
-else
-  for tcllibfns in $tcllibnames
-  do
-    for tcllibext in $tcllibextensions
-    do
-      for tcllibpath in $tcllibpaths
-      do
-        if test -r "$tcllibpath/lib$tcllibfns$tcllibext"
-        then
-          AC_MSG_RESULT(found $tcllibpath/lib$tcllibfns$tcllibext)
-          TCLLIB="$tcllibpath"
-          TCLLIBFN="$tcllibfns$tcllibext"
-          TCLLIBEXT="$tcllibext"
-          TCLLIBFNS="$tcllibfns"
-          break 3
-        fi
-      done
-    done
-  done
-fi
-
-# Show if $TCLLIBFN wasn't found
-if test "${TCLLIBFN-x}" = "x"
-then
-  AC_MSG_RESULT(not found)
-fi
-AC_SUBST(TCLLIB)dnl
-AC_SUBST(TCLLIBFN)dnl
-])dnl
-
-
-dnl  EGG_TCL_CHECK_HEADER()
-dnl
-AC_DEFUN(EGG_TCL_CHECK_HEADER, [dnl
-AC_MSG_CHECKING(for Tcl header)
-
-# Attempt autodetect for $TCLINCFN if it's not set
-if test ! "${TCLINCFN-x}" = "x"
-then
-  AC_MSG_RESULT(using $TCLINC/$TCLINCFN)
-else
-  for tclheaderpath in $tclheaderpaths
-  do
-    for tclheaderfn in $tclheadernames
-    do
-      if test -r "$tclheaderpath/$tclheaderfn"
-      then
-        AC_MSG_RESULT(found $tclheaderpath/$tclheaderfn)
-        TCLINC="$tclheaderpath"
-        TCLINCFN="$tclheaderfn"
-        break 2
-      fi
-    done
-  done
-  # FreeBSD hack ...
-  if test "${TCLINCFN-x}" = "x"
-  then
-    for tcllibfns in $tcllibnames
-    do
-      for tclheaderpath in $tclheaderpaths
-      do
-        for tclheaderfn in $tclheadernames
-        do
-          if test -r "$tclheaderpath/$tcllibfns/$tclheaderfn"
-          then
-            AC_MSG_RESULT(found $tclheaderpath/$tcllibfns/$tclheaderfn)
-            TCLINC="$tclheaderpath/$tcllibfns"
-            TCLINCFN="$tclheaderfn"
-            break 3
-          fi
-        done
-      done
-    done
-  fi
-fi
-
-# Show if $TCLINCFN wasn't found
-if test "${TCLINCFN-x}" = "x"
-then
-  AC_MSG_RESULT(not found)
-fi
-AC_SUBST(TCLINC)dnl
-AC_SUBST(TCLINCFN)dnl
-])dnl
-
-
 dnl  EGG_CACHE_UNSET(CACHE-ID)
 dnl
 dnl  Unsets a certain cache item. Typically called before using
@@ -812,234 +486,6 @@ AC_DEFUN(EGG_CACHE_UNSET, [dnl
 ])
 
 
-dnl  EGG_TCL_DETECT_CHANGE()
-dnl
-dnl  Detect whether the Tcl system has changed since our last
-dnl  configure run. Set egg_tcl_changed accordingly.
-dnl
-dnl  Tcl related feature and version checks should re-run their
-dnl  checks as soon as egg_tcl_changed is set to "yes".
-AC_DEFUN(EGG_TCL_DETECT_CHANGE, [dnl
-  AC_MSG_CHECKING(whether the Tcl system has changed)
-  egg_tcl_changed=yes
-  egg_tcl_id="$TCLLIB:$TCLLIBFN:$TCLINC:$TCLINCFN"
-  if test ! "$egg_tcl_id" = ":::"
-  then
-    egg_tcl_cached=yes
-    AC_CACHE_VAL(egg_cv_var_tcl_id, [dnl
-      egg_cv_var_tcl_id="$egg_tcl_id"
-      egg_tcl_cached=no
-    ])
-    if test "$egg_tcl_cached" = "yes"
-    then
-      if test "${egg_cv_var_tcl_id-x}" = "${egg_tcl_id-x}"
-      then
-        egg_tcl_changed=no
-      else
-        egg_cv_var_tcl_id="$egg_tcl_id"
-      fi
-    fi
-  fi
-  if test "$egg_tcl_changed" = "yes"
-  then
-    AC_MSG_RESULT(yes)
-  else
-    AC_MSG_RESULT(no)
-  fi
-])
-
-
-dnl  EGG_TCL_CHECK_VERSION()
-dnl
-AC_DEFUN(EGG_TCL_CHECK_VERSION, [dnl
-# Both TCLLIBFN & TCLINCFN must be set, or we bail
-TCL_FOUND=0
-if test ! "${TCLLIBFN-x}" = "x" && test ! "${TCLINCFN-x}" = "x"
-then
-  TCL_FOUND=1
-
-  # Check Tcl's version
-  if test "$egg_tcl_changed" = "yes"
-  then
-    EGG_CACHE_UNSET(egg_cv_var_tcl_version)
-  fi
-  AC_MSG_CHECKING(for Tcl version)
-  AC_CACHE_VAL(egg_cv_var_tcl_version, [dnl
-    egg_cv_var_tcl_version=`grep TCL_VERSION $TCLINC/$TCLINCFN | $HEAD_1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`
-  ])
-
-  if test ! "${egg_cv_var_tcl_version-x}" = "x"
-  then
-    AC_MSG_RESULT($egg_cv_var_tcl_version)
-  else
-    AC_MSG_RESULT(not found)
-    TCL_FOUND=0
-  fi
-
-  # Check Tcl's patch level (if available)
-  if test "$egg_tcl_changed" = "yes"
-  then
-    EGG_CACHE_UNSET(egg_cv_var_tcl_patch_level)
-  fi
-  AC_MSG_CHECKING(for Tcl patch level)
-  AC_CACHE_VAL(egg_cv_var_tcl_patch_level, [dnl
-    eval "egg_cv_var_tcl_patch_level=`grep TCL_PATCH_LEVEL $TCLINC/$TCLINCFN | $HEAD_1 | $AWK '{gsub(/\"/, "", [$]3); print [$]3}'`"
-  ])
-
-  if test ! "${egg_cv_var_tcl_patch_level-x}" = "x"
-  then
-    AC_MSG_RESULT($egg_cv_var_tcl_patch_level)
-  else
-    egg_cv_var_tcl_patch_level="unknown"
-    AC_MSG_RESULT(unknown)
-  fi
-fi
-
-# Check if we found Tcl's version
-if test "$TCL_FOUND" = 0
-then
-  cat << 'EOF' >&2
-configure: error:
-
-  I can't find Tcl on this system.
-
-  The download website is at:
-        http://www.tcl.tk/software/tcltk/download84.html
-  A nice direct link for the tarball is:
-        http://aleron.dl.sourceforge.net/sourceforge/tcl/tcl8.4.4-src.tar.gz
-
-  OR
-
-  Just type: ./build -T
-
-EOF
-  exit 1
-fi
-])dnl
-
-
-dnl  EGG_TCL_CHECK_PRE80()
-dnl
-AC_DEFUN(EGG_TCL_CHECK_PRE80, [dnl
-# Is this version of Tcl too old for us to use ?
-TCL_VER_PRE80=`echo $egg_cv_var_tcl_version | $AWK '{split([$]1, i, "."); if (i[[1]] < 8) print "yes"; else print "no"}'`
-if test "$TCL_VER_PRE80" = "yes"
-then
-  cat << EOF >&2
-configure: error:
-
-  Your Tcl version is much too old for Eggdrop to use.
-  I suggest you download and compile a more recent version.
-  The most reliable current version is $tclrecommendver and
-  can be downloaded from $tclrecommendsite
-
-EOF
-  exit 1
-fi
-])dnl
-
-
-dnl  EGG_TCL_TESTLIBS()
-dnl
-AC_DEFUN(EGG_TCL_TESTLIBS, [dnl
-# Set variables for Tcl library tests
-TCL_TEST_LIB="$TCLLIBFNS"
-TCL_TEST_OTHERLIBS="-L$TCLLIB $EGG_MATH_LIB"
-
-if test ! "${ac_cv_lib_pthread-x}" = "x"
-then
-  TCL_TEST_OTHERLIBS="$TCL_TEST_OTHERLIBS $ac_cv_lib_pthread"
-fi
-])dnl
-
-
-dnl  EGG_TCL_CHECK_FREE()
-dnl
-AC_DEFUN(EGG_TCL_CHECK_FREE, [dnl
-if test "$egg_tcl_changed" = "yes"
-then
-  EGG_CACHE_UNSET(egg_cv_var_tcl_free)
-fi
-
-# Check for Tcl_Free()
-AC_CHECK_LIB($TCL_TEST_LIB, Tcl_Free, egg_cv_var_tcl_free="yes", egg_cv_var_tcl_free="no", $TCL_TEST_OTHERLIBS)
-
-if test "$egg_cv_var_tcl_free" = "yes"
-then
-  AC_DEFINE(HAVE_TCL_FREE, 1, [Define for Tcl that has Tcl_Free() (7.5p1 and later)])dnl
-fi
-])dnl
-
-
-dnl  EGG_TCL_CHECK_THREADS()
-dnl
-AC_DEFUN(EGG_TCL_CHECK_THREADS, [dnl
-if test "$egg_tcl_changed" = "yes"
-then
-  EGG_CACHE_UNSET(egg_cv_var_tcl_threaded)
-fi
-
-# Check for TclpFinalizeThreadData()
-AC_CHECK_LIB($TCL_TEST_LIB, TclpFinalizeThreadData, egg_cv_var_tcl_threaded="yes", egg_cv_var_tcl_threaded="no", $TCL_TEST_OTHERLIBS)
-enable_tcl_threads=no
-if test "$egg_cv_var_tcl_threaded" = "yes"
-then
-  if test "$enable_tcl_threads" = "no"
-  then
-
-    cat << 'EOF' >&2
-configure: warning:
-
-  You have disabled threads support on a system with a threaded Tcl library.
-  Tcl features that rely on scheduled events may not function properly.
-
-EOF
-  fi
-
-  # Add pthread library to $LIBS if we need it
-  if test ! "${ac_cv_lib_pthread-x}" = "x"
-  then
-    LIBS="$ac_cv_lib_pthread $LIBS"
-  fi
-fi
-])dnl
-
-
-dnl  EGG_TCL_LIB_REQS()
-dnl
-AC_DEFUN(EGG_TCL_LIB_REQS, [dnl
-if test "$EGG_CYGWIN" = "yes"
-then
-  TCL_REQS="$TCLLIB/lib$TCLLIBFN"
-  TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
-else
- if test ! "$TCLLIBEXT" = ".a"
- then
-    cat << 'EOF' >&2
-configure: warning:
-
-  Your Tcl library is not compiled statically.
-  You will need to compile Tcl statically to successfully compile wraith.
-
-EOF
-  exit 1
- else
-  # Was the --with-tcllib option given ?
-  if test ! "${tcllibname-x}" = "x"
-  then
-    TCL_REQS="$TCLLIB/lib$TCLLIBFN"
-    TCL_LIBS="$TCLLIB/lib$TCLLIBFN $EGG_MATH_LIB"
-  else
-    TCL_REQS="$TCLLIB/lib$TCLLIBFN"
-    TCL_LIBS="-L$TCLLIB -l$TCLLIBFNS $EGG_MATH_LIB"
-  fi
- fi
-fi
-AC_SUBST(TCL_REQS)dnl
-AC_SUBST(TCL_LIBS)dnl
-])dnl
-
-
 dnl  EGG_SUBST_VERSION()
 dnl
 AC_DEFUN(EGG_SUBST_VERSION, [dnl
@@ -1103,25 +549,6 @@ m4_define(EGG_REPLACE_IF_CHANGED,
   [[$3]])
 ])
 
-dnl EGG_TCL_LUSH()
-AC_DEFUN([EGG_TCL_LUSH],
-[
-  EGG_REPLACE_IF_CHANGED(lush.h,
-  [
-    cat > conftest.out << EOF
-
-/* Ignore me but do not erase me. I am a kludge. */
-
-#include "${egg_tclinc}/${egg_tclincfn}"
-
-EOF
-  ], [
-    egg_tclinc="$TCLINC"
-    egg_tclincfn="$TCLINCFN"
-  ])
-])
-
-
 dnl  EGG_SAVE_PARAMETERS()
 dnl
 AC_DEFUN(EGG_SAVE_PARAMETERS, [dnl

+ 0 - 9
config.h.in

@@ -62,12 +62,6 @@
 /* Define to 1 if you have the `isascii' function. */
 #undef HAVE_ISASCII
 
-/* Define to 1 if you have the `dl' library (-ldl). */
-#undef HAVE_LIBDL
-
-/* Define to 1 if you have the `dld' library (-ldld). */
-#undef HAVE_LIBDLD
-
 /* Define to 1 if you have the `dns' library (-ldns). */
 #undef HAVE_LIBDNS
 
@@ -209,9 +203,6 @@
 /* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
 #undef HAVE_SYS_WAIT_H
 
-/* Define for Tcl that has Tcl_Free() (7.5p1 and later) */
-#undef HAVE_TCL_FREE
-
 /* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
    `HAVE_STRUCT_TM_TM_ZONE' instead. */
 #undef HAVE_TM_ZONE

Fichier diff supprimé car celui-ci est trop grand
+ 356 - 412
configure


+ 0 - 17
misc/fstrings

@@ -1,17 +0,0 @@
-#!/bin/sh
-if test -z $1
-then
-  grep -n -R "\"" src/*.c | grep -v "STR(" | grep -v "^src/x" | grep -v "\#include" | grep -v "[\"][^X][\"]" | grep -v "[\"][^X][^X][\"]" | grep -v "\"\"" | grep -v "Context" | grep -v "\#define" | grep -v "stringfix\.c" | grep -v "{\"" | grep -v "BADARGS(" | grep -v "Tcl_" | grep -v "check_tcl_bind(" | grep -v "add_bind_table("
-else
-  grep -n -R "\"" $1 | grep -v "STR(" | grep -v "^src/x" | grep -v "\#include" | grep -v "[\"][^X][\"]" | grep -v "[\"][^X][^X][\"]" | grep -v "\"\"" | grep -v "Context" | grep -v "\#define" | grep -v "stringfix\.c" | grep -v "^{\"" | grep -v "BADARGS(" | grep -v "Tcl_" | grep -v "check_tcl_bind(" | grep -v "add_bind_table("
-fi
-
-
-
-
-
-
-
-
-
-

+ 2 - 3
src/Makefile.in

@@ -41,7 +41,6 @@ OBJS = auth.o \
 	rfc1459.o \
 	settings.o \
 	shell.o \
-	tcl.o \
 	tclhash.o \
 	userent.o \
 	userrec.o \
@@ -87,11 +86,11 @@ stringfix: stringfix.c common.h ../config.h ../pack/pack.cfg eggdrop.h
 	@$(CC) $(CFLAGS) -I$(top_srcdir) -I$(top_srcdir)/pack $(CPPFLAGS) stringfix.c -o stringfix
 	@$(STRIP) stringfix
 
-../$(EGGEXEC): build_msg $(OBJS) $(XREQS) compatability
+../$(EGGEXEC): build_msg $(OBJS) compatability
 	@echo ""
 	@echo "Linking wraith... $(EGGBUILD)"
 	@echo ""
-	@$(LD) -o ../$(EGGEXEC) $(OBJS) $(MODOBJS) $(XLIBS) compat/*.o
+	@$(LD) -o ../$(EGGEXEC) $(OBJS) $(MODOBJS) $(LIBS) compat/*.o
 	@$(STRIP) ../$(EGGEXEC)
 	@$(OBJCOPY) ../$(EGGEXEC)
 	@echo "Successful compile: $(EGGEXEC)"

+ 2 - 2
src/auth.c

@@ -80,7 +80,7 @@ void init_auth()
 }
 
 #if defined(S_AUTHHASH) || defined(S_DCCAUTH)
-char *makehash(struct userrec *u, char *rand)
+char *makehash(struct userrec *u, char *randstring)
 {
   char hash[256] = "", *secpass = NULL;
 
@@ -88,7 +88,7 @@ char *makehash(struct userrec *u, char *rand)
     secpass = strdup(get_user(&USERENTRY_SECPASS, u));
     secpass[strlen(secpass)] = 0;
   }
-  egg_snprintf(hash, sizeof hash, "%s%s%s", rand, (secpass && secpass[0]) ? secpass : "" , (authkey && authkey[0]) ? authkey : "");
+  egg_snprintf(hash, sizeof hash, "%s%s%s", randstring, (secpass && secpass[0]) ? secpass : "" , (authkey && authkey[0]) ? authkey : "");
   if (secpass)
     free(secpass);
 

+ 1 - 4
src/chanprog.c

@@ -38,7 +38,7 @@ extern char		 ver[], firewall[],
 extern time_t		 now, online_since;
 extern int		 backgrd, term_z, cache_hit, cache_miss,
 			 firewallport, default_flags, conmask,
-			 protect_readonly, noshare, localhub,
+			 noshare, localhub,
 			 ignore_time, loading;
 
 struct chanset_t 	*chanset = NULL;	/* Channel list			*/
@@ -541,12 +541,9 @@ void chanprog()
   sdprintf("ip4: %s", myipstr(4));
   sdprintf("ip6: %s", myipstr(6));
   conmask = 0;
-  /* Turn off read-only variables (make them write-able) for rehash */
-  protect_readonly = 0;
 
  /* now this only checks server shit. (no channels) */
   call_hook(HOOK_REHASH);
-  protect_readonly = 1;
 
   strcpy(botuser, origbotname);
 

+ 0 - 1
src/common.h

@@ -41,7 +41,6 @@
 #  include <strings.h>
 #endif
 #include "lang.h"
-#include "lush.h"
 
 
 /* This macro copies (_len - 1) bytes from _source to _target. The

+ 3 - 1
src/conf.c

@@ -9,6 +9,7 @@
 #include "shell.h"
 #include "debug.h"
 #include "crypt.h"
+#include "main.h"
 #include "salt.h"
 #include "misc.h"
 
@@ -212,7 +213,8 @@ int readconf(char *cfile)
   char inbuf[8192] = "";
 
   Context;
-  f = fopen(cfile, "r");
+  if (!(f = fopen(cfile, "r")))
+    fatal("Cannot read config", 0);
   while (fgets(inbuf, sizeof inbuf, f) != NULL) {
     char *line = NULL, *temp_ptr = NULL;
 

+ 4 - 0
src/eggdrop.h

@@ -95,6 +95,10 @@
 
 /***********************************************************************/
 
+enum {		/* TAKE A GUESS */
+  OK,
+  ERROR
+};
 
 
 /* chan & global */

+ 2 - 0
src/log.c

@@ -16,6 +16,8 @@
 #include "misc.h"
 #include "main.h"
 
+#include <stdarg.h>
+
 extern struct userrec   *userlist;
 extern tand_t           *tandbot;
 extern struct dcc_t     *dcc;

+ 3 - 6
src/main.c

@@ -489,7 +489,7 @@ void check_static(char *, char *(*)());
 #include "mod/static.h"
 
 int init_dcc_max(), init_userent(), init_auth(), init_config(), init_bots(),
- init_net(), init_modules(), init_tcl(int, char **), init_botcmd(), init_settings();
+ init_net(), init_modules(), init_botcmd(), init_settings();
 
 int main(int argc, char **argv)
 {
@@ -545,7 +545,6 @@ int main(int argc, char **argv)
   init_bots();
   init_net();
   init_modules();
-  init_tcl(argc, argv);
   init_auth();
   init_config();
   init_botcmd();
@@ -744,10 +743,11 @@ printf("bleh..ip: %s host: %s ip6: %s host6: %s\n", conf.bot->ip, conf.bot->host
 #if HAVE_SETPGID && !defined(CYGWIN_HACKS)
     setpgid(0, 0);
 #endif
-    /* Tcl wants the stdin, stdout and stderr file handles kept open. */
+    /* fuck tcl.
     freopen("/dev/null", "r", stdin);
     freopen("/dev/null", "w", stdout);
     freopen("/dev/null", "w", stderr);
+    */
 #ifdef CYGWIN_HACKS
     FreeConsole();
 #endif /* CYGWIN_HACKS */
@@ -797,9 +797,6 @@ printf("bleh..ip: %s host: %s ip6: %s host6: %s\n", conf.bot->ip, conf.bot->host
     int socket_cleanup = 0, i, xx;
     char buf[SGRAB + 9] = "";
 
-    /* Process a single tcl event */
-    Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT);
-
     /* Lets move some of this here, reducing the numer of actual
      * calls to periodic_timers
      */

+ 2 - 2
src/mod/Makefile.in

@@ -16,7 +16,7 @@ CPPFLAGS = @CPPFLAGS@
 MOD_CFLAGS = @CFLAGS@ -I. -I../../.. -I$(MOD_UPDIR)$(top_srcdir) \
   -I$(MOD_UPDIR)$(top_srcdir)/src/mod -I$(top_srcdir)/pack @DEFS@ $(CFLGS)
 MOD_CPPFLAGS = @CPPFLAGS@
-XLIBS = @XLIBS@
+LIBS = @LIBS@
 
 mods = channels.mod \
 	compress.mod \
@@ -48,7 +48,7 @@ egg_ac_parameters = @egg_ac_parameters@
 MAKE_MOD = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CC)' 'LD=$(LD)' \
 'CCDEPMODE=$(CCDEPMODE)' \
 'STRIP=$(STRIP)' 'CFLAGS=$(MOD_CFLAGS)' 'CPPFLAGS=$(MOD_CPPFLAGS)' \
-'XLIBS=$(XLIBS)' 'SHELL=$(SHELL)'
+'LIBS=$(LIBS)' 'SHELL=$(SHELL)'
 
 
 doofus:

+ 5 - 5
src/mod/channels.mod/channels.c

@@ -174,7 +174,7 @@ static void got_cjoin(char *botnick, char *code, char *par)
    return;
   }
 
-  if (tcl_channel_add(NULL, chname, par) == TCL_ERROR) /* drummer */
+  if (tcl_channel_add(NULL, chname, par) == ERROR) /* drummer */
     putlog(LOG_BOTS, "@", "Invalid channel or channel options from %s for %s", botnick, chname);
   else {
 #ifdef HUB
@@ -533,20 +533,20 @@ static void get_mode_protect(struct chanset_t *chan, char *s)
 
 /* Returns true if this is one of the channel masks
  */
-static int ismodeline(masklist *m, char *user)
+static int ismodeline(masklist *m, char *username)
 {
   for (; m && m->mask[0]; m = m->next)  
-    if (!rfc_casecmp(m->mask, user))
+    if (!rfc_casecmp(m->mask, username))
       return 1;
   return 0;
 }
 
 /* Returns true if user matches one of the masklist -- drummer
  */
-static int ismasked(masklist *m, char *user)
+static int ismasked(masklist *m, char *username)
 {
   for (; m && m->mask[0]; m = m->next)
-    if (wild_match(m->mask, user))
+    if (wild_match(m->mask, username))
       return 1;
   return 0;
 }

+ 12 - 7
src/mod/channels.mod/cmdschan.c

@@ -961,7 +961,7 @@ static void cmd_slowjoin(struct userrec *u, int idx, char *par)
   strcpy(buf, "+inactive ");
   if (par[0])
     strncat(buf, par, sizeof(buf));
-  if (tcl_channel_add(NULL, chname, buf) == TCL_ERROR) {
+  if (tcl_channel_add(NULL, chname, buf) == ERROR) {
     dprintf(idx, "Invalid channel.\n");
     return;
   }
@@ -1389,7 +1389,7 @@ static void cmd_down(struct userrec *u, int idx, char *par)
 
 static void cmd_pls_chan(struct userrec *u, int idx, char *par)
 {
-  char *chname = NULL, buf2[1024] = "";
+  char *chname = NULL, buf2[1024] = "", buf[2048] = "";
   struct chanset_t *chan = NULL;
 
   putlog(LOG_CMDS, "*", "#%s# +chan %s", dcc[idx].nick, par);
@@ -1401,11 +1401,13 @@ static void cmd_pls_chan(struct userrec *u, int idx, char *par)
 
   chname = newsplit(&par);
   sprintf(buf2, "cjoin %s %s", chname, par);
-  putallbots(buf2);
+
   if (findchan_by_dname(chname)) {
+    putallbots(buf2);
     dprintf(idx, "That channel already exists!\n");
     return;
   } else if ((chan = findchan(chname))) {
+    putallbots(buf2);
     /* This prevents someone adding a channel by it's unique server
      * name <cybah>
      */
@@ -1413,12 +1415,15 @@ static void cmd_pls_chan(struct userrec *u, int idx, char *par)
     return;
   }
 
-  if (tcl_channel_add(NULL, chname, par) == TCL_ERROR) /* drummer */
+  if (tcl_channel_add(buf, chname, par) == ERROR) {/* drummer */
     dprintf(idx, "Invalid channel or channel options.\n");
-  else {
+    if (buf && buf[0])
+      dprintf(idx, "%s\n", buf);
+  } else {
     if ((chan = findchan_by_dname(chname))) {
       char *tmp = NULL;
 
+      putallbots(buf2);
       tmp = malloc(7 + 1 + strlen(dcc[idx].nick) + 1);
       sprintf(tmp, "addedby %s", dcc[idx].nick);
       do_chanset(chan, tmp, 1);
@@ -1767,7 +1772,7 @@ static void cmd_chanset(struct userrec *u, int idx, char *par)
       while (list[0][0]) {
 	if (list[0][0] == '+' || list[0][0] == '-' ||
 	    (!strcmp(list[0], "dont-idle-kick"))) {
-	  if (tcl_channel_modify(0, chan, 1, list) == TCL_OK) {
+	  if (tcl_channel_modify(0, chan, 1, list) == OK) {
 	    strcat(answers, list[0]);
 	    strcat(answers, " ");
 	  } else if (!all || !chan->next)
@@ -1786,7 +1791,7 @@ static void cmd_chanset(struct userrec *u, int idx, char *par)
   	 * circumstances, so save it now.
 	 */
         parcpy = strdup(par);
-        if (tcl_channel_modify(0, chan, 2, list) == TCL_OK) {
+        if (tcl_channel_modify(0, chan, 2, list) == OK) {
 	  strcat(answers, list[0]);
 	  strcat(answers, " { ");
 	  strcat(answers, parcpy);

+ 310 - 34
src/mod/channels.mod/tclchan.c

@@ -3,6 +3,281 @@
  *
  */
 
+int FindElement(char *resultBuf, const char *list, int listLength, const char **elementPtr, const char **nextPtr, int *sizePtr, int *bracePtr)
+{
+    const char *p = list;
+    const char *elemStart = NULL;	/* Points to first byte of first element. */
+    const char *limit = NULL;		/* Points just after list's last byte. */
+    int openBraces = 0;   	/* Brace nesting level during parse. */
+    int inQuotes = 0;
+    int size = 0;               /* lint. */
+    const char *p2 = NULL;
+
+    /*
+     * Skim off leading white space and check for an opening brace or
+     * quote. We treat embedded NULLs in the list as bytes belonging to
+     * a list element.
+     */
+
+    limit = (list + listLength);
+    while ((p < limit) && egg_isspace(*p)) { /* INTL: ISO space. */
+        p++;
+    }
+
+    if (p == limit) {           /* no element found */
+        elemStart = limit;
+        goto done;
+    }
+
+    if (*p == '{') {
+        openBraces = 1;
+        p++;
+    } else if (*p == '"') {
+        inQuotes = 1;
+        p++;
+    }
+    elemStart = p;
+    if (bracePtr != 0) {
+        *bracePtr = openBraces;
+    }
+
+    /*
+     * Find element's end (a space, close brace, or the end of the string).
+     */
+
+    while (p < limit) {
+        switch (*p) {
+            /*
+             * Open brace: don't treat specially unless the element is in
+             * braces. In this case, keep a nesting count.
+             */
+
+            case '{':
+                if (openBraces != 0) {
+                    openBraces++;
+                }
+                break;
+
+            /*
+             * Close brace: if element is in braces, keep nesting count and
+             * quit when the last close brace is seen.
+             */
+
+            case '}':
+                if (openBraces > 1) {
+                    openBraces--;
+                } else if (openBraces == 1) {
+                    size = (p - elemStart);
+                    p++;
+                    if ((p >= limit) || egg_isspace(*p)) { /* INTL: ISO space. */
+                        goto done;
+                    }
+
+                    /*
+                     * Garbage after the closing brace; return an error.
+                     */
+
+                    if (resultBuf) {
+                        p2 = p;
+                        while ((p2 < limit)
+                                && (!egg_isspace(*p2)) /* INTL: ISO space. */
+                                && (p2 < p+20)) {
+                            p2++;
+                        }
+                        sprintf(resultBuf, "list element in braces followed by \"%.*s\" instead of space", (int) (p2-p), p);
+                    }
+                    return ERROR;
+                }
+                break;
+
+            /*
+             * Backslash:  skip over everything up to the end of the
+             * backslash sequence.
+             */
+
+/*            case '\\': {
+                Tcl_UtfBackslash(p, &numChars, NULL);
+                p += (numChars - 1);
+                break;
+            }
+*/
+            /*
+             * Space: ignore if element is in braces or quotes; otherwise
+             * terminate element.
+             */
+
+            case ' ':
+            case '\f':
+            case '\n':
+            case '\r':
+            case '\t':
+            case '\v':
+                if ((openBraces == 0) && !inQuotes) {
+                    size = (p - elemStart);
+                    goto done;
+                }
+                break;
+
+            /*
+             * Double-quote: if element is in quotes then terminate it.
+             */
+
+            case '"':
+                if (inQuotes) {
+                    size = (p - elemStart);
+                    p++;
+                    if ((p >= limit) || egg_isspace(*p)) { /* INTL: ISO space */
+                        goto done;
+                    }
+
+                    /*
+                     * Garbage after the closing quote; return an error.
+                     */
+
+                    if (resultBuf) {
+                        p2 = p;
+                        while ((p2 < limit)
+                                && (!egg_isspace(*p2)) /* INTL: ISO space */
+                                 && (p2 < p+20)) {
+                            p2++;
+                        }
+                        sprintf(resultBuf, "list element in quotes followed by \"%.*s\" %s", (int) (p2-p), p, "instead of space");
+                    }
+                    return ERROR;
+                }
+                break;
+        }
+        p++;
+    }
+
+
+    /*
+     * End of list: terminate element.
+     */
+
+    if (p == limit) {
+        if (openBraces != 0) {
+            if (resultBuf) {
+                sprintf(resultBuf, "unmatched open brace in list");
+            }
+            return ERROR;
+        } else if (inQuotes) {
+            if (resultBuf) {
+                sprintf(resultBuf, "unmatched open quote in list");
+            }
+            return ERROR;
+        }
+        size = (p - elemStart);
+    }
+
+done:
+    while ((p < limit) && (egg_isspace(*p))) { /* INTL: ISO space. */
+        p++;
+    }
+    *elementPtr = elemStart;
+    *nextPtr = p;
+    if (sizePtr != 0) {
+        *sizePtr = size;
+    }
+    return OK;
+}
+
+/* unneeded?
+int CopyAndCollapse(int count, const char *src, char *dst)
+{
+    register char c;
+    int numRead; 
+    int newCount = 0;
+    int backslashCount; 
+
+    for (c = *src;  count > 0;  src++, c = *src, count--) {
+        if (c == '\\') {
+           backslashCount = Tcl_UtfBackslash(src, &numRead, dst);
+            dst += backslashCount;
+            newCount += backslashCount;
+            src += numRead-1;
+            count -= numRead-1;
+        } else { 
+            *dst = c;
+            dst++;
+            newCount++;
+        } 
+    }
+    *dst = 0;
+    return newCount;
+}
+*/
+
+
+int SplitList(char *resultBuf, const char *list, int *argcPtr, const char ***argvPtr)
+{
+    const char **argv = NULL;
+    const char *l = NULL;
+    const char *element = NULL;
+    char *p = NULL;
+    int length, size, i = 0, result, elSize, brace;
+
+    /*
+     * Figure out how much space to allocate.  There must be enough
+     * space for both the array of pointers and also for a copy of
+     * the list.  To estimate the number of pointers needed, count
+     * the number of space characters in the list.
+     */
+
+    for (size = 1, l = list; *l != 0; l++) {
+        if (egg_isspace(*l)) { /* INTL: ISO space. */
+            size++;
+        }
+    }
+    size++;                     /* Leave space for final NULL pointer. */
+
+    argv = (const char **) calloc(1, (unsigned) ((size * sizeof(char *)) + (l - list) + 1 + 15));	/* 15 cuz the tcl src is hard to follow */
+
+    length = strlen(list);
+
+    for (p = ((char *) argv) + size*sizeof(char *); *list != 0; i++) {
+        const char *prevList = list;
+
+        result = FindElement(resultBuf, list, length, &element, &list, &elSize, &brace);
+
+        length -= (list - prevList);
+
+        if (result != OK) {
+            free((char *) argv);
+            return result;
+        }
+
+        if (*element == 0) {
+            break;
+        }
+
+        if (i >= size) {
+            free((char *) argv);
+            if (resultBuf)
+                sprintf(resultBuf, "internal error in SplitList");
+            return ERROR;
+        }
+
+        argv[i] = p;
+
+        if (brace) {
+            egg_memcpy(p, element, elSize);
+            p += elSize;
+            *p = 0;
+            p++;
+        } else {
+/*            CopyAndCollapse(elSize, element, p); */
+            egg_memcpy(p, element, elSize);
+            p += elSize + 1;
+        }
+    }
+
+    argv[i] = NULL;
+    *argvPtr = argv;
+    *argcPtr = i;
+    return OK;
+}
+
 
 /* Parse options for a channel.
  */
@@ -24,7 +299,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       if (i >= items) {
 	if (result)
 	  sprintf(result, "channel chanmode needs argument");
-	return TCL_ERROR;
+	return ERROR;
       }
       strncpy(s, item[i], 120);
       s[120] = 0;
@@ -34,7 +309,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       if (i >= items) {
 	if (result)
 	  sprintf(result, "addedby chanmode needs argument");
-	return TCL_ERROR;
+	return ERROR;
       }
       strncpyz(chan->added_by, item[i], NICKLEN);
     } else if (!strcmp(item[i], "addedts")) {
@@ -42,7 +317,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       if (i >= items) {
 	if (result)
 	  sprintf(result, "addedts chanmode needs argument");
-	return TCL_ERROR;
+	return ERROR;
       }
       chan->added_ts = atoi(item[i]);
     } else if (!strcmp(item[i], "idle-kick")) {
@@ -50,7 +325,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       if (i >= items) {
 	if (result)
 	  sprintf(result, "channel idle-kick needs argument");
-	return TCL_ERROR;
+	return ERROR;
       }
       chan->idle_kick = atoi(item[i]);
     } else if (!strcmp(item[i], "limit")) {
@@ -58,7 +333,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       if (i >= items) {
         if (result)
           sprintf(result, "channel limit needs argument");
-        return TCL_ERROR;
+        return ERROR;
       }
       chan->limitraise = atoi(item[i]);
       chan->limit_prot = 0;
@@ -69,7 +344,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       if (i >= items) {
 	if (result)
 	  sprintf(result, "channel stopnethack-mode needs argument");
-	return TCL_ERROR;
+	return ERROR;
       }
       chan->stopnethack_mode = atoi(item[i]);
     } else if (!strcmp(item[i], "revenge-mode")) {
@@ -77,7 +352,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       if (i >= items) {
         if (result)
           sprintf(result, "channel revenge-mode needs argument");
-        return TCL_ERROR;
+        return ERROR;
       }
       chan->revenge_mode = atoi(item[i]);
     } else if (!strcmp(item[i], "ban-time")) {
@@ -85,7 +360,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       if (i >= items) {
         if (result)
           sprintf(result, "channel ban-time needs argument");
-        return TCL_ERROR;
+        return ERROR;
       }
       chan->ban_time = atoi(item[i]);
     } else if (!strcmp(item[i], "exempt-time")) {
@@ -93,7 +368,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       if (i >= items) {
         if (result)
           sprintf(result, "channel exempt-time needs argument");
-        return TCL_ERROR;
+        return ERROR;
       }
       chan->exempt_time = atoi(item[i]);
     } else if (!strcmp(item[i], "invite-time")) {
@@ -101,7 +376,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       if (i >= items) {
         if (result)
           sprintf(result, "channel invite-time needs argument");
-        return TCL_ERROR;
+        return ERROR;
       }
       chan->invite_time = atoi(item[i]);
     } else if (!strcmp(item[i], "closed-ban")) {
@@ -109,7 +384,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       if (i >= items) {
         if (result)
           sprintf(result, "channel closed-ban needs argument");
-        return TCL_ERROR;
+        return ERROR;
       }
       chan->closed_ban = atoi(item[i]);
 /* Chanint template
@@ -118,7 +393,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
  *    if (i >= items) {
  *      if (result)
  *        sprintf(result, "channel temp needs argument");
- *      return TCL_ERROR;
+ *      return ERROR;
  *    }
  *    chan->temp = atoi(item[i]);
  */
@@ -128,7 +403,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       if (i >= items) {
         if (result)
           sprintf(result, "channel temp needs argument");
-        return TCL_ERROR;
+        return ERROR;
       }
       strncpyz(chan->temp, item[i], sizeof(chan->temp));
       check_temp(chan);
@@ -138,7 +413,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       if (i >= items) {
         if (result)
           sprintf(result, "channel topic needs argument");
-        return TCL_ERROR;
+        return ERROR;
       }
     }
     else if (!strcmp(item[i], "+enforcebans"))
@@ -284,13 +559,13 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
       } else {
 	if (result)
 	  sprintf(result, "illegal channel flood type: %s", item[i]);
-	return TCL_ERROR;
+	return ERROR;
       }
       i++;
       if (i >= items) {
 	if (result)
 	  sprintf(result, "%s needs argument", item[i - 1]);
-	return TCL_ERROR;
+	return ERROR;
       }
       p = strchr(item[i], ':');
       if (p) {
@@ -331,7 +606,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
           if (i >= items) {
             if (result)
               sprintf(result, "this setting needs an argument");
-            return TCL_ERROR;
+            return ERROR;
           }
           setudef(ul, chan->dname, atoi(item[i]));
           found = 1;
@@ -352,7 +627,7 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
    * <drummer/1999/10/21>
    */
 #ifdef LEAF
-  if (protect_readonly || loading) {
+  if (loading) {
     if (((old_status ^ chan->status) & CHAN_INACTIVE) &&
 	module_find("irc", 0, 0)) {
       if (!shouldjoin(chan) &&
@@ -376,8 +651,8 @@ static int tcl_channel_modify(char *result, struct chanset_t *chan, int items, c
   }
 #endif /* LEAF */
   if (x > 0)
-    return TCL_ERROR;
-  return TCL_OK;
+    return ERROR;
+  return OK;
 }
 
 static void init_masklist(masklist *m)
@@ -456,31 +731,31 @@ static void clear_channel(struct chanset_t *chan, int reset)
 static int tcl_channel_add(char *result, char *newname, char *options)
 {
   struct chanset_t *chan = NULL;
-  int items;
-  int ret = TCL_OK;
+  int items = 0;
+  int ret = OK;
   int join = 0;
   char buf[3001] = "";
-  CONST char **item = NULL;
+  const char **item = NULL;
 
   if (!newname || !newname[0] || !strchr(CHANMETA, newname[0])) {
     if (result)
       sprintf(result, "invalid channel prefix");
-    return TCL_ERROR;
+    return ERROR;
   }
 
   if (strchr(newname, ',') != NULL) {
     if (result)
       sprintf(result, "invalid channel name");
-    return TCL_ERROR;
+    return ERROR;
   }
-
   simple_sprintf(buf, "chanmode %s ", glob_chanmode);
   strcat(buf, glob_chanset);
   strcat(buf, options);
-  buf[sizeof(buf) - 1] = 0;
+  buf[strlen(buf)] = 0;
 
-  if (Tcl_SplitList(NULL, buf, &items, &item) != TCL_OK)
-    return TCL_ERROR;
+
+  if (SplitList(result, buf, &items, &item) != OK)
+    return ERROR;
 
   if ((chan = findchan_by_dname(newname))) {
     /* Already existing channel, maybe a reload of the channel file */
@@ -488,7 +763,7 @@ static int tcl_channel_add(char *result, char *newname, char *options)
   } else {
     chan = (struct chanset_t *) calloc(1, sizeof(struct chanset_t));
 
-    /* Hells bells, why set *every* variable to 0 when we have bzero? */
+    /* Hells bells, const set *every* variable to 0 when we have bzero? */
 /* not needed..    egg_bzero(chan, sizeof(struct chanset_t)); */
 
     /* These are defaults, bzero already set them 0, but we set them for future reference */
@@ -537,14 +812,15 @@ static int tcl_channel_add(char *result, char *newname, char *options)
     join = 1;
   }
   /* If loading is set, we're loading the userfile. Ignore errors while
-   * reading userfile and just return TCL_OK. This is for compatability
+   * reading userfile and just return OK. This is for compatability
    * if a user goes back to an eggdrop that no-longer supports certain
    * (channel) options.
    */
-  if ((tcl_channel_modify(result, chan, items, (char **) item) != TCL_OK) && !loading) {
-    ret = TCL_ERROR;
+  if ((tcl_channel_modify(result, chan, items, (char **) item) != OK) && !loading) {
+    ret = ERROR;
   }
-  Tcl_Free((char *) item);
+
+  free(item);
 #ifdef LEAF
   if (join && shouldjoin(chan) && module_find("irc", 0, 0))
     dprintf(DP_SERVER, "JOIN %s %s\n", chan->dname, chan->key_prot);

+ 0 - 1
src/mod/irc.mod/cmdsirc.c

@@ -1519,7 +1519,6 @@ static void cmd_deluser(struct userrec *u, int idx, char *par)
   char *nick = NULL, s[UHOSTLEN] = "";
   struct chanset_t *chan = NULL;
   memberlist *m = NULL;
-  struct flag_record victim = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
 
   if (!par[0]) {
     dprintf(idx, "Usage: deluser <nick>\n");

+ 26 - 26
src/mod/irc.mod/irc.c

@@ -164,7 +164,7 @@ void getin_request(char *botnick, char *code, char *par)
    *p3 = NULL;
   struct chanset_t *chan = NULL;
   memberlist *mem = NULL;
-  struct userrec *user = NULL;
+  struct userrec *u = NULL;
   char nick[NICKLEN] = "";
   char host[UHOSTLEN] = "";
   char ip4host[UHOSTLEN] = "";
@@ -240,7 +240,7 @@ void getin_request(char *botnick, char *code, char *par)
       return;
     }
   */
-  user = get_user_by_handle(userlist, botnick);
+  u = get_user_by_handle(userlist, botnick);
 
   if (nick[0])
     mem = ismember(chan, nick);
@@ -258,15 +258,15 @@ void getin_request(char *botnick, char *code, char *par)
       putlog(LOG_GETIN, "*", STR("opreq from %s/%s on %s - %s isn't on %s"), botnick, nick, chan->dname, nick, chan->dname);
       return;
     }
-    if (!user) {
+    if (!u) {
       putlog(LOG_GETIN, "*", STR("opreq from %s/%s on %s - No user called %s in userlist"), botnick, nick, chan->dname, botnick);
       return;
     }
-    if (mem->user != user) {
+    if (mem->user != u) {
       putlog(LOG_GETIN, "*", STR("opreq from %s/%s on %s - %s doesn't match %s"), botnick, nick, chan->dname, nick, botnick);
       return;
     }
-    get_user_flagrec(user, &fr, chan->dname);
+    get_user_flagrec(u, &fr, chan->dname);
 
     if ((!chan_op(fr) && !glob_op(fr)) || (glob_deop(fr) && !chan_op(fr))) {
       putlog(LOG_GETIN, "*", STR("opreq from %s/%s on %s - %s doesnt have +o for chan."), botnick, nick, chan->dname, botnick);
@@ -323,11 +323,11 @@ void getin_request(char *botnick, char *code, char *par)
       putlog(LOG_GETIN, "*", STR("inreq from %s/%s for %s - %s is already on %s"), botnick, nick, chan->dname, nick, chan->dname);
       return;
     }
-    if (!user) {
+    if (!u) {
       putlog(LOG_GETIN, "*", STR("inreq from %s/%s for %s - No user called %s in userlist"), botnick, nick, chan->dname, botnick);
       return;
     }
-    get_user_flagrec(user, &fr, chan->dname);
+    get_user_flagrec(u, &fr, chan->dname);
     if ((!chan_op(fr) && !glob_op(fr)) || (glob_deop(fr) && !chan_op(fr))) {
       putlog(LOG_GETIN, "*", STR("inreq from %s/%s for %s - %s doesn't have acces for chan."), botnick, nick, chan->dname, botnick);
       return;
@@ -471,7 +471,7 @@ void check_hostmask()
 
 static void request_op(struct chanset_t *chan)
 {
-  int i = 0, exp = 0, first = 100, n, cnt, i2;
+  int i = 0, my_exp = 0, first = 100, n, cnt, i2;
   memberlist *ml = NULL;
   memberlist *botops[MAX_BOTS];
   char s[100] = "", *l = NULL, myserv[SERVLEN] = "";
@@ -499,12 +499,12 @@ static void request_op(struct chanset_t *chan)
     if (n - chan->opreqtime[i] > OPREQ_SECONDS) {
       if (first > i)
 	first = i;
-      exp++;
+      my_exp++;
       chan->opreqtime[i] = 0;
     }
     i++;
   }
-  if ((5 - exp) >= OPREQ_COUNT) {
+  if ((5 - my_exp) >= OPREQ_COUNT) {
     putlog(LOG_GETIN, "*", STR("Delaying opreq for %s - Maximum of %d:%d reached"), chan->dname, OPREQ_COUNT, OPREQ_SECONDS);
     return;
   }
@@ -582,17 +582,17 @@ static void request_in(struct chanset_t *chan)
   char s[255] = "", *l = NULL;
   int i = 0;
   int cnt, n;
-  struct userrec *botops[MAX_BOTS], *user = NULL;
+  struct userrec *botops[MAX_BOTS], *u = NULL;
   struct flag_record fr = { FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0 };
 
-  for (user = userlist; user && (i < MAX_BOTS); user = user->next) {
-    get_user_flagrec(user, &fr, NULL);
-    if (bot_hublevel(user) == 999 && glob_bot(fr) && chk_op(fr, chan)
+  for (u = userlist; u && (i < MAX_BOTS); u = u->next) {
+    get_user_flagrec(u, &fr, NULL);
+    if (bot_hublevel(u) == 999 && glob_bot(fr) && chk_op(fr, chan)
 #ifdef G_BACKUP
 	&& (!glob_backupbot(fr) || channel_backup(chan))
 #endif/* G_BACKUP */
-	&& nextbot(user->handle) >= 0)
-      botops[i++] = user;
+	&& nextbot(u->handle) >= 0)
+      botops[i++] = u;
   }
   if (!i) {
     putlog(LOG_GETIN, "*", STR("No bots linked, can't request help to join %s"), chan->dname);
@@ -630,7 +630,7 @@ static void request_in(struct chanset_t *chan)
  * true (1) if we want to, false (0) if not.
  */
 static int want_to_revenge(struct chanset_t *chan, struct userrec *u,
-			   struct userrec *u2, char *badnick, char *victim,
+			   struct userrec *u2, char *badnick, char *victimstr,
 			   int mevictim)
 {
   struct flag_record fr = { FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0 };
@@ -642,7 +642,7 @@ static int want_to_revenge(struct chanset_t *chan, struct userrec *u,
   get_user_flagrec(u, &fr, chan->dname);
 
   /* Kickee didn't kick themself? */
-  if (rfc_casecmp(badnick, victim)) {
+  if (rfc_casecmp(badnick, victimstr)) {
     /* They kicked me? */
     if (mevictim) {
       /* ... and I'm allowed to take revenge? <snicker> */
@@ -667,7 +667,7 @@ static int want_to_revenge(struct chanset_t *chan, struct userrec *u,
 /* Dependant on revenge_mode, punish the offender.
  */
 static void punish_badguy(struct chanset_t *chan, char *whobad,
-			  struct userrec *u, char *badnick, char *victim,
+			  struct userrec *u, char *badnick, char *victimstr,
 			  int mevictim, int type)
 {
   char reason[1024] = "", ct[81] = "", *kick_msg = NULL;
@@ -691,10 +691,10 @@ static void punish_badguy(struct chanset_t *chan, char *whobad,
   switch (type) {
   case REVENGE_KICK:
     kick_msg = IRC_KICK_PROTECT;
-    simple_sprintf(reason, "kicked %s off %s", victim, chan->dname);
+    simple_sprintf(reason, "kicked %s off %s", victimstr, chan->dname);
     break;
   case REVENGE_DEOP:
-    simple_sprintf(reason, "deopped %s on %s", victim, chan->dname);
+    simple_sprintf(reason, "deopped %s on %s", victimstr, chan->dname);
     kick_msg = IRC_DEOP_PROTECT;
     break;
   default:
@@ -793,7 +793,7 @@ static void punish_badguy(struct chanset_t *chan, char *whobad,
 static void maybe_revenge(struct chanset_t *chan, char *whobad,
 			  char *whovictim, int type)
 {
-  char *badnick = NULL, *victim = NULL;
+  char *badnick = NULL, *victimstr = NULL;
   int mevictim;
   struct userrec *u = NULL, *u2 = NULL;
 
@@ -806,15 +806,15 @@ static void maybe_revenge(struct chanset_t *chan, char *whobad,
 
   /* Get info about victim */
   u2 = get_user_by_host(whovictim);
-  victim = splitnick(&whovictim);
-  mevictim = match_my_nick(victim);
+  victimstr = splitnick(&whovictim);
+  mevictim = match_my_nick(victimstr);
 
   /* Do we want to revenge? */
-  if (!want_to_revenge(chan, u, u2, badnick, victim, mevictim))
+  if (!want_to_revenge(chan, u, u2, badnick, victimstr, mevictim))
     return;	/* No, leave them alone ... */
 
   /* Haha! Do the vengeful thing ... */
-  punish_badguy(chan, whobad, u, badnick, victim, mevictim, type);
+  punish_badguy(chan, whobad, u, badnick, victimstr, mevictim, type);
 }
 
 /* Set the key.

+ 0 - 1
src/mod/irc.mod/mode.c

@@ -1214,7 +1214,6 @@ static int gotmode(char *from, char *msg)
       char *modes[5] = { NULL, NULL, NULL, NULL, NULL };
       char tmp[1024] = "", sign = '+', *nfrom = NULL, *hfrom = NULL, *wptr = NULL, *p = NULL, work[1024] = "";
       struct userrec *ufrom = NULL;
-      memberlist *m = NULL;
       int modecnt = 0, i = 0, n = 0, ops = 0, deops = 0, bans = 0, unbans = 0;
 
       /* Split up the mode: #chan modes param param param param */

+ 4 - 4
src/mod/irc.mod/msgcmds.c

@@ -234,7 +234,7 @@ static int msg_auth(char *nick, char *host, struct userrec *u, char *par)
 {
   char *pass = NULL;
 #ifdef S_AUTHHASH
-  char rand[50] = "";
+  char randstring[50] = "";
 #endif /* S_AUTHHASH */
   int i = 0;
 
@@ -259,9 +259,9 @@ static int msg_auth(char *nick, char *host, struct userrec *u, char *par)
       putlog(LOG_CMDS, "*", "(%s!%s) !%s! -AUTH", nick, host, u->handle);
 
       auth[i].authing = 2;      
-      make_rand_str(rand, 50);
-      strncpyz(auth[i].hash, makehash(u, rand), sizeof auth[i].hash);
-      dprintf(DP_HELP, "PRIVMSG %s :-Auth %s %s\n", nick, rand, conf.bot->nick);
+      make_rand_str(randstring, 50);
+      strncpyz(auth[i].hash, makehash(u, randstring), sizeof auth[i].hash);
+      dprintf(DP_HELP, "PRIVMSG %s :-Auth %s %s\n", nick, randstring, conf.bot->nick);
   } else {
     putlog(LOG_CMDS, "*", "(%s!%s) !%s! failed -AUTH", nick, host, u->handle);
     removeauth(i);

+ 4 - 4
src/mod/module.h

@@ -420,7 +420,7 @@
 #define changeover_dcc ((void (*)(int, struct dcc_table *, int))global[242])
 #define make_rand_str ((void (*) (char *, int))global[243])
 /* 244 - 247 */
-#define protect_readonly (*(int *)(global[244]))
+/* UNUSED 244 */
 #define findchan_by_dname ((struct chanset_t *(*)(char *))global[245])
 /* 246 UNUSED */
 #define userfile_perm (*(int *)global[247])
@@ -428,7 +428,7 @@
 #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])
+#define egg_inet_aton ((int (*)(const char *, struct in_addr *))global[251])
 /* 252 - 255 */
 #define egg_snprintf (global[252])
 #define egg_vsnprintf ((int (*)(char *, size_t, const char *, va_list))global[253])
@@ -446,8 +446,8 @@
 #define strchr_unescape ((char *(*)(char *, const char, register const char))global[263])
 /* 264 - 267 */
 #define str_unescape ((void (*)(char *, register const char))global[264])
-#define egg_strcatn ((int (*)(char *dst, const char *src, size_t max))global[265])
-#define clear_chanlist_member ((void (*)(const char *nick))global[266])
+#define egg_strcatn ((int (*)(char *, const char *, size_t))global[265])
+#define clear_chanlist_member ((void (*)(const char *))global[266])
 #define fixfrom ((char *(*)(char *))global[267])
 /* 268 - 272 */
 /* Please don't modify socklist directly, unless there's no other way.

+ 15 - 12
src/mod/server.mod/server.c

@@ -489,19 +489,19 @@ static int fast_deq(int which)
   return 0;
 }
 
-static void check_queues(char *oldnick, char *newnick)
+static void check_queues(char *old_nick, char *newnick)
 {
   if (optimize_kicks == 2) {
     if (modeq.head)
-      parse_q(&modeq, oldnick, newnick);
+      parse_q(&modeq, old_nick, newnick);
     if (mq.head)
-      parse_q(&mq, oldnick, newnick);
+      parse_q(&mq, old_nick, newnick);
     if (hq.head)
-      parse_q(&hq, oldnick, newnick);
+      parse_q(&hq, old_nick, newnick);
   }
 }
 
-static void parse_q(struct msgq_head *q, char *oldnick, char *newnick)
+static void parse_q(struct msgq_head *q, char *old_nick, char *newnick)
 {
   struct msgq *m = NULL, *lm = NULL;  char buf[511] = "", *msg = NULL, *nicks = NULL, 
               *nick = NULL, *chan = NULL, newnicks[511] = "", newmsg[511] = "";
@@ -520,7 +520,7 @@ static void parse_q(struct msgq_head *q, char *oldnick, char *newnick)
       nicks = newsplit(&msg);
       while (strlen(nicks) > 0) {
         nick = splitnicks(&nicks);
-        if (!egg_strcasecmp(nick, oldnick) &&
+        if (!egg_strcasecmp(nick, old_nick) &&
             ((9 + strlen(chan) + strlen(newnicks) + strlen(newnick) +
               strlen(nicks) + strlen(msg)) < 510)) {
           if (newnick)
@@ -1101,7 +1101,7 @@ struct cfg_entry CFG_REALNAME = {
  *
  * -> if (*ptr == -1) then jump to that particular server
  */
-static void next_server(int *ptr, char *serv, unsigned int *port, char *pass)
+static void next_server(int *ptr, char *servname, unsigned int *port, char *pass)
 {
   struct server_list *x = serverlist;
   int i = 0;
@@ -1112,12 +1112,12 @@ static void next_server(int *ptr, char *serv, unsigned int *port, char *pass)
   if (*ptr == (-1)) {
     for (; x; x = x->next) {
       if (x->port == *port) {
-	if (!egg_strcasecmp(x->name, serv)) {
+	if (!egg_strcasecmp(x->name, servname)) {
 	  *ptr = i;
 	  return;
-	} else if (x->realname && !egg_strcasecmp(x->realname, serv)) {
+	} else if (x->realname && !egg_strcasecmp(x->realname, servname)) {
 	  *ptr = i;
-	  strncpyz(serv, x->realname, sizeof serv);
+	  strncpyz(servname, x->realname, sizeof servname);
 	  return;
 	}
       }
@@ -1128,7 +1128,7 @@ static void next_server(int *ptr, char *serv, unsigned int *port, char *pass)
 
     x->next = 0;
     x->realname = 0;
-    x->name = strdup(serv);
+    x->name = strdup(servname);
     x->port = *port ? *port : default_port;
     if (pass && pass[0]) {
       x->pass = strdup(pass);
@@ -1152,7 +1152,7 @@ static void next_server(int *ptr, char *serv, unsigned int *port, char *pass)
     x = serverlist;
     *ptr = 0;
   }				/* Start over at the beginning */
-  strcpy(serv, x->name);
+  strcpy(servname, x->name);
   *port = x->port ? x->port : default_port;
   if (x->pass)
     strcpy(pass, x->pass);
@@ -1300,7 +1300,10 @@ static void dcc_chat_hostresolved(int i)
     debug0("afinet6, af_type, strcpy");
   } else
 #endif /* !USE_IPV6 */
+/* redundant?
   egg_snprintf(ip, sizeof ip, "%lu", iptolong(htonl(dcc[i].addr)));
+*/
+  egg_snprintf(ip, sizeof ip, "%lu", iptolong(dcc[i].addr));
 #ifdef USE_IPV6
   if (sockprotocol(dcc[i].sock) == AF_INET6) {
 #  ifdef IPV6_DEBUG

+ 16 - 16
src/mod/server.mod/servmsg.c

@@ -468,25 +468,25 @@ static int gotmsg(char *from, char *msg)
 	putlog(LOG_MSGS | LOG_SERV, "*", "[%s!%s to %s] %s",nick, uhost, to, msg);
       }
     } else {
-      char *code = NULL;
-      struct userrec *u = NULL;
+      char *my_code = NULL;
+      struct userrec *my_u = NULL;
 
       detect_flood(nick, uhost, from, FLOOD_PRIVMSG);
-      u = get_user_by_host(from);
-      code = newsplit(&msg);
+      my_u = get_user_by_host(from);
+      my_code = newsplit(&msg);
       rmspace(msg);
 #ifdef S_AUTHCMDS
       i = findauth(uhost);
       /* is it a cmd? */
 
-      if (i > -1 && auth[i].authed && code[0] == cmdprefix[0] && code[1]) {
-        code++;        
-        u = auth[i].user;
+      if (i > -1 && auth[i].authed && my_code[0] == cmdprefix[0] && my_code[1]) {
+        my_code++;        
+        my_u = auth[i].user;
 
-        if (check_bind_msgc(code, nick, uhost, u, msg))
+        if (check_bind_msgc(my_code, nick, uhost, my_u, msg))
           auth[i].atime = now;
         else
-          putlog(LOG_MSGS, "*", "[%s] %c%s %s", from, cmdprefix[0], code, msg);
+          putlog(LOG_MSGS, "*", "[%s] %c%s %s", from, cmdprefix[0], my_code, msg);
       } else if ((code[0] != cmdprefix[0] || !code[1] || i == -1 || !(auth[i].authed))) {
 #endif /* S_AUTHCMDS */
         if (!ignoring) {
@@ -497,23 +497,23 @@ static int gotmsg(char *from, char *msg)
                || !egg_strcasecmp(code, msgop) || !egg_strcasecmp(code, msgpass) 
                || !egg_strcasecmp(code, msginvite) || !egg_strcasecmp(code, msgident)) {
 /*           || !strcmp(code, msgop) || !strcmp(code, msgpass) || !strcmp(code, msgop)) { */
-            char buf[10] = "";
+            char buf2[10] = "";
 
             doit = 0;
             if (!egg_strcasecmp(code, msgop))
-              sprintf(buf, "op");
+              sprintf(buf2, "op");
             else if (!egg_strcasecmp(code, msgpass))
-              sprintf(buf, "pass");
+              sprintf(buf2, "pass");
             else if (!egg_strcasecmp(code, msginvite))
-              sprintf(buf, "invite");
+              sprintf(buf2, "invite");
             else if (!egg_strcasecmp(code, msgident))
-              sprintf(buf, "ident");
+              sprintf(buf2, "ident");
             if (buf[0])
-              result = check_bind_msg(buf, nick, uhost, u, msg);
+              result = check_bind_msg(buf2, nick, uhost, my_u, msg);
           }
 #endif /* S_MSGCMDS */
           if (doit)
-            result = check_bind_msg(code, nick, uhost, u, msg);
+            result = check_bind_msg(code, nick, uhost, my_u, msg);
             
 	  if (!result)
 	    putlog(LOG_MSGS, "*", "[%s] %s %s", from, code, msg);

+ 7 - 7
src/mod/share.mod/share.c

@@ -1841,16 +1841,16 @@ Context;
       }
       noshare = 1;
       for (cr = u2->chanrec; cr; cr = cr_next) {
-	struct chanset_t *chan = findchan_by_dname(cr->channel);
+	struct chanset_t *mychan = findchan_by_dname(cr->channel);
 
 	cr_next = cr->next;
-	if (chan) {
+	if (mychan) {
 	  int not_shared = 0;
 
-	  if (!channel_shared(chan))
+	  if (!channel_shared(mychan))
 	    not_shared = 1;
 	  else {
-	    get_user_flagrec(dcc[j].user, &fr, chan->dname);
+	    get_user_flagrec(dcc[j].user, &fr, mychan->dname);
 	    if (!bot_chan(fr) && !bot_global(fr))
 	      not_shared = 1;
 	  }
@@ -2152,8 +2152,8 @@ char *share_start(Function *global_funcs)
 
 int private_globals_bitmask()
 {
-  struct flag_record fr = {FR_GLOBAL, 0, 0, 0, 0, 0};
+  struct flag_record my_fr = {FR_GLOBAL, 0, 0, 0, 0, 0};
 
-  break_down_flags(private_globals, &fr, 0);
-  return fr.global;
+  break_down_flags(private_globals, &my_fr, 0);
+  return my_fr.global;
 }

+ 3 - 3
src/modules.c

@@ -58,8 +58,8 @@ extern int	 	 noshare, loading, role, server_lag,
 			 debug_output, default_flags,  
 			 max_dcc, password_timeout, localhub,
 			 use_invites, use_exempts, 
-                         do_restart, timesync,
-			 protect_readonly;
+                         do_restart, timesync;
+			 
 extern time_t now, online_since, buildts;
 extern struct chanset_t *chanset;
 extern tand_t *tandbot;
@@ -484,7 +484,7 @@ Function global_table[] =
   (Function) changeover_dcc,  
   (Function) make_rand_str,
   /* 244 - 247 */
-  (Function) & protect_readonly, /* int					*/
+  (Function) 0,
   (Function) findchan_by_dname,
   (Function) 0,
   (Function) & userfile_perm,	 /* int					*/

+ 1 - 1
src/shell.c

@@ -65,7 +65,7 @@ int clear_tmp()
        && strcmp(dir_ent->d_name, ".") && strcmp(dir_ent->d_name, ".un") && strcmp(dir_ent->d_name, "..")) {
       char *file = NULL;
 
-      file = malloc(strlen(dir_ent->d_name) + strlen(tempdir) + 1);
+      file = calloc(1, strlen(dir_ent->d_name) + strlen(tempdir) + 1);
 
       strcat(file, tempdir);
       strcat(file, dir_ent->d_name);

+ 0 - 136
src/tcl.c

@@ -1,136 +0,0 @@
-/*
- * tcl.c -- handles:
- *   the code for every command eggdrop adds to Tcl
- *   Tcl initialization
- *   getting and setting Tcl/eggdrop variables
- *
- */
-
-#include <stdlib.h>		/* getenv()				*/
-#include <locale.h>		/* setlocale()				*/
-#include "common.h"
-#include "misc.h"
-#include "chanprog.h"
-#include <sys/stat.h>
-
-extern char egg_version[];
-
-int	    protect_readonly = 0;	/* turn on/off readonly protection */
-Tcl_Interp *interp;			/* eggdrop always uses the same
-					   interpreter */
-/* Prototypes for tcl */
-Tcl_Interp *Tcl_CreateInterp();
-
-/*
- *     Vars, traces, misc
- */
-
-
-/* Not going through Tcl's crazy main() system (what on earth was he
- * smoking?!) so we gotta initialize the Tcl interpreter
- */
-void init_tcl(int argc, char **argv)
-{
-  const char *encoding = NULL;
-  char *langEnv = NULL;
-  int j;
-  char pver[1024] = "";
-
-/* This must be done *BEFORE* Tcl_SetSystemEncoding(),
- * or Tcl_SetSystemEncoding() will cause a segfault.
- */
-  /* This is used for 'info nameofexecutable'.
-   * The filename in argv[0] must exist in a directory listed in
-   * the environment variable PATH for it to register anything.
-   */
-  Tcl_FindExecutable(argv[0]);
-
-  /* Initialize the interpreter */
-  interp = Tcl_CreateInterp();
-
-  /* Set Tcl variable tcl_interactive to 0 */
-  Tcl_SetVar(interp, "tcl_interactive", "0", TCL_GLOBAL_ONLY);
-
-  /* Setup script library facility */
-  Tcl_Init(interp);
-
-/* Code based on Tcl's TclpSetInitialEncodings() */
-  /* Determine the current encoding from the LC_* or LANG environment
-   * variables.
-   */
-  langEnv = getenv("LC_ALL");
-  if (langEnv == NULL || langEnv[0] == '\0') {
-    langEnv = getenv("LC_CTYPE");
-  }
-  if (langEnv == NULL || langEnv[0] == '\0') {
-    langEnv = getenv("LANG");
-  }
-  if (langEnv == NULL || langEnv[0] == '\0') {
-    langEnv = NULL;
-  }
-
-  encoding = NULL;
-  if (langEnv != NULL) {
-
-    /* There was no mapping in the locale table.  If there is an
-     * encoding subfield, we can try to guess from that.
-     */
-    if (encoding == NULL) {
-      char *p;
-
-      for (p = langEnv; *p != '\0'; p++) {
-        if (*p == '.') {
-          p++;
-          break;
-        }
-      }
-      if (*p != '\0') {
-        Tcl_DString ds;
-        Tcl_DStringInit(&ds);
-        Tcl_DStringAppend(&ds, p, -1);
-
-        encoding = Tcl_DStringValue(&ds);
-        Tcl_UtfToLower(Tcl_DStringValue(&ds));
-        if (Tcl_SetSystemEncoding(NULL, encoding) == TCL_OK) {
-          Tcl_DStringFree(&ds);
-          goto resetPath;
-        }
-        Tcl_DStringFree(&ds);
-        encoding = NULL;
-      }
-    }
-  }
-
-  if (encoding == NULL) {
-    encoding = "iso8859-1";
-  }
-
-  Tcl_SetSystemEncoding(NULL, encoding);
-
-resetPath:
-
-  /* Initialize the C library's locale subsystem. */
-  setlocale(LC_CTYPE, "");
-
-  /* In case the initial locale is not "C", ensure that the numeric
-   * processing is done in "C" locale regardless. */
-  setlocale(LC_NUMERIC, "C");
-
-  /* Keep the iso8859-1 encoding preloaded.  The IO package uses it for
-   * gets on a binary channel. */
-  Tcl_GetEncoding(NULL, "iso8859-1");
-
-  /* Add eggdrop to Tcl's package list */
-  for (j = 0; j <= strlen(egg_version); j++) {
-    if ((egg_version[j] == ' ') || (egg_version[j] == '+'))
-      break;
-    pver[strlen(pver)] = egg_version[j];
-  }
-  Tcl_PkgProvide(interp, "eggdrop", pver);
-
-  /* Initialize binds and traces */
-  Context;
-
-  Context;
-}
-

+ 3 - 1
src/users.c

@@ -816,6 +816,7 @@ int readuserfile(char *file, struct userrec **ret)
            if ((me = module_find("channels", 0, 0))) {
              Function *func = me->funcs;
              char *options = NULL, *chan = NULL, *my_ptr = NULL;
+             char resultbuf[2048] = "";
 
              options = my_ptr = strdup(s);
 
@@ -826,7 +827,8 @@ int readuserfile(char *file, struct userrec **ret)
              newsplit(&options);
              options[strlen(options) - 1] = 0;
 /* Above is a hack to remove { } */
-             if ((func[37]) (NULL, chan, options) != TCL_OK) {	/* tcl_channel_add() */
+             if ((func[37]) (resultbuf, chan, options) != OK) {	/* tcl_channel_add() */
+printf("BUF: %s\n", resultbuf);
                putlog(LOG_MISC, "*", "Channel parsing error in userfile on line %d", line);
                free(my_ptr);
                return 0;

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff