[cvslog] Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Sun Oct 21 20:50:02 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2001-10-22 01:49:35 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Modified files:
     src/modules.c src/egglib/msprintf.h src/egglib/mstack.h
     src/mod/module.h src/mod/perlscript.mod/perlscript.c
     src/mod/tclscript.mod/tclscript.c

Log message:

* Moved msprintf and mstack to the function table (boo this is temporary I hope)
* Fixed compile warnings and some other stuff in perlscript.mod so that it compiles and loads (but you can't use it to write a script yet).

---------------------- diff included ----------------------
Index: eggdrop1.7/src/egglib/msprintf.h
diff -u eggdrop1.7/src/egglib/msprintf.h:1.1 eggdrop1.7/src/egglib/msprintf.h:1.2
--- eggdrop1.7/src/egglib/msprintf.h:1.1	Sat Oct 13 23:44:37 2001
+++ eggdrop1.7/src/egglib/msprintf.h	Sun Oct 21 20:49:25 2001
@@ -1,6 +1,8 @@
 #ifndef _MSPRINTF_H_
 #define _MSPRINTF_H_
 
+#ifndef MAKING_MODS
 char *msprintf(char *format, ...);
+#endif
 
 #endif
Index: eggdrop1.7/src/egglib/mstack.h
diff -u eggdrop1.7/src/egglib/mstack.h:1.1 eggdrop1.7/src/egglib/mstack.h:1.2
--- eggdrop1.7/src/egglib/mstack.h:1.1	Sat Oct 13 23:44:37 2001
+++ eggdrop1.7/src/egglib/mstack.h	Sun Oct 21 20:49:25 2001
@@ -7,10 +7,12 @@
 	int *stack;
 } mstack_t;
 
+#ifndef MAKING_MODS
 mstack_t *mstack_new(int initial_size);
 int mstack_destroy(mstack_t *m);
 void *mstack_push(mstack_t *m, void *item);
 int mstack_pop(mstack_t *m, void **itemptr);
 int mstack_grow(mstack_t *m, int nsteps);
+#endif
 
 #endif
Index: eggdrop1.7/src/mod/module.h
diff -u eggdrop1.7/src/mod/module.h:1.73 eggdrop1.7/src/mod/module.h:1.74
--- eggdrop1.7/src/mod/module.h:1.73	Sat Oct 20 22:44:30 2001
+++ eggdrop1.7/src/mod/module.h	Sun Oct 21 20:49:25 2001
@@ -1,7 +1,7 @@
 /*
  * module.h
  *
- * $Id: module.h,v 1.73 2001/10/21 03:44:30 stdarg Exp $
+ * $Id: module.h,v 1.74 2001/10/22 01:49:25 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -460,6 +460,12 @@
 #ifndef HAVE_ASPRINTF
 # define asprintf ((int (*)(char **, const char *, ...))global[287])
 #endif
+
+/* 288 - 291 */
+#define msprintf ((char *(*)())global[288])
+#define mstack_new ((mstack_t *(*)())global[289])
+#define mstack_push ((void *(*)())global[290])
+#define mstack_destroy ((void *(*)())global[291])
 
 /* This is for blowfish module, couldnt be bothered making a whole new .h
  * file for it ;)
Index: eggdrop1.7/src/mod/perlscript.mod/perlscript.c
diff -u eggdrop1.7/src/mod/perlscript.mod/perlscript.c:1.3 eggdrop1.7/src/mod/perlscript.mod/perlscript.c:1.4
--- eggdrop1.7/src/mod/perlscript.mod/perlscript.c:1.3	Sun Oct 21 12:38:25 2001
+++ eggdrop1.7/src/mod/perlscript.mod/perlscript.c	Sun Oct 21 20:49:25 2001
@@ -15,6 +15,7 @@
 static PerlInterpreter *ginterp; /* Our global interpreter. */
 
 static XS(my_command_handler);
