4 * A skeleton module to test the dynamic loader.
16 #include <sys/types.h>
18 #if TIME_WITH_SYS_TIME
19 # include <sys/time.h>
23 # include <sys/time.h>
32 #include "ctdl_module.h"
34 extern struct CitContext *ContextList;
36 void CleanupTest(void) {
37 CtdlLogPrintf(CTDL_DEBUG, "--- test of adding an unload hook --- \n");
40 void NewRoomTest(void) {
41 CtdlLogPrintf(CTDL_DEBUG, "--- test module was told we're now in a new room ---\n");
44 void SessionStartTest(void) {
45 CtdlLogPrintf(CTDL_DEBUG, "--- starting up session %d ---\n",
49 void SessionStopTest(void) {
50 CtdlLogPrintf(CTDL_DEBUG, "--- ending session %d ---\n",
54 void LoginTest(void) {
55 CtdlLogPrintf(CTDL_DEBUG, "--- Hello, %s ---\n", CC->curr_user);
58 /* To insert this module into the server activate the next block by changing the #if 0 to #if 1 */
59 CTDL_MODULE_INIT(test)
64 CtdlRegisterCleanupHook(CleanupTest);
65 CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM);
66 CtdlRegisterSessionHook(SessionStartTest, EVT_START);
67 CtdlRegisterSessionHook(SessionStopTest, EVT_STOP);
68 CtdlRegisterSessionHook(LoginTest, EVT_LOGIN);
72 /* return our Subversion id for the Log */