OpenDNSSEC-signer
1.3.9
Main Page
Data Structures
Files
File List
Globals
signer
src
shared
duration.h
Go to the documentation of this file.
1
/*
2
* $Id: duration.h 4341 2011-01-31 15:21:09Z matthijs $
3
*
4
* Copyright (c) 2009 NLNet Labs. All rights reserved.
5
*
6
* Redistribution and use in source and binary forms, with or without
7
* modification, are permitted provided that the following conditions
8
* are met:
9
* 1. Redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer.
11
* 2. Redistributions in binary form must reproduce the above copyright
12
* notice, this list of conditions and the following disclaimer in the
13
* documentation and/or other materials provided with the distribution.
14
*
15
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
19
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
21
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
23
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
25
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
*
27
*/
28
34
#ifndef UTIL_DURATION_H
35
#define UTIL_DURATION_H
36
37
#include "config.h"
38
#include "
shared/allocator.h
"
39
40
#include <stdint.h>
41
#include <time.h>
42
47
typedef
struct
duration_struct
duration_type
;
48
struct
duration_struct
49
{
50
allocator_type
*
allocator
;
51
time_t
years
;
52
time_t
months
;
53
time_t
weeks
;
54
time_t
days
;
55
time_t
hours
;
56
time_t
minutes
;
57
time_t
seconds
;
58
};
59
65
duration_type
*
duration_create
(
void
);
66
74
int
duration_compare
(
duration_type
* d1,
duration_type
* d2);
75
82
duration_type
*
duration_create_from_string
(
const
char
* str);
83
90
char
*
duration2string
(
duration_type
* duration);
91
98
time_t
duration2time
(
duration_type
* duration);
99
106
time_t
ods_rand
(time_t mod);
107
115
time_t
time_minimum
(time_t a, time_t b);
116
124
time_t
time_maximum
(time_t a, time_t b);
125
132
void
time_itoa
(time_t n,
char
* s);
133
142
uint32_t
time_datestamp
(time_t tt,
const
char
* format,
char
** str);
143
150
time_t
time_now
(
void
);
151
157
void
duration_cleanup
(
duration_type
* duration);
158
159
#endif
/* UTIL_DURATION_H */
Generated on Mon Oct 15 2012 22:17:12 for OpenDNSSEC-signer by
1.8.1.2