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"
51 void CleanupTest(void) {
52 CtdlLogPrintf(CTDL_DEBUG, "--- test of adding an unload hook --- \n");
55 void NewRoomTest(void) {
56 CtdlLogPrintf(CTDL_DEBUG, "--- test module was told we're now in a new room ---\n");
59 void SessionStartTest(void) {
60 CtdlLogPrintf(CTDL_DEBUG, "--- starting up session %d ---\n",
64 void SessionStopTest(void) {
65 CtdlLogPrintf(CTDL_DEBUG, "--- ending session %d ---\n",
69 void LoginTest(void) {
70 CtdlLogPrintf(CTDL_DEBUG, "--- Hello, %s ---\n", CC->curr_user);
73 /* To insert this module into the server activate the next block by changing the #if 0 to #if 1 */
74 CTDL_MODULE_INIT(test)
79 CtdlRegisterCleanupHook(CleanupTest);
80 CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM);
81 CtdlRegisterSessionHook(SessionStartTest, EVT_START);
82 CtdlRegisterSessionHook(SessionStopTest, EVT_STOP);
83 CtdlRegisterSessionHook(LoginTest, EVT_LOGIN);
87 /* return our Subversion id for the Log */