summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/demos/catserv/Makefile9
-rw-r--r--src/modules/demos/catserv/README4
-rw-r--r--src/modules/demos/catserv/catserv_extern.h11
-rw-r--r--src/modules/demos/catserv/catserv_messages.c14
-rw-r--r--src/modules/demos/catserv/catserv_messages.h10
-rw-r--r--src/modules/demos/catserv/ircd_catserv.c110
-rw-r--r--src/modules/demos/catserv/makefile.win324
-rw-r--r--src/modules/demos/catserv/meow.c9
-rw-r--r--src/modules/demos/catserv/meow.h9
-rw-r--r--src/modules/demos/catserv/purr.c8
-rw-r--r--src/modules/demos/catserv/purr.h9
-rw-r--r--src/modules/demos/events.c82
-rw-r--r--src/modules/demos/hs_conf.c74
-rw-r--r--src/modules/demos/hs_moo.c119
14 files changed, 0 insertions, 472 deletions
diff --git a/src/modules/demos/catserv/Makefile b/src/modules/demos/catserv/Makefile
deleted file mode 100644
index 5b2f4efa3..000000000
--- a/src/modules/demos/catserv/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-SRCS= ircd_catserv.c \
- catserv_messages.c \
- meow.c \
- purr.c
-
-TARGET=ircd_catserv
-
-include ../Makefile.sub
-
diff --git a/src/modules/demos/catserv/README b/src/modules/demos/catserv/README
deleted file mode 100644
index c3d3f7084..000000000
--- a/src/modules/demos/catserv/README
+++ /dev/null
@@ -1,4 +0,0 @@
-This is an EXAMPLE module, it serves no real purpose.
-
-This module was broken down into multiple files to demonstrate how multiple files can be used.
-
diff --git a/src/modules/demos/catserv/catserv_extern.h b/src/modules/demos/catserv/catserv_extern.h
deleted file mode 100644
index 02c21addb..000000000
--- a/src/modules/demos/catserv/catserv_extern.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef CATSERV_DEFS_H
-#define CATSERV_DEFS_H
-
-#ifdef _WIN32
-extern __declspec(dllexport) char *s_CatServ;
-#else
-E char *s_CatServ;
-#endif
-
-#endif
-
diff --git a/src/modules/demos/catserv/catserv_messages.c b/src/modules/demos/catserv/catserv_messages.c
deleted file mode 100644
index 667b336b5..000000000
--- a/src/modules/demos/catserv/catserv_messages.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "catserv_messages.h"
-#include "module.h"
-#include "meow.h"
-#include "purr.h"
-
-void addMessageList(void)
-{
- Command *c;
- c = createCommand("meow", do_meow, NULL, -1, -1, -1, -1, -1);
- this->AddCommand(Catserv_cmdTable, c, MOD_UNIQUE);
- c = createCommand("purr", do_purr, NULL, -1, -1, -1, -1, -1);
- this->AddCommand(Catserv_cmdTable, c, MOD_UNIQUE);
-}
-
diff --git a/src/modules/demos/catserv/catserv_messages.h b/src/modules/demos/catserv/catserv_messages.h
deleted file mode 100644
index bb3f82dd0..000000000
--- a/src/modules/demos/catserv/catserv_messages.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef CATSERV_MESSAGES_H
-#define CATSERV_MESSAGES_H
-
-#include "module.h"
-
-CommandHash *Catserv_cmdTable[MAX_CMD_HASH];
-void addMessageList(void);
-
-#endif
-
diff --git a/src/modules/demos/catserv/ircd_catserv.c b/src/modules/demos/catserv/ircd_catserv.c
deleted file mode 100644
index 0f98df58a..000000000
--- a/src/modules/demos/catserv/ircd_catserv.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * Simple module to load up a client called CatServ and process commands for it
- * This module is an example, and has no useful purpose!
- *
- * Please visit http://modules.anope.org for useful modules!
- *
- **/
-
-#include "module.h"
-#include "catserv_messages.h"
-
-#define AUTHOR "Anope"
-#define VERSION "$Id$"
-
-int my_privmsg(char *source, int ac, char **av);
-
-void addClient(char *nick, char *realname);
-void delClient(void);
-void catserv(User * u, char *buf);
-
-char *s_CatServ = "CatServ";
-
-int AnopeInit(int argc, char **argv)
-{
- Message *msg = NULL;
- int status;
-#ifdef IRC_UNREAL32
- if (UseTokens) {
- msg = createMessage("!", my_privmsg);
- } else {
- msg = createMessage("PRIVMSG", my_privmsg);
- }
-#else
- msg = createMessage("PRIVMSG", my_privmsg);
-#endif
- status = moduleAddMessage(msg, MOD_HEAD);
- if (status == MOD_ERR_OK) {
- addClient(s_CatServ, "meow!");
- addMessageList();
- }
- this->SetAuthor(AUTHOR);
- this->SetVersion(VERSION);
- alog("ircd_catserv.so: loaded, message status [%d]", status);
- return MOD_CONT;
-}
-
-void AnopeFini(void)
-{
- delClient();
-}
-
-int my_privmsg(char *source, int ac, char **av)
-{
- User *u;
- char *s;
-
- /* First, some basic checks */
- if (ac != 2)
- return MOD_CONT; /* bleh */
- if (!(u = finduser(source))) {
- return MOD_CONT;
- } /* non-user source */
- if (*av[0] == '#') {
- return MOD_CONT;
- }
- /* Channel message */
- /* we should prolly honour the ignore list here, but i cba for this... */
- s = strchr(av[0], '@');
- if (s) {
- *s++ = 0;
- if (stricmp(s, ServerName) != 0)
- return MOD_CONT;
- }
- if ((stricmp(av[0], s_CatServ)) == 0) { /* its for US! */
- catserv(u, av[1]);
- return MOD_STOP;
- } else { /* ok it isnt us, let the old code have it */
- return MOD_CONT;
- }
-}
-
-void addClient(char *nick, char *realname)
-{
- anope_SendClientIntroduction(nick, "catserv", "meow.meow.land", realname, "+");
-}
-
-void delClient(void)
-{
- anope_SendQuit(s_CatServ, "QUIT :Module Unloaded!");
-}
-
-/*****************************************************************************/
-/* Main CatServ routine. */
-void catserv(User * u, char *buf)
-{
- char *cmd, *s;
-
- cmd = strtok(buf, " ");
-
- if (!cmd) {
- return;
- } else if (stricmp(cmd, "\1PING") == 0) {
- if (!(s = strtok(NULL, "")))
- s = "\1";
- notice(s_CatServ, u->nick, "\1PING %s", s);
- } else {
- mod_run_cmd(s_CatServ, u, Catserv_cmdTable, cmd);
- }
-}
-
diff --git a/src/modules/demos/catserv/makefile.win32 b/src/modules/demos/catserv/makefile.win32
deleted file mode 100644
index 638704440..000000000
--- a/src/modules/demos/catserv/makefile.win32
+++ /dev/null
@@ -1,4 +0,0 @@
-SRCS=ircd_catserv.c purr.c catserv_messages.c meow.c
-TARGET=ircd_catserv.dll
-
-include ..\Makefile.sub.win32
diff --git a/src/modules/demos/catserv/meow.c b/src/modules/demos/catserv/meow.c
deleted file mode 100644
index 9279eec0b..000000000
--- a/src/modules/demos/catserv/meow.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "meow.h"
-
-#include "catserv_extern.h"
-
-int do_meow(User * u) {
- notice(s_CatServ, u->nick, "MEOW!");
- return MOD_STOP;
-}
-
diff --git a/src/modules/demos/catserv/meow.h b/src/modules/demos/catserv/meow.h
deleted file mode 100644
index 0f28673a0..000000000
--- a/src/modules/demos/catserv/meow.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef CATSERV_MEOW_H
-#define CATSERV_MEOW_H
-
-#include "module.h"
-
-int do_meow(User * u);
-
-#endif
-
diff --git a/src/modules/demos/catserv/purr.c b/src/modules/demos/catserv/purr.c
deleted file mode 100644
index e7c1e9c8d..000000000
--- a/src/modules/demos/catserv/purr.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "purr.h"
-#include "catserv_extern.h"
-
-int do_purr(User * u)
-{
- notice(s_CatServ, u->nick, "PURR!");
- return MOD_STOP;
-}
diff --git a/src/modules/demos/catserv/purr.h b/src/modules/demos/catserv/purr.h
deleted file mode 100644
index a92e421f6..000000000
--- a/src/modules/demos/catserv/purr.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef CATSERV_PURR_H
-#define CATSERV_PURR_H
-
-#include "module.h"
-
-int do_purr(User * u);
-
-#endif
-
diff --git a/src/modules/demos/events.c b/src/modules/demos/events.c
deleted file mode 100644
index bea3ccd6d..000000000
--- a/src/modules/demos/events.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Simple module to show the usage of event messages and hooks
- * This module is an example, and has no useful purpose!
- *
- * Please visit http://modules.anope.org for useful modules!
- *
- **/
-
-#include "module.h"
-
-#define AUTHOR "Anope"
-#define VERSION "$Id$"
-
-int my_nick(char *source, int ac, char **av);
-int my_save(int argc, char **argv);
-int do_moo(int argc, char **argv);
-
-int AnopeInit(int argc, char **argv)
-{
- EvtMessage *msg = NULL;
- EvtHook *hook = NULL;
- int status;
- msg = createEventHandler("NICK", my_nick);
- status = moduleAddEventHandler(msg);
-
- hook = createEventHook(EVENT_DB_SAVING, my_save);
- status = this->AddEventHook(hook);
-
-
- hook = createEventHook(EVENT_BOT_FANTASY, do_moo);
- status = this->AddEventHook(hook);
-
- this->SetAuthor(AUTHOR);
- this->SetVersion(VERSION);
- return MOD_CONT;
-}
-
-void AnopeFini(void)
-{
- /* unloading */
-}
-
-int my_nick(char *source, int ac, char **av)
-{
- alog("Internal Event - nick is %s",av[0]);
- return MOD_CONT;
-}
-
-int my_save(int argc, char **argv)
-{
- if(argc>=1) {
- if (!stricmp(argv[0], EVENT_START)) {
- alog("Saving the databases! has started");
- } else {
- alog("Saving the databases is complete");
- }
- }
- return MOD_CONT;
-}
-
-/**
- * command to be called when a EVENT_BOT_FANTASY event is recived.
- * @param argc The paramater count for this event.
- * @param argv[0] The cmd used.
- * @param argv[1] The nick of the command user.
- * @param argv[2] The channel name the command was used in.
- * @param argv[3] The rest of the text after the command.
- * @return MOD_CONT or MOD_STOP
- **/
-int do_moo(int argc, char **argv) {
- ChannelInfo *ci;
- if(argc>=3) { /* We need at least 3 arguments */
- if(stricmp(argv[0],"moo")==0) { /* is it meant for us? */
- if((ci = cs_findchan(argv[2]))) { /* channel should always exist */
- anope_cmd_privmsg(ci->bi->nick, ci->name, "%cACTION moo's at %s %c",1,argv[1],1);
- return MOD_STOP; /* We've dealt with it, dont let others */
- }
- }
- }
- return MOD_CONT; /* guess it wasnt for us, pass it on */
-}
-
diff --git a/src/modules/demos/hs_conf.c b/src/modules/demos/hs_conf.c
deleted file mode 100644
index 755b1bae4..000000000
--- a/src/modules/demos/hs_conf.c
+++ /dev/null
@@ -1,74 +0,0 @@
-#include "module.h"
-
-#define AUTHOR "Anope"
-#define VERSION "1"
-
-/**
- * Default setting to be used if no confing value is found
- **/
-#define DEFAULT_SETTING "moo"
-
-int mShowSetting(User *u);
-int mReadConfig(int argc, char **argv);
-
-char *setting;
-
-int AnopeInit(int argc, char **argv) {
- Command *c;
- EvtHook *hook;
- int status = 0;
-
- setting = NULL;
-
- mReadConfig(0,NULL);
-
- c = createCommand("SHOW",mShowSetting,NULL,-1,-1,-1,-1,-1);
- status = this->AddCommand(HOSTSERV, c, MOD_HEAD);
-
- hook = createEventHook(EVENT_RELOAD, mReadConfig);
- status = this->AddEventHook(hook);
-
- if(status!=MOD_ERR_OK) {
- return MOD_STOP;
- }
- return MOD_CONT;
-}
-
-/**
- * free the globals when we close
- **/
-void AnopeFini(void) {
- if(setting)
- free(setting);
-}
-
-/**
- * Simple function to show the user the current config setting
- **/
-int mShowSetting(User *u) {
- notice(s_HostServ,u->nick,"Setting in use is [%s]",setting);
- return MOD_CONT;
-}
-
-/**
- * Load the config setting up, this will be called whenever
- * the EVENT_RELOAD event is recived.
- **/
-int mReadConfig(int argc, char **argv) {
- char *tmp=NULL;
- Directive d[] = {{"HSConfigSetting", {{PARAM_STRING, PARAM_RELOAD, &tmp}}}};
- moduleGetConfigDirective(d);
-
- if(setting) {
- free(setting);
- }
- if(tmp) {
- setting = tmp;
- } else {
- setting = sstrdup(DEFAULT_SETTING);
- }
- return MOD_CONT;
-}
-
-
-/* EOF */
diff --git a/src/modules/demos/hs_moo.c b/src/modules/demos/hs_moo.c
deleted file mode 100644
index ab677527c..000000000
--- a/src/modules/demos/hs_moo.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * This is an EXAMPLE module, which adds the "moo" command to HostServ
- *
- * This command does NOT do anything useful at all!
- *
- * Please visit http://modules.anope.org for useful modules!
- *
- **/
-#include "module.h"
-
-#define AUTHOR "Anope" /* Set the Author for a modinfo reply */
-#define VERSION "$Id$" /* Set the version for a modinfo reply */
-
-int hs_moo_show(User * u); /* Function to use when a /hs moo command is recived */
-int test(int argc, char **argv);
-void myHostServHelp(User *u); /* Function to display out help in a /hs help response */
-int myHostServMooHelp(User *u); /* Function to display help to _everyone_ when a /hs help moo is called*/
-int myHostServMooRegHelp(User *u); /* Function to display extra help to regular-users when a /hs help moo is called*/
-int myHostServMooOperHelp(User *u); /* Function to display extra help to opers when a /hs help moo is called*/
-int myHostServMooAdminHelp(User *u); /* Function to display extra help to admins when a /hs help moo is called*/
-int myHostServMooRootHelp(User *u); /* Function to display extra help to roors when a /hs help moo is called*/
-
-int AnopeInit(int argc, char **argv) /* This will be executed when the module is loaded */
-{
- Command *c; /* Pointer to a Command */
- int status = 0; /* the status of our new command */
- c = createCommand("moo", hs_moo_show, NULL, -1, -1, -1, -1, -1); /* Create a new command "moo" pointing to hs_moo */
-
- moduleAddHelp(c,myHostServMooHelp); /* add help for all users to this command */
- moduleAddRegHelp(c,myHostServMooRegHelp); /* add extra regular-user only help to this command */
- moduleAddOperHelp(c,myHostServMooOperHelp); /* add extra oper only help to this command */
- moduleAddAdminHelp(c,myHostServMooAdminHelp); /* add extra admin only help to this command */
- moduleAddRootHelp(c,myHostServMooRootHelp); /* add extra root only help to this command */
-
- moduleSetHostHelp(myHostServHelp); /* add us to the .hs help list */
-
- status = this->AddCommand(HOSTSERV, c, MOD_HEAD); /* Add the command to the HOSTSERV cmd table */
-
- /* Check if we have any argv's */
- if(argc>0) {
- /* we do, the first will be the nick of the person modload'ing us */
- /* or NULL if we were auto-loaded */
- if(argv[0]) {
- alog("hs_moo was modloaded by: [%s]",argv[0]);
- } else {
- alog("hs_moo was automatically loaded by anope");
- }
- }
- alog("hs_moo.so: Add Command 'moo' Status: %d",status); /* Log the command being added */
-
- moduleAddCallback("test",time(NULL)+dotime("15s"),test,0,NULL); /* set a call-back function to exec in 3 mins time */
- moduleDelCallback("test");
- this->SetAuthor(AUTHOR); /* tell Anope about the author */
- this->SetVersion(VERSION); /* Tell Anope about the verison */
-
- if(status!=MOD_ERR_OK) {
- return MOD_STOP;
- }
- return MOD_CONT;
-}
-
-int hs_moo_show(User * u)
-{
- notice(s_HostServ, u->nick, "MOO! - This command was loaded via a module!"); /* Just notice the user */
- return MOD_STOP; /* MOD_STOP means we will NOT pass control back to other */
-} /* modules waiting to handle the /hs moo command! */
-
-int test(int argc, char **argv) {
- alog("CallBack from hs_moo with %d paramaters",argc);
- return MOD_CONT;
-}
-
-void AnopeFini(void)
-{
- /* module is unloading */
-}
-
-/***************************************************************************************************************************************/
-/* The code below here shows various ways of dealing with the module help system */
-/***************************************************************************************************************************************/
-
-void myHostServHelp(User *u) {
- notice(s_HostServ,u->nick, " MOO Moo's at the user!"); /* this will appear in the help list */
-}
-
-int myHostServMooHelp(User *u) {
- notice(s_HostServ,u->nick,"Syntax: Moo"); /* this will be sent to everyone who does /msg hostserv help moo */
- notice(s_HostServ,u->nick,"This command is an example provided");
- notice(s_HostServ,u->nick,"by the Anope development team.");
- return MOD_CONT; /* allow any other module's with help for /hs moo to run */
-}
-
-int myHostServMooRootHelp(User *u) { /* this will only be sent to ROOTS ONLY who /msg hostserv moo */
- myHostServMooAdminHelp(u); /* this line lets us show roots the ADMIN help as well as the root help */
- notice(s_HostServ,u->nick,"Only roots will see this part of the help");
- return MOD_CONT;
-}
-
-int myHostServMooAdminHelp(User *u) { /* this will only be sent to ADMINS ONLY who /msg hostserv moo */
- myHostServMooOperHelp(u); /* this line lets us show admins the OPER help as well as the admin help */
- notice(s_HostServ,u->nick,"Only admins will see this part of the help");
- notice(s_HostServ,u->nick,"why not visit us on www.anope.org ?");
- return MOD_CONT;
-}
-
-int myHostServMooOperHelp(User *u) { /* this will only be sent to OPERS ONLY who /msg hostserv moo */
- notice(s_HostServ,u->nick,"Only opers will see this part of the help");
- notice(s_HostServ,u->nick,"for more help/support with modules");
- notice(s_HostServ,u->nick,"visit us on irc.anope.org #anope! :)");
- return MOD_CONT;
-}
-
-int myHostServMooRegHelp(User *u) { /* this will only be sent to REGULAR USERS ONLY who /msg hostserv moo */
- notice(s_HostServ,u->nick,"Only non-opers will see this part of the help");
- notice(s_HostServ,u->nick,"as we've left it hidden from opers");
- return MOD_CONT;
-}
-
-/* EOF */