xref: /openbsd-src/usr.bin/dig/lib/dns/include/dns/time.h (revision 3ec2dc6fdfab2e5e81826a09f0e137ab70cc0bdc)
1 /*
2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14  * PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 /* $Id: time.h,v 1.4 2020/04/02 16:57:45 florian Exp $ */
18 
19 #ifndef DNS_TIME_H
20 #define DNS_TIME_H 1
21 
22 /*! \file dns/time.h */
23 
24 /***
25  ***	Imports
26  ***/
27 
28 #include <isc/buffer.h>
29 
30 /***
31  ***	Functions
32  ***/
33 
34 isc_result_t
35 dns_time32_totext(uint32_t value, isc_buffer_t *target);
36 /*%<
37  * Convert 32-bit cyclic time value into a YYYYMMDDHHMMSS text representation
38  * and append it to 'target'.
39  * Of those dates whose counts of seconds since Jan 1 1970 0:00 GMT
40  * are congruent with 'value' modulo 2^32, the one closest to the
41  * current date is chosen.
42  */
43 
44 #endif /* DNS_TIME_H */
45