40 static const char* task_str =
"task";
58 ods_log_error(
"[%s] unable to create task: allocator_create() failed",
64 ods_log_error(
"[%s] unable to create task: allocator_alloc() failed",
95 fprintf(fd,
";;Task: when %u what %i interrupt %i halted %i backoff %i " 97 (
unsigned) task->
when,
123 if (!ldns_dname_compare((
const void*) zx->
apex,
124 (
const void*) zy->
apex)) {
136 return ldns_dname_compare((
const void*) zx->
apex,
137 (
const void*) zy->
apex);
153 return "[configure]";
182 if (zone && zone->
name) {
196 char* strtime = NULL;
197 char* strtask = NULL;
200 strtime = ctime(&task->
when);
202 strtime[strlen(strtime)-1] =
'\0';
205 (void)snprintf(buftask, ODS_SE_MAXLINE,
"%s %s I will %s zone %s" 206 "\n", task->
flush?
"Flush":
"On", strtime?strtime:
"(null)",
210 strtask = (
char*) calloc(ODS_SE_MAXLINE,
sizeof(
char));
212 snprintf(strtask, ODS_SE_MAXLINE,
"%s %s I will %s zone %s\n",
213 task->
flush?
"Flush":
"On", strtime?strtime:
"(null)",
217 ods_log_error(
"[%s] unable to convert task to string: malloc " 233 char* strtime = NULL;
236 strtime = ctime(&task->
when);
238 strtime[strlen(strtime)-1] =
'\0';
240 fprintf(out,
"%s %s I will %s zone %s\n",
241 task->
flush?
"Flush":
"On", strtime?strtime:
"(null)",
255 char* strtime = NULL;
258 strtime = ctime(&task->
when);
260 strtime[strlen(strtime)-1] =
'\0';
263 task->
flush?
"Flush":
"On", strtime?strtime:
"(null)",
void ods_log_debug(const char *format,...)
void * allocator_alloc(allocator_type *allocator, size_t size)
void task_log(task_type *task)
const char * task_who2str(task_type *task)
void ods_log_error(const char *format,...)
enum task_id_enum task_id
allocator_type * allocator_create(void *(*allocator)(size_t size), void(*deallocator)(void *))
allocator_type * allocator
void task_cleanup(task_type *task)
void allocator_cleanup(allocator_type *allocator)
void allocator_deallocate(allocator_type *allocator, void *data)
int task_compare(const void *a, const void *b)
char * task2str(task_type *task, char *buftask)
void task_print(FILE *out, task_type *task)
#define ods_log_assert(x)
const char * task_what2str(task_id what)
task_type * task_create(task_id what, time_t when, void *zone)
void task_backup(FILE *fd, task_type *task)