Code: Select all
#define MODULE_NAME "testmod"
#define MAKING_TESTMOD
#define TEST_MAJORV 0
#define TEST_MINORV 1
#include "../module.h"
#include "../irc.mod/irc.h"
#undef global
static Function *global = NULL;
static Function *irc_funcs = NULL;
char *testmod_start();
static int print_hi(char *nick, char *host, char *hand,
char *channel, char *text) {
/* dprintf(DP_STDOUT, "He told hello\n");*/
return 0;
}
static cmd_t hi_pub[] = {
{"!hi", "", print_hi, NULL},
{0, 0, 0, 0}
};
static int testmod_expmem () {
return 0;
}
static void testmod_report (int idx, int details) {
if (details) {
int size = testmod_expmem();
dprintf(idx, " Using %d byte%s of memory\n", size, size != 1 ? "s" : "");
}
}
static char *testmod_close () {
rem_builtins(H_pub, hi_pub);
module_undepend(MODULE_NAME);
return NULL;
}
static Function testmod_table[] = {
(Function) testmod_start,
(Function) testmod_close,
(Function) testmod_expmem,
(Function) testmod_report,
};
char *testmod_start(Function *global_funcs) {
global = global_funcs;
module_register(MODULE_NAME, testmod_table, 0, 1);
if (!module_depend(MODULE_NAME, "eggdrop", 106, 0)) {
module_undepend(MODULE_NAME);
return "This module requires Eggdrop 1.6.0 or later.";
}
add_builtins(H_pub, hi_pub);
return NULL;
}