4 * A skeleton module to test the dynamic loader.
16 #include <sys/types.h>
24 #include "sysdep_decls.h"
25 #include "citserver.h"
28 #include "dynloader.h"
34 extern struct CitContext *ContextList;
36 void CleanupTest(void) {
37 lprintf(9, "--- test of adding an unload hook --- \n");
40 void NewRoomTest(void) {
41 lprintf(9, "--- test module was told we're now in a new room ---\n");
44 void SessionStartTest(void) {
45 lprintf(9, "--- starting up session %d ---\n",
49 void SessionStopTest(void) {
50 lprintf(9, "--- ending session %d ---\n",
54 void LoginTest(void) {
55 lprintf(9, "--- Hello, %s ---\n", CC->curr_user);
59 void Ygorl(char *username, long usernum) {
60 if (!strcasecmp(username, "Unsuspecting User")) {
61 strcpy(username, "Flaming Asshole");
65 void LogTest(char *buf) {
66 fprintf(stderr,"%c[1m%s%c[0m", 27, buf, 27);
71 char *Dynamic_Module_Init(void)
73 CtdlRegisterCleanupHook(CleanupTest);
74 CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM);
75 CtdlRegisterSessionHook(SessionStartTest, EVT_START);
76 CtdlRegisterSessionHook(SessionStopTest, EVT_STOP);
77 CtdlRegisterSessionHook(LoginTest, EVT_LOGIN);
78 CtdlRegisterUserHook(Ygorl, EVT_OUTPUTMSG);
79 CtdlRegisterLogHook(LogTest, 1);