struct CtdlThreadNode *_this_cit_thread;\
_this_cit_thread = CtdlThreadSelf()
-
-#ifdef WITH_THREADLOG
-#define CtdlThreadPushName(NAME) \
- char *_push_name; \
- _push_name = CtdlThreadName(CtdlThreadSelf(), NAME)
-
-#define CtdlThreadPopName() \
- free (CtdlThreadName(CtdlThreadSelf(), _push_name))
-#else
-#define CtdlThreadPushName(NAME)
-#define CtdlThreadPopName()
-#endif
-
#endif /* CTDL_MODULE_H */
{
struct SessionFunctionHook *fcn = NULL;
- CtdlThreadPushName("PerformSessionHooks");
-
for (fcn = SessionHookTable; fcn != NULL; fcn = fcn->next) {
if (fcn->eventtype == EventType) {
(*fcn->h_function_pointer) ();
}
}
- CtdlThreadPopName();
-
}
void PerformUserHooks(struct ctdluser *usbuf, int EventType)
{
struct UserFunctionHook *fcn = NULL;
- CtdlThreadPushName("PerformUserHooks");
-
for (fcn = UserHookTable; fcn != NULL; fcn = fcn->next) {
if (fcn->eventtype == EventType) {
(*fcn->h_function_pointer) (usbuf);
}
}
- CtdlThreadPopName();
}
int PerformMessageHooks(struct CtdlMessage *msg, int EventType)
struct MessageFunctionHook *fcn = NULL;
int total_retval = 0;
- CtdlThreadPushName("PerformMessageHooks");
-
/* Other code may elect to protect this message from server-side
* handlers; if this is the case, don't do anything.
lprintf(CTDL_DEBUG, "** Event type is %d, flags are %d\n",
*/
if (msg->cm_flags & CM_SKIP_HOOKS) {
lprintf(CTDL_DEBUG, "Skipping hooks\n");
- CtdlThreadPopName();
return(0);
}
* this is an EVT_BEFORESAVE event, a nonzero return code will cause
* the save operation to abort.
*/
- CtdlThreadPopName();
return total_retval;
}
struct RoomFunctionHook *fcn;
int total_retval = 0;
- CtdlThreadPushName("PerformRoomHooks");
-
lprintf(CTDL_DEBUG, "Performing room hooks for <%s>\n", target_room->QRname);
for (fcn = RoomHookTable; fcn != NULL; fcn = fcn->next) {
/* Return the sum of the return codes from the hook functions.
*/
- CtdlThreadPopName();
return total_retval;
}
struct NetprocFunctionHook *fcn;
int total_retval = 0;
- CtdlThreadPushName("PerformNetprocHooks");
-
for (fcn = NetprocHookTable; fcn != NULL; fcn = fcn->next) {
total_retval = total_retval +
(*fcn->h_function_pointer) (msg, target_room);
/* Return the sum of the return codes from the hook functions.
* A nonzero return code will cause the message to *not* be imported.
*/
- CtdlThreadPopName();
return total_retval;
}
{
struct DeleteFunctionHook *fcn;
- CtdlThreadPushName("PerformDeleteHooks");
-
for (fcn = DeleteHookTable; fcn != NULL; fcn = fcn->next) {
(*fcn->h_function_pointer) (room, msgnum);
}
- CtdlThreadPopName();
}
int total_sent = 0;
int p;
- CtdlThreadPushName("PerformXmsgHooks");
-
for (p=0; p<MAX_XMSG_PRI; ++p) {
for (fcn = XmsgHookTable; fcn != NULL; fcn = fcn->next) {
if (fcn->order == p) {
*/
if (total_sent) break;
}
- CtdlThreadPopName();
return total_sent;
}