* 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
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
* 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 }
};
/* 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
*/
* 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 */
/*
* 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 */
/*
* 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;
}