Переглянути джерело

* Finished removing all the modules.
* Added hooks.[c|h]


svn: 805

Bryan Drewery 22 роки тому
батько
коміт
f3776a3410
78 змінених файлів з 316 додано та 2076 видалено
  1. 1 1
      src/Makefile.in
  2. 0 1
      src/auth.c
  3. 0 3
      src/auth.h
  4. 0 2
      src/bg.h
  5. 3 4
      src/botcmd.c
  6. 0 3
      src/botcmd.h
  7. 0 3
      src/botmsg.h
  8. 0 3
      src/botnet.h
  9. 0 1
      src/cfg.c
  10. 0 2
      src/cfg.h
  11. 1 1
      src/chanprog.c
  12. 0 3
      src/chanprog.h
  13. 3 3
      src/cmds.c
  14. 0 4
      src/cmds.h
  15. 0 3
      src/conf.h
  16. 0 2
      src/core_binds.h
  17. 0 3
      src/crypt.h
  18. 0 1
      src/dcc.c
  19. 0 3
      src/dcc.h
  20. 1 4
      src/dccutil.c
  21. 0 2
      src/dccutil.h
  22. 0 2
      src/debug.h
  23. 0 4
      src/flags.h
  24. 85 0
      src/hooks.c
  25. 37 0
      src/hooks.h
  26. 0 3
      src/log.h
  27. 6 7
      src/main.c
  28. 0 2
      src/main.h
  29. 1 1
      src/misc.c
  30. 0 3
      src/misc.h
  31. 0 2
      src/misc_file.h
  32. 1 1
      src/mod/channels.mod/Makefile
  33. 1 2
      src/mod/channels.mod/channels.c
  34. 0 2
      src/mod/channels.mod/channels.h
  35. 1 1
      src/mod/compress.mod/Makefile
  36. 10 37
      src/mod/compress.mod/compress.c
  37. 3 9
      src/mod/compress.mod/compress.h
  38. 1 1
      src/mod/console.mod/Makefile
  39. 0 1
      src/mod/console.mod/console.c
  40. 1 1
      src/mod/ctcp.mod/Makefile
  41. 0 2
      src/mod/ctcp.mod/ctcp.c
  42. 1 1
      src/mod/dns.mod/Makefile.in
  43. 0 2
      src/mod/dns.mod/dns.c
  44. 1 1
      src/mod/irc.mod/Makefile
  45. 3 4
      src/mod/irc.mod/irc.c
  46. 1 3
      src/mod/irc.mod/irc.h
  47. 2 2
      src/mod/irc.mod/mode.c
  48. 0 565
      src/mod/module.h
  49. 0 88
      src/mod/modvals.h
  50. 1 1
      src/mod/notes.mod/Makefile
  51. 0 9
      src/mod/notes.mod/notes.c
  52. 1 1
      src/mod/server.mod/Makefile
  53. 2 4
      src/mod/server.mod/server.c
  54. 1 0
      src/mod/server.mod/server.h
  55. 1 1
      src/mod/share.mod/Makefile
  56. 19 39
      src/mod/share.mod/share.c
  57. 4 10
      src/mod/share.mod/share.h
  58. 1 41
      src/mod/share.mod/uf_features.c
  59. 3 10
      src/mod/static.h
  60. 1 1
      src/mod/transfer.mod/Makefile
  61. 30 97
      src/mod/transfer.mod/transfer.c
  62. 4 10
      src/mod/transfer.mod/transfer.h
  63. 1 1
      src/mod/update.mod/Makefile
  64. 0 3
      src/mod/update.mod/update.c
  65. 0 840
      src/modules.c
  66. 0 60
      src/modules.h
  67. 0 5
      src/net.h
  68. 76 95
      src/rfc1459.c
  69. 4 13
      src/rfc1459.h
  70. 0 1
      src/shell.c
  71. 0 4
      src/shell.h
  72. 0 6
      src/tandem.h
  73. 0 6
      src/tclhash.h
  74. 0 2
      src/userent.h
  75. 1 1
      src/userrec.c
  76. 0 4
      src/userrec.h
  77. 2 7
      src/users.c
  78. 0 5
      src/users.h

+ 1 - 1
src/Makefile.in

@@ -31,12 +31,12 @@ OBJS = auth.o \
 	egg_timer.o \
 	flags.o \
 	garble.o \
+	hooks.o \
 	log.o \
 	main.o \
 	match.o \
 	misc.o \
 	misc_file.o \
-	modules.o \
 	net.o \
 	rfc1459.o \
 	settings.o \

+ 0 - 1
src/auth.c

@@ -19,7 +19,6 @@
 #include <fcntl.h>
 #include "chan.h"
 #include "tandem.h"
-#include "modules.h"
 #include <pwd.h>
 #include <errno.h>
 

+ 0 - 3
src/auth.h

@@ -18,7 +18,6 @@ struct auth_t {
 };
 #endif /* S_AUTHCMDS */
 
-#ifndef MAKING_MODS
 # ifdef S_AUTHCMDS
 int new_auth();
 int findauth(char *);
@@ -37,6 +36,4 @@ extern struct auth_t		*auth;
 extern char                     authkey[121];
 #endif /* S_AUTHHASH || S_DCCAUTH */
 
-#endif /* !MAKING_MODS */
-
 #endif /* !_AUTH_H */

+ 0 - 2
src/bg.h

@@ -1,11 +1,9 @@
 #ifndef _BG_H
 #define _BG_H
 
-#ifndef MAKING_MODS
 extern time_t 		lastfork;
 
 void do_fork();
 void bg_do_split();
-#endif /* !MAKING_MODS */
 
 #endif /* !_BG_H */

+ 3 - 4
src/botcmd.c

@@ -24,7 +24,6 @@
 #include "tandem.h"
 #include "users.h"
 #include "chan.h"
-#include "modules.h"
 #include "core_binds.h"
 
 int remote_boots = 2;
@@ -1271,7 +1270,6 @@ void bot_shareupdate(int idx, char *par)
 static void bot_versions(int sock, char *par)
 {
   char *frombot = newsplit(&par), *tobot = NULL, *from = NULL;
-  module_entry *me = NULL;
 
   if (nextbot(frombot) != sock)
     fake_alert(sock, "versions-direction", frombot);
@@ -1281,9 +1279,10 @@ static void bot_versions(int sock, char *par)
   } else {
     from = newsplit(&par);
     botnet_send_priv(sock, conf.bot->nick, from, frombot, "Modules loaded:\n");
+/* wtf?
     for (me = module_list; me; me = me->next)
-      botnet_send_priv(sock, conf.bot->nick, from, frombot, "  Module: %s\n",
-		       me->name);
+      botnet_send_priv(sock, conf.bot->nick, from, frombot, "  Module: %s\n", me->name);
+*/
     botnet_send_priv(sock, conf.bot->nick, from, frombot, "End of module list.\n");
   }
 }

+ 0 - 3
src/botcmd.h

@@ -1,8 +1,6 @@
 #ifndef _BOTCMD_H
 #define _BOTCMD_H
 
-
-#ifndef MAKING_MODS
 extern int		remote_boots;
 
 void bounce_simul(int, char *);
@@ -10,6 +8,5 @@ void send_remote_simul(int, char *, char *, char *);
 void bot_share(int, char *);
 void bot_shareupdate(int, char *);
 int base64_to_int(char *);
-#endif /* !MAKING_MODS */
 
 #endif /* !_BOTCMD_H */

+ 0 - 3
src/botmsg.h

@@ -13,8 +13,6 @@
 #define NOTE_AWAY       5       /* away; stored                 */
 #define NOTE_FWD        6       /* away; forwarded              */
 
-
-#ifndef MAKING_MODS
 void botnet_send_cfg(int idx, struct cfg_entry *entry);
 void botnet_send_cfg_broad(int idx, struct cfg_entry *entry);
 void putbot(char *, char *);
@@ -25,7 +23,6 @@ void tandout_but (int, ...);
 char *int_to_base10(int);
 char *unsigned_int_to_base10(unsigned int);
 char *int_to_base64(unsigned int);
-#endif /* !MAKING_MODS */
 
 #endif /* !_BOTMSG_H */
 

+ 0 - 3
src/botnet.h

@@ -7,8 +7,6 @@
 
 #include "tandem.h"
 
-#ifndef MAKING_MODS
-
 extern tand_t		*tandbot;
 extern party_t		*party;
 extern int		tands;
@@ -45,6 +43,5 @@ void botnet_send_cmdpass(int, char *, char *);
 void zapfbot(int);
 void tandem_relay(int, char *, int);
 int getparty(char *, int);
-#endif /* !MAKING_MODS */
 
 #endif /* !_BOTNET_H */

+ 0 - 1
src/cfg.c

@@ -19,7 +19,6 @@
 #include <fcntl.h>
 #include "chan.h"
 #include "tandem.h"
-#include "modules.h"
 #ifdef S_DCCPASS
 #include "botnet.h"
 #endif /* S_DCCPASS */

+ 0 - 2
src/cfg.h

@@ -52,7 +52,6 @@ struct cfg_entry CFG_FIGHTTHRESHOLD;
 #endif /* S_AUTOLOCK */
 #endif /* HUB */
 
-#ifndef MAKING_MODS
 void set_cfg_str(char *, char *, char *);
 void add_cfg(struct cfg_entry *);
 void got_config_share(int, char *, int);
@@ -69,6 +68,5 @@ extern struct cmd_pass            *cmdpass;
 extern char			cmdprefix[];
 extern int			cfg_count, cfg_noshare;
 extern struct cfg_entry		**cfg;
-#endif /* MAKING_MODS */
 
 #endif /* !_CFG_H */

+ 1 - 1
src/chanprog.c

@@ -29,7 +29,7 @@
 #endif
 #endif
 #include <sys/utsname.h>
-#include "modules.h"
+#include "hooks.h"
 
 struct chanset_t 	*chanset = NULL;	/* Channel list			*/
 char 			admin[121] = "";	/* Admin info			*/

+ 0 - 3
src/chanprog.h

@@ -6,7 +6,6 @@
 #define DO_LOCAL	1
 #define DO_NET		2
 
-#ifndef MAKING_MODS
 extern struct chanset_t *chanset;
 extern char botname[];
 
@@ -35,6 +34,4 @@ extern char			admin[], origbotname[], botname[];
 extern int			my_port;
 #endif /* HUB */
 
-#endif /* !MAKING_MODS */
-
 #endif /* !_CHANPROG_H */

+ 3 - 3
src/cmds.c

@@ -27,7 +27,6 @@
 #include "botcmd.h"	
 #include "botnet.h"
 #include "tandem.h"
-#include "modules.h"
 #include "help.h"
 #include "traffic.h" /* egg_traffic_t */
 #include "core_binds.h"
@@ -1101,11 +1100,12 @@ static void cmd_status(struct userrec *u, int idx, char *par)
     tell_verbose_status(idx);
     dprintf(idx, "\n");
     tell_settings(idx);
-    do_module_report(idx, 1, NULL);
+/* FIXME: call the _report functions here */
+    /* do_module_report(idx, 1, NULL); */
   } else {
     putlog(LOG_CMDS, "*", STR("#%s# status"), dcc[idx].nick);
     tell_verbose_status(idx);
-    do_module_report(idx, 0, NULL);
+    /* do_module_report(idx, 0, NULL); */
   }
 }
 

+ 0 - 4
src/cmds.h

@@ -29,18 +29,14 @@ typedef struct cmd_pass {
 #endif
 
 
-#ifndef MAKING_MODS
-
 extern mycmds 		cmdlist[]; 
 extern int		cmdi;
 
-
 int check_dcc_attrs(struct userrec *, int);
 int check_dcc_chanattrs(struct userrec *, char *, int, int);
 int stripmodes(char *);
 char *stripmasktype(int);
 void gotremotecmd(char * forbot, char * frombot, char * fromhand, char * fromidx, char * cmd);
 void gotremotereply(char * frombot, char * tohand, char * toidx, char * ln);
-#endif /* !MAKING_MODS */
 
 #endif /* !_CMDS_H */

+ 0 - 3
src/conf.h

@@ -44,8 +44,6 @@ enum {
 };
 
 
-#ifndef MAKING_MODS
-
 #ifdef LEAF
 void spawnbots();
 int killbot(char *);
@@ -61,6 +59,5 @@ int readconf(char *);
 int parseconf();
 int writeconf(char *, FILE *, int);
 void fillconf(conf_t *);
-#endif /* !MAKING_MODS */
 
 #endif /* !_CONF_H */

+ 0 - 2
src/core_binds.h

@@ -1,7 +1,6 @@
 #ifndef _CORE_BINDS_H_
 #define _CORE_BINDS_H_
 
-#ifndef MAKING_MODS
 void core_binds_init();
 void check_bind_time(struct tm *tm);
 void check_bind_dcc(const char *, int, const char *);
@@ -18,5 +17,4 @@ void check_bind_act(const char *, int, const char *);
 void check_bind_bcst(const char *, int, const char *);
 void check_bind_chon(char *, int);
 void check_bind_chof(char *, int);
-#endif /* !MAKING_MODS */
 #endif /* !_CORE_BINDS_H */

+ 0 - 3
src/crypt.h

@@ -20,8 +20,6 @@
 #define MD5_HASH_LENGTH (MD5_DIGEST_LENGTH * 2)
 #define md5cmp(hash, string)            strcmp(hash, MD5(string))
 
-
-#ifndef MAKING_MODS
 char *MD5(const char *);
 char *SHA1(const char *);
 char *encrypt_string(const char *, char *);
@@ -32,6 +30,5 @@ char *decryptit (char *);
 int lfprintf (FILE *, ...);
 void EncryptFile(char *, char *);
 void DecryptFile(char *, char *);
-#endif /* !MAKING_MODS */
 
 #endif /* !_CRYPT_H */

+ 0 - 1
src/dcc.c

@@ -30,7 +30,6 @@
 #include "botnet.h"
 #include <ctype.h>
 #include <errno.h>
-#include "modules.h"
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>

+ 0 - 3
src/dcc.h

@@ -205,8 +205,6 @@ struct dupwait_info {
 #define TLN_ECHO        1               /* Echo                 */
 #define TLN_ECHO_C      "\001"
 
-#ifndef MAKING_MODS
-
 extern struct dcc_t 		*dcc;
 extern int 			dcc_total, timesync;
 extern char			network[];
@@ -220,6 +218,5 @@ void send_timesync(int);
 void failed_link(int);
 void dupwait_notify(char *);
 char *rand_dccresp();
-#endif /* !MAKING_MODS */
 
 #endif /* !_DCC_H */

+ 1 - 4
src/dccutil.c

@@ -20,7 +20,6 @@
 #include "botcmd.h"
 #include <errno.h>
 #include "chan.h"
-#include "modules.h"
 #include "tandem.h"
 #include "core_binds.h"
 #include "src/mod/server.mod/server.h"
@@ -70,8 +69,6 @@ char *add_cr(char *buf)
   return WBUF;
 }
 
-extern void (*qserver) (int, char *, int);
-
 void dprintf (int idx, ...)
 {
   static char buf[1024] = "";
@@ -133,7 +130,7 @@ void dprintf (int idx, ...)
 #ifdef HUB
      return;
 #endif /* HUB */
-      qserver(idx, buf, len);
+      queue_server(idx, buf, len);
       break;
     }
     return;

+ 0 - 2
src/dccutil.h

@@ -26,7 +26,6 @@ struct portmap {
 #define DP_HELP_NEXT    0x7FF9
 
 
-#ifndef MAKING_MODS
 void dprintf (int, ...);
 void chatout (char *, ...);
 void chanout_but (int, ...);
@@ -47,6 +46,5 @@ void do_boot(int, char *, char *);
 int detect_dcc_flood(time_t *, struct chat_info *, int);
 
 extern int		max_dcc, connect_timeout;
-#endif /* !MAKING_MODS */
 
 #endif /* !_DCCUTIL_H */

+ 0 - 2
src/debug.h

@@ -53,7 +53,6 @@
 #define debug4(x,a1,a2,a3,a4)   putlog(LOG_DEBUG,"*",x,a1,a2,a3,a4)
 
 
-#ifndef MAKING_MODS
 extern int		sdebug;
 
 void sdprintf (char *, ...);
@@ -62,6 +61,5 @@ void init_debug();
 void eggContext(const char *, int, const char *);
 void eggContextNote(const char *, int, const char *, const char *);
 void eggAssert(const char *, int, const char *);
-#endif /* !MAKING_MODS */
 
 #endif /* !_DEBUG_H */

+ 0 - 4
src/flags.h

@@ -181,8 +181,6 @@ struct flag_record {
 #define bot_chan(x)		((x).chan & BOT_AGGRESSIVE)
 #define bot_shared(x)		((x).bot & BOT_SHARE)
 
-#ifndef MAKING_MODS
-
 void get_user_flagrec(struct userrec *, struct flag_record *, const char *);
 void set_user_flagrec(struct userrec *, struct flag_record *, const char *);
 void break_down_flags(const char *, struct flag_record *, struct flag_record *);
@@ -205,6 +203,4 @@ int dovoice(struct chanset_t *);
 int dolimit(struct chanset_t *);
 int whois_access(struct userrec *, struct userrec *);
 
-#endif				/* MAKING_MODS */
-
 #endif				/* _EGG_FLAGS_H */

+ 85 - 0
src/hooks.c

@@ -0,0 +1,85 @@
+/*
+ * hook.c -- handles:
+ *
+ * hooks
+ *
+ */
+
+#include "common.h"
+#include "hooks.h"
+
+
+/*
+ *     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
+hooks_init()
+{
+  int i;
+
+  for (i = 0; i < REAL_HOOKS; i++)
+    hook_list[i] = NULL;
+}
+
+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;
+}
+
+
+/* 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 = NULL;
+
+    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 = calloc(1, sizeof(struct hook_entry));
+
+    p->next = hook_list[hook_num];
+    hook_list[hook_num] = p;
+    p->func = func;
+  }
+}
+
+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;
+    }
+  }
+}

+ 37 - 0
src/hooks.h

@@ -0,0 +1,37 @@
+#ifndef _HOOKS_H
+#define _HOOKS_H
+
+#include "types.h"
+
+#define HOOK_READ_USERFILE        1
+#define HOOK_REHASH               2
+#define HOOK_USERFILE             3
+#define HOOK_PRE_REHASH           4
+#define HOOK_IDLE                 5
+#define HOOK_BACKUP               6
+#define HOOK_DIE                  7
+#define HOOK_DAILY                8
+#define REAL_HOOKS                9
+
+#define HOOK_RFC_CASECMP        111
+
+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)
+
+void hooks_init();
+void add_hook(int, Function);
+void del_hook(int, Function);
+int call_hook_cccc(int, char *, char *, char *, char *);
+
+#endif /* !_HOOKS_H */

+ 0 - 3
src/log.h

@@ -35,8 +35,6 @@
 #define LOG_BOTSHARE 0x400000   /* h   share traffic                    */
 #define LOG_ALL      0x7fffff   /* (dump to all logfiles)               */
 
-
-#ifndef MAKING_MODS
 inline void logidx(int, char *, ...);
 void putlog (int, char *, char *, ...);
 int logmodes(char *);
@@ -44,6 +42,5 @@ char *masktype(int);
 char *maskname(int);
 
 extern int		conmask, debug_output, use_console_r;
-#endif /* !MAKING_MODS */
 
 #endif /* !_LOG_H */

+ 6 - 7
src/main.c

@@ -8,6 +8,7 @@
 
 #include "common.h"
 #include "main.h"
+#include "hooks.h"
 #include "dcc.h"
 #include "misc.h"
 #include "settings.h"
@@ -41,7 +42,6 @@
 #include <sys/stat.h>
 
 #include "chan.h"
-#include "modules.h"
 #include "tandem.h"
 #include "egg_timer.h"
 #include "core_binds.h"
@@ -618,7 +618,7 @@ static void startup_checks() {
 #include "mod/static.h"
 
 int init_dcc_max(), init_userent(), init_auth(), init_config(), init_bots(),
- init_net(), init_modules(), init_botcmd();
+ init_net(), init_botcmd();
 
 int main(int argc, char **argv)
 {
@@ -667,18 +667,17 @@ int main(int argc, char **argv)
 
   /* just load everything now, won't matter if it's loaded if the bot has to suicide on startup */
   init_settings();
+  hooks_init();
   binds_init();
   core_binds_init();
   init_dcc_max();
   init_userent();
   init_bots();
   init_net();
-  init_modules();
   init_auth();
   init_config();
   init_botcmd();
   init_conf();
-  link_statics();
 
   if (argc) {
     sdprintf(STR("Calling dtx_arg with %d params."), argc);
@@ -705,13 +704,13 @@ int main(int argc, char **argv)
   server_init();
   irc_init();
 #endif /* LEAF */
-  module_load("transfer");
-  module_load("share");
+  transfer_init();
+  share_init();
   update_init();
   notes_init();
   console_init();
   ctcp_init();
-  module_load("compress");
+  compress_init();
   chanprog();
 
 

+ 0 - 2
src/main.h

@@ -3,7 +3,6 @@
 
 #include <sys/types.h>
 
-#ifndef MAKING_MODS
 extern int		localhub, role, loading, default_flags, default_uflags,
 			backgrd, term_z, updating, use_stderr, do_restart;
 extern char		tempdir[], *binname, owner[], version[], ver[], quit_msg[];
@@ -13,6 +12,5 @@ extern const time_t	buildts;
 extern const char	egg_version[];
 
 void fatal(const char *, int);
-#endif /* !MAKING_MODS */
 
 #endif /* !_MAIN_H */

+ 1 - 1
src/misc.c

@@ -24,7 +24,7 @@
 #include "bg.h"	
 #include "chan.h"
 #include "tandem.h"
-#include "modules.h"
+#include "hooks.h"
 #ifdef LEAF
 #include "src/mod/server.mod/server.h"
 #include "src/mod/irc.mod/irc.h"

+ 0 - 3
src/misc.h

@@ -28,8 +28,6 @@
 #define KICK_MEAN 		14
 #define KICK_BOGUSKEY 		15
 
-
-#ifndef MAKING_MODS
 char *wbanner();
 char *color(int, int, int);
 void shuffle(char *, char *);
@@ -71,7 +69,6 @@ void kill_bot(char *, char *);
 
 extern char		kickprefix[], bankickprefix[];
 extern int		server_lag, use_invites, use_exempts;
-#endif /* !MAKING_MODS */
 
 #endif /* !_MISC_H_ */
 

+ 0 - 2
src/misc_file.h

@@ -7,7 +7,6 @@
 #ifndef _EGG_MISC_FILE_H
 #define _EGG_MISC_FILE_H
 
-#ifndef MAKING_MODS
 int copyfile(char *, char *);
 int movefile(char *, char *);
 int is_file(const char *);
@@ -16,6 +15,5 @@ int can_lstat(const char *);
 int is_symlink(const char *);
 int is_dir(const char *);
 int fixmod(const char *);
-#endif /* !MAKING_MODS */
 
 #endif				/* _EGG_MISC_FILE_H */

+ 1 - 1
src/mod/channels.mod/Makefile

@@ -19,7 +19,7 @@ static: ../channels.o
 ../channels.o:
 	@echo -e "Compiling: \033[1mchannels\033[0m"
 	@source='channels.c' object='$@' depfile='.deps/channels.Po' tmpdepfile='.deps/channels.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DMAKING_MODS -c $(srcdir)/channels.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/channels.c
 	@rm -f ../channels.o
 	@mv channels.o ../
 

+ 1 - 2
src/mod/channels.mod/channels.c

@@ -4,10 +4,9 @@
  *
  */
 
-#undef MAKING_MODS
 #define MAKING_CHANNELS
 #include "src/common.h"
-#include "src/modules.h"
+#include "src/hooks.h"
 #include "src/mod/share.mod/share.h"
 #ifdef LEAF
 #include "src/mod/irc.mod/irc.h"

+ 0 - 2
src/mod/channels.mod/channels.h

@@ -17,8 +17,6 @@
 
 #ifdef MAKING_CHANNELS
 
-#define add_mode real_add_mode
-
 /* Structure for udef channel values. Udef setting have one such
  * structure for each channel where they have a defined value.
  */

+ 1 - 1
src/mod/compress.mod/Makefile

@@ -19,7 +19,7 @@ static: ../compress.o
 ../compress.o:
 	@echo -e "Compiling: \033[1mcompress\033[0m"
 	@source='compress.c' object='$@' depfile='.deps/compress.Po' tmpdepfile='.deps/compress.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DMAKING_MODS -c $(srcdir)/compress.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/compress.c
 	@rm -f ../compress.o
 	@mv compress.o ../
 

+ 10 - 37
src/mod/compress.mod/compress.c

@@ -26,7 +26,10 @@
  */
 
 #define MODULE_NAME "compress"
-#define MAKING_COMPRESS
+
+#include "src/common.h"
+#include "src/misc_file.h"
+#include "src/misc.h"
 
 #define free_func zlib_free_func
 #include <zlib.h>
@@ -34,7 +37,6 @@
 #include <string.h>
 #include <errno.h>
 
-#include "src/mod/module.h"
 #include "src/mod/share.mod/share.h"
 
 #ifdef HAVE_MMAP
@@ -46,8 +48,6 @@
 
 #define BUFLEN	512
 
-static Function *global = NULL, *share_funcs = NULL;
-
 static unsigned int compressed_files;	/* Number of files compressed.      */
 static unsigned int uncompressed_files;	/* Number of files uncompressed.    */
 static unsigned int share_compressed;	/* Compress userfiles when sharing? */
@@ -56,8 +56,8 @@ static unsigned int compress_level;	/* Default compression used.	    */
 
 static int uncompress_to_file(char *f_src, char *f_target);
 static int compress_to_file(char *f_src, char *f_target, int mode_num);
-static int compress_file(char *filename, int mode_num);
-static int uncompress_file(char *filename);
+int compress_file(char *filename, int mode_num);
+int uncompress_file(char *filename);
 static int is_compressedfile(char *filename);
 
 
@@ -279,7 +279,7 @@ static int compress_to_file(char *f_src, char *f_target, int mode_num)
 
 /* Compresses a file `filename' and saves it as `filename'.
  */
-static int compress_file(char *filename, int mode_num)
+int compress_file(char *filename, int mode_num)
 {
   char *temp_fn = NULL, randstr[5] = "";
   int ret;
@@ -305,7 +305,7 @@ static int compress_file(char *filename, int mode_num)
 
 /* Uncompresses a file `filename' and saves it as `filename'.
  */
-static int uncompress_file(char *filename)
+int uncompress_file(char *filename)
 {
   char *temp_fn = NULL, randstr[5] = "";
   int ret;
@@ -363,7 +363,7 @@ static uff_table_t compress_uff_table[] = {
  *    Compress module related code
  */
 
-static int compress_report(int idx, int details)
+int compress_report(int idx, int details)
 {
   if (details) {
 
@@ -376,39 +376,12 @@ static int compress_report(int idx, int details)
   return 0;
 }
 
-EXPORT_SCOPE char *compress_start();
-
-static Function compress_table[] =
-{
-  /* 0 - 3 */
-  (Function) compress_start,
-  (Function) NULL,
-  (Function) 0,
-  (Function) compress_report,
-  /* 4 - 7 */
-  (Function) compress_to_file,
-  (Function) compress_file,
-  (Function) uncompress_to_file,
-  (Function) uncompress_file,
-  /* 8 - 11 */
-  (Function) is_compressedfile,
-};
-
-char *compress_start(Function *global_funcs)
+void compress_init()
 {
-  global = global_funcs;
   compressed_files	= 0;
   uncompressed_files	= 0;
   share_compressed	= 0;
   compress_level	= 9;
 
-  module_register(MODULE_NAME, compress_table, 1, 1);
-  share_funcs = module_depend(MODULE_NAME, "share", 2, 3);
-  if (!share_funcs) {
-    module_undepend(MODULE_NAME);
-    return "This module requires share module 2.3 or later.";
-  }
-
   uff_addtable(compress_uff_table);
-  return NULL;
 }

+ 3 - 9
src/mod/compress.mod/compress.h

@@ -38,14 +38,8 @@ typedef enum {
 } compf_type;
 
 
-#ifndef MAKING_COMPRESS
-/* 4 - 7 */
-# define compress_to_file   ((int (*)(char *, char *, int))(compress_funcs[4]))
-# define compress_file	    ((int (*)(char *, int))(compress_funcs[5]))
-# define uncompress_to_file ((int (*)(char *, char *))(uncompress_funcs[6]))
-# define uncompress_file    ((int (*)(char *))(uncompress_funcs[7]))
-/* 8 - 11 */
-# define is_compressedfile  ((int (*)(char *))(uncompress_funcs[8]))
-#endif /* !MAKING_COMPRESS */
+int compress_file(char *, int);
+int uncompress_file(char *);
+int compress_report(int, int);
 
 #endif /* !_EGG_MOD_COMPRESS_COMPRESS_H */

+ 1 - 1
src/mod/console.mod/Makefile

@@ -19,7 +19,7 @@ static: ../console.o
 ../console.o:
 	@echo -e "Compiling: \033[1mconsole\033[0m"
 	@source='console.c' object='$@' depfile='.deps/console.Po' tmpdepfile='.deps/console.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DMAKING_MODS -c $(srcdir)/console.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/console.c
 	@rm -f ../console.o
 	@mv console.o ../
 

+ 0 - 1
src/mod/console.mod/console.c

@@ -5,7 +5,6 @@
  *
  */
 
-#undef MAKING_MODS
 #include "console.h"
 #include "src/common.h"
 #include "src/mod/share.mod/share.h"

+ 1 - 1
src/mod/ctcp.mod/Makefile

@@ -19,7 +19,7 @@ static: ../ctcp.o
 ../ctcp.o:
 	@echo -e "Compiling: \033[1mctcp\033[0m"
 	@source='ctcp.c' object='$@' depfile='.deps/ctcp.Po' tmpdepfile='.deps/ctcp.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DMAKING_MODS -c $(srcdir)/ctcp.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/ctcp.c
 	@rm -f ../ctcp.o
 	@mv ctcp.o ../
 

+ 0 - 2
src/mod/ctcp.mod/ctcp.c

@@ -4,7 +4,6 @@
  *
  */
 
-#undef MAKING_MODS /* TEMP HACK */
 #include "ctcp.h"
 #include "src/common.h"
 #include "src/main.h"
@@ -16,7 +15,6 @@
 #include "src/userrec.h"
 #include "src/botmsg.h"
 #include "src/tclhash.h"
-#include "src/modules.h"
 #include "src/egg_timer.h"
 
 #ifdef LEAF

+ 1 - 1
src/mod/dns.mod/Makefile.in

@@ -20,7 +20,7 @@ static: ../dns.o
 ../dns.o:
 	@echo -e "Compiling: \033[1mdns\033[0m"
 	 @source='dns.c' object='$@' depfile='.deps/dns.Po' tmpdepfile='.deps/dns.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CC) $(CFLAGS) $(CPPFLAGS) $(RESINCLUDE) -DMAKING_MODS -c $(srcdir)/dns.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(RESINCLUDE) -c $(srcdir)/dns.c
 	@rm -f ../dns.o
 	@mv dns.o ../
 

+ 0 - 2
src/mod/dns.mod/dns.c

@@ -6,11 +6,9 @@
  *
  */
 
-#undef MAKING_MODS
 #include "dns.h"
 #include "src/common.h"
 #include "src/dccutil.h"
-#include "src/modules.h"
 #include "src/main.h"
 #include "src/egg_timer.h"
 #include "src/types.h"

+ 1 - 1
src/mod/irc.mod/Makefile

@@ -20,7 +20,7 @@ static: ../irc.o
 ../irc.o:
 	@echo -e "Compiling: \033[1mirc\033[0m"
 	@source='irc.c' object='$@' depfile='.deps/irc.Po' tmpdepfile='.deps/irc.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DMAKING_MODS -c $(srcdir)/irc.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/irc.c
 	@rm -f ../irc.o
 	@mv irc.o ../
 

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

@@ -5,11 +5,10 @@
  *
  */
 
-#undef MAKING_MODS
 #include "src/common.h"
 #define MAKING_IRC
 #include "irc.h"
-#include "src/modules.h"
+#include "src/hooks.h"
 #include "src/match.h"
 #include "src/settings.h"
 #include "src/tandem.h"
@@ -1421,8 +1420,9 @@ static void do_nettype()
   default:
     break;
   }
+
   /* Update all rfc_ function pointers */
-  add_hook(HOOK_RFC_CASECMP, (Function) rfc_compliant);
+  /* add_hook(HOOK_RFC_CASECMP, (Function) rfc_compliant); */
 }
 
 static cmd_t irc_bot[] = {
@@ -1551,7 +1551,6 @@ void irc_init()
   timer_create_secs(60, "warn_pls_take", (Function) warn_pls_take);
   timer_create_secs(60, "check_servers", (Function) check_servers);
   timer_create_secs(5, "getin_5secondly", (Function) getin_5secondly);
-  add_hook(HOOK_ADD_MODE, (Function) real_add_mode);
   add_hook(HOOK_IDLE, (Function) flush_modes);
 #ifdef S_AUTOLOCK
   timer_create_secs(60, "check_netfight", (Function) check_netfight);

+ 1 - 3
src/mod/irc.mod/irc.h

@@ -21,8 +21,6 @@
 
 #ifdef S_AUTHCMDS
 
-#define add_mode real_add_mode
-
 static int check_bind_pubc(char *, char *, char *, struct userrec *, char *, char *);
 #endif /* S_AUTHCMDS */
 static void makeopline(struct chanset_t *, char *, char *);
@@ -63,7 +61,7 @@ static int gotmode(char *, char *);
 
 #endif /* MAKING_IRC */
 
-void real_add_mode(struct chanset_t *, char, char, char *);
+void add_mode(struct chanset_t *, char, char, char *);
 int me_op(struct chanset_t *);
 void check_this_ban(struct chanset_t *, char *, int);
 void check_this_user(char *, int, char *);

+ 2 - 2
src/mod/irc.mod/mode.c

@@ -277,7 +277,7 @@ void queue_deop(struct chanset_t *chan, char *op) {
 
 /* Queue a channel mode change
  */
-void real_add_mode(struct chanset_t *chan, char plus, char mode, char *op)
+void add_mode(struct chanset_t *chan, char plus, char mode, char *op)
 {
   int i, type, modes, l;
   masklist *m = NULL;
@@ -575,7 +575,7 @@ static void flush_mode(struct chanset_t *chan, int pri)
 
 /* Queue a channel mode change
  */
-void real_add_mode(struct chanset_t *chan, char plus, char mode, char *op)
+void add_mode(struct chanset_t *chan, char plus, char mode, char *op)
 {
   int i, type, modes, l;
   masklist *m = NULL;

+ 0 - 565
src/mod/module.h

@@ -1,565 +0,0 @@
-/*
- * module.h
- *
- */
-/*
- * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002 Eggheads Development Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-#ifndef _EGG_MOD_MODULE_H
-#define _EGG_MOD_MODULE_H
-
-/* Just include *all* the include files...it's slower but EASIER */
-#include "src/common.h"
-#include "src/dcc.h"
-#include "src/debug.h"
-#include "src/color.h"
-#include "src/users.h"
-#include "src/types.h"
-#include "src/cfg.h"
-#include "src/cmds.h"
-#include "src/tclhash.h"
-#include "modvals.h"
-#include "src/tandem.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 killsock
-#undef feof
-#undef dprintf
-#undef sdprintf
-#undef wild_match
-#undef wild_match_per
-#undef Context
-#undef ContextNote
-#undef Assert
-
-/* Compability functions. */
-#ifdef egg_inet_aton
-#  undef egg_inet_aton
-#endif
-#ifdef egg_inet_ntop
-#  undef egg_inet_ntop
-#endif
-#ifdef egg_vsnprintf
-#  undef egg_vsnprintf
-#endif
-#ifdef egg_snprintf
-#  undef egg_snprintf
-#endif
-#ifdef egg_memset
-#  undef egg_memset
-#endif
-#ifdef egg_strcasecmp
-#  undef egg_strcasecmp
-#endif
-#ifdef egg_strncasecmp
-#  undef egg_strncasecmp
-#endif
-
-#if defined (__CYGWIN__) && !defined(STATIC)
-#  define EXPORT_SCOPE	__declspec(dllexport)
-#else
-#  define EXPORT_SCOPE
-#endif
-
-/* Version checks for modules. */
-#define EGG_IS_MIN_VER(ver) 		((ver) <= EGG_VERSION)
-#define EGG_IS_MAX_VER(ver)		((ver) >= EGG_VERSION)
-
-/* Redefine for module-relevance */
-
-/* 0 - 3 */
-/* UNUSED 0 */
-/* UNUSED 1 */
-#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])
-#define module_find ((module_entry * (*)(char *,int,int))global[5])
-#define module_depend ((Function *(*)(char *,char *,int,int))global[6])
-#define module_undepend ((int(*)(char *))global[7])
-/* 8 - 11 */
-/* UNUSED 8 */
-/* UNUSED 9 */
-/* UNUSED 10 */
-/* UNUSED 11 */
-/* 12 - 15 */
-/* UNUSED 12 */
-/* UNUSED 13 */
-/* UNUSED 14 */
-/* UNUSED 15 */
-/* 16 - 19 */
-/* UNUSED 16 */
-/* UNUSED 17 */
-/* UNUSED 18 */
-/* UNUSED 19 */
-/* 20 - 23 */
-#define base64_to_int ((int (*) (char *))global[20])
-#define int_to_base64 ((char * (*) (int))global[21])
-#define int_to_base10 ((char * (*) (int))global[22])
-#define simple_sprintf ((int (*)())global[23])
-/* 24 - 27 */
-#define botnet_send_zapf ((void (*)(int, char *, char *, char *))global[24])
-#define botnet_send_zapf_broad ((void (*)(int, char *, char *, char *))global[25])
-#define botnet_send_unlinked ((void (*)(int, char *, char *))global[26])
-#define botnet_send_bye ((void(*)(void))global[27])
-/* 28 - 31 */
-#define botnet_send_chat ((void(*)(int,char*,char*))global[28])
-#define server_lag (*(int *)global[29])
-#define remove_crlf ((void (*)(char **))global[30])
-#define shuffle ((void (*)(char *, char *))global[31])
-/* 32 - 35 */
-#define botnet_send_join_idx ((void(*)(int,int))global[32])
-#define botnet_send_part_idx ((void(*)(int,char *))global[33])
-#define updatebot ((void(*)(int,char*,char,int))global[34])
-#define nextbot ((int (*)(char *))global[35])
-/* 36 - 39 */
-#define zapfbot ((void (*)(int))global[36])
-/* UNUSED 37 */
-#define u_pass_match ((int (*)(struct userrec *,char *))global[38])
-/* UNUSED 39 */
-/* 40 - 43 */
-#define get_user ((void *(*)(struct user_entry_type *,struct userrec *))global[40])
-#define set_user ((int(*)(struct user_entry_type *,struct userrec *,void *))global[41])
-#define add_entry_type ((int (*) ( struct user_entry_type * ))global[42])
-#define del_entry_type ((int (*) ( struct user_entry_type * ))global[43])
-/* 44 - 47 */
-#define get_user_flagrec ((void (*)(struct userrec *, struct flag_record *, const char *))global[44])
-#define set_user_flagrec ((void (*)(struct userrec *, struct flag_record *, const char *))global[45])
-#define get_user_by_host ((struct userrec * (*)(char *))global[46])
-#define get_user_by_handle ((struct userrec *(*)(struct userrec *,char *))global[47])
-/* 48 - 51 */
-#define find_entry_type ((struct user_entry_type * (*) ( char * ))global[48])
-#define find_user_entry ((struct user_entry * (*)( struct user_entry_type *, struct userrec *))global[49])
-#define adduser ((struct userrec *(*)(struct userrec *,char*,char*,char*,int))global[50])
-#define deluser ((int (*)(char *))global[51])
-/* 52 - 55 */
-#define addhost_by_handle ((void (*) (char *, char *))global[52])
-#define delhost_by_handle ((int(*)(char *,char *))global[53])
-#define readuserfile ((int (*)(char *,struct userrec **))global[54])
-#define write_userfile ((void(*)(int))global[55])
-/* 56 - 59 */
-#define geticon ((char (*) (int))global[56])
-#define clear_chanlist ((void (*)(void))global[57])
-#define reaffirm_owners ((void (*)(void))global[58])
-#define change_handle ((int(*)(struct userrec *,char*))global[59])
-/* 60 - 63 */
-#define write_user ((int (*)(struct userrec *, FILE *,int))global[60])
-#define clear_userlist ((void (*)(struct userrec *))global[61])
-#define count_users ((int(*)(struct userrec *))global[62])
-#define sanity_check ((int(*)(int))global[63])
-/* 64 - 67 */
-#define break_down_flags ((void (*)(const char *,struct flag_record *,struct flag_record *))global[64])
-#define build_flags ((void (*)(char *, struct flag_record *, struct flag_record *))global[65])
-#define flagrec_eq ((int(*)(struct flag_record*,struct flag_record *))global[66])
-#define flagrec_ok ((int(*)(struct flag_record*,struct flag_record *))global[67])
-/* 68 - 71 */
-/* UNUSED 68 */
-#define dprintf (global[69])
-#define chatout (global[70])
-#define chanout_but ((void(*)())global[71])
-/* 72 - 75 */
-/* UNUSED 72 */
-#define list_delete ((int (*)( struct list_type **, struct list_type *))global[73])
-#define list_append ((int (*) ( struct list_type **, struct list_type *))global[74])
-#define list_contains ((int (*) (struct list_type *, struct list_type *))global[75])
-/* 76 - 79 */
-#define answer ((int (*) (int,char *,unsigned long *,unsigned short *,int))global[76])
-#define getmyip ((IP (*) (void))global[77])
-#define neterror ((void (*) (char *))global[78])
-#define tputs ((void (*) (int, char *,unsigned int))global[79])
-/* 80 - 83 */
-#define new_dcc ((int (*) (struct dcc_table *, int))global[80])
-#define lostdcc ((void (*) (int))global[81])
-#ifdef USE_IPV6
-#define getsock ((int (*) (int,int))global[82])
-#else
-#define getsock ((int (*) (int))global[82])
-#endif /* USE_IPV6 */
-#define killsock(x) (((void *(*)())global[83])((x),MODULE_NAME,__FILE__,__LINE__))
-/* 84 - 87 */
-#define open_listen_by_af ((int (*) (int *, int))global[84])
-#define open_telnet_dcc ((int (*) (int,char *,char *))global[85])
-/* UNUSED 86 */
-#define open_telnet ((int (*) (char *, int))global[87])
-/* 88 - 91 */
-/* UNUSED 88 */
-#define my_memcpy ((void * (*) (void *, const void *, size_t))global[89])
-#define my_atoul ((IP(*)(char *))global[90])
-#define my_strcpy ((int (*)(char *, const char *))global[91])
-/* 92 - 95 */
-#define dcc (*(struct dcc_t **)global[92])
-#define chanset (*(struct chanset_t **)(global[93]))
-#define userlist (*(struct userrec **)global[94])
-#define lastuser (*(struct userrec **)(global[95]))
-/* 96 - 99 */
-#define global_bans (*(maskrec **)(global[96]))
-#define global_ign (*(struct igrec **)(global[97]))
-/* UNUSED 98 */
-#define md5 ((char *(*)(const char *))global[99])
-/* 100 - 103 */
-#define max_dcc (*(int *)global[100])
-#define shouldjoin ((int (*) (struct chanset_t *))global[101])
-#define ignore_time (*(int *)(global[102]))
-#define use_console_r (*(int *)(global[103]))
-/* 104 - 107 */
-/* UNUSED 104 */
-/* UNUSED 105 */
-#define debug_output (*(int *)(global[106]))
-#define noshare (*(int *)(global[107]))
-/* 108 - 111 */
-#define do_chanset ((int (*)(char *, struct chanset_t *, char *, int))global[108])
-#define str_isdigit ((int (*) (const char *))global[109])
-#define default_flags (*(int*)global[110])
-#define dcc_total (*(int*)global[111])
-/* 112 - 115 */
-#define tempdir ((char *)(global[112]))
-#define natip ((char *)(global[113]))
-/* UNUSED 114 */
-#define origbotname ((char *)(global[115]))
-/* 116 - 119 */
-#define botuser ((char *)(global[116]))
-#define admin ((char *)(global[117]))
-#define userfile ((char *)global[118])
-#define ver ((char *)global[119])
-/* 120 - 123 */
-/* UNUSED 120 */
-#define dovoice ((int (*)(struct chanset_t *))global[121])
-#define version ((char *)global[122])
-/* UNUSED 123 */
-/* 124 - 127 */
-#define DCC_CHAT_PASS (*(struct dcc_table *)(global[124]))
-#define DCC_BOT (*(struct dcc_table *)(global[125]))
-#define DCC_LOST (*(struct dcc_table *)(global[126]))
-#define DCC_CHAT (*(struct dcc_table *)(global[127]))
-/* 128 - 131 */
-/* UNUSED 128 */
-#define now (*(time_t*)global[129])
-/* UNUSED 130 */
-#define findchan ((struct chanset_t *(*)(char *))global[131])
-/* 132 - 135 */
-#define dolimit ((int (*)(struct chanset_t *))global[132])
-#define days ((void (*)(time_t,time_t,char *))global[133])
-#define daysago ((void (*)(time_t,time_t,char *))global[134])
-#define daysdur ((void (*)(time_t,time_t,char *))global[135])
-/* 136 - 139 */
-#define ismember ((memberlist * (*) (struct chanset_t *, char *))global[136])
-#define newsplit ((char *(*)(char **))global[137])
-#define splitnick ((char *(*)(char **))global[138])
-#define splitc ((void (*)(char *,char *,char))global[139])
-/* 140 - 143 */
-#define addignore ((void (*) (char *, char *, char *,time_t))global[140])
-#define match_ignore ((int (*)(char *))global[141])
-#define delignore ((int (*)(char *))global[142])
-#define fatal (global[143])
-/* 144 - 147 */
-/* UNUSED 144 */
-/* UNUSED 145 */
-#define movefile ((int (*) (char *, char *))global[146])
-#define copyfile ((int (*) (char *, char *))global[147])
-/* 148 - 151 */
-/* UNUSED 148 */
-#define encrypt_string ((char *(*)(const char *, char *))global[149])
-#define decrypt_string ((char *(*)(const char *, char *))global[150])
-#define def_get ((void *(*)(struct userrec *, struct user_entry *))global[151])
-/* 152 - 155 */
-#define makepass ((void (*) (char *))global[152])
-#define wild_match ((int (*)(const char *, const char *))global[153])
-#define maskhost ((void (*)(const char *, char *))global[154])
-#define private ((int (*)(struct flag_record, struct chanset_t *, int))global[155])
-/* 156 - 159 */
-#define chk_op ((int (*)(struct flag_record, struct chanset_t *))global[156])
-#define chk_deop ((int (*)(struct flag_record, struct chanset_t *))global[157])
-#define chk_voice ((int (*)(struct flag_record, struct chanset_t *))global[158])
-#define chk_devoice ((int (*)(struct flag_record, struct chanset_t *))global[159])
-/* 160 - 163 */
-#define touch_laston ((void (*)(struct userrec *,char *,time_t))global[160])
-#define add_mode ((void (*)(struct chanset_t *,char,char,char *))(*(Function**)(global[161])))
-#define rmspace ((void (*)(char *))global[162])
-#define in_chain ((int (*)(char *))global[163])
-/* 164 - 167 */
-#define add_note ((int (*)(char *,char*,char*,int,int))global[164])
-#define btoh ((char *(*)(const unsigned char *, int))global[165])
-#define detect_dcc_flood ((int (*) (time_t *,struct chat_info *,int))global[166])
-#define flush_lines ((void(*)(int,struct chat_info*))global[167])
-/* 168 - 171 */
-/* UNUSED 168 */
-/* UNUSED 169 */
-#define do_restart (*(int *)(global[170]))
-/* --- UNUSED 171 */
-/* 172 - 175 */
-#define add_hook(a,b) (((void (*) (int, Function))global[172])(a,b))
-#define del_hook(a,b) (((void (*) (int, Function))global[173])(a,b))
-/* --- UNUSED 174 */
-/* --- UNUSED 175 */
-/* 176 - 179 */
-/* UNUSED 176 */
-/* UNUSED 177 */
-/* --- UNUSED 178 */
-/* --- UNUSED 179 */
-/* 180 - 183 */
-/* UNUSED 180 */
-/* UNUSED 181 */
-/* UNUSED 182 */
-/* --- UNUSED 183 */
-/* 184 - 187 */
-/* UNUSED 184 */
-/* UNUSED 185 */
-/* UNUSED 186 */
-/* UNUSED 187 */
-/* 188 - 191 */
-#define USERENTRY_BOTADDR (*(struct user_entry_type *)(global[188]))
-#define USERENTRY_BOTFL (*(struct user_entry_type *)(global[189]))
-#define USERENTRY_HOSTS (*(struct user_entry_type *)(global[190]))
-#define USERENTRY_PASS (*(struct user_entry_type *)(global[191]))
-/* 192 - 195 */
-/* UNUSED 192 */
-#define user_del_chan ((void(*)(char *))(global[193]))
-#define USERENTRY_INFO (*(struct user_entry_type *)(global[194]))
-#define USERENTRY_COMMENT (*(struct user_entry_type *)(global[195]))
-/* 196 - 199 */
-#define USERENTRY_LASTON (*(struct user_entry_type *)(global[196]))
-#define putlog (global[197])
-#define botnet_send_chan ((void(*)(int,char*,char*,int,char*))global[198])
-#define list_type_kill ((void(*)(struct list_type *))global[199])
-/* 200 - 203 */
-#define logmodes ((int(*)(char *))global[200])
-#define masktype ((const char *(*)(int))global[201])
-#define stripmodes ((int(*)(char *))global[202])
-#define stripmasktype ((const char *(*)(int))global[203])
-/* 204 - 207 */
-#define online_since (*(int *)(global[204]))
-#define buildts (*(const time_t*)(global[205]))
-#define color ((char *(*)(int, int, int))global[206])
-#define check_dcc_attrs ((int (*)(struct userrec *,int))global[207])
-/* 208 - 211 */
-#define check_dcc_chanattrs ((int (*)(struct userrec *,char *,int,int))global[208])
-/* UNUSED 209 */
-/* UNUSED 210 */
-#define botname ((char *)(global[211]))
-/* 212 - 215 */
-/* 212: remove_gunk() -- UNUSED (drummer) */
-#define check_bind_chjn ((void (*) (const char *,const char *,int,char,int,const char *))global[213])
-#define sanitycheck_dcc ((int (*)(char *, char *, char *, char *))global[214])
-#define isowner ((int (*)(char *))global[215])
-/* 216 - 219 */
-/* 216: min_dcc_port -- UNUSED (guppy) */
-/* 217: max_dcc_port -- UNUSED (guppy) */
-#define rfc_casecmp ((int(*)(char *, char *))(*(Function**)(global[218])))
-#define rfc_ncasecmp ((int(*)(char *, char *, int *))(*(Function**)(global[219])))
-/* 220 - 223 */
-#define global_exempts (*(maskrec **)(global[220]))
-#define global_invites (*(maskrec **)(global[221]))
-/* 222: ginvite_total -- UNUSED (Eule) */
-/* 223: gexempt_total -- UNUSED (Eule) */
-/* 224 - 227 */
-/* 224 -- UNUSED */
-#define use_exempts (*(int *)(global[225]))	/* drummer/Jason */
-#define use_invites (*(int *)(global[226]))	/* drummer/Jason */
-/* UNUSED 227 */
-/* 228 - 231 */
-/* 228 */
-/* UNUSED 229 */
-/* UNUSED 230 */
-/* UNUSED 231 */
-/* 232 - 235 */
-#ifdef DEBUG_CONTEXT
-#  define ContextNote(note) (global[232](__FILE__, __LINE__, MODULE_NAME, note))
-#else
-#  define ContextNote(note)	do {	} while (0)
-#endif
-#ifdef DEBUG_ASSERT
-#  define Assert(expr)		do {					\
-	if (!(expr))							\
-		(global[233](__FILE__, __LINE__, MODULE_NAME));		\
-} while (0)
-#else
-#  define Assert(expr)	do {	} while (0)
-#endif
-#define allocsock ((int(*)(int sock,int options))global[234])
-#define call_hostbyip ((void(*)(IP, char *, int))global[235])
-/* 236 - 239 */
-#define call_ipbyhost ((void(*)(char *, IP, int))global[236])
-#define iptostr ((char *(*)(IP))global[237])
-#define DCC_DNSWAIT (*(struct dcc_table *)(global[238]))
-#define hostsanitycheck_dcc ((int(*)(char *, char *, IP, char *, char *))global[239])
-/* 240 - 243 */
-#define dcc_dnsipbyhost ((void (*)(char *))global[240])
-#define dcc_dnshostbyip ((void (*)(IP))global[241])
-#define changeover_dcc ((void (*)(int, struct dcc_table *, int))global[242])
-#define make_rand_str ((void (*) (char *, int))global[243])
-/* 244 - 247 */
-/* UNUSED 244 */
-#define findchan_by_dname ((struct chanset_t *(*)(char *))global[245])
-/* 246 UNUSED */
-#define userfile_perm (*(int *)global[247])
-/* 248 - 251 */
-#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 *, 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])
-#define egg_memset ((void *(*)(void *, int, size_t))global[254])
-#define egg_strcasecmp ((int (*)(const char *, const char *))global[255])
-/* 256 - 259 */
-#define egg_strncasecmp ((int (*)(const char *, const char *, size_t))global[256])
-#define is_file ((int (*)(const char *))global[257])
-/* UNUSED 258 */
-#define tandbot (*(tand_t **)(global[259]))
-/* 260 - 263 */
-#define party (*(party_t **)(global[260]))
-#define open_address_listen ((int (*)(IP addr, int *port))global[261])
-#define str_escape ((char *(*)(const char *, const char, const char))global[262])
-#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 *, 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.
- * Its structure might be changed, or it might be completely removed,
- * so you can't rely on it without a version-check.
- */
-#define sockprotocol ((int (*)(int))global[268]) /* get protocol */
-#define socklist (*(struct sock_list **)global[269])
-#define sockoptions ((int (*)(int, int, int))global[270])
-#define flush_inbuf ((int (*)(int))global[271])
-#define kill_bot ((void (*)(char *, char *))global[272])
-/* 273 - 276 */
-#define quit_msg ((char *)(global[273]))
-#define module_load ((char *(*)(char *))global[274])
-#define module_unload ((char *(*)(char *, char *))global[275])
-/* UNUSED 276 */
-/* 277 - 280 */
-#define ischanhub ((int (*)(void))global[277])
-#define rand_dccresp ((char *(*)(void))global[278])
-/* 279 unused */
-#ifdef LEAF
-#define listen_all ((int (*)(int, int))global[280])
-#endif
-/* 281 - 284 */
-#define _wild_match_per ((int (*)(const char *, const char *))global[284])
-/* 285 - 288 */
-#define role (*(int*)global[285])
-#define loading (*(int*)global[286])
-#define localhub (*(int*)global[287])
-#define updatebin ((int (*)(int, char *, int))global[288])
-/* 289 - 292 */
-#define stats_add ((void (*)(struct userrec *, int, int))global[289])
-#define lower_bot_linked ((void (*)(int))global[290])
-#define add_cfg ((void (*)(struct cfg_entry *))global[291])
-#define set_cfg_str ((void (*)(char *, char *, char *))global[292])
-/* 293 - 296 */
-#define trigger_cfg_changed (global[293])
-#define higher_bot_linked ((void (*)(int))global[294])
-#define bot_aggressive_to ((int (*)(struct userrec *))global[295])
-#define botunlink ((int (*)(int, char *, char *))global[296])
-/* 297 - 300 */
-/* UNUSED 297 */
-#define timesync (*(int*)global[298])
-/* UNUSED 299 */
-#define kickreason ((char *(*)(int))global[300])
-/* 301 - 304 */
-#define getting_users ((int (*)())global[301])
-/* 302 */
-/* 303 */
-#define USERENTRY_ADDED (*(struct user_entry_type *)(global[304]))
-/* 305 - 308 */
-#define bdhash ((char *)(global[305]))
-#define isupdatehub ((int (*)(void))global[306])
-/* 307 UNUSED */
-#define botlink ((int (*)(char *, int, char *))global[308])
-/* 309 - 312 */
-#define makeplaincookie ((void (*)(char *, char *, char *))global[309])
-#define kickprefix ((char *)(global[310]))
-#define bankickprefix ((char *)(global[311]))
-#define deflag_user ((void (*)(struct userrec *, int, char *, struct chanset_t *))global[312])
-/* 313 - 316 */
-#define dcc_prefix ((char *)(global[313]))
-#define goodpass ((int (*)(char *, int, char *))global[314])
-#ifdef S_AUTHCMDS
-#define auth (*(struct auth_t **)global[315])
-#define auth_total (*(int*)global[316])
-/* 317 - 320 */
-#define new_auth ((int (*) (void))global[317])
-#define findauth ((int (*) (char *))global[318])
-#define removeauth ((void (*)(int))global[319])
-#endif /* S_AUTHCMDS */
-#ifdef S_AUTHHASH
-#define makehash ((char *(*)(struct userrec *, char *))global[320])
-/* 321 - 324 */
-#define authkey ((char *)(global[321]))
-#endif /* S_AUTHHASH */
-#define USERENTRY_SECPASS (*(struct user_entry_type *)(global[322]))
-/* UNUSED 323 */
-/* UNUSED 324 */
-/* 325 - 328 */
-#define cmdprefix ((char *)(global[325]))
-#define replace ((char*(*)(char *, char *, char *))global[326])
-#define degarble ((char *(*)(int, char *))global[327])
-#define open_listen ((int (*) (int *))global[328])
-/* 329 - 332 */
-#define egg_inet_ntop ((int (*)(int af, const void *src, char *dst, socklen_t size))global[329])
-#define hostprotocol ((int (*) (char *))global[330])
-#define sdprintf (global[331])
-#define putbot ((void (*)(char *, char *))global[332])
-/* 333 - 336 */
-#define putallbots ((void (*)(char *))global[333])
-#define ssl_link ((int (*) (int, int))global[334])
-#define dropssl ((void (*) (int))global[335])
-#define myipstr ((char*(*)(int))global[336])
-/* 337 - 340 */
-#define checkchans ((void (*)(int))global[337])
-#define CFG_MSGOP (*(struct cfg_entry *)(global[338]))
-#define CFG_MSGPASS (*(struct cfg_entry *)(global[339]))
-#define CFG_MSGINVITE (*(struct cfg_entry *)(global[340]))
-/* 341 - 344 */
-#define CFG_MSGIDENT (*(struct cfg_entry *)(global[341]))
-#define bind_table_add ((bind_table_t *(*)(const char *, int, char *, int, int))global[342])
-#define bind_table_del ((void (*)(bind_table_t *))global[343])
-#define add_builtins ((void (*)(const char *, cmd_t *))global[344])
-/* 345 - 348 */
-#define rem_builtins ((void (*)(const char *, cmd_t *))global[345])
-#define bind_table_lookup ((bind_table_t *(*)(const char *))global[346])
-#define check_bind ((int (*)(bind_table_t *, const char *, struct flag_record *, ...))global[347])
-
-extern int lfprintf(FILE *, char *, ...);
-extern int cfg_count;
-extern struct cfg_entry **cfg;
-#define STR(x) x
-
-#endif				/* _EGG_MOD_MODULE_H */

+ 0 - 88
src/mod/modvals.h

@@ -1,88 +0,0 @@
-/*
- * modvals.h
- *
- */
-/*
- * Copyright (C) 1997 Robey Pointer
- * Copyright (C) 1999, 2000, 2001, 2002 Eggheads Development Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-#ifndef _EGG_MOD_MODVALS_H
-#define _EGG_MOD_MODVALS_H
-
-#include "src/types.h"
-
-#define HOOK_READ_USERFILE	  1
-#define HOOK_REHASH		  2
-#define HOOK_USERFILE		  3
-#define HOOK_PRE_REHASH		  4
-#define HOOK_IDLE		  5
-#define HOOK_BACKUP     	  6
-#define HOOK_DIE		  7
-#define HOOK_DAILY		  8
-#define REAL_HOOKS		  9
-
-#define HOOK_QSERV		108
-#define HOOK_ADD_MODE		109
-#define HOOK_RFC_CASECMP	111
-
-/* These are FIXED once they are in a release they STAY
- */
-#define MODCALL_START		  0
-/* #define MODCALL_CLOSE		  1 */
-#define MODCALL_EXPMEM		  2
-#define MODCALL_REPORT		  3
-/* Filesys */
-#define FILESYS_REMOTE_REQ	  4
-#define FILESYS_ADDFILE		  5
-#define FILESYS_INCRGOTS	  6
-#define FILESYS_ISVALID		  7
-/* Share */
-#define SHARE_FINISH		  4
-#define UPDATE_FINISH		  4
-#define SHARE_DUMP_RESYNC	  5
-/* Channels */
-#define CHANNEL_CLEAR		 15
-#define CHANNEL_REMOVE		 45
-/* Server */
-#define SERVER_BOTNAME		  4
-#define SERVER_BOTUSERHOST	  5
-#define SERVER_NICKLEN		 38
-#define SERVER_NUKESERVER	 19
-/* IRC */
-#define IRC_RECHECK_CHANNEL	  15
-#define IRC_RECHECK_CHANNEL_MODES 17
-#define IRC_DO_CHANNEL_PART	  19
-#define IRC_CHECK_THIS_BAN	  20
-#define IRC_CHECK_THIS_USER       21
-/* Notes */
-#define NOTES_CMD_NOTE		  4
-/* Console */
-#define CONSOLE_DOSTORE		  4
-/* compress */
-#define COMPRESS_CFILE		  5
-#define COMPRESS_UFILE		  7
-
-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 >=	*/
-  Function		*funcs;
-} module_entry;
-
-#endif		/* _EGG_MOD_MODVALS_H */

+ 1 - 1
src/mod/notes.mod/Makefile

@@ -19,7 +19,7 @@ static: ../notes.o
 ../notes.o:
 	@echo -e "Compiling: \033[1mnotes\033[0m"
 	@source='notes.c' object='$@' depfile='.deps/notes.Po' tmpdepfile='.deps/notes.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DMAKING_MODS -c $(srcdir)/notes.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/notes.c
 	@rm -f ../notes.o
 	@mv notes.o ../
 

+ 0 - 9
src/mod/notes.mod/notes.c

@@ -7,7 +7,6 @@
  *
  */
 
-#undef MAKING_MODS
 #include "notes.h"
 #include "src/common.h"
 #include "src/chanprog.h"
@@ -16,7 +15,6 @@
 #include "src/userrec.h"
 #include "src/userent.h"
 #include "src/misc_file.h"
-#include "src/modules.h"
 #include "src/misc.h"
 #include "src/users.h"
 #include "src/egg_timer.h"
@@ -752,12 +750,6 @@ static int notes_server_setup(char *mod)
   return 0;
 }
 
-static cmd_t notes_load[] =
-{
-  {"server",	"",	notes_server_setup,		"notes:server"},
-  {NULL,	NULL,	NULL,				NULL}
-};
-
 void notes_report(int idx, int details)
 {
   if (details) {
@@ -773,7 +765,6 @@ void notes_init()
   timer_create_secs(3600, "notes_hourly", (Function) notes_hourly);
 
   add_builtins("dcc", notes_cmds);
-  add_builtins("load", notes_load);
   add_builtins("away", notes_away);
   add_builtins("chon", notes_chon);
   add_builtins("nkch", notes_nkch);

+ 1 - 1
src/mod/server.mod/Makefile

@@ -19,7 +19,7 @@ static: ../server.o
 ../server.o:
 	@echo -e "Compiling: \033[1mserver\033[0m"
 	@source='server.c' object='$@' depfile='.deps/server.Po' tmpdepfile='.deps/server.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DMAKING_MODS -c $(srcdir)/server.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/server.c
 	@rm -f ../server.o
 	@mv server.o ../
 

+ 2 - 4
src/mod/server.mod/server.c

@@ -5,7 +5,6 @@
  *
  */
 
-#undef MAKING_MODS
 #include "src/common.h"
 #include "src/cfg.h"
 #include "src/botmsg.h"
@@ -17,7 +16,7 @@
 #include "src/main.h"
 #include "src/misc.h"
 #include "src/chanprog.h"
-#include "src/modules.h"
+#include "src/hooks.h"
 #include "src/net.h"
 #include "src/auth.h"
 #include "src/dns.h"
@@ -774,7 +773,7 @@ static void empty_msgq()
 
 /* Use when sending msgs... will spread them out so there's no flooding.
  */
-static void queue_server(int which, char *buf, int len)
+void queue_server(int which, char *buf, int len)
 {
   struct msgq_head *h = NULL, tempq;
   struct msgq *q = NULL, *tq = NULL, *tqq = NULL;
@@ -1553,7 +1552,6 @@ void server_init()
   timer_create_secs(10, "server_10secondly", (Function) server_10secondly);
   timer_create_secs(300, "server_5minutely", (Function) server_5minutely);
   timer_create_secs(60, "minutely_checks", (Function) minutely_checks);
-  add_hook(HOOK_QSERV, (Function) queue_server);
   add_hook(HOOK_PRE_REHASH, (Function) server_prerehash);
   add_hook(HOOK_REHASH, (Function) server_postrehash);
   add_hook(HOOK_DIE, (Function) server_die);

+ 1 - 0
src/mod/server.mod/server.h

@@ -64,5 +64,6 @@ int check_bind_ctcpr(char *, char *, struct userrec *, char *, char *, char *, b
 int detect_avalanche(char *);
 void server_report(int, int);
 void server_init();
+void queue_server(int, char *, int);
 
 #endif /*leaf*/

+ 1 - 1
src/mod/share.mod/Makefile

@@ -19,7 +19,7 @@ static: ../share.o
 ../share.o:
 	@echo -e "Compiling: \033[1mshare\033[0m"
 	@source='share.c' object='$@' depfile='.deps/share.Po' tmpdepfile='.deps/share.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DMAKING_MODS -c $(srcdir)/share.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/share.c
 	@rm -f ../share.o
 	@mv share.o ../
 

+ 19 - 39
src/mod/share.mod/share.c

@@ -3,10 +3,17 @@
  *
  */
 
-#define MODULE_NAME "share"
-#define MAKING_SHARE
-
-#include "src/mod/module.h"
+#include "src/common.h"
+#include "src/main.h"
+#include "src/rfc1459.h"
+#include "src/botmsg.h"
+#include "src/misc.h"
+#include "src/cmds.h"
+#include "src/chanprog.h"
+#include "src/users.h"
+#include "src/userrec.h"
+#include "src/botnet.h"
+#include "src/hooks.h"
 
 #include <netinet/in.h>
 #include <arpa/inet.h>
@@ -20,7 +27,7 @@
 #include "src/mod/transfer.mod/transfer.h"
 #include "src/mod/channels.mod/channels.h"
 #ifdef LEAF
-#include "src/mod/irc.mod/irc.h"
+# include "src/mod/irc.mod/irc.h"
 #endif /* LEAF */
 
 /* Minimum version I will share with. */
@@ -30,8 +37,6 @@ static const int min_exemptinvite	= 1000000;
 /* Minimum version that supports userfile features. */
 static const int min_uffeature		= 1000000;
 
-static Function *global = NULL, *transfer_funcs = NULL;
-
 static int private_global = 0;
 static int private_user = 0;
 static char private_globals[50] = "";
@@ -74,7 +79,6 @@ static void start_sending_users(int);
 static void shareout_but (struct chanset_t *, ...);
 static int flush_tbuf(char *);
 static int can_resync(char *);
-static void dump_resync(int);
 static void q_resync(char *, struct chanset_t *);
 static void cancel_user_xfer(int, void *);
 static int private_globals_bitmask();
@@ -129,7 +133,9 @@ static void check_delay()
   for (d = start_delay; d; d = dnext) {
     dnext = d->next;
     if (d->seconds <= now) {
+#ifdef LEAF
       add_mode(d->chan, d->plsmns, d->mode, d->mask);
+#endif /* LEAF */
       del_delay(d);
     }
   }
@@ -1531,7 +1537,7 @@ static int can_resync(char *bot)
 
 /* Dump the resync buffer for a bot.
  */
-static void dump_resync(int idx)
+void dump_resync(int idx)
 {
   struct share_msgq *q = NULL;
   tandbuf *t = NULL;
@@ -1683,7 +1689,7 @@ static struct userrec *dup_userlist(int t)
 
 /* Erase old user list, switch to new one.
  */
-static void finish_share(int idx)
+void finish_share(int idx)
 {
   struct userrec *u = NULL, *ou = NULL;
   struct chanset_t *chan = NULL;
@@ -1774,8 +1780,8 @@ Context;
 
 Context;
     unlink(dcc[idx].u.xfer->filename); /* why the fuck was this not here, stupid eggdev team. */
-    loading = 0;
     putlog(LOG_MISC, "*", "%s", USERF_CANTREAD);
+    loading = 0;
     clear_userlist(u);		/* Clear new, obsolete, user list.	*/
     clear_chanlist();		/* Remove all user references from the
 				   channel lists.			*/
@@ -2049,7 +2055,7 @@ static void cancel_user_xfer(int idx, void *x)
     def_dcc_bot_kill(idx, x);
 }
 
-static void share_report(int idx, int details)
+void share_report(int idx, int details)
 {
   int i, j;
 
@@ -2102,34 +2108,9 @@ static void share_report(int idx, int details)
   }
 }
 
-EXPORT_SCOPE char *share_start();
-
-static Function share_table[] =
-{
-  /* 0 - 3 */
-  (Function) share_start,
-  (Function) NULL,
-  (Function) 0,
-  (Function) share_report,
-  /* 4 - 7 */
-  (Function) finish_share,
-  (Function) dump_resync,
-  (Function) uff_addtable,
-  (Function) uff_deltable
-  /* 8 - 11 */
-};
-
-char *share_start(Function *global_funcs)
+void share_init()
 {
 
-  global = global_funcs;
-
-  module_register(MODULE_NAME, share_table, 2, 3);
-  if (!(transfer_funcs = module_depend(MODULE_NAME, "transfer", 0, 0))) {
-    module_undepend(MODULE_NAME);
-    return "This module requires transfer module 2.0 or later.";
-  }
-
   timer_create_secs(60, "check_expired_tbufs", (Function) check_expired_tbufs);
   timer_create_secs(1, "check_delay", (Function) check_delay);
   add_hook(HOOK_READ_USERFILE, (Function) hook_read_userfile);
@@ -2137,7 +2118,6 @@ char *share_start(Function *global_funcs)
   DCC_BOT.kill = cancel_user_xfer;
   uff_init();
   uff_addtable(internal_uff_table);
-  return NULL;
 }
 
 int private_globals_bitmask()

+ 4 - 10
src/mod/share.mod/share.h

@@ -39,17 +39,11 @@ typedef struct {
 				   to `priority'.			*/
 } uff_table_t;
 
-#ifndef MAKING_SHARE
-/* 4 - 7 */
-#define finish_share ((void (*) (int))share_funcs[4])
-#define dump_resync ((void (*) (int))share_funcs[5])
-#define uff_addtable ((void (*) (uff_table_t *))share_funcs[6])
-#define uff_deltable ((void (*) (uff_table_t *))share_funcs[7])
-/* 8 - 11 */
-
 void sharein(int, char *);
 void shareout(struct chanset_t *, ...);
-
-#endif				/* !MAKING_SHARE */
+void finish_share(int);
+void dump_resync(int);
+void uff_addtable(uff_table_t *);
+void share_report(int, int);
 
 #endif				/* _EGG_MOD_SHARE_SHARE_H */

+ 1 - 41
src/mod/share.mod/uf_features.c

@@ -123,20 +123,6 @@ static void uff_insert_entry(uff_list_t *nul)
     uff_list.end = nul;
 }
 
-/* Remove entry from sorted list.
- */
-static void uff_remove_entry(uff_list_t *ul)
-{
-  if (!ul->next)
-    uff_list.end = ul->prev;
-  else
-    ul->next->prev = ul->prev;
-  if (!ul->prev)
-    uff_list.start = ul->next;
-  else
-    ul->prev->next = ul->next;
-}
-
 /* Add a single feature to the list.
  */
 static void uff_addfeature(uff_table_t *ut)
@@ -159,7 +145,7 @@ static void uff_addfeature(uff_table_t *ut)
 
 /* Add a complete table to the list.
  */
-static void uff_addtable(uff_table_t *ut)
+void uff_addtable(uff_table_t *ut)
 {
   if (!ut)
     return;
@@ -167,32 +153,6 @@ static void uff_addtable(uff_table_t *ut)
     uff_addfeature(ut);
 }
 
-/* Remove a single feature from the list.
- */
-static int uff_delfeature(uff_table_t *ut)
-{
-  uff_list_t *ul = NULL;
-
-  for (ul = uff_list.start; ul; ul = ul->next)
-    if (!strcmp(ul->entry->feature, ut->feature)) {
-      uff_remove_entry(ul);
-      free(ul);
-      return 1;
-    }
-  return 0;
-}
-
-/* Remove a complete table from the list.
- */
-static void uff_deltable(uff_table_t *ut)
-{
-  if (!ut)
-    return;
-  for (; ut->feature; ++ut)
-    (int) uff_delfeature(ut);
-}
-
-
 /*
  *    Userfile feature parsing functions
  */

+ 3 - 10
src/mod/static.h

@@ -5,10 +5,6 @@
 #ifndef _EGG_MOD_STATIC_H
 #define _EGG_MOD_STATIC_H
 
-char *compress_start();
-char *share_start();
-char *transfer_start();
-
 void dns_init();
 void console_init();
 void ctcp_init();
@@ -20,11 +16,8 @@ void irc_init();
 #endif /* LEAF */
 void channels_init();
 
-static void link_statics()
-{
-  check_static("compress", compress_start);
-  check_static("share", share_start);
-  check_static("transfer", transfer_start);
-}
+void compress_init();
+void share_init();
+void transfer_init();
 
 #endif /* _EGG_MOD_STATIC_H */

+ 1 - 1
src/mod/transfer.mod/Makefile

@@ -19,7 +19,7 @@ static: ../transfer.o
 ../transfer.o:
 	@echo -e "Compiling: \033[1mtransfer\033[0m"
 	@source='transfer.c' object='$@' depfile='.deps/transfer.Po' tmpdepfile='.deps/transfer.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DMAKING_MODS -c $(srcdir)/transfer.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/transfer.c
 	@rm -f ../transfer.o
 	@mv transfer.o ../
 

+ 30 - 97
src/mod/transfer.mod/transfer.c

@@ -7,22 +7,26 @@
  * BitchX, copyright by panasync.
  */
 
-#define MODULE_NAME "transfer"
-#define MAKING_TRANSFER
-
-/* sigh sunos */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "src/mod/module.h"
+#include "src/common.h"
+#include "src/cmds.h"
+#include "src/misc_file.h"
+#include "src/misc.h"
+#include "src/main.h"
+#include "src/userrec.h"
+#include "src/userent.h"
 #include "src/tandem.h"
-#include "src/mod/share.mod/share.h"
 #include "src/net.h"
-
+#include "src/tclhash.h"
 #include "src/users.h"
+
+#define MAKING_TRANSFER
 #include "transfer.h"
 
+#include "src/mod/share.mod/share.h"
 #include "src/mod/update.mod/update.h"
 
+#include <sys/types.h>
+#include <sys/stat.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
@@ -30,8 +34,6 @@ extern int		bupdating;
 
 static bind_table_t *BT_rcvd = NULL, *BT_sent = NULL, *BT_lost = NULL, *BT_tout = NULL;
 
-static Function *global = NULL;
-
 static int copy_to_tmp = 1;	/* Copy files to /tmp before transmitting? */
 static int wait_dcc_xfer = 40;	/* Timeout time on DCC xfers */
 static int dcc_limit = 4;	/* Maximum number of simultaneous file
@@ -583,13 +585,7 @@ static void eof_dcc_send(int idx)
     /* Success */
     ok = 0;
     if (!strcmp(dcc[idx].nick, "*users")) {
-      module_entry *me = module_find("share", 0, 0);
-
-      if (me && me->funcs) {
-	Function f = me->funcs[SHARE_FINISH];
-
-	(f) (idx);
-      }
+      finish_share(idx);
       killsock(dcc[idx].sock);
       lostdcc(idx);
       return;
@@ -625,17 +621,9 @@ static void eof_dcc_send(int idx)
     sprintf(ofn, "%s%s", tempdir, dcc[idx].u.xfer->filename);
     sprintf(nfn, "%s%s", dcc[idx].u.xfer->dir, dcc[idx].u.xfer->origname);
     if (movefile(ofn, nfn))
-      putlog(LOG_MISC | LOG_FILES, "*",
-	     TRANSFER_FAILED_MOVE, nfn, ofn);
+      putlog(LOG_MISC | LOG_FILES, "*", TRANSFER_FAILED_MOVE, nfn, ofn);
     else {
-      /* Add to file database */
-      module_entry *fs = module_find("filesys", 0, 0);
-
-      if (fs != NULL) {
-	Function f = fs->funcs[FILESYS_ADDFILE];
-
-	f(dcc[idx].u.xfer->dir, dcc[idx].u.xfer->origname, hand);
-      }
+      /* old filesys crap was here */
       stats_add_upload(u, dcc[idx].u.xfer->length);
       check_sentrcvd(u, dcc[idx].nick, nfn, BT_rcvd);
     }
@@ -780,7 +768,7 @@ void dcc_get(int idx, char *buf, int len)
    */
   if (w < 4 ||
       (w < 8 && dcc[idx].u.xfer->type == XFER_RESEND_PEND)) {
-    my_memcpy(&(dcc[idx].u.xfer->buf[dcc[idx].u.xfer->sofar]), buf, len);
+    egg_memcpy(&(dcc[idx].u.xfer->buf[dcc[idx].u.xfer->sofar]), buf, len);
     dcc[idx].u.xfer->sofar += len;
     return;
   /* Waiting for the 8 bit reget packet? */
@@ -789,8 +777,8 @@ void dcc_get(int idx, char *buf, int len)
     if (w == 8) {
       transfer_reget reget_data;
 
-      my_memcpy(&reget_data, dcc[idx].u.xfer->buf, dcc[idx].u.xfer->sofar);
-      my_memcpy(&reget_data + dcc[idx].u.xfer->sofar, buf, len);
+      egg_memcpy(&reget_data, dcc[idx].u.xfer->buf, dcc[idx].u.xfer->sofar);
+      egg_memcpy(&reget_data + dcc[idx].u.xfer->sofar, buf, len);
       handle_resend_packet(idx, &reget_data);
       cmp = dcc[idx].u.xfer->offset;
     } else
@@ -800,16 +788,16 @@ void dcc_get(int idx, char *buf, int len)
   } else {
     /* Complete packet? */
     if (w == 4) {
-      my_memcpy(bbuf, dcc[idx].u.xfer->buf, dcc[idx].u.xfer->sofar);
-      my_memcpy(&(bbuf[dcc[idx].u.xfer->sofar]), buf, len);
+      egg_memcpy(bbuf, dcc[idx].u.xfer->buf, dcc[idx].u.xfer->sofar);
+      egg_memcpy(&(bbuf[dcc[idx].u.xfer->sofar]), buf, len);
     } else {
       p = ((w - 1) & ~3) - dcc[idx].u.xfer->sofar;
       w = w - ((w - 1) & ~3);
       if (w < 4) {
-	my_memcpy(dcc[idx].u.xfer->buf, &(buf[p]), w);
+	egg_memcpy(dcc[idx].u.xfer->buf, &(buf[p]), w);
 	return;
       }
-      my_memcpy(bbuf, &(buf[p]), w);
+      egg_memcpy(bbuf, &(buf[p]), w);
     }
     /* This is more compatible than ntohl for machines where an int
      * is more than 4 bytes:
@@ -861,7 +849,6 @@ void dcc_get(int idx, char *buf, int len)
     killsock(dcc[idx].sock);
     fclose(dcc[idx].u.xfer->f);
     if (!strcmp(dcc[idx].nick, "*users")) {
-      module_entry *me = module_find("share", 0, 0);
       int x, y = 0;
 
       for (x = 0; x < dcc_total; x++)
@@ -870,12 +857,10 @@ void dcc_get(int idx, char *buf, int len)
 	  y = x;
       if (y != 0)
 	dcc[y].status &= ~STAT_SENDING;
-      putlog(LOG_BOTS, "*",TRANSFER_COMPLETED_USERFILE,
-	     dcc[y].nick);
+      putlog(LOG_BOTS, "*",TRANSFER_COMPLETED_USERFILE, dcc[y].nick);
       unlink(dcc[idx].u.xfer->filename);
       /* Any sharebot things that were queued: */
-      if (me && me->funcs[SHARE_DUMP_RESYNC])
-	((me->funcs)[SHARE_DUMP_RESYNC]) (y);
+      dump_resync(y);
       xnick[0] = 0;
     } else if (!strcmp(dcc[idx].nick, "*binary")) {
       int x, y = 0;
@@ -895,16 +880,8 @@ void dcc_get(int idx, char *buf, int len)
       bupdating = 0;
 #endif
     } else {
-      module_entry *fs = module_find("filesys", 0, 0);
-      struct userrec *u = get_user_by_handle(userlist,
-					     dcc[idx].u.xfer->from);
-      check_sentrcvd(u, dcc[idx].nick,
-			 dcc[idx].u.xfer->dir, BT_sent);
-      if (fs != NULL) {
-	Function f = fs->funcs[FILESYS_INCRGOTS];
-
-	f(dcc[idx].u.xfer->dir);
-      }
+      struct userrec *u = get_user_by_handle(userlist, dcc[idx].u.xfer->from);
+      check_sentrcvd(u, dcc[idx].nick, dcc[idx].u.xfer->dir, BT_sent);
       /* Download is credited to the user who requested it
        * (not the user who actually received it)
        */
@@ -1628,7 +1605,7 @@ static int fstat_dupuser(struct userrec *u, struct userrec *o,
 
   if (e->u.extra) {
     fs = calloc(1, sizeof(struct filesys_stats));
-    my_memcpy(fs, e->u.extra, sizeof(struct filesys_stats));
+    egg_memcpy(fs, e->u.extra, sizeof(struct filesys_stats));
 
     return set_user(&USERENTRY_FSTAT, u, fs);
   }
@@ -1725,17 +1702,11 @@ static int server_transfer_setup(char *mod)
   return 1;
 }
 
-static cmd_t transfer_load[] =
-{
-  {"server",	"",	server_transfer_setup,	NULL},
-  {NULL,	"",	NULL,			NULL}
-};
-
 /*
  *   Module functions
  */
 
-static void transfer_report(int idx, int details)
+void transfer_report(int idx, int details)
 {
   if (details) {
     dprintf(idx,TRANSFER_STAT_BLOCK,
@@ -1743,46 +1714,9 @@ static void transfer_report(int idx, int details)
   }
 }
 
-EXPORT_SCOPE char *transfer_start();
-
-static Function transfer_table[] =
+void transfer_init()
 {
-  (Function) transfer_start,
-  (Function) NULL,
-  (Function) 0,
-  (Function) transfer_report,
-  /* 4- 7 */
-  (Function) & DCC_FORK_SEND,		/* struct dcc_table		*/
-  (Function) at_limit,
-  (Function) & copy_to_tmp,		/* int				*/
-  (Function) fileq_cancel,
-  /* 8 - 11 */
-  (Function) queue_file,
-  (Function) raw_dcc_send,
-  (Function) show_queued_files,
-  (Function) wild_match_file,
-  /* 12 - 15 */
-  (Function) wipe_tmp_filename,
-  (Function) & DCC_GET,			/* struct dcc_table		*/
-  (Function) 0,
-  (Function) 0,
-  /* 16 - 19 */
-  (Function) & USERENTRY_FSTAT,		/* struct user_entry_type	*/
-  (Function) & quiet_reject,		/* int				*/
-  (Function) raw_dcc_resend,
-  (Function) 0,
-  /* 20 - 23 */
-  (Function) 0,
-};
-
-char *transfer_start(Function *global_funcs)
-{
-  global = global_funcs;
-
   fileq = NULL;
-  module_register(MODULE_NAME, transfer_table, 2, 2);
-
-  add_builtins("load", transfer_load);
 
   server_transfer_setup(NULL);
   BT_rcvd = bind_table_add("rcvd", 3, "Uss", MATCH_MASK, BIND_STACKABLE);
@@ -1792,5 +1726,4 @@ char *transfer_start(Function *global_funcs)
 
   USERENTRY_FSTAT.get = def_get;
   add_entry_type(&USERENTRY_FSTAT);
-  return NULL;
 }

+ 4 - 10
src/mod/transfer.mod/transfer.h

@@ -33,30 +33,21 @@ enum {
 int raw_dcc_send(char *, char *, char *, char *);
 
 #if !defined(MAKING_TRANSFER) && defined(MAKING_MODS)
-/* 4 - 7 */
 #define DCC_FORK_SEND (*(struct dcc_table *)(transfer_funcs[4]))
 #define at_limit(a) (((int (*) (char *))transfer_funcs[5])(a))
 #define copy_to_tmp (*(int *)(transfer_funcs[6]))
 #define fileq_cancel(a,b) (((void (*) (int,char *))transfer_funcs[7])(a,b))
-/* 8 - 11 */
 #define queue_file(a,b,c,d) (((void (*)(char *,char *,char *,char *))transfer_funcs[8])(a,b,c,d))
 #define raw_dcc_send(a,b,c,d) (((int (*) (char *,char *,char *,char *))transfer_funcs[9])(a,b,c,d))
 #define show_queued_files(a) (((void (*) (int))transfer_funcs[10])(a))
 #define wild_match_file(a,b) (((int (*)(register char * m, register char * n))transfer_funcs[11])(a,b))
-/* 12 - 15 */
 #define wipe_tmp_filename(a,b) (((void (*) (char *,int))transfer_funcs[12])(a,b))
 #define DCC_GET (*(struct dcc_table *)(transfer_funcs[13]))
-/* UNUSED 14 */
-/* UNUSED 15 */
-/* 16 - 19 */
 #define USERENTRY_FSTAT (*(struct user_entry_type *)(transfer_funcs[16]))
 #define quiet_reject (*(int *)(transfer_funcs[17]))
 #define raw_dcc_resend(a,b,c,d) (((int (*) (char *,char *,char *,char *))transfer_funcs[18])(a,b,c,d))
-/* UNUSED 19 */
-/* 20 - 23 */
-/* UNUSED 20 */
-
 #endif
+
 #ifdef MAKING_TRANSFER
 
 static int raw_dcc_resend(char *, char *, char *, char *);
@@ -147,4 +138,7 @@ typedef struct zarrf {
 #define TRANSFER_STAT_MEMORY        "   Using %d bytes of memory\n"
 /* end of langauge addon */
 
+extern struct dcc_table 		DCC_SEND, DCC_GET, DCC_GET_PENDING, DCC_FORK_SEND;
+
+
 #endif				/* _EGG_MOD_TRANSFER_TRANSFER_H */

+ 1 - 1
src/mod/update.mod/Makefile

@@ -19,7 +19,7 @@ static: ../update.o
 ../update.o:
 	@echo -e "Compiling: \033[1mupdate\033[0m"
 	@source='update.c' object='$@' depfile='.deps/update.Po' tmpdepfile='.deps/update.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DMAKING_MODS -c $(srcdir)/update.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/update.c
 	@rm -f ../update.o
 	@mv update.o ../
 

+ 0 - 3
src/mod/update.mod/update.c

@@ -3,11 +3,8 @@
  *
  */
 
-#undef MAKING_MODS
-
 #include "src/common.h"
 #include "src/users.h"
-#include "src/modules.h"
 #include "src/dcc.h"
 #include "src/botnet.h"
 #include "src/main.h"

+ 0 - 840
src/modules.c

@@ -1,840 +0,0 @@
-/* 
- * modules.c -- handles:
- *   support for modules in eggdrop
- * 
- * by Darrin Smith (beldin@light.iinet.net.au)
- * 
- */
-
-#include "common.h"
-#include "modules.h"
-#include "tclhash.h"
-#include "misc_file.h"
-#include "rfc1459.h"
-#include "net.h"
-#include "misc.h"
-#include "userent.h"
-#include "settings.h"
-#include "userrec.h"
-#include "cfg.h"
-#include "match.h"
-#include "auth.h"
-#include "main.h"
-#include "dccutil.h"
-#include "debug.h"
-#include "dcc.h"
-#include "dns.h"
-#include "cmds.h"
-#include "crypt.h"
-#include "chanprog.h"
-#include "botmsg.h"
-#include "botcmd.h"
-#include "botnet.h"
-#include "tandem.h"
-#include <ctype.h>
-#include "core_binds.h"
-
-#include "users.h"
-
-static int module_rename(char *name, char *newname);
-
-
-struct static_list {
-  struct static_list *next;
-  char *name;
-  char *(*func) ();
-} *static_modules = NULL;
-
-void check_static(char *name, char *(*func) ())
-{
-  struct static_list *p = NULL;
-
-  p = calloc(1, sizeof(struct static_list));
-
-  p->name = strdup(name);
-  p->func = func;
-  p->next = static_modules;
-  static_modules = p;
-}
-
-void *mod_killsock(int size, const char *modname, const char *filename, int line)
-{
-  char x[100] = "", *p = NULL;
-
-  p = strrchr(filename, '/');
-  egg_snprintf(x, sizeof x, "%s:%s", modname, p ? p + 1 : filename);
-  x[19] = 0;
-  real_killsock(size, x, line);
-  return NULL;
-}
-
-
-/* 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 (*qserver) (int, char *, int) = (void (*)(int, char *, int)) null_func;
-void (*add_mode) () = null_func;
-int (*rfc_casecmp) (const char *, const char *) = _rfc_casecmp;
-int (*rfc_ncasecmp) (const char *, const char *, int) = _rfc_ncasecmp;
-int (*rfc_toupper) (int) = _rfc_toupper;
-int (*rfc_tolower) (int) = _rfc_tolower;
-
-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[] =
-{
-  /* 0 - 3 */
-  (Function) 0,
-  (Function) 0,
-#ifdef DEBUG_CONTEXT
-  (Function) eggContext,
-#else
-  (Function) 0,
-#endif
-  (Function) module_rename,
-  /* 4 - 7 */
-  (Function) module_register,
-  (Function) module_find,
-  (Function) module_depend,
-  (Function) module_undepend,
-  /* 8 - 11 */
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  /* 12 - 15 */
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  /* 16 - 19 */
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  /* 20 - 23 */
-  (Function) base64_to_int,
-  (Function) int_to_base64,
-  (Function) int_to_base10,
-  (Function) simple_sprintf,
-  /* 24 - 27 */
-  (Function) botnet_send_zapf,
-  (Function) botnet_send_zapf_broad,
-  (Function) botnet_send_unlinked,
-  (Function) botnet_send_bye,
-  /* 28 - 31 */
-  (Function) botnet_send_chat,
-  (Function) & server_lag, /* int					*/
-  (Function) remove_crlf,
-  (Function) shuffle,
-  /* 32 - 35 */
-  (Function) botnet_send_join_idx,
-  (Function) botnet_send_part_idx,
-  (Function) updatebot,
-  (Function) nextbot,
-  /* 36 - 39 */
-  (Function) zapfbot,
-  (Function) 0,
-  (Function) u_pass_match,
-  (Function) 0,
-  /* 40 - 43 */
-  (Function) get_user,
-  (Function) set_user,
-  (Function) add_entry_type,
-  (Function) del_entry_type,
-  /* 44 - 47 */
-  (Function) get_user_flagrec,
-  (Function) set_user_flagrec,
-  (Function) get_user_by_host,
-  (Function) get_user_by_handle,
-  /* 48 - 51 */
-  (Function) find_entry_type,
-  (Function) find_user_entry,
-  (Function) adduser,
-  (Function) deluser,
-  /* 52 - 55 */
-  (Function) addhost_by_handle,
-  (Function) delhost_by_handle,
-  (Function) readuserfile,
-  (Function) write_userfile,
-  /* 56 - 59 */
-  (Function) geticon,
-  (Function) clear_chanlist,
-  (Function) reaffirm_owners,
-  (Function) change_handle,
-  /* 60 - 63 */
-  (Function) write_user,
-  (Function) clear_userlist,
-  (Function) count_users,
-  (Function) sanity_check,
-  /* 64 - 67 */
-  (Function) break_down_flags,
-  (Function) build_flags,
-  (Function) flagrec_eq,
-  (Function) flagrec_ok,
-  /* 68 - 71 */
-  (Function) 0,
-  (Function) dprintf,
-  (Function) chatout,
-  (Function) chanout_but,
-  /* 72 - 75 */
-  (Function) 0,
-  (Function) list_delete,
-  (Function) list_append,
-  (Function) list_contains,
-  /* 76 - 79 */
-  (Function) answer,
-  (Function) getmyip,
-  (Function) neterror,
-  (Function) tputs,
-  /* 80 - 83 */
-  (Function) new_dcc,
-  (Function) lostdcc,
-  (Function) getsock,
-  (Function) mod_killsock,
-  /* 84 - 87 */
-  (Function) open_listen_by_af,
-  (Function) open_telnet_dcc,
-  (Function) 0,
-  (Function) open_telnet,
-  /* 88 - 91 */
-  (Function) 0,
-  (Function) egg_memcpy,
-  (Function) my_atoul,
-  (Function) my_strcpy,
-  /* 92 - 95 */
-  (Function) & dcc,		 /* struct dcc_t *			*/
-  (Function) & chanset,		 /* struct chanset_t *			*/
-  (Function) & userlist,	 /* struct userrec *			*/
-  (Function) & lastuser,	 /* struct userrec *			*/
-  /* 96 - 99 */
-  (Function) & global_bans,	 /* struct banrec *			*/
-  (Function) & global_ign,	 /* struct igrec *			*/
-  (Function) 0,
-  (Function) MD5,
-  /* 100 - 103 */
-  (Function) & max_dcc,		 /* int					*/
-  (Function) shouldjoin, 
-  (Function) & ignore_time,	 /* int					*/
-  (Function) & use_console_r,	 /* int					*/
-  /* 104 - 107 */
-  (Function) 0,
-  (Function) 0,
-  (Function) & debug_output,	 /* int					*/
-  (Function) & noshare,		 /* int					*/
-  /* 108 - 111 */
-  (Function) do_chanset, 
-  (Function) str_isdigit,
-  (Function) & default_flags,	 /* int					*/
-  (Function) & dcc_total,	 /* int					*/
-  /* 112 - 115 */
-  (Function) tempdir,		 /* char *				*/
-  (Function) natip,		 /* char *				*/
-  (Function) 0,	
-  (Function) origbotname,	 /* char *				*/
-  /* 116 - 119 */
-  (Function) botuser,		 /* char *				*/
-  (Function) admin,		 /* char *				*/
-  (Function) userfile,		 /* char *				*/
-  (Function) ver,		 /* char *				*/
-  /* 120 - 123 */
-  (Function) 0,
-  (Function) dovoice,
-  (Function) version,		 /* char *				*/
-  (Function) 0,
-  /* 124 - 127 */
-  (Function) & DCC_CHAT_PASS,	 /* struct dcc_table *			*/
-  (Function) & DCC_BOT,		 /* struct dcc_table *			*/
-  (Function) & DCC_LOST,	 /* struct dcc_table *			*/
-  (Function) & DCC_CHAT,	 /* struct dcc_table *			*/
-  /* 128 - 131 */
-  (Function) 0,
-  (Function) & now,		 /* time_t				*/
-  (Function) 0,
-  (Function) findchan,
-  /* 132 - 135 */
-  (Function) dolimit,
-  (Function) days,
-  (Function) daysago,
-  (Function) daysdur,
-  /* 136 - 139 */
-  (Function) ismember,
-  (Function) newsplit,
-  (Function) splitnick,
-  (Function) splitc,
-  /* 140 - 143 */
-  (Function) addignore,
-  (Function) match_ignore,
-  (Function) delignore,
-  (Function) fatal,
-  /* 144 - 147 */
-  (Function) 0, 
-  (Function) 0,
-  (Function) movefile,
-  (Function) copyfile,
-  /* 148 - 151 */
-  (Function) 0,
-  (Function) encrypt_string,
-  (Function) decrypt_string,
-  (Function) def_get,
-  /* 152 - 155 */
-  (Function) makepass,
-  (Function) _wild_match,
-  (Function) maskhost,
-  (Function) private,
-  /* 156 - 159 */
-  (Function) chk_op,
-  (Function) chk_deop,
-  (Function) chk_voice,
-  (Function) chk_devoice,
-  /* 160 - 163 */
-  (Function) touch_laston,
-  (Function) & add_mode,	/* Function *				*/
-  (Function) rmspace,
-  (Function) in_chain,
-  /* 164 - 167 */
-  (Function) add_note,
-  (Function) btoh,
-  (Function) detect_dcc_flood,
-  (Function) flush_lines,
-  /* 168 - 171 */
-  (Function) 0,
-  (Function) 0,
-  (Function) & do_restart,	/* int					*/
-  (Function) 0,
-  /* 172 - 175 */
-  (Function) add_hook,
-  (Function) del_hook,
-  (Function) 0,
-  (Function) 0,
-  /* 176 - 179 */
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  /* 180 - 183 */
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  /* 184 - 187 */
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  /* 188 - 191 */
-  (Function) & USERENTRY_BOTADDR,	/* struct user_entry_type *	*/
-  (Function) & USERENTRY_BOTFL,		/* struct user_entry_type *	*/
-  (Function) & USERENTRY_HOSTS,		/* struct user_entry_type *	*/
-  (Function) & USERENTRY_PASS,		/* struct user_entry_type *	*/
-  /* 192 - 195 */
-  (Function) 0,
-  (Function) user_del_chan,
-  (Function) & USERENTRY_INFO,		/* struct user_entry_type *	*/
-  (Function) & USERENTRY_COMMENT,	/* struct user_entry_type *	*/
-  /* 196 - 199 */
-  (Function) & USERENTRY_LASTON,	/* struct user_entry_type *	*/
-  (Function) putlog,
-  (Function) botnet_send_chan,
-  (Function) list_type_kill,
-  /* 200 - 203 */
-  (Function) logmodes,
-  (Function) masktype,
-  (Function) stripmodes,
-  (Function) stripmasktype,
-  /* 204 - 207 */
-  (Function) & online_since,	/* time_t *				*/
-  (Function) & buildts,		/* time_t *				*/
-  (Function) color,
-  (Function) check_dcc_attrs,
-  /* 208 - 211 */
-  (Function) check_dcc_chanattrs,
-  (Function) 0,
-  (Function) 0,
-  (Function) botname,
-  /* 212 - 215 */
-  (Function) 0,			/* remove_gunk() -- UNUSED! (drummer)	*/
-  (Function) check_bind_chjn,
-  (Function) sanitycheck_dcc,
-  (Function) isowner,
-  /* 216 - 219 */
-  (Function) 0, /* min_dcc_port -- UNUSED! (guppy) */
-  (Function) 0, /* max_dcc_port -- UNUSED! (guppy) */
-  (Function) & rfc_casecmp,	/* Function *				*/
-  (Function) & rfc_ncasecmp,	/* Function *				*/
-  /* 220 - 223 */
-  (Function) & global_exempts,	/* struct exemptrec *			*/
-  (Function) & global_invites,	/* struct inviterec *			*/
-  (Function) 0, /* ginvite_total -- UNUSED! (Eule) */
-  (Function) 0, /* gexempt_total -- UNUSED! (Eule) */
-  /* 224 - 227 */
-  (Function) 0,
-  (Function) & use_exempts,	/* int					*/
-  (Function) & use_invites,	/* int					*/
-  (Function) 0,
-  /* 228 - 231 */
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  (Function) 0, 
-  /* 232 - 235 */
-#ifdef DEBUG_CONTEXT
-  (Function) eggContextNote,
-#else
-  (Function) 0,
-#endif
-#ifdef DEBUG_ASSERT
-  (Function) eggAssert,
-#else
-  (Function) 0,
-#endif
-  (Function) allocsock,
-  (Function) call_hostbyip,
-  /* 236 - 239 */
-  (Function) call_ipbyhost,
-  (Function) iptostr,
-  (Function) & DCC_DNSWAIT,	 /* struct dcc_table *			*/
-  (Function) hostsanitycheck_dcc,
-  /* 240 - 243 */
-  (Function) dcc_dnsipbyhost,
-  (Function) dcc_dnshostbyip,
-  (Function) changeover_dcc,  
-  (Function) make_rand_str,
-  /* 244 - 247 */
-  (Function) 0,
-  (Function) findchan_by_dname,
-  (Function) 0,
-  (Function) & userfile_perm,	 /* int					*/
-  /* 248 - 251 */
-  (Function) sock_has_data,
-  (Function) bots_in_subtree,
-  (Function) users_in_subtree,
-  (Function) egg_inet_aton,
-  /* 252 - 255 */
-  (Function) egg_snprintf,
-  (Function) egg_vsnprintf,
-  (Function) egg_memset,
-  (Function) egg_strcasecmp,
-  /* 256 - 259 */
-  (Function) egg_strncasecmp,
-  (Function) is_file,
-  (Function) 0,
-  (Function) & tandbot,		/* tand_t *				*/
-  /* 260 - 263 */
-  (Function) & party,		/* party_t *				*/
-  (Function) open_address_listen,
-  (Function) str_escape,
-  (Function) strchr_unescape,
-  /* 264 - 267 */
-  (Function) str_unescape,
-  (Function) egg_strcatn,
-  (Function) clear_chanlist_member,
-  (Function) fixfrom,
-  /* 268 - 272 */
-  (Function) sockprotocol,
-  (Function) & socklist,	/* sock_list *				*/
-  (Function) sockoptions,
-  (Function) flush_inbuf,
-  (Function) kill_bot,
-  /* 273 - 276 */
-  (Function) quit_msg,		/* char *				*/
-  (Function) module_load,
-  (Function) 0,
-  (Function) 0,
-  /* 277 - 280 */
-  (Function) ischanhub,        
-  (Function) rand_dccresp,
-  (Function) 0,
-#ifdef LEAF
-  (Function) listen_all,
-#else
-  (Function) 0, /* listen_all */
-#endif
-  /* 281 - 284 */
-/* gay.
-  (Function) MD5_Init,
-  (Function) MD5_Update,
-  (Function) MD5_Final,
-*/
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  (Function) _wild_match_per,
-  /* 285 - 288 */
-  (Function) & role,	 /* int					*/
-  (Function) & loading,	 /* int					*/
-  (Function) & localhub, /* int					*/
-  (Function) updatebin,
-  (Function) stats_add,
-  (Function) lower_bot_linked,
-  (Function) add_cfg,
-  (Function) set_cfg_str,
-  (Function) trigger_cfg_changed,
-  (Function) higher_bot_linked,
-  (Function) bot_aggressive_to,
-  (Function) botunlink,
-  (Function) 0,
-  (Function) & timesync, /* int					*/
-  (Function) 0, 
-  (Function) kickreason,
-  (Function) getting_users,
-  (Function) 0,
-  (Function) 0,
-  (Function) & USERENTRY_ADDED,	/* struct user_entry_type *	*/
-  (Function) bdhash,
-  (Function) isupdatehub,
-  (Function) 0,
-  (Function) botlink,
-  (Function) makeplaincookie,
-  (Function) bankickprefix,
-  (Function) kickprefix,
-  (Function) deflag_user,
-  (Function) dcc_prefix,
-  (Function) goodpass,
-#ifdef S_AUTHCMDS
-  (Function) & auth, /* struct auth_t *auth */
-  (Function) & auth_total,
-  (Function) new_auth,
-  (Function) findauth,
-  (Function) removeauth,
-#else
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-#endif /* S_AUTHCMDS */
-#ifdef S_AUTHHASH
-  (Function) makehash,
-  (Function) authkey,
-#else /* !S_AUTHHASH */
-  (Function) 0,
-  (Function) 0,
-#endif /* S_AUTHHASH */
-  (Function) & USERENTRY_SECPASS,
-  (Function) 0,
-  (Function) 0,
-  (Function) cmdprefix,
-  (Function) replace,
-  (Function) degarble,
-  (Function) egg_inet_ntop,
-  (Function) open_listen,
-  (Function) hostprotocol,
-  (Function) sdprintf,
-  (Function) putbot,
-  (Function) putallbots,
-  (Function) ssl_link,
-  (Function) dropssl,
-  (Function) myipstr,
-  (Function) checkchans,
-#ifdef S_MSGCMDS
-  (Function) & CFG_MSGOP,
-  (Function) & CFG_MSGPASS,
-  (Function) & CFG_MSGINVITE,
-  (Function) & CFG_MSGIDENT,
-#else /* !S_MSGCMDS */
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-  (Function) 0,
-#endif /* S_MSGCMDS */
-  (Function) bind_table_add,
-  (Function) bind_table_add,
-  (Function) add_builtins,
-  (Function) rem_builtins,
-  (Function) bind_table_lookup,
-  (Function) check_bind
-
-};
-
-static bind_table_t *BT_load = NULL;
-
-void init_modules(void)
-{
-  int i;
-
-  BT_load = bind_table_add("load", 1, "s", MATCH_MASK, 0);
-
-  module_list = calloc(1, sizeof(module_entry));
-  module_list->name = strdup("eggdrop");
-  module_list->next = NULL;
-  module_list->funcs = NULL;
-  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 = NULL;
-
-  for (p = module_list; p && p->name; p = p->next)
-    if (!egg_strcasecmp(name, p->name)) {
-      p->funcs = funcs;
-      return 1;
-    }
-  return 0;
-}
-
-const char *module_load(char *name)
-{
-  module_entry *p = NULL;
-  char *e = NULL;
-  Function f;
-  struct static_list *sl = NULL;
-
-  sdprintf("module_load(\"%s\")", name);
-
-  if (module_find(name, 0, 0) != NULL)
-    return "Already loaded";
-
-  for (sl = static_modules; sl && egg_strcasecmp(sl->name, name); sl = sl->next);
-  if (!sl)
-    fatal("Unknown module.", 0);
-
-  f = (Function) sl->func;
-  p = calloc(1, sizeof(module_entry));
-  p->name = strdup(name);
-  p->funcs = 0;
-  p->next = module_list;
-  module_list = p;
-  e = (((char *(*)()) f) (global_table));
-  if (e) {
-    module_list = module_list->next;
-    free(p->name);
-    free(p);
-    return e;
-  }
-  check_bind(BT_load, name, NULL, name);
-  return NULL;
-}
-
-module_entry *module_find(char *name, int major, int minor)
-{
-  module_entry *p;
-
-  for (p = module_list; p && p->name; p = p->next) 
-    if (!egg_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 (!egg_strcasecmp(newname, p->name))
-      return 0;
-
-  for (p = module_list; p && p->name; p = p->next)
-    if (!egg_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 = NULL;
-
-  if (!p) {
-    if (module_load(name2))
-      return 0;
-    p = module_find(name2, major, minor);
-  }
-  if (!p || !o)
-    return 0;
-  d = calloc(1, sizeof(dependancy));
-
-  d->needed = p;
-  d->needing = o;
-  d->next = dependancy_list;
-  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 = NULL;
-
-    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 = calloc(1, sizeof(struct hook_entry));
-
-    p->next = hook_list[hook_num];
-    hook_list[hook_num] = p;
-    p->func = func;
-  } else
-    switch (hook_num) {
-    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;
-    /* special hook <drummer> */
-    case HOOK_RFC_CASECMP:
-      if (func == NULL) {
-	rfc_casecmp = egg_strcasecmp;
-	rfc_ncasecmp = (int (*)(const char *, const char *, int)) egg_strncasecmp;
-	rfc_tolower = tolower;
-	rfc_toupper = toupper;
-      } else {
-	rfc_casecmp = _rfc_casecmp;
-	rfc_ncasecmp = _rfc_ncasecmp;
-	rfc_tolower = _rfc_tolower;
-	rfc_toupper = _rfc_toupper;
-      }
-      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_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;
-    }
-}
-
-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)
-{
-  module_entry *p = module_list;
-
-  if (p && !which && details)
-    dprintf(idx, "MODULES LOADED:\n");
-  for (; p; p = p->next) {
-    if (!which || !egg_strcasecmp(which, p->name)) {
-      dependancy *d;
-
-      if (details)
-	dprintf(idx, "Module: %s\n", p->name ? p->name : "CORE");
-
-      if (details > 1) {
-	for (d = dependancy_list; d; d = d->next) 
-	  if (d->needing == p)
-	    dprintf(idx, "    requires: %s\n", d->needed->name);
-      }
-      if (p->funcs) {
-	Function f = p->funcs[MODCALL_REPORT];
-
-	if (f != NULL)
-	  f(idx, details);
-      }
-      if (which)
-	return;
-    }
-  }
-  if (which)
-    dprintf(idx, "No such module.\n");
-}

+ 0 - 60
src/modules.h

@@ -1,60 +0,0 @@
-/*
- * modules.h
- *   support for modules in eggdrop
- *
- * by Darrin Smith (beldin@light.iinet.net.au)
- *
- */
-
-#ifndef _EGG_MODULE_H
-#define _EGG_MODULE_H
-
-/* Module related structures
- */
-#include "mod/modvals.h"
-#include "types.h"
-
-#ifndef MAKING_NUMMODS
-extern module_entry 		*module_list;
-
-void check_static(char *, char *(*)());
-
-/* Modules specific functions and functions called by eggdrop
- */
-
-void do_module_report(int, int, char *);
-
-int module_register(char *name, Function * funcs,
-		    int major, int minor);
-const char *module_load(char *module_name);
-char *module_unload(char *module_name, char *nick);
-module_entry *module_find(char *name, int, int);
-Function *module_depend(char *, char *, int major, int minor);
-int module_undepend(char *);
-void add_hook(int hook_num, Function func);
-void del_hook(int hook_num, Function func);
-void *get_next_hook(int hook_num, void *func);
-extern 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)
-int call_hook_cccc(int, char *, char *, char *, char *);
-
-#endif
-
-typedef struct _dependancy {
-  struct _module_entry *needed;
-  struct _module_entry *needing;
-  struct _dependancy *next;
-} dependancy;
-extern dependancy *dependancy_list;
-#endif				/* _EGG_MODULE_H */

+ 0 - 5
src/net.h

@@ -119,8 +119,6 @@ typedef struct {
 } sock_list;
 
 
-#ifndef MAKING_MODS
-
 # define killsock(x)     	real_killsock((x),__FILE__,__LINE__)
 
 IP my_atoul(char *);
@@ -178,7 +176,4 @@ extern int				firewallport, resolve_timeout, MAXSOCKS;
 extern jmp_buf				alarmret;
 extern sock_list			*socklist;
 
-
-#endif /* !MAKING_MODS */
-
 #endif /* !_NET_H */

+ 76 - 95
src/rfc1459.c

@@ -2,32 +2,11 @@
  * rfc1459.c
  * 
  */
-/* 
- * Copyright (C) 1990 Jarkko Oikarinen
- * Copyright (C) 1999, 2000, 2001, 2002 Eggheads Development Team
- * 
- * This code was more or less cloned from the ircd-hybrid 5.3 source.
- * The original code was written by Otto Harkoonen and even though it
- * it not entirely in synch with section 2.2 of RFC1459 in that it
- * additionally defines carat as an uppercase version of tilde, it's
- * what is in the servers themselves so we're going with it this way.
- * 
- * If for some reason someone who maintains the source for ircd decides
- * to change the code to be completely RFC compliant, the change here
- * would be absolutely miniscule.
- * 
- * BTW, since carat characters are allowed in nicknames and tildes are
- * not, I stronly suggest that people convert to uppercase when doing
- * comparisons or creation of hash elements (which tcl laughably calls
- * arrays) to avoid making entries with impossible nicknames in them.
- * 
- * --+ Dagmar
- */
-
 #include "common.h"
 #include "rfc1459.h"
 
-int _rfc_casecmp(const char *s1, const char *s2)
+int
+rfc_casecmp(const char *s1, const char *s2)
 {
   register unsigned char *str1 = (unsigned char *) s1;
   register unsigned char *str2 = (unsigned char *) s2;
@@ -42,7 +21,8 @@ int _rfc_casecmp(const char *s1, const char *s2)
   return (res);
 }
 
-int _rfc_ncasecmp(const char *str1, const char *str2, int n)
+int
+rfc_ncasecmp(const char *str1, const char *str2, int n)
 {
   register unsigned char *s1 = (unsigned char *) str1;
   register unsigned char *s2 = (unsigned char *) str2;
@@ -61,81 +41,82 @@ int _rfc_ncasecmp(const char *str1, const char *str2, int n)
 unsigned char rfc_tolowertab[];
 unsigned char rfc_touppertab[];
 
-int _rfc_tolower(int c)
+int
+rfc_tolower(int c)
 {
-  return rfc_tolowertab[(unsigned char)(c)];
+  return rfc_tolowertab[(unsigned char) (c)];
 }
 
-int _rfc_toupper(int c)
+int
+rfc_toupper(int c)
 {
-  return rfc_touppertab[(unsigned char)(c)];
+  return rfc_touppertab[(unsigned char) (c)];
 }
 
-unsigned char rfc_tolowertab[] =
-{0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa,
- 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14,
- 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
- 0x1e, 0x1f,
- ' ', '!', '"', '#', '$', '%', '&', 0x27, '(', ')',
- '*', '+', ',', '-', '.', '/',
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
- ':', ';', '<', '=', '>', '?',
- '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
- 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
- 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~',
- '_',
- '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
- 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
- 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~',
- 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
- 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
- 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9,
- 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
- 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
- 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9,
- 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
- 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
- 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff};
-
-unsigned char rfc_touppertab[] =
-{0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa,
- 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14,
- 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
- 0x1e, 0x1f,
- ' ', '!', '"', '#', '$', '%', '&', 0x27, '(', ')',
- '*', '+', ',', '-', '.', '/',
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
- ':', ';', '<', '=', '>', '?',
- '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
- 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
- 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^',
- 0x5f,
- '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
- 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
- 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^',
- 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
- 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
- 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9,
- 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
- 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
- 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9,
- 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
- 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
- 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff};
+unsigned char rfc_tolowertab[] = { 0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa,
+  0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14,
+  0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
+  0x1e, 0x1f,
+  ' ', '!', '"', '#', '$', '%', '&', 0x27, '(', ')',
+  '*', '+', ',', '-', '.', '/',
+  '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+  ':', ';', '<', '=', '>', '?',
+  '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
+  'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
+  't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~',
+  '_',
+  '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
+  'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
+  't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~',
+  0x7f,
+  0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
+  0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+  0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
+  0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
+  0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9,
+  0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
+  0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
+  0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
+  0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
+  0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
+  0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9,
+  0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
+  0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
+  0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
+  0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
+  0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
+};
 
+unsigned char rfc_touppertab[] = { 0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa,
+  0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14,
+  0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
+  0x1e, 0x1f,
+  ' ', '!', '"', '#', '$', '%', '&', 0x27, '(', ')',
+  '*', '+', ',', '-', '.', '/',
+  '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+  ':', ';', '<', '=', '>', '?',
+  '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
+  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
+  'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^',
+  0x5f,
+  '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
+  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
+  'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^',
+  0x7f,
+  0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
+  0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+  0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
+  0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
+  0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9,
+  0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
+  0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
+  0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
+  0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
+  0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
+  0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9,
+  0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
+  0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
+  0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
+  0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
+  0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
+};

+ 4 - 13
src/rfc1459.h

@@ -1,18 +1,9 @@
 #ifndef _RFC1459_H
 #define _RFC1459_H
 
-#ifndef MAKING_MODS
-extern int (*rfc_casecmp) (const char *, const char *);
-extern int (*rfc_ncasecmp) (const char *, const char *, int);
-extern int (*rfc_toupper) (int);
-extern int (*rfc_tolower) (int);
-
-int _rfc_casecmp(const char *, const char *);
-int _rfc_ncasecmp(const char *, const char *, int);
-int _rfc_toupper(int);
-int _rfc_tolower(int);
-
-#endif /* !MAKING_MODS */
-
+int rfc_casecmp(const char *, const char *);
+int rfc_ncasecmp(const char *, const char *, int);
+int rfc_toupper(int);
+int rfc_tolower(int);
 
 #endif /* !_RFC1459_H */

+ 0 - 1
src/shell.c

@@ -18,7 +18,6 @@
 #include "tandem.h"
 #include "main.h"
 #include "dccutil.h"
-#include "modules.h"
 #include "misc.h"
 #include "misc_file.h"
 #include "bg.h"

+ 0 - 4
src/shell.h

@@ -36,8 +36,6 @@
 #define DET_DIE 3
 #define DET_SUICIDE 4
 
-
-#ifndef MAKING_MODS
 void check_mypid();
 int clear_tmp();
 char *homedir();
@@ -59,7 +57,5 @@ void crontab_del();
 int crontab_exists();
 void crontab_create(int);
 void check_trace_start();
-#endif /* !MAKING_MODS */
-
 
 #endif /* _SHELL_H */

+ 0 - 6
src/tandem.h

@@ -41,8 +41,6 @@ typedef struct {
 #define GLOBAL_CHANS 100000
 
 
-#ifndef MAKING_MODS
-
 void botnet_send_chan(int, char *, char *, int, char *);
 void botnet_send_chat(int, char *, char *);
 void botnet_send_act(int, char *, char *, int, char *);
@@ -76,10 +74,6 @@ int botnet_send_cmd(char * fbot, char * bot, char * from, int fromidx, char * cm
 void botnet_send_cmd_broad(int idx, char * fbot, char * from, int fromidx, char * cmd);
 void botnet_send_cmdreply(char * fbot, char * bot, char * to, char * toidx, char * ln);
 
-
-#endif				/* MAKING_MODS */
-
-
 #define b_status(a)	(dcc[a].status)
 #define b_version(a)	(dcc[a].u.bot->version)
 #define b_linker(a)	(dcc[a].u.bot->linker)

+ 0 - 6
src/tclhash.h

@@ -57,9 +57,6 @@ typedef struct bind_table_b {
 } bind_table_t;
 
 
-#ifndef MAKING_MODS
-
-
 void kill_binds(void);
 void binds_init();
 
@@ -73,7 +70,4 @@ int bind_entry_modify(bind_table_t *table, int id, const char *mask, const char
 void add_builtins(const char *table_name, cmd_t *cmds);
 void rem_builtins(const char *table_name, cmd_t *cmds);
 
-#endif
-
-
 #endif				/* _EGG_TCLHASH_H */

+ 0 - 2
src/userent.h

@@ -3,10 +3,8 @@
 
 #include "users.h"
 
-#ifndef MAKING_MODS
 void update_mod(char *, char *, char *, char *);
 void list_type_kill(struct list_type *);
 void stats_add(struct userrec *, int, int);
-#endif /* !MAKING_MODS */
 
 #endif /* !_USERENT_H */

+ 1 - 1
src/userrec.c

@@ -19,7 +19,7 @@
 #include "chan.h"
 #include "match.h"
 #include "dccutil.h"
-#include "modules.h"
+#include "hooks.h"
 #include "tandem.h"
 #include "chanprog.h"
 #include "crypt.h"

+ 0 - 4
src/userrec.h

@@ -1,8 +1,6 @@
 #ifndef _USERREC_H
 #define _USERREC_H
 
-
-#ifndef MAKING_MODS
 void deflag_user(struct userrec *, int, char *, struct chanset_t *);
 struct userrec *adduser(struct userrec *, char *, char *, char *, int);
 void addhost_by_handle(char *, char *);
@@ -26,6 +24,4 @@ char *fixfrom(char *);
 extern struct userrec  		*userlist, *lastuser;
 extern int			noshare, cache_hit, cache_miss, strict_host,
 				userfile_perm;
-#endif /* !MAKING_MODS */
-
 #endif /* !_USERREC_H */

+ 2 - 7
src/users.c

@@ -28,9 +28,9 @@
 #include "crypt.h"
 #include "botnet.h"
 #include "chan.h"
-#include "modules.h"
 #include "tandem.h"
 #include "src/mod/channels.mod/channels.h"
+#include "src/mod/notes.mod/notes.h"
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #ifdef HUB
@@ -456,13 +456,8 @@ void tell_user(int idx, struct userrec *u, int master)
   struct user_entry *ue = NULL;
   struct laston_info *li = NULL;
   struct flag_record fr = {FR_GLOBAL, 0, 0, 0, 0, 0};
-  module_entry *me = NULL;
-
-  if ((me = module_find("notes", 0, 0))) {
-    Function *func = me->funcs;
-    n = (func[5]) (u->handle);
-  }
 
+  n = num_notes(u->handle);
 
   fr.global = u->flags;
   fr.udef_global = u->flags_udef;

+ 0 - 5
src/users.h

@@ -46,7 +46,6 @@ struct user_entry_type {
 };
 
 
-#ifndef MAKING_MODS
 extern struct user_entry_type USERENTRY_COMMENT, USERENTRY_LASTON,
  USERENTRY_INFO, USERENTRY_BOTADDR, USERENTRY_HOSTS,
  USERENTRY_PASS, USERENTRY_BOTFL,
@@ -55,8 +54,6 @@ extern struct user_entry_type USERENTRY_COMMENT, USERENTRY_LASTON,
   USERENTRY_MODIFIED,
   USERENTRY_CONFIG,
   USERENTRY_SECPASS;
-#endif /* MAKING_MODS */
-
 
 struct laston_info {
   time_t laston;
@@ -178,7 +175,6 @@ int def_dupuser(struct userrec *new, struct userrec *old,
 		struct user_entry *e);
 
 
-#ifndef MAKING_MODS
 #ifdef HUB
 void backup_userfile();
 #endif /* HUB */
@@ -197,6 +193,5 @@ void link_pref_val(struct userrec *u, char *lval);
 
 extern char			natip[], userfile[];
 extern int			ignore_time;
-#endif /* !MAKING_MODS */
 
 #endif				/* _EGG_USERS_H */