netsurf/frontends/amiga/schedule.h

58 lines
1.6 KiB
C
Raw Normal View History

/*
2014-11-22 19:24:26 +03:00
* Copyright 2008-2014 Chris Young <chris@unsatisfactorysoftware.co.uk>
*
* 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
#include "amiga/os3support.h"
/**
* 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-11-22 19:24:26 +03:00
* \param nsmsgport Message port to process.
*/
2014-11-22 19:24:26 +03:00
void ami_schedule_handle(struct MsgPort *nsmsgport);
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);
#endif