Data Structures | Typedefs | Functions

/build/buildd-opendnssec_1.3.2-1~bpo60+1-ia64-Ga1C3m/opendnssec-1.3.2/signer/src/scheduler/schedule.h File Reference

#include "config.h"
#include "scheduler/task.h"
#include "shared/allocator.h"
#include "shared/locks.h"
#include "shared/status.h"
#include <stdio.h>
#include <time.h>
#include <ldns/ldns.h>
Include dependency graph for schedule.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  schedule_struct

Typedefs

typedef struct schedule_struct schedule_type

Functions

schedule_typeschedule_create (allocator_type *allocator)
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)
ods_status reschedule_task (schedule_type *schedule, task_type *task, task_id what, time_t when)
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

Task scheduling. Task schedule.

Definition at line 59 of file schedule.h.


Function Documentation

ods_status reschedule_task ( schedule_type schedule,
task_type task,
task_id  what,
time_t  when 
)

Reschedule task.

Parameters:
[in] schedule schedule
[in] task task to delete
[in] what new task
[in] when new time
Returns:
ods_status status

Reschedule task.

Definition at line 246 of file schedule.c.

References schedule_task(), unschedule_task(), task_struct::what, and task_struct::when.

void schedule_cleanup ( schedule_type schedule  ) 

Clean up schedule.

Parameters:
[in] schedule schedule to be cleaned up

Clean up schedule.

Definition at line 396 of file schedule.c.

References schedule_struct::allocator, allocator_deallocate(), lock_basic_destroy, ods_log_debug(), schedule_struct::schedule_lock, and schedule_struct::tasks.

Referenced by engine_cleanup().

schedule_type* schedule_create ( allocator_type allocator  ) 

Create new schedule.

Parameters:
[in] allocator memory allocator
Returns:
schedule_type* created schedule

Create new schedule.

Definition at line 51 of file schedule.c.

References schedule_struct::allocator, allocator_alloc(), schedule_struct::flushcount, schedule_struct::loading, lock_basic_init, ods_log_assert, ods_log_error(), schedule_struct::schedule_lock, task_compare(), and schedule_struct::tasks.

void schedule_flush ( schedule_type schedule,
task_id  override 
)

Flush schedule.

Parameters:
[in] schedule schedule to be flushed
[in] override override task

Flush schedule.

Definition at line 83 of file schedule.c.

References task_struct::flush, schedule_struct::flushcount, ods_log_assert, ods_log_debug(), TASK_NONE, schedule_struct::tasks, and task_struct::what.

task_type* schedule_get_first_task ( schedule_type schedule  ) 

Get the first scheduled task.

Parameters:
[in] schedule schedule
Returns:
task_type* first scheduled task

Get the first scheduled task.

Definition at line 270 of file schedule.c.

References task_struct::flush, schedule_struct::flushcount, ods_log_assert, ods_log_info(), ods_log_warning(), and schedule_struct::tasks.

Referenced by schedule_pop_task().

task_type* schedule_lookup_task ( schedule_type schedule,
task_type task 
)

Look up task.

Parameters:
[in] schedule schedule
[in] task task
Returns:
task_type* task, if found

Look up task.

Definition at line 128 of file schedule.c.

References ods_log_assert, and schedule_struct::tasks.

Referenced by schedule_task().

task_type* schedule_pop_task ( schedule_type schedule  ) 

Pop the first scheduled task.

Parameters:
[in] schedule schedule
Returns:
task_type* popped task

Pop the first scheduled task.

Definition at line 315 of file schedule.c.

References task_struct::flush, ods_log_assert, ods_log_debug(), ods_log_error(), schedule_get_first_task(), schedule_struct::tasks, time_now(), unschedule_task(), task_struct::when, and task_struct::who.

void schedule_print ( FILE *  out,
schedule_type schedule 
)

Print schedule.

Parameters:
[in] out file descriptor
[in] schedule schedule

Print schedule.

Definition at line 348 of file schedule.c.

References ods_log_assert, task_print(), and schedule_struct::tasks.

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

Schedule task.

Parameters:
[in] schedule schedule
[in] task task
[in] log add entry in log for this
Returns:
ods_status status

Schedule task.

Definition at line 153 of file schedule.c.

References task_struct::flush, schedule_struct::flushcount, ods_log_assert, ods_log_debug(), ods_log_error(), schedule_lookup_task(), task_log(), task_what2str(), task_who2str(), schedule_struct::tasks, task_struct::what, and task_struct::who.

Referenced by engine_update_zones(), and reschedule_task().

task_type* unschedule_task ( schedule_type schedule,
task_type task 
)

Unschedule task.

Parameters:
[in] schedule schedule
[in] task task to delete
Returns:
task_type* task, if it was scheduled

Unschedule task.

Definition at line 203 of file schedule.c.

References task_struct::flush, schedule_struct::flushcount, ods_log_assert, ods_log_debug(), ods_log_error(), ods_log_warning(), task_what2str(), task_who2str(), schedule_struct::tasks, task_struct::what, and task_struct::who.

Referenced by engine_update_zones(), reschedule_task(), and schedule_pop_task().