2 * A skeleton module to test the dynamic loader.
4 * Copyright (c) 1998-2012 by the citadel.org team
6 * This program is open source software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
29 #include <sys/types.h>
31 #if TIME_WITH_SYS_TIME
32 # include <sys/time.h>
36 # include <sys/time.h>
45 #include "ctdl_module.h"
48 void CleanupTest(void) {
49 syslog(LOG_DEBUG, "--- test of adding an unload hook --- \n");
52 void NewRoomTest(void) {
53 syslog(LOG_DEBUG, "--- test module was told we're now in a new room ---\n");
56 void SessionStartTest(void) {
57 syslog(LOG_DEBUG, "--- starting up session %d ---\n",
61 void SessionStopTest(void) {
62 syslog(LOG_DEBUG, "--- ending session %d ---\n",
66 void LoginTest(void) {
67 syslog(LOG_DEBUG, "--- Hello, %s ---\n", CC->curr_user);
70 /* To insert this module into the server activate the next block by changing the #if 0 to #if 1 */
71 CTDL_MODULE_INIT(test)
76 CtdlRegisterCleanupHook(CleanupTest);
77 CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM, 1);
78 CtdlRegisterSessionHook(SessionStartTest, EVT_START, 1);
79 CtdlRegisterSessionHook(SessionStopTest, EVT_STOP, 1);
80 CtdlRegisterSessionHook(LoginTest, EVT_LOGIN, 1);
84 /* return our module name for the log */