GNUnet 0.21.1
GNUNET_SCHEDULER_Driver Struct Reference

API an external event loop has to implement for GNUNET_SCHEDULER_driver_init. More...

#include <gnunet_scheduler_lib.h>

Data Fields

void * cls
 Closure to pass to the functions in this struct. More...
 
int(* add )(void *cls, struct GNUNET_SCHEDULER_Task *task, struct GNUNET_SCHEDULER_FdInfo *fdi)
 Add a task to be run if the conditions specified in the et field of the given fdi are satisfied. More...
 
int(* del )(void *cls, struct GNUNET_SCHEDULER_Task *task)
 Delete a task from the set of tasks to be run. More...
 
void(* set_wakeup )(void *cls, struct GNUNET_TIME_Absolute dt)
 Set time at which we definitively want to get a wakeup call. More...
 

Detailed Description

API an external event loop has to implement for GNUNET_SCHEDULER_driver_init.

Definition at line 267 of file gnunet_scheduler_lib.h.

Field Documentation

◆ cls

void* GNUNET_SCHEDULER_Driver::cls

Closure to pass to the functions in this struct.

Definition at line 272 of file gnunet_scheduler_lib.h.

Referenced by driver_add_multiple(), GNUNET_SCHEDULER_cancel(), GNUNET_SCHEDULER_do_work(), GNUNET_SCHEDULER_driver_init(), and GNUNET_SCHEDULER_run().

◆ add

int(* GNUNET_SCHEDULER_Driver::add) (void *cls, struct GNUNET_SCHEDULER_Task *task, struct GNUNET_SCHEDULER_FdInfo *fdi)

Add a task to be run if the conditions specified in the et field of the given fdi are satisfied.

The et field will be cleared after this call and the driver is expected to set the type of the actual event before passing fdi to GNUNET_SCHEDULER_task_ready.

Parameters
clsclosure
tasktask to add
fdiconditions to watch for
Returns
GNUNET_OK on success, GNUNET_SYSERR on failure (i.e. fdi too high or invalid)

Definition at line 287 of file gnunet_scheduler_lib.h.

Referenced by driver_add_multiple(), and GNUNET_SCHEDULER_driver_select().

◆ del

int(* GNUNET_SCHEDULER_Driver::del) (void *cls, struct GNUNET_SCHEDULER_Task *task)

Delete a task from the set of tasks to be run.

A task may comprise multiple FdInfo entries previously added with the add function. The driver is expected to delete them all.

Parameters
clsclosure
tasktask to delete
Returns
GNUNET_OK on success, GNUNET_SYSERR on failure (i.e. task does not match prior add call)

Definition at line 302 of file gnunet_scheduler_lib.h.

Referenced by GNUNET_SCHEDULER_cancel(), GNUNET_SCHEDULER_do_work(), and GNUNET_SCHEDULER_driver_select().

◆ set_wakeup

void(* GNUNET_SCHEDULER_Driver::set_wakeup) (void *cls, struct GNUNET_TIME_Absolute dt)

Set time at which we definitively want to get a wakeup call.

Parameters
clsclosure
dttime when we want to wake up next

Definition at line 312 of file gnunet_scheduler_lib.h.

Referenced by GNUNET_SCHEDULER_do_work(), GNUNET_SCHEDULER_driver_init(), and GNUNET_SCHEDULER_driver_select().


The documentation for this struct was generated from the following file: