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  */
35 nserror 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  */
42 void ami_schedule_handle(struct MsgPort *nsmsgport);
43 
44 /**
45  * Initialise amiga scheduler
46  *
47  * \param msgport opened message port
48  *
49  * \return error.
50  */
51 nserror ami_schedule_create(struct MsgPort *msgport);
52 
53 /**
54  * Finalise amiga scheduler
55  */
56 void ami_schedule_free(void);
57 #endif
58 
59