OpenDNSSEC-signer  1.4.5
Functions
duration.c File Reference
#include "shared/allocator.h"
#include "shared/duration.h"
#include "shared/log.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
Include dependency graph for duration.c:

Go to the source code of this file.

Functions

duration_typeduration_create (void)
 
int duration_compare (duration_type *d1, duration_type *d2)
 
duration_typeduration_create_from_string (const char *str)
 
char * duration2string (duration_type *duration)
 
time_t duration2time (duration_type *duration)
 
time_t time_minimum (time_t a, time_t b)
 
time_t time_maximum (time_t a, time_t b)
 
time_t ods_rand (time_t mod)
 
time_t time_now (void)
 
uint32_t time_datestamp (time_t tt, const char *format, char **str)
 
void time_itoa (time_t n, char *s)
 
void duration_cleanup (duration_type *duration)
 

Function Documentation

char* duration2string ( duration_type duration)
time_t duration2time ( duration_type duration)
void duration_cleanup ( duration_type duration)

Clean up duration.

Definition at line 600 of file duration.c.

References duration_struct::allocator, allocator_cleanup(), and allocator_deallocate().

Referenced by duration_create_from_string(), and signconf_cleanup().

int duration_compare ( duration_type d1,
duration_type d2 
)
duration_type* duration_create ( void  )
duration_type* duration_create_from_string ( const char *  str)
time_t ods_rand ( time_t  mod)

Return a random time.

Definition at line 422 of file duration.c.

uint32_t time_datestamp ( time_t  tt,
const char *  format,
char **  str 
)

copycode: This code is based on the EXAMPLE in the strftime manual.

Definition at line 531 of file duration.c.

References ods_log_error(), and time_now().

Referenced by namedb_update_serial(), zone_load_signconf(), and zonelist_update().

void time_itoa ( time_t  n,
char *  s 
)

Convert time into string.

Definition at line 582 of file duration.c.

time_t time_maximum ( time_t  a,
time_t  b 
)

Return the longest time.

Definition at line 411 of file duration.c.

time_t time_minimum ( time_t  a,
time_t  b 
)

Return the shortest time.

Definition at line 401 of file duration.c.

time_t time_now ( void  )