DIRECTORY BasicTime USING [ExtendedGMT, ZoneAndDST]; HostTime: CEDAR DEFINITIONS ~ BEGIN Time: TYPE = RECORD[a, b, c, d: WORD ¬ 0]; ExtendedGMT: TYPE = BasicTime.ExtendedGMT; ZoneAndDST: TYPE = BasicTime.ZoneAndDST; ExtendedGMTFromHostTime: PROC [Time] RETURNS [egmt: ExtendedGMT]; HostTimeFromExtendedGMT: PROC [egmt: ExtendedGMT] RETURNS [Time]; GetTime: PROC [] RETURNS [Time]; TimeToMicroseconds: PROC [Time] RETURNS [CARD]; MicrosecondsToTime: PROC [CARD] RETURNS [Time]; TimeToSeconds: PROC [Time] RETURNS [REAL]; SecondsToTime: PROC [REAL] RETURNS [Time]; GetZoneAndDST: PROC [] RETURNS [ZoneAndDST]; END. ì HostTime.mesa Copyright Ó 1988, 1991 by Xerox Corporation. All rights reserved. Carl Hauser, October 27, 1988 1:53:22 pm PDT A common notion of time representations, allowing BasicTime to be machine independent. For each different hosts we must supply a diffent Impl behind this interface. For example, for Unix there is HostTimeUnixImpl. The idea is that the mapping between 4*32 bit numeric quantities and the abstract notion of seconds is entirely accomplished in the host-specific impl behind this interface. For good measure, the host-specific impl is also responsible for making sense of time zone parameters. Intended to be general enough to accomodate the results of the system gettime call on many systems. Not all words are used on any given system. The meaning of the different words is defined by the impl, e.g. HostTimeUnixImpl. Obtain current time from host. Convert time to microseconds since the host-specific epoch and return the low-order 32 bits. Maybe not too useful? Seconds since the host epoch. Beware: reals have only 24 bits of precision, so the fractional part of the result is not as accurate as calling TimeToMicroseconds. However, the result never overflows. Carl Hauser, October 25, 1988 5:28:20 pm PDT New file ʧ•NewlineDelimiter –(cedarcode) style™code™ Kšœ Ïeœ7™BK™,—K˜K™WKšœ®™®Kšœg™gšÏk ˜ Kšœ žœ˜*K˜—KšÐlnœžœž ˜šœž˜K˜šœžœžœ žœ˜*K™ã—Icode2šœ žœ˜*Lšœ žœ˜(LšÏnœžœžœ˜ALš œžœžœ˜Aš œžœžœ˜ L™—š œžœžœžœ˜/L™\—š œžœžœžœ˜/L™—š  œžœžœžœ˜*LšœÉ™É—Lš  œžœžœžœ˜*Lš  œžœžœ˜,K˜—K˜Kšžœ˜™,Kšœ™—K™K™—…—jý