summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index d17f64823..28f80225d 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -260,6 +260,22 @@ void Fl::remove_check(Fl_Timeout_Handler cb, void *argp) {
}
}
+/**
+ * Return 1, if a check with the same handler and data pointer
+ * is pending, 0 otherwise.
+ */
+int Fl::has_check(Fl_Timeout_Handler cb, void *argp) {
+ for (Check** p = &first_check; *p;) {
+ Check* t = *p;
+ if (t->cb == cb && t->arg == argp) {
+ return 1;
+ } else {
+ p = &(t->next);
+ }
+ }
+ return 0;
+}
+
static void run_checks()
{
// checks are a bit messy so that add/remove and wait may be called