annotate src/timeout.cc @ 2102:e1973d1962c5

rm comment warning about (left|right)-tab
author corvid <corvid@lavabit.com>
date Tue, 21 Jun 2011 00:15:55 +0000
parents e8f95d2c1732
children
rev   line source
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
1 /*
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
2 * File: timeout.cc
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
3 *
35
d9e7b35430de Updated copyright lines
jcid
parents: 0
diff changeset
4 * Copyright (C) 2005-2007 Jorge Arellano Cid <jcid@dillo.org>
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
5 *
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
8 * the Free Software Foundation; either version 3 of the License, or
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
9 * (at your option) any later version.
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
10 */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
11
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
12 // Simple ADT for timeout functions
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
13
1800
e8f95d2c1732 timeout
corvid <corvid@lavabit.com>
parents: 1037
diff changeset
14 #include <FL/Fl.H>
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
15 #include "timeout.hh"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
16
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
17 // C++ functions with C linkage ----------------------------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
18
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
19 /*
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
20 * Hook a one-time timeout function 'cb' after 't' seconds
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
21 * with 'cbdata" as its data.
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
22 */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
23 void a_Timeout_add(float t, TimeoutCb_t cb, void *cbdata)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
24 {
1800
e8f95d2c1732 timeout
corvid <corvid@lavabit.com>
parents: 1037
diff changeset
25 Fl::add_timeout(t, cb, cbdata);
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
26 }
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
27
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
28 /*
1037
a72e5506e280 Implemented Instant client-side redirects (META refresh with delay=0)
Jorge Arellano Cid <jcid@dillo.org>
parents: 35
diff changeset
29 * To be called from inside the 'cb' function when it wants to keep running
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
30 */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
31 void a_Timeout_repeat(float t, TimeoutCb_t cb, void *cbdata)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
32 {
1800
e8f95d2c1732 timeout
corvid <corvid@lavabit.com>
parents: 1037
diff changeset
33 Fl::add_timeout(t, cb, cbdata);
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
34 }
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
35
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
36 /*
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
37 * Stop running a timeout function
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
38 */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
39 void a_Timeout_remove()
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
40 {
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
41 /* in FLTK, timeouts run one time by default */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
42 }
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
43