struct CleanupFunctionHook *CleanupHookTable = NULL;
struct SessionFunctionHook *SessionHookTable = NULL;
struct UserFunctionHook *UserHookTable = NULL;
+struct XmsgFunctionHook *XmsgHookTable = NULL;
struct ProtoFunctionHook {
void (*handler) (char *cmdbuf);
p->desc = desc;
p->next = ProtoHookList;
ProtoHookList = p;
+ lprintf(5, "Registered server command %s (%s)\n", cmd, desc);
}
int DLoader_Exec_Cmd(char *cmdbuf)
while ((dptr = readdir(dir)) != NULL) {
if (dptr->d_name[0] == '.')
continue;
- lprintf(9, "Attempting to load %s\n", dptr->d_name);
snprintf(pathbuf, PATH_MAX, "%s/%s", pathname, dptr->d_name);
#ifdef RTLD_NOW
}
+void CtdlRegisterXmsgHook(int (*fcn_ptr) (char *, char *, char *) )
+{
+
+ struct XmsgFunctionHook *newfcn;
+
+ newfcn = (struct XmsgFunctionHook *)
+ mallok(sizeof(struct XmsgFunctionHook));
+ newfcn->next = XmsgHookTable;
+ newfcn->h_function_pointer = fcn_ptr;
+ XmsgHookTable = newfcn;
+
+ lprintf(5, "Registered a new x-msg function\n");
+}
+
+
void PerformSessionHooks(int EventType)
{
struct SessionFunctionHook *fcn;
}
}
}
+
+int PerformXmsgHooks(char *sender, char *recp, char *msg)
+{
+ struct XmsgFunctionHook *fcn;
+ int total_sent = 0;
+
+ for (fcn = XmsgHookTable; fcn != NULL; fcn = fcn->next) {
+ total_sent +=
+ (*fcn->h_function_pointer) (sender, recp, msg);
+ }
+ return total_sent;
+}