NetSurf
schedule.h
Go to the documentation of this file.
1/*
2 * Copyright 2008-2014 Chris Young <chris@unsatisfactorysoftware.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 AMIGA_SCHEDULE_H
20#define AMIGA_SCHEDULE_H
21#include "amiga/os3support.h"
22#include "utils/errors.h"
23
24/**
25 * Schedule a callback.
26 *
27 * \param t interval before the callback should be made / ms
28 * \param callback callback function
29 * \param p user parameter, passed to callback function
30 * \return NSERROR_OK on sucess or appropriate error on faliure
31 *
32 * The callback function will be called as soon as possible after t ms have
33 * passed.
34 */
35nserror ami_schedule(int t, void (*callback)(void *p), void *p);
36
37/**
38 * Handle a message received from the scheduler process.
39 *
40 * \param nsmsgport Message port to process.
41 */
42void ami_schedule_handle(struct MsgPort *nsmsgport);
43
44/**
45 * Initialise amiga scheduler
46 *
47 * \param msgport opened message port
48 *
49 * \return error.
50 */
51nserror ami_schedule_create(struct MsgPort *msgport);
52
53/**
54 * Finalise amiga scheduler
55 */
56void ami_schedule_free(void);
57#endif
58
void ami_schedule_free(void)
Finalise amiga scheduler.
Definition: schedule.c:320
nserror ami_schedule(int t, void(*callback)(void *p), void *p)
Schedule a callback.
Definition: schedule.c:331
void ami_schedule_handle(struct MsgPort *nsmsgport)
Handle a message received from the scheduler process.
Definition: schedule.c:369
nserror ami_schedule_create(struct MsgPort *msgport)
Initialise amiga scheduler.
Definition: schedule.c:302
Error codes.
nserror
Enumeration of error codes.
Definition: errors.h:29
Minimal compatibility header for AmigaOS 3.