10 #include <sys/types.h>
22 #include "sysdep_decls.h"
23 #include "citserver.h"
26 #include "dynloader.h"
32 extern struct CitContext *ContextList;
34 #define MODULE_NAME "Dummy test module"
35 #define MODULE_AUTHOR "Art Cancro"
36 #define MODULE_EMAIL "ajc@uncnsrd.mt-kisco.ny.us"
37 #define MAJOR_VERSION 0
38 #define MINOR_VERSION 4
40 static struct DLModule_Info info = {
48 void CleanupTest(void) {
49 lprintf(9, "--- test of adding an unload hook --- \n");
52 void NewRoomTest(void) {
53 lprintf(9, "--- test module was told we're now in %s ---\n",
57 void SessionStartTest(void) {
58 lprintf(9, "--- starting up session %d ---\n",
62 void SessionStopTest(void) {
63 lprintf(9, "--- ending session %d ---\n",
67 void LoginTest(void) {
68 lprintf(9, "--- Hello, %s ---\n", CC->curr_user);
72 void Ygorl(char *username, long usernum) {
73 if (!strcasecmp(username, "Unsuspecting User")) {
74 strcpy(username, "Flaming Asshole");
78 void LogTest(char *buf) {
79 fprintf(stderr,"%c[1m%s%c[0m", 27, buf, 27);
84 struct DLModule_Info *Dynamic_Module_Init(void)
86 CtdlRegisterCleanupHook(CleanupTest);
87 CtdlRegisterSessionHook(NewRoomTest, EVT_NEWROOM);
88 CtdlRegisterSessionHook(SessionStartTest, EVT_START);
89 CtdlRegisterSessionHook(SessionStopTest, EVT_STOP);
90 CtdlRegisterSessionHook(LoginTest, EVT_LOGIN);
91 CtdlRegisterUserHook(Ygorl, EVT_OUTPUTMSG);
92 CtdlRegisterLogHook(LogTest, 1);