/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1992 by Xerox Corporation. All rights reserved. */
/* time: February 21, 1992 9:45:14 pm PST */
/* C2C version: October 16, 1990 (native) */
/* ref-counting: off */
/* file: HostTimeUnixImpl, module: HostTimeUnixImpl */
/* switches: bcfhklnouw */
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
static char versionStamp[] = "@(#)mob←version [2194834731,3409745707] HostTimeUnixImpl";
typedef unsigned word, *ptr;
typedef unsigned char byte, *bPt;
typedef unsigned short half, *hPt;
typedef struct {word f0, f1;} W2;
typedef struct {word f0, f1, f2, f3;} W4;
typedef W4 *W4Pt;
typedef W2 *W2Pt;
typedef word (*fPt)();
typedef struct {word f0, f1, f2;} W3;
typedef W3 *W3Pt;
#define SOURCE(p, l) /* source p, l */
#define BCK(idx, lim) ( ((unsigned) idx) >= ((unsigned) lim) ? (XR←RaiseBoundsFault()) : (idx) )
static float fc7 = 1.0e-6;
#define SGNCK(i) ((int) (word) (i) < 0 ? XR←RaiseArithmeticFault(): i )
static float fc12 = 1000000.0;
static void NoName←Q540();
static void HostTimeUnixImpl←P0();
static void HostTimeFromExtendedGMT←P60();
static void ExtendedGMTFromHostTime←P120();
static void GetTime←P180();
static word TimeToMicroseconds←P240();
static void MicrosecondsToTime←P300();
static word TimeToSeconds←P360();
static void SecondsToTime←P420();
static void GetZoneAndDST←P480();
static struct {unsigned f; char r[16];} string1 = {851984, "\257\300\202\322\205\053\300\313\074\227\053\100\164\000\000"};
static struct {unsigned f; char r[16];} string2 = {851984, "\257\300\246\205\220\035\300\344\000\142\023\100\150\000\000"};
static struct {unsigned f; char r[16];} string3 = {851984, "\257\300\211\056\077\074\300\127\047\310\242\100\150\000\000"};
static struct {unsigned f; char r[16];} string4 = {851984, "\257\300\273\264\166\314\300\142\321\237\137\100\150\000\000"};
static struct {
word f0[4]; word f4; word f5; word f6;
word f7; word f8; word f9; word f10;
word f11; word f12; word f13; word f14;
word f15; word f16; word f17; word f18;
word f19; word f20; word f21[4];
} globalframe = {
{0}, (word) GetZoneAndDST←P480, 0, (word) SecondsToTime←P420,
0, (word) TimeToSeconds←P360, 0, (word) MicrosecondsToTime←P300,
0, (word) TimeToMicroseconds←P240, 0, (word) GetTime←P180,
0, (word) ExtendedGMTFromHostTime←P120, 0, (word) HostTimeFromExtendedGMT←P60,
0, (word) HostTimeUnixImpl←P0, {0}
};
static void NoName←Q540()
{
register ptr gf←c043 = (ptr) &globalframe;
word var←c5916;
(void) XR←DeclareGlobalFrame((word) "HostTimeUnixImpl", &globalframe, (word) XR←GetTypeIndexS((word) (&string1)), (word) (
( (bPt) gf←c043)+80)/* var←c5596 */ );
var←c5916 = (word) XR←ImportInterface((word) "Real", (word) XR←GetTypeIndexS((word) (&string2)), 11);
(* (( (ptr) gf←c043)+23)/* var←c5788 */ ) = var←c5916;
(void) XR←ImportProcS(var←c5916, 67371521);
(void) XR←ImportProcS(var←c5916, 67372033);
var←c5916 = (word) XR←ImportInterface((word) "UnixSysCalls", (word) XR←GetTypeIndexS((word) (&string3)), 77);
(* (( (ptr) gf←c043)+22)/* var←c5660 */ ) = var←c5916;
(void) XR←ImportProcS(var←c5916, 67640066);
var←c5916 = (word) XR←ExportInterface((word) "HostTime", (word) XR←GetTypeIndexS((word) (&string4)), 8);
(* (( (ptr) gf←c043)+24)/* var←c5948 */ ) = var←c5916;
(void) XR←ExportProcS(var←c5916, (word) (( (bPt) gf←c043)+64)/* var←c5532 */ , 135266305);
(void) XR←ExportProcS(var←c5916, (word) (( (bPt) gf←c043)+72)/* var←c5564 */ , 268960001);
(void) XR←ExportProcS(var←c5916, (word) (( (bPt) gf←c043)+56)/* var←c5500 */ , 268435968);
(void) XR←ExportProcS(var←c5916, (word) (( (bPt) gf←c043)+48)/* var←c5468 */ , 68158209);
(void) XR←ExportProcS(var←c5916, (word) (( (bPt) gf←c043)+40)/* var←c5436 */ , 268698625);
(void) XR←ExportProcS(var←c5916, (word) (( (bPt) gf←c043)+32)/* var←c5404 */ , 68158721);
(void) XR←ExportProcS(var←c5916, (word) (( (bPt) gf←c043)+24)/* var←c5372 */ , 268699137);
(void) XR←ExportProcS(var←c5916, (word) (( (bPt) gf←c043)+16)/* var←c5340 */ , 201328384);
}
static void HostTimeUnixImpl←P0(formal←c015, formal←c014)
word formal←c015;
word formal←c014;
{
/* HostTimeUnixImpl: */
}
static void HostTimeFromExtendedGMT←P60(formal←c018, egmt←v2996)
word formal←c018;
W2 egmt←v2996;
{
W4 time←v3040;
/* HostTimeFromExtendedGMT: */
SOURCE(514, 163)
SOURCE(514, 163)
time←v3040.f0 = 0;
time←v3040.f1 = 0;
time←v3040.f2 = 0;
time←v3040.f3 = 0;
SOURCE(611, 45)
time←v3040.f0 = (egmt←v2996.f0 - 63158400);
SOURCE(658, 19)
time←v3040.f1 = egmt←v2996.f1;
/* removed tail goto */
(* (W4Pt) formal←c018 ) = time←v3040;
return;
}
static void ExtendedGMTFromHostTime←P120(formal←c021, time←v3100)
word formal←c021;
W4 time←v3100;
{
W2 egmt←v3144;
/* ExtendedGMTFromHostTime: */
SOURCE(683, 145)
SOURCE(765, 42)
egmt←v3144.f0 = (time←v3100.f0 + 63158400);
SOURCE(809, 19)
{
word idx5;
egmt←v3144.f1 = (
idx5 = (word) time←v3100.f1,
BCK(idx5, 1000000)
);
};
/* removed tail goto */
(* (W2Pt) formal←c021 ) = egmt←v3144;
return;
}
static void GetTime←P180(formal←c025)
word formal←c025;
{
register ptr gf←c5980 = (ptr) &globalframe;
W4 time←v3204;
W2 timeVal←v3708;
/* GetTime: */
SOURCE(834, 208)
SOURCE(834, 208)
time←v3204.f0 = 0;
time←v3204.f1 = 0;
time←v3204.f2 = 0;
time←v3204.f3 = 0;
SOURCE(906, 35)
timeVal←v3708.f0 = 0;
timeVal←v3708.f1 = 0;
SOURCE(943, 54)
{
word var←c5692;
word pd6;
pd6 = (* (( (ptr) (* (( (ptr) gf←c5980)+22)/* var←c5660 */ ))+31) );
var←c5692 = (word) ( *( (fPt) ((* (ptr) pd6 ))))((word) &timeVal←v3708, 0, pd6);
};
SOURCE(999, 20)
time←v3204.f0 = timeVal←v3708.f0;
SOURCE(1021, 21)
time←v3204.f1 = timeVal←v3708.f1;
/* removed tail goto */
(* (W4Pt) formal←c025 ) = time←v3204;
return;
}
static word TimeToMicroseconds←P240(time←v3264)
W4 time←v3264;
{
word var←c3308;
/* TimeToMicroseconds: */
SOURCE(1048, 116)
SOURCE(1112, 52)
return((time←v3264.f1 + (time←v3264.f0 * 1000000)));
}
static void MicrosecondsToTime←P300(formal←c030, usecs←v3368)
word formal←c030;
word usecs←v3368;
{
W4 time←v3412;
/* MicrosecondsToTime: */
SOURCE(1170, 120)
SOURCE(1170, 120)
time←v3412.f0 = 0;
time←v3412.f1 = 0;
time←v3412.f2 = 0;
time←v3412.f3 = 0;
SOURCE(1241, 49)
time←v3412.f0 = (usecs←v3368 / 1000000);
time←v3412.f1 = (usecs←v3368 % 1000000);
time←v3412.f2 = 0;
time←v3412.f3 = 0;
/* removed tail goto */
(* (W4Pt) formal←c030 ) = time←v3412;
return;
}
static word TimeToSeconds←P360(time←v3472)
W4 time←v3472;
{
word var←c3516;
/* TimeToSeconds: */
SOURCE(1296, 90)
SOURCE(1355, 31)
{
word x8;
float tf9;
return((
tf9 = (float)(unsigned)time←v3472.f0 + ((float)(unsigned)time←v3472.f1 * (
x8 = (* (ptr) &fc7 ), *(float*)&x8
)), *(word*)&tf9
));
};
}
static void SecondsToTime←P420(formal←c038, secs←v3576)
word formal←c038;
word secs←v3576;
{
register ptr gf←c6012 = (ptr) &globalframe;
W4 var←c3620;
/* SecondsToTime: */
SOURCE(1392, 137)
SOURCE(1451, 78)
{
W4 var←c5852;
{
W4 var←c5756;
{
word pd10;
word idx11;
pd10 = (* (( (ptr) (* (( (ptr) gf←c6012)+23)/* var←c5788 */ ))+8) );
var←c5756.f0 = (
idx11 = (word) ( *( (fPt) ((* (ptr) pd10 ))))(secs←v3576, pd10),
SGNCK(idx11)
);
};
{
word var←c5820;
{
word x13;
word x14;
word pd15;
pd15 = (* (( (ptr) (* (( (ptr) gf←c6012)+23)/* var←c5788 */ ))+8) );
*(float*)&var←c5820 = (
x13 = (* (ptr) &fc12 ), *(float*)&x13
) * ((
x14 = secs←v3576, *(float*)&x14
) - (float)(int)(word) ( *( (fPt) ((* (ptr) pd15 ))))(secs←v3576, pd15));
};
{
word pd16;
word idx17;
pd16 = (* (( (ptr) (* (( (ptr) gf←c6012)+23)/* var←c5788 */ ))+6) );
var←c5756.f1 = (
idx17 = (word) ( *( (fPt) ((* (ptr) pd16 ))))(var←c5820, pd16),
SGNCK(idx17)
);
};
};
var←c5756.f2 = 0;
var←c5756.f3 = 0;
var←c5852 = var←c5756;
};
var←c3620 = var←c5852;
/* removed tail goto */
};
(* (W4Pt) formal←c038 ) = var←c3620;
return;
}
static void GetZoneAndDST←P480(formal←c042)
word formal←c042;
{
register ptr gf←c6044 = (ptr) &globalframe;
W3 tp←v3680;
W2 unixTimeZone←v3752;
/* GetZoneAndDST: */
SOURCE(1535, 336)
SOURCE(1644, 60)
SOURCE(1645, 59)
{
word var←c5884;
word pd18;
pd18 = (* (( (ptr) (* (( (ptr) gf←c6044)+22)/* var←c5660 */ ))+31) );
var←c5884 = (word) ( *( (fPt) ((* (ptr) pd18 ))))(0, (word) &unixTimeZone←v3752, pd18);
};
SOURCE(1707, 34)
{
word idx19;
tp←v3680.f0 = (
idx19 = (word) (unixTimeZone←v3752.f0 + 720),
BCK(idx19, 1442)
);
};
SOURCE(1743, 128)
if (( (int)unixTimeZone←v3752.f1 != (int)0)) {
SOURCE(1778, 16)
tp←v3680.f1 = 98;
SOURCE(1796, 15)
tp←v3680.f2 = 305;
}
else {
SOURCE(1822, 17)
tp←v3680.f1 = 366;
SOURCE(1858, 13)
tp←v3680.f2 = 1;
};
/* removed tail goto */
(* (W3Pt) formal←c042 ) = tp←v3680;
return;
}
/* file: HostTimeUnixImpl, module: HostTimeUnixImpl, compiled at: February 21, 1992 9:45:14 pm PST */
extern void XR←install←HostTimeUnixImpl() {
NoName←Q540();
}
extern void XR←run←HostTimeUnixImpl() { XR←Start(&globalframe); }