[cvslog] (2004-12-13 15:02:40 UTC) Module eggdrop1.9: Change committed!

cvslog cvs at tsss.org
Mon Dec 13 09:02:40 CST 2004


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.9
Commit time: 2004-12-13 15:02:40 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Modified files:
     lib/eggdrop/binds.c lib/eggdrop/xmlread.c
     modules/server/egg_server_api.c

Added files:
     modules/chanserv/Makefile.am modules/chanserv/chanserv.c
     modules/chanserv/chanserv.h modules/chanserv/config.m4
     modules/chanserv/events.c modules/chanserv/events.h

Log message:

* skeleton for channel services module

---------------------- diff included ----------------------
Index: eggdrop1.9/lib/eggdrop/binds.c
diff -u eggdrop1.9/lib/eggdrop/binds.c:1.21 eggdrop1.9/lib/eggdrop/binds.c:1.22
--- eggdrop1.9/lib/eggdrop/binds.c:1.21	Sun Oct 17 00:14:06 2004
+++ eggdrop1.9/lib/eggdrop/binds.c	Mon Dec 13 09:02:29 2004
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: binds.c,v 1.21 2004/10/17 05:14:06 stdarg Exp $";
+static const char rcsid[] = "$Id: binds.c,v 1.22 2004/12/13 15:02:29 stdarg Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -386,12 +386,10 @@
 			if (!cmp) continue;
 		}
 
