1290001Sglebius/*
2290001Sglebius * Copyright (C) 2004, 2005, 2007, 2011, 2012  Internet Systems Consortium, Inc. ("ISC")
3290001Sglebius * Copyright (C) 1999-2001  Internet Software Consortium.
4290001Sglebius *
5290001Sglebius * Permission to use, copy, modify, and/or distribute this software for any
6290001Sglebius * purpose with or without fee is hereby granted, provided that the above
7290001Sglebius * copyright notice and this permission notice appear in all copies.
8290001Sglebius *
9290001Sglebius * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10290001Sglebius * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11290001Sglebius * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12290001Sglebius * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13290001Sglebius * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14290001Sglebius * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15290001Sglebius * PERFORMANCE OF THIS SOFTWARE.
16290001Sglebius */
17290001Sglebius
18290001Sglebius/* $Id$ */
19290001Sglebius
20290001Sglebius#ifndef ISC_STDTIME_H
21290001Sglebius#define ISC_STDTIME_H 1
22290001Sglebius
23290001Sglebius/*! \file */
24290001Sglebius
25290001Sglebius#include <isc/lang.h>
26290001Sglebius#include <isc/int.h>
27290001Sglebius
28290001Sglebius/*%
29290001Sglebius * It's public information that 'isc_stdtime_t' is an unsigned integral type.
30290001Sglebius * Applications that want maximum portability should not assume anything
31290001Sglebius * about its size.
32290001Sglebius */
33290001Sglebiustypedef isc_uint32_t isc_stdtime_t;
34290001Sglebius
35290001Sglebius/* but this flag helps... */
36290001Sglebius#define STDTIME_ON_32BITS	1
37290001Sglebius
38290001Sglebius/*
39290001Sglebius * isc_stdtime32_t is a 32-bit version of isc_stdtime_t.  A variable of this
40290001Sglebius * type should only be used as an opaque integer (e.g.,) to compare two
41290001Sglebius * time values.
42290001Sglebius */
43290001Sglebiustypedef isc_uint32_t isc_stdtime32_t;
44290001Sglebius
45290001SglebiusISC_LANG_BEGINDECLS
46290001Sglebius/* */
47290001Sglebiusvoid
48290001Sglebiusisc_stdtime_get(isc_stdtime_t *t);
49290001Sglebius/*%<
50290001Sglebius * Set 't' to the number of seconds since 00:00:00 UTC, January 1, 1970.
51290001Sglebius *
52290001Sglebius * Requires:
53290001Sglebius *
54290001Sglebius *\li	't' is a valid pointer.
55290001Sglebius */
56290001Sglebius
57290001Sglebius#define isc_stdtime_convert32(t, t32p) (*(t32p) = t)
58290001Sglebius/*
59290001Sglebius * Convert the standard time to its 32-bit version.
60290001Sglebius */
61290001Sglebius
62290001SglebiusISC_LANG_ENDDECLS
63290001Sglebius
64290001Sglebius#endif /* ISC_STDTIME_H */
65