]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/timeq.c
quick fix for "Unable to find user SOME-SERVER whose mark is changing." errors, bette...
[irc/evilnet/x3.git] / src / timeq.c
index 115a97a5cd4a3803d98fdef7153644c25509b305..40c8bdf4f2a266552c068befd99bab8370a6ae0c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * This file is part of x3.
  *
- * srvx is free software; you can redistribute it and/or modify
+ * x3 is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
@@ -21,6 +21,7 @@
 #include "common.h"
 #include "heap.h"
 #include "timeq.h"
+#include "log.h"
 
 heap_t timeq;
 
@@ -52,10 +53,11 @@ timeq_next(void)
 }
 
 void
-timeq_add(time_t when, timeq_func func, void *data)
+timeq_add_real(time_t when, timeq_func func, void *data, UNUSED_ARG(const char *calling_func))
 {
     struct timeq_entry *ent;
     void *w;
+/*    log_module(MAIN_LOG, LOG_DEBUG, "TIMEQ: %s adding timer: %ul (address: %x)", calling_func, (unsigned int)when, (unsigned int)func); */
     ent = malloc(sizeof(struct timeq_entry));
     ent->func = func;
     ent->data = data;
@@ -78,6 +80,7 @@ timeq_del_matching(void *key, void *data, void *extra)
     if (((b->mask & TIMEQ_IGNORE_WHEN) || ((time_t)key == b->when))
        && ((b->mask & TIMEQ_IGNORE_FUNC) || (a->func == b->func))
        && ((b->mask & TIMEQ_IGNORE_DATA) || (a->data == b->data))) {
+        /* log_module(MAIN_LOG, LOG_DEBUG, "TIMEQ:     - deleting matching timer %x", a->func); */
         free(data);
         return 1;
     } else {
@@ -86,9 +89,10 @@ timeq_del_matching(void *key, void *data, void *extra)
 }
 
 void
-timeq_del(time_t when, timeq_func func, void *data, int mask)
+timeq_del_real(time_t when, timeq_func func, void *data, int mask, UNUSED_ARG(const char *calling_func))
 {
     struct timeq_extra extra;
+    /* log_module(MAIN_LOG, LOG_DEBUG, "TIMEQ: %s deleting timer: %d (address: %x mask: %x)", calling_func, (unsigned int)when, (unsigned int) func,  mask); */
     extra.when = when;
     extra.func = func;
     extra.data = data;