-		if (table->match_type & MATCH_MASK) {
+		if (table->match_type & MATCH_NONE || !entry->mask) cmp = 0;
+		else if (table->match_type & MATCH_MASK) {
 			cmp = !wild_match_per((unsigned char *)entry->mask, (unsigned char *)match);
 		}
-		else if (table->match_type & MATCH_NONE) {
-			cmp = 0;
-		}
 		else if (table->match_type & MATCH_PARTIAL) {
 			cmp = 1;
 			if (!strncasecmp(match, entry->mask, matchlen)) {
Index: eggdrop1.9/lib/eggdrop/xmlread.c
diff -u eggdrop1.9/lib/eggdrop/xmlread.c:1.20 eggdrop1.9/lib/eggdrop/xmlread.c:1.21
--- eggdrop1.9/lib/eggdrop/xmlread.c:1.20	Sun Oct 17 03:38:11 2004
+++ eggdrop1.9/lib/eggdrop/xmlread.c	Mon Dec 13 09:02:29 2004
@@ -281,7 +281,6 @@
 {
 	char *ptr, *buf = *bufptr;
 	int ret;
-	char temp[8];
 
 	do {
 		ptr = strchr(buf, '<');
Index: eggdrop1.9/modules/chanserv/Makefile.am
diff -u /dev/null eggdrop1.9/modules/chanserv/Makefile.am:1.1
--- /dev/null	Mon Dec 13 09:02:40 2004
+++ eggdrop1.9/modules/chanserv/Makefile.am	Mon Dec 13 09:02:29 2004
@@ -0,0 +1,8 @@
+# $Id: Makefile.am,v 1.1 2004/12/13 15:02:29 stdarg Exp $
+
+include $(top_srcdir)/$(ac_aux_dir)/module.mk
+
+pkglib_LTLIBRARIES	= chanserv.la
+chanserv_la_SOURCES	= chanserv.c chanserv.h events.c
+chanserv_la_LDFLAGS	= -module -avoid-version -no-undefined
+chanserv_la_LIBADD	= @LIBS@ $(top_builddir)/lib/eggdrop/libeggdrop.la
Index: eggdrop1.9/modules/chanserv/chanserv.c
diff -u /dev/null eggdrop1.9/modules/chanserv/chanserv.c:1.1
--- /dev/null	Mon Dec 13 09:02:40 2004
+++ eggdrop1.9/modules/chanserv/chanserv.c	Mon Dec 13 09:02:29 2004
@@ -0,0 +1,71 @@
+/* chanserv.c: channel services
+ *
+ * Copyright (C) 2003, 2004 Eggheads Development Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id: chanserv.c,v 1.1 2004/12/13 15:02:29 stdarg Exp $";
+#endif
+
+#include <eggdrop/eggdrop.h>
+
+#include "chanserv.h"
+
+chan_config_t chan_config = {0};
+egg_server_api_t *server = NULL;
+
+static config_var_t chan_config_vars[] = {
+	{"enforcebans", &chan_config.enforcebans, CONFIG_INT},
+	{0}
+};
+
+EXPORT_SCOPE int chanserv_LTX_start(egg_module_t *modinfo);
+static int chanserv_close(int why);
+
+static int chanserv_init()
+{
+	server = module_get_api("server", 1, 0);
+	events_init();
+	return(0);
+}
+
+static int chanserv_close(int why)
+{
+	return(0);
+}
+
+int chanserv_LTX_start(egg_module_t *modinfo)
+{
+	void *config_root;
+
+	modinfo->name = "chanserv";
+	modinfo->author = "eggdev";
+	modinfo->version = "1.0.0";
+	modinfo->description = "channel services";
+	modinfo->close_func = chanserv_close;
+
+	/* Set defaults. */
+	memset(&chan_config, 0, sizeof(chan_config));
+
+	/* Link our vars in. */
+	config_root = config_get_root("eggdrop");
+	config_link_table(chan_config_vars, config_root, "chanserv", 0, NULL);
+	config_update_table(chan_config_vars, config_root, "chanserv", 0, NULL);
+
+	chanserv_init();
+	return(0);
+}
Index: eggdrop1.9/modules/chanserv/chanserv.h
diff -u /dev/null eggdrop1.9/modules/chanserv/chanserv.h:1.1
--- /dev/null	Mon Dec 13 09:02:40 2004
+++ eggdrop1.9/modules/chanserv/chanserv.h	Mon Dec 13 09:02:29 2004
@@ -0,0 +1,45 @@
+/* chanserv.h: header for chanserv.c
+ *
+ * Copyright (C) 2003, 2004 Eggheads Development Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id: chanserv.h,v 1.1 2004/12/13 15:02:29 stdarg Exp $
+ */
+
+#ifndef _EGG_MOD_CHANSERV_CHANSERV_H_
+#define _EGG_MOD_CHANSERV_CHANSERV_H_
+
+#include <modules/server/egg_server_api.h>
+
+#define chan_config chanserv_LTX_chan_config
+#define server chanserv_LTX_server
+#define events_init chanserv_LTX_events_init
+
+#include "events.h"
+
+typedef struct {
+	int short_joins, long_joins;
+} chanserv_stats_t;
+
+typedef struct {
+	int short_join_period, long_join_period;
+	int short_join_limit, long_join_limit;
+} chan_config_t;
+
+extern chan_config_t chan_config;
+extern egg_server_api_t *server;
+
+#endif
Index: eggdrop1.9/modules/chanserv/config.m4
diff -u /dev/null eggdrop1.9/modules/chanserv/config.m4:1.1
--- /dev/null	Mon Dec 13 09:02:40 2004
+++ eggdrop1.9/modules/chanserv/config.m4	Mon Dec 13 09:02:29 2004
@@ -0,0 +1,26 @@
+dnl config.m4
+dnl
+dnl Copyright (C) 2004 Eggheads Development Team
+dnl
+dnl This program is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License
+dnl as published by the Free Software Foundation; either version 2
+dnl of the License, or (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+dnl
+dnl $Id: config.m4,v 1.1 2004/12/13 15:02:29 stdarg Exp $
+dnl
+
+EGG_MODULE_START(chanserv, [channel services], "yes")
+
+# Nothing special to configure in this module
+
+EGG_MODULE_END()
Index: eggdrop1.9/modules/chanserv/events.c
diff -u /dev/null eggdrop1.9/modules/chanserv/events.c:1.1
--- /dev/null	Mon Dec 13 09:02:40 2004
+++ eggdrop1.9/modules/chanserv/events.c	Mon Dec 13 09:02:29 2004
@@ -0,0 +1,43 @@
+/* events.c -- respond to irc events
+ *
+ * Copyright (C) 2003, 2004 Eggheads Development Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id: events.c,v 1.1 2004/12/13 15:02:29 stdarg Exp $";
+#endif
+
+#include <eggdrop/eggdrop.h>
+
+#include "chanserv.h"
+
+static int got_join(const char *nick, const char *uhost, user_t *u, const char *chan);
+
+static int got_join(const char *nick, const char *uhost, user_t *u, const char *chan)
+{
+	if (u) {
+		/* Check if we're sending greets. */
+		server->printserv(SERVER_NORMAL, "PRIVMSG %s :[%s] <greet goes here>", chan, u->handle);
+	}
+	return(0);
+}
+
+int events_init()
+{
+	bind_add_simple("join", NULL, NULL, got_join);
+	return(0);
+}
Index: eggdrop1.9/modules/chanserv/events.h
diff -u /dev/null eggdrop1.9/modules/chanserv/events.h:1.1
--- /dev/null	Mon Dec 13 09:02:40 2004
+++ eggdrop1.9/modules/chanserv/events.h	Mon Dec 13 09:02:29 2004
@@ -0,0 +1,27 @@
+/* events.h: header for events.c
+ *
+ * Copyright (C) 2003, 2004 Eggheads Development Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id: events.h,v 1.1 2004/12/13 15:02:29 stdarg Exp $
+ */
+
+#ifndef _EGG_MOD_CHANSERV_EVENTS_H_
+#define _EGG_MOD_CHANSERV_EVENTS_H_
+
+extern int events_init();
+
+#endif
Index: eggdrop1.9/modules/server/egg_server_api.c
diff -u eggdrop1.9/modules/server/egg_server_api.c:1.2 eggdrop1.9/modules/server/egg_server_api.c:1.3
--- eggdrop1.9/modules/server/egg_server_api.c:1.2	Sun Sep 26 04:42:09 2004
+++ eggdrop1.9/modules/server/egg_server_api.c	Mon Dec 13 09:02:29 2004
@@ -3,7 +3,6 @@
 void *server_get_api()
 {
 	static egg_server_api_t api;
-#if 0
 
 	api.major = EGG_SERVER_API_MAJOR;
 	api.minor = EGG_SERVER_API_MINOR;
@@ -18,6 +17,7 @@
 	api.queue_get_by_priority = queue_get_by_priority;
 	api.dequeue_messages = dequeue_messages;
 
+#if 0
 	/* Channel functions. */
 	int (*channel_list)(const char ***chans);
 	int (*channel_list_members)(const char *chan, const char ***members);
----------------------- End of diff -----------------------



More information about the Changes mailing list