/* Generated with C2C (Cedar To C)*/ /* Copyright (C) 1992 by Xerox Corporation. All rights reserved. */ /* time: February 21, 1992 4:39:30 pm PST */ /* C2C version: October 16, 1990 (native) */ /* ref-counting: off */ /* file: ConvertUnsafeImpl, module: ConvertUnsafeImpl */ /* switches: bcfhklnouw */ #include <cedar/InstallationSupport.h> #include <cedar/CedarExtra.h> static char versionStamp[] = "@(#)mob←version [2426916631,1004263386] ConvertUnsafeImpl"; typedef unsigned word, *ptr; typedef unsigned char byte, *bPt; typedef unsigned short half, *hPt; typedef word (*fPt)(); typedef struct {word f0, f1, f2;} W3; typedef struct {unsigned u1:1, f:15;} * P15x1h; #define SOURCE(p, l) /* source p, l */ #define BCK(idx, lim) ( ((unsigned) idx) >= ((unsigned) lim) ? (XR←RaiseBoundsFault()) : (idx) ) #define SGNCK(i) ((int) (word) (i) < 0 ? XR←RaiseArithmeticFault(): i ) static void NoName←Q1212(); static void ConvertUnsafeImpl←P0(); static void AppendRefText←P60(); static void AppendRope←P120(); static void AppendSubString←P180(); static void AppendSubStringToRefText←P240(); static word ToRefText←P300(); static word EqualSubStrings←P360(); static word SubStringToRope←P420(); static word ToRope←P480(); static struct {unsigned f; char r[16];} string1 = {851984, "\257\300\220\247\317\027\300\073\333\327\332\100\164\000\000"}; static struct {unsigned f; char r[16];} string2 = {851984, "\257\300\332\223\177\020\300\304\076\102\260\100\164\000\000"}; static struct {unsigned f; char r[16];} string3 = {851984, "\257\300\363\223\326\161\300\017\164\046\072\100\150\000\000"}; static struct {unsigned f; char r[12];} string4 = {720908, "\257\300\036\351\345\237\244\150\210\100\150"}; 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) ToRope←P480, 0, (word) SubStringToRope←P420, 0, (word) EqualSubStrings←P360, 0, (word) ToRefText←P300, 0, (word) AppendSubStringToRefText←P240, 0, (word) AppendSubString←P180, 0, (word) AppendRope←P120, 0, (word) AppendRefText←P60, 0, (word) ConvertUnsafeImpl←P0, {0} }; static void NoName←Q1212() { register ptr gf←c070 = (ptr) &globalframe; word var←c8464; (void) XR←DeclareGlobalFrame((word) "ConvertUnsafeImpl", &globalframe, (word) XR←GetTypeIndexS((word) (&string1)), (word) ( ( (bPt) gf←c070)+80)/* var←c7888 */ ); var←c8464 = (word) XR←ImportInterface((word) "RefText", (word) XR←GetTypeIndexS((word) (&string2)), 26); (* (( (ptr) gf←c070)+23)/* var←c8176 */ ) = var←c8464; (void) XR←ImportProcS(var←c8464, 67371009); var←c8464 = (word) XR←ImportInterface((word) "Rope", (word) XR←GetTypeIndexS((word) (&string3)), 43); (* (( (ptr) gf←c070)+22)/* var←c7952 */ ) = var←c8464; (void) XR←ImportProcS(var←c8464, 67378689); (void) XR←ImportProcS(var←c8464, 67634434); (void) XR←ImportProcS(var←c8464, 67373825); var←c8464 = (word) XR←ExportInterface((word) "ConvertUnsafe", (word) XR←GetTypeIndexS((word) (&string4)), 8); (* (( (ptr) gf←c070)+24)/* var←c8496 */ ) = var←c8464; (void) XR←ExportProcS(var←c8464, (word) (( (bPt) gf←c070)+72)/* var←c7856 */ , 524290); (void) XR←ExportProcS(var←c8464, (word) (( (bPt) gf←c070)+64)/* var←c7824 */ , 524546); (void) XR←ExportProcS(var←c8464, (word) (( (bPt) gf←c070)+56)/* var←c7792 */ , 1049090); (void) XR←ExportProcS(var←c8464, (word) (( (bPt) gf←c070)+48)/* var←c7760 */ , 1049346); (void) XR←ExportProcS(var←c8464, (word) (( (bPt) gf←c070)+40)/* var←c7728 */ , 67372033); (void) XR←ExportProcS(var←c8464, (word) (( (bPt) gf←c070)+16)/* var←c7632 */ , 67372289); (void) XR←ExportProcS(var←c8464, (word) (( (bPt) gf←c070)+24)/* var←c7664 */ , 67896833); (void) XR←ExportProcS(var←c8464, (word) (( (bPt) gf←c070)+32)/* var←c7696 */ , 68945667); } static void ConvertUnsafeImpl←P0(formal←c015, formal←c014) word formal←c015; word formal←c014; { /* ConvertUnsafeImpl: */ } static void AppendRefText←P60(to←v2912, from←v2940) word to←v2912; word from←v2940; { word len←v3740; /* AppendRefText: */ SOURCE(356, 206) SOURCE(438, 25) len←v3740 = (* (hPt) to←v2912 ); SOURCE(465, 71) { register word i←v3784 = 0; register word noName←c7920; noName←c7920 = (* (hPt) from←v2940 ); if ((i←v3784 >= noName←c7920)) { goto lab←L100000; }; lab←L100003: ; SOURCE(504, 17) { word limit5; word limit6; (* ((( (bPt) to←v2912)+4)+( limit5 = (word) (* (( (hPt) to←v2912)+1) ), BCK(len←v3740, limit5) )) ) = (word) (* ((( (bPt) from←v2940)+4)+( limit6 = (word) (* (( (hPt) from←v2940)+1) ), BCK(i←v3784, limit6) )) ); }; SOURCE(523, 13) len←v3740 = (len←v3740 + 1); i←v3784 = (i←v3784 + 1); if ((i←v3784 < noName←c7920)) { goto lab←L100003; }; lab←L100000: ; }; SOURCE(547, 15) (* (hPt) to←v2912 ) = BCK(len←v3740, 65536); } static void AppendRope←P120(to←v3012, from←v3040) word to←v3012; word from←v3040; { register ptr gf←c8528 = (ptr) &globalframe; word len←v3828; /* AppendRope: */ SOURCE(568, 190) SOURCE(634, 25) len←v3828 = (* (hPt) to←v3012 ); SOURCE(661, 71) { register word i←v3872 = 0; register word noName←c7984; { word pd7; pd7 = (* (( (ptr) (* (( (ptr) gf←c8528)+22)/* var←c7952 */ ))+15) ); noName←c7984 = (word) ( *( (fPt) ((* (ptr) pd7 ))))(from←v3040, pd7); }; if (( (int)i←v3872 >= (int)noName←c7984)) { goto lab←L100004; }; lab←L100007: ; SOURCE(694, 23) { word var←c8016; { word pd8; pd8 = (* (( (ptr) (* (( (ptr) gf←c8528)+22)/* var←c7952 */ ))+9) ); var←c8016 = (word) ( *( (fPt) ((* (ptr) pd8 ))))(from←v3040, i←v3872, pd8); }; { word limit9; (* ((( (bPt) to←v3012)+4)+( limit9 = (word) (* (( (hPt) to←v3012)+1) ), BCK(len←v3828, limit9) )) ) = var←c8016; }; }; SOURCE(719, 13) len←v3828 = (len←v3828 + 1); i←v3872 = (i←v3872 + 1); if (( (int)i←v3872 < (int)noName←c7984)) { goto lab←L100007; }; lab←L100004: ; }; SOURCE(743, 15) (* (hPt) to←v3012 ) = BCK(len←v3828, 65536); } static void AppendSubString←P180(to←v3100, from←v3128) word to←v3100; W3 from←v3128; { word len←v3916; /* AppendSubString: */ SOURCE(764, 214) SOURCE(840, 25) len←v3916 = (* (hPt) to←v3100 ); SOURCE(867, 85) { register word i←v3960 = 0; register word noName←c8048; { word idx10; noName←c8048 = ( idx10 = (word) from←v3128.f2, SGNCK(idx10) ); }; if (( (int)i←v3960 >= (int)noName←c8048)) { goto lab←L100008; }; lab←L100011: ; SOURCE(901, 36) { word var←c8080; var←c8080 = (from←v3128.f1 + i←v3960); { word limit11; word limit12; (* ((( (bPt) to←v3100)+4)+( limit11 = (word) (* (( (hPt) to←v3100)+1) ), BCK(len←v3916, limit11) )) ) = (word) (* ((( (bPt) from←v3128.f0)+4)+( limit12 = (word) (* (( (hPt) from←v3128.f0)+1) ), BCK(var←c8080, limit12) )) ); }; }; SOURCE(939, 13) len←v3916 = (len←v3916 + 1); i←v3960 = (i←v3960 + 1); if (( (int)i←v3960 < (int)noName←c8048)) { goto lab←L100011; }; lab←L100008: ; }; SOURCE(963, 15) (* (hPt) to←v3100 ) = BCK(len←v3916, 65536); } static void AppendSubStringToRefText←P240(to←v3188, from←v3216) word to←v3188; W3 from←v3216; { word len←v4004; /* AppendSubStringToRefText: */ SOURCE(984, 220) SOURCE(1066, 25) len←v4004 = (* (hPt) to←v3188 ); SOURCE(1093, 85) { register word i←v4048 = 0; register word noName←c8112; { word idx13; noName←c8112 = ( idx13 = (word) from←v3216.f2, SGNCK(idx13) ); }; if (( (int)i←v4048 >= (int)noName←c8112)) { goto lab←L100012; }; lab←L100015: ; SOURCE(1127, 36) { word var←c8144; var←c8144 = (from←v3216.f1 + i←v4048); { word limit14; word limit15; (* ((( (bPt) to←v3188)+4)+( limit14 = (word) (* (( (hPt) to←v3188)+1) ), BCK(len←v4004, limit14) )) ) = (word) (* ((( (bPt) from←v3216.f0)+4)+( limit15 = (word) (* (( (hPt) from←v3216.f0)+1) ), BCK(var←c8144, limit15) )) ); }; }; SOURCE(1165, 13) len←v4004 = (len←v4004 + 1); i←v4048 = (i←v4048 + 1); if (( (int)i←v4048 < (int)noName←c8112)) { goto lab←L100015; }; lab←L100012: ; }; SOURCE(1189, 15) (* (hPt) to←v3188 ) = BCK(len←v4004, 32768); } static word ToRefText←P300(from←v3288) word from←v3288; { register ptr gf←c8560 = (ptr) &globalframe; word var←c3332; word len←v4092; word rt←v4120; /* ToRefText: */ SOURCE(1210, 317) SOURCE(1275, 53) { word tc16; if ((from←v3288 == 0)) { tc16 = (word) 0; } else { tc16 = (word) (* (hPt) from←v3288 ); }; len←v4092 = tc16; }; SOURCE(1330, 31) { word pd17; pd17 = (* (( (ptr) (* (( (ptr) gf←c8560)+23)/* var←c8176 */ ))+4) ); rt←v4120 = (word) ( *( (fPt) ((* (ptr) pd17 ))))(BCK(len←v4092, 32768), pd17); }; SOURCE(1363, 150) { word var←c8208; word var←c8272; { word text←v7584; text←v7584 = rt←v4120; var←c8208 = (text←v7584 + 4); }; { word p←v7536; p←v7536 = from←v3288; var←c8272 = (p←v7536 + 4); }; { word var←c8336; var←c8336 = BCK(len←v4092, 32768); (* (hPt) rt←v4120 ) = var←c8336; (void) Basics←CopyBytes(var←c8208, 0, var←c8272, 0, var←c8336); }; }; SOURCE(1515, 12) return(rt←v4120); } static word EqualSubStrings←P360(s1←v3404, s2←v3432, case←v3460) W3 s1←v3404; W3 s2←v3432; word case←v3460; { word ans←v3504; word i1←v4176; word i2←v4204; register word n←v4232; word b1←v4260; word b2←v4288; /* EqualSubStrings: */ SOURCE(1531, 430) SOURCE(1531, 430) ans←v3504 = 1; SOURCE(1671, 43) if ((s1←v3404.f2 != s2←v3432.f2)) { SOURCE(1701, 13) return(0); }; SOURCE(1716, 12) b1←v4260 = s1←v3404.f0; SOURCE(1730, 14) i1←v4176 = s1←v3404.f1; SOURCE(1746, 12) b2←v4288 = s2←v3432.f0; SOURCE(1760, 14) i2←v4204 = s2←v3432.f1; SOURCE(1776, 185) n←v4232 = s1←v3404.f2; lab←L100021: ; if ((n←v4232 > 0)) { } else { goto lab←L100018; }; { word c1←v4332; word c2←v4360; SOURCE(1816, 17) { word limit18; c1←v4332 = (word) (* ((( (bPt) b1←v4260)+4)+( limit18 = (word) (* (( (hPt) b1←v4260)+1) ), BCK(i1←v4176, limit18) )) ); }; SOURCE(1835, 17) { word limit19; c2←v4360 = (word) (* ((( (bPt) b2←v4288)+4)+( limit19 = (word) (* (( (hPt) b2←v4288)+1) ), BCK(i2←v4204, limit19) )) ); }; SOURCE(1854, 78) if ((c1←v4332 != c2←v4360)) { SOURCE(1870, 62) if ((0 != case←v3460) || ( ( ((c1←v4332 - 65) <= 25) ? (c1←v4332 + 32) : c1←v4332 ) != ( ((c2←v4360 - 65) <= 25) ? (c2←v4360 + 32) : c2←v4360 ) )) { SOURCE(1918, 14) return(0); }; }; SOURCE(1937, 11) i1←v4176 = (i1←v4176 + 1); SOURCE(1950, 11) i2←v4204 = (i2←v4204 + 1); }; n←v4232 = (n←v4232 - 1); goto lab←L100021; lab←L100018: ; SOURCE(1531, 430) return(ans←v3504); } static word SubStringToRope←P420(from←v3564) W3 from←v3564; { register ptr gf←c8592 = (ptr) &globalframe; word rt←v3608; word len←v4404; /* SubStringToRope: */ SOURCE(1976, 239) SOURCE(1976, 239) rt←v3608 = 0; SOURCE(2054, 58) len←v4404 = ( (from←v3564.f0 == 0) ? 0 : from←v3564.f2 ) ; SOURCE(2114, 17) { word pd20; pd20 = (* (( (ptr) (* (( (ptr) gf←c8592)+22)/* var←c7952 */ ))+34) ); rt←v3608 = (word) ( *( (fPt) ((* (ptr) pd20 ))))(BCK(len←v4404, 32768), pd20); }; SOURCE(2133, 15) ((P15x1h) rt←v3608)->f = BCK(len←v4404, 32768); SOURCE(2150, 65) { register word i←v4448 = 0; if ((i←v4448 >= len←v4404)) { goto lab←L100022; }; lab←L100025: ; SOURCE(2181, 34) { word var←c8368; var←c8368 = (from←v3564.f1 + i←v4448); { word limit21; word limit22; (* ((( (bPt) rt←v3608)+4)+( limit21 = (word) ( (((unsigned)(* (( (hPt) rt←v3608)+1) ) << 17) >> 17) ), BCK(i←v4448, limit21) )) ) = (word) (* ((( (bPt) from←v3564.f0)+4)+( limit22 = (word) (* (( (hPt) from←v3564.f0)+1) ), BCK(var←c8368, limit22) )) ); }; }; i←v4448 = (i←v4448 + 1); if ((i←v4448 < len←v4404)) { goto lab←L100025; }; lab←L100022: ; }; SOURCE(1976, 239) return(rt←v3608); } static word ToRope←P480(from←v3668) word from←v3668; { register ptr gf←c8624 = (ptr) &globalframe; word var←c3712; word len←v4492; word rt←v4520; /* ToRope: */ SOURCE(2230, 292) SOURCE(2288, 53) { word tc23; if ((from←v3668 == 0)) { tc23 = (word) 0; } else { tc23 = (word) (* (hPt) from←v3668 ); }; len←v4492 = tc23; }; SOURCE(2343, 23) { word pd24; pd24 = (* (( (ptr) (* (( (ptr) gf←c8624)+22)/* var←c7952 */ ))+34) ); rt←v4520 = (word) ( *( (fPt) ((* (ptr) pd24 ))))(BCK(len←v4492, 32768), pd24); }; SOURCE(2368, 140) { word var←c8400; { word p←v7488; p←v7488 = from←v3668; var←c8400 = (p←v7488 + 4); }; (void) Basics←CopyBytes((rt←v4520 + 4), 0, var←c8400, 0, len←v4492); }; SOURCE(2510, 12) return(rt←v4520); } /* file: ConvertUnsafeImpl, module: ConvertUnsafeImpl, compiled at: February 21, 1992 4:39:29 pm PST */ extern void XR←install←ConvertUnsafeImpl() { NoName←Q1212(); } extern void XR←run←ConvertUnsafeImpl() { XR←Start(&globalframe); }