/*
 * RageIRCd: an advanced Internet Relay Chat daemon (ircd).
 * (C) 2000-2005 the RageIRCd Development Team, all rights reserved.
 *
 * This software is free, licensed under the General Public License.
 * Please refer to doc/LICENSE and doc/README for further details.
 *
 * $Id: example_module.txt,v 1.6.2.1 2005/02/21 02:32:45 amcwilliam Exp $
 */

#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include "h.h"
#include "memory.h"
#include "modules.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>

/* Please see the following technical references for a more detailed guide 
 * on how to develop custom dynamic modules for RageIRCd v2.0.
 *
 * Main technical documents to read:
 * 1. module-api.txt
 * 2. module-objects.txt
 * 3. command-api.txt
 * 4. event-api.txt
 * 5. hooks.txt
 * 6. hook-api.txt
 * 7. hook-events.txt
 */

/* Prototype declarations */
int m_dummy(aClient *, aClient *, int, char **);

msg_ptr CMD_DUMMY = { "DUMMY", NULL, CMDFLAG_NONE };

/* Module APIs */
Module MOD_HEADER(m_dummy) = {
	"modules/example_module.so",
	"Example module document",
	6, "$Revision: 1.6.2.1 $",
};

int MOD_LOAD(m_dummy)()
{
	/* Return MOD_FAILURE if any object registration fails! */
	if (register_command(&MOD_HEADER(m_dummy), &CMD_DUMMY, m_dummy) == NULL) {
		return MOD_FAILURE;
	}
	return MOD_SUCCESS;
};

int MOD_UNLOAD(m_dummy)()
{
	/* Object cleanup is done by the ircd. */
	return MOD_SUCCESS;
}

/* Contents of module starts here! */

/*
 * m_dummy
 *	parv[0] = sender prefix
 */
int m_dummy(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
	sendto_realops("%s (%s@%s) wants everyone to know he/she is a dummy!",
		sptr->name, sptr->username, MaskedHost(sptr));
	return 0;
}
