time.c revision 4bed2e84a34b37259b85e5c092d51c122ef58c3c
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <isc/assertions.h>
#include <isc/unexpect.h>
/***
*** Intervals
***/
void
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().
*/
i->nanoseconds = nanoseconds;
}
/*
* Returns ISC_TRUE iff. 'i' is the zero interval.
*/
if (i->seconds == 0 && i->nanoseconds == 0)
return (ISC_TRUE);
return (ISC_FALSE);
}
/***
*** Absolute Times
***/
void
/*
* Set 't' to the time of the epoch.
*/
t->seconds = 0;
t->nanoseconds = 0;
}
/*
* Returns ISC_TRUE iff. 't' is the epoch ("time zero").
*/
if (t->seconds == 0 && t->nanoseconds == 0)
return (ISC_TRUE);
return (ISC_FALSE);
}
isc_time_get(isc_time_t t) {
/*
* Set *t to the current absolute time.
*/
return (ISC_R_UNEXPECTED);
}
return (ISC_R_SUCCESS);
}
int
/*
* Compare the times referenced by 't1' and 't2'
*/
return (-1);
return (1);
return (-1);
return (1);
return (0);
}
void
{
/*
* Add 't' to 'i', storing the result in 'result'.
*/
}
}
void
/*
* Subtract 'i' from 't', storing the result in 'result'.
*/
if (t->nanoseconds >= i->nanoseconds)
else {
t->nanoseconds;
}
}
/***
*** UNIX-only
***/
void
/*
* Set 't' to the time given by 'ts'.
*/
}
void
/*
* Convert 't' to a UNIX timeval.
*/
}
void
/*
* Set 't' to the time given by 'ts'.
*/
}
void
/*
* Convert 't' to a UNIX timespec.
*/
}