NetSurf
schedule.h
Go to the documentation of this file.
1/*
2 * Copyright 2008 Vincent Sanders <vince@simtec.co.uk>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef NETSURF_MONKEY_SCHEDULE_H
20#define NETSURF_MONKEY_SCHEDULE_H
21
22/**
23 * Schedule a callback.
24 *
25 * \param tival interval before the callback should be made in ms
26 * \param callback callback function
27 * \param p user parameter, passed to callback function
28 *
29 * The callback function will be called as soon as possible after t ms have
30 * passed.
31 */
32
33nserror monkey_schedule(int tival, void (*callback)(void *p), void *p);
34
35/**
36 * Process scheduled callbacks up to current time.
37 *
38 * @return The number of milliseconds untill the next scheduled event
39 * or -1 for no event.
40 */
41int monkey_schedule_run(void);
42
43/**
44 * Log a list of all scheduled callbacks.
45 */
46void monkey_schedule_list(void);
47
48#endif
nserror
Enumeration of error codes.
Definition: errors.h:29
void monkey_schedule_list(void)
Log a list of all scheduled callbacks.
Definition: schedule.c:200
nserror monkey_schedule(int tival, void(*callback)(void *p), void *p)
Schedule a callback.
Definition: schedule.c:100
int monkey_schedule_run(void)
Process scheduled callbacks up to current time.
Definition: schedule.c:133