4 * A skeleton module to test the dynamic loader.
7 * Copyright (c) 1998-2009 by the citadel.org team
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #include <sys/types.h>
34 #if TIME_WITH_SYS_TIME
35 # include <sys/time.h>
39 # include <sys/time.h>
48 #include "ctdl_module.h"
50 extern struct CitContext *ContextList;
52 void CleanupTest(void) {
53 CtdlLogPrintf(CTDL_DEBUG, "--- test of adding an unload hook --- \n");
56 void NewRoomTest(void) {
57 CtdlLogPrintf(CTDL_DEBUG, "--- test module was told we're now in a new room ---\n");
60 void SessionStartTest(void) {
61 CtdlLogPrintf(CTDL_DEBUG, "--- starting up session %d ---\n",
65 void SessionStopTest(void) {
66 CtdlLogPrintf(CTDL_DEBUG, "--- ending session %d ---\n",
70 void LoginTest(void) {
71 CtdlLogPrintf(CTDL_DEBUG, "--- Hello, %s ---\n", CC->curr_user);
74 /* To insert this module into the server activate the next block by changing the #if 0 to #if 1 */
75 CTDL_MODULE_INIT(test)
80 CtdlRegisterCleanupHook(CleanupTest);
81 CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM);
82 CtdlRegisterSessionHook(SessionStartTest, EVT_START);
83 CtdlRegisterSessionHook(SessionStopTest, EVT_STOP);
84 CtdlRegisterSessionHook(LoginTest, EVT_LOGIN);
88 /* return our Subversion id for the Log */