+static SV *my_resolve_variable(script_var_t *v);
 
 static int my_load_script(registry_entry_t * entry, char *fname)
 {
@@ -48,7 +49,7 @@
 	int retval, i, n, count;
 	script_var_t var;
 	SV *arg;
-	void **al;
+	int *al;
 	dSP;
 
 	ENTER;
@@ -148,7 +149,7 @@
 			char str[32];
 			int str_len;
 
-			sprintf(str, "#%u", v->value);
+			sprintf(str, "#%u", (unsigned int) v->value);
 			str_len = strlen(str);
 			result = newSVpv(str, str_len);
 			break;
@@ -325,7 +326,7 @@
 	(Function) 0
 };
 
-char *perlmodule_LTX_start(Function *global_funcs)
+char *perlscript_LTX_start(Function *global_funcs)
 {
 	char *embedding[] = {"", "-e", "0"};
 
@@ -337,7 +338,8 @@
         registry_lookup("script", "playback", &journal_playback, &journal_playback_h);
         if (journal_playback) journal_playback(journal_playback_h, journal_table);
 
-	if (module_register("perlscript", perlscript_table, 107, 0)) {
+	module_register("perlscript", perlscript_table, 1, 2);
+	if (!module_depend("perlscript", "eggdrop", 107, 0)) {
 		module_undepend("perlscript");
 		return "This module requires eggdrop1.7.0 of later";
 	}
Index: eggdrop1.7/src/mod/tclscript.mod/tclscript.c
diff -u eggdrop1.7/src/mod/tclscript.mod/tclscript.c:1.11 eggdrop1.7/src/mod/tclscript.mod/tclscript.c:1.12
--- eggdrop1.7/src/mod/tclscript.mod/tclscript.c:1.11	Sun Oct 21 01:02:48 2001
+++ eggdrop1.7/src/mod/tclscript.mod/tclscript.c	Sun Oct 21 20:49:25 2001
@@ -27,7 +27,6 @@
 static Tcl_Obj *my_resolve_var(Tcl_Interp *myinterp, script_var_t *v);
 
 static Tcl_Interp *ginterp; /* Our global interpreter. */
-static char *my_syntax_error = "syntax error";
 
 static char *error_logfile = NULL;
 
@@ -265,7 +264,7 @@
 		case SCRIPT_POINTER: {
 			char str[32];
 
-			sprintf(str, "#%u", v->value);
+			sprintf(str, "#%u", (unsigned int) v->value);
 			result = Tcl_NewStringObj(str, -1);
 			break;
 		}
@@ -386,7 +385,6 @@
 
 static int my_argument_cleanup(script_argstack_t *argstack)
 {
-	void *ptr;
 	int i;
 
 	for (i = 0; i < argstack->bufs->len; i++) {
@@ -472,7 +470,7 @@
 	{"unlink str", my_unlink_var, 2},
 	{"create cmd", my_create_cmd, 2},
 	{"delete cmd", my_delete_cmd, 2},
-	0
+	{0}
 };
 
 static Function journal_table[] = {
Index: eggdrop1.7/src/modules.c
diff -u eggdrop1.7/src/modules.c:1.81 eggdrop1.7/src/modules.c:1.82
--- eggdrop1.7/src/modules.c:1.81	Sat Oct 20 22:44:30 2001
+++ eggdrop1.7/src/modules.c	Sun Oct 21 20:49:24 2001
@@ -4,7 +4,7 @@
  * 
  * by Darrin Smith (beldin at light.iinet.net.au)
  * 
- * $Id: modules.c,v 1.81 2001/10/21 03:44:30 stdarg Exp $
+ * $Id: modules.c,v 1.82 2001/10/22 01:49:24 stdarg Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -31,6 +31,8 @@
 #include "registry.h"
 #include "core_binds.h"
 #include <ctype.h>
+#include "egglib/msprintf.h"
+#include "egglib/mstack.h"
 
 #include <ltdl.h>
 
@@ -555,10 +557,16 @@
   (Function) 0,
 #endif
 #ifndef HAVE_ASPRINTF
-  (Function) asprintf
+  (Function) asprintf,
 #else
-  (Function) 0
+  (Function) 0,
 #endif
+
+	/* 288 - 291 -- egglib stuff */
+	(Function) msprintf,
+	(Function) mstack_new,
+	(Function) mstack_push,
+	(Function) mstack_destroy
 };
 
 static bind_table_t *BT_load, *BT_unload;
----------------------- End of diff -----------------------



More information about the Changes mailing list