]> jfr.im git - solanum.git/blobdiff - extensions/example_module.c
msg: remove last vestiges of the fakelag system. charybdis has never supported fakelag.
[solanum.git] / extensions / example_module.c
index 32e15097798ca2b936ead37c8c14ee191948a87a..d08e9ff9cd4c2b9cb7050073da8421f0020c026d 100644 (file)
@@ -16,7 +16,7 @@
  *   along with this program; if not, write to the Free Software
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- *   $Id: example_module.c 494 2006-01-15 16:08:28Z jilles $
+ *   $Id: example_module.c 3161 2007-01-25 07:23:01Z nenolod $
  */
 
 /* List of ircd includes from ../include/ */
  * parv     == an array of the parameters
  */
 
-static int munreg_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
-static int mclient_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
-static int mserver_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
-static int mrclient_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
-static int moper_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
+static int munreg_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
+static int mclient_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
+static int mserver_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
+static int mrclient_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
+static int moper_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
 
 /* Show the commands this module can handle in a msgtab
  * and give the msgtab a name, here its test_msgtab
@@ -52,7 +52,7 @@ struct Message test_msgtab = {
   0,                    /* SET TO ZERO -- number of times command used by clients */
   0,                    /* SET TO ZERO -- number of times command used by clients */
   0,                    /* SET TO ZERO -- number of times command used by clients */
-  MFLG_SLOW,            /* ALWAYS SET TO MFLG_SLOW */
+  0,            /* ALWAYS SET TO 0 */
 
   /* the functions to call for each handler.  If not using the generic
    * handlers, the first param is the function to call, the second is the
@@ -94,7 +94,7 @@ mapi_clist_av1 test_clist[] = { &test_msgtab, NULL };
  * terminated with NULLs.
  */
 int doing_example_hook;
-mapi_hlist_av1 test_hlist[] = { 
+mapi_hlist_av1 test_hlist[] = {
        { "doing_example_hook", &doing_example_hook, },
        { NULL, NULL }
 };
@@ -144,14 +144,13 @@ DECLARE_MODULE_AV1(
                          /* Then the hook function list, if we have one */
                          test_hfnlist,
                          /* And finally the version number of this module. */
-                         "$Revision: 494 $");
+                         "$Revision: 3161 $");
 
 /* Any of the above arguments can be NULL to indicate they aren't used. */
 
 
 /*
  * mr_test
- *      parv[0] = sender prefix
  *      parv[1] = parameter
  */
 
@@ -159,17 +158,15 @@ DECLARE_MODULE_AV1(
  * and the fairly normal C coding
  */
 static int
-munreg_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+munreg_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        if(parc < 2)
        {
-               sendto_one(source_p, ":%s NOTICE %s :You are unregistered and sent no parameters",
-                          me.name, source_p->name);
+               sendto_one_notice(source_p, ":You are unregistered and sent no parameters");
        }
        else
        {
-               sendto_one(source_p, ":%s NOTICE %s :You are unregistered and sent parameter: %s",
-                          me.name, source_p->name, parv[1]);
+               sendto_one_notice(source_p, ":You are unregistered and sent parameter: %s", parv[1]);
        }
 
        /* illustration of how to call a hook function */
@@ -180,22 +177,18 @@ munreg_test(struct Client *client_p, struct Client *source_p, int parc, const ch
 
 /*
  * mclient_test
- *      parv[0] = sender prefix
  *      parv[1] = parameter
  */
 static int
-mclient_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+mclient_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        if(parc < 2)
        {
-               sendto_one(source_p, ":%s NOTICE %s :You are a normal user, and sent no parameters",
-                          me.name, source_p->name);
+               sendto_one_notice(source_p, ":You are a normal user, and sent no parameters");
        }
        else
        {
-               sendto_one(source_p,
-                          ":%s NOTICE %s :You are a normal user, and send parameters: %s", me.name,
-                          source_p->name, parv[1]);
+               sendto_one_notice(source_p, ":You are a normal user, and send parameters: %s", parv[1]);
        }
 
        /* illustration of how to call a hook function */
@@ -206,67 +199,54 @@ mclient_test(struct Client *client_p, struct Client *source_p, int parc, const c
 
 /*
  * mrclient_test
- *      parv[0] = sender prefix
  *      parv[1] = parameter
  */
 static int
-mrclient_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+mrclient_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        if(parc < 2)
        {
-               sendto_one(source_p,
-                          ":%s NOTICE %s :You are a remote client, and sent no parameters",
-                          me.name, source_p->name);
+               sendto_one_notice(source_p, ":You are a remote client, and sent no parameters");
        }
        else
        {
-               sendto_one(source_p,
-                          ":%s NOTICE %s :You are a remote client, and sent parameters: %s",
-                          me.name, source_p->name, parv[1]);
+               sendto_one_notice(source_p, ":You are a remote client, and sent parameters: %s", parv[1]);
        }
        return 0;
 }
 
 /*
  * mserver_test
- *      parv[0] = sender prefix
  *      parv[1] = parameter
  */
 static int
-mserver_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+mserver_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        if(parc < 2)
        {
-               sendto_one(source_p,
-                          ":%s NOTICE %s :You are a server, and sent no parameters",
-                          me.name, source_p->name);
+               sendto_one_notice(source_p, ":You are a server, and sent no parameters");
        }
        else
        {
-               sendto_one(source_p,
-                          ":%s NOTICE %s :You are a server, and sent parameters: %s",
-                          me.name, source_p->name, parv[1]);
+               sendto_one_notice(source_p, ":You are a server, and sent parameters: %s", parv[1]);
        }
        return 0;
 }
 
 /*
  * moper_test
- *      parv[0] = sender prefix
  *      parv[1] = parameter
  */
 static int
-moper_test(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+moper_test(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        if(parc < 2)
        {
-               sendto_one(source_p, ":%s NOTICE %s :You are an operator, and sent no parameters",
-                          me.name, source_p->name);
+               sendto_one_notice(source_p, ":You are an operator, and sent no parameters");
        }
        else
        {
-               sendto_one(source_p, ":%s NOTICE %s :You are an operator, and sent parameters: %s",
-                          me.name, source_p->name, parv[1]);
+               sendto_one_notice(source_p, ":You are an operator, and sent parameters: %s", parv[1]);
        }
        return 0;
 }