2008-08-03 20:10:10 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2008 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
|
2008-09-08 22:14:14 +04:00
|
|
|
#include <proto/timer.h>
|
2010-12-30 03:53:11 +03:00
|
|
|
#include "amiga/os3support.h"
|
|
|
|
|
2011-02-19 20:19:38 +03:00
|
|
|
struct Device *TimerBase;
|
|
|
|
struct TimerIFace *ITimer;
|
|
|
|
|
2008-12-20 13:54:59 +03:00
|
|
|
struct TimeRequest *tioreq;
|
2009-10-16 01:35:29 +04:00
|
|
|
struct MsgPort *msgport;
|
2008-08-03 20:10:10 +04:00
|
|
|
|
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);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialise amiga scheduler
|
|
|
|
*
|
|
|
|
* /return true if initialised ok or false on error.
|
|
|
|
*/
|
2014-11-11 02:50:28 +03:00
|
|
|
bool ami_schedule_create(void);
|
2014-03-08 18:13:27 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Finalise amiga scheduler
|
|
|
|
*
|
|
|
|
*/
|
2011-02-17 00:29:39 +03:00
|
|
|
void ami_schedule_free(void);
|
2014-03-08 18:13:27 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Process events up to current time.
|
|
|
|
*
|
|
|
|
* This implementation only takes the top entry off the heap, it does not
|
|
|
|
* venture to later scheduled events until the next time it is called -
|
|
|
|
* immediately afterwards, if we're in a timer signalled loop.
|
|
|
|
*/
|
2014-11-18 02:47:28 +03:00
|
|
|
void schedule_run(void);
|
2014-03-08 18:13:27 +04:00
|
|
|
|
2008-08-03 20:10:10 +04:00
|
|
|
#endif
|
2014-11-18 02:47:28 +03:00
|
|
|
|