[cvslog] (2003-05-13 07:16:28 UTC) Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Tue May 13 01:16:29 CST 2003


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2003-05-13 07:16:28 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Modified files:
     acconfig/acinclude.m4 modules/tclscript/Makefile.am

Removed files:
     lib/eggdrop/module.h lib/eggdrop/modvals.h src/modules.c
     src/modules.h

Log message:

* Added help to error message if tcl isn't found
* Remove some stray files

---------------------- diff included ----------------------
Index: eggdrop1.7/acconfig/acinclude.m4
diff -u eggdrop1.7/acconfig/acinclude.m4:1.31 eggdrop1.7/acconfig/acinclude.m4:1.32
--- eggdrop1.7/acconfig/acinclude.m4:1.31	Sat May 10 21:30:54 2003
+++ eggdrop1.7/acconfig/acinclude.m4	Tue May 13 02:16:18 2003
@@ -1,7 +1,7 @@
 dnl acinclude.m4
 dnl   macros autoconf uses when building configure from configure.in
 dnl
-dnl $Id: acinclude.m4,v 1.31 2003/05/11 02:30:54 stdarg Exp $
+dnl $Id: acinclude.m4,v 1.32 2003/05/13 07:16:18 stdarg Exp $
 dnl
 
 
@@ -740,20 +740,27 @@
 egg_tclscript=no
 
 SC_PATH_TCLCONFIG
-SC_LOAD_TCLCONFIG
+if test x"${no_tcl}" = x ; then
+	SC_LOAD_TCLCONFIG
 
-# We only support version 8
-if test "$TCL_MAJOR_VERSION" = 8
-then
-  AC_SUBST(TCL_PREFIX)
-  egg_tclscript=yes
-else
-  AC_MSG_WARN([
+	# We only support version 8
+	if test "$TCL_MAJOR_VERSION" = 8
+	then
+		AC_SUBST(TCL_PREFIX)
+		AC_SUBST(TCL_LIBS)
+		egg_tclscript=yes
+	else
+		AC_MSG_WARN([
 
-  Your system does not provide tcl 8.0 or later. The
+  Your system does not seem to provide tcl 8.0 or later. The
   tclscript module will therefore be disabled.
 
+  To manually specify tcl's location, re-run configure using
+    --with-tcl=/path/to/tcl
+  where the path is the directory containing tclConfig.sh.
+
 ])
+	fi
 fi
 
 AM_CONDITIONAL(EGG_TCLSCRIPT, test "$egg_tclscript" = yes)
Index: eggdrop1.7/lib/eggdrop/module.h
diff -u eggdrop1.7/lib/eggdrop/module.h:1.44 eggdrop1.7/lib/eggdrop/module.h:removed
--- eggdrop1.7/lib/eggdrop/module.h:1.44	Tue Feb 25 04:28:21 2003
+++ eggdrop1.7/lib/eggdrop/module.h	Tue May 13 02:16:28 2003
@@ -1,96 +0,0 @@
-/*
- * module.h --
- */
-/*
- * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003 Eggheads Development Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-/*
- * $Id: module.h,v 1.44 2003/02/25 10:28:21 stdarg Exp $
- */
-
-#ifndef _EGG_MOD_MODULE_H
-#define _EGG_MOD_MODULE_H
-
-/* FIXME: remove this ugliness ASAP! */
-#define MAKING_MODS
-
-#include "src/main.h"		/* NOTE: when removing this, include config.h */
-
-/* FIXME: filter out files which are not needed (it was easier after removing
-   proto.h and cleaning up main.h to just include all .h files here w/o
-   validating if they aren't needed */
-#include "src/users.h"
-#include "src/bg.h"
-#include "src/chan.h"
-#include "src/cmdt.h"
-#include "src/core_binds.h"
-#include "src/debug.h"
-#include "src/egg.h"
-#include "src/flags.h"
-#include "src/logfile.h"
-#include "src/misc.h"
-#include "src/modules.h"
-#include "src/logfile.h"
-
-/*
- * This file contains all the orrible stuff required to do the lookup
- * table for symbols, rather than getting the OS to do it, since most
- * OS's require all symbols resolved, this can cause a problem with
- * some modules.
- *
- * This is intimately related to the table in `modules.c'. Don't change
- * the files unless you have flamable underwear.
- *
- * Do not read this file whilst unless heavily sedated, I will not be
- * held responsible for mental break-downs caused by this file <G>
- */
-
-/* #undef feof */
-#undef dprintf
-#undef wild_match_per
-#undef maskhost
-#undef maskban
-
-#if defined (__CYGWIN__) 
-#  define EXPORT_SCOPE	__declspec(dllexport)
-#else
-#  define EXPORT_SCOPE
-#endif
-
-/* Redefine for module-relevance */
-
-#define module_rename ((int (*)(char *, char *))egg->global[0])
-#define module_register ((int (*)(char *, Function *, int, int))egg->global[1])
-#define module_find ((module_entry * (*)(char *,int,int))egg->global[2])
-#define module_depend ((Function *(*)(char *,char *,int,int))egg->global[3])
-#define module_undepend ((int(*)(char *))egg->global[4])
-#define egg_timeval_now (*(egg_timeval_t *)egg->global[5])
-#define owner_check ((int (*)(const char *))egg->global[6])
-
-/* This is for blowfish module, couldnt be bothered making a whole new .h
- * file for it ;)
- */
-#ifndef MAKING_ENCRYPTION
-
-#  define encrypt_string(a, b)						\
-	(((char *(*)(char *,char*))encryption_funcs[4])(a,b))
-#  define decrypt_string(a, b)						\
-	(((char *(*)(char *,char*))encryption_funcs[5])(a,b))
-#endif
-
-#endif				/* !_EGG_MOD_MODULE_H */
Index: eggdrop1.7/lib/eggdrop/modvals.h
diff -u eggdrop1.7/lib/eggdrop/modvals.h:1.11 eggdrop1.7/lib/eggdrop/modvals.h:removed
--- eggdrop1.7/lib/eggdrop/modvals.h:1.11	Mon May 12 09:11:42 2003
+++ eggdrop1.7/lib/eggdrop/modvals.h	Tue May 13 02:16:28 2003
@@ -1,96 +0,0 @@
-/*
- * modvals.h --
- */
-/*
- * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003 Eggheads Development Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-/*
- * $Id: modvals.h,v 1.11 2003/05/12 14:11:42 wingman Exp $
- */
-
-#ifndef _EGG_MOD_MODVALS_H
-#define _EGG_MOD_MODVALS_H
-
-/* #define HOOK_GET_FLAGREC	  0 	*/
-/* #define HOOK_BUILD_FLAGREC	  1 	*/
-/* #define HOOK_SET_FLAGREC	  2 	*/
-#define HOOK_READ_USERFILE	  3
-#define HOOK_REHASH		  4
-#define HOOK_MINUTELY		  5
-#define HOOK_DAILY		  6
-#define HOOK_HOURLY		  7
-#define HOOK_USERFILE		  8
-#define HOOK_SECONDLY		  9
-#define HOOK_PRE_REHASH		 10
-#define HOOK_IDLE		 11
-#define HOOK_5MINUTELY		 12
-#define HOOK_LOADED		 13
-#define HOOK_BACKUP     	 14
-#define HOOK_DIE		 15
-#define REAL_HOOKS		 16
-#define HOOK_ENCRYPT_PASS	107
-#define HOOK_QSERV		108
-#define HOOK_ADD_MODE		109
-#define HOOK_MATCH_NOTEREJ	110
-/*#define HOOK_IRCCMP		111*/
-#define HOOK_DNS_HOSTBYIP	112
-#define HOOK_DNS_IPBYHOST	113
-#define HOOK_ENCRYPT_STRING     114
-#define HOOK_DECRYPT_STRING     115
-#define HOOK_STORENOTE		116
-
-/* These are FIXED once they are in a release they STAY
- */
-#define MODCALL_START		  0
-#define MODCALL_CLOSE		  1
-/* MODCALL_EXPMEM (2) - This is no longer used (Tothwolf) */
-#define MODCALL_REPORT		  3
-/* Filesys */
-#define FILESYS_REMOTE_REQ	  4
-#define FILESYS_ADDFILE		  5
-#define FILESYS_INCRGOTS	  6
-#define FILESYS_ISVALID		  7
-/* Channels */
-#define CHANNEL_CLEAR		 15
-/* Server */
-#define SERVER_BOTNAME		  4
-#define SERVER_BOTUSERHOST	  5
-#define SERVER_NICKLEN		 38
-/* IRC */
-#define IRC_RECHECK_CHANNEL	  4
-#define IRC_RECHECK_CHANNEL_MODES 6
-#define IRC_DO_CHANNEL_PART	  7
-#define IRC_CHECK_THIS_BAN	  8
-#define IRC_CHECK_THIS_USER	  9
-/* Notes */
-#define NOTES_CMD_NOTE		  4
-/* Console */
-#define CONSOLE_DOSTORE		  4
-
-#include <ltdl.h>
-
-typedef struct _module_entry {
-  struct _module_entry	*next;
-  char			*name;	/* Name of the module (without .so)	*/
-  int			 major;	/* Major version number MUST match	*/
-  int			 minor;	/* Minor version number MUST be >=	*/
-  lt_dlhandle		hand;
-  Function		*funcs;
-} module_entry;
-
-#endif				/* !_EGG_MOD_MODVALS_H */
Index: eggdrop1.7/modules/tclscript/Makefile.am
diff -u eggdrop1.7/modules/tclscript/Makefile.am:1.7 eggdrop1.7/modules/tclscript/Makefile.am:1.8
--- eggdrop1.7/modules/tclscript/Makefile.am:1.7	Sat May 10 21:30:54 2003
+++ eggdrop1.7/modules/tclscript/Makefile.am	Tue May 13 02:16:18 2003
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.7 2003/05/11 02:30:54 stdarg Exp $
+# $Id: Makefile.am,v 1.8 2003/05/13 07:16:18 stdarg Exp $
 
 # FIXME: optionally allow a system wide install by ignoring the line below.
 pkglibdir		= $(exec_prefix)/modules
@@ -13,7 +13,7 @@
 pkglib_LTLIBRARIES	= $(EGG_TCL)
 tclscript_la_SOURCES	= tclscript.c
 tclscript_la_LDFLAGS	= -module -avoid-version -no-undefined
-tclscript_la_LIBADD	= @TCL_LIB_SPEC@ @LIBS@ \
+tclscript_la_LIBADD	= @TCL_LIBS@ @TCL_LIB_SPEC@ @LIBS@ \
 			$(top_builddir)/lib/eggdrop/libeggdrop.la
 
 MAINTAINERCLEANFILES	= Makefile.in
@@ -22,6 +22,6 @@
 			-I$(top_builddir)/intl -I$(top_srcdir)/intl \
 			-I$(top_builddir)/lib \
 			-I$(top_srcdir)/lib \
-			-I$(TCL_PREFIX)/include
+			-I at TCL_PREFIX@/include
 
 DEFS			= $(EGG_DEBUG) @DEFS@
Index: eggdrop1.7/src/modules.c
diff -u eggdrop1.7/src/modules.c:1.136 eggdrop1.7/src/modules.c:removed
--- eggdrop1.7/src/modules.c:1.136	Mon May 12 09:11:42 2003
+++ eggdrop1.7/src/modules.c	Tue May 13 02:16:28 2003
@@ -1,460 +0,0 @@
-/*
- * modules.c --
- *
- *	support for modules in eggdrop
- *
- * by Darrin Smith (beldin at light.iinet.net.au)
- */
-/*
- * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003 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 lint
-static const char rcsid[] = "$Id: modules.c,v 1.136 2003/05/12 14:11:42 wingman Exp $";
-#endif
-
-#include <eggdrop/eggdrop.h>
-#include "main.h"		/* NOTE: when removing this, include config.h */
-#include "modules.h"
-#include "core_binds.h"
-#include "logfile.h"
-#include "misc.h"
-#include "cmdt.h"		/* cmd_t				*/
-#include "core_binds.h"
-/*#include "cmds.h"*/		/* check_dcc_attrs, check_dcc_chanattrs	*/
-#include <ctype.h>
-#include <ltdl.h>
-
-extern struct dcc_t	*dcc;
-
-extern struct userrec	*userlist, *lastuser;
-extern char myname[], *botname, natip[], origbotname[], botuser[],
-            admin[], userfile[], ver[], notify_new[], helpdir[], version[],
-            quit_msg[];
-extern int dcc_total, egg_numver, userfile_perm, ignore_time, learn_users,
-           raw_log, make_userfile, default_flags, max_dcc, password_timeout,
-           use_invites, use_exempts, force_expire, do_restart,
-           protect_readonly, reserved_port_min, reserved_port_max, copy_to_tmp,
-           quiet_reject;
-extern time_t now, online_since;
-extern egg_timeval_t egg_timeval_now;
-extern struct chanset_t *chanset;
-extern sock_list *socklist;
-
-#ifndef MAKING_MODS
-extern struct dcc_table DCC_CHAT_PASS, DCC_LOST, DCC_DNSWAIT,
-			DCC_CHAT;
-#endif /* MAKING_MODS   */
-
-int xtra_kill();
-int xtra_unpack();
-static int module_rename(char *name, char *newname);
-
-
-/* Directory to look for modules */
-/* FIXME: the default should be the value of $pkglibdir in configure. */
-/* FIXME: support multiple entries. */
-char moddir[121] = "modules/";
-
-
-/* The null functions */
-void null_func()
-{
-}
-char *charp_func()
-{
-  return NULL;
-}
-int minus_func()
-{
-  return -1;
-}
-int false_func()
-{
-  return 0;
-}
-
-
-/*
- *     Various hooks & things
- */
-
-/* The REAL hooks, when these are called, a return of 0 indicates unhandled
- * 1 is handled
- */
-struct hook_entry *hook_list[REAL_HOOKS];
-
-void (*encrypt_pass) (char *, char *) = 0;
-char *(*encrypt_string) (char *, char *) = 0;
-char *(*decrypt_string) (char *, char *) = 0;
-void (*qserver) (int, char *, int) = (void (*)(int, char *, int)) null_func;
-void (*add_mode) () = null_func;
-int (*match_noterej) (struct userrec *, char *) = (int (*)(struct userrec *, char *)) false_func;
-int (*storenote)(char *from, char *to, char *msg, int idx, char *who) = (int (*)(char *from, char *to, char *msg, int idx, char *who)) minus_func;
-
-module_entry *module_list;
-dependancy *dependancy_list = NULL;
-
-/* The horrible global lookup table for functions
- * BUT it makes the whole thing *much* more portable than letting each
- * OS screw up the symbols their own special way :/
- */
-
-Function global_table[] =
-{
-  (Function) module_rename,
-  (Function) module_register,
-  (Function) module_find,
-  (Function) module_depend,
-  (Function) module_undepend,
-  (Function) &egg_timeval_now,
-  owner_check
-};
-
-static bind_table_t *BT_load, *BT_unload;
-
-void modules_init()
-{
-  int i;
-  char wbuf[1024];
-
-  /* FIXME: keep this hack until the global table mess is gone */
-  egg->global = global_table;
-
-  BT_load = bind_table_add("load", 1, "s", MATCH_MASK, 0);
-  BT_unload = bind_table_add("unload", 1, "s", MATCH_MASK, 0);
-
-  module_list = malloc(sizeof(module_entry));
-  module_list->name = strdup("eggdrop");
-  module_list->major = (egg_numver) / 10000;
-  module_list->minor = ((egg_numver) / 100) % 100;
-  module_list->hand = NULL;
-  module_list->next = NULL;
-  module_list->funcs = NULL;
-
-  LTDL_SET_PRELOADED_SYMBOLS();
-  if (lt_dlinit() != 0) {
-    snprintf(wbuf, sizeof(wbuf),
-		    _("error during libtdl initialization: %s\n"),
-		    lt_dlerror());
-    fatal(wbuf, 0);
-  }
-
-  if (moddir[0] != '/') {
-    if (getcwd(wbuf, sizeof(wbuf)) == NULL)
-      fatal(_("Cant determine current directory."), 0);
-    sprintf(&(wbuf[strlen(wbuf)]), "/%s", moddir);
-    if (lt_dladdsearchdir(wbuf)) fatal(_("Invalid module's search path."), 0);
-  } else
-    if (lt_dladdsearchdir(moddir)) fatal(_("Invalid module's search path."), 0);
-
-  for (i = 0; i < REAL_HOOKS; i++)
-    hook_list[i] = NULL;
-}
-
-int module_register(char *name, Function * funcs,
-		    int major, int minor)
-{
-  module_entry *p;
-
-  for (p = module_list; p && p->name; p = p->next)
-    if (!strcasecmp(name, p->name)) {
-      p->major = major;
-      p->minor = minor;
-      p->funcs = funcs;
-      return 1;
-    }
-  return 0;
-}
-
-const char *module_load(char *name)
-{
-  module_entry *p;
-  char *e;
-  Function f;
-  lt_dlhandle hand;
-
-  if (module_find(name, 0, 0) != NULL)
-    return _("Already loaded.");
-  hand = lt_dlopenext(name);
-  if (!hand) {
-    const char *err = lt_dlerror();
-    putlog(LOG_MISC, "*", "Error loading module %s: %s", name, err);
-    return err;
-  }
-
-  f = (Function) lt_dlsym(hand, "start");
-    if (f == NULL) {
-    lt_dlclose(hand);
-      return _("No start function defined.");
-    }
-  p = malloc(sizeof(module_entry));
-  if (p == NULL)
-    return _("Malloc error");
-  p->name = strdup(name);
-  p->major = 0;
-  p->minor = 0;
-  p->hand = hand;
-  p->funcs = 0;
-  p->next = module_list;
-  module_list = p;
-  e = (((char *(*)()) f) (egg));
-  if (e) {
-    module_list = module_list->next;
-    free(p->name);
-    free(p);
-    return e;
-  }
-  bind_check(BT_load, name, name);
-  putlog(LOG_MISC, "*", _("Module loaded: %-16s"), name);
-  return NULL;
-}
-
-char *module_unload(char *name, char *user)
-{
-  module_entry *p = module_list, *o = NULL;
-  char *e;
-  Function *f;
-
-  while (p) {
-    if ((p->name != NULL) && (!strcmp(name, p->name))) {
-      dependancy *d;
-
-      for (d = dependancy_list; d; d = d->next)
-	if (d->needed == p)
-	  return _("Needed by another module");
-
-      f = p->funcs;
-      if (f && !f[MODCALL_CLOSE])
-	return _("No close function");
-      if (f) {
-	bind_check(BT_unload, name, name);
-	e = (((char *(*)()) f[MODCALL_CLOSE]) (user));
-	if (e != NULL)
-	  return e;
-	lt_dlclose(p->hand);
-      }
-      free(p->name);
-      if (o == NULL) {
-	module_list = p->next;
-      } else {
-	o->next = p->next;
-      }
-      free(p);
-      putlog(LOG_MISC, "*", _("Module unloaded: %s"), name);
-      return NULL;
-    }
-    o = p;
-    p = p->next;
-  }
-  return _("No such module");
-}
-
-module_entry *module_find(char *name, int major, int minor)
-{
-  module_entry *p;
-
-  for (p = module_list; p && p->name; p = p->next)
-    if ((major == p->major || !major) && minor <= p->minor &&
-	!strcasecmp(name, p->name))
-      return p;
-  return NULL;
-}
-
-static int module_rename(char *name, char *newname)
-{
-  module_entry *p;
-
-  for (p = module_list; p; p = p->next)
-    if (!strcasecmp(newname, p->name))
-      return 0;
-
-  for (p = module_list; p && p->name; p = p->next)
-    if (!strcasecmp(name, p->name)) {
-      free(p->name);
-      p->name = strdup(newname);
-      return 1;
-    }
-  return 0;
-}
-
-Function *module_depend(char *name1, char *name2, int major, int minor)
-{
-  module_entry *p = module_find(name2, major, minor);
-  module_entry *o = module_find(name1, 0, 0);
-  dependancy *d;
-
-  if (!p) {
-    if (module_load(name2))
-      return 0;
-    p = module_find(name2, major, minor);
-  }
-  if (!p || !o)
-    return 0;
-  d = malloc(sizeof(dependancy));
-
-  d->needed = p;
-  d->needing = o;
-  d->next = dependancy_list;
-  d->major = major;
-  d->minor = minor;
-  dependancy_list = d;
-  return p->funcs ? p->funcs : (Function *) 1;
-}
-
-int module_undepend(char *name1)
-{
-  int ok = 0;
-  module_entry *p = module_find(name1, 0, 0);
-  dependancy *d = dependancy_list, *o = NULL;
-
-  if (p == NULL)
-    return 0;
-  while (d != NULL) {
-    if (d->needing == p) {
-      if (o == NULL) {
-	dependancy_list = d->next;
-      } else {
-	o->next = d->next;
-      }
-      free(d);
-      if (o == NULL)
-	d = dependancy_list;
-      else
-	d = o->next;
-      ok++;
-    } else {
-      o = d;
-      d = d->next;
-    }
-  }
-  return ok;
-}
-
-/* Hooks, various tables of functions to call on ceratin events
- */
-void add_hook(int hook_num, Function func)
-{
-  if (hook_num < REAL_HOOKS) {
-    struct hook_entry *p;
-
-    for (p = hook_list[hook_num]; p; p = p->next)
-      if (p->func == func)
-	return;			/* Don't add it if it's already there */
-    p = malloc(sizeof(struct hook_entry));
-
-    p->next = hook_list[hook_num];
-    hook_list[hook_num] = p;
-    p->func = func;
-  } else
-    switch (hook_num) {
-    case HOOK_ENCRYPT_PASS:
-      encrypt_pass = (void (*)(char *, char *)) func;
-      break;
-    case HOOK_ENCRYPT_STRING:
-      encrypt_string = (char *(*)(char *, char *)) func;
-      break;
-    case HOOK_DECRYPT_STRING:
-      decrypt_string = (char *(*)(char *, char *)) func;
-      break;
-    case HOOK_QSERV:
-      if (qserver == (void (*)(int, char *, int)) null_func)
-	qserver = (void (*)(int, char *, int)) func;
-      break;
-    case HOOK_ADD_MODE:
-      if (add_mode == (void (*)()) null_func)
-	add_mode = (void (*)()) func;
-      break;
-    case HOOK_MATCH_NOTEREJ:
-      if (match_noterej == (int (*)(struct userrec *, char *))false_func)
-	match_noterej = func;
-      break;
-    case HOOK_STORENOTE:
-	if (func == NULL) storenote = (int (*)(char *from, char *to, char *msg, int idx, char *who)) minus_func;
-	else storenote = func;
-	break;
-    }
-}
-
-void del_hook(int hook_num, Function func)
-{
-  if (hook_num < REAL_HOOKS) {
-    struct hook_entry *p = hook_list[hook_num], *o = NULL;
-
-    while (p) {
-      if (p->func == func) {
-	if (o == NULL)
-	  hook_list[hook_num] = p->next;
-	else
-	  o->next = p->next;
-	free(p);
-	break;
-      }
-      o = p;
-      p = p->next;
-    }
-  } else
-    switch (hook_num) {
-    case HOOK_ENCRYPT_PASS:
-      if (encrypt_pass == (void (*)(char *, char *)) func)
-	encrypt_pass = (void (*)(char *, char *)) null_func;
-      break;
-    case HOOK_ENCRYPT_STRING:
-      if (encrypt_string == (char *(*)(char *, char *)) func)
-        encrypt_string = (char *(*)(char *, char *)) null_func;
-      break;
-    case HOOK_DECRYPT_STRING:
-      if (decrypt_string == (char *(*)(char *, char *)) func)
-        decrypt_string = (char *(*)(char *, char *)) null_func;
-      break;
-    case HOOK_QSERV:
-      if (qserver == (void (*)(int, char *, int)) func)
-	qserver = null_func;
-      break;
-    case HOOK_ADD_MODE:
-      if (add_mode == (void (*)()) func)
-	add_mode = null_func;
-      break;
-    case HOOK_MATCH_NOTEREJ:
-      if (match_noterej == (int (*)(struct userrec *, char *))func)
-	match_noterej = false_func;
-      break;
-    case HOOK_STORENOTE:
-	if (storenote == func) storenote = (int (*)(char *from, char *to, char *msg, int idx, char *who)) minus_func;
-	break;
-    }
-}
-
-int call_hook_cccc(int hooknum, char *a, char *b, char *c, char *d)
-{
-  struct hook_entry *p, *pn;
-  int f = 0;
-
-  if (hooknum >= REAL_HOOKS)
-    return 0;
-  p = hook_list[hooknum];
-  for (p = hook_list[hooknum]; p && !f; p = pn) {
-    pn = p->next;
-    f = p->func(a, b, c, d);
-  }
-  return f;
-}
-
-void do_module_report(int idx, int details, char *which)
-{
-}
Index: eggdrop1.7/src/modules.h
diff -u eggdrop1.7/src/modules.h:1.18 eggdrop1.7/src/modules.h:removed
--- eggdrop1.7/src/modules.h:1.18	Fri Feb 14 14:55:02 2003
+++ eggdrop1.7/src/modules.h	Tue May 13 02:16:28 2003
@@ -1,79 +0,0 @@
-/*
- * modules.h --
- *
- *	support for modules in eggdrop
- *
- * by Darrin Smith (beldin at light.iinet.net.au)
- */
-/*
- * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002, 2003 Eggheads Development Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-/*
- * $Id: modules.h,v 1.18 2003/02/14 20:55:02 stdarg Exp $
- */
-
-#ifndef _EGG_MODULE_H
-#define _EGG_MODULE_H
-
-/* Module related structures
- */
-#include <eggdrop/modvals.h>
-
-#ifndef MAKING_NUMMODS
-
-/* Modules specific functions and functions called by eggdrop
- */
-extern void modules_init();
-extern void do_module_report(int, int, char *);
-extern int module_register(char *name, Function * funcs,
-		    int major, int minor);
-extern const char *module_load(char *module_name);
-extern char *module_unload(char *module_name, char *nick);
-extern module_entry *module_find(char *name, int, int);
-extern Function *module_depend(char *, char *, int major, int minor);
-extern int module_undepend(char *);
-extern void add_hook(int hook_num, Function func);
-extern void del_hook(int hook_num, Function func);
-extern void *get_next_hook(int hook_num, void *func);
-struct hook_entry {
-  struct hook_entry *next;
-  int (*func) ();
-} *hook_list[REAL_HOOKS];
-
-#define call_hook(x) do {					\
-	register struct hook_entry *p, *pn;			\
-								\
-	for (p = hook_list[x]; p; p = pn) {			\
-		pn = p->next;					\
-		p->func();					\
-	}							\
-} while (0)
-extern int call_hook_cccc(int, char *, char *, char *, char *);
-
-#endif
-
-typedef struct _dependancy {
-  struct _module_entry *needed;
-  struct _module_entry *needing;
-  struct _dependancy *next;
-  int major;
-  int minor;
-} dependancy;
-extern dependancy *dependancy_list;
-
-#endif				/* !_EGG_MODULE_H */
----------------------- End of diff -----------------------


More information about the Changes mailing list