42 static const char* task_str =
"task";
60 ods_log_error(
"[%s] unable to create task: allocator_create() failed",
66 ods_log_error(
"[%s] unable to create task: allocator_alloc() failed",
97 fprintf(fd,
";;Task: when %u what %i interrupt %i halted %i backoff %i "
99 (
unsigned) task->
when,
125 if (!ldns_dname_compare((
const void*) zx->
apex,
126 (
const void*) zy->
apex)) {
138 return ldns_dname_compare((
const void*) zx->
apex,
139 (
const void*) zy->
apex);
155 return "[configure]";
184 if (zone && zone->
name) {
198 char* strtime = NULL;
199 char* strtask = NULL;
202 strtime = ctime(&task->
when);
204 strtime[strlen(strtime)-1] =
'\0';
207 (void)snprintf(buftask, ODS_SE_MAXLINE,
"%s %s I will %s zone %s"
208 "\n", task->
flush?
"Flush":
"On", strtime?strtime:
"(null)",
212 strtask = (
char*) calloc(ODS_SE_MAXLINE,
sizeof(
char));
214 snprintf(strtask, ODS_SE_MAXLINE,
"%s %s I will %s zone %s\n",
215 task->
flush?
"Flush":
"On", strtime?strtime:
"(null)",
219 ods_log_error(
"[%s] unable to convert task to string: malloc "
235 char* strtime = NULL;
238 strtime = ctime(&task->
when);
240 strtime[strlen(strtime)-1] =
'\0';
242 fprintf(out,
"%s %s I will %s zone %s\n",
243 task->
flush?
"Flush":
"On", strtime?strtime:
"(null)",
257 char* strtime = NULL;
260 strtime = ctime(&task->
when);
262 strtime[strlen(strtime)-1] =
'\0';
265 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)