* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $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
{ NULL, NULL }
};
+/* The mapi_cap_list_av2 declares the capabilities this module adds. This is
+ * for protocol usage. Here we declare both server and client capabilities.
+ * The first parameter is the cap type (server or client). The second is the
+ * name of the capability we wish to register. The third is the data attached
+ * to the cap (typically NULL). The last parameter is a pointer to an integer
+ * for the CAP index (recommended).
+ */
+unsigned int CAP_TESTCAP_SERVER, CAP_TESTCAP_CLIENT;
+mapi_cap_list_av2 test_cap_list[] = {
+ { MAPI_CAP_SERVER, "TESTCAP", NULL, &CAP_TESTCAP_SERVER },
+ { MAPI_CAP_CLIENT, "testcap", NULL, &CAP_TESTCAP_CLIENT },
+ { 0, NULL, NULL, NULL }
+};
+
/* Here we tell it what to do when the module is loaded */
static int
modinit(void)
/* Again, nothing to do. */
}
-/* DECLARE_MODULE_AV1() actually declare the MAPI header. */
-DECLARE_MODULE_AV1(
+/* DECLARE_MODULE_AV2() actually declare the MAPI header. */
+DECLARE_MODULE_AV2(
/* The first argument is the name */
example,
/* The second argument is the function to call on load */
test_hlist,
/* Then the hook function list, if we have one */
test_hfnlist,
- /* And finally the version number of this module. */
- "$Revision: 3161 $");
+ /* Then the caps list, if we have one */
+ test_cap_list,
+ /* Then the version number of this module (NULL for bundled) */
+ NULL,
+ /* And finally, the description of this module */
+ "This is an example module");
/* Any of the above arguments can be NULL to indicate they aren't used. */
* 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)
{
* 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)
{
* 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)
{
* 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)
{
* 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)
{