#include "M3Runtime.h" #define t12 ADDRESS typedef int t8; #line 111 ".ROOT/.boots/corelib/Interfaces/CoreOS.i3" typedef struct { t8 _sc_onstack; t8 _sc_mask; t8 _sc_sp; t8 _sc_pc; t8 _sc_ps; } t13; PRIVATE void t12_PrintProc (); PRIVATE typecell t12_TC; PRIVATE typecell t12_TC_init = {0, 0, 0, 0, 0, (PROC)NIL, 20, 0, NIL, 0, 0, (PROC)NIL, (PROC)NIL, t12_PrintProc, #line 120 "", 467594205, 652907876}; PRIVATE TYPE TC12 = &t12_TC; #define t17 ADDRESS #define TC17 TC_ADDRESS IMPORT TYPE TC_ADDRESS; IMPORT char VS_ADDRESS__30f7308738738b44; #line 63 ".ROOT/.boots/corelib/Interfaces/Ctypes.i3" #define t23 ADDRESS typedef short t45; typedef unsigned char t44; #define t70 void typedef struct { #line 58 char* elts; int size[1]; } t22; #define t21 t22 typedef struct { t44 elts[4096]; } t46; #line 63 #define TC23 TC_Ctypes__String4096 IMPORT TYPE TC_Ctypes__String4096; #line 63 IMPORT char VS_Ctypes__String4096__8d2ce04b3a64ff9f; #line 62 #define t24 ADDRESS typedef short t47; #line 62 typedef struct { t44 elts[1024]; } t48; #define TC24 TC_Ctypes__String1024 IMPORT TYPE TC_Ctypes__String1024; #line 62 IMPORT char VS_Ctypes__String1024__85fe08042cc88853; #line 61 #define t25 ADDRESS typedef unsigned char t39; #line 61 typedef struct { t44 elts[256]; } t49; #define TC25 TC_Ctypes__String256 IMPORT TYPE TC_Ctypes__String256; #line 61 IMPORT char VS_Ctypes__String256__e84eeb8129c76f43; #line 60 #define t26 ADDRESS typedef signed_char t50; #line 60 typedef struct { t44 elts[64]; } t51; #define TC26 TC_Ctypes__String64 IMPORT TYPE TC_Ctypes__String64; #line 60 IMPORT char VS_Ctypes__String64__e232939e2f4ff601; #line 59 #define t27 ADDRESS typedef signed_char t52; #line 59 typedef struct { t44 elts[16]; } t53; #define TC27 TC_Ctypes__String16 IMPORT TYPE TC_Ctypes__String16; #line 59 IMPORT char VS_Ctypes__String16__46fccbf225a113eb; #line 58 #define t28 ADDRESS typedef signed_char t54; #line 58 typedef struct { t44 elts[4]; } t55; #define TC28 TC_Ctypes__String4 IMPORT TYPE TC_Ctypes__String4; #line 58 IMPORT char VS_Ctypes__String4__1ecbc452350ba764; #line 52 #define t29 ADDRESS typedef unsigned short t19; #line 52 #define TC29 TC_Ctypes__UnsignedShortStar IMPORT TYPE TC_Ctypes__UnsignedShortStar; #line 52 IMPORT char VS_Ctypes__UnsignedShortStar__ba7321c22f5477f7; #line 50 #define t30 ADDRESS #define t31 ADDRESS typedef short t20; #line 49 #define TC31 TC_Ctypes__ShortStar IMPORT TYPE TC_Ctypes__ShortStar; #line 49 IMPORT char VS_Ctypes__ShortStar__ceeffab3338d5be6; #define TC30 TC_Ctypes__ShortStarStar IMPORT TYPE TC_Ctypes__ShortStarStar; #line 50 IMPORT char VS_Ctypes__ShortStarStar__1827fd6f22a4a56a; #line 46 #define t32 ADDRESS #define TC32 TC_Ctypes__IntStar IMPORT TYPE TC_Ctypes__IntStar; #line 46 IMPORT char VS_Ctypes__IntStar__e39a77b6392d7c83; #line 44 #define t33 ADDRESS #define TC33 TC_Ctypes__IntStarStar IMPORT TYPE TC_Ctypes__IntStarStar; #line 44 IMPORT char VS_Ctypes__IntStarStar__a46afe5b32b9d475; #line 33 #define t35 ADDRESS typedef float t36; #line 33 #define TC35 TC_Ctypes__FloatStar IMPORT TYPE TC_Ctypes__FloatStar; #line 33 IMPORT char VS_Ctypes__FloatStar__6c7e0b722780a93f; #line 26 #define t37 ADDRESS #define TC37 TC_Ctypes__UnsignedCharStar IMPORT TYPE TC_Ctypes__UnsignedCharStar; #line 26 IMPORT char VS_Ctypes__UnsignedCharStar__5ba21f95225c580b; #define t38 ADDRESS #define TC38 TC_Ctypes__UnsignedCharStarStar IMPORT TYPE TC_Ctypes__UnsignedCharStarStar; #line 27 IMPORT char VS_Ctypes__UnsignedCharStarStar__64970e213b9e555a; #line 24 #define t40 ADDRESS #define t41 ADDRESS #define TC41 TC_Ctypes__CharStarStar IMPORT TYPE TC_Ctypes__CharStarStar; #line 23 IMPORT char VS_Ctypes__CharStarStar__5cd33554337263a0; #define TC40 TC_Ctypes__CharStarStarStar IMPORT TYPE TC_Ctypes__CharStarStarStar; #line 24 IMPORT char VS_Ctypes__CharStarStarStar__a792f1ad3925ee76; #line 17 #define t43 ADDRESS typedef double t34; #line 17 #define TC43 TC_Ctypes__DoubleStar IMPORT TYPE TC_Ctypes__DoubleStar; #line 17 IMPORT char VS_Ctypes__DoubleStar__09a97cc036088f62; #define t56 ADDRESS #define TC56 TC_REFANY IMPORT TYPE TC_REFANY; IMPORT char VS_REFANY__4b8748e831fc107a; #define t73 ADDRESS #define TC73 TC_NULL IMPORT TYPE TC_NULL; IMPORT char VS_NULL__fb50c7d53bec30dc; #line 109 "./Time.i3" typedef struct { t8 _minutesWest; t8 _dstAlgorithm; } t1; #line 55 typedef struct { t8 _seconds; t8 _microseconds; } t2; #line 103 "Time.m3" typedef t70 (*t3)(); #line 93 typedef void (*t4)(); #line 78 typedef signed_char t5; typedef t5 (*t6)(); #line 66 typedef void (*t7)(); #line 49 typedef t8 (*t9)(); typedef int t10; #line 122 ".ROOT/.boots/corelib/Interfaces/CoreOS.i3" typedef struct { t3 _sv_handler; t8 _sv_mask; t8 _sv_flags; } t11; #line 82 typedef struct { t8 _tv_sec; t8 _tv_usec; } t16; typedef struct { t16 _it_interval; t16 _it_value; } t14; #line 86 typedef struct { t8 _tz_minuteswest; t8 _tz_dsttime; } t15; #line 33 typedef struct { t20 _st_dev; t8 _st_ino; t19 _st_mode; t20 _st_nlink; t20 _st_uid; t20 _st_gid; t20 _st_rdev; t8 _st_size; #line 33 t8 _st_atime; t8 _st_spare1; t8 _st_mtime; t8 _st_spare2; t8 _st_ctime; t8 _st_spare3; t8 _st_blksize; t8 _st_blocks; t8 _st_spare41; #line 33 t8 _st_spare42; } t18; #line 19 ".ROOT/.boots/corelib/Interfaces/Ctypes.i3" typedef signed_char t42; #define t68 ADDRESS typedef struct { TYPE self; int private; } t68_methods; #define t68_msize (sizeof (t68_methods)) typedef struct { ADDRESS methods; } t68_fields; #define t68_size (sizeof (t68_fields)) #define TC68 TC_ROOT IMPORT TYPE TC_ROOT; IMPORT char VS_ROOT__349f58f628be0ac6; #define t68_MapProc TC_ROOT->mapProc #define t57 ADDRESS #define TC57 TC_Thread__T IMPORT TYPE TC_Thread__T; #line 15 ".ROOT/.boots/corelib/Interfaces/Thread.i3" IMPORT char VS_Thread__T__2555b70b3f7780b1; #define t57_MapProc TC_Thread__T->mapProc typedef t56 (*t58)(); #define t59 ADDRESS #define TC59 TC_Thread__Condition IMPORT TYPE TC_Thread__Condition; #line 21 IMPORT char VS_Thread__Condition__26d5968239e08f4e; #define t59_MapProc TC_Thread__Condition->mapProc #define t60 ADDRESS #define TC60 TC_MUTEX IMPORT TYPE TC_MUTEX; IMPORT char VS_MUTEX__1f9d4e89391ab815; #define t60_MapProc TC_MUTEX->mapProc typedef unsigned char t61; #line 71 typedef t61 (*t62)(); #line 61 typedef t57 (*t63)(); #line 23 #define t64 ADDRESS #line 23 typedef struct { t58 _apply; } t64_methods; #define t64_msize (sizeof (t64_methods)) typedef struct { #line 23 int filler; } t64_fields; #define t64_size (sizeof (t64_fields)) #define TC64 TC_Thread__Closure IMPORT TYPE TC_Thread__Closure; #line 23 IMPORT char VS_Thread__Closure__7fb5c6232c5a658a; #define t64_MapProc TC_Thread__Closure->mapProc typedef t59 (*t65)(); typedef t60 (*t66)(); #line 28 #define t67 ADDRESS #line 28 typedef struct { int filler; } t67_methods; #define t67_msize (sizeof (t67_methods)) typedef struct { #line 28 t10 _stackSize; } t67_fields; #define t67_size (sizeof (t67_fields)) #define TC67 TC_Thread__SizedClosure IMPORT TYPE TC_Thread__SizedClosure; #line 28 IMPORT char VS_Thread__SizedClosure__8a46717d2eae7b07; #define t67_MapProc TC_Thread__SizedClosure->mapProc typedef CLOSURE t69; #define t71 ADDRESS #define TC71 TC_TEXT IMPORT TYPE TC_TEXT; IMPORT char VS_TEXT__b7a92447326386f5; #define t71_MapProc TC_TEXT->mapProc #define t72 ADDRESS typedef struct { TYPE self; int private; } t72_methods; #define t72_msize (sizeof (t72_methods)) typedef struct { ADDRESS methods; } t72_fields; #define t72_size (sizeof (t72_fields)) #define TC72 TC_UNTRACED_ROOT IMPORT TYPE TC_UNTRACED_ROOT; IMPORT char VS_UNTRACED_ROOT__3e0964513fd6da20; #line 7 "Time.m3" IMPORT INITLINK* CoreOS__init; IMPORT INITLINK* ThreadF__init; IMPORT INITLINK* Thread__init; IMPORT INITLINK* Time__init; #line 7 IMPORT TYPE TC_Ctypes__char_star; IMPORT char VS_Ctypes__char_star__90cf39683847e5e8; IMPORT t8 gettimeofday (); IMPORT char VSgettimeofday__ae64c4e03a1134e0; #line 7 IMPORT t8 settimeofday (); IMPORT char VSsettimeofday__d508071325366cbf; IMPORT t70 _ThreadF__Pause (); IMPORT char VS_ThreadF__Pause__e6785a583a691f40; #line 7 IMPORT char VS_Thread__DefaultStackSize__0c949e2e2def4e40; IMPORT TYPE TC_Thread__Mutex; IMPORT char VS_Thread__Mutex__4f5c12072cdeec3e; #line 7 IMPORT EXCEPTION_NAME _Thread__Alerted; IMPORT char VS_Thread__Alerted__fc88feb43485af46; EXPORT t70 _Time__Pause (); EXPORT char VS_Time__Pause__2b3acd4827f1853b = '\0'; #line 7 EXPORT t70 _Time__LongPause (); EXPORT char VS_Time__LongPause__9c53b31d2d46119e = '\0'; EXPORT t70 _Time__PauseUntil (); #line 7 EXPORT char VS_Time__PauseUntil__28b890183d53bd4e = '\0'; EXPORT void _Time__Now (); EXPORT char VS_Time__Now__1cf048602fe0a57c = '\0'; #line 7 EXPORT t8 _Time__ClockGrain (); EXPORT char VS_Time__ClockGrain__ac55870a3fa5f917 = '\0'; EXPORT void _Time__Add (); EXPORT char VS_Time__Add__7df69f893689d04a = '\0'; #line 7 EXPORT void _Time__Subtract (); EXPORT char VS_Time__Subtract__a5e6bd09359aa50f = '\0'; EXPORT t5 _Time__Compare (); EXPORT char VS_Time__Compare__9a4ce2942f11a212 = '\0'; #line 7 EXPORT void _Time__GetTimeZone (); EXPORT char VS_Time__GetTimeZone__ad1ef81723fb4f94 = '\0'; IMPORT EXCEPTION_NAME _Time__NoPrivileges; #line 7 IMPORT char VS_Time__NoPrivileges__6cb57575330ad093; EXPORT t70 _Time__SetTime (); EXPORT char VS_Time__SetTime__e4927f313c069070 = '\0'; #line 7 #line 23 PRIVATE EXCEPTION_NAME *raises_4 [] = { & _Thread__Alerted, (EXCEPTION_NAME *) NULL}; PRIVATE EXCEPTION_NAME *raises_5 [] = { & _Thread__Alerted, (EXCEPTION_NAME *) NULL}; #line 100 PRIVATE EXCEPTION_NAME *raises_7 [] = { & _Time__NoPrivileges, (EXCEPTION_NAME *) NULL}; #line 14 "Time.m3" EXPORT t70 _Time__Pause (_interval) t10 _interval; { t2 z1; t8 z4; t8 z5; t8 z6; t61 z3; #line 14 "Time.m3" { HANDLER hproc_0; PUSH_RAISES (hproc_0, raises_4, proc_0); { auto t2 _t; { _Time__Now (&z1); _t = z1; #line 14 CHECKSTACKOVERFLOW; z4 = _interval; z5 = 1000000 ; z6 = z4 - (z5 * (IDIV (z4, z5))); (_t._microseconds) += z6; z4 = IDIV (_interval, 1000000 ); (_t._seconds) += z4; z3 = ((_t._microseconds) >= 1000000 ); if (z3) { (_t._microseconds) -= 1000000 ; (_t._seconds) += 1 ; goto if_1_end; }; if_1_end: /**/; _ThreadF__Pause (_t); } } proc_0: CUT_TO_NEXT_HANDLER (hproc_0); if (hproc_0.exception != 0) RAISE_FOR_SURE (hproc_0.exception); #line 23 }; }; #line 26 "Time.m3" EXPORT t70 _Time__LongPause (_interval) t10 _interval; { t2 z1; #line 26 "Time.m3" { HANDLER hproc_0; PUSH_RAISES (hproc_0, raises_4, proc_0); { auto t2 _t; { _Time__Now (&z1); _t = z1; #line 26 CHECKSTACKOVERFLOW; (_t._seconds) += _interval; _ThreadF__Pause (_t); } } proc_0: CUT_TO_NEXT_HANDLER (hproc_0); if (hproc_0.exception != 0) RAISE_FOR_SURE (hproc_0.exception); #line 31 }; }; #line 34 "Time.m3" EXPORT t70 _Time__PauseUntil (_t) t2 _t; { #line 34 "Time.m3" { HANDLER hproc_0; PUSH_RAISES (hproc_0, raises_5, proc_0); { { CHECKSTACKOVERFLOW; _ThreadF__Pause (_t); } } proc_0: CUT_TO_NEXT_HANDLER (hproc_0); if (hproc_0.exception != 0) RAISE_FOR_SURE (hproc_0.exception); #line 36 }; }; #line 39 "Time.m3" EXPORT void _Time__Now (_return) t2* _return; { t8 z5; #line 39 "Time.m3" { auto t2 _tv; auto t1 _tz; auto t2 __result; { CHECKSTACKOVERFLOW; z5 = gettimeofday (&(*((t16*)(& _tv))), &(*((t15*)(& _tz)))); __result = _tv; *_return = __result; return; } } }; #line 49 "Time.m3" EXPORT t8 _Time__ClockGrain () { #line 49 "Time.m3" { auto t8 __result; { CHECKSTACKOVERFLOW; __result = 10000 ; return __result; } } }; #line 54 "Time.m3" EXPORT void _Time__Add (_t1, _t2, _return) t2 _t1; t2 _t2; t2* _return; { t8 z4; t61 z3; #line 54 "Time.m3" { auto t2 _res; auto t2 __result; { CHECKSTACKOVERFLOW; z4 = (_t1._seconds) + (_t2._seconds); (_res._seconds) = z4; z4 = (_t1._microseconds) + (_t2._microseconds); (_res._microseconds) = z4; z3 = ((_res._microseconds) > 1000000 ); if (z3) { (_res._microseconds) -= 1000000 ; (_res._seconds) += 1 ; goto if_2_end; }; if_2_end: /**/; __result = _res; *_return = __result; return; } } }; #line 66 "Time.m3" EXPORT void _Time__Subtract (_t1, _t2, _return) t2 _t1; t2 _t2; t2* _return; { t8 z4; t61 z3; #line 66 "Time.m3" { auto t2 _res; auto t2 __result; { CHECKSTACKOVERFLOW; z4 = (_t1._seconds) - (_t2._seconds); (_res._seconds) = z4; z4 = (_t1._microseconds) - (_t2._microseconds); (_res._microseconds) = z4; z3 = ((_res._microseconds) < 0 ); if (z3) { (_res._microseconds) += 1000000 ; (_res._seconds) -= 1 ; goto if_3_end; }; if_3_end: /**/; __result = _res; *_return = __result; return; } } }; #line 78 "Time.m3" EXPORT t5 _Time__Compare (_t1, _t2) t2 _t1; t2 _t2; { t61 z4; t8 z1; t8 z0; #line 78 "Time.m3" { auto t5 __result; { ZERO1B (& __result); CHECKSTACKOVERFLOW; z4 = ((_t1._seconds) > (_t2._seconds)); if (z4) { __result = 1 ; return __result; }; z4 = ((_t1._seconds) == (_t2._seconds)); if (z4) { z4 = ((_t1._microseconds) > (_t2._microseconds)); if (z4) { __result = 1 ; return __result; }; z4 = ((_t1._microseconds) == (_t2._microseconds)); if (z4) { __result = 0 ; return __result; }; z1 = - 1 ; z0 = z1; if ((z0 < -1) || (1 < z0)) RANGEFAULT; __result = z0; return __result; }; z1 = - 1 ; z0 = z1; if ((z0 < -1) || (1 < z0)) RANGEFAULT; __result = z0; return __result; } } }; #line 93 "Time.m3" EXPORT void _Time__GetTimeZone (_return) t1* _return; { t8 z5; #line 93 "Time.m3" { auto t2 _tv; auto t1 _tz; auto t1 __result; { CHECKSTACKOVERFLOW; z5 = gettimeofday (&(*((t16*)(& _tv))), &(*((t15*)(& _tz)))); __result = _tz; *_return = __result; return; } } }; #line 103 "Time.m3" EXPORT t70 _Time__SetTime (_tv, _tz) t2 _tv; t1 _tz; { t8 z5; t8 z1; t61 z0; #line 103 "Time.m3" { HANDLER hproc_0; PUSH_RAISES (hproc_0, raises_7, proc_0); { { CHECKSTACKOVERFLOW; z5 = settimeofday (&(*((t16*)(& _tv))), &(*((t15*)(& _tz)))); z1 = - 1 ; z0 = (z5 == z1); if (z0) { RAISE (& _Time__NoPrivileges, 0, 0); }; } } proc_0: CUT_TO_NEXT_HANDLER (hproc_0); if (hproc_0.exception != 0) RAISE_FOR_SURE (hproc_0.exception); #line 107 }; }; PRIVATE int init_done = -1; #line 107 "Time.m3" PRIVATE void Time__initProc (g) int g; { #line 107 "Time.m3" if (init_done >= g) return; init_done = g; INITIALIZE (& Time__init); INITIALIZE (& CoreOS__init); INITIALIZE (& ThreadF__init); #line 107 INITIALIZE (& Thread__init); return; }; #line 107 "Time.m3" PRIVATE void t12_PrintProc (ref) t13* ref; { CHECKSTACKOVERFLOW; fprintf (stderr, "%s {", TC12->brand); fprintf (stderr, "^ = { "); #line 107 fprintf (stderr, "sc_onstack = %d", (*ref)._sc_onstack); fprintf (stderr, "sc_mask = %d", (*ref)._sc_mask); fprintf (stderr, "sc_sp = %d", (*ref)._sc_sp); #line 107 fprintf (stderr, "sc_pc = %d", (*ref)._sc_pc); fprintf (stderr, "sc_ps = %d", (*ref)._sc_ps); fprintf (stderr, "}"); fprintf (stderr, "}\n"); #line 107 }; PRIVATE INITLINK me_0 ={(INITLINK*)NIL, 0, Time__initProc}; static char* VSimports[] = { &VS_Ctypes__char_star__90cf39683847e5e8, &VS_ThreadF__Pause__e6785a583a691f40, &VS_Thread__DefaultStackSize__0c949e2e2def4e40, &VS_Thread__T__2555b70b3f7780b1, &VS_Thread__Mutex__4f5c12072cdeec3e, &VS_Thread__Condition__26d5968239e08f4e, &VS_Thread__Closure__7fb5c6232c5a658a, &VS_Thread__SizedClosure__8a46717d2eae7b07, &VS_Thread__Alerted__fc88feb43485af46, &VS_Thread__Alerted__fc88feb43485af46, &VS_Time__NoPrivileges__6cb57575330ad093, NIL }; void Time__MLink (phase) int phase; { switch (phase) { case 0: { me_0.link = Time__init; Time__init = & me_0; t12_TC = t12_TC_init; REGISTERTYPE (TC12); break; }; case 1: { break; }; case 2: { break; }; }; };