OpenDNSSEC-signer  2.0.3
Data Structures | Typedefs | Functions
schedule.h File Reference
#include "config.h"
#include <stdio.h>
#include <time.h>
#include <ldns/ldns.h>
#include "scheduler/task.h"
#include "locks.h"
#include "status.h"

Go to the source code of this file.

Data Structures

struct  schedule_struct
 

Typedefs

typedef struct schedule_struct schedule_type
 

Functions

schedule_typeschedule_create (void)
 
void schedule_flush (schedule_type *schedule, task_id override)
 
task_typeschedule_lookup_task (schedule_type *schedule, task_type *task)
 
ods_status schedule_task (schedule_type *schedule, task_type *task, int log)
 
task_typeunschedule_task (schedule_type *schedule, task_type *task)
 
task_typeschedule_pop_task (schedule_type *schedule)
 
task_typeschedule_get_first_task (schedule_type *schedule)
 
void schedule_print (FILE *out, schedule_type *schedule)
 
void schedule_cleanup (schedule_type *schedule)
 

Typedef Documentation

◆ schedule_type

Task scheduling.

Definition at line 48 of file schedule.h.

Function Documentation

◆ schedule_cleanup()

void schedule_cleanup ( schedule_type schedule)

Clean up schedule.

Parameters
[in]scheduleschedule to be cleaned up

Clean up schedule.

Definition at line 304 of file schedule.c.

Referenced by engine_cleanup().

◆ schedule_create()

schedule_type* schedule_create ( void  )

Create new schedule.

Parameters
[in]allocatormemory allocator
Returns
schedule_type* created schedule

Create new schedule.

Definition at line 48 of file schedule.c.

◆ schedule_flush()

void schedule_flush ( schedule_type schedule,
task_id  override 
)

Flush schedule.

Parameters
[in]scheduleschedule to be flushed
[in]overrideoverride task

Flush schedule.

Definition at line 76 of file schedule.c.

◆ schedule_get_first_task()

task_type* schedule_get_first_task ( schedule_type schedule)

Get the first scheduled task.

Parameters
[in]scheduleschedule
Returns
task_type* first scheduled task

Get the first scheduled task.

Definition at line 217 of file schedule.c.

References task_struct::flush, schedule_struct::flushcount, and schedule_struct::tasks.

Referenced by schedule_pop_task().

◆ schedule_lookup_task()

task_type* schedule_lookup_task ( schedule_type schedule,
task_type task 
)

Look up task.

Parameters
[in]scheduleschedule
[in]tasktask
Returns
task_type* task, if found

Look up task.

Definition at line 119 of file schedule.c.

References schedule_struct::tasks.

◆ schedule_pop_task()

task_type* schedule_pop_task ( schedule_type schedule)

Pop the first scheduled task.

Parameters
[in]scheduleschedule
Returns
task_type* popped task

Pop the first scheduled task.

Definition at line 257 of file schedule.c.

References task_struct::flush, schedule_get_first_task(), schedule_struct::tasks, and task_struct::when.

◆ schedule_print()

void schedule_print ( FILE *  out,
schedule_type schedule 
)

Print schedule.

Parameters
[in]outfile descriptor
[in]scheduleschedule

◆ schedule_task()

ods_status schedule_task ( schedule_type schedule,
task_type task,
int  log 
)

Schedule task.

Parameters
[in]scheduleschedule
[in]tasktask
[in]logadd entry in log for this
Returns
ods_status status

Schedule task.

Definition at line 140 of file schedule.c.

References schedule_struct::tasks.

◆ unschedule_task()

task_type* unschedule_task ( schedule_type schedule,
task_type task 
)

Unschedule task.

Parameters
[in]scheduleschedule
[in]tasktask to delete
Returns
task_type* task, if it was scheduled

Unschedule task.

Definition at line 185 of file schedule.c.

References schedule_struct::tasks.