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