10 #include <sys/types.h>
22 #include "sysdep_decls.h"
23 #include "citserver.h"
26 #include "dynloader.h"
32 extern struct CitContext *ContextList;
34 void CleanupTest(void) {
35 lprintf(9, "--- test of adding an unload hook --- \n");
38 void NewRoomTest(void) {
39 lprintf(9, "--- test module was told we're now in %s ---\n",
43 void SessionStartTest(void) {
44 lprintf(9, "--- starting up session %d ---\n",
48 void SessionStopTest(void) {
49 lprintf(9, "--- ending session %d ---\n",
53 void LoginTest(void) {
54 lprintf(9, "--- Hello, %s ---\n", CC->curr_user);
58 void Ygorl(char *username, long usernum) {
59 if (!strcasecmp(username, "Unsuspecting User")) {
60 strcpy(username, "Flaming Asshole");
64 void LogTest(char *buf) {
65 fprintf(stderr,"%c[1m%s%c[0m", 27, buf, 27);
70 char *Dynamic_Module_Init(void)
72 CtdlRegisterCleanupHook(CleanupTest);
73 CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM);
74 CtdlRegisterSessionHook(SessionStartTest, EVT_START);
75 CtdlRegisterSessionHook(SessionStopTest, EVT_STOP);
76 CtdlRegisterSessionHook(LoginTest, EVT_LOGIN);
77 CtdlRegisterUserHook(Ygorl, EVT_OUTPUTMSG);
78 CtdlRegisterLogHook(LogTest, 1);