diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2006-12-20 20:29:08 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2006-12-20 20:29:08 +0000 |
| commit | baed853fe369f6ef46e7c583d0347e8b42160d65 (patch) | |
| tree | f6805f5c6fd710d5df18eb6bfbf670bc00ab11f4 /src | |
| parent | e8550d89b3f13a85c6ba4b4a65291f9aa4bf533e (diff) | |
STR #1542: implemented the prototyped Fl::has_check() function
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5563 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl.cxx | 16 |
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 |
