4 * Calling routines at set times
6 * © 1994-1998 Straylight
9 /*----- Licensing note ----------------------------------------------------*
11 * This file is part of Straylight's Steel library.
13 * Steel is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
18 * Steel is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with Steel. If not, write to the Free Software Foundation,
25 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
37 typedef void (*alarm_handler)(int at,void *handle);
40 * void alarm_init(void)
46 void alarm_init(void);
49 * int alarm_timenow(void)
52 * Reports the time right now
55 int alarm_timenow(void);
58 * int alarm_timedifference(int t1,int t2)
61 * Tells you the difference between two times. t2 is considered to be later
65 int alarm_timedifference(int t1,int t2);
68 * void alarm_set(int at,alarm_handler proc,void *handle)
71 * Sets up `proc' to be called at time `at', being passed `handle'.
74 void alarm_set(int at,alarm_handler proc,void *handle);
77 * void alarm_remove(int at,void *handle)
80 * Removes an alarm identified by a time and a handle
83 void alarm_remove(int at,void *handle);
86 * void alarm_removeall(void *handle)
89 * Removes all alarms for the given handle
92 void alarm_removeall(void *handle);
95 * BOOL alarm_anypending(void *handle)
98 * Returns TRUE if there are alarms for the given handle
101 BOOL alarm_anypending(void *handle);
104 * BOOL alarm_next(int *when)
107 * Informs the caller (a) if there are any alarms waiting, and (b) when
111 * int *when == where to put the next time for an alarm (unchanged if no
115 * TRUE if there are any alarms left
118 BOOL alarm_next(int *when);
121 * void alarm_callnext(void)
124 * Calls the next alarm and removes it from the list
127 void alarm_callnext(void);