]> code.citadel.org Git - citadel.git/blob - citadel/serv_test.c
* Makefile.in: add SERV_MODULES and PROXY_TARGETS to `cleaner'
[citadel.git] / citadel / serv_test.c
1 #include <stdlib.h>
2 #include <unistd.h>
3 #include <stdio.h>
4 #include <fcntl.h>
5 #include <signal.h>
6 #include <pwd.h>
7 #include <errno.h>
8 #include <sys/types.h>
9 #include <sys/time.h>
10 #include <sys/wait.h>
11 #include <string.h>
12 #include <pthread.h>
13 #include "citadel.h"
14 #include "server.h"
15 #include <syslog.h>
16 #include "sysdep_decls.h"
17 #include "citserver.h"
18 #include "support.h"
19 #include "config.h"
20 #include "dynloader.h"
21
22 extern struct CitContext *ContextList;
23
24 #define MODULE_NAME     "Dummy test module"
25 #define MODULE_AUTHOR   "Art Cancro"
26 #define MODULE_EMAIL    "ajc@uncnsrd.mt-kisco.ny.us"
27 #define MAJOR_VERSION   0
28 #define MINOR_VERSION   1
29
30 static struct DLModule_Info info = {
31   MODULE_NAME,
32   MODULE_AUTHOR,
33   MODULE_EMAIL,
34   MAJOR_VERSION,
35   MINOR_VERSION
36 };
37
38 void CleanupTest(void) {
39         lprintf(9, "--- test of adding an unload hook --- \n");
40         }
41
42 void NewRoomTest(char *RoomName) {
43         lprintf(9, "--- test module was told we're now in %s ---\n", RoomName);
44         }
45
46 void SessionStartTest(int WhichSession) {
47         lprintf(9, "--- starting up session %d ---\n", WhichSession);
48         }
49
50 void SessionStopTest(int WhichSession) {
51         lprintf(9, "--- ending session %d ---\n", WhichSession);
52         }
53
54 void LoginTest(void) {
55         lprintf(9, "--- Hello, %s ---\n", CC->curr_user);
56         }
57
58 struct DLModule_Info *Dynamic_Module_Init(void)
59 {
60    CtdlRegisterCleanupHook(CleanupTest);
61    CtdlRegisterNewRoomHook(NewRoomTest);
62    CtdlRegisterSessionHook(SessionStartTest, 1);
63    CtdlRegisterSessionHook(SessionStopTest, 0);
64    CtdlRegisterLoginHook(LoginTest);
65    return &info;
66 }