comparison src/timeout.cc @ 1800:e8f95d2c1732

timeout
author corvid <corvid@lavabit.com>
date Thu, 06 Jan 2011 06:19:52 +0000
parents a72e5506e280
children
comparison
equal deleted inserted replaced
1799:01432b4073db 1800:e8f95d2c1732
9 * (at your option) any later version. 9 * (at your option) any later version.
10 */ 10 */
11 11
12 // Simple ADT for timeout functions 12 // Simple ADT for timeout functions
13 13
14 #include <fltk/run.h> 14 #include <FL/Fl.H>
15 #include "timeout.hh" 15 #include "timeout.hh"
16
17 using namespace fltk;
18
19 16
20 // C++ functions with C linkage ---------------------------------------------- 17 // C++ functions with C linkage ----------------------------------------------
21 18
22 /* 19 /*
23 * Hook a one-time timeout function 'cb' after 't' seconds 20 * Hook a one-time timeout function 'cb' after 't' seconds
24 * with 'cbdata" as its data. 21 * with 'cbdata" as its data.
25 */ 22 */
26 void a_Timeout_add(float t, TimeoutCb_t cb, void *cbdata) 23 void a_Timeout_add(float t, TimeoutCb_t cb, void *cbdata)
27 { 24 {
28 add_timeout(t, cb, cbdata); 25 Fl::add_timeout(t, cb, cbdata);
29 } 26 }
30 27
31 /* 28 /*
32 * To be called from inside the 'cb' function when it wants to keep running 29 * To be called from inside the 'cb' function when it wants to keep running
33 */ 30 */
34 void a_Timeout_repeat(float t, TimeoutCb_t cb, void *cbdata) 31 void a_Timeout_repeat(float t, TimeoutCb_t cb, void *cbdata)
35 { 32 {
36 add_timeout(t, cb, cbdata); 33 Fl::add_timeout(t, cb, cbdata);
37 } 34 }
38 35
39 /* 36 /*
40 * Stop running a timeout function 37 * Stop running a timeout function
41 */ 38 */