diff options
Diffstat (limited to 'contrib/xntpd/parse/parse.c')
-rw-r--r-- | contrib/xntpd/parse/parse.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/contrib/xntpd/parse/parse.c b/contrib/xntpd/parse/parse.c index ed5fd9a8fad7..84bfa39d1293 100644 --- a/contrib/xntpd/parse/parse.c +++ b/contrib/xntpd/parse/parse.c @@ -1,8 +1,8 @@ #if defined(REFCLOCK) && (defined(PARSE) || defined(PARSEPPS)) /* - * /src/NTP/REPOSITORY/v3/parse/parse.c,v 3.19 1994/01/25 19:05:20 kardel Exp + * /src/NTP/REPOSITORY/v3/parse/parse.c,v 3.23 1994/03/25 13:09:02 kardel Exp * - * parse.c,v 3.19 1994/01/25 19:05:20 kardel Exp + * parse.c,v 3.23 1994/03/25 13:09:02 kardel Exp * * Parser module for reference clock * @@ -29,6 +29,10 @@ static char rcsid[] = "parse.c,v 3.19 1994/01/25 19:05:20 kardel Exp"; #include "sys/time.h" #include "sys/errno.h" +#include "ntp_fp.h" +#include "ntp_unixtime.h" +#include "ntp_calendar.h" + #include "ntp_machine.h" #if defined(PARSESTREAM) && (defined(SYS_SUNOS4) || defined(SYS_SOLARIS)) && defined(STREAM) @@ -49,10 +53,6 @@ static char rcsid[] = "parse.c,v 3.19 1994/01/25 19:05:20 kardel Exp"; #endif #endif -#include "ntp_fp.h" -#include "ntp_unixtime.h" -#include "ntp_calendar.h" - #include "parse.h" #include "ntp_stdlib.h" @@ -178,6 +178,10 @@ setup_bitmaps(parseio, low, high) { fmt = clockformats[i]; + if (!(parseio->parse_flags & PARSE_FIXED_FMT) && + (fmt->flags & CVT_FIXEDONLY)) + continue; + if (fmt->flags & F_START) { index = fmt->startsym / 8; @@ -556,6 +560,9 @@ parse_to_unixtime(clock, cvtrtc) register int i; time_t t; + if (clock->utctime) + return clock->utctime; /* if the conversion routine gets it right away - why not */ + if (clock->year < 100) clock->year += 1900; @@ -628,6 +635,9 @@ parse_to_unixtime(clock, cvtrtc) t += clock->utcoffset; /* warp to UTC */ /* done */ + + clock->utctime = t; /* documentray only */ + return t; } @@ -890,6 +900,8 @@ timepacket(parseio) if (parseio->parse_flags & PARSE_FIXED_FMT) { + clock.utctime = 0; + switch ((cvtrtc = clockformats[format]->convert ? clockformats[format]->convert(parseio->parse_data, parseio->parse_index, clockformats[format]->data, &clock) : CVT_NONE) & CVT_MASK) { case CVT_FAIL: @@ -941,6 +953,8 @@ timepacket(parseio) { do { + clock.utctime = 0; + switch ((cvtrtc = (clockformats[format]->convert && !(clockformats[format]->flags & CVT_FIXEDONLY)) ? clockformats[format]->convert(parseio->parse_data, parseio->parse_index, clockformats[format]->data, &clock) : CVT_NONE) & CVT_MASK) @@ -1148,6 +1162,15 @@ parse_setcs(dct, parse) * History: * * parse.c,v + * Revision 3.23 1994/03/25 13:09:02 kardel + * considering FIXEDONLY entries only in FIXEDONLY mode + * + * Revision 3.22 1994/02/25 12:34:49 kardel + * allow for converter generated utc times + * + * Revision 3.21 1994/02/02 17:45:30 kardel + * rcs ids fixed + * * Revision 3.19 1994/01/25 19:05:20 kardel * 94/01/23 reconcilation * |