#define TIME_FIXUP_CONSTANT_INT 11644473600LL
#endif
-
-/**
- parse a nttime as a large integer in a string and return a NTTIME
-*/
-NTTIME nttime_from_string(const char *s)
-{
- return strtoull(s, NULL, 0);
-}
-
/**************************************************************
Handle conversions between time_t and uint32, taking care to
preserve the "special" values.
void round_timespec(enum timestamp_set_resolution res, struct timespec *ts)
{
+ if (is_omit_timespec(ts)) {
+ return;
+ }
+
switch (res) {
case TIMESTAMP_SET_SECONDS:
round_timespec_to_sec(ts);
{
NTTIME nt;
round_timespec(res, &ts);
- unix_timespec_to_nt_time(&nt, ts);
- SIVAL(p, 0, nt & 0xFFFFFFFF);
- SIVAL(p, 4, nt >> 32);
+ nt = unix_timespec_to_nt_time(ts);
+ SBVAL(p, 0, nt);
+}
+
+void put_long_date_full_timespec(enum timestamp_set_resolution res,
+ char *p,
+ const struct timespec *_ts)
+{
+ struct timespec ts = *_ts;
+ NTTIME nt;
+
+ round_timespec(res, &ts);
+ nt = full_timespec_to_nt_time(&ts);
+ SBVAL(p, 0, nt);
}
void put_long_date(char *p, time_t t)
struct timespec interpret_long_date(const char *p)
{
NTTIME nt;
- nt = IVAL(p,0) + ((uint64_t)IVAL(p,4) << 32);
+ nt = BVAL(p, 0);
if (nt == (uint64_t)-1) {
struct timespec ret;
ret.tv_sec = (time_t)-1;
ret.tv_nsec = 0;
return ret;
}
- return nt_time_to_unix_timespec(&nt);
+ return nt_time_to_unix_timespec(nt);
}
/*******************************************************************
return (time_t)d;
}
-time_t uint64s_nt_time_to_unix_abs(const uint64_t *src)
-{
- NTTIME nttime;
- nttime = *src;
- return nt_time_to_unix_abs(&nttime);
-}
-
/****************************************************************************
Convert a time_t to a NTTIME structure