NetSurf
|
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "utils/sys_time.h"
#include "utils/errors.h"
#include "utils/log.h"
#include "atari/schedule.h"
Go to the source code of this file.
Data Structures | |
struct | nscallback |
scheduled callback. More... | |
Macros | |
#define | MS_NOW() ((clock() * 1000) / CLOCKS_PER_SEC) |
Functions | |
static nserror | schedule_remove (void(*callback)(void *p), void *p) |
Unschedule a callback. More... | |
nserror | atari_schedule (int ival, void(*callback)(void *p), void *p) |
Schedule a callback. More... | |
int | schedule_run (void) |
Process events up to current time. More... | |
void | list_schedule (void) |
LOG all current scheduled events. More... | |
Variables | |
static struct nscallback * | schedule_list = NULL |
static int | max_scheduled |
static int | cur_scheduled |
#define MS_NOW | ( | ) | ((clock() * 1000) / CLOCKS_PER_SEC) |
Definition at line 30 of file schedule.c.
nserror atari_schedule | ( | int | ival, |
void(*)(void *p) | callback, | ||
void * | p | ||
) |
Schedule a callback.
ival | interval before the callback should be made in miliseconds. |
callback | callback function. |
p | user parameter, passed to callback function. |
The callback function will be called as soon as possible after ival ms have passed.
Definition at line 103 of file schedule.c.
References nscallback::callback, cur_scheduled, max_scheduled, MS_NOW, nscallback::next, NSERROR_OK, NSLOG, nscallback::p, schedule_list, schedule_remove(), and nscallback::timeout.
Referenced by gui_window_start_throbber(), gui_window_stop_throbber(), and throbber_advance().
void list_schedule | ( | void | ) |
LOG all current scheduled events.
Definition at line 210 of file schedule.c.
References max_scheduled, MS_NOW, nscallback::next, NSLOG, schedule_list, and nscallback::timeout.
|
static |
Unschedule a callback.
callback | callback function |
p | user parameter, passed to callback function |
All scheduled callbacks matching both callback and p are removed.
Definition at line 58 of file schedule.c.
References nscallback::callback, cur_scheduled, nscallback::next, NSERROR_OK, NSLOG, nscallback::p, and schedule_list.
Referenced by atari_schedule().
int schedule_run | ( | void | ) |
Process events up to current time.
Process scheduled callbacks up to current time.
Definition at line 137 of file schedule.c.
References nscallback::callback, cur_scheduled, MS_NOW, nscallback::next, NSLOG, nscallback::p, schedule_list, and nscallback::timeout.
Referenced by atari_poll(), framebuffer_run(), nsbeos_gui_poll(), nsgtk_main(), riscos_poll(), and win32_run().
|
static |
Definition at line 47 of file schedule.c.
Referenced by atari_schedule(), schedule_remove(), and schedule_run().
|
static |
Definition at line 46 of file schedule.c.
Referenced by atari_schedule(), and list_schedule().
|
static |
Definition at line 33 of file schedule.c.
Referenced by atari_schedule(), list_schedule(), schedule_remove(), and schedule_run().