/* Generated with C2C (Cedar To C)*/ /* Copyright (C) 1992 by Xerox Corporation. All rights reserved. */ /* time: February 21, 1992 7:40:53 pm PST */ /* C2C version: October 16, 1990 (native) */ /* ref-counting: off */ /* file: AsynchronousEventsImpl, module: AsynchronousEventsImpl */ /* switches: bcfhklnouw */ #include #include static char versionStamp[] = "@(#)mob_version [1958539963,3845346028] AsynchronousEventsImpl"; typedef unsigned word, *ptr; typedef unsigned char byte, *bPt; typedef unsigned short half, *hPt; typedef struct {word f0, f1;} W2; typedef word (*fPt)(); typedef struct {word f0, f1, f2;} W3; typedef W3 *W3Pt; typedef W2 *W2Pt; typedef struct {word f0, f1, f2, f3;} W4; typedef struct {word f0, f1, f2, f3, f4, f5, f6, f7;} W8; #define SOURCE(p, l) /* source p, l */ #define BCK(idx, lim) ( ((unsigned) idx) >= ((unsigned) lim) ? (XR_RaiseBoundsFault()) : (idx) ) static void NoName_Q672(); static void AsynchronousEventsImpl_P0(); static void RegisterInterest_P60(); static void TellPCR_P120(); static word Ok_P180(); static void MoreRegistrations_P240(); static void StopProcessingEvents_P300(); static void ProcessEvents_P360(); static void ProcessOneEvent_P420(); static word NoName_Q732(); static void NoName_Q792(); static word NoName_Q852(); static struct {unsigned f; char r[16];} string1 = {851984, "\257\300\164\274\362\273\300\345\063\122\354\100\214\000\000"}; static struct {unsigned f; char r[16];} string2 = {851984, "\257\300\164\274\362\273\300\345\063\122\354\100\164\000\000"}; static struct {unsigned f; char r[4];} string3 = {131074, "\003\010\000"}; static struct {unsigned f; char r[16];} string4 = {851984, "\257\300\240\236\274\315\300\111\163\325\023\100\150\000\000"}; static struct {unsigned f; char r[16];} string5 = {851984, "\257\300\254\022\215\272\300\356\006\202\125\100\150\000\000"}; static struct { word f0[12]; word f12; word f13; word f14; word f15; word f16; word f17; word f18; word f19; word f20; word f21; word f22; word f23; word f24; word f25; word f26; word f27; word f28; word f29; word f30; word f31; word f32; word f33; word f34; word f35; word f36; word f37; word f38; word f39; word f40[2]; } globalframe = { {0}, (word) ProcessOneEvent_P420, 0, (word) ProcessEvents_P360, 0, (word) StopProcessingEvents_P300, 0, (word) MoreRegistrations_P240, 0, (word) Ok_P180, 0, (word) TellPCR_P120, 0, (word) RegisterInterest_P60, 0, (word) AsynchronousEventsImpl_P0, 0, 1, 2, 13, 17, 23, 24, 25, 26, 27, 28, 29, 31, {0} }; static void NoName_Q672() { register ptr gf_c068 = (ptr) &globalframe; word var_c6564; (* (( (ptr) gf_c068)+10) ) = (word) XR_GetTypeIndexS((word) (&string1)); (void) XR_DeclareGlobalFrame((word) "AsynchronousEventsImpl", &globalframe, (word) XR_GetTypeIndex((word) &string2, 0, (word) &string3) , (word) (( (bPt) gf_c068)+104)/* var_c5764 */ ); var_c6564 = (word) XR_ImportInterface((word) "Process", (word) XR_GetTypeIndexS((word) (&string4)), 22); (* (( (ptr) gf_c068)+40)/* var_c5924 */ ) = var_c6564; (void) XR_ImportProcS(var_c6564, 527105); (void) XR_ImportProcS(var_c6564, 134219776); (void) XR_ImportProcS(var_c6564, 526081); var_c6564 = (word) XR_ExportInterface((word) "AsynchronousEvents", (word) XR_GetTypeIndexS((word) (&string5)), 1); (* (( (ptr) gf_c068)+41)/* var_c6596 */ ) = var_c6564; (void) XR_ExportProcS(var_c6564, (word) (( (bPt) gf_c068)+96)/* var_c5732 */ , 524290); } static void AsynchronousEventsImpl_P0(formal_c027, formal_c020) word formal_c027; word formal_c020; { register ptr gf_c6628 = (ptr) &globalframe; /* AsynchronousEventsImpl: */ SOURCE(51, 3182) /* moved to installation proc */ /* moved to installation proc */ /* moved to installation proc */ /* moved to installation proc */ /* moved to installation proc */ /* moved to installation proc */ /* moved to installation proc */ /* moved to installation proc */ /* moved to installation proc */ /* moved to installation proc */ /* moved to installation proc */ /* moved to installation proc */ SOURCE(579, 59) { word var_c5860; var_c5860 = XR_NewObject(128, (* (( (ptr) gf_c6628)+10) )); (* (( (ptr) var_c5860)+1) ) = 10; (* (( (ptr) gf_c6628)+8)/* registrations_v2664 */ ) = var_c5860; }; SOURCE(2412, 21) (* (( (ptr) gf_c6628)+9)/* continue_v2888 */ ) = 1; SOURCE(3192, 41) SOURCE(3194, 39) { W2 var_c5892; { W2 var_c024; word var_c023; var_c023 = XR_ExtensionAlloc(4); { word tmpAddr6; tmpAddr6 = (word) var_c023; (* (ptr) tmpAddr6 ) = ( ((word) (fPt) NoName_Q852) ); (* (( (ptr) tmpAddr6) + 1) ) = 0; (* (( (ptr) tmpAddr6) + 2) ) = (word) (( (bPt) gf_c6628)+56)/* var_c5572 */ ; (* (( (ptr) tmpAddr6) + 3) ) = 0; }; (void) XR_Fork((word) &var_c024, var_c023); var_c5892 = var_c024; }; { word pd7; pd7 = (* (( (ptr) (* (( (ptr) gf_c6628)+40)/* var_c5924 */ ))+11) ); (void) ( *( (fPt) ((* (ptr) pd7 ))))(var_c5892, pd7); }; }; } static void RegisterInterest_P60(event_v3316, interested_v3344) word event_v3316; word interested_v3344; { register ptr gf_c6660 = (ptr) &globalframe; W2 self_v4080; /* RegisterInterest: */ SOURCE(641, 506) (void) (XR_MonitorEntry((word) (( (bPt) gf_c6660)+16)/* LOCK_v2496 */ )); SOURCE(714, 36) { word pd8; pd8 = (* (( (ptr) (* (( (ptr) gf_c6660)+40)/* var_c5924 */ ))+12) ); (void) ( *( (fPt) ((* (ptr) pd8 ))))((word) (&self_v4080), pd8); }; SOURCE(752, 42) if ((0 != (word) Ok_P180(event_v3316, interested_v3344, self_v4080))) { SOURCE(788, 6) (void) (XR_MonitorExit((word) (( (bPt) gf_c6660)+16)/* LOCK_v2496 */ )); return; }; SOURCE(796, 89) if (((* (ptr) (* (( (ptr) gf_c6660)+8)/* registrations_v2664 */ ) ) == (* (( (ptr) (* (( (ptr) gf_c6660)+8)/* registrations_v2664 */ ))+1) ))) { SOURCE(866, 19) (void) MoreRegistrations_P240(); }; SOURCE(887, 260) { register word i_v4140 = 0; register word noName_c5956; word var_c5988; noName_c5956 = (* (( (ptr) (* (( (ptr) gf_c6660)+8)/* registrations_v2664 */ ))+1) ); if ((i_v4140 >= noName_c5956)) { goto lab_L100000; }; lab_L100003: ; SOURCE(941, 206) { word limit9; W2 temp10; var_c5988 = (* (( (ptr) gf_c6660)+8)/* registrations_v2664 */ ); (* (ptr) &temp10 ) = 0; (* (( (ptr) &temp10) + 1) ) = 0; if (XR_EqualWords((( (W3Pt) (( (ptr) var_c5988)+2))+( limit9 = (* (( (ptr) var_c5988)+1) ), BCK(i_v4140, limit9) )), &temp10, 2)) { { word var_c6020; word var_c6052; SOURCE(982, 31) { word limit11; var_c6020 = (* (( (ptr) gf_c6660)+8)/* registrations_v2664 */ ); (* (W2Pt) (( (W3Pt) (( (ptr) var_c6020)+2))+( limit11 = (* (( (ptr) var_c6020)+1) ), BCK(i_v4140, limit11) )) ) = self_v4080; }; SOURCE(1015, 30) { word limit12; var_c6052 = (* (( (ptr) gf_c6660)+8)/* registrations_v2664 */ ); (* (( (W3Pt) (( (ptr) var_c6052)+2))+( limit12 = (* (( (ptr) var_c6052)+1) ), BCK(i_v4140, limit12) )) ).f2 = event_v3316; }; SOURCE(1047, 64) (* (ptr) (* (( (ptr) gf_c6660)+8)/* registrations_v2664 */ ) ) = ((* (ptr) (* (( (ptr) gf_c6660)+8)/* registrations_v2664 */ ) ) + 1); SOURCE(1113, 26) (void) TellPCR_P120((* (((( (ptr) gf_c6660)+28)/* var_c5828 */ +event_v3316)) )); SOURCE(1141, 6) (void) (XR_MonitorExit((word) (( (bPt) gf_c6660)+16)/* LOCK_v2496 */ )); return; }; }; }; i_v4140 = (i_v4140 + 1); if ((i_v4140 < noName_c5956)) { goto lab_L100003; }; lab_L100000: ; }; SOURCE(1161, 5) (void) XR_RaiseUnnamedError(); } static void TellPCR_P120(sig_v3404) word sig_v3404; { /* TellPCR: */ SOURCE(1172, 135) SOURCE(1208, 99) if ((sig_v3404 == 2)) { SOURCE(1229, 41) (void) XR_UIORegisterInterestInINTEvent(1); } else { SOURCE(1270, 37) (void) XR_UIORegisterInterestInEvent(sig_v3404, 1); }; } static word Ok_P180(event_v3612, interested_v3640, process_v3668) word event_v3612; word interested_v3640; W2 process_v3668; { register ptr gf_c6692 = (ptr) &globalframe; word var_c3728; /* Ok: */ SOURCE(1599, 393) SOURCE(1678, 275) { register word i_v4184 = 0; register word noName_c6084; word var_c6116; word var_c6148; word var_c078; noName_c6084 = (* (( (ptr) (* (( (ptr) gf_c6692)+8)/* registrations_v2664 */ ))+1) ); if ((i_v4184 >= noName_c6084)) { goto lab_L100004; }; lab_L100007: ; SOURCE(1732, 221) { word tc13; word limit14; var_c6116 = (* (( (ptr) gf_c6692)+8)/* registrations_v2664 */ ); if (XR_EqualWords((( (W3Pt) (( (ptr) var_c6116)+2))+( limit14 = (* (( (ptr) var_c6116)+1) ), BCK(i_v4184, limit14) )), &process_v3668, 2)) { { word limit15; var_c6148 = (* (( (ptr) gf_c6692)+8)/* registrations_v2664 */ ); var_c078 = (* (( (W3Pt) (( (ptr) var_c6148)+2))+( limit15 = (* (( (ptr) var_c6148)+1) ), BCK(i_v4184, limit15) )) ).f2; }; tc13 = (word) (var_c078 == event_v3612); } else { tc13 = (word) 0; }; if (tc13) { SOURCE(1813, 121) if ((0 == interested_v3640)) { { word var_c6180; SOURCE(1838, 30) { word limit16; word tmpAddr17; var_c6180 = (* (( (ptr) gf_c6692)+8)/* registrations_v2664 */ ); tmpAddr17 = (word) (( (W3Pt) (( (ptr) var_c6180)+2))+( limit16 = (* (( (ptr) var_c6180)+1) ), BCK(i_v4184, limit16) )); (* (ptr) tmpAddr17 ) = 0; (* (( (ptr) tmpAddr17) + 1) ) = 0; }; SOURCE(1870, 64) (* (ptr) (* (( (ptr) gf_c6692)+8)/* registrations_v2664 */ ) ) = ((* (ptr) (* (( (ptr) gf_c6692)+8)/* registrations_v2664 */ ) ) - 1); }; }; SOURCE(1939, 14) return(1); }; }; i_v4184 = (i_v4184 + 1); if ((i_v4184 < noName_c6084)) { goto lab_L100007; }; lab_L100004: ; }; SOURCE(1967, 25) return((0 == interested_v3640)); } static void MoreRegistrations_P240() { register ptr gf_c6724 = (ptr) &globalframe; word newRegistrations_v4228; /* MoreRegistrations: */ SOURCE(1998, 322) SOURCE(2026, 93) { word var_c6212; word var_c6244; word var_c6276; var_c6212 = ((* (( (ptr) (* (( (ptr) gf_c6724)+8)/* registrations_v2664 */ ))+1) ) + 10); var_c6244 = (var_c6212 * 12); var_c6276 = XR_NewObject((8 + var_c6244), (* (( (ptr) gf_c6724)+10) )); (* (( (ptr) var_c6276)+1) ) = var_c6212; newRegistrations_v4228 = var_c6276; }; SOURCE(2121, 62) (* (ptr) newRegistrations_v4228 ) = (* (ptr) (* (( (ptr) gf_c6724)+8)/* registrations_v2664 */ ) ); SOURCE(2185, 92) { register word i_v4284 = 0; register word noName_c6308; noName_c6308 = (* (( (ptr) (* (( (ptr) gf_c6724)+8)/* registrations_v2664 */ ))+1) ); if ((i_v4284 >= noName_c6308)) { goto lab_L100008; }; lab_L100011: ; SOURCE(2239, 38) { word var_c6340; var_c6340 = (* (( (ptr) gf_c6724)+8)/* registrations_v2664 */ ); { word limit18; word limit19; (* (( (W3Pt) (( (ptr) newRegistrations_v4228)+2))+( limit18 = (* (( (ptr) newRegistrations_v4228)+1) ), BCK(i_v4284, limit18) )) ) = (* (( (W3Pt) (( (ptr) var_c6340)+2))+( limit19 = (* (( (ptr) var_c6340)+1) ), BCK(i_v4284, limit19) )) ); }; }; i_v4284 = (i_v4284 + 1); if ((i_v4284 < noName_c6308)) { goto lab_L100011; }; lab_L100008: ; }; SOURCE(2288, 32) (* (( (ptr) gf_c6724)+8)/* registrations_v2664 */ ) = newRegistrations_v4228; } static void StopProcessingEvents_P300() { register ptr gf_c6756 = (ptr) &globalframe; /* StopProcessingEvents: */ SOURCE(2435, 47) SOURCE(2466, 16) (* (( (ptr) gf_c6756)+9)/* continue_v2888 */ ) = 0; } static void ProcessEvents_P360() { register ptr gf_c6788 = (ptr) &globalframe; W4 myEvent_v4328; /* ProcessEvents: */ SOURCE(2488, 118) SOURCE(2520, 17) myEvent_v4328.f0 = 0; myEvent_v4328.f1 = 0; myEvent_v4328.f2 = 0; myEvent_v4328.f3 = 0; SOURCE(2539, 67) lab_L100014: ; if ((* (( (ptr) gf_c6788)+9)/* continue_v2888 */ )) { } else { goto lab_L100012; }; SOURCE(2557, 23) (void) XR_UIOAwaitEvent((word) (&myEvent_v4328)); SOURCE(2582, 24) (void) ProcessOneEvent_P420(myEvent_v4328); goto lab_L100014; lab_L100012: ; } static void ProcessOneEvent_P420(eventInstance_v4052) W4 eventInstance_v4052; { W8 var_c6820; register ptr gf_c6852 = (ptr) &globalframe; /* ProcessOneEvent: */ SOURCE(2711, 442) (void) (XR_MonitorEntry((word) (( (bPt) gf_c6852)+16)/* LOCK_v2496 */ )); SOURCE(2769, 384) { /* declaration of i_v4372 skipped */ register word noName_c6404; word var_c6436; word var_c6468; word var_c079; var_c6820.f4/* i_v4372 */ = 0; noName_c6404 = (* (( (ptr) (* (( (ptr) gf_c6852)+8)/* registrations_v2664 */ ))+1) ); if ((var_c6820.f4/* i_v4372 */ >= noName_c6404)) { goto lab_L100015; }; lab_L100018: ; SOURCE(2823, 330) { word tc20; word idx21; word limit22; W2 temp23; var_c6436 = (* (( (ptr) gf_c6852)+8)/* registrations_v2664 */ ); (* (ptr) &temp23 ) = 0; (* (( (ptr) &temp23) + 1) ) = 0; if ( ! XR_EqualWords((( (W3Pt) (( (ptr) var_c6436)+2))+( idx21 = (word) var_c6820.f4/* i_v4372 */ , limit22 = (* (( (ptr) var_c6436)+1) ), BCK(idx21, limit22) )), &temp23, 2)) { { word idx24; word limit25; var_c6468 = (* (( (ptr) gf_c6852)+8)/* registrations_v2664 */ ); var_c079 = (* ((( (ptr) gf_c6852)+28)/* var_c5828 */ +(* (( (W3Pt) (( (ptr) var_c6468)+2))+( idx24 = (word) var_c6820.f4/* i_v4372 */ , limit25 = (* (( (ptr) var_c6468)+1) ), BCK(idx24, limit25) )) ).f2) ); }; tc20 = (word) (var_c079 == eventInstance_v4052.f2); } else { tc20 = (word) 0; }; if (tc20) { SOURCE(2922, 231) if ((eventInstance_v4052.f2 != 2) || (eventInstance_v4052.f1 == 1)) { SOURCE(2987, 166) SOURCE(2987, 166) { /* declaration of var_c01 skipped */ word var_c6500; /* declaration of var_c02 skipped */ { word idx26; word limit27; var_c6500 = (* (( (ptr) gf_c6852)+8)/* registrations_v2664 */ ); (* (W2Pt) (( (ptr) &var_c6820)+5)/* var_c01 */ ) = (* (W2Pt) (( (W3Pt) (( (ptr) var_c6500)+2))+( idx26 = (word) var_c6820.f4/* i_v4372 */ , limit27 = (* (( (ptr) var_c6500)+1) ), BCK(idx26, limit27) )) ); }; var_c6820.f7/* var_c02 */ = (* (( (ptr) (* (( (ptr) gf_c6852)+40)/* var_c5924 */ ))+15) ); { word var_c03; { word var_c080; var_c080 = (word) &var_c6820; var_c03 = (word) XR_Enable(( ((word) (fPt) NoName_Q732) ), ( ((word) (fPt) NoName_Q792) ), var_c080); }; /* removed trivial cond node */ }; }; }; }; }; var_c6820.f4/* i_v4372 */ = (var_c6820.f4/* i_v4372 */ + 1); if ((var_c6820.f4/* i_v4372 */ < noName_c6404)) { goto lab_L100018; }; lab_L100015: ; }; SOURCE(2711, 442) (void) (XR_MonitorExit((word) (( (bPt) gf_c6852)+16)/* LOCK_v2496 */ )); return; } static word NoName_Q732(formal_c076) word formal_c076; { SOURCE(2987, 166) { word pd28; pd28 = (* (( (ptr) formal_c076)+7) ); (void) ( *( (fPt) ((* (ptr) pd28 ))))((* (W2Pt) ((( (ptr) formal_c076)+5)) ), pd28); }; return(0); } static void NoName_Q792(formal_c067, formal_c200000, formal_c200001, formal_c200002, formal_c200003) word formal_c067; word formal_c200000; word formal_c200001; word formal_c200002; word formal_c200003; { register ptr gf_c077 = (ptr) &globalframe; if ((formal_c200001 == (* (ptr) (* (( (ptr) (* (( (ptr) gf_c077)+40)/* var_c5924 */ ))+25) ) ))) { { W2 process_v5428; word var_c6532; process_v5428 = (* (W2Pt) formal_c200003 ); SOURCE(3057, 30) { word idx29; word limit30; word tmpAddr31; var_c6532 = (* (( (ptr) gf_c077)+8)/* registrations_v2664 */ ); tmpAddr31 = (word) (( (W3Pt) (( (ptr) var_c6532)+2))+( idx29 = (* (( (ptr) formal_c200000)+4) ), limit30 = (* (( (ptr) var_c6532)+1) ), BCK(idx29, limit30) )); (* (ptr) tmpAddr31 ) = 0; (* (( (ptr) tmpAddr31) + 1) ) = 0; }; SOURCE(3089, 64) (* (ptr) (* (( (ptr) gf_c077)+8)/* registrations_v2664 */ ) ) = ((* (ptr) (* (( (ptr) gf_c077)+8)/* registrations_v2664 */ ) ) - 1); SOURCE(3155, 9) (* (ptr) formal_c067 ) = 2; (* (( (ptr) formal_c067)+1) ) = 2; return; }; }; (* (ptr) formal_c067 ) = 0; (* (( (ptr) formal_c067)+1) ) = 0; return; } static word NoName_Q852(formal_c025) word formal_c025; { word var_c026; /* intermediary proc for a FORK, nArgs: 0, nRets: 0 */ var_c026 = (* (( (ptr) formal_c025)+2) ); formal_c025 = XR_ExtensionFree(formal_c025); (void) ( *( (fPt) ((* (ptr) var_c026 ))))(var_c026); return(0); } /* file: AsynchronousEventsImpl, module: AsynchronousEventsImpl, compiled at: February 21, 1992 7:40:52 pm PST */ extern void XR_install_AsynchronousEventsImpl() { NoName_Q672(); } extern void XR_run_AsynchronousEventsImpl() { XR_Start(&globalframe); }