Normal
�
355Ä¿Æ c
404 Not Found
Not Found
The requested URL was not found on this server.
Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.
$ ˆl–Ãa¾”ji?u@?pÜŠbÑ¿Ê
„B?ÉÀÇ +b /*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
#ifndef ISC_TIME_H
#define ISC_TIME_H 1
/*! \file */
#include
#include
#include
#include
/***
*** Intervals
***/
/*!
* \brief
* The contents of this structure are private, and MUST NOT be accessed
* directly by callers.
*
* The contents are exposed only to allow callers to avoid dynamic allocation.
*/
struct isc_interval {
unsigned int seconds;
unsigned int nanoseconds;
};
extern const isc_interval_t *const isc_interval_zero;
/*
* ISC_FORMATHTTPTIMESTAMP_SIZE needs to be 30 in C locale and potentially
* more for other locales to handle longer national abbreviations when
* expanding strftime's %a and %b.
*/
#define ISC_FORMATHTTPTIMESTAMP_SIZE 50
ISC_LANG_BEGINDECLS
void
isc_interval_set(isc_interval_t *i, unsigned int seconds,
unsigned int nanoseconds);
/*%<
* Set 'i' to a value representing an interval of 'seconds' seconds and
* 'nanoseconds' nanoseconds, suitable for use in isc_time_add() and
* isc_time_subtract().
*
* Requires:
*
*\li 't' is a valid pointer.
*\li nanoseconds < 1000000000.
*/
bool
isc_interval_iszero(const isc_interval_t *i);
/*%<
* Returns true iff. 'i' is the zero interval.
*
* Requires:
*
*\li 'i' is a valid pointer.
*/
/***
*** Absolute Times
***/
/*%
* The contents of this structure are private, and MUST NOT be accessed
* directly by callers.
*
* The contents are exposed only to allow callers to avoid dynamic allocation.
*/
struct isc_time {
unsigned int seconds;
unsigned int nanoseconds;
};
extern const isc_time_t *const isc_time_epoch;
void
isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds);
/*%<
* Set 't' to a value which represents the given number of seconds and
* nanoseconds since 00:00:00 January 1, 1970, UTC.
*
* Notes:
*\li The Unix version of this call is equivalent to:
*\code
* isc_time_settoepoch(t);
* isc_interval_set(i, seconds, nanoseconds);
* isc_time_add(t, i, t);
*\endcode
*
* Requires:
*\li 't' is a valid pointer.
*\li nanoseconds < 1000000000.
*/
void
isc_time_settoepoch(isc_time_t *t);
/*%<
* Set 't' to the time of the epoch.
*
* Notes:
*\li The date of the epoch is platform-dependent.
*
* Requires:
*
*\li 't' is a valid pointer.
*/
bool
isc_time_isepoch(const isc_time_t *t);
/*%<
* Returns true iff. 't' is the epoch ("time zero").
*
* Requires:
*
*\li 't' is a valid pointer.
*/
isc_result_t
isc_time_now(isc_time_t *t);
/*%<
* Set 't' to the current absolute time.
*
* Requires:
*
*\li 't' is a valid pointer.
*
* Returns:
*
*\li Success
*\li Unexpected error
* Getting the time from the system failed.
*\li Out of range
* The time from the system is too large to be represented
* in the current definition of isc_time_t.
*/
isc_result_t
isc_time_now_hires(isc_time_t *t);
/*%<
* Set 't' to the current absolute time. Uses higher resolution clocks
* recommended when microsecond accuracy is required.
*
* Requires:
*
*\li 't' is a valid pointer.
*
* Returns:
*
*\li Success
*\li Unexpected error
* Getting the time from the system failed.
*\li Out of range
* The time from the system is too large to be represented
* in the current definition of isc_time_t.
*/
isc_result