Main Page
Related Pages
Data Structures
Files
File List
Globals
ldns
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
40
#ifndef LDNS_DURATION_H
41
#define LDNS_DURATION_H
42
43
#include <stdint.h>
44
#include <time.h>
45
50
typedef
struct
ldns_duration_struct
ldns_duration_type
;
51
struct
ldns_duration_struct
52
{
53
time_t
years
;
54
time_t
months
;
55
time_t
weeks
;
56
time_t
days
;
57
time_t
hours
;
58
time_t
minutes
;
59
time_t
seconds
;
60
};
61
67
ldns_duration_type
*
ldns_duration_create
(
void
);
68
76
int
ldns_duration_compare
(
ldns_duration_type
* d1,
ldns_duration_type
* d2);
77
84
ldns_duration_type
*
ldns_duration_create_from_string
(
const
char
* str);
85
92
char
*
ldns_duration2string
(
ldns_duration_type
* duration);
93
100
time_t
ldns_duration2time
(
ldns_duration_type
* duration);
101
107
void
ldns_duration_cleanup
(
ldns_duration_type
* duration);
108
109
#endif
/* LDNS_DURATION_H */
Generated on Thu Jan 10 2013 15:51:24 for ldns by
1.8.1.1