-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;
-
- syslog(LOG_DEBUG, "extensions: registered a new cleanup function");
-}
-
-
-void CtdlUnregisterCleanupHook(void (*fcn_ptr) (void))
-{
- CleanupFunctionHook *cur, *p, *last;
- last = NULL;
- cur = CleanupHookTable;
- while (cur != NULL)
- {
- if (fcn_ptr == cur->h_function_pointer)
- {
- syslog(LOG_DEBUG, "extensions: unregistered cleanup function");
- 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)
- {
- syslog(LOG_DEBUG, "extensions: destroyed cleanup function");
- 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;
-
- syslog(LOG_DEBUG, "extensions: registered a new cleanup function");
-}
-
-
-void CtdlUnregisterEVCleanupHook(void (*fcn_ptr) (void))
-{
- CleanupFunctionHook *cur, *p, *last;
- last = NULL;
- cur = EVCleanupHookTable;
- while (cur != NULL)
- {
- if (fcn_ptr == cur->h_function_pointer)
- {
- syslog(LOG_DEBUG, "extensions: unregistered cleanup function");
- 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)
- {
- syslog(LOG_DEBUG, "extensions: destroyed cleanup function");
- p = cur->next;
- cur->h_function_pointer();
- free(cur);
- cur = p;
- }
- EVCleanupHookTable = NULL;
-}
-
-
-