diff options
author | jcid <devnull@localhost> | 2007-10-07 00:36:34 +0200 |
---|---|---|
committer | jcid <devnull@localhost> | 2007-10-07 00:36:34 +0200 |
commit | 93715c46a99c96d6c866968312691ec9ab0f6a03 (patch) | |
tree | 573f19ec6aa740844f53a7c0eb7114f04096bf64 /src/timeout.cc |
Initial revision
Diffstat (limited to 'src/timeout.cc')
-rw-r--r-- | src/timeout.cc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/timeout.cc b/src/timeout.cc new file mode 100644 index 00000000..da944803 --- /dev/null +++ b/src/timeout.cc @@ -0,0 +1,46 @@ +/* + * File: timeout.cc + * + * Copyright (C) 2005 Jorge Arellano Cid <jcid@dillo.org> + * + * This program 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 3 of the License, or + * (at your option) any later version. + */ + +// Simple ADT for timeout functions + +#include <fltk/run.h> +#include "timeout.hh" + +using namespace fltk; + + +// C++ functions with C linkage ---------------------------------------------- + +/* + * Hook a one-time timeout function 'cb' after 't' seconds + * with 'cbdata" as its data. + */ +void a_Timeout_add(float t, TimeoutCb_t cb, void *cbdata) +{ + add_timeout(t, cb, cbdata); +} + +/* + * To be called from iside the 'cb' function when it wants to keep running + */ +void a_Timeout_repeat(float t, TimeoutCb_t cb, void *cbdata) +{ + add_timeout(t, cb, cbdata); +} + +/* + * Stop running a timeout function + */ +void a_Timeout_remove() +{ + /* in FLTK, timeouts run one time by default */ +} + |