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 a new room ---\n");
42 void SessionStartTest(void) {
43 lprintf(9, "--- starting up session %d ---\n",
47 void SessionStopTest(void) {
48 lprintf(9, "--- ending session %d ---\n",
52 void LoginTest(void) {
53 lprintf(9, "--- Hello, %s ---\n", CC->curr_user);
57 void Ygorl(char *username, long usernum) {
58 if (!strcasecmp(username, "Unsuspecting User")) {
59 strcpy(username, "Flaming Asshole");
63 void LogTest(char *buf) {
64 fprintf(stderr,"%c[1m%s%c[0m", 27, buf, 27);
69 char *Dynamic_Module_Init(void)
71 CtdlRegisterCleanupHook(CleanupTest);
72 CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM);
73 CtdlRegisterSessionHook(SessionStartTest, EVT_START);
74 CtdlRegisterSessionHook(SessionStopTest, EVT_STOP);
75 CtdlRegisterSessionHook(LoginTest, EVT_LOGIN);
76 CtdlRegisterUserHook(Ygorl, EVT_OUTPUTMSG);
77 CtdlRegisterLogHook(LogTest, 1);