time.h revision 15a44745412679c30a6d022733925af70a38b715
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * Copyright (C) 1998-2000 Internet Software Consortium.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * Permission to use, copy, modify, and distribute this software for any
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User * purpose with or without fee is hereby granted, provided that the above
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User * copyright notice and this permission notice appear in all copies.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/* $Id: time.h,v 1.23 2000/07/27 09:53:08 tale Exp $ */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews *** Intervals
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * The contents of this structure are private, and MUST NOT be accessed
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * directly by callers.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * The contents are exposed only to allow callers to avoid dynamic allocation.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User unsigned int seconds, unsigned int nanoseconds);
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt * Set 'i' to a value representing an interval of 'seconds' seconds and
d856585f5fe37cc2ea82115c10339578d2b517b1Automatic Updater * 'nanoseconds' nanoseconds, suitable for use in isc_time_add() and
d856585f5fe37cc2ea82115c10339578d2b517b1Automatic Updater * isc_time_subtract().
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt * 't' is a valid pointer.
d856585f5fe37cc2ea82115c10339578d2b517b1Automatic Updater * nanoseconds < 1000000000.
d856585f5fe37cc2ea82115c10339578d2b517b1Automatic Updater * Returns ISC_TRUE iff. 'i' is the zero interval.
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User * 'i' is a valid pointer.
f7b41fd9291b8f4dba27e2b57e1d93f0913a4f1dMark Andrews *** Absolute Times
ea640e04eae220b5e569f188563eb1f204c7c77eTinderbox User * The contents of this structure are private, and MUST NOT be accessed
ea640e04eae220b5e569f188563eb1f204c7c77eTinderbox User * directly by callers.
ea640e04eae220b5e569f188563eb1f204c7c77eTinderbox User * The contents are exposed only to allow callers to avoid dynamic allocation.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds);
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt * Set 't' to a particular number of seconds + nanoseconds since the epoch.
990d0e893f5b70e735cdf990af66e9ec6e91fa78Tinderbox User * This call is equivalent to:
990d0e893f5b70e735cdf990af66e9ec6e91fa78Tinderbox User * isc_time_settoepoch(t);
990d0e893f5b70e735cdf990af66e9ec6e91fa78Tinderbox User * isc_interval_set(i, seconds, nanoseconds);
990d0e893f5b70e735cdf990af66e9ec6e91fa78Tinderbox User * isc_time_add(t, i, t);
990d0e893f5b70e735cdf990af66e9ec6e91fa78Tinderbox User * 't' is a valid pointer.
990d0e893f5b70e735cdf990af66e9ec6e91fa78Tinderbox User * nanoseconds < 1000000000.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User * Set 't' to the time of the epoch.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * The date of the epoch is platform-dependent.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User * 't' is a valid pointer.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * Returns ISC_TRUE iff. 't' is the epoch ("time zero").
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User * 't' is a valid pointer.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * Set 't' to the current absolute time.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * 't' is a valid pointer.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * Unexpected error
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * Getting the time from the system failed.
4abdfc917e6635a7c81d1f931a0c79227e72d025Mark Andrews * Out of range
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt * The time from the system is too large to be represented
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * in the current definition of isc_time_t.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsisc_time_nowplusinterval(isc_time_t *t, isc_interval_t *i);
1ca759b3f5c0672b2a66bc02288fe010cabbfe37Tinderbox User * Set *t to the current absolute time + i.