mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 14:07:59 +00:00
Prototype for new function isc_time_subtract.
Comment cleanups (ie, many "'t' are a valid." comments made grammatically correct). win32's file.h added missing ISC_LANG_ENDDECLS.
This commit is contained in:
parent
8b7304a34c
commit
2cc9a6a0f7
@ -53,9 +53,8 @@ isc_interval_set(isc_interval_t *i,
|
|||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't' is a valid.
|
* 't' is a valid pointer.
|
||||||
*
|
* nanoseconds < 1000000000.
|
||||||
* nanoseconds < 1000000000
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_boolean_t
|
isc_boolean_t
|
||||||
@ -65,7 +64,7 @@ isc_interval_iszero(isc_interval_t *i);
|
|||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't' is a valid.
|
* 't' is a valid pointer.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -87,6 +86,23 @@ typedef struct isc_time {
|
|||||||
|
|
||||||
extern isc_time_t *isc_time_epoch;
|
extern isc_time_t *isc_time_epoch;
|
||||||
|
|
||||||
|
void
|
||||||
|
isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds);
|
||||||
|
/*
|
||||||
|
* Set 't' to a particular number of seconds + nanoseconds since the epoch.
|
||||||
|
*
|
||||||
|
* Notes:
|
||||||
|
* This call is equivalent to:
|
||||||
|
*
|
||||||
|
* isc_time_settoepoch(t);
|
||||||
|
* isc_interval_set(i, seconds, nanoseconds);
|
||||||
|
* isc_time_add(t, i, t);
|
||||||
|
*
|
||||||
|
* Requires:
|
||||||
|
* 't' is a valid pointer.
|
||||||
|
* nanoseconds < 1000000000.
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
isc_time_settoepoch(isc_time_t *t);
|
isc_time_settoepoch(isc_time_t *t);
|
||||||
/*
|
/*
|
||||||
@ -97,7 +113,7 @@ isc_time_settoepoch(isc_time_t *t);
|
|||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't' is a valid.
|
* 't' is a valid pointer.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -108,7 +124,7 @@ isc_time_isepoch(isc_time_t *t);
|
|||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't' is a valid.
|
* 't' is a valid pointer.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -133,6 +149,7 @@ isc_time_nowplusinterval(isc_time_t *t, isc_interval_t *i);
|
|||||||
* Set *t to the current absolute time + i.
|
* Set *t to the current absolute time + i.
|
||||||
*
|
*
|
||||||
* Note:
|
* Note:
|
||||||
|
* Overflow is not checked.
|
||||||
*
|
*
|
||||||
* This call is equivalent to:
|
* This call is equivalent to:
|
||||||
*
|
*
|
||||||
@ -141,7 +158,7 @@ isc_time_nowplusinterval(isc_time_t *t, isc_interval_t *i);
|
|||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't' and 'i' are valid.
|
* 't' and 'i' are valid pointers.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
*
|
*
|
||||||
@ -156,7 +173,7 @@ isc_time_compare(isc_time_t *t1, isc_time_t *t2);
|
|||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't1' and 't2' are a valid.
|
* 't1' and 't2' are valid pointers.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
*
|
*
|
||||||
@ -170,9 +187,12 @@ isc_time_add(isc_time_t *t, isc_interval_t *i, isc_time_t *result);
|
|||||||
/*
|
/*
|
||||||
* Add 'i' to 't', storing the result in 'result'.
|
* Add 'i' to 't', storing the result in 'result'.
|
||||||
*
|
*
|
||||||
|
* Notes:
|
||||||
|
* Overflow is not checked.
|
||||||
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't', 'i', and 'result' are valid.
|
* 't', 'i', and 'result' are valid pointers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -182,7 +202,7 @@ isc_time_subtract(isc_time_t *t, isc_interval_t *i, isc_time_t *result);
|
|||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't', 'i', and 'result' are valid.
|
* 't', 'i', and 'result' are valid pointers.
|
||||||
*
|
*
|
||||||
* t >= epoch + i (comparing times, not pointers)
|
* t >= epoch + i (comparing times, not pointers)
|
||||||
*/
|
*/
|
||||||
@ -194,7 +214,7 @@ isc_time_microdiff(isc_time_t *t1, isc_time_t *t2);
|
|||||||
* t2 is the subtrahend of t1; ie, difference = t1 - t2.
|
* t2 is the subtrahend of t1; ie, difference = t1 - t2.
|
||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
* No formal requirements are asserted.
|
* 't1' and 't2' are valid pointers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_uint32_t
|
isc_uint32_t
|
||||||
@ -203,7 +223,7 @@ isc_time_seconds(isc_time_t *t);
|
|||||||
* Return the number of seconds since the epoch stored in a time structure.
|
* Return the number of seconds since the epoch stored in a time structure.
|
||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
* No formal requirements are asserted.
|
* 't' is a valid pointer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_uint32_t
|
isc_uint32_t
|
||||||
@ -217,7 +237,7 @@ isc_time_nanoseconds(isc_time_t *t);
|
|||||||
* full second.
|
* full second.
|
||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
* No formal requirements are asserted.
|
* 't' is a valid pointer.
|
||||||
*
|
*
|
||||||
* Ensures:
|
* Ensures:
|
||||||
* The returned value is less than 1*10^9.
|
* The returned value is less than 1*10^9.
|
||||||
|
@ -53,9 +53,8 @@ isc_interval_set(isc_interval_t *i,
|
|||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't' is a valid.
|
* 't' is a valid pointer.
|
||||||
*
|
* nanoseconds < 1000000000.
|
||||||
* nanoseconds < 1000000000
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_boolean_t
|
isc_boolean_t
|
||||||
@ -65,7 +64,7 @@ isc_interval_iszero(isc_interval_t *i);
|
|||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't' is a valid.
|
* 't' is a valid pointer.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -86,14 +85,34 @@ typedef struct isc_time {
|
|||||||
|
|
||||||
extern isc_time_t *isc_time_epoch;
|
extern isc_time_t *isc_time_epoch;
|
||||||
|
|
||||||
|
void
|
||||||
|
isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds);
|
||||||
|
/*
|
||||||
|
* Set 't' to a particular number of seconds + nanoseconds since the epoch.
|
||||||
|
*
|
||||||
|
* Notes:
|
||||||
|
* This call is equivalent to:
|
||||||
|
*
|
||||||
|
* isc_time_settoepoch(t);
|
||||||
|
* isc_interval_set(i, seconds, nanoseconds);
|
||||||
|
* isc_time_add(t, i, t);
|
||||||
|
*
|
||||||
|
* Requires:
|
||||||
|
* 't' is a valid pointer.
|
||||||
|
* nanoseconds < 1000000000.
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
isc_time_settoepoch(isc_time_t *t);
|
isc_time_settoepoch(isc_time_t *t);
|
||||||
/*
|
/*
|
||||||
* Set 't' to the time of the epoch.
|
* Set 't' to the time of the epoch.
|
||||||
*
|
*
|
||||||
|
* Notes:
|
||||||
|
* The date of the epoch is platform-dependent.
|
||||||
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't' is a valid.
|
* 't' is a valid pointer.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -104,7 +123,7 @@ isc_time_isepoch(isc_time_t *t);
|
|||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't' is a valid.
|
* 't' is a valid pointer.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -129,6 +148,7 @@ isc_time_nowplusinterval(isc_time_t *t, isc_interval_t *i);
|
|||||||
* Set *t to the current absolute time + i.
|
* Set *t to the current absolute time + i.
|
||||||
*
|
*
|
||||||
* Note:
|
* Note:
|
||||||
|
* Overflow is not checked.
|
||||||
*
|
*
|
||||||
* This call is equivalent to:
|
* This call is equivalent to:
|
||||||
*
|
*
|
||||||
@ -137,7 +157,7 @@ isc_time_nowplusinterval(isc_time_t *t, isc_interval_t *i);
|
|||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't' and 'i' are valid.
|
* 't' and 'i' are valid pointers.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
*
|
*
|
||||||
@ -152,7 +172,7 @@ isc_time_compare(isc_time_t *t1, isc_time_t *t2);
|
|||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't1' and 't2' are a valid.
|
* 't1' and 't2' are valid pointers.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
*
|
*
|
||||||
@ -166,9 +186,12 @@ isc_time_add(isc_time_t *t, isc_interval_t *i, isc_time_t *result);
|
|||||||
/*
|
/*
|
||||||
* Add 'i' to 't', storing the result in 'result'.
|
* Add 'i' to 't', storing the result in 'result'.
|
||||||
*
|
*
|
||||||
|
* Notes:
|
||||||
|
* Overflow is not checked.
|
||||||
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't', 'i', and 'result' are valid.
|
* 't', 'i', and 'result' are valid pointers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -178,7 +201,7 @@ isc_time_subtract(isc_time_t *t, isc_interval_t *i, isc_time_t *result);
|
|||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
* 't', 'i', and 'result' are valid.
|
* 't', 'i', and 'result' are valid pointers.
|
||||||
*
|
*
|
||||||
* t >= epoch + i (comparing times, not pointers)
|
* t >= epoch + i (comparing times, not pointers)
|
||||||
*/
|
*/
|
||||||
@ -190,7 +213,7 @@ isc_time_microdiff(isc_time_t *t1, isc_time_t *t2);
|
|||||||
* t2 is the subtrahend of t1; ie, difference = t1 - t2.
|
* t2 is the subtrahend of t1; ie, difference = t1 - t2.
|
||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
* No formal requirements are asserted.
|
* 't1' and 't2' are valid pointers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_uint32_t
|
isc_uint32_t
|
||||||
@ -199,7 +222,7 @@ isc_time_seconds(isc_time_t *t);
|
|||||||
* Return the number of seconds since the epoch stored in a time structure.
|
* Return the number of seconds since the epoch stored in a time structure.
|
||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
* No formal requirements are asserted.
|
* 't' is a valid pointer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_uint32_t
|
isc_uint32_t
|
||||||
@ -213,10 +236,12 @@ isc_time_nanoseconds(isc_time_t *t);
|
|||||||
* full second.
|
* full second.
|
||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
* No formal requirements are asserted.
|
* 't' is a valid pointer.
|
||||||
*
|
*
|
||||||
* Ensures:
|
* Ensures:
|
||||||
* The returned value is less than 1*10^9.
|
* The returned value is less than 1*10^9.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
ISC_LANG_ENDDECLS
|
||||||
|
|
||||||
#endif /* ISC_TIME_H */
|
#endif /* ISC_TIME_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user