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>
34 #include "sysdep_decls.h"
35 #include "citserver.h"
38 #include "serv_extensions.h"
44 extern struct CitContext *ContextList;
46 void CleanupTest(void) {
47 lprintf(9, "--- test of adding an unload hook --- \n");
50 void NewRoomTest(void) {
51 lprintf(9, "--- test module was told we're now in a new room ---\n");
54 void SessionStartTest(void) {
55 lprintf(9, "--- starting up session %d ---\n",
59 void SessionStopTest(void) {
60 lprintf(9, "--- ending session %d ---\n",
64 void LoginTest(void) {
65 lprintf(9, "--- Hello, %s ---\n", CC->curr_user);
69 void Ygorl(char *username, long usernum) {
70 if (!strcasecmp(username, "Unsuspecting User")) {
71 strcpy(username, "Flaming Asshole");
75 void LogTest(char *buf) {
76 fprintf(stderr,"%c[1m%s%c[0m", 27, buf, 27);
81 char *serv_test_init(void)
83 CtdlRegisterCleanupHook(CleanupTest);
84 CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM);
85 CtdlRegisterSessionHook(SessionStartTest, EVT_START);
86 CtdlRegisterSessionHook(SessionStopTest, EVT_STOP);
87 CtdlRegisterSessionHook(LoginTest, EVT_LOGIN);
88 CtdlRegisterUserHook(Ygorl, EVT_OUTPUTMSG);
89 CtdlRegisterLogHook(LogTest, 1);