NetSurf
|
#include <stdlib.h>
#include <time.h>
#include "utils/sys_time.h"
#include "utils/log.h"
#include "utils/errors.h"
#include "windows/schedule.h"
Go to the source code of this file.
Data Structures | |
struct | nscallback |
scheduled callback. More... | |
Functions | |
static nserror | schedule_remove (void(*callback)(void *p), void *p) |
Unschedule a callback. More... | |
nserror | win32_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 |
void list_schedule | ( | void | ) |
LOG all current scheduled events.
Definition at line 214 of file schedule.c.
References nscallback::next, NSLOG, schedule_list, and nscallback::tv.
|
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 52 of file schedule.c.
References nscallback::callback, nscallback::next, NSERROR_OK, NSLOG, nscallback::p, and schedule_list.
Referenced by win32_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, nscallback::next, NSLOG, nscallback::p, schedule_list, timercmp, timersub, and nscallback::tv.
nserror win32_schedule | ( | int | ival, |
void(*)(void *p) | callback, | ||
void * | p | ||
) |
Schedule a callback.
ival | interval before the callback should be made in ms |
callback | callback function |
p | user parameter, passed to callback function |
The callback function will be called as soon as possible after t ms have passed.
Definition at line 99 of file schedule.c.
References nscallback::callback, nscallback::next, NSERROR_NOMEM, NSERROR_OK, NSLOG, nscallback::p, schedule_list, schedule_remove(), timeradd, and nscallback::tv.
Referenced by nsws_download_clear_data(), nsws_download_update_label(), and nsws_download_update_progress().
|
static |
Definition at line 29 of file schedule.c.
Referenced by list_schedule(), schedule_remove(), schedule_run(), and win32_schedule().