[cvslog] Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Tue Dec 18 01:05:02 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2001-12-18 07:04:32 UTC
Commited by: Jeff Fisher <guppy at techmonkeys.org>

Modified files:
     doc/MODULES lib/eggdrop/module.h modules/uptime/uptime.c
     modules/woobie/woobie.c src/eggdrop.h src/main.c src/modules.c
     src/net.c src/proto.h

Log message:

removed Context and ContextNote

---------------------- diff included ----------------------
Index: eggdrop1.7/doc/MODULES
diff -u eggdrop1.7/doc/MODULES:1.12 eggdrop1.7/doc/MODULES:1.13
--- eggdrop1.7/doc/MODULES:1.12	Thu Dec 13 23:48:37 2001
+++ eggdrop1.7/doc/MODULES	Tue Dec 18 01:04:21 2001
@@ -220,8 +220,6 @@
 
 void *nmalloc (int a);      - allocates a bytes
 void   nfree (void *a);     - frees a modmalloc'd block
-       context;             - actually a #define, records the current
-                            - possition in execution, for debugging
 void   dprintf (int idx,char *format, ... ) - just like normal printf,
                             outputs to a dcc/socket/server,
                             idx is a normal dcc idx OR if < 0 is a sock #
Index: eggdrop1.7/lib/eggdrop/module.h
diff -u eggdrop1.7/lib/eggdrop/module.h:1.6 eggdrop1.7/lib/eggdrop/module.h:1.7
--- eggdrop1.7/lib/eggdrop/module.h:1.6	Tue Dec 18 00:30:54 2001
+++ eggdrop1.7/lib/eggdrop/module.h	Tue Dec 18 01:04:21 2001
@@ -1,7 +1,7 @@
 /*
  * module.h
  *
- * $Id: module.h,v 1.6 2001/12/18 06:30:54 guppy Exp $
+ * $Id: module.h,v 1.7 2001/12/18 07:04:21 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -49,8 +49,6 @@
 
 /* #undef feof */
 #undef dprintf
-#undef Context
-#undef ContextNote
 
 #if defined (__CYGWIN__) && !defined(STATIC)
 #  define EXPORT_SCOPE	__declspec(dllexport)
@@ -63,11 +61,6 @@
 /* 0 - 3 */
 /* 0: nmalloc -- UNUSED (Tothwolf) */
 /* 1: nfree -- UNUSED (Tothwolf) */
-#ifdef DEBUG_CONTEXT
-#  define Context (global[2](__FILE__, __LINE__, MODULE_NAME))
-#else
-#  define Context {}
-#endif
 #define module_rename ((int (*)(char *, char *))global[3])
 /* 4 - 7 */
 #define module_register ((int (*)(char *, Function *, int, int))global[4])
@@ -355,11 +348,7 @@
 /* 230: nrealloc -- UNUSED (Tothwolf) */
 #define xtra_set ((int(*)(struct userrec *,struct user_entry *, void *))global[231])
 /* 232 - 235 */
-#ifdef DEBUG_CONTEXT
-#  define ContextNote(note) (global[232](__FILE__, __LINE__, MODULE_NAME, note))
-#else
-#  define ContextNote(note)	do {	} while (0)
-#endif
+/* #define ContextNote(note) (global[232](__FILE__, __LINE__, MODULE_NAME, note)) */
 /* 233: Assert -- UNUSED (Tothwolf) */
 #define allocsock ((int(*)(int sock,int options))global[234])
 #define call_hostbyip ((void(*)(char *, char *, int))global[235])
Index: eggdrop1.7/modules/uptime/uptime.c
diff -u eggdrop1.7/modules/uptime/uptime.c:1.4 eggdrop1.7/modules/uptime/uptime.c:1.5
--- eggdrop1.7/modules/uptime/uptime.c:1.4	Sun Dec  2 06:36:38 2001
+++ eggdrop1.7/modules/uptime/uptime.c	Tue Dec 18 01:04:21 2001
@@ -1,5 +1,5 @@
 /* 
- * $Id: uptime.c,v 1.4 2001/12/02 12:36:38 ite Exp $
+ * $Id: uptime.c,v 1.5 2001/12/18 07:04:21 guppy Exp $
  *
  * This module reports uptime information about your bot to http://uptime.eggheads.org. The
  * purpose for this is to see how your bot rates against many others (including EnergyMechs 
@@ -79,7 +79,6 @@
 
 static void uptime_report(int idx, int details)
 {
-  Context;
 }
 	
 
@@ -182,7 +181,6 @@
 
 static int uptime_set_send(struct userrec *u, int idx, char *par)
 {
-	Context;
 	dprintf(idx,"Nick %s Ontime %lu Version %s Result %d\n", botnetnick, online_since,
 	        uptime_version, send_uptime()); 
 	return 1;
@@ -230,7 +228,6 @@
 {
 	global = global_funcs;
 
-	Context;
 	if (!module_depend(MODULE_NAME, "eggdrop", 107, 0)) {
 		module_undepend(MODULE_NAME);
 		return _("This module requires eggdrop1.7.0 or later");
Index: eggdrop1.7/modules/woobie/woobie.c
diff -u eggdrop1.7/modules/woobie/woobie.c:1.1 eggdrop1.7/modules/woobie/woobie.c:1.2
--- eggdrop1.7/modules/woobie/woobie.c:1.1	Sat Oct 27 11:34:54 2001
+++ eggdrop1.7/modules/woobie/woobie.c	Tue Dec 18 01:04:21 2001
@@ -5,7 +5,7 @@
  * Originally written by ButchBub	  15 July     1997
  * Comments by Fabian Knittel		  29 December 1999
  *
- * $Id: woobie.c,v 1.1 2001/10/27 16:34:54 ite Exp $
+ * $Id: woobie.c,v 1.2 2001/12/18 07:04:21 guppy Exp $
  */
 /*
  * Copyright (C) 1999, 2000, 2001 Eggheads Development Team
@@ -43,13 +43,6 @@
 
 static int cmd_woobie(struct userrec *u, int idx, char *par)
 {
-  /* Define a context.
-   *
-   * If the bot crashes after the context, it will be  the last mentioned
-   * in the resulting DEBUG file. This helps you debugging.
-   */
-  Context;
-
   /* Log the command as soon as you're sure all parameters are valid. */
   putlog(LOG_CMDS, "*", "#%s# woobie", dcc[idx].nick);
 
@@ -65,7 +58,6 @@
  */
 static void woobie_report(int idx, int details)
 {
-  Context;
 }
 
 /* Note: The tcl-name is automatically created if you set it to NULL. In
@@ -83,7 +75,6 @@
 
 static char *woobie_close()
 {
-  Context;
   if (BT_dcc) rem_builtins2(BT_dcc, mydcc);
   module_undepend(MODULE_NAME);
   return NULL;
@@ -115,7 +106,6 @@
    */
   global = global_funcs;
 
-  Context;
   /* Register the module. */
   module_register(MODULE_NAME, woobie_table, 2, 0);
   /*                                            ^--- minor module version
Index: eggdrop1.7/src/eggdrop.h
diff -u eggdrop1.7/src/eggdrop.h:1.51 eggdrop1.7/src/eggdrop.h:1.52
--- eggdrop1.7/src/eggdrop.h:1.51	Sun Nov 25 08:45:09 2001
+++ eggdrop1.7/src/eggdrop.h	Tue Dec 18 01:04:21 2001
@@ -4,7 +4,7 @@
  *
  *   IF YOU ALTER THIS FILE, YOU NEED TO RECOMPILE THE BOT.
  *
- * $Id: eggdrop.h,v 1.51 2001/11/25 14:45:09 ite Exp $
+ * $Id: eggdrop.h,v 1.52 2001/12/18 07:04:21 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -35,12 +35,6 @@
 #undef NO_OLD_BOTNET
 
 /*
- * Undefine this to completely disable context debugging.
- * WARNING: DO NOT send in bug reports if you undefine this!
- */
-#define DEBUG_CONTEXT
-
-/*
  * HANDLEN note:
  *       HANDLEN defines the maximum length a handle on the bot can be.
  *       Standard (and minimum) is 9 characters long.
@@ -181,14 +175,6 @@
   } else								\
     free_null(target);							\
 } while (0)
-
-#ifdef DEBUG_CONTEXT
-#  define Context		eggContext(__FILE__, __LINE__, NULL)
-#  define ContextNote(note)	eggContextNote(__FILE__, __LINE__, NULL, note)
-#else
-#  define Context		{}
-#  define ContextNote(note)	{}
-#endif
 
 /* 32 bit type
  */
Index: eggdrop1.7/src/main.c
diff -u eggdrop1.7/src/main.c:1.100 eggdrop1.7/src/main.c:1.101
--- eggdrop1.7/src/main.c:1.100	Sat Dec  8 21:55:57 2001
+++ eggdrop1.7/src/main.c	Tue Dec 18 01:04:21 2001
@@ -3,9 +3,8 @@
  *   core event handling
  *   signal handling
  *   command line arguments
- *   context and assert debugging
  *
- * $Id: main.c,v 1.100 2001/12/09 03:55:57 stdarg Exp $
+ * $Id: main.c,v 1.101 2001/12/18 07:04:21 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -146,15 +145,6 @@
 unsigned long	itraffic_unknown = 0;
 unsigned long	itraffic_unknown_today = 0;
 
-#ifdef DEBUG_CONTEXT
-/* Context storage for fatal crashes */
-char	cx_file[16][30];
-char	cx_note[16][256];
-int	cx_line[16];
-int	cx_ptr = 0;
-#endif
-
-
 void fatal(const char *s, int recoverable)
 {
   int i;
@@ -189,107 +179,8 @@
     }
 }
 
-#ifdef DEBUG_CONTEXT
-static int	nested_debug = 0;
-
-void write_debug()
-{
-  int x;
-  char s[25];
-  int y;
-
-  if (nested_debug) {
-    /* Yoicks, if we have this there's serious trouble!
-     * All of these are pretty reliable, so we'll try these.
-     *
-     * NOTE: dont try and display context-notes in here, it's
-     *       _not_ safe <cybah>
-     */
-    x = creat("DEBUG.DEBUG", 0644);
-    setsock(x, SOCK_NONSOCK);
-    if (x >= 0) {
-      strncpyz(s, ctime(&now), sizeof s);
-      dprintf(-x, "Debug (%s) written %s\n", ver, s);
-      dprintf(-x, "Please report problem to bugs at eggheads.org\n");
-      dprintf(-x, "after a visit to http://www.eggheads.org/bugzilla/\n");
-      dprintf(-x, "Full Patch List: %s\n", egg_xtra);
-      dprintf(-x, "Context: ");
-      cx_ptr = cx_ptr & 15;
-      for (y = ((cx_ptr + 1) & 15); y != cx_ptr; y = ((y + 1) & 15))
-	dprintf(-x, "%s/%d,\n         ", cx_file[y], cx_line[y]);
-      dprintf(-x, "%s/%d\n\n", cx_file[y], cx_line[y]);
-      killsock(x);
-      close(x);
-    }
-    bg_send_quit(BG_ABORT);
-    exit(1);			/* Dont even try & tell people about, that may
-				   have caused the fault last time. */
-  } else
-    nested_debug = 1;
-  putlog(LOG_MISC, "*", "* Last context: %s/%d [%s]", cx_file[cx_ptr],
-	 cx_line[cx_ptr], cx_note[cx_ptr][0] ? cx_note[cx_ptr] : "");
-  putlog(LOG_MISC, "*", "* Please REPORT this BUG!");
-  putlog(LOG_MISC, "*", "* Check doc/BUG-REPORT on how to do so.");
-  x = creat("DEBUG", 0644);
-  setsock(x, SOCK_NONSOCK);
-  if (x < 0) {
-    putlog(LOG_MISC, "*", "* Failed to write DEBUG");
-  } else {
-    strncpyz(s, ctime(&now), sizeof s);
-    dprintf(-x, "Debug (%s) written %s\n", ver, s);
-    dprintf(-x, "Full Patch List: %s\n", egg_xtra);
-#ifdef STATIC
-    dprintf(-x, "STATICALLY LINKED\n");
-#endif
-
-    /* info library */
-    dprintf(-x, "TCL library: %s\n",
-	    ((interp) && (Tcl_Eval(interp, "info library") == TCL_OK)) ?
-	    interp->result : "*unknown*");
-
-    /* info tclversion/patchlevel */
-    dprintf(-x, "TCL version: %s (header version %s)\n",
-	    ((interp) && (Tcl_Eval(interp, "info patchlevel") == TCL_OK)) ?
-	    interp->result : (Tcl_Eval(interp, "info tclversion") == TCL_OK) ?
-	    interp->result : "*unknown*", TCL_PATCH_LEVEL ? TCL_PATCH_LEVEL :
-	    "*unknown*");
-
-#if HAVE_TCL_THREADS
-    dprintf(-x, "TCL is threaded\n");
-#endif
-
-#ifdef CCFLAGS
-    dprintf(-x, "Compile flags: %s\n", CCFLAGS);
-#endif
-#ifdef LDFLAGS
-    dprintf(-x, "Link flags: %s\n", LDFLAGS);
-#endif
-#ifdef STRIPFLAGS
-    dprintf(-x, "Strip flags: %s\n", STRIPFLAGS);
-#endif
-
-    dprintf(-x, "Context: ");
-    cx_ptr = cx_ptr & 15;
-    for (y = ((cx_ptr + 1) & 15); y != cx_ptr; y = ((y + 1) & 15))
-      dprintf(-x, "%s/%d, [%s]\n         ", cx_file[y], cx_line[y],
-	      (cx_note[y][0]) ? cx_note[y] : "");
-    dprintf(-x, "%s/%d [%s]\n\n", cx_file[cx_ptr], cx_line[cx_ptr],
-	    (cx_note[cx_ptr][0]) ? cx_note[cx_ptr] : "");
-    tell_dcc(-x);
-    dprintf(-x, "\n");
-    tell_netdebug(-x);
-    killsock(x);
-    close(x);
-    putlog(LOG_MISC, "*", "* Wrote DEBUG");
-  }
-}
-#endif
-
 static void got_bus(int z)
 {
-#ifdef DEBUG_CONTEXT
-  write_debug();
-#endif
   fatal("BUS ERROR -- CRASHING!", 1);
 #ifdef SA_RESETHAND
   kill(getpid(), SIGBUS);
@@ -301,9 +192,6 @@
 
 static void got_segv(int z)
 {
-#ifdef DEBUG_CONTEXT
-  write_debug();
-#endif
   fatal("SEGMENT VIOLATION -- CRASHING!", 1);
 #ifdef SA_RESETHAND
   kill(getpid(), SIGSEGV);
@@ -315,9 +203,6 @@
 
 static void got_fpe(int z)
 {
-#ifdef DEBUG_CONTEXT
-  write_debug();
-#endif
   fatal("FLOATING POINT ERROR -- CRASHING!", 0);
 }
 
@@ -360,53 +245,13 @@
   /* -Never reached- */
 }
 
-/* Got ILL signal -- log context and continue
+/* Got ILL signal
  */
 static void got_ill(int z)
 {
   check_bind_event("sigill");
-#ifdef DEBUG_CONTEXT
-  putlog(LOG_MISC, "*", "* Context: %s/%d [%s]", cx_file[cx_ptr],
-	 cx_line[cx_ptr], (cx_note[cx_ptr][0]) ? cx_note[cx_ptr] : "");
-#endif
-}
-
-#ifdef DEBUG_CONTEXT
-/* Context */
-void eggContext(const char *file, int line, const char *module)
-{
-  char x[31], *p;
-
-  p = strrchr(file, '/');
-  if (!module) {
-    strncpyz(x, p ? p + 1 : file, sizeof x);
-  } else
-    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;
-  cx_note[cx_ptr][0] = 0;
 }
 
-/* Called from the ContextNote macro.
- */
-void eggContextNote(const char *file, int line, const char *module,
-		    const char *note)
-{
-  char x[31], *p;
-
-  p = strrchr(file, '/');
-  if (!module) {
-    strncpyz(x, p ? p + 1 : file, sizeof x);
-  } else
-    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;
-  strncpyz(cx_note[cx_ptr], note, sizeof cx_note[cx_ptr]);
-}
-#endif
-
 static void do_arg(char *s)
 {
   char x[1024], *z = x;
@@ -473,8 +318,6 @@
 static struct tm	nowtm;
 
 /* Called once a second.
- *
- * Note:  Try to not put any Context lines in here (guppy 21Mar2000).
  */
 static void core_secondly()
 {
@@ -642,10 +485,6 @@
     setrlimit(RLIMIT_CORE, &cdlim);
   }
 #endif
-
-  /* Initialise context list */
-  for (i = 0; i < 16; i++)
-    Context;
 
 #ifdef ENABLE_NLS
   setlocale(LC_MESSAGES, "");
Index: eggdrop1.7/src/modules.c
diff -u eggdrop1.7/src/modules.c:1.89 eggdrop1.7/src/modules.c:1.90
--- eggdrop1.7/src/modules.c:1.89	Sun Dec  9 21:22:29 2001
+++ eggdrop1.7/src/modules.c	Tue Dec 18 01:04:21 2001
@@ -4,7 +4,7 @@
  * 
  * by Darrin Smith (beldin at light.iinet.net.au)
  * 
- * $Id: modules.c,v 1.89 2001/12/10 03:22:29 guppy Exp $
+ * $Id: modules.c,v 1.90 2001/12/18 07:04:21 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -140,11 +140,7 @@
   /* 0 - 3 */
   (Function) 0,
   (Function) 0,
-#ifdef DEBUG_CONTEXT
-  (Function) eggContext,
-#else
   (Function) 0,
-#endif
   (Function) module_rename,
   /* 4 - 7 */
   (Function) module_register,
@@ -432,11 +428,7 @@
   (Function) 0,
   (Function) xtra_set,
   /* 232 - 235 */
-#ifdef DEBUG_CONTEXT
-  (Function) eggContextNote,
-#else
   (Function) 0,
-#endif
   (Function) 0,
   (Function) allocsock,
   (Function) call_hostbyip,
Index: eggdrop1.7/src/net.c
diff -u eggdrop1.7/src/net.c:1.49 eggdrop1.7/src/net.c:1.50
--- eggdrop1.7/src/net.c:1.49	Sun Oct 28 07:30:33 2001
+++ eggdrop1.7/src/net.c	Tue Dec 18 01:04:21 2001
@@ -2,7 +2,7 @@
  * net.c -- handles:
  *   all raw network i/o
  * 
- * $Id: net.c,v 1.49 2001/10/28 13:30:33 ite Exp $
+ * $Id: net.c,v 1.50 2001/12/18 07:04:21 guppy Exp $
  */
 /* 
  * This is hereby released into the public domain.
@@ -1124,8 +1124,6 @@
 }
 
 /* Dump something to a socket
- * 
- * NOTE: Do NOT put Contexts in here if you want DEBUG to be meaningful!!
  */
 void tputs(register int z, char *s, unsigned int len)
 {
Index: eggdrop1.7/src/proto.h
diff -u eggdrop1.7/src/proto.h:1.58 eggdrop1.7/src/proto.h:1.59
--- eggdrop1.7/src/proto.h:1.58	Thu Oct 18 04:06:43 2001
+++ eggdrop1.7/src/proto.h	Tue Dec 18 01:04:22 2001
@@ -7,7 +7,7 @@
  * because they use structures in those
  * (saves including those .h files EVERY time) - Beldin
  *
- * $Id: proto.h,v 1.58 2001/10/18 09:06:43 stdarg Exp $
+ * $Id: proto.h,v 1.59 2001/12/18 07:04:22 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -163,8 +163,6 @@
 /* main.c */
 void fatal(const char *, int);
 void patch(const char *);
-void eggContext(const char *, int, const char *);
-void eggContextNote(const char *, int, const char *, const char *);
 void backup_userfile(void);
 
 /* misc.c */
----------------------- End of diff -----------------------



More information about the Changes mailing list