2008-08-03 20:10:10 +04:00
|
|
|
/*
|
2014-11-22 19:24:26 +03:00
|
|
|
* Copyright 2008-2014 Chris Young <chris@unsatisfactorysoftware.co.uk>
|
2008-08-03 20:10:10 +04:00
|
|
|
*
|
|
|
|
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
|
|
|
*
|
|
|
|
* NetSurf is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* NetSurf is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AMIGA_SCHEDULE_H
|
|
|
|
#define AMIGA_SCHEDULE_H
|
2010-12-30 03:53:11 +03:00
|
|
|
#include "amiga/os3support.h"
|
|
|
|
|
2014-03-08 18:13:27 +04:00
|
|
|
/**
|
|
|
|
* Schedule a callback.
|
|
|
|
*
|
|
|
|
* \param t interval before the callback should be made / ms
|
|
|
|
* \param callback callback function
|
|
|
|
* \param p user parameter, passed to callback function
|
|
|
|
* \return NSERROR_OK on sucess or appropriate error on faliure
|
|
|
|
*
|
|
|
|
* The callback function will be called as soon as possible after t ms have
|
|
|
|
* passed.
|
|
|
|
*/
|
|
|
|
nserror ami_schedule(int t, void (*callback)(void *p), void *p);
|
|
|
|
|
|
|
|
/**
|
2014-11-22 19:24:26 +03:00
|
|
|
* Handle a message received from the scheduler process.
|
2014-03-08 18:13:27 +04:00
|
|
|
*
|
2014-11-22 19:24:26 +03:00
|
|
|
* \param nsmsgport Message port to process.
|
2014-03-08 18:13:27 +04:00
|
|
|
*/
|
2014-11-22 19:24:26 +03:00
|
|
|
void ami_schedule_handle(struct MsgPort *nsmsgport);
|
2014-03-08 18:13:27 +04:00
|
|
|
|
2014-11-22 02:46:22 +03:00
|
|
|
/**
|
2016-01-21 23:13:49 +03:00
|
|
|
* Initialise amiga scheduler
|
2014-11-22 02:46:22 +03:00
|
|
|
*
|
2016-01-21 23:13:49 +03:00
|
|
|
* \param msgport opened message port
|
|
|
|
*
|
|
|
|
* \return error.
|
2014-11-22 02:46:22 +03:00
|
|
|
*/
|
2016-01-21 23:13:49 +03:00
|
|
|
nserror ami_schedule_create(struct MsgPort *msgport);
|
2014-11-22 19:24:26 +03:00
|
|
|
|
|
|
|
/**
|
2016-01-21 23:13:49 +03:00
|
|
|
* Finalise amiga scheduler
|
2014-11-22 19:24:26 +03:00
|
|
|
*/
|
2016-01-21 23:13:49 +03:00
|
|
|
void ami_schedule_free(void);
|
2008-08-03 20:10:10 +04:00
|
|
|
#endif
|
2014-11-18 02:47:28 +03:00
|
|
|
|