- MOD_syslog(LOG_DEBUG, "Registered server command %s (%s)\n", cmd, desc);
-}
-
-void CtdlDestroyProtoHooks(void)
-{
-
- DeleteHash(&ProtoHookList);
-}
-
-
-void CtdlRegisterCleanupHook(void (*fcn_ptr) (void))
-{
-
- CleanupFunctionHook *newfcn;
-
- newfcn = (CleanupFunctionHook *)
- malloc(sizeof(CleanupFunctionHook));
- newfcn->next = CleanupHookTable;
- newfcn->h_function_pointer = fcn_ptr;
- CleanupHookTable = newfcn;
-
- MODM_syslog(LOG_DEBUG, "Registered a new cleanup function\n");
-}
-
-
-void CtdlUnregisterCleanupHook(void (*fcn_ptr) (void))
-{
- CleanupFunctionHook *cur, *p, *last;
- last = NULL;
- cur = CleanupHookTable;
- while (cur != NULL)
- {
- if (fcn_ptr == cur->h_function_pointer)
- {
- MODM_syslog(LOG_DEBUG, "Unregistered cleanup function\n");
- p = cur->next;
-
- free(cur);
- cur = NULL;
-
- if (last != NULL)
- last->next = p;
- else
- CleanupHookTable = p;
- cur = p;
- }
- else {
- last = cur;
- cur = cur->next;
- }
- }
-}
-
-
-void CtdlDestroyCleanupHooks(void)
-{
- CleanupFunctionHook *cur, *p;
-
- cur = CleanupHookTable;
- while (cur != NULL)
- {
- MODM_syslog(LOG_DEBUG, "Destroyed cleanup function\n");
- p = cur->next;
- free(cur);
- cur = p;
- }
- CleanupHookTable = NULL;
-}
-
-void CtdlRegisterEVCleanupHook(void (*fcn_ptr) (void))
-{
-
- CleanupFunctionHook *newfcn;
-
- newfcn = (CleanupFunctionHook *)
- malloc(sizeof(CleanupFunctionHook));
- newfcn->next = EVCleanupHookTable;
- newfcn->h_function_pointer = fcn_ptr;
- EVCleanupHookTable = newfcn;
-
- MODM_syslog(LOG_DEBUG, "Registered a new cleanup function\n");
-}
-
-
-void CtdlUnregisterEVCleanupHook(void (*fcn_ptr) (void))
-{
- CleanupFunctionHook *cur, *p, *last;
- last = NULL;
- cur = EVCleanupHookTable;
- while (cur != NULL)
- {
- if (fcn_ptr == cur->h_function_pointer)
- {
- MODM_syslog(LOG_DEBUG, "Unregistered cleanup function\n");
- p = cur->next;
-
- free(cur);
- cur = NULL;
-
- if (last != NULL)
- last->next = p;
- else
- EVCleanupHookTable = p;
- cur = p;
- }
- else {
- last = cur;
- cur = cur->next;
- }
- }
-}
-
-
-void CtdlDestroyEVCleanupHooks(void)
-{
- CleanupFunctionHook *cur, *p;
-
- cur = EVCleanupHookTable;
- while (cur != NULL)
- {
- MODM_syslog(LOG_DEBUG, "Destroyed cleanup function\n");
- p = cur->next;
- cur->h_function_pointer();
- free(cur);
- cur = p;
- }
- EVCleanupHookTable = NULL;
-}
-
-void CtdlRegisterTDAPVetoHook(int (*fcn_ptr) (StrBuf*), int EventType, int Priority)
-{
- TDAPVetoHookFunctionHook *newfcn;
-
- newfcn = (TDAPVetoHookFunctionHook *)
- malloc(sizeof(TDAPVetoHookFunctionHook));
- newfcn->Priority = Priority;
- newfcn->h_function_pointer = fcn_ptr;
- newfcn->eventtype = EventType;
-
- TDAPVetoHookFunctionHook **pfcn;
- pfcn = &TDAPVetoHookTable;
- while ((*pfcn != NULL) &&
- ((*pfcn)->Priority < newfcn->Priority) &&
- ((*pfcn)->next != NULL))
- pfcn = &(*pfcn)->next;
-
- newfcn->next = *pfcn;
- *pfcn = newfcn;
-
- MOD_syslog(LOG_DEBUG, "Registered a new TDAP Veto function (type %d Priority %d)\n",
- EventType, Priority);
-}
-
-
-void CtdlUnregisterTDAPVetoHook(int (*fcn_ptr) (StrBuf*), int EventType)
-{
- TDAPVetoHookFunctionHook *cur, *p, *last;
- last = NULL;
- cur = TDAPVetoHookTable;
- while (cur != NULL) {
- if ((fcn_ptr == cur->h_function_pointer) &&
- (EventType == cur->eventtype))
- {
- MOD_syslog(LOG_DEBUG, "Unregistered TDAP Veto function (type %d)\n",
- EventType);
- p = cur->next;
-
- free(cur);
- cur = NULL;
-
- if (last != NULL)
- last->next = p;
- else
- TDAPVetoHookTable = p;
- cur = p;
- }
- else {
- last = cur;
- cur = cur->next;
- }
- }
-}
-
-void CtdlDestroyTDAPVetoHooks(void)
-{
- TDAPVetoHookFunctionHook *cur, *p;
-
- cur = TDAPVetoHookTable;
- while (cur != NULL)
- {
- MODM_syslog(LOG_DEBUG, "Destroyed TDAP Veto function\n");
- p = cur->next;
- free(cur);
- cur = p;
- }
- TDAPVetoHookTable = NULL;