1258945Sroberto/* 2280849Scy * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") 3258945Sroberto * Copyright (C) 1999-2001 Internet Software Consortium. 4258945Sroberto * 5258945Sroberto * Permission to use, copy, modify, and/or distribute this software for any 6258945Sroberto * purpose with or without fee is hereby granted, provided that the above 7258945Sroberto * copyright notice and this permission notice appear in all copies. 8258945Sroberto * 9258945Sroberto * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10258945Sroberto * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 11258945Sroberto * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 12258945Sroberto * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13258945Sroberto * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 14258945Sroberto * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15258945Sroberto * PERFORMANCE OF THIS SOFTWARE. 16258945Sroberto */ 17258945Sroberto 18280849Scy/* $Id$ */ 19258945Sroberto 20258945Sroberto#ifndef ISC_STDTIME_H 21258945Sroberto#define ISC_STDTIME_H 1 22258945Sroberto 23258945Sroberto#include <isc/lang.h> 24258945Sroberto#include <isc/int.h> 25258945Sroberto 26258945Sroberto/* 27258945Sroberto * It's public information that 'isc_stdtime_t' is an unsigned integral type. 28258945Sroberto * Applications that want maximum portability should not assume anything 29258945Sroberto * about its size. 30258945Sroberto */ 31258945Srobertotypedef isc_uint32_t isc_stdtime_t; 32280849Scy 33280849Scy/* but this flag helps... */ 34280849Scy#define STDTIME_ON_32BITS 1 35280849Scy 36258945Sroberto/* 37258945Sroberto * isc_stdtime32_t is a 32-bit version of isc_stdtime_t. A variable of this 38258945Sroberto * type should only be used as an opaque integer (e.g.,) to compare two 39258945Sroberto * time values. 40258945Sroberto */ 41258945Srobertotypedef isc_uint32_t isc_stdtime32_t; 42258945Sroberto 43258945SrobertoISC_LANG_BEGINDECLS 44258945Sroberto 45258945Srobertovoid 46258945Srobertoisc_stdtime_get(isc_stdtime_t *t); 47258945Sroberto/* 48258945Sroberto * Set 't' to the number of seconds since 00:00:00 UTC, January 1, 1970. 49258945Sroberto * 50258945Sroberto * Requires: 51258945Sroberto * 52258945Sroberto * 't' is a valid pointer. 53258945Sroberto */ 54258945Sroberto 55258945Sroberto#define isc_stdtime_convert32(t, t32p) (*(t32p) = t) 56258945Sroberto/* 57258945Sroberto * Convert the standard time to its 32-bit version. 58258945Sroberto */ 59258945Sroberto 60258945SrobertoISC_LANG_ENDDECLS 61258945Sroberto 62258945Sroberto#endif /* ISC_STDTIME_H */ 63