From c593f7da31818bb87c8506db7adead13d987afdb Mon Sep 17 00:00:00 2001 From: MaddTheSane Date: Mon, 15 Jul 2013 18:20:02 -0600 Subject: [PATCH 001/390] Update .gitignore Ignore more files so we don't have git complaining. --- .gitignore | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.gitignore b/.gitignore index 378eac25..a1d04a0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,28 @@ build +**.o +src/apple.c +src/active.c +src/arrow_down_active.c +src/arrow_down_inactive.c +src/arrow_left_active.c +src/arrow_left_inactive.c +src/arrow_right_active.c +src/arrow_right_inactive.c +src/arrow_up_active.c +src/arrow_up_inactive.c +src/go_away.c +src/grow.c +src/parse.c +src/ractive.c +src/rawpatstubs.c +src/rawsrcstubs.c +src/seedtables.c +src/sspairtable.c +src/thumb_horiz.c +src/thumb_vert.c +src/ultable.c +src/zoom.c +src/config.status +src/config.log +src/config.h +src/.deps/ From 072f360b05a5ddb20628285ad36c60df6d1e2703 Mon Sep 17 00:00:00 2001 From: MaddTheSane Date: Mon, 15 Jul 2013 18:39:23 -0600 Subject: [PATCH 002/390] Update .gitignore Ignoring .DS_Store files generated by OS X --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index a1d04a0f..81f6b3dd 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ src/config.status src/config.log src/config.h src/.deps/ +**/.DS_Store +.DS_Store From 4e5d52adc7e875f6604b4d0ffeb3f3c53add6dfe Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sun, 3 Aug 2014 15:48:07 -0600 Subject: [PATCH 003/390] Port the code to C++ for one specific reason: namespaces. Begin work on porting to OS X from the old NeXTStep/OpenStep source files. --- .gitignore | 3 +- CocoaExecutor.xcodeproj/project.pbxproj | 3634 +++++++++++++++++ .../CocoaExecutor/CocoaExecutor-Info.plist | 34 + .../CocoaExecutor/CocoaExecutor-Prefix.pch | 11 + .../AppIcon.appiconset/Contents.json | 63 + .../AppIcon.appiconset/Executor 128.png | Bin 0 -> 3967 bytes .../AppIcon.appiconset/Executor 16.png | Bin 0 -> 3353 bytes .../AppIcon.appiconset/Executor 64.png | Bin 0 -> 5469 bytes .../Executor copy cop1y copy-1.png | Bin 0 -> 4375 bytes .../Executor copy cop1y copy.png | Bin 0 -> 4375 bytes .../Executor copy cop1y.png | Bin 0 -> 3529 bytes .../AppIcon.appiconset/Executor copy.png | Bin 0 -> 1070 bytes .../AppIcon.appiconset/Executor.png | Bin 0 -> 972 bytes .../NeXT Classes/Base.lproj/Executor.xib | 848 ++++ .../NeXT Classes/Base.lproj/info.xib | 169 + .../CocoaExecutor/NeXT Classes/Executor.tiff | Bin 0 -> 1302 bytes .../NeXT Classes/Executor_main.mm | 30 +- .../CocoaExecutor/NeXT Classes/MacAppClass.h | 41 + .../CocoaExecutor/NeXT Classes/MacAppClass.mm | 317 ++ .../NeXT Classes}/MacPrintClass.h | 6 +- .../NeXT Classes}/MacViewClass.h | 70 +- .../NeXT Classes/MacViewClass.mm | 2206 ++++++++++ .../CocoaExecutor/NeXT Classes/MacWinClass.h | 10 + .../CocoaExecutor/NeXT Classes}/MacWinClass.m | 9 +- .../CocoaExecutor/NeXT Classes/NEXT.mm | 332 +- .../NeXT Classes/NEXTkeyboard.cpp | 46 + .../CocoaExecutor/NeXT Classes/NEXTmain.mm | 173 +- .../CocoaExecutor/NeXT Classes/NEXTprint.mm | 70 + .../CocoaExecutor/NeXT Classes/SoundOSX.cpp | 112 + .../CocoaExecutor/NeXT Classes/SoundOSX.h | 42 + .../NeXT Classes/blockinterrupts.mm | 4 +- .../NeXT Classes}/contextswitch.h | 2 + .../NeXT Classes/en.lproj/Credits.rtf | 29 + .../NeXT Classes/en.lproj/Executor.strings | 438 ++ .../NeXT Classes/en.lproj/InfoPlist.strings | 2 + .../NeXT Classes/en.lproj/info.strings | 36 + .../NeXT Classes}/host_bltmacros.h | 0 .../NeXT Classes}/host_vdriver.h | 7 +- .../CocoaExecutor/NeXT Classes/nextstep.h | 3 + .../CocoaExecutor/NeXT Classes/ourstuff.h | 35 + OSX-only/CocoaExecutor/build-arch-config.h | 1 + OSX-only/CocoaExecutor/build-os-config.h | 1 + OSX-only/CocoaExecutor/config.h | 118 + OSX-only/CocoaExecutor/front-end-config.h | 13 + OSX-only/CocoaExecutor/host-arch-config.h | 22 + OSX-only/CocoaExecutor/host-os-config.h | 111 + OSX-only/CocoaExecutor/skel/README | 6 + .../skel/volume/Freeware/About Freeware | 1 + .../volume/Freeware/Desktop Textures Vol. I | 0 .../CocoaExecutor/skel/volume/Freeware/Risk! | 0 .../skel/volume/System Folder/Browser | 0 .../skel/volume/System Folder/ParamRAM | Bin 0 -> 20 bytes .../skel/volume/System Folder/Preferences/CVS | 1 + .../skel/volume/System Folder/Printer | 0 .../skel/volume/System Folder/System | 0 .../skel/volume/System Folder/godata.sav | 1 + .../skel/volume/System Folder/mac.rsrc | 0 .../skel/volume/System Folder/system.ard | 0 .../skel/volume/System Folder/windows.rsrc | 0 OSX-only/CocoaExecutor/sound-config.h | 13 + OSX-only/CocoaExecutor/trapinfo | 2708 ++++++++++++ OSX-only/CocoaExecutor/x86_64.cpp | 8 + .../CocoaExecutorTests-Info.plist | 22 + .../CocoaExecutorTests/CocoaExecutorTests.m | 34 + .../en.lproj/InfoPlist.strings | 2 + OSX-only/syn68k/Syn68k.c | 115 + OSX-only/syn68k/syn68k_public.h | 698 ++++ src/{AE.c => AE.cpp} | 38 +- src/{AE_coercion.c => AE_coercion.cpp} | 5 + src/{AE_desc.c => AE_desc.cpp} | 37 +- src/{AE_hdlr.c => AE_hdlr.cpp} | 12 +- src/CBridge.cpp | 64 + src/FileDouble-OSX.cpp | 11 + src/FileDouble-OSX.h | 20 + src/{PSprint.c => PSprint.mm} | 213 +- src/{PSstrings.c => PSstrings.cpp} | 20 +- src/{aboutbox.c => aboutbox.cpp} | 197 +- src/{adb.c => adb.cpp} | 22 +- src/{alias.c => alias.cpp} | 56 +- src/{appearance.c => appearance.cpp} | 38 +- src/{autorefresh.c => autorefresh.cpp} | 2 + src/{balloon.c => balloon.cpp} | 4 +- src/{bindec.c => bindec.cpp} | 55 +- src/{blockdev.c => blockdev.cpp} | 14 +- src/{cfm.c => cfm.cpp} | 2 + src/{check_structs.c => check_structs.cpp} | 116 +- src/{checkpoint.c => checkpoint.cpp} | 0 src/{cleanup.c => cleanup.cpp} | 0 src/color_wheel_bits.c | 13 - src/color_wheel_bits.cpp | 73 + src/{commtool.c => commtool.cpp} | 16 +- .../English.lproj.openstep/.dir3_0.wmd | 8 - .../Executor.nib/data.classes | 102 - .../Executor.nib/objects.nib | Bin 8891 -> 0 bytes .../Executor.project.nib/data.classes | 5 - .../Executor.project.nib/data.nib | Bin 1306 -> 0 bytes .../Help/Index.rtfd/1PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/213102_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/228564_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/233683_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/249151_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Help/Index.rtfd/257522_PixelRule.tiff | Bin 3848 -> 0 bytes .../Index.rtfd/258566_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/281899_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/285316_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/32130_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/396344_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/419343_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/421483_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/506328_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/556892_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/55774_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/565289_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/70598_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/730050_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/790199_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/854927_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/86115_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/867553_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/913680_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/91917_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/922556_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/956766_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Help/Index.rtfd/TXT.rtf | 582 --- .../Help/TableOfContents.rtf | 58 - .../Info.nib/data.classes | 11 - .../English.lproj.openstep/Info.nib/data.nib | Bin 2167 -> 0 bytes .../Executor/English.lproj/.dir3_0.wmd | 8 - .../English.lproj/Executor.nib/data.classes | 98 - .../English.lproj/Executor.nib/data.nib | Bin 7011 -> 0 bytes .../Executor.project.nib/data.classes | 5 - .../Executor.project.nib/data.nib | Bin 1306 -> 0 bytes .../Help/Index.rtfd/1PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/213102_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/228564_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/233683_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/249151_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Help/Index.rtfd/257522_PixelRule.tiff | Bin 3848 -> 0 bytes .../Index.rtfd/258566_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/281899_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/285316_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/32130_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/396344_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/419343_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/421483_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/506328_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/556892_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/55774_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/565289_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/70598_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/730050_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/790199_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/854927_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/86115_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/867553_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/913680_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/91917_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/922556_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../Index.rtfd/956766_PixelRule_Index.tiff | Bin 1340 -> 0 bytes .../English.lproj/Help/Index.rtfd/TXT.rtf | 582 --- .../English.lproj/Help/TableOfContents.rtf | 58 - .../English.lproj/Info.nib/data.classes | 11 - .../Executor/English.lproj/Info.nib/data.nib | Bin 2167 -> 0 bytes .../nextstep/Executor/Executor.iconheader | 5 - .../nextstep/Executor/Makefile.nextstep | 49 - .../nextstep/Executor/Makefile.openstep | 54 - .../nextstep/Executor/Makefile.postamble | 106 - .../nextstep/Executor/Makefile.preamble | 90 - .../front-ends/nextstep/Executor/PB.gdbinit | 7 - .../front-ends/nextstep/Executor/PB.project | 26 - .../nextstep/Executor/PB.project.openstep | 36 - src/config/front-ends/nextstep/MacAppClass.h | 56 - src/config/front-ends/nextstep/MacAppClass.m | 616 --- src/config/front-ends/nextstep/MacViewClass.m | 2903 ------------- src/config/front-ends/nextstep/MacWinClass.h | 24 - src/config/front-ends/nextstep/NEXTkeyboard.m | 42 - src/config/front-ends/nextstep/NEXTprint.m | 143 - src/config/front-ends/nextstep/NEXTsound.m | 41 - .../front-ends/nextstep/OldMacViewClass.m | 2907 ------------- src/config/front-ends/nextstep/nextstep.h | 3 - .../nextstep/nextstep.make.nextstep | 42 - .../nextstep/nextstep.make.openstep | 44 - src/config/front-ends/nextstep/ourstuff.h | 41 - src/{crc.c => crc.cpp} | 5 +- src/{ctlArrows.c => ctlArrows.cpp} | 30 +- src/{ctlDisplay.c => ctlDisplay.cpp} | 2 + src/{ctlIMIV.c => ctlIMIV.cpp} | 2 + src/{ctlInit.c => ctlInit.cpp} | 4 +- src/{ctlMisc.c => ctlMisc.cpp} | 23 +- src/{ctlMouse.c => ctlMouse.cpp} | 9 +- src/{ctlPopup.c => ctlPopup.cpp} | 7 +- src/{ctlSet.c => ctlSet.cpp} | 2 + src/{ctlSize.c => ctlSize.cpp} | 2 + src/{ctlStddef.c => ctlStddef.cpp} | 1 + src/{custom.c => custom.cpp} | 45 +- src/{dcache.c => dcache.cpp} | 15 +- src/{dcconvert.c => dcconvert.cpp} | 3 + src/{dcmaketables.c => dcmaketables.cpp} | 37 +- src/default_ctab_values.c | 305 -- src/default_ctab_values.cpp | 310 ++ src/{desk.c => desk.cpp} | 2 + src/{desperate.c => desperate.cpp} | 7 +- src/{device.c => device.cpp} | 262 +- src/{dialAlert.c => dialAlert.cpp} | 11 +- src/{dialCreate.c => dialCreate.cpp} | 6 +- src/{dialDispatch.c => dialDispatch.cpp} | 4 +- src/{dialHandle.c => dialHandle.cpp} | 21 +- src/{dialInit.c => dialInit.cpp} | 16 +- src/{dialItem.c => dialItem.cpp} | 8 +- src/{dialManip.c => dialManip.cpp} | 32 +- src/{dirtyrect.c => dirtyrect.cpp} | 9 +- src/{disk.c => disk.cpp} | 2 + src/{diskinit.c => diskinit.cpp} | 13 +- src/{dump.c => dump.cpp} | 156 +- src/{edition.c => edition.cpp} | 2 + src/{emustubs.c => emustubs.cpp} | 30 +- src/{emutrap.c => emutrap.cpp} | 6 +- src/emutraptables.c | 1746 -------- src/emutraptables.cpp | 1752 ++++++++ src/{error.c => error.cpp} | 9 +- src/{executor.c => executor.cpp} | 28 +- src/{fileAccess.c => fileAccess.cpp} | 77 +- src/{fileCreate.c => fileCreate.cpp} | 7 + src/{fileDirs.c => fileDirs.cpp} | 4 +- src/{fileDouble.c => fileDouble.cpp} | 43 +- src/{fileHighlevel.c => fileHighlevel.cpp} | 8 +- src/{fileInfo.c => fileInfo.cpp} | 9 +- src/{fileMisc.c => fileMisc.cpp} | 137 +- src/{fileVolumes.c => fileVolumes.cpp} | 53 +- src/{finder.c => finder.cpp} | 34 +- src/{float4.c => float4.cpp} | 8 +- src/{float5.c => float5.cpp} | 4 +- src/{float7.c => float7.cpp} | 2 + src/{floatnext.c => floatnext.cpp} | 5 +- src/{font.c => font.cpp} | 24 +- src/{fontIMVI.c => fontIMVI.cpp} | 2 + src/{genfndecls.c => genfndecls.cpp} | 22 +- src/{gensplash.c => gensplash.cpp} | 2 + src/{gestalt.c => gestalt.cpp} | 21 +- src/globals.cpp | 328 ++ src/{hfsBtree.c => hfsBtree.cpp} | 143 +- src/{hfsChanging.c => hfsChanging.cpp} | 37 +- src/{hfsCreate.c => hfsCreate.cpp} | 26 +- src/{hfsFile.c => hfsFile.cpp} | 80 +- src/{hfsHelper.c => hfsHelper.cpp} | 232 +- src/{hfsHier.c => hfsHier.cpp} | 16 +- src/{hfsMisc.c => hfsMisc.cpp} | 2 + src/{hfsVolume.c => hfsVolume.cpp} | 77 +- src/{hfsWorkingdir.c => hfsWorkingdir.cpp} | 18 +- src/{hfsXbar.c => hfsXbar.cpp} | 11 +- src/hintemplate.h | 2 +- src/{hle.c => hle.cpp} | 19 +- src/{ibm_keycodes.c => ibm_keycodes.cpp} | 6 +- src/{icon.c => icon.cpp} | 2 + src/{image.c => image.cpp} | 10 +- src/{image_inits.c => image_inits.cpp} | 5 +- src/include/ADB.h | 2 + src/include/AliasMgr.h | 60 +- src/include/AppleEvents.h | 3 +- src/include/AppleTalk.h | 2 +- src/include/BinaryDecimal.h | 13 +- src/include/CQuickDraw.h | 11 +- src/include/CommTool.h | 3 +- src/include/Components.h | 3 +- src/include/ControlMgr.h | 5 +- src/include/DeskMgr.h | 16 +- src/include/DeviceMgr.h | 2 + src/include/DialogMgr.h | 2 + src/include/Disk.h | 2 + src/include/DiskInit.h | 3 +- src/include/EditionMgr.h | 3 + src/include/EventMgr.h | 2 + src/include/FileMgr.h | 92 +- src/include/Finder.h | 3 +- src/include/FontMgr.h | 4 +- src/include/Gestalt.h | 3 +- src/include/HelpMgr.h | 2 + src/include/Iconutil.h | 3 + src/include/IntlUtil.h | 3 +- src/include/ListMgr.h | 2 + src/include/MacTypes.h | 33 +- src/include/MemoryMgr.h | 6 +- src/include/MenuMgr.h | 2 + src/include/NotifyMgr.h | 3 +- src/include/OSEvent.h | 2 + src/include/OSUtil.h | 8 +- src/include/PPC.h | 3 + src/include/Package.h | 3 +- src/include/PrintMgr.h | 2 + src/include/ProcessMgr.h | 3 +- src/include/QuickDraw.h | 50 +- src/include/QuickTime.h | 2 + src/include/ResourceMgr.h | 11 +- src/include/SANE.h | 3 +- src/include/ScrapMgr.h | 16 +- src/include/ScriptMgr.h | 2 + src/include/SegmentLdr.h | 17 +- src/include/Serial.h | 2 + src/include/ShutDown.h | 3 +- src/include/SoundDvr.h | 3 +- src/include/SoundMgr.h | 2 + src/include/StartMgr.h | 2 + src/include/StdFilePkg.h | 3 +- src/include/SysErr.h | 2 + src/include/TextEdit.h | 7 +- src/include/ThinkC.h | 3 +- src/include/TimeMgr.h | 3 +- src/include/ToolboxEvent.h | 3 +- src/include/ToolboxUtil.h | 2 + src/include/VDriver.h | 3 +- src/include/VRetraceMgr.h | 4 +- src/include/WindowMgr.h | 56 +- src/include/paramline.h | 8 + src/include/rsys/CFriendly.h | 28 + src/include/rsys/Info.plist | 28 + src/include/rsys/PSstrings.h | 4 +- src/include/rsys/Xdefs.h | 37 - src/include/rsys/aboutbox.h | 3 +- src/include/rsys/aboutpanel.h | 4 +- src/include/rsys/adb.h | 5 +- src/include/rsys/alias.h | 3 +- src/include/rsys/appearance.h | 7 +- src/include/rsys/apple_events.h | 4 +- src/include/rsys/arch.h | 3 +- src/include/rsys/autorefresh.h | 3 +- src/include/rsys/blockdev.h | 4 +- src/include/rsys/blockinterrupts.h | 15 +- src/include/rsys/byteswap.h | 16 +- src/include/rsys/cfm.h | 2 + src/include/rsys/check_structs.h | 3 +- src/include/rsys/checkpoint.h | 4 +- src/include/rsys/color_wheel_bits.h | 7 +- src/include/rsys/common.h | 9 +- src/include/rsys/commonevt.h | 3 +- src/include/rsys/cquick.h | 4 +- src/include/rsys/crc.h | 3 +- src/include/rsys/ctl.h | 2 + src/include/rsys/custom.h | 7 + src/include/rsys/dcache.h | 12 +- src/include/rsys/depthconv.h | 4 +- src/include/rsys/desk.h | 6 +- src/include/rsys/desperate.h | 4 +- src/include/rsys/dial.h | 4 +- src/include/rsys/dirtyrect.h | 3 +- src/include/rsys/drive_flags.h | 3 +- src/include/rsys/dump.h | 3 +- src/include/rsys/emustubs.h | 4 +- src/include/rsys/error.h | 11 +- src/include/rsys/evil.h | 4 +- src/include/rsys/executor.h | 4 +- src/include/rsys/file.h | 6 +- src/include/rsys/filedouble.h | 4 +- src/include/rsys/flags.h | 2 + src/include/rsys/float.h | 3 +- src/include/rsys/float_fcw.h | 4 +- src/include/rsys/floatconv.h | 4 +- src/include/rsys/font.h | 2 + src/include/rsys/gestalt.h | 3 +- src/include/rsys/glue.h | 3 +- src/include/rsys/gworld.h | 4 +- src/include/rsys/hfs.h | 8 +- src/include/rsys/hfs_plus.h | 4 +- src/include/rsys/hook.h | 4 +- src/include/rsys/host.h | 8 +- src/include/rsys/icon.h | 4 +- src/include/rsys/image.h | 5 +- src/include/rsys/ini.h | 4 +- src/include/rsys/interfacelib.h | 4 +- src/include/rsys/itm.h | 4 +- src/include/rsys/iv.h | 4 +- src/include/rsys/jumpvectors.h | 4 +- src/include/rsys/keyboard.h | 4 +- src/include/rsys/keyboards.h | 7 +- src/include/rsys/keycode.h | 5 +- src/include/rsys/launch.h | 4 +- src/include/rsys/libcproto.h | 4 +- src/include/rsys/licensetext.h | 4 +- src/include/rsys/list.h | 12 +- src/include/rsys/local_charset.h | 2 + src/include/rsys/lockunlock.h | 3 +- src/include/rsys/lowglobals.h | 7 + src/include/rsys/mactype.h | 8 + src/include/rsys/mathlib.h | 3 +- src/include/rsys/menu.h | 11 +- src/include/rsys/mixed_mode.h | 4 +- src/include/rsys/mman.h | 9 +- src/include/rsys/mman_private.h | 6 +- src/include/rsys/new_mmanstubs.h | 4 +- src/include/rsys/newvga.h | 4 +- src/include/rsys/nextprint.h | 4 +- src/include/rsys/notmac.h | 10 +- src/include/rsys/option.h | 12 +- src/include/rsys/options.h | 8 +- src/include/rsys/os.h | 3 +- src/include/rsys/osevent.h | 4 +- src/include/rsys/osutil.h | 22 +- src/include/rsys/parse.h | 4 +- src/include/rsys/parsenum.h | 3 +- src/include/rsys/parseopt.h | 6 +- src/include/rsys/partition.h | 2 + src/include/rsys/pef.h | 4 +- src/include/rsys/picture.h | 2 + src/include/rsys/prefs.h | 17 +- src/include/rsys/print.h | 19 +- src/include/rsys/process.h | 4 +- src/include/rsys/pstuff.h | 3 +- src/include/rsys/qcolor.h | 4 +- src/include/rsys/quick.h | 2 + src/include/rsys/redrawscreen.h | 2 + src/include/rsys/refresh.h | 8 +- src/include/rsys/release.h | 2 +- src/include/rsys/resource.h | 15 +- src/include/rsys/rgbutil.h | 3 +- src/include/rsys/safe_alloca.h | 2 +- src/include/rsys/scrap.h | 2 + src/include/rsys/segment.h | 13 +- src/include/rsys/serial.h | 3 +- src/include/rsys/slash.h | 8 + src/include/rsys/sounddriver.h | 45 +- src/include/rsys/soundfake.h | 34 +- src/include/rsys/soundopts.h | 18 +- src/include/rsys/srcblt.h | 12 +- src/include/rsys/stdbits.h | 4 +- src/include/rsys/stdfile.h | 11 +- src/include/rsys/stdio_smashage.h | 3 +- src/include/rsys/string.h | 9 +- src/include/rsys/stub.c | 15 + src/include/rsys/stubify.h | 17 + src/include/rsys/syncint.h | 26 +- src/include/rsys/syserr.h | 4 +- src/include/rsys/system_error.h | 2 + src/include/rsys/tempalloc.h | 2 +- src/include/rsys/tesave.h | 18 +- src/include/rsys/text.h | 2 + src/include/rsys/time.h | 2 + src/include/rsys/toolevent.h | 5 +- src/include/rsys/toolutil.h | 2 + src/include/rsys/trapdecl.h | 61 +- src/include/rsys/trapglue.h | 7 +- src/include/rsys/types.h | 16 +- src/include/rsys/uniquefile.h | 4 +- src/include/rsys/vbl.h | 2 + src/include/rsys/vdriver.h | 10 +- src/include/rsys/version.h | 10 +- src/include/rsys/vgavdriver.h | 3 + src/include/rsys/wind.h | 4 +- src/include/rsys/x.h | 2 + src/include/rsys/xdata.h | 4 +- src/include/rsys/xdblt.h | 14 +- src/{ini.c => ini.cpp} | 194 +- src/{interfacelib.c => interfacelib.cpp} | 2 + src/{iu.c => iu.cpp} | 44 +- src/{iv-stubs.c => iv-stubs.cpp} | 8 +- src/{keycode.c => keycode.mm} | 44 +- src/{launch.c => launch.cpp} | 52 +- src/licensetext.c | 247 -- src/{listAccess.c => listAccess.cpp} | 8 +- src/{listAddDel.c => listAddDel.cpp} | 2 + src/{listCreate.c => listCreate.cpp} | 2 + src/{listDisplay.c => listDisplay.cpp} | 6 +- src/{listMouse.c => listMouse.cpp} | 26 +- src/{listOps.c => listOps.cpp} | 6 + src/{listStdLDEF.c => listStdLDEF.cpp} | 5 + src/{local_charset.c => local_charset.cpp} | 4 +- src/{lockrange.c => lockrange.cpp} | 18 +- src/{main.c => main.cpp} | 86 +- src/map_to_c/map_to_c.1 | 79 + src/{map_to_c.c => map_to_c/map_to_c.cpp} | 95 +- src/{mathlib.c => mathlib.cpp} | 2 + src/{menu.c => menu.cpp} | 64 +- src/{menuColor.c => menuColor.cpp} | 12 +- src/{menuV.c => menuV.cpp} | 2 + src/{mixed_mode.c => mixed_mode.cpp} | 2 + src/{ => mkexpandtables}/mkexpandtables.c | 0 src/{ => mkseedtables}/mkseedtables.c | 2 +- src/{ => mksspairtable}/mksspairtable.c | 2 +- src/{ => mkultable}/mkultable.c | 2 +- src/mkvol/{mkvol.c => mkvol.cpp} | 172 +- src/mkvol/mkvol.h | 2 +- src/mkvol/mkvol_internal.h | 254 +- src/{mman.c => mman.cpp} | 144 +- src/{mmansubr.c => mmansubr.cpp} | 66 +- src/{notify.c => notify.cpp} | 2 + src/{option.c => option.mm} | 159 +- src/{osevent.c => osevent.cpp} | 64 +- src/ostrap.awk | 1 - src/osutil.c.NEW | 981 ----- src/{osutil.c => osutil.cpp} | 24 +- src/{pack.c => pack.cpp} | 2 + src/parse.y | 18 +- src/{parsenum.c => parsenum.cpp} | 7 +- src/{parseopt.c => parseopt.cpp} | 11 +- src/{pef_hash.c => pef_hash.cpp} | 10 +- src/{prError.c => prError.cpp} | 2 + src/{prInit.c => prInit.cpp} | 5 +- src/{prLowLevel.c => prLowLevel.cpp} | 62 +- src/{prPrinting.c => prPrinting.cpp} | 168 +- src/{prRecords.c => prRecords.cpp} | 4 +- src/{priv.c => priv.cpp} | 3 +- src/{process.c => process.cpp} | 11 +- src/{qBit.c => qBit.cpp} | 2 + src/{qCConv.c => qCConv.cpp} | 3 + src/{qCGrafPort.c => qCGrafPort.cpp} | 6 +- src/{qCRegular.c => qCRegular.cpp} | 2 + src/{qColor.c => qColor.cpp} | 32 +- src/{qColorMgr.c => qColorMgr.cpp} | 6 +- src/{qColorPicker.c => qColorPicker.cpp} | 26 +- src/{qColorutil.c => qColorutil.cpp} | 18 +- src/{qCursor.c => qCursor.cpp} | 16 +- src/{qGDevice.c => qGDevice.cpp} | 83 +- src/{qGWorld.c => qGWorld.cpp} | 16 +- src/{qGrafport.c => qGrafport.cpp} | 10 +- src/{qHooks.c => qHooks.cpp} | 54 +- src/{qIMIV.c => qIMIV.cpp} | 19 +- src/{qIMV.c => qIMV.cpp} | 24 +- src/{qIMVI.c => qIMVI.cpp} | 6 +- src/{qIMVxfer.c => qIMVxfer.cpp} | 20 +- src/{qMisc.c => qMisc.cpp} | 7 + src/{qPaletteMgr.c => qPaletteMgr.cpp} | 18 +- src/{qPen.c => qPen.cpp} | 6 +- src/{qPicstuff.c => qPicstuff.cpp} | 102 +- src/{qPict2.c => qPict2.cpp} | 2 + src/{qPicture.c => qPicture.cpp} | 16 +- src/{qPixMapConv.c => qPixMapConv.cpp} | 26 +- src/{qPoint.c => qPoint.cpp} | 2 + src/{qPoly.c => qPoly.cpp} | 4 +- src/{qRect.c => qRect.cpp} | 2 + src/{qRegion.c => qRegion.cpp} | 47 +- src/{qRegular.c => qRegular.cpp} | 2 + src/{qScale.c => qScale.cpp} | 46 +- src/qStandard.c | 37 - src/qStandard.cpp | 39 + src/{qStdArc.c => qStdArc.cpp} | 7 + src/{qStdBits.c => qStdBits.cpp} | 83 +- src/{qStdLine.c => qStdLine.cpp} | 388 +- src/{qStdOval.c => qStdOval.cpp} | 2 + src/{qStdPic.c => qStdPic.cpp} | 2 + src/{qStdPoly.c => qStdPoly.cpp} | 6 + src/{qStdRRect.c => qStdRRect.cpp} | 2 + src/{qStdRect.c => qStdRect.cpp} | 2 + src/{qStdRgn.c => qStdRgn.cpp} | 22 +- src/{qStdText.c => qStdText.cpp} | 21 +- src/{qText.c => qText.cpp} | 4 +- src/{qt.c => qt.cpp} | 2 + src/{rawpatblt.c => rawpatblt.cpp} | 6 +- src/{rawsrcblt.c => rawsrcblt.cpp} | 7 +- src/{redrawscreen.c => redrawscreen.cpp} | 4 +- src/{refresh.c => refresh.cpp} | 15 +- src/{resGet.c => resGet.cpp} | 11 +- src/{resGetinfo.c => resGetinfo.cpp} | 2 + src/{resGettype.c => resGettype.cpp} | 15 +- src/{resIMIV.c => resIMIV.cpp} | 2 + src/{resInit.c => resInit.cpp} | 2 + src/{resMisc.c => resMisc.cpp} | 2 + src/{resMod.c => resMod.cpp} | 24 +- src/{resOpen.c => resOpen.cpp} | 29 +- src/{resPartial.c => resPartial.cpp} | 2 + src/{resSetcur.c => resSetcur.cpp} | 2 + src/{rgbutil.c => rgbutil.cpp} | 4 +- src/{romlib_stubs.c => romlib_stubs.cpp} | 8 + src/{scrap.c => scrap.cpp} | 10 +- src/{screen-dump.c => screen-dump.cpp} | 8 +- src/{script.c => script.cpp} | 9 +- src/{segment.c => segment.cpp} | 98 +- src/{serial.c => serial.cpp} | 119 +- src/{setuid.c => setuid.cpp} | 6 +- src/{shutdown.c => shutdown.cpp} | 2 + ...{sigio_multiplex.c => sigio_multiplex.cpp} | 7 +- src/{slash.c => slash.cpp} | 4 +- src/{snth5.c => snth5.cpp} | 6 +- src/{sound.c => sound.cpp} | 33 +- src/{soundIMVI.c => soundIMVI.cpp} | 11 +- src/sounddriver.c | 52 - src/sounddriver.cpp | 56 + src/soundfake.c | 185 - src/soundfake.cpp | 151 + src/{splash.c => splash.cpp} | 0 src/{srcblt.c => srcblt.cpp} | 4 + src/stdfile-OSX.cpp | 17 + src/stdfile-OSX.h | 18 + src/{stdfile.c => stdfile.cpp} | 174 +- src/stdmbdf.c | 653 --- src/stdmbdf.cpp | 668 +++ src/{stdmdef.c => stdmdef.cpp} | 40 +- src/{string.c => string.cpp} | 22 +- src/suffix_maps.cpp | 250 ++ src/syncint.c | 633 --- src/syncint.cpp | 106 + src/{syserr.c => syserr.cpp} | 12 + src/{system_error.c => system_error.cpp} | 11 +- src/{teAccess.c => teAccess.cpp} | 2 + src/{teDisplay.c => teDisplay.cpp} | 1 + src/{teEdit.c => teEdit.cpp} | 19 +- src/{teIMIV.c => teIMIV.cpp} | 2 + src/{teIMV.c => teIMV.cpp} | 22 +- src/{teInit.c => teInit.cpp} | 2 + src/{teInsert.c => teInsert.cpp} | 24 +- src/{teMisc.c => teMisc.cpp} | 14 +- src/{teScrap.c => teScrap.cpp} | 2 + src/{tempmem.c => tempmem.cpp} | 2 + src/{think.c => think.cpp} | 11 +- src/{time.c => time.cpp} | 9 +- src/{toolevent.c => toolevent.cpp} | 64 +- src/{toolmath.c => toolmath.cpp} | 2 + src/{toolutil.c => toolutil.cpp} | 42 +- src/{trapname.c => trapname.cpp} | 2 + src/{uniquefile.c => uniquefile.cpp} | 25 +- src/{unix_like.c => unix_like.cpp} | 30 +- src/{vbl.c => vbl.cpp} | 3 +- src/{version.c => version.cpp} | 2 + src/{vgavdriver.c => vgavdriver.cpp} | 1 + src/{virtualint.c => virtualint.cpp} | 17 +- src/{windColor.c => windColor.cpp} | 20 +- src/{windDisplay.c => windDisplay.cpp} | 2 + src/{windDocdef.c => windDocdef.cpp} | 21 +- src/{windInit.c => windInit.cpp} | 18 +- src/{windMisc.c => windMisc.cpp} | 10 +- src/{windMouse.c => windMouse.cpp} | 8 + src/{windSize.c => windSize.cpp} | 2 + src/{windUpdate.c => windUpdate.cpp} | 4 +- src/{xdata.c => xdata.cpp} | 12 +- src/{xdblt.c => xdblt.cpp} | 15 +- 622 files changed, 20849 insertions(+), 17871 deletions(-) create mode 100644 CocoaExecutor.xcodeproj/project.pbxproj create mode 100644 OSX-only/CocoaExecutor/CocoaExecutor-Info.plist create mode 100644 OSX-only/CocoaExecutor/CocoaExecutor-Prefix.pch create mode 100644 OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor 128.png create mode 100644 OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor 16.png create mode 100644 OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor 64.png create mode 100644 OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor copy cop1y copy-1.png create mode 100644 OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor copy cop1y copy.png create mode 100644 OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor copy cop1y.png create mode 100644 OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor copy.png create mode 100644 OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor.png create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/Base.lproj/Executor.xib create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/Base.lproj/info.xib create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/Executor.tiff rename src/config/front-ends/nextstep/Executor/Executor_main.m => OSX-only/CocoaExecutor/NeXT Classes/Executor_main.mm (68%) create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/MacAppClass.h create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/MacAppClass.mm rename {src/config/front-ends/nextstep => OSX-only/CocoaExecutor/NeXT Classes}/MacPrintClass.h (78%) rename {src/config/front-ends/nextstep => OSX-only/CocoaExecutor/NeXT Classes}/MacViewClass.h (84%) create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.mm create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.h rename {src/config/front-ends/nextstep => OSX-only/CocoaExecutor/NeXT Classes}/MacWinClass.m (57%) rename src/config/front-ends/nextstep/NEXT.c => OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm (67%) create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/NEXTkeyboard.cpp rename src/config/front-ends/nextstep/NEXTmain.m => OSX-only/CocoaExecutor/NeXT Classes/NEXTmain.mm (67%) create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/NEXTprint.mm create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.cpp create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h rename src/config/front-ends/nextstep/blockinterrupts.m => OSX-only/CocoaExecutor/NeXT Classes/blockinterrupts.mm (97%) rename {src/config/front-ends/nextstep => OSX-only/CocoaExecutor/NeXT Classes}/contextswitch.h (90%) create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/en.lproj/Credits.rtf create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/en.lproj/Executor.strings create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/en.lproj/InfoPlist.strings create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/en.lproj/info.strings rename {src/config/front-ends/nextstep => OSX-only/CocoaExecutor/NeXT Classes}/host_bltmacros.h (100%) rename {src/config/front-ends/nextstep => OSX-only/CocoaExecutor/NeXT Classes}/host_vdriver.h (80%) create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/nextstep.h create mode 100644 OSX-only/CocoaExecutor/NeXT Classes/ourstuff.h create mode 120000 OSX-only/CocoaExecutor/build-arch-config.h create mode 120000 OSX-only/CocoaExecutor/build-os-config.h create mode 100644 OSX-only/CocoaExecutor/config.h create mode 100644 OSX-only/CocoaExecutor/front-end-config.h create mode 100644 OSX-only/CocoaExecutor/host-arch-config.h create mode 100644 OSX-only/CocoaExecutor/host-os-config.h create mode 100644 OSX-only/CocoaExecutor/skel/README create mode 100644 OSX-only/CocoaExecutor/skel/volume/Freeware/About Freeware create mode 100644 OSX-only/CocoaExecutor/skel/volume/Freeware/Desktop Textures Vol. I create mode 100644 OSX-only/CocoaExecutor/skel/volume/Freeware/Risk! create mode 100644 OSX-only/CocoaExecutor/skel/volume/System Folder/Browser create mode 100644 OSX-only/CocoaExecutor/skel/volume/System Folder/ParamRAM create mode 100644 OSX-only/CocoaExecutor/skel/volume/System Folder/Preferences/CVS create mode 100644 OSX-only/CocoaExecutor/skel/volume/System Folder/Printer create mode 100644 OSX-only/CocoaExecutor/skel/volume/System Folder/System create mode 100644 OSX-only/CocoaExecutor/skel/volume/System Folder/godata.sav create mode 100644 OSX-only/CocoaExecutor/skel/volume/System Folder/mac.rsrc create mode 100644 OSX-only/CocoaExecutor/skel/volume/System Folder/system.ard create mode 100644 OSX-only/CocoaExecutor/skel/volume/System Folder/windows.rsrc create mode 100644 OSX-only/CocoaExecutor/sound-config.h create mode 100644 OSX-only/CocoaExecutor/trapinfo create mode 100644 OSX-only/CocoaExecutor/x86_64.cpp create mode 100644 OSX-only/CocoaExecutorTests/CocoaExecutorTests-Info.plist create mode 100644 OSX-only/CocoaExecutorTests/CocoaExecutorTests.m create mode 100644 OSX-only/CocoaExecutorTests/en.lproj/InfoPlist.strings create mode 100644 OSX-only/syn68k/Syn68k.c create mode 100644 OSX-only/syn68k/syn68k_public.h rename src/{AE.c => AE.cpp} (92%) rename src/{AE_coercion.c => AE_coercion.cpp} (83%) rename src/{AE_desc.c => AE_desc.cpp} (96%) rename src/{AE_hdlr.c => AE_hdlr.cpp} (98%) create mode 100644 src/CBridge.cpp create mode 100644 src/FileDouble-OSX.cpp create mode 100644 src/FileDouble-OSX.h rename src/{PSprint.c => PSprint.mm} (92%) rename src/{PSstrings.c => PSstrings.cpp} (95%) rename src/{aboutbox.c => aboutbox.cpp} (86%) rename src/{adb.c => adb.cpp} (92%) rename src/{alias.c => alias.cpp} (97%) rename src/{appearance.c => appearance.cpp} (90%) rename src/{autorefresh.c => autorefresh.cpp} (99%) rename src/{balloon.c => balloon.cpp} (98%) rename src/{bindec.c => bindec.cpp} (56%) rename src/{blockdev.c => blockdev.cpp} (93%) rename src/{cfm.c => cfm.cpp} (99%) rename src/{check_structs.c => check_structs.cpp} (92%) rename src/{checkpoint.c => checkpoint.cpp} (100%) rename src/{cleanup.c => cleanup.cpp} (100%) delete mode 100644 src/color_wheel_bits.c create mode 100644 src/color_wheel_bits.cpp rename src/{commtool.c => commtool.cpp} (91%) delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/.dir3_0.wmd delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Executor.nib/data.classes delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Executor.nib/objects.nib delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Executor.project.nib/data.classes delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Executor.project.nib/data.nib delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/1PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/213102_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/228564_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/233683_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/249151_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/257522_PixelRule.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/258566_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/281899_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/285316_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/32130_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/396344_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/419343_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/421483_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/506328_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/556892_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/55774_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/565289_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/70598_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/730050_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/790199_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/854927_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/86115_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/867553_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/913680_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/91917_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/922556_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/956766_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/TXT.rtf delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/TableOfContents.rtf delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Info.nib/data.classes delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj.openstep/Info.nib/data.nib delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/.dir3_0.wmd delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Executor.nib/data.classes delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Executor.nib/data.nib delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Executor.project.nib/data.classes delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Executor.project.nib/data.nib delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/1PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/213102_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/228564_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/233683_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/249151_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/257522_PixelRule.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/258566_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/281899_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/285316_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/32130_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/396344_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/419343_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/421483_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/506328_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/556892_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/55774_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/565289_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/70598_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/730050_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/790199_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/854927_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/86115_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/867553_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/913680_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/91917_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/922556_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/956766_PixelRule_Index.tiff delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/TXT.rtf delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Help/TableOfContents.rtf delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Info.nib/data.classes delete mode 100644 src/config/front-ends/nextstep/Executor/English.lproj/Info.nib/data.nib delete mode 100644 src/config/front-ends/nextstep/Executor/Executor.iconheader delete mode 100644 src/config/front-ends/nextstep/Executor/Makefile.nextstep delete mode 100644 src/config/front-ends/nextstep/Executor/Makefile.openstep delete mode 100644 src/config/front-ends/nextstep/Executor/Makefile.postamble delete mode 100644 src/config/front-ends/nextstep/Executor/Makefile.preamble delete mode 100644 src/config/front-ends/nextstep/Executor/PB.gdbinit delete mode 100644 src/config/front-ends/nextstep/Executor/PB.project delete mode 100644 src/config/front-ends/nextstep/Executor/PB.project.openstep delete mode 100644 src/config/front-ends/nextstep/MacAppClass.h delete mode 100644 src/config/front-ends/nextstep/MacAppClass.m delete mode 100644 src/config/front-ends/nextstep/MacViewClass.m delete mode 100644 src/config/front-ends/nextstep/MacWinClass.h delete mode 100644 src/config/front-ends/nextstep/NEXTkeyboard.m delete mode 100644 src/config/front-ends/nextstep/NEXTprint.m delete mode 100644 src/config/front-ends/nextstep/NEXTsound.m delete mode 100644 src/config/front-ends/nextstep/OldMacViewClass.m delete mode 100644 src/config/front-ends/nextstep/nextstep.h delete mode 100644 src/config/front-ends/nextstep/nextstep.make.nextstep delete mode 100644 src/config/front-ends/nextstep/nextstep.make.openstep delete mode 100644 src/config/front-ends/nextstep/ourstuff.h rename src/{crc.c => crc.cpp} (90%) rename src/{ctlArrows.c => ctlArrows.cpp} (98%) rename src/{ctlDisplay.c => ctlDisplay.cpp} (99%) rename src/{ctlIMIV.c => ctlIMIV.cpp} (96%) rename src/{ctlInit.c => ctlInit.cpp} (98%) rename src/{ctlMisc.c => ctlMisc.cpp} (87%) rename src/{ctlMouse.c => ctlMouse.cpp} (97%) rename src/{ctlPopup.c => ctlPopup.cpp} (99%) rename src/{ctlSet.c => ctlSet.cpp} (98%) rename src/{ctlSize.c => ctlSize.cpp} (98%) rename src/{ctlStddef.c => ctlStddef.cpp} (99%) rename src/{custom.c => custom.cpp} (62%) rename src/{dcache.c => dcache.cpp} (96%) rename src/{dcconvert.c => dcconvert.cpp} (99%) rename src/{dcmaketables.c => dcmaketables.cpp} (94%) delete mode 100644 src/default_ctab_values.c create mode 100644 src/default_ctab_values.cpp rename src/{desk.c => desk.cpp} (99%) rename src/{desperate.c => desperate.cpp} (94%) rename src/{device.c => device.cpp} (64%) rename src/{dialAlert.c => dialAlert.cpp} (95%) rename src/{dialCreate.c => dialCreate.cpp} (98%) rename src/{dialDispatch.c => dialDispatch.cpp} (95%) rename src/{dialHandle.c => dialHandle.cpp} (97%) rename src/{dialInit.c => dialInit.cpp} (80%) rename src/{dialItem.c => dialItem.cpp} (97%) rename src/{dialManip.c => dialManip.cpp} (95%) rename src/{dirtyrect.c => dirtyrect.cpp} (96%) rename src/{disk.c => disk.cpp} (95%) rename src/{diskinit.c => diskinit.cpp} (96%) rename src/{dump.c => dump.cpp} (90%) rename src/{edition.c => edition.cpp} (99%) rename src/{emustubs.c => emustubs.cpp} (99%) rename src/{emutrap.c => emutrap.cpp} (98%) delete mode 100644 src/emutraptables.c create mode 100644 src/emutraptables.cpp rename src/{error.c => error.cpp} (98%) rename src/{executor.c => executor.cpp} (96%) rename src/{fileAccess.c => fileAccess.cpp} (95%) rename src/{fileCreate.c => fileCreate.cpp} (97%) rename src/{fileDirs.c => fileDirs.cpp} (98%) rename src/{fileDouble.c => fileDouble.cpp} (92%) rename src/{fileHighlevel.c => fileHighlevel.cpp} (98%) rename src/{fileInfo.c => fileInfo.cpp} (98%) rename src/{fileMisc.c => fileMisc.cpp} (88%) rename src/{fileVolumes.c => fileVolumes.cpp} (96%) rename src/{finder.c => finder.cpp} (70%) rename src/{float4.c => float4.cpp} (99%) rename src/{float5.c => float5.cpp} (99%) rename src/{float7.c => float7.cpp} (99%) rename src/{floatnext.c => floatnext.cpp} (99%) rename src/{font.c => font.cpp} (96%) rename src/{fontIMVI.c => fontIMVI.cpp} (97%) rename src/{genfndecls.c => genfndecls.cpp} (89%) rename src/{gensplash.c => gensplash.cpp} (99%) rename src/{gestalt.c => gestalt.cpp} (96%) create mode 100644 src/globals.cpp rename src/{hfsBtree.c => hfsBtree.cpp} (94%) rename src/{hfsChanging.c => hfsChanging.cpp} (85%) rename src/{hfsCreate.c => hfsCreate.cpp} (82%) rename src/{hfsFile.c => hfsFile.cpp} (94%) rename src/{hfsHelper.c => hfsHelper.cpp} (77%) rename src/{hfsHier.c => hfsHier.cpp} (95%) rename src/{hfsMisc.c => hfsMisc.cpp} (99%) rename src/{hfsVolume.c => hfsVolume.cpp} (93%) rename src/{hfsWorkingdir.c => hfsWorkingdir.cpp} (89%) rename src/{hfsXbar.c => hfsXbar.cpp} (98%) rename src/{hle.c => hle.cpp} (90%) rename src/{ibm_keycodes.c => ibm_keycodes.cpp} (96%) rename src/{icon.c => icon.cpp} (99%) rename src/{image.c => image.cpp} (93%) rename src/{image_inits.c => image_inits.cpp} (90%) create mode 100644 src/include/rsys/CFriendly.h create mode 100644 src/include/rsys/Info.plist create mode 100644 src/include/rsys/stub.c rename src/{ini.c => ini.cpp} (60%) rename src/{interfacelib.c => interfacelib.cpp} (99%) rename src/{iu.c => iu.cpp} (95%) rename src/{iv-stubs.c => iv-stubs.cpp} (95%) rename src/{keycode.c => keycode.mm} (91%) rename src/{launch.c => launch.cpp} (96%) delete mode 100644 src/licensetext.c rename src/{listAccess.c => listAccess.cpp} (97%) rename src/{listAddDel.c => listAddDel.cpp} (99%) rename src/{listCreate.c => listCreate.cpp} (99%) rename src/{listDisplay.c => listDisplay.cpp} (97%) rename src/{listMouse.c => listMouse.cpp} (94%) rename src/{listOps.c => listOps.cpp} (98%) rename src/{listStdLDEF.c => listStdLDEF.cpp} (90%) rename src/{local_charset.c => local_charset.cpp} (99%) rename src/{lockrange.c => lockrange.cpp} (87%) rename src/{main.c => main.cpp} (96%) create mode 100644 src/map_to_c/map_to_c.1 rename src/{map_to_c.c => map_to_c/map_to_c.cpp} (90%) rename src/{mathlib.c => mathlib.cpp} (99%) rename src/{menu.c => menu.cpp} (96%) rename src/{menuColor.c => menuColor.cpp} (95%) rename src/{menuV.c => menuV.cpp} (99%) rename src/{mixed_mode.c => mixed_mode.cpp} (98%) rename src/{ => mkexpandtables}/mkexpandtables.c (100%) rename src/{ => mkseedtables}/mkseedtables.c (97%) rename src/{ => mksspairtable}/mksspairtable.c (96%) rename src/{ => mkultable}/mkultable.c (95%) rename src/mkvol/{mkvol.c => mkvol.cpp} (91%) rename src/{mman.c => mman.cpp} (93%) rename src/{mmansubr.c => mmansubr.cpp} (94%) rename src/{notify.c => notify.cpp} (98%) rename src/{option.c => option.mm} (77%) rename src/{osevent.c => osevent.cpp} (91%) delete mode 100644 src/ostrap.awk delete mode 100644 src/osutil.c.NEW rename src/{osutil.c => osutil.cpp} (98%) rename src/{pack.c => pack.cpp} (94%) rename src/{parsenum.c => parsenum.cpp} (97%) rename src/{parseopt.c => parseopt.cpp} (92%) rename src/{pef_hash.c => pef_hash.cpp} (98%) rename src/{prError.c => prError.cpp} (95%) rename src/{prInit.c => prInit.cpp} (92%) rename src/{prLowLevel.c => prLowLevel.cpp} (95%) rename src/{prPrinting.c => prPrinting.cpp} (82%) rename src/{prRecords.c => prRecords.cpp} (97%) rename src/{priv.c => priv.cpp} (98%) rename src/{process.c => process.cpp} (97%) rename src/{qBit.c => qBit.cpp} (99%) rename src/{qCConv.c => qCConv.cpp} (99%) rename src/{qCGrafPort.c => qCGrafPort.cpp} (99%) rename src/{qCRegular.c => qCRegular.cpp} (98%) rename src/{qColor.c => qColor.cpp} (80%) rename src/{qColorMgr.c => qColorMgr.cpp} (99%) rename src/{qColorPicker.c => qColorPicker.cpp} (98%) rename src/{qColorutil.c => qColorutil.cpp} (93%) rename src/{qCursor.c => qCursor.cpp} (97%) rename src/{qGDevice.c => qGDevice.cpp} (86%) rename src/{qGWorld.c => qGWorld.cpp} (97%) rename src/{qGrafport.c => qGrafport.cpp} (97%) rename src/{qHooks.c => qHooks.cpp} (74%) rename src/{qIMIV.c => qIMIV.cpp} (96%) rename src/{qIMV.c => qIMV.cpp} (94%) rename src/{qIMVI.c => qIMVI.cpp} (97%) rename src/{qIMVxfer.c => qIMVxfer.cpp} (96%) rename src/{qMisc.c => qMisc.cpp} (98%) rename src/{qPaletteMgr.c => qPaletteMgr.cpp} (98%) rename src/{qPen.c => qPen.cpp} (97%) rename src/{qPicstuff.c => qPicstuff.cpp} (95%) rename src/{qPict2.c => qPict2.cpp} (99%) rename src/{qPicture.c => qPicture.cpp} (95%) rename src/{qPixMapConv.c => qPixMapConv.cpp} (95%) rename src/{qPoint.c => qPoint.cpp} (97%) rename src/{qPoly.c => qPoly.cpp} (96%) rename src/{qRect.c => qRect.cpp} (99%) rename src/{qRegion.c => qRegion.cpp} (97%) rename src/{qRegular.c => qRegular.cpp} (99%) rename src/{qScale.c => qScale.cpp} (86%) delete mode 100644 src/qStandard.c create mode 100644 src/qStandard.cpp rename src/{qStdArc.c => qStdArc.cpp} (97%) rename src/{qStdBits.c => qStdBits.cpp} (93%) rename src/{qStdLine.c => qStdLine.cpp} (56%) rename src/{qStdOval.c => qStdOval.cpp} (98%) rename src/{qStdPic.c => qStdPic.cpp} (98%) rename src/{qStdPoly.c => qStdPoly.cpp} (96%) rename src/{qStdRRect.c => qStdRRect.cpp} (99%) rename src/{qStdRect.c => qStdRect.cpp} (98%) rename src/{qStdRgn.c => qStdRgn.cpp} (97%) rename src/{qStdText.c => qStdText.cpp} (97%) rename src/{qText.c => qText.cpp} (97%) rename src/{qt.c => qt.cpp} (99%) rename src/{rawpatblt.c => rawpatblt.cpp} (98%) rename src/{rawsrcblt.c => rawsrcblt.cpp} (98%) rename src/{redrawscreen.c => redrawscreen.cpp} (94%) rename src/{refresh.c => refresh.cpp} (96%) rename src/{resGet.c => resGet.cpp} (97%) rename src/{resGetinfo.c => resGetinfo.cpp} (99%) rename src/{resGettype.c => resGettype.cpp} (92%) rename src/{resIMIV.c => resIMIV.cpp} (98%) rename src/{resInit.c => resInit.cpp} (98%) rename src/{resMisc.c => resMisc.cpp} (98%) rename src/{resMod.c => resMod.cpp} (97%) rename src/{resOpen.c => resOpen.cpp} (96%) rename src/{resPartial.c => resPartial.cpp} (98%) rename src/{resSetcur.c => resSetcur.cpp} (98%) rename src/{rgbutil.c => rgbutil.cpp} (98%) rename src/{romlib_stubs.c => romlib_stubs.cpp} (84%) rename src/{scrap.c => scrap.cpp} (98%) rename src/{screen-dump.c => screen-dump.cpp} (98%) rename src/{script.c => script.cpp} (99%) rename src/{segment.c => segment.cpp} (93%) rename src/{serial.c => serial.cpp} (90%) rename src/{setuid.c => setuid.cpp} (89%) rename src/{shutdown.c => shutdown.cpp} (97%) rename src/{sigio_multiplex.c => sigio_multiplex.cpp} (92%) rename src/{slash.c => slash.cpp} (99%) rename src/{snth5.c => snth5.cpp} (95%) rename src/{sound.c => sound.cpp} (97%) rename src/{soundIMVI.c => soundIMVI.cpp} (98%) delete mode 100644 src/sounddriver.c create mode 100644 src/sounddriver.cpp delete mode 100644 src/soundfake.c create mode 100644 src/soundfake.cpp rename src/{splash.c => splash.cpp} (100%) rename src/{srcblt.c => srcblt.cpp} (99%) create mode 100644 src/stdfile-OSX.cpp create mode 100644 src/stdfile-OSX.h rename src/{stdfile.c => stdfile.cpp} (94%) delete mode 100644 src/stdmbdf.c create mode 100644 src/stdmbdf.cpp rename src/{stdmdef.c => stdmdef.cpp} (95%) rename src/{string.c => string.cpp} (68%) create mode 100644 src/suffix_maps.cpp delete mode 100644 src/syncint.c create mode 100644 src/syncint.cpp rename src/{syserr.c => syserr.cpp} (96%) rename src/{system_error.c => system_error.cpp} (97%) rename src/{teAccess.c => teAccess.cpp} (98%) rename src/{teDisplay.c => teDisplay.cpp} (98%) rename src/{teEdit.c => teEdit.cpp} (97%) rename src/{teIMIV.c => teIMIV.cpp} (99%) rename src/{teIMV.c => teIMV.cpp} (97%) rename src/{teInit.c => teInit.cpp} (98%) rename src/{teInsert.c => teInsert.cpp} (98%) rename src/{teMisc.c => teMisc.cpp} (97%) rename src/{teScrap.c => teScrap.cpp} (97%) rename src/{tempmem.c => tempmem.cpp} (98%) rename src/{think.c => think.cpp} (86%) rename src/{time.c => time.cpp} (97%) rename src/{toolevent.c => toolevent.cpp} (96%) rename src/{toolmath.c => toolmath.cpp} (98%) rename src/{toolutil.c => toolutil.cpp} (94%) rename src/{trapname.c => trapname.cpp} (99%) rename src/{uniquefile.c => uniquefile.cpp} (75%) rename src/{unix_like.c => unix_like.cpp} (94%) rename src/{vbl.c => vbl.cpp} (98%) rename src/{version.c => version.cpp} (99%) rename src/{vgavdriver.c => vgavdriver.cpp} (99%) rename src/{virtualint.c => virtualint.cpp} (65%) rename src/{windColor.c => windColor.cpp} (87%) rename src/{windDisplay.c => windDisplay.cpp} (99%) rename src/{windDocdef.c => windDocdef.cpp} (98%) rename src/{windInit.c => windInit.cpp} (98%) rename src/{windMisc.c => windMisc.cpp} (98%) rename src/{windMouse.c => windMouse.cpp} (97%) rename src/{windSize.c => windSize.cpp} (99%) rename src/{windUpdate.c => windUpdate.cpp} (97%) rename src/{xdata.c => xdata.cpp} (97%) rename src/{xdblt.c => xdblt.cpp} (98%) diff --git a/.gitignore b/.gitignore index 81f6b3dd..710e8304 100644 --- a/.gitignore +++ b/.gitignore @@ -26,5 +26,6 @@ src/config.status src/config.log src/config.h src/.deps/ -**/.DS_Store .DS_Store +*xcuserdata +**/project.xcworkspace/ diff --git a/CocoaExecutor.xcodeproj/project.pbxproj b/CocoaExecutor.xcodeproj/project.pbxproj new file mode 100644 index 00000000..f992d273 --- /dev/null +++ b/CocoaExecutor.xcodeproj/project.pbxproj @@ -0,0 +1,3634 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 5500AB341985911A00FF62C0 /* x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB321985911A00FF62C0 /* x86_64.cpp */; }; + 5500AB541985A66A00FF62C0 /* Executor.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5500AB3C1985A66A00FF62C0 /* Executor.xib */; }; + 5500AB551985A66A00FF62C0 /* Executor.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 5500AB3E1985A66A00FF62C0 /* Executor.tiff */; }; + 5500AB561985A66A00FF62C0 /* Executor_main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB3F1985A66A00FF62C0 /* Executor_main.mm */; }; + 5500AB571985A66A00FF62C0 /* MacAppClass.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB431985A66A00FF62C0 /* MacAppClass.mm */; }; + 5500AB581985A66A00FF62C0 /* MacViewClass.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB461985A66A00FF62C0 /* MacViewClass.mm */; }; + 5500AB591985A66A00FF62C0 /* MacWinClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB481985A66A00FF62C0 /* MacWinClass.m */; }; + 5500AB5A1985A66A00FF62C0 /* NEXT.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB491985A66A00FF62C0 /* NEXT.mm */; }; + 5500AB5B1985A66A00FF62C0 /* NEXTkeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB4A1985A66A00FF62C0 /* NEXTkeyboard.cpp */; }; + 5500AB5C1985A66A00FF62C0 /* NEXTmain.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB4B1985A66A00FF62C0 /* NEXTmain.mm */; }; + 5500AB5D1985A66A00FF62C0 /* NEXTprint.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB4C1985A66A00FF62C0 /* NEXTprint.mm */; }; + 553B0B6C19888B690041B809 /* hfsHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98A31987FCBD00ADF159 /* hfsHelper.cpp */; }; + 556062EB1988441700D6F0B2 /* xdata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99511987FCBF00ADF159 /* xdata.cpp */; }; + 556062EC198844B800D6F0B2 /* xdblt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99521987FCBF00ADF159 /* xdblt.cpp */; }; + 556063B41988680000D6F0B2 /* aboutbox.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560630F1988680000D6F0B2 /* aboutbox.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063B51988680000D6F0B2 /* aboutpanel.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063101988680000D6F0B2 /* aboutpanel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063B61988680000D6F0B2 /* adb.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063111988680000D6F0B2 /* adb.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063B71988680000D6F0B2 /* alias.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063121988680000D6F0B2 /* alias.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063B81988680000D6F0B2 /* appearance.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063131988680000D6F0B2 /* appearance.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063B91988680000D6F0B2 /* apple_events.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063141988680000D6F0B2 /* apple_events.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063BA1988680000D6F0B2 /* arch.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063151988680000D6F0B2 /* arch.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063BB1988680000D6F0B2 /* arrowkeys.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063161988680000D6F0B2 /* arrowkeys.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063BC1988680000D6F0B2 /* autorefresh.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063171988680000D6F0B2 /* autorefresh.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063BD1988680000D6F0B2 /* blockdev.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063181988680000D6F0B2 /* blockdev.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063BE1988680000D6F0B2 /* blockinterrupts.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063191988680000D6F0B2 /* blockinterrupts.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063BF1988680000D6F0B2 /* byteswap.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560631A1988680000D6F0B2 /* byteswap.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063C01988680000D6F0B2 /* cfm.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560631B1988680000D6F0B2 /* cfm.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063C11988680000D6F0B2 /* check_structs.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560631C1988680000D6F0B2 /* check_structs.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063C21988680000D6F0B2 /* checkpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560631D1988680000D6F0B2 /* checkpoint.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063C31988680000D6F0B2 /* cleanup.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560631E1988680000D6F0B2 /* cleanup.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063C41988680000D6F0B2 /* color_wheel_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560631F1988680000D6F0B2 /* color_wheel_bits.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063C51988680000D6F0B2 /* common.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063201988680000D6F0B2 /* common.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063C61988680000D6F0B2 /* commonevt.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063211988680000D6F0B2 /* commonevt.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063C71988680000D6F0B2 /* cquick.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063221988680000D6F0B2 /* cquick.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063C81988680000D6F0B2 /* crc.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063231988680000D6F0B2 /* crc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063C91988680000D6F0B2 /* cruft.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063241988680000D6F0B2 /* cruft.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063CA1988680000D6F0B2 /* ctl.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063251988680000D6F0B2 /* ctl.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063CB1988680000D6F0B2 /* ctopflags.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063261988680000D6F0B2 /* ctopflags.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063CC1988680000D6F0B2 /* custom.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063271988680000D6F0B2 /* custom.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063CD1988680000D6F0B2 /* dcache.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063281988680000D6F0B2 /* dcache.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063CE1988680000D6F0B2 /* depthconv.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063291988680000D6F0B2 /* depthconv.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063CF1988680000D6F0B2 /* desk.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560632A1988680000D6F0B2 /* desk.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063D01988680000D6F0B2 /* desperate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560632B1988680000D6F0B2 /* desperate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063D11988680000D6F0B2 /* device.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560632C1988680000D6F0B2 /* device.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063D21988680000D6F0B2 /* dial.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560632D1988680000D6F0B2 /* dial.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063D31988680000D6F0B2 /* dirtyrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560632E1988680000D6F0B2 /* dirtyrect.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063D41988680000D6F0B2 /* drive_flags.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560632F1988680000D6F0B2 /* drive_flags.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063D51988680000D6F0B2 /* dump.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063301988680000D6F0B2 /* dump.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063D61988680000D6F0B2 /* emustubs.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063311988680000D6F0B2 /* emustubs.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063D71988680000D6F0B2 /* error.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063321988680000D6F0B2 /* error.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063D81988680000D6F0B2 /* everything.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063331988680000D6F0B2 /* everything.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063D91988680000D6F0B2 /* evil.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063341988680000D6F0B2 /* evil.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063DA1988680000D6F0B2 /* executor.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063351988680000D6F0B2 /* executor.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063DB1988680000D6F0B2 /* fauxdbm.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063361988680000D6F0B2 /* fauxdbm.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063DC1988680000D6F0B2 /* file.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063371988680000D6F0B2 /* file.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063DD1988680000D6F0B2 /* filedouble.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063381988680000D6F0B2 /* filedouble.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063DE1988680000D6F0B2 /* flags.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063391988680000D6F0B2 /* flags.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063DF1988680000D6F0B2 /* float_fcw.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560633A1988680000D6F0B2 /* float_fcw.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063E01988680000D6F0B2 /* float.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560633B1988680000D6F0B2 /* float.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063E11988680000D6F0B2 /* floatconv.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560633C1988680000D6F0B2 /* floatconv.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063E21988680000D6F0B2 /* font.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560633D1988680000D6F0B2 /* font.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063E31988680000D6F0B2 /* gestalt.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560633E1988680000D6F0B2 /* gestalt.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063E41988680000D6F0B2 /* glue.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560633F1988680000D6F0B2 /* glue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063E51988680000D6F0B2 /* gworld.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063401988680000D6F0B2 /* gworld.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063E61988680000D6F0B2 /* hfs_plus.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063411988680000D6F0B2 /* hfs_plus.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063E71988680000D6F0B2 /* hfs.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063421988680000D6F0B2 /* hfs.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063E81988680000D6F0B2 /* hook.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063431988680000D6F0B2 /* hook.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063E91988680000D6F0B2 /* host.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063441988680000D6F0B2 /* host.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063EA1988680000D6F0B2 /* icon.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063451988680000D6F0B2 /* icon.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063EB1988680000D6F0B2 /* image.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063461988680000D6F0B2 /* image.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063EC1988680000D6F0B2 /* ini.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063471988680000D6F0B2 /* ini.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063ED1988680000D6F0B2 /* interfacelib.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063481988680000D6F0B2 /* interfacelib.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063EE1988680000D6F0B2 /* itm.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063491988680000D6F0B2 /* itm.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063EF1988680000D6F0B2 /* iv.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560634A1988680000D6F0B2 /* iv.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063F01988680000D6F0B2 /* jumpvectors.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560634B1988680000D6F0B2 /* jumpvectors.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063F11988680000D6F0B2 /* keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560634C1988680000D6F0B2 /* keyboard.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063F21988680000D6F0B2 /* keyboards.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560634D1988680000D6F0B2 /* keyboards.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063F31988680000D6F0B2 /* keycode.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560634E1988680000D6F0B2 /* keycode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063F41988680000D6F0B2 /* launch.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560634F1988680000D6F0B2 /* launch.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063F51988680000D6F0B2 /* libcproto.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063501988680000D6F0B2 /* libcproto.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063F61988680000D6F0B2 /* licensetext.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063511988680000D6F0B2 /* licensetext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063F71988680000D6F0B2 /* list.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063521988680000D6F0B2 /* list.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063F81988680000D6F0B2 /* local_charset.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063531988680000D6F0B2 /* local_charset.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063F91988680000D6F0B2 /* lockunlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063541988680000D6F0B2 /* lockunlock.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063FA1988680000D6F0B2 /* lowglobals.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063551988680000D6F0B2 /* lowglobals.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063FB1988680000D6F0B2 /* m68kint.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063561988680000D6F0B2 /* m68kint.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063FC1988680000D6F0B2 /* macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063571988680000D6F0B2 /* macros.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063FD1988680000D6F0B2 /* mactype.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063581988680000D6F0B2 /* mactype.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063FE1988680000D6F0B2 /* mathlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063591988680000D6F0B2 /* mathlib.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556063FF1988680000D6F0B2 /* memory_layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560635A1988680000D6F0B2 /* memory_layout.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064001988680000D6F0B2 /* memsize.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560635B1988680000D6F0B2 /* memsize.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064011988680000D6F0B2 /* menu.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560635C1988680000D6F0B2 /* menu.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064021988680000D6F0B2 /* misc.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560635D1988680000D6F0B2 /* misc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064031988680000D6F0B2 /* mixed_mode.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560635E1988680000D6F0B2 /* mixed_mode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064041988680000D6F0B2 /* mman_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560635F1988680000D6F0B2 /* mman_private.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064051988680000D6F0B2 /* mman.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063601988680000D6F0B2 /* mman.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064061988680000D6F0B2 /* mmanstubs.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063611988680000D6F0B2 /* mmanstubs.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064071988680000D6F0B2 /* new_mmanstubs.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063621988680000D6F0B2 /* new_mmanstubs.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064081988680000D6F0B2 /* newvga.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063631988680000D6F0B2 /* newvga.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064091988680000D6F0B2 /* next.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063641988680000D6F0B2 /* next.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560640A1988680000D6F0B2 /* nextprint.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063651988680000D6F0B2 /* nextprint.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560640B1988680000D6F0B2 /* noreturn.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063661988680000D6F0B2 /* noreturn.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560640C1988680000D6F0B2 /* notmac.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063671988680000D6F0B2 /* notmac.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560640D1988680000D6F0B2 /* Olibcproto.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063681988680000D6F0B2 /* Olibcproto.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560640E1988680000D6F0B2 /* option.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063691988680000D6F0B2 /* option.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560640F1988680000D6F0B2 /* options.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560636A1988680000D6F0B2 /* options.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064101988680000D6F0B2 /* os.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560636B1988680000D6F0B2 /* os.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064111988680000D6F0B2 /* osevent.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560636C1988680000D6F0B2 /* osevent.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064121988680000D6F0B2 /* osutil.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560636D1988680000D6F0B2 /* osutil.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064131988680000D6F0B2 /* parse.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560636E1988680000D6F0B2 /* parse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064141988680000D6F0B2 /* parsenum.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560636F1988680000D6F0B2 /* parsenum.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064151988680000D6F0B2 /* parseopt.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063701988680000D6F0B2 /* parseopt.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064161988680000D6F0B2 /* partition.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063711988680000D6F0B2 /* partition.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064171988680000D6F0B2 /* pef.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063721988680000D6F0B2 /* pef.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064181988680000D6F0B2 /* picture.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063731988680000D6F0B2 /* picture.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064191988680000D6F0B2 /* pragmal.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063741988680000D6F0B2 /* pragmal.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560641A1988680000D6F0B2 /* pragmar.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063751988680000D6F0B2 /* pragmar.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560641B1988680000D6F0B2 /* pragmas.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063761988680000D6F0B2 /* pragmas.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560641C1988680000D6F0B2 /* prefpanel.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063771988680000D6F0B2 /* prefpanel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560641D1988680000D6F0B2 /* prefs.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063781988680000D6F0B2 /* prefs.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560641E1988680000D6F0B2 /* print.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063791988680000D6F0B2 /* print.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560641F1988680000D6F0B2 /* process.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560637A1988680000D6F0B2 /* process.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064201988680000D6F0B2 /* PSstrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560637B1988680000D6F0B2 /* PSstrings.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064211988680000D6F0B2 /* pstuff.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560637C1988680000D6F0B2 /* pstuff.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064221988680000D6F0B2 /* ptocflags.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560637D1988680000D6F0B2 /* ptocflags.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064231988680000D6F0B2 /* qcolor.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560637E1988680000D6F0B2 /* qcolor.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064241988680000D6F0B2 /* quick.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560637F1988680000D6F0B2 /* quick.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064251988680000D6F0B2 /* rawblt.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063801988680000D6F0B2 /* rawblt.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064261988680000D6F0B2 /* redrawscreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063811988680000D6F0B2 /* redrawscreen.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064271988680000D6F0B2 /* refresh.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063821988680000D6F0B2 /* refresh.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064281988680000D6F0B2 /* region.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063831988680000D6F0B2 /* region.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064291988680000D6F0B2 /* release.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063841988680000D6F0B2 /* release.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560642A1988680000D6F0B2 /* resource.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063851988680000D6F0B2 /* resource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560642B1988680000D6F0B2 /* rgbutil.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063861988680000D6F0B2 /* rgbutil.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560642C1988680000D6F0B2 /* safe_alloca.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063871988680000D6F0B2 /* safe_alloca.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560642D1988680000D6F0B2 /* scrap.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063881988680000D6F0B2 /* scrap.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560642E1988680000D6F0B2 /* screen-dump.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063891988680000D6F0B2 /* screen-dump.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560642F1988680000D6F0B2 /* segment.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560638A1988680000D6F0B2 /* segment.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064301988680000D6F0B2 /* serial.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560638B1988680000D6F0B2 /* serial.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064311988680000D6F0B2 /* setuid.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560638C1988680000D6F0B2 /* setuid.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064321988680000D6F0B2 /* sigio_multiplex.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560638D1988680000D6F0B2 /* sigio_multiplex.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064331988680000D6F0B2 /* slash.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560638E1988680000D6F0B2 /* slash.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064341988680100D6F0B2 /* smash.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560638F1988680000D6F0B2 /* smash.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064351988680100D6F0B2 /* sounddriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063901988680000D6F0B2 /* sounddriver.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064361988680100D6F0B2 /* soundfake.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063911988680000D6F0B2 /* soundfake.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064371988680100D6F0B2 /* soundopts.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063921988680000D6F0B2 /* soundopts.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064381988680100D6F0B2 /* splash.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063931988680000D6F0B2 /* splash.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064391988680100D6F0B2 /* srcblt.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063941988680000D6F0B2 /* srcblt.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560643A1988680100D6F0B2 /* stdbits.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063951988680000D6F0B2 /* stdbits.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560643B1988680100D6F0B2 /* stdfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063961988680000D6F0B2 /* stdfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560643C1988680100D6F0B2 /* stdio_smashage.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063971988680000D6F0B2 /* stdio_smashage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560643D1988680100D6F0B2 /* string.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063981988680000D6F0B2 /* string.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560643E1988680100D6F0B2 /* stubify.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063991988680000D6F0B2 /* stubify.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560643F1988680100D6F0B2 /* suffix_maps.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560639A1988680000D6F0B2 /* suffix_maps.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064401988680100D6F0B2 /* syncint.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560639B1988680000D6F0B2 /* syncint.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064411988680100D6F0B2 /* syserr.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560639C1988680000D6F0B2 /* syserr.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064421988680100D6F0B2 /* system_error.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560639D1988680000D6F0B2 /* system_error.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064431988680100D6F0B2 /* tempalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560639E1988680000D6F0B2 /* tempalloc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064441988680100D6F0B2 /* tesave.h in Headers */ = {isa = PBXBuildFile; fileRef = 5560639F1988680000D6F0B2 /* tesave.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064451988680100D6F0B2 /* text.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063A01988680000D6F0B2 /* text.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064461988680100D6F0B2 /* time.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063A11988680000D6F0B2 /* time.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064471988680100D6F0B2 /* toolevent.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063A21988680000D6F0B2 /* toolevent.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064481988680100D6F0B2 /* toolutil.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063A31988680000D6F0B2 /* toolutil.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064491988680100D6F0B2 /* trapdecl.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063A41988680000D6F0B2 /* trapdecl.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560644A1988680100D6F0B2 /* trapdefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063A51988680000D6F0B2 /* trapdefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560644B1988680100D6F0B2 /* trapglue.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063A61988680000D6F0B2 /* trapglue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560644C1988680100D6F0B2 /* trapname.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063A71988680000D6F0B2 /* trapname.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560644D1988680100D6F0B2 /* types.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063A81988680000D6F0B2 /* types.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560644E1988680100D6F0B2 /* uniquefile.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063A91988680000D6F0B2 /* uniquefile.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5560644F1988680100D6F0B2 /* vbl.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063AA1988680000D6F0B2 /* vbl.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064501988680100D6F0B2 /* vdriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063AB1988680000D6F0B2 /* vdriver.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064511988680100D6F0B2 /* version.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063AC1988680000D6F0B2 /* version.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064521988680100D6F0B2 /* vgavdriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063AD1988680000D6F0B2 /* vgavdriver.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064531988680100D6F0B2 /* wind.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063AE1988680000D6F0B2 /* wind.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064541988680100D6F0B2 /* wrappers.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063AF1988680000D6F0B2 /* wrappers.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064551988680100D6F0B2 /* x.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063B01988680000D6F0B2 /* x.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064561988680100D6F0B2 /* xdata.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063B11988680000D6F0B2 /* xdata.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064571988680100D6F0B2 /* xdblt.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063B21988680000D6F0B2 /* xdblt.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556064581988680100D6F0B2 /* Xdefs.h in Headers */ = {isa = PBXBuildFile; fileRef = 556063B31988680000D6F0B2 /* Xdefs.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 556E040719856E5700FC4362 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 556E040619856E5700FC4362 /* Cocoa.framework */; }; + 556E041719856E5700FC4362 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 556E041519856E5700FC4362 /* Credits.rtf */; }; + 556E041F19856E5700FC4362 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 556E041E19856E5700FC4362 /* Images.xcassets */; }; + 556E042619856E5700FC4362 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 556E042519856E5700FC4362 /* XCTest.framework */; }; + 556E042719856E5700FC4362 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 556E040619856E5700FC4362 /* Cocoa.framework */; }; + 556E042F19856E5700FC4362 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 556E042D19856E5700FC4362 /* InfoPlist.strings */; }; + 556E043119856E5700FC4362 /* CocoaExecutorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 556E043019856E5700FC4362 /* CocoaExecutorTests.m */; }; + 556E0555198584DE00FC4362 /* active.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E0547198584DE00FC4362 /* active.map */; }; + 556E0556198584DE00FC4362 /* apple.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E0548198584DE00FC4362 /* apple.map */; }; + 556E0557198584DE00FC4362 /* arrow_down_active.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E0549198584DE00FC4362 /* arrow_down_active.map */; }; + 556E0558198584DE00FC4362 /* arrow_down_inactive.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E054A198584DE00FC4362 /* arrow_down_inactive.map */; }; + 556E0559198584DE00FC4362 /* arrow_left_active.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E054B198584DE00FC4362 /* arrow_left_active.map */; }; + 556E055A198584DE00FC4362 /* arrow_left_inactive.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E054C198584DE00FC4362 /* arrow_left_inactive.map */; }; + 556E055B198584DE00FC4362 /* arrow_right_active.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E054D198584DE00FC4362 /* arrow_right_active.map */; }; + 556E055C198584DE00FC4362 /* arrow_right_inactive.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E054E198584DE00FC4362 /* arrow_right_inactive.map */; }; + 556E055D198584DE00FC4362 /* arrow_up_active.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E054F198584DE00FC4362 /* arrow_up_active.map */; }; + 556E055E198584DE00FC4362 /* arrow_up_inactive.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E0550198584DE00FC4362 /* arrow_up_inactive.map */; }; + 556E055F198584DE00FC4362 /* go_away.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E0551198584DE00FC4362 /* go_away.map */; }; + 556E0560198584DE00FC4362 /* grow.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E0552198584DE00FC4362 /* grow.map */; }; + 556E0561198584DE00FC4362 /* ractive.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E0553198584DE00FC4362 /* ractive.map */; }; + 556E0562198584DE00FC4362 /* zoom.map in Sources */ = {isa = PBXBuildFile; fileRef = 556E0554198584DE00FC4362 /* zoom.map */; }; + 556E05711985855100FC4362 /* map_to_c.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 556E05701985855100FC4362 /* map_to_c.cpp */; }; + 556E061A1985873F00FC4362 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 556E06191985873F00FC4362 /* ApplicationServices.framework */; }; + 557F308919895405009873EB /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 557F308819895405009873EB /* CoreServices.framework */; }; + 557F308A1989540D009873EB /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 556E06191985873F00FC4362 /* ApplicationServices.framework */; }; + 557F308C19895414009873EB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 557F308B19895414009873EB /* Carbon.framework */; }; + 557F308F198967BE009873EB /* stdfile-OSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 557F308D198967BE009873EB /* stdfile-OSX.cpp */; }; + 557F30C2198976A9009873EB /* mkseedtables.c in Sources */ = {isa = PBXBuildFile; fileRef = 557F30C1198976A9009873EB /* mkseedtables.c */; }; + 557F30C4198976DC009873EB /* mkultable.c in Sources */ = {isa = PBXBuildFile; fileRef = 557F30C3198976DC009873EB /* mkultable.c */; }; + 557F30C61989771D009873EB /* mksspairtable.c in Sources */ = {isa = PBXBuildFile; fileRef = 557F30C51989771D009873EB /* mksspairtable.c */; }; + 557F30D019897991009873EB /* thumb_horiz.map in Sources */ = {isa = PBXBuildFile; fileRef = 557F30CE19897991009873EB /* thumb_horiz.map */; }; + 557F30D119897991009873EB /* thumb_vert.map in Sources */ = {isa = PBXBuildFile; fileRef = 557F30CF19897991009873EB /* thumb_vert.map */; }; + 557F30D3198982DC009873EB /* CFriendly.h in Headers */ = {isa = PBXBuildFile; fileRef = 557F30D2198982DC009873EB /* CFriendly.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 557F30D519898513009873EB /* CBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 557F30D419898513009873EB /* CBridge.cpp */; }; + 557F30D71989ACFE009873EB /* fauxdbm.c in Sources */ = {isa = PBXBuildFile; fileRef = 558B988A1987FCBD00ADF159 /* fauxdbm.c */; }; + 558B98521987F5BA00ADF159 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 558B98511987F5BA00ADF159 /* IOKit.framework */; }; + 558B99531987FCBF00ADF159 /* aboutbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98541987FCBD00ADF159 /* aboutbox.cpp */; }; + 558B99541987FCBF00ADF159 /* adb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98551987FCBD00ADF159 /* adb.cpp */; }; + 558B99551987FCBF00ADF159 /* AE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98561987FCBD00ADF159 /* AE.cpp */; }; + 558B99561987FCBF00ADF159 /* AE_coercion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98571987FCBD00ADF159 /* AE_coercion.cpp */; }; + 558B99571987FCBF00ADF159 /* AE_desc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98581987FCBD00ADF159 /* AE_desc.cpp */; }; + 558B99581987FCBF00ADF159 /* AE_hdlr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98591987FCBD00ADF159 /* AE_hdlr.cpp */; }; + 558B99591987FCBF00ADF159 /* alias.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B985A1987FCBD00ADF159 /* alias.cpp */; }; + 558B995A1987FCBF00ADF159 /* appearance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B985B1987FCBD00ADF159 /* appearance.cpp */; }; + 558B995B1987FCBF00ADF159 /* autorefresh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B985C1987FCBD00ADF159 /* autorefresh.cpp */; }; + 558B995C1987FCBF00ADF159 /* balloon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B985D1987FCBD00ADF159 /* balloon.cpp */; }; + 558B995D1987FCBF00ADF159 /* bindec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B985E1987FCBD00ADF159 /* bindec.cpp */; }; + 558B995E1987FCBF00ADF159 /* blockdev.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B985F1987FCBD00ADF159 /* blockdev.cpp */; }; + 558B995F1987FCBF00ADF159 /* cfm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98601987FCBD00ADF159 /* cfm.cpp */; }; + 558B99631987FCBF00ADF159 /* color_wheel_bits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98641987FCBD00ADF159 /* color_wheel_bits.cpp */; }; + 558B99641987FCBF00ADF159 /* commtool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98651987FCBD00ADF159 /* commtool.cpp */; }; + 558B99651987FCBF00ADF159 /* crc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98661987FCBD00ADF159 /* crc.cpp */; }; + 558B99661987FCBF00ADF159 /* ctlArrows.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98671987FCBD00ADF159 /* ctlArrows.cpp */; }; + 558B99671987FCBF00ADF159 /* ctlDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98681987FCBD00ADF159 /* ctlDisplay.cpp */; }; + 558B99681987FCBF00ADF159 /* ctlIMIV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98691987FCBD00ADF159 /* ctlIMIV.cpp */; }; + 558B99691987FCBF00ADF159 /* ctlInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B986A1987FCBD00ADF159 /* ctlInit.cpp */; }; + 558B996A1987FCBF00ADF159 /* ctlMisc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B986B1987FCBD00ADF159 /* ctlMisc.cpp */; }; + 558B996B1987FCBF00ADF159 /* ctlMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B986C1987FCBD00ADF159 /* ctlMouse.cpp */; }; + 558B996C1987FCBF00ADF159 /* ctlPopup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B986D1987FCBD00ADF159 /* ctlPopup.cpp */; }; + 558B996D1987FCBF00ADF159 /* ctlSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B986E1987FCBD00ADF159 /* ctlSet.cpp */; }; + 558B996E1987FCBF00ADF159 /* ctlSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B986F1987FCBD00ADF159 /* ctlSize.cpp */; }; + 558B996F1987FCBF00ADF159 /* ctlStddef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98701987FCBD00ADF159 /* ctlStddef.cpp */; }; + 558B99701987FCBF00ADF159 /* custom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98711987FCBD00ADF159 /* custom.cpp */; }; + 558B99711987FCBF00ADF159 /* dcache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98721987FCBD00ADF159 /* dcache.cpp */; }; + 558B99721987FCBF00ADF159 /* dcconvert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98731987FCBD00ADF159 /* dcconvert.cpp */; }; + 558B99731987FCBF00ADF159 /* dcmaketables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98741987FCBD00ADF159 /* dcmaketables.cpp */; }; + 558B99741987FCBF00ADF159 /* default_ctab_values.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98751987FCBD00ADF159 /* default_ctab_values.cpp */; }; + 558B99751987FCBF00ADF159 /* desk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98761987FCBD00ADF159 /* desk.cpp */; }; + 558B99761987FCBF00ADF159 /* desperate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98771987FCBD00ADF159 /* desperate.cpp */; }; + 558B99771987FCBF00ADF159 /* device.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98781987FCBD00ADF159 /* device.cpp */; }; + 558B99781987FCBF00ADF159 /* dialAlert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98791987FCBD00ADF159 /* dialAlert.cpp */; }; + 558B99791987FCBF00ADF159 /* dialCreate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B987A1987FCBD00ADF159 /* dialCreate.cpp */; }; + 558B997A1987FCBF00ADF159 /* dialDispatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B987B1987FCBD00ADF159 /* dialDispatch.cpp */; }; + 558B997B1987FCBF00ADF159 /* dialHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B987C1987FCBD00ADF159 /* dialHandle.cpp */; }; + 558B997C1987FCBF00ADF159 /* dialInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B987D1987FCBD00ADF159 /* dialInit.cpp */; }; + 558B997D1987FCBF00ADF159 /* dialItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B987E1987FCBD00ADF159 /* dialItem.cpp */; }; + 558B997E1987FCBF00ADF159 /* dialManip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B987F1987FCBD00ADF159 /* dialManip.cpp */; }; + 558B997F1987FCBF00ADF159 /* dirtyrect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98801987FCBD00ADF159 /* dirtyrect.cpp */; }; + 558B99801987FCBF00ADF159 /* disk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98811987FCBD00ADF159 /* disk.cpp */; }; + 558B99811987FCBF00ADF159 /* diskinit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98821987FCBD00ADF159 /* diskinit.cpp */; }; + 558B99821987FCBF00ADF159 /* dump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98831987FCBD00ADF159 /* dump.cpp */; }; + 558B99831987FCBF00ADF159 /* edition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98841987FCBD00ADF159 /* edition.cpp */; }; + 558B99851987FCBF00ADF159 /* emutrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98861987FCBD00ADF159 /* emutrap.cpp */; }; + 558B99861987FCBF00ADF159 /* emutraptables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98871987FCBD00ADF159 /* emutraptables.cpp */; }; + 558B99871987FCBF00ADF159 /* error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98881987FCBD00ADF159 /* error.cpp */; }; + 558B99881987FCBF00ADF159 /* executor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98891987FCBD00ADF159 /* executor.cpp */; }; + 558B998A1987FCBF00ADF159 /* fileAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B988B1987FCBD00ADF159 /* fileAccess.cpp */; }; + 558B998B1987FCBF00ADF159 /* fileCreate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B988C1987FCBD00ADF159 /* fileCreate.cpp */; }; + 558B998C1987FCBF00ADF159 /* fileDirs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B988D1987FCBD00ADF159 /* fileDirs.cpp */; }; + 558B998D1987FCBF00ADF159 /* fileDouble.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B988E1987FCBD00ADF159 /* fileDouble.cpp */; }; + 558B998E1987FCBF00ADF159 /* fileHighlevel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B988F1987FCBD00ADF159 /* fileHighlevel.cpp */; }; + 558B998F1987FCBF00ADF159 /* fileInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98901987FCBD00ADF159 /* fileInfo.cpp */; }; + 558B99901987FCBF00ADF159 /* fileMisc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98911987FCBD00ADF159 /* fileMisc.cpp */; }; + 558B99911987FCBF00ADF159 /* fileVolumes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98921987FCBD00ADF159 /* fileVolumes.cpp */; }; + 558B99921987FCBF00ADF159 /* finder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98931987FCBD00ADF159 /* finder.cpp */; }; + 558B99931987FCBF00ADF159 /* float4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98941987FCBD00ADF159 /* float4.cpp */; }; + 558B99941987FCBF00ADF159 /* float5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98951987FCBD00ADF159 /* float5.cpp */; }; + 558B99951987FCBF00ADF159 /* float7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98961987FCBD00ADF159 /* float7.cpp */; }; + 558B99961987FCBF00ADF159 /* floatnext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98971987FCBD00ADF159 /* floatnext.cpp */; }; + 558B99971987FCBF00ADF159 /* font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98981987FCBD00ADF159 /* font.cpp */; }; + 558B99981987FCBF00ADF159 /* fontIMVI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98991987FCBD00ADF159 /* fontIMVI.cpp */; }; + 558B999C1987FCBF00ADF159 /* gestalt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B989D1987FCBD00ADF159 /* gestalt.cpp */; }; + 558B999D1987FCBF00ADF159 /* globals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B989E1987FCBD00ADF159 /* globals.cpp */; }; + 558B999E1987FCBF00ADF159 /* hfsBtree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B989F1987FCBD00ADF159 /* hfsBtree.cpp */; }; + 558B999F1987FCBF00ADF159 /* hfsChanging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98A01987FCBD00ADF159 /* hfsChanging.cpp */; }; + 558B99A01987FCBF00ADF159 /* hfsCreate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98A11987FCBD00ADF159 /* hfsCreate.cpp */; }; + 558B99A11987FCBF00ADF159 /* hfsFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98A21987FCBD00ADF159 /* hfsFile.cpp */; }; + 558B99A31987FCBF00ADF159 /* hfsHier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98A41987FCBD00ADF159 /* hfsHier.cpp */; }; + 558B99A41987FCBF00ADF159 /* hfsMisc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98A51987FCBD00ADF159 /* hfsMisc.cpp */; }; + 558B99A51987FCBF00ADF159 /* hfsVolume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98A61987FCBD00ADF159 /* hfsVolume.cpp */; }; + 558B99A61987FCBF00ADF159 /* hfsWorkingdir.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98A71987FCBD00ADF159 /* hfsWorkingdir.cpp */; }; + 558B99A71987FCBF00ADF159 /* hfsXbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98A81987FCBD00ADF159 /* hfsXbar.cpp */; }; + 558B99A81987FCBF00ADF159 /* hle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98AA1987FCBD00ADF159 /* hle.cpp */; }; + 558B99A91987FCBF00ADF159 /* ibm_keycodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98AB1987FCBD00ADF159 /* ibm_keycodes.cpp */; }; + 558B99AA1987FCBF00ADF159 /* icon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98AC1987FCBD00ADF159 /* icon.cpp */; }; + 558B99AB1987FCBF00ADF159 /* image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98AD1987FCBD00ADF159 /* image.cpp */; }; + 558B99AC1987FCBF00ADF159 /* image_inits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98AE1987FCBD00ADF159 /* image_inits.cpp */; }; + 558B99AD1987FCBF00ADF159 /* ini.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98AF1987FCBD00ADF159 /* ini.cpp */; }; + 558B99AE1987FCBF00ADF159 /* interfacelib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98B01987FCBD00ADF159 /* interfacelib.cpp */; }; + 558B99AF1987FCBF00ADF159 /* iu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98B11987FCBD00ADF159 /* iu.cpp */; }; + 558B99B01987FCBF00ADF159 /* iv-stubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98B21987FCBD00ADF159 /* iv-stubs.cpp */; }; + 558B99B11987FCBF00ADF159 /* keycode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 558B98B31987FCBD00ADF159 /* keycode.mm */; }; + 558B99B21987FCBF00ADF159 /* launch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98B41987FCBD00ADF159 /* launch.cpp */; }; + 558B99B41987FCBF00ADF159 /* listAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98B61987FCBD00ADF159 /* listAccess.cpp */; }; + 558B99B51987FCBF00ADF159 /* listAddDel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98B71987FCBD00ADF159 /* listAddDel.cpp */; }; + 558B99B61987FCBF00ADF159 /* listCreate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98B81987FCBD00ADF159 /* listCreate.cpp */; }; + 558B99B71987FCBF00ADF159 /* listDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98B91987FCBD00ADF159 /* listDisplay.cpp */; }; + 558B99B81987FCBF00ADF159 /* listMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98BA1987FCBD00ADF159 /* listMouse.cpp */; }; + 558B99B91987FCBF00ADF159 /* listOps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98BB1987FCBD00ADF159 /* listOps.cpp */; }; + 558B99BA1987FCBF00ADF159 /* listStdLDEF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98BC1987FCBD00ADF159 /* listStdLDEF.cpp */; }; + 558B99BC1987FCBF00ADF159 /* lockrange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98BE1987FCBD00ADF159 /* lockrange.cpp */; }; + 558B99BD1987FCBF00ADF159 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98BF1987FCBD00ADF159 /* main.cpp */; }; + 558B99BF1987FCBF00ADF159 /* mathlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98C11987FCBD00ADF159 /* mathlib.cpp */; }; + 558B99C01987FCBF00ADF159 /* menu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98C21987FCBD00ADF159 /* menu.cpp */; }; + 558B99C11987FCBF00ADF159 /* menuColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98C31987FCBD00ADF159 /* menuColor.cpp */; }; + 558B99C21987FCBF00ADF159 /* menuV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98C41987FCBD00ADF159 /* menuV.cpp */; }; + 558B99C31987FCBF00ADF159 /* mixed_mode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98C51987FCBD00ADF159 /* mixed_mode.cpp */; }; + 558B99C81987FCBF00ADF159 /* mman.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98CA1987FCBD00ADF159 /* mman.cpp */; }; + 558B99C91987FCBF00ADF159 /* mmansubr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98CB1987FCBD00ADF159 /* mmansubr.cpp */; }; + 558B99CB1987FCBF00ADF159 /* notify.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98CD1987FCBD00ADF159 /* notify.cpp */; }; + 558B99CC1987FCBF00ADF159 /* option.mm in Sources */ = {isa = PBXBuildFile; fileRef = 558B98CE1987FCBD00ADF159 /* option.mm */; }; + 558B99CD1987FCBF00ADF159 /* osevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98CF1987FCBD00ADF159 /* osevent.cpp */; }; + 558B99CE1987FCBF00ADF159 /* osutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98D01987FCBD00ADF159 /* osutil.cpp */; }; + 558B99CF1987FCBF00ADF159 /* pack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98D11987FCBD00ADF159 /* pack.cpp */; }; + 558B99D01987FCBF00ADF159 /* paramline.c in Sources */ = {isa = PBXBuildFile; fileRef = 558B98D21987FCBD00ADF159 /* paramline.c */; }; + 558B99D11987FCBF00ADF159 /* parse.y in Sources */ = {isa = PBXBuildFile; fileRef = 558B98D31987FCBD00ADF159 /* parse.y */; }; + 558B99D21987FCBF00ADF159 /* parsenum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98D41987FCBD00ADF159 /* parsenum.cpp */; }; + 558B99D31987FCBF00ADF159 /* parseopt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98D51987FCBD00ADF159 /* parseopt.cpp */; }; + 558B99D41987FCBF00ADF159 /* pef_hash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98D61987FCBD00ADF159 /* pef_hash.cpp */; }; + 558B99D51987FCBF00ADF159 /* prError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98D71987FCBD00ADF159 /* prError.cpp */; }; + 558B99D61987FCBF00ADF159 /* prInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98D81987FCBD00ADF159 /* prInit.cpp */; }; + 558B99D71987FCBF00ADF159 /* priv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98D91987FCBD00ADF159 /* priv.cpp */; }; + 558B99D81987FCBF00ADF159 /* prLowLevel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98DA1987FCBD00ADF159 /* prLowLevel.cpp */; }; + 558B99D91987FCBF00ADF159 /* process.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98DB1987FCBD00ADF159 /* process.cpp */; }; + 558B99DA1987FCBF00ADF159 /* prPrinting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98DC1987FCBD00ADF159 /* prPrinting.cpp */; }; + 558B99DB1987FCBF00ADF159 /* prRecords.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98DD1987FCBD00ADF159 /* prRecords.cpp */; }; + 558B99DC1987FCBF00ADF159 /* PSprint.mm in Sources */ = {isa = PBXBuildFile; fileRef = 558B98DE1987FCBD00ADF159 /* PSprint.mm */; }; + 558B99DD1987FCBF00ADF159 /* PSstrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98DF1987FCBD00ADF159 /* PSstrings.cpp */; }; + 558B99DE1987FCBF00ADF159 /* qBit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98E01987FCBD00ADF159 /* qBit.cpp */; }; + 558B99DF1987FCBF00ADF159 /* qCConv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98E11987FCBD00ADF159 /* qCConv.cpp */; }; + 558B99E01987FCBF00ADF159 /* qCGrafPort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98E21987FCBD00ADF159 /* qCGrafPort.cpp */; }; + 558B99E11987FCBF00ADF159 /* qColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98E31987FCBE00ADF159 /* qColor.cpp */; }; + 558B99E21987FCBF00ADF159 /* qColorMgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98E41987FCBE00ADF159 /* qColorMgr.cpp */; }; + 558B99E31987FCBF00ADF159 /* qColorPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98E51987FCBE00ADF159 /* qColorPicker.cpp */; }; + 558B99E41987FCBF00ADF159 /* qColorutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98E61987FCBE00ADF159 /* qColorutil.cpp */; }; + 558B99E51987FCBF00ADF159 /* qCRegular.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98E71987FCBE00ADF159 /* qCRegular.cpp */; }; + 558B99E61987FCBF00ADF159 /* qCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98E81987FCBE00ADF159 /* qCursor.cpp */; }; + 558B99E71987FCBF00ADF159 /* qGDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98E91987FCBE00ADF159 /* qGDevice.cpp */; }; + 558B99E81987FCBF00ADF159 /* qGrafport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98EA1987FCBE00ADF159 /* qGrafport.cpp */; }; + 558B99E91987FCBF00ADF159 /* qGWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98EB1987FCBE00ADF159 /* qGWorld.cpp */; }; + 558B99EA1987FCBF00ADF159 /* qHooks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98EC1987FCBE00ADF159 /* qHooks.cpp */; }; + 558B99EB1987FCBF00ADF159 /* qIMIV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98ED1987FCBE00ADF159 /* qIMIV.cpp */; }; + 558B99EC1987FCBF00ADF159 /* qIMV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98EE1987FCBE00ADF159 /* qIMV.cpp */; }; + 558B99ED1987FCBF00ADF159 /* qIMVI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98EF1987FCBE00ADF159 /* qIMVI.cpp */; }; + 558B99EE1987FCBF00ADF159 /* qIMVxfer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98F01987FCBE00ADF159 /* qIMVxfer.cpp */; }; + 558B99EF1987FCBF00ADF159 /* qMisc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98F11987FCBE00ADF159 /* qMisc.cpp */; }; + 558B99F01987FCBF00ADF159 /* qPaletteMgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98F21987FCBE00ADF159 /* qPaletteMgr.cpp */; }; + 558B99F11987FCBF00ADF159 /* qPen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98F31987FCBE00ADF159 /* qPen.cpp */; }; + 558B99F21987FCBF00ADF159 /* qPicstuff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98F41987FCBE00ADF159 /* qPicstuff.cpp */; }; + 558B99F31987FCBF00ADF159 /* qPict2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98F51987FCBE00ADF159 /* qPict2.cpp */; }; + 558B99F41987FCBF00ADF159 /* qPicture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98F61987FCBE00ADF159 /* qPicture.cpp */; }; + 558B99F51987FCBF00ADF159 /* qPixMapConv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98F71987FCBE00ADF159 /* qPixMapConv.cpp */; }; + 558B99F61987FCBF00ADF159 /* qPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98F81987FCBE00ADF159 /* qPoint.cpp */; }; + 558B99F71987FCBF00ADF159 /* qPoly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98F91987FCBE00ADF159 /* qPoly.cpp */; }; + 558B99F81987FCBF00ADF159 /* qRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98FA1987FCBE00ADF159 /* qRect.cpp */; }; + 558B99F91987FCBF00ADF159 /* qRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98FB1987FCBE00ADF159 /* qRegion.cpp */; }; + 558B99FA1987FCBF00ADF159 /* qRegular.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98FC1987FCBE00ADF159 /* qRegular.cpp */; }; + 558B99FB1987FCBF00ADF159 /* qScale.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98FD1987FCBE00ADF159 /* qScale.cpp */; }; + 558B99FC1987FCBF00ADF159 /* qStandard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98FE1987FCBE00ADF159 /* qStandard.cpp */; }; + 558B99FD1987FCBF00ADF159 /* qStdArc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98FF1987FCBE00ADF159 /* qStdArc.cpp */; }; + 558B99FE1987FCBF00ADF159 /* qStdBits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99001987FCBE00ADF159 /* qStdBits.cpp */; }; + 558B99FF1987FCBF00ADF159 /* qStdLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99011987FCBE00ADF159 /* qStdLine.cpp */; }; + 558B9A001987FCBF00ADF159 /* qStdOval.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99021987FCBE00ADF159 /* qStdOval.cpp */; }; + 558B9A011987FCBF00ADF159 /* qStdPic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99031987FCBE00ADF159 /* qStdPic.cpp */; }; + 558B9A021987FCBF00ADF159 /* qStdPoly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99041987FCBE00ADF159 /* qStdPoly.cpp */; }; + 558B9A031987FCBF00ADF159 /* qStdRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99051987FCBE00ADF159 /* qStdRect.cpp */; }; + 558B9A041987FCBF00ADF159 /* qStdRgn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99061987FCBE00ADF159 /* qStdRgn.cpp */; }; + 558B9A051987FCBF00ADF159 /* qStdRRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99071987FCBE00ADF159 /* qStdRRect.cpp */; }; + 558B9A061987FCBF00ADF159 /* qStdText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99081987FCBE00ADF159 /* qStdText.cpp */; }; + 558B9A071987FCBF00ADF159 /* qt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99091987FCBE00ADF159 /* qt.cpp */; }; + 558B9A081987FCBF00ADF159 /* qText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B990A1987FCBE00ADF159 /* qText.cpp */; }; + 558B9A091987FCBF00ADF159 /* rawpatblt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B990B1987FCBE00ADF159 /* rawpatblt.cpp */; }; + 558B9A0A1987FCBF00ADF159 /* rawsrcblt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B990C1987FCBE00ADF159 /* rawsrcblt.cpp */; }; + 558B9A0B1987FCBF00ADF159 /* redrawscreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B990D1987FCBE00ADF159 /* redrawscreen.cpp */; }; + 558B9A0C1987FCBF00ADF159 /* refresh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B990E1987FCBE00ADF159 /* refresh.cpp */; }; + 558B9A0D1987FCBF00ADF159 /* resGet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B990F1987FCBE00ADF159 /* resGet.cpp */; }; + 558B9A0E1987FCBF00ADF159 /* resGetinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99101987FCBE00ADF159 /* resGetinfo.cpp */; }; + 558B9A0F1987FCBF00ADF159 /* resGettype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99111987FCBE00ADF159 /* resGettype.cpp */; }; + 558B9A101987FCBF00ADF159 /* resIMIV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99121987FCBE00ADF159 /* resIMIV.cpp */; }; + 558B9A111987FCBF00ADF159 /* resInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99131987FCBE00ADF159 /* resInit.cpp */; }; + 558B9A121987FCBF00ADF159 /* resMisc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99141987FCBE00ADF159 /* resMisc.cpp */; }; + 558B9A131987FCBF00ADF159 /* resMod.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99151987FCBE00ADF159 /* resMod.cpp */; }; + 558B9A141987FCBF00ADF159 /* resOpen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99161987FCBE00ADF159 /* resOpen.cpp */; }; + 558B9A151987FCBF00ADF159 /* resPartial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99171987FCBE00ADF159 /* resPartial.cpp */; }; + 558B9A161987FCBF00ADF159 /* resSetcur.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99181987FCBE00ADF159 /* resSetcur.cpp */; }; + 558B9A171987FCBF00ADF159 /* rgbutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99191987FCBE00ADF159 /* rgbutil.cpp */; }; + 558B9A181987FCBF00ADF159 /* romlib_stubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B991A1987FCBE00ADF159 /* romlib_stubs.cpp */; }; + 558B9A191987FCBF00ADF159 /* scrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B991B1987FCBE00ADF159 /* scrap.cpp */; }; + 558B9A1A1987FCBF00ADF159 /* screen-dump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B991C1987FCBE00ADF159 /* screen-dump.cpp */; }; + 558B9A1B1987FCBF00ADF159 /* script.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B991D1987FCBE00ADF159 /* script.cpp */; }; + 558B9A1D1987FCBF00ADF159 /* serial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B991F1987FCBE00ADF159 /* serial.cpp */; }; + 558B9A1E1987FCBF00ADF159 /* setuid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99201987FCBE00ADF159 /* setuid.cpp */; }; + 558B9A1F1987FCBF00ADF159 /* shutdown.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99211987FCBE00ADF159 /* shutdown.cpp */; }; + 558B9A201987FCBF00ADF159 /* sigio_multiplex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99221987FCBE00ADF159 /* sigio_multiplex.cpp */; }; + 558B9A221987FCBF00ADF159 /* snth5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99241987FCBE00ADF159 /* snth5.cpp */; }; + 558B9A231987FCBF00ADF159 /* sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99251987FCBE00ADF159 /* sound.cpp */; }; + 558B9A241987FCBF00ADF159 /* sounddriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99261987FCBE00ADF159 /* sounddriver.cpp */; }; + 558B9A251987FCBF00ADF159 /* soundfake.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99271987FCBE00ADF159 /* soundfake.cpp */; }; + 558B9A261987FCBF00ADF159 /* soundIMVI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99281987FCBE00ADF159 /* soundIMVI.cpp */; }; + 558B9A271987FCBF00ADF159 /* splash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99291987FCBE00ADF159 /* splash.cpp */; }; + 558B9A281987FCBF00ADF159 /* srcblt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B992A1987FCBE00ADF159 /* srcblt.cpp */; }; + 558B9A291987FCBF00ADF159 /* stdfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B992B1987FCBE00ADF159 /* stdfile.cpp */; }; + 558B9A2A1987FCBF00ADF159 /* stdmbdf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B992C1987FCBE00ADF159 /* stdmbdf.cpp */; }; + 558B9A2B1987FCBF00ADF159 /* stdmdef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B992D1987FCBE00ADF159 /* stdmdef.cpp */; }; + 558B9A2C1987FCBF00ADF159 /* string.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B992E1987FCBE00ADF159 /* string.cpp */; }; + 558B9A2D1987FCBF00ADF159 /* suffix_maps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B992F1987FCBE00ADF159 /* suffix_maps.cpp */; }; + 558B9A2E1987FCBF00ADF159 /* syncint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99301987FCBE00ADF159 /* syncint.cpp */; }; + 558B9A2F1987FCBF00ADF159 /* syserr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99311987FCBE00ADF159 /* syserr.cpp */; }; + 558B9A301987FCBF00ADF159 /* system_error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99321987FCBE00ADF159 /* system_error.cpp */; }; + 558B9A311987FCBF00ADF159 /* teAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99331987FCBE00ADF159 /* teAccess.cpp */; }; + 558B9A321987FCBF00ADF159 /* teDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99341987FCBE00ADF159 /* teDisplay.cpp */; }; + 558B9A331987FCBF00ADF159 /* teEdit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99351987FCBE00ADF159 /* teEdit.cpp */; }; + 558B9A341987FCBF00ADF159 /* teIMIV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99361987FCBE00ADF159 /* teIMIV.cpp */; }; + 558B9A351987FCBF00ADF159 /* teIMV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99371987FCBE00ADF159 /* teIMV.cpp */; }; + 558B9A361987FCBF00ADF159 /* teInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99381987FCBE00ADF159 /* teInit.cpp */; }; + 558B9A371987FCBF00ADF159 /* teInsert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99391987FCBE00ADF159 /* teInsert.cpp */; }; + 558B9A381987FCBF00ADF159 /* teMisc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B993A1987FCBE00ADF159 /* teMisc.cpp */; }; + 558B9A391987FCBF00ADF159 /* tempmem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B993B1987FCBE00ADF159 /* tempmem.cpp */; }; + 558B9A3A1987FCBF00ADF159 /* teScrap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B993C1987FCBE00ADF159 /* teScrap.cpp */; }; + 558B9A3B1987FCBF00ADF159 /* think.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B993D1987FCBE00ADF159 /* think.cpp */; }; + 558B9A3C1987FCBF00ADF159 /* time.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B993E1987FCBE00ADF159 /* time.cpp */; }; + 558B9A3D1987FCBF00ADF159 /* toolevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B993F1987FCBE00ADF159 /* toolevent.cpp */; }; + 558B9A3E1987FCBF00ADF159 /* toolmath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99401987FCBE00ADF159 /* toolmath.cpp */; }; + 558B9A3F1987FCBF00ADF159 /* toolutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99411987FCBE00ADF159 /* toolutil.cpp */; }; + 558B9A401987FCBF00ADF159 /* trapname.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99421987FCBE00ADF159 /* trapname.cpp */; }; + 558B9A411987FCBF00ADF159 /* uniquefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99431987FCBE00ADF159 /* uniquefile.cpp */; }; + 558B9A421987FCBF00ADF159 /* unix_like.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99441987FCBE00ADF159 /* unix_like.cpp */; }; + 558B9A431987FCBF00ADF159 /* vbl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99451987FCBE00ADF159 /* vbl.cpp */; }; + 558B9A441987FCBF00ADF159 /* version.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99461987FCBE00ADF159 /* version.cpp */; }; + 558B9A451987FCBF00ADF159 /* vgavdriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99471987FCBE00ADF159 /* vgavdriver.cpp */; }; + 558B9A461987FCBF00ADF159 /* virtualint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99481987FCBE00ADF159 /* virtualint.cpp */; }; + 558B9A471987FCBF00ADF159 /* windColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99491987FCBE00ADF159 /* windColor.cpp */; }; + 558B9A481987FCBF00ADF159 /* windDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B994A1987FCBF00ADF159 /* windDisplay.cpp */; }; + 558B9A491987FCBF00ADF159 /* windDocdef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B994B1987FCBF00ADF159 /* windDocdef.cpp */; }; + 558B9A4A1987FCBF00ADF159 /* windInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B994C1987FCBF00ADF159 /* windInit.cpp */; }; + 558B9A4B1987FCBF00ADF159 /* windMisc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B994D1987FCBF00ADF159 /* windMisc.cpp */; }; + 558B9A4C1987FCBF00ADF159 /* windMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B994E1987FCBF00ADF159 /* windMouse.cpp */; }; + 558B9A4D1987FCBF00ADF159 /* windSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B994F1987FCBF00ADF159 /* windSize.cpp */; }; + 558B9A4E1987FCBF00ADF159 /* windUpdate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99501987FCBF00ADF159 /* windUpdate.cpp */; }; + 558B9A521987FCDF00ADF159 /* skel in Resources */ = {isa = PBXBuildFile; fileRef = 558B9A511987FCDF00ADF159 /* skel */; }; + 558B9A5D198804D400ADF159 /* syn68k_public.h in Headers */ = {isa = PBXBuildFile; fileRef = 558B9A5C198804D400ADF159 /* syn68k_public.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 559AF49F198ABFE600DE8472 /* Syn68k.c in Sources */ = {isa = PBXBuildFile; fileRef = 559AF49E198ABFE600DE8472 /* Syn68k.c */; }; + 559AF4A0198AC14900DE8472 /* libsyn68k.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 558B9A571988049300ADF159 /* libsyn68k.a */; }; + 559AF4A2198AC90F00DE8472 /* stub.c in Sources */ = {isa = PBXBuildFile; fileRef = 559AF4A1198AC90F00DE8472 /* stub.c */; }; + 559AF4A5198AC9AB00DE8472 /* rsys.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 556062F21988679400D6F0B2 /* rsys.framework */; }; + 559AF4B5198AE0F400DE8472 /* mkexpandtables.c in Sources */ = {isa = PBXBuildFile; fileRef = 559AF4B4198AE0F400DE8472 /* mkexpandtables.c */; }; + 559AF4B8198AF72B00DE8472 /* segment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B991E1987FCBE00ADF159 /* segment.cpp */; }; + 55A742A2198D79DD00F1A8A5 /* SoundOSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55A742A0198D79DD00F1A8A5 /* SoundOSX.cpp */; }; + 55A742A8198D819E00F1A8A5 /* FileDouble-OSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55A742A6198D819E00F1A8A5 /* FileDouble-OSX.cpp */; }; + 55A742AB198DB05100F1A8A5 /* emustubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98851987FCBD00ADF159 /* emustubs.cpp */; }; + 55A742AC198DC09200F1A8A5 /* local_charset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98BD1987FCBD00ADF159 /* local_charset.cpp */; }; + 55A742AE198DE07900F1A8A5 /* check_structs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98611987FCBD00ADF159 /* check_structs.cpp */; }; + 55A742B0198DE1C100F1A8A5 /* slash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55A742AF198DE1C100F1A8A5 /* slash.cpp */; }; + 55D30F53198C1B65009BBB62 /* mkvol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55D30F50198C1B65009BBB62 /* mkvol.cpp */; }; + 55D30F55198C1E3C009BBB62 /* parsenum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98D41987FCBD00ADF159 /* parsenum.cpp */; }; + 55D30F56198C1FE2009BBB62 /* mkvol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55D30F50198C1B65009BBB62 /* mkvol.cpp */; }; + 55D30F59198C38DB009BBB62 /* info.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55D30F5B198C38DB009BBB62 /* info.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXBuildRule section */ + 5500AB2C19858B8F00FF62C0 /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.proxy.script; + filePatterns = "*.map"; + fileType = pattern.proxy; + isEditable = 1; + outputFiles = ( + "$(DERIVED_FILE_DIR)/$(INPUT_FILE_BASE).cmap", + ); + script = "${TARGET_BUILD_DIR}/map_to_c < \"${INPUT_FILE_PATH}\" > \"${DERIVED_FILE_DIR}/${INPUT_FILE_BASE}.cmap\""; + }; +/* End PBXBuildRule section */ + +/* Begin PBXContainerItemProxy section */ + 5500AB2A19858A4F00FF62C0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 556E03FB19856E5700FC4362 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 556E05661985854000FC4362; + remoteInfo = map_to_c; + }; + 5560630B198867C300D6F0B2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 556E03FB19856E5700FC4362 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 556062F11988679400D6F0B2; + remoteInfo = rsys; + }; + 5560630D198867C500D6F0B2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 556E03FB19856E5700FC4362 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 558B9A561988049300ADF159; + remoteInfo = syn68k; + }; + 556E042819856E5700FC4362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 556E03FB19856E5700FC4362 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 556E040219856E5700FC4362; + remoteInfo = CocoaExecutor; + }; + 557F30C8198977AB009873EB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 556E03FB19856E5700FC4362 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 557F30A319897619009873EB; + remoteInfo = mkseedtables; + }; + 557F30CA198977AB009873EB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 556E03FB19856E5700FC4362 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 557F30AE19897653009873EB; + remoteInfo = mkultable; + }; + 557F30CC198977AB009873EB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 556E03FB19856E5700FC4362 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 557F30B91989768A009873EB; + remoteInfo = mksspairtable; + }; + 559AF4A3198AC99B00DE8472 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 556E03FB19856E5700FC4362 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 556E040219856E5700FC4362; + remoteInfo = CocoaExecutor; + }; + 559AF4A6198AD3B400DE8472 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 556E03FB19856E5700FC4362 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 556062F11988679400D6F0B2; + remoteInfo = rsys; + }; + 559AF4B6198AE20300DE8472 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 556E03FB19856E5700FC4362 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 559AF4AC198AE03000DE8472; + remoteInfo = mkexpandtables; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 557F30A219897619009873EB /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; + 557F30AD19897653009873EB /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; + 557F30B81989768A009873EB /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; + 559AF4AB198AE03000DE8472 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; + 55D30F46198C1B08009BBB62 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 5500AB2F1985900000FF62C0 /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; + 5500AB321985911A00FF62C0 /* x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = x86_64.cpp; sourceTree = ""; }; + 5500AB331985911A00FF62C0 /* host-arch-config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "host-arch-config.h"; sourceTree = ""; }; + 5500AB351985A0F600FF62C0 /* host-os-config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "host-os-config.h"; sourceTree = ""; }; + 5500AB361985A40F00FF62C0 /* front-end-config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "front-end-config.h"; sourceTree = ""; }; + 5500AB381985A66A00FF62C0 /* blockinterrupts.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = blockinterrupts.mm; sourceTree = ""; }; + 5500AB391985A66A00FF62C0 /* contextswitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = contextswitch.h; sourceTree = ""; }; + 5500AB3E1985A66A00FF62C0 /* Executor.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Executor.tiff; sourceTree = ""; }; + 5500AB3F1985A66A00FF62C0 /* Executor_main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Executor_main.mm; sourceTree = ""; }; + 5500AB401985A66A00FF62C0 /* host_bltmacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_bltmacros.h; sourceTree = ""; }; + 5500AB411985A66A00FF62C0 /* host_vdriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_vdriver.h; sourceTree = ""; }; + 5500AB421985A66A00FF62C0 /* MacAppClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacAppClass.h; sourceTree = ""; }; + 5500AB431985A66A00FF62C0 /* MacAppClass.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MacAppClass.mm; sourceTree = ""; }; + 5500AB441985A66A00FF62C0 /* MacPrintClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacPrintClass.h; sourceTree = ""; }; + 5500AB451985A66A00FF62C0 /* MacViewClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacViewClass.h; sourceTree = ""; }; + 5500AB461985A66A00FF62C0 /* MacViewClass.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.objcpp; path = MacViewClass.mm; sourceTree = ""; }; + 5500AB471985A66A00FF62C0 /* MacWinClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacWinClass.h; sourceTree = ""; }; + 5500AB481985A66A00FF62C0 /* MacWinClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MacWinClass.m; sourceTree = ""; }; + 5500AB491985A66A00FF62C0 /* NEXT.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NEXT.mm; sourceTree = ""; }; + 5500AB4A1985A66A00FF62C0 /* NEXTkeyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NEXTkeyboard.cpp; sourceTree = ""; usesTabs = 1; }; + 5500AB4B1985A66A00FF62C0 /* NEXTmain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NEXTmain.mm; sourceTree = ""; }; + 5500AB4C1985A66A00FF62C0 /* NEXTprint.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NEXTprint.mm; sourceTree = ""; }; + 5500AB4E1985A66A00FF62C0 /* nextstep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nextstep.h; sourceTree = ""; }; + 5500AB501985A66A00FF62C0 /* ourstuff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ourstuff.h; sourceTree = ""; }; + 5500AB621985B31E00FF62C0 /* ADB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADB.h; sourceTree = ""; }; + 5500AB631985B31E00FF62C0 /* AliasMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliasMgr.h; sourceTree = ""; }; + 5500AB641985B31E00FF62C0 /* AppleEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleEvents.h; sourceTree = ""; }; + 5500AB651985B31E00FF62C0 /* AppleTalk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleTalk.h; sourceTree = ""; }; + 5500AB661985B31E00FF62C0 /* BinaryDecimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BinaryDecimal.h; sourceTree = ""; }; + 5500AB671985B31E00FF62C0 /* CommTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommTool.h; sourceTree = ""; }; + 5500AB681985B31E00FF62C0 /* Components.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Components.h; sourceTree = ""; }; + 5500AB691985B31E00FF62C0 /* ControlMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlMgr.h; sourceTree = ""; }; + 5500AB6A1985B31E00FF62C0 /* CQuickDraw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CQuickDraw.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 5500AB6B1985B31E00FF62C0 /* DeskMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeskMgr.h; sourceTree = ""; }; + 5500AB6C1985B31E00FF62C0 /* DeviceMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceMgr.h; sourceTree = ""; }; + 5500AB6D1985B31E00FF62C0 /* DialogMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DialogMgr.h; sourceTree = ""; }; + 5500AB6E1985B31E00FF62C0 /* Disk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Disk.h; sourceTree = ""; }; + 5500AB6F1985B31E00FF62C0 /* DiskInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiskInit.h; sourceTree = ""; }; + 5500AB701985B31E00FF62C0 /* EditionMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditionMgr.h; sourceTree = ""; }; + 5500AB711985B31E00FF62C0 /* EventMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventMgr.h; sourceTree = ""; }; + 5500AB721985B31E00FF62C0 /* FileMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMgr.h; sourceTree = ""; }; + 5500AB731985B31E00FF62C0 /* Finder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Finder.h; sourceTree = ""; }; + 5500AB741985B31E00FF62C0 /* FontMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontMgr.h; sourceTree = ""; }; + 5500AB751985B31E00FF62C0 /* Gestalt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Gestalt.h; sourceTree = ""; }; + 5500AB761985B31E00FF62C0 /* HelpMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelpMgr.h; sourceTree = ""; }; + 5500AB771985B31E00FF62C0 /* Iconutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Iconutil.h; sourceTree = ""; }; + 5500AB781985B31E00FF62C0 /* IntlUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlUtil.h; sourceTree = ""; }; + 5500AB791985B31E00FF62C0 /* ListMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListMgr.h; sourceTree = ""; }; + 5500AB7A1985B31E00FF62C0 /* MacTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacTypes.h; sourceTree = ""; }; + 5500AB7B1985B31E00FF62C0 /* MemoryMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryMgr.h; sourceTree = ""; }; + 5500AB7C1985B31E00FF62C0 /* MenuMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuMgr.h; sourceTree = ""; }; + 5500AB7D1985B31E00FF62C0 /* NotifyMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotifyMgr.h; sourceTree = ""; }; + 5500AB7E1985B31E00FF62C0 /* OSEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSEvent.h; sourceTree = ""; }; + 5500AB7F1985B31E00FF62C0 /* OSUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSUtil.h; sourceTree = ""; }; + 5500AB801985B31E00FF62C0 /* Package.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Package.h; sourceTree = ""; }; + 5500AB811985B31E00FF62C0 /* paramline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = paramline.h; sourceTree = ""; }; + 5500AB821985B31E00FF62C0 /* PPC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPC.h; sourceTree = ""; }; + 5500AB831985B31E00FF62C0 /* PrintMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = PrintMgr.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 5500AB841985B31E00FF62C0 /* ProcessMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessMgr.h; sourceTree = ""; }; + 5500AB851985B31E00FF62C0 /* QuickDraw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = QuickDraw.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 5500AB861985B31E00FF62C0 /* QuickTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuickTime.h; sourceTree = ""; }; + 5500AB871985B31E00FF62C0 /* ResourceMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceMgr.h; sourceTree = ""; }; + 5500AC2F1985B31E00FF62C0 /* SANE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SANE.h; sourceTree = ""; }; + 5500AC301985B31E00FF62C0 /* ScrapMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrapMgr.h; sourceTree = ""; }; + 5500AC311985B31E00FF62C0 /* ScriptMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptMgr.h; sourceTree = ""; }; + 5500AC321985B31E00FF62C0 /* SegmentLdr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SegmentLdr.h; sourceTree = ""; }; + 5500AC331985B31E00FF62C0 /* Serial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Serial.h; sourceTree = ""; }; + 5500AC341985B31E00FF62C0 /* ShutDown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShutDown.h; sourceTree = ""; }; + 5500AC351985B31E00FF62C0 /* SoundDvr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoundDvr.h; sourceTree = ""; }; + 5500AC361985B31E00FF62C0 /* SoundMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoundMgr.h; sourceTree = ""; }; + 5500AC371985B31E00FF62C0 /* StartMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StartMgr.h; sourceTree = ""; }; + 5500AC381985B31E00FF62C0 /* StdFilePkg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StdFilePkg.h; sourceTree = ""; }; + 5500AC391985B31E00FF62C0 /* SysErr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SysErr.h; sourceTree = ""; }; + 5500AC3A1985B31E00FF62C0 /* TextEdit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextEdit.h; sourceTree = ""; }; + 5500AC3B1985B31E00FF62C0 /* ThinkC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThinkC.h; sourceTree = ""; }; + 5500AC3C1985B31E00FF62C0 /* TimeMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimeMgr.h; sourceTree = ""; }; + 5500AC3D1985B31E00FF62C0 /* ToolboxEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ToolboxEvent.h; sourceTree = ""; }; + 5500AC3E1985B31E00FF62C0 /* ToolboxUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ToolboxUtil.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 5500AC3F1985B31E00FF62C0 /* VDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VDriver.h; sourceTree = ""; }; + 5500AC401985B31E00FF62C0 /* VRetraceMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VRetraceMgr.h; sourceTree = ""; }; + 5500AC411985B31E00FF62C0 /* WindowMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = WindowMgr.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 556062F21988679400D6F0B2 /* rsys.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = rsys.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 556062F51988679400D6F0B2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5560630F1988680000D6F0B2 /* aboutbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aboutbox.h; sourceTree = ""; }; + 556063101988680000D6F0B2 /* aboutpanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aboutpanel.h; sourceTree = ""; }; + 556063111988680000D6F0B2 /* adb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = adb.h; sourceTree = ""; }; + 556063121988680000D6F0B2 /* alias.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = alias.h; sourceTree = ""; }; + 556063131988680000D6F0B2 /* appearance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = appearance.h; sourceTree = ""; }; + 556063141988680000D6F0B2 /* apple_events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = apple_events.h; sourceTree = ""; }; + 556063151988680000D6F0B2 /* arch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = arch.h; sourceTree = ""; }; + 556063161988680000D6F0B2 /* arrowkeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = arrowkeys.h; sourceTree = ""; }; + 556063171988680000D6F0B2 /* autorefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = autorefresh.h; sourceTree = ""; }; + 556063181988680000D6F0B2 /* blockdev.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = blockdev.h; sourceTree = ""; }; + 556063191988680000D6F0B2 /* blockinterrupts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = blockinterrupts.h; sourceTree = ""; }; + 5560631A1988680000D6F0B2 /* byteswap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = byteswap.h; sourceTree = ""; }; + 5560631B1988680000D6F0B2 /* cfm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cfm.h; sourceTree = ""; }; + 5560631C1988680000D6F0B2 /* check_structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = check_structs.h; sourceTree = ""; }; + 5560631D1988680000D6F0B2 /* checkpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = checkpoint.h; sourceTree = ""; }; + 5560631E1988680000D6F0B2 /* cleanup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cleanup.h; sourceTree = ""; }; + 5560631F1988680000D6F0B2 /* color_wheel_bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = color_wheel_bits.h; sourceTree = ""; }; + 556063201988680000D6F0B2 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = ""; }; + 556063211988680000D6F0B2 /* commonevt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = commonevt.h; sourceTree = ""; }; + 556063221988680000D6F0B2 /* cquick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cquick.h; sourceTree = ""; }; + 556063231988680000D6F0B2 /* crc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crc.h; sourceTree = ""; }; + 556063241988680000D6F0B2 /* cruft.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cruft.h; sourceTree = ""; }; + 556063251988680000D6F0B2 /* ctl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ctl.h; sourceTree = ""; }; + 556063261988680000D6F0B2 /* ctopflags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ctopflags.h; sourceTree = ""; }; + 556063271988680000D6F0B2 /* custom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = custom.h; sourceTree = ""; }; + 556063281988680000D6F0B2 /* dcache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dcache.h; sourceTree = ""; }; + 556063291988680000D6F0B2 /* depthconv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = depthconv.h; sourceTree = ""; }; + 5560632A1988680000D6F0B2 /* desk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = desk.h; sourceTree = ""; }; + 5560632B1988680000D6F0B2 /* desperate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = desperate.h; sourceTree = ""; }; + 5560632C1988680000D6F0B2 /* device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device.h; sourceTree = ""; }; + 5560632D1988680000D6F0B2 /* dial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dial.h; sourceTree = ""; }; + 5560632E1988680000D6F0B2 /* dirtyrect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dirtyrect.h; sourceTree = ""; }; + 5560632F1988680000D6F0B2 /* drive_flags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = drive_flags.h; sourceTree = ""; }; + 556063301988680000D6F0B2 /* dump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dump.h; sourceTree = ""; }; + 556063311988680000D6F0B2 /* emustubs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = emustubs.h; sourceTree = ""; }; + 556063321988680000D6F0B2 /* error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = error.h; sourceTree = ""; }; + 556063331988680000D6F0B2 /* everything.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = everything.h; sourceTree = ""; }; + 556063341988680000D6F0B2 /* evil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = evil.h; sourceTree = ""; }; + 556063351988680000D6F0B2 /* executor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = executor.h; sourceTree = ""; }; + 556063361988680000D6F0B2 /* fauxdbm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fauxdbm.h; sourceTree = ""; }; + 556063371988680000D6F0B2 /* file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = file.h; sourceTree = ""; }; + 556063381988680000D6F0B2 /* filedouble.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = filedouble.h; sourceTree = ""; }; + 556063391988680000D6F0B2 /* flags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flags.h; sourceTree = ""; }; + 5560633A1988680000D6F0B2 /* float_fcw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = float_fcw.h; sourceTree = ""; }; + 5560633B1988680000D6F0B2 /* float.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = float.h; sourceTree = ""; }; + 5560633C1988680000D6F0B2 /* floatconv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = floatconv.h; sourceTree = ""; }; + 5560633D1988680000D6F0B2 /* font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = font.h; sourceTree = ""; }; + 5560633E1988680000D6F0B2 /* gestalt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gestalt.h; sourceTree = ""; }; + 5560633F1988680000D6F0B2 /* glue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = glue.h; sourceTree = ""; }; + 556063401988680000D6F0B2 /* gworld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gworld.h; sourceTree = ""; }; + 556063411988680000D6F0B2 /* hfs_plus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs_plus.h; sourceTree = ""; }; + 556063421988680000D6F0B2 /* hfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs.h; sourceTree = ""; }; + 556063431988680000D6F0B2 /* hook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hook.h; sourceTree = ""; }; + 556063441988680000D6F0B2 /* host.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host.h; sourceTree = ""; }; + 556063451988680000D6F0B2 /* icon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icon.h; sourceTree = ""; }; + 556063461988680000D6F0B2 /* image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = image.h; sourceTree = ""; }; + 556063471988680000D6F0B2 /* ini.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ini.h; sourceTree = ""; }; + 556063481988680000D6F0B2 /* interfacelib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = interfacelib.h; sourceTree = ""; }; + 556063491988680000D6F0B2 /* itm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = itm.h; sourceTree = ""; }; + 5560634A1988680000D6F0B2 /* iv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iv.h; sourceTree = ""; }; + 5560634B1988680000D6F0B2 /* jumpvectors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jumpvectors.h; sourceTree = ""; }; + 5560634C1988680000D6F0B2 /* keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keyboard.h; sourceTree = ""; }; + 5560634D1988680000D6F0B2 /* keyboards.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keyboards.h; sourceTree = ""; }; + 5560634E1988680000D6F0B2 /* keycode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keycode.h; sourceTree = ""; }; + 5560634F1988680000D6F0B2 /* launch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = launch.h; sourceTree = ""; }; + 556063501988680000D6F0B2 /* libcproto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libcproto.h; sourceTree = ""; }; + 556063511988680000D6F0B2 /* licensetext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = licensetext.h; sourceTree = ""; }; + 556063521988680000D6F0B2 /* list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = list.h; sourceTree = ""; }; + 556063531988680000D6F0B2 /* local_charset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = local_charset.h; sourceTree = ""; }; + 556063541988680000D6F0B2 /* lockunlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lockunlock.h; sourceTree = ""; }; + 556063551988680000D6F0B2 /* lowglobals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lowglobals.h; sourceTree = ""; }; + 556063561988680000D6F0B2 /* m68kint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = m68kint.h; sourceTree = ""; }; + 556063571988680000D6F0B2 /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macros.h; sourceTree = ""; }; + 556063581988680000D6F0B2 /* mactype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mactype.h; sourceTree = ""; }; + 556063591988680000D6F0B2 /* mathlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mathlib.h; sourceTree = ""; }; + 5560635A1988680000D6F0B2 /* memory_layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory_layout.h; sourceTree = ""; }; + 5560635B1988680000D6F0B2 /* memsize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memsize.h; sourceTree = ""; }; + 5560635C1988680000D6F0B2 /* menu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = menu.h; sourceTree = ""; }; + 5560635D1988680000D6F0B2 /* misc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = misc.h; sourceTree = ""; }; + 5560635E1988680000D6F0B2 /* mixed_mode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mixed_mode.h; sourceTree = ""; }; + 5560635F1988680000D6F0B2 /* mman_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mman_private.h; sourceTree = ""; }; + 556063601988680000D6F0B2 /* mman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mman.h; sourceTree = ""; }; + 556063611988680000D6F0B2 /* mmanstubs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmanstubs.h; sourceTree = ""; }; + 556063621988680000D6F0B2 /* new_mmanstubs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = new_mmanstubs.h; sourceTree = ""; }; + 556063631988680000D6F0B2 /* newvga.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = newvga.h; sourceTree = ""; }; + 556063641988680000D6F0B2 /* next.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = next.h; sourceTree = ""; }; + 556063651988680000D6F0B2 /* nextprint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nextprint.h; sourceTree = ""; }; + 556063661988680000D6F0B2 /* noreturn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = noreturn.h; sourceTree = ""; }; + 556063671988680000D6F0B2 /* notmac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = notmac.h; sourceTree = ""; }; + 556063681988680000D6F0B2 /* Olibcproto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Olibcproto.h; sourceTree = ""; }; + 556063691988680000D6F0B2 /* option.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = option.h; sourceTree = ""; }; + 5560636A1988680000D6F0B2 /* options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = options.h; sourceTree = ""; }; + 5560636B1988680000D6F0B2 /* os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = os.h; sourceTree = ""; }; + 5560636C1988680000D6F0B2 /* osevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = osevent.h; sourceTree = ""; }; + 5560636D1988680000D6F0B2 /* osutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = osutil.h; sourceTree = ""; }; + 5560636E1988680000D6F0B2 /* parse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parse.h; sourceTree = ""; }; + 5560636F1988680000D6F0B2 /* parsenum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parsenum.h; sourceTree = ""; }; + 556063701988680000D6F0B2 /* parseopt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parseopt.h; sourceTree = ""; }; + 556063711988680000D6F0B2 /* partition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = partition.h; sourceTree = ""; }; + 556063721988680000D6F0B2 /* pef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pef.h; sourceTree = ""; }; + 556063731988680000D6F0B2 /* picture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = picture.h; sourceTree = ""; }; + 556063741988680000D6F0B2 /* pragmal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pragmal.h; sourceTree = ""; }; + 556063751988680000D6F0B2 /* pragmar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pragmar.h; sourceTree = ""; }; + 556063761988680000D6F0B2 /* pragmas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pragmas.h; sourceTree = ""; }; + 556063771988680000D6F0B2 /* prefpanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prefpanel.h; sourceTree = ""; }; + 556063781988680000D6F0B2 /* prefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prefs.h; sourceTree = ""; }; + 556063791988680000D6F0B2 /* print.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = print.h; sourceTree = ""; }; + 5560637A1988680000D6F0B2 /* process.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = process.h; sourceTree = ""; }; + 5560637B1988680000D6F0B2 /* PSstrings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSstrings.h; sourceTree = ""; }; + 5560637C1988680000D6F0B2 /* pstuff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pstuff.h; sourceTree = ""; }; + 5560637D1988680000D6F0B2 /* ptocflags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ptocflags.h; sourceTree = ""; }; + 5560637E1988680000D6F0B2 /* qcolor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qcolor.h; sourceTree = ""; }; + 5560637F1988680000D6F0B2 /* quick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = quick.h; sourceTree = ""; }; + 556063801988680000D6F0B2 /* rawblt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rawblt.h; sourceTree = ""; }; + 556063811988680000D6F0B2 /* redrawscreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = redrawscreen.h; sourceTree = ""; }; + 556063821988680000D6F0B2 /* refresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = refresh.h; sourceTree = ""; }; + 556063831988680000D6F0B2 /* region.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = region.h; sourceTree = ""; }; + 556063841988680000D6F0B2 /* release.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = release.h; sourceTree = ""; }; + 556063851988680000D6F0B2 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resource.h; sourceTree = ""; }; + 556063861988680000D6F0B2 /* rgbutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rgbutil.h; sourceTree = ""; }; + 556063871988680000D6F0B2 /* safe_alloca.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = safe_alloca.h; sourceTree = ""; }; + 556063881988680000D6F0B2 /* scrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scrap.h; sourceTree = ""; }; + 556063891988680000D6F0B2 /* screen-dump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "screen-dump.h"; sourceTree = ""; }; + 5560638A1988680000D6F0B2 /* segment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = segment.h; sourceTree = ""; }; + 5560638B1988680000D6F0B2 /* serial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = serial.h; sourceTree = ""; }; + 5560638C1988680000D6F0B2 /* setuid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setuid.h; sourceTree = ""; }; + 5560638D1988680000D6F0B2 /* sigio_multiplex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sigio_multiplex.h; sourceTree = ""; }; + 5560638E1988680000D6F0B2 /* slash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = slash.h; sourceTree = ""; }; + 5560638F1988680000D6F0B2 /* smash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = smash.h; sourceTree = ""; }; + 556063901988680000D6F0B2 /* sounddriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sounddriver.h; sourceTree = ""; }; + 556063911988680000D6F0B2 /* soundfake.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = soundfake.h; sourceTree = ""; }; + 556063921988680000D6F0B2 /* soundopts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = soundopts.h; sourceTree = ""; }; + 556063931988680000D6F0B2 /* splash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = splash.h; sourceTree = ""; }; + 556063941988680000D6F0B2 /* srcblt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = srcblt.h; sourceTree = ""; }; + 556063951988680000D6F0B2 /* stdbits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdbits.h; sourceTree = ""; }; + 556063961988680000D6F0B2 /* stdfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdfile.h; sourceTree = ""; }; + 556063971988680000D6F0B2 /* stdio_smashage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdio_smashage.h; sourceTree = ""; }; + 556063981988680000D6F0B2 /* string.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = string.h; sourceTree = ""; }; + 556063991988680000D6F0B2 /* stubify.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stubify.h; sourceTree = ""; }; + 5560639A1988680000D6F0B2 /* suffix_maps.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = suffix_maps.h; sourceTree = ""; }; + 5560639B1988680000D6F0B2 /* syncint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = syncint.h; sourceTree = ""; }; + 5560639C1988680000D6F0B2 /* syserr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = syserr.h; sourceTree = ""; }; + 5560639D1988680000D6F0B2 /* system_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = system_error.h; sourceTree = ""; }; + 5560639E1988680000D6F0B2 /* tempalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tempalloc.h; sourceTree = ""; }; + 5560639F1988680000D6F0B2 /* tesave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tesave.h; sourceTree = ""; }; + 556063A01988680000D6F0B2 /* text.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = text.h; sourceTree = ""; }; + 556063A11988680000D6F0B2 /* time.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = time.h; sourceTree = ""; }; + 556063A21988680000D6F0B2 /* toolevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = toolevent.h; sourceTree = ""; }; + 556063A31988680000D6F0B2 /* toolutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = toolutil.h; sourceTree = ""; }; + 556063A41988680000D6F0B2 /* trapdecl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = trapdecl.h; sourceTree = ""; }; + 556063A51988680000D6F0B2 /* trapdefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = trapdefines.h; sourceTree = ""; }; + 556063A61988680000D6F0B2 /* trapglue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = trapglue.h; sourceTree = ""; }; + 556063A71988680000D6F0B2 /* trapname.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = trapname.h; sourceTree = ""; }; + 556063A81988680000D6F0B2 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; + 556063A91988680000D6F0B2 /* uniquefile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uniquefile.h; sourceTree = ""; }; + 556063AA1988680000D6F0B2 /* vbl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vbl.h; sourceTree = ""; }; + 556063AB1988680000D6F0B2 /* vdriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vdriver.h; sourceTree = ""; }; + 556063AC1988680000D6F0B2 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = ""; }; + 556063AD1988680000D6F0B2 /* vgavdriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vgavdriver.h; sourceTree = ""; }; + 556063AE1988680000D6F0B2 /* wind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wind.h; sourceTree = ""; }; + 556063AF1988680000D6F0B2 /* wrappers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrappers.h; sourceTree = ""; }; + 556063B01988680000D6F0B2 /* x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x.h; sourceTree = ""; }; + 556063B11988680000D6F0B2 /* xdata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdata.h; sourceTree = ""; }; + 556063B21988680000D6F0B2 /* xdblt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xdblt.h; sourceTree = ""; }; + 556063B31988680000D6F0B2 /* Xdefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Xdefs.h; sourceTree = ""; }; + 556E040319856E5700FC4362 /* NeoClassic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NeoClassic.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 556E040619856E5700FC4362 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 556E040919856E5700FC4362 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 556E040A19856E5700FC4362 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 556E040B19856E5700FC4362 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 556E040E19856E5700FC4362 /* CocoaExecutor-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CocoaExecutor-Info.plist"; sourceTree = ""; }; + 556E041019856E5700FC4362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 556E041419856E5700FC4362 /* CocoaExecutor-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CocoaExecutor-Prefix.pch"; sourceTree = ""; }; + 556E041619856E5700FC4362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; + 556E041E19856E5700FC4362 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 556E042419856E5700FC4362 /* CocoaExecutorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CocoaExecutorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 556E042519856E5700FC4362 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 556E042C19856E5700FC4362 /* CocoaExecutorTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CocoaExecutorTests-Info.plist"; sourceTree = ""; }; + 556E042E19856E5700FC4362 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 556E043019856E5700FC4362 /* CocoaExecutorTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CocoaExecutorTests.m; sourceTree = ""; }; + 556E0547198584DE00FC4362 /* active.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = active.map; sourceTree = ""; }; + 556E0548198584DE00FC4362 /* apple.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = apple.map; sourceTree = ""; }; + 556E0549198584DE00FC4362 /* arrow_down_active.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = arrow_down_active.map; sourceTree = ""; }; + 556E054A198584DE00FC4362 /* arrow_down_inactive.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = arrow_down_inactive.map; sourceTree = ""; }; + 556E054B198584DE00FC4362 /* arrow_left_active.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = arrow_left_active.map; sourceTree = ""; }; + 556E054C198584DE00FC4362 /* arrow_left_inactive.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = arrow_left_inactive.map; sourceTree = ""; }; + 556E054D198584DE00FC4362 /* arrow_right_active.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = arrow_right_active.map; sourceTree = ""; }; + 556E054E198584DE00FC4362 /* arrow_right_inactive.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = arrow_right_inactive.map; sourceTree = ""; }; + 556E054F198584DE00FC4362 /* arrow_up_active.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = arrow_up_active.map; sourceTree = ""; }; + 556E0550198584DE00FC4362 /* arrow_up_inactive.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = arrow_up_inactive.map; sourceTree = ""; }; + 556E0551198584DE00FC4362 /* go_away.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = go_away.map; sourceTree = ""; }; + 556E0552198584DE00FC4362 /* grow.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = grow.map; sourceTree = ""; }; + 556E0553198584DE00FC4362 /* ractive.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ractive.map; sourceTree = ""; }; + 556E0554198584DE00FC4362 /* zoom.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = zoom.map; sourceTree = ""; }; + 556E05671985854000FC4362 /* map_to_c */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = map_to_c; sourceTree = BUILT_PRODUCTS_DIR; }; + 556E05701985855100FC4362 /* map_to_c.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = map_to_c.cpp; sourceTree = ""; }; + 556E06191985873F00FC4362 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = System/Library/Frameworks/ApplicationServices.framework; sourceTree = SDKROOT; }; + 557F308819895405009873EB /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; + 557F308B19895414009873EB /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; + 557F308D198967BE009873EB /* stdfile-OSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "stdfile-OSX.cpp"; sourceTree = ""; }; + 557F308E198967BE009873EB /* stdfile-OSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "stdfile-OSX.h"; sourceTree = ""; }; + 557F3091198974E4009873EB /* genctopflags_h.tmpl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = genctopflags_h.tmpl; sourceTree = ""; }; + 557F3092198974E4009873EB /* geninterfacelib.tmpl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = geninterfacelib.tmpl; sourceTree = ""; }; + 557F3093198974E4009873EB /* genptocflags_h.tmpl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = genptocflags_h.tmpl; sourceTree = ""; }; + 557F3094198974E4009873EB /* genstubify_h.tmpl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = genstubify_h.tmpl; sourceTree = ""; }; + 557F3095198974E4009873EB /* genstubify_s.tmpl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = genstubify_s.tmpl; sourceTree = ""; }; + 557F3096198974E4009873EB /* pat-blitters.tmpl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pat-blitters.tmpl"; sourceTree = ""; }; + 557F3097198974E4009873EB /* src-blitters.tmpl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "src-blitters.tmpl"; sourceTree = ""; }; + 557F309F19897549009873EB /* trapinfo */ = {isa = PBXFileReference; lastKnownFileType = text; path = trapinfo; sourceTree = ""; }; + 557F30A419897619009873EB /* mkseedtables */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mkseedtables; sourceTree = BUILT_PRODUCTS_DIR; }; + 557F30AF19897653009873EB /* mkultable */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mkultable; sourceTree = BUILT_PRODUCTS_DIR; }; + 557F30BA1989768A009873EB /* mksspairtable */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mksspairtable; sourceTree = BUILT_PRODUCTS_DIR; }; + 557F30C1198976A9009873EB /* mkseedtables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mkseedtables.c; sourceTree = ""; }; + 557F30C3198976DC009873EB /* mkultable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mkultable.c; sourceTree = ""; }; + 557F30C51989771D009873EB /* mksspairtable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mksspairtable.c; sourceTree = ""; }; + 557F30CE19897991009873EB /* thumb_horiz.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = thumb_horiz.map; sourceTree = ""; }; + 557F30CF19897991009873EB /* thumb_vert.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = thumb_vert.map; sourceTree = ""; }; + 557F30D2198982DC009873EB /* CFriendly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFriendly.h; sourceTree = ""; }; + 557F30D419898513009873EB /* CBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBridge.cpp; sourceTree = ""; }; + 557F30D619899569009873EB /* sound-config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "sound-config.h"; sourceTree = ""; }; + 557F30D81989B5B2009873EB /* makerawblt.pl */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = makerawblt.pl; path = ../../src/makerawblt.pl; sourceTree = ""; }; + 558B98511987F5BA00ADF159 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; + 558B98541987FCBD00ADF159 /* aboutbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = aboutbox.cpp; sourceTree = ""; }; + 558B98551987FCBD00ADF159 /* adb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = adb.cpp; sourceTree = ""; }; + 558B98561987FCBD00ADF159 /* AE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AE.cpp; sourceTree = ""; }; + 558B98571987FCBD00ADF159 /* AE_coercion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AE_coercion.cpp; sourceTree = ""; }; + 558B98581987FCBD00ADF159 /* AE_desc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AE_desc.cpp; sourceTree = ""; }; + 558B98591987FCBD00ADF159 /* AE_hdlr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AE_hdlr.cpp; sourceTree = ""; }; + 558B985A1987FCBD00ADF159 /* alias.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = alias.cpp; sourceTree = ""; }; + 558B985B1987FCBD00ADF159 /* appearance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = appearance.cpp; sourceTree = ""; }; + 558B985C1987FCBD00ADF159 /* autorefresh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = autorefresh.cpp; sourceTree = ""; }; + 558B985D1987FCBD00ADF159 /* balloon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = balloon.cpp; sourceTree = ""; }; + 558B985E1987FCBD00ADF159 /* bindec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bindec.cpp; sourceTree = ""; usesTabs = 0; }; + 558B985F1987FCBD00ADF159 /* blockdev.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = blockdev.cpp; sourceTree = ""; }; + 558B98601987FCBD00ADF159 /* cfm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cfm.cpp; sourceTree = ""; }; + 558B98611987FCBD00ADF159 /* check_structs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = check_structs.cpp; sourceTree = ""; }; + 558B98621987FCBD00ADF159 /* checkpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = checkpoint.cpp; sourceTree = ""; }; + 558B98631987FCBD00ADF159 /* cleanup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cleanup.cpp; sourceTree = ""; }; + 558B98641987FCBD00ADF159 /* color_wheel_bits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = color_wheel_bits.cpp; sourceTree = ""; }; + 558B98651987FCBD00ADF159 /* commtool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = commtool.cpp; sourceTree = ""; }; + 558B98661987FCBD00ADF159 /* crc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = crc.cpp; sourceTree = ""; }; + 558B98671987FCBD00ADF159 /* ctlArrows.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ctlArrows.cpp; sourceTree = ""; }; + 558B98681987FCBD00ADF159 /* ctlDisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ctlDisplay.cpp; sourceTree = ""; }; + 558B98691987FCBD00ADF159 /* ctlIMIV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ctlIMIV.cpp; sourceTree = ""; }; + 558B986A1987FCBD00ADF159 /* ctlInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ctlInit.cpp; sourceTree = ""; }; + 558B986B1987FCBD00ADF159 /* ctlMisc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ctlMisc.cpp; sourceTree = ""; }; + 558B986C1987FCBD00ADF159 /* ctlMouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ctlMouse.cpp; sourceTree = ""; }; + 558B986D1987FCBD00ADF159 /* ctlPopup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ctlPopup.cpp; sourceTree = ""; }; + 558B986E1987FCBD00ADF159 /* ctlSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ctlSet.cpp; sourceTree = ""; }; + 558B986F1987FCBD00ADF159 /* ctlSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ctlSize.cpp; sourceTree = ""; }; + 558B98701987FCBD00ADF159 /* ctlStddef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ctlStddef.cpp; sourceTree = ""; }; + 558B98711987FCBD00ADF159 /* custom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = custom.cpp; sourceTree = ""; }; + 558B98721987FCBD00ADF159 /* dcache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dcache.cpp; sourceTree = ""; }; + 558B98731987FCBD00ADF159 /* dcconvert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dcconvert.cpp; sourceTree = ""; }; + 558B98741987FCBD00ADF159 /* dcmaketables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dcmaketables.cpp; sourceTree = ""; }; + 558B98751987FCBD00ADF159 /* default_ctab_values.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = default_ctab_values.cpp; sourceTree = ""; }; + 558B98761987FCBD00ADF159 /* desk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = desk.cpp; sourceTree = ""; }; + 558B98771987FCBD00ADF159 /* desperate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = desperate.cpp; sourceTree = ""; }; + 558B98781987FCBD00ADF159 /* device.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = device.cpp; sourceTree = ""; }; + 558B98791987FCBD00ADF159 /* dialAlert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialAlert.cpp; sourceTree = ""; }; + 558B987A1987FCBD00ADF159 /* dialCreate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialCreate.cpp; sourceTree = ""; }; + 558B987B1987FCBD00ADF159 /* dialDispatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialDispatch.cpp; sourceTree = ""; }; + 558B987C1987FCBD00ADF159 /* dialHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialHandle.cpp; sourceTree = ""; }; + 558B987D1987FCBD00ADF159 /* dialInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialInit.cpp; sourceTree = ""; }; + 558B987E1987FCBD00ADF159 /* dialItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialItem.cpp; sourceTree = ""; }; + 558B987F1987FCBD00ADF159 /* dialManip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialManip.cpp; sourceTree = ""; }; + 558B98801987FCBD00ADF159 /* dirtyrect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dirtyrect.cpp; sourceTree = ""; }; + 558B98811987FCBD00ADF159 /* disk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = disk.cpp; sourceTree = ""; }; + 558B98821987FCBD00ADF159 /* diskinit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = diskinit.cpp; sourceTree = ""; }; + 558B98831987FCBD00ADF159 /* dump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dump.cpp; sourceTree = ""; }; + 558B98841987FCBD00ADF159 /* edition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = edition.cpp; sourceTree = ""; }; + 558B98851987FCBD00ADF159 /* emustubs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = emustubs.cpp; sourceTree = ""; }; + 558B98861987FCBD00ADF159 /* emutrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = emutrap.cpp; sourceTree = ""; }; + 558B98871987FCBD00ADF159 /* emutraptables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = emutraptables.cpp; sourceTree = ""; }; + 558B98881987FCBD00ADF159 /* error.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = error.cpp; sourceTree = ""; }; + 558B98891987FCBD00ADF159 /* executor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = executor.cpp; sourceTree = ""; }; + 558B988A1987FCBD00ADF159 /* fauxdbm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fauxdbm.c; sourceTree = ""; }; + 558B988B1987FCBD00ADF159 /* fileAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileAccess.cpp; sourceTree = ""; }; + 558B988C1987FCBD00ADF159 /* fileCreate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileCreate.cpp; sourceTree = ""; }; + 558B988D1987FCBD00ADF159 /* fileDirs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileDirs.cpp; sourceTree = ""; }; + 558B988E1987FCBD00ADF159 /* fileDouble.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileDouble.cpp; sourceTree = ""; }; + 558B988F1987FCBD00ADF159 /* fileHighlevel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileHighlevel.cpp; sourceTree = ""; }; + 558B98901987FCBD00ADF159 /* fileInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileInfo.cpp; sourceTree = ""; }; + 558B98911987FCBD00ADF159 /* fileMisc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileMisc.cpp; sourceTree = ""; }; + 558B98921987FCBD00ADF159 /* fileVolumes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = fileVolumes.cpp; sourceTree = ""; usesTabs = 0; }; + 558B98931987FCBD00ADF159 /* finder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = finder.cpp; sourceTree = ""; }; + 558B98941987FCBD00ADF159 /* float4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = float4.cpp; sourceTree = ""; }; + 558B98951987FCBD00ADF159 /* float5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = float5.cpp; sourceTree = ""; }; + 558B98961987FCBD00ADF159 /* float7.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = float7.cpp; sourceTree = ""; }; + 558B98971987FCBD00ADF159 /* floatnext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = floatnext.cpp; sourceTree = ""; }; + 558B98981987FCBD00ADF159 /* font.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = font.cpp; sourceTree = ""; }; + 558B98991987FCBD00ADF159 /* fontIMVI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fontIMVI.cpp; sourceTree = ""; }; + 558B989A1987FCBD00ADF159 /* genfndecls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = genfndecls.cpp; sourceTree = ""; }; + 558B989B1987FCBD00ADF159 /* genrand_h.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = genrand_h.c; sourceTree = ""; }; + 558B989C1987FCBD00ADF159 /* gensplash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gensplash.cpp; sourceTree = ""; }; + 558B989D1987FCBD00ADF159 /* gestalt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gestalt.cpp; sourceTree = ""; }; + 558B989E1987FCBD00ADF159 /* globals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = globals.cpp; sourceTree = ""; }; + 558B989F1987FCBD00ADF159 /* hfsBtree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsBtree.cpp; sourceTree = ""; usesTabs = 0; }; + 558B98A01987FCBD00ADF159 /* hfsChanging.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsChanging.cpp; sourceTree = ""; }; + 558B98A11987FCBD00ADF159 /* hfsCreate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsCreate.cpp; sourceTree = ""; }; + 558B98A21987FCBD00ADF159 /* hfsFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsFile.cpp; sourceTree = ""; }; + 558B98A31987FCBD00ADF159 /* hfsHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsHelper.cpp; sourceTree = ""; usesTabs = 0; }; + 558B98A41987FCBD00ADF159 /* hfsHier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsHier.cpp; sourceTree = ""; }; + 558B98A51987FCBD00ADF159 /* hfsMisc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsMisc.cpp; sourceTree = ""; }; + 558B98A61987FCBD00ADF159 /* hfsVolume.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsVolume.cpp; sourceTree = ""; }; + 558B98A71987FCBD00ADF159 /* hfsWorkingdir.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsWorkingdir.cpp; sourceTree = ""; }; + 558B98A81987FCBD00ADF159 /* hfsXbar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsXbar.cpp; sourceTree = ""; }; + 558B98A91987FCBD00ADF159 /* hintemplate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hintemplate.h; sourceTree = ""; }; + 558B98AA1987FCBD00ADF159 /* hle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hle.cpp; sourceTree = ""; }; + 558B98AB1987FCBD00ADF159 /* ibm_keycodes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ibm_keycodes.cpp; sourceTree = ""; }; + 558B98AC1987FCBD00ADF159 /* icon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = icon.cpp; sourceTree = ""; }; + 558B98AD1987FCBD00ADF159 /* image.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = image.cpp; sourceTree = ""; }; + 558B98AE1987FCBD00ADF159 /* image_inits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = image_inits.cpp; sourceTree = ""; }; + 558B98AF1987FCBD00ADF159 /* ini.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ini.cpp; sourceTree = ""; }; + 558B98B01987FCBD00ADF159 /* interfacelib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = interfacelib.cpp; sourceTree = ""; }; + 558B98B11987FCBD00ADF159 /* iu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iu.cpp; sourceTree = ""; }; + 558B98B21987FCBD00ADF159 /* iv-stubs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "iv-stubs.cpp"; sourceTree = ""; }; + 558B98B31987FCBD00ADF159 /* keycode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = keycode.mm; sourceTree = ""; }; + 558B98B41987FCBD00ADF159 /* launch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = launch.cpp; sourceTree = ""; }; + 558B98B61987FCBD00ADF159 /* listAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listAccess.cpp; sourceTree = ""; }; + 558B98B71987FCBD00ADF159 /* listAddDel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listAddDel.cpp; sourceTree = ""; }; + 558B98B81987FCBD00ADF159 /* listCreate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listCreate.cpp; sourceTree = ""; }; + 558B98B91987FCBD00ADF159 /* listDisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listDisplay.cpp; sourceTree = ""; }; + 558B98BA1987FCBD00ADF159 /* listMouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listMouse.cpp; sourceTree = ""; }; + 558B98BB1987FCBD00ADF159 /* listOps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listOps.cpp; sourceTree = ""; }; + 558B98BC1987FCBD00ADF159 /* listStdLDEF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listStdLDEF.cpp; sourceTree = ""; }; + 558B98BD1987FCBD00ADF159 /* local_charset.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = local_charset.cpp; sourceTree = ""; }; + 558B98BE1987FCBD00ADF159 /* lockrange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lockrange.cpp; sourceTree = ""; }; + 558B98BF1987FCBD00ADF159 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; + 558B98C11987FCBD00ADF159 /* mathlib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mathlib.cpp; sourceTree = ""; }; + 558B98C21987FCBD00ADF159 /* menu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = menu.cpp; sourceTree = ""; }; + 558B98C31987FCBD00ADF159 /* menuColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = menuColor.cpp; sourceTree = ""; }; + 558B98C41987FCBD00ADF159 /* menuV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = menuV.cpp; sourceTree = ""; }; + 558B98C51987FCBD00ADF159 /* mixed_mode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mixed_mode.cpp; sourceTree = ""; }; + 558B98CA1987FCBD00ADF159 /* mman.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mman.cpp; sourceTree = ""; }; + 558B98CB1987FCBD00ADF159 /* mmansubr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mmansubr.cpp; sourceTree = ""; }; + 558B98CC1987FCBD00ADF159 /* munger_test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = munger_test.c; sourceTree = ""; }; + 558B98CD1987FCBD00ADF159 /* notify.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = notify.cpp; sourceTree = ""; }; + 558B98CE1987FCBD00ADF159 /* option.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.objcpp; path = option.mm; sourceTree = ""; usesTabs = 0; }; + 558B98CF1987FCBD00ADF159 /* osevent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = osevent.cpp; sourceTree = ""; }; + 558B98D01987FCBD00ADF159 /* osutil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = osutil.cpp; sourceTree = ""; }; + 558B98D11987FCBD00ADF159 /* pack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pack.cpp; sourceTree = ""; }; + 558B98D21987FCBD00ADF159 /* paramline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = paramline.c; sourceTree = ""; }; + 558B98D31987FCBD00ADF159 /* parse.y */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; path = parse.y; sourceTree = ""; }; + 558B98D41987FCBD00ADF159 /* parsenum.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parsenum.cpp; sourceTree = ""; }; + 558B98D51987FCBD00ADF159 /* parseopt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parseopt.cpp; sourceTree = ""; }; + 558B98D61987FCBD00ADF159 /* pef_hash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pef_hash.cpp; sourceTree = ""; }; + 558B98D71987FCBD00ADF159 /* prError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = prError.cpp; sourceTree = ""; }; + 558B98D81987FCBD00ADF159 /* prInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = prInit.cpp; sourceTree = ""; }; + 558B98D91987FCBD00ADF159 /* priv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = priv.cpp; sourceTree = ""; }; + 558B98DA1987FCBD00ADF159 /* prLowLevel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = prLowLevel.cpp; sourceTree = ""; }; + 558B98DB1987FCBD00ADF159 /* process.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = process.cpp; sourceTree = ""; }; + 558B98DC1987FCBD00ADF159 /* prPrinting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = prPrinting.cpp; sourceTree = ""; }; + 558B98DD1987FCBD00ADF159 /* prRecords.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = prRecords.cpp; sourceTree = ""; }; + 558B98DE1987FCBD00ADF159 /* PSprint.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PSprint.mm; sourceTree = ""; usesTabs = 0; }; + 558B98DF1987FCBD00ADF159 /* PSstrings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PSstrings.cpp; sourceTree = ""; }; + 558B98E01987FCBD00ADF159 /* qBit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qBit.cpp; sourceTree = ""; }; + 558B98E11987FCBD00ADF159 /* qCConv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qCConv.cpp; sourceTree = ""; }; + 558B98E21987FCBD00ADF159 /* qCGrafPort.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qCGrafPort.cpp; sourceTree = ""; }; + 558B98E31987FCBE00ADF159 /* qColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qColor.cpp; sourceTree = ""; }; + 558B98E41987FCBE00ADF159 /* qColorMgr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qColorMgr.cpp; sourceTree = ""; }; + 558B98E51987FCBE00ADF159 /* qColorPicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qColorPicker.cpp; sourceTree = ""; }; + 558B98E61987FCBE00ADF159 /* qColorutil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qColorutil.cpp; sourceTree = ""; }; + 558B98E71987FCBE00ADF159 /* qCRegular.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qCRegular.cpp; sourceTree = ""; }; + 558B98E81987FCBE00ADF159 /* qCursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qCursor.cpp; sourceTree = ""; }; + 558B98E91987FCBE00ADF159 /* qGDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qGDevice.cpp; sourceTree = ""; }; + 558B98EA1987FCBE00ADF159 /* qGrafport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qGrafport.cpp; sourceTree = ""; }; + 558B98EB1987FCBE00ADF159 /* qGWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qGWorld.cpp; sourceTree = ""; }; + 558B98EC1987FCBE00ADF159 /* qHooks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qHooks.cpp; sourceTree = ""; }; + 558B98ED1987FCBE00ADF159 /* qIMIV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qIMIV.cpp; sourceTree = ""; }; + 558B98EE1987FCBE00ADF159 /* qIMV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qIMV.cpp; sourceTree = ""; }; + 558B98EF1987FCBE00ADF159 /* qIMVI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qIMVI.cpp; sourceTree = ""; }; + 558B98F01987FCBE00ADF159 /* qIMVxfer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qIMVxfer.cpp; sourceTree = ""; }; + 558B98F11987FCBE00ADF159 /* qMisc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qMisc.cpp; sourceTree = ""; }; + 558B98F21987FCBE00ADF159 /* qPaletteMgr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qPaletteMgr.cpp; sourceTree = ""; }; + 558B98F31987FCBE00ADF159 /* qPen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qPen.cpp; sourceTree = ""; }; + 558B98F41987FCBE00ADF159 /* qPicstuff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qPicstuff.cpp; sourceTree = ""; }; + 558B98F51987FCBE00ADF159 /* qPict2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qPict2.cpp; sourceTree = ""; }; + 558B98F61987FCBE00ADF159 /* qPicture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qPicture.cpp; sourceTree = ""; }; + 558B98F71987FCBE00ADF159 /* qPixMapConv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qPixMapConv.cpp; sourceTree = ""; }; + 558B98F81987FCBE00ADF159 /* qPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qPoint.cpp; sourceTree = ""; }; + 558B98F91987FCBE00ADF159 /* qPoly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qPoly.cpp; sourceTree = ""; }; + 558B98FA1987FCBE00ADF159 /* qRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qRect.cpp; sourceTree = ""; }; + 558B98FB1987FCBE00ADF159 /* qRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qRegion.cpp; sourceTree = ""; }; + 558B98FC1987FCBE00ADF159 /* qRegular.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qRegular.cpp; sourceTree = ""; }; + 558B98FD1987FCBE00ADF159 /* qScale.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qScale.cpp; sourceTree = ""; }; + 558B98FE1987FCBE00ADF159 /* qStandard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qStandard.cpp; sourceTree = ""; }; + 558B98FF1987FCBE00ADF159 /* qStdArc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qStdArc.cpp; sourceTree = ""; }; + 558B99001987FCBE00ADF159 /* qStdBits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = qStdBits.cpp; sourceTree = ""; }; + 558B99011987FCBE00ADF159 /* qStdLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qStdLine.cpp; sourceTree = ""; }; + 558B99021987FCBE00ADF159 /* qStdOval.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qStdOval.cpp; sourceTree = ""; }; + 558B99031987FCBE00ADF159 /* qStdPic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qStdPic.cpp; sourceTree = ""; }; + 558B99041987FCBE00ADF159 /* qStdPoly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qStdPoly.cpp; sourceTree = ""; }; + 558B99051987FCBE00ADF159 /* qStdRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qStdRect.cpp; sourceTree = ""; }; + 558B99061987FCBE00ADF159 /* qStdRgn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qStdRgn.cpp; sourceTree = ""; }; + 558B99071987FCBE00ADF159 /* qStdRRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qStdRRect.cpp; sourceTree = ""; }; + 558B99081987FCBE00ADF159 /* qStdText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qStdText.cpp; sourceTree = ""; }; + 558B99091987FCBE00ADF159 /* qt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qt.cpp; sourceTree = ""; }; + 558B990A1987FCBE00ADF159 /* qText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qText.cpp; sourceTree = ""; }; + 558B990B1987FCBE00ADF159 /* rawpatblt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rawpatblt.cpp; sourceTree = ""; }; + 558B990C1987FCBE00ADF159 /* rawsrcblt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rawsrcblt.cpp; sourceTree = ""; }; + 558B990D1987FCBE00ADF159 /* redrawscreen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = redrawscreen.cpp; sourceTree = ""; }; + 558B990E1987FCBE00ADF159 /* refresh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = refresh.cpp; sourceTree = ""; }; + 558B990F1987FCBE00ADF159 /* resGet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resGet.cpp; sourceTree = ""; }; + 558B99101987FCBE00ADF159 /* resGetinfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resGetinfo.cpp; sourceTree = ""; }; + 558B99111987FCBE00ADF159 /* resGettype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resGettype.cpp; sourceTree = ""; }; + 558B99121987FCBE00ADF159 /* resIMIV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resIMIV.cpp; sourceTree = ""; }; + 558B99131987FCBE00ADF159 /* resInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resInit.cpp; sourceTree = ""; }; + 558B99141987FCBE00ADF159 /* resMisc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resMisc.cpp; sourceTree = ""; }; + 558B99151987FCBE00ADF159 /* resMod.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resMod.cpp; sourceTree = ""; }; + 558B99161987FCBE00ADF159 /* resOpen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resOpen.cpp; sourceTree = ""; }; + 558B99171987FCBE00ADF159 /* resPartial.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resPartial.cpp; sourceTree = ""; }; + 558B99181987FCBE00ADF159 /* resSetcur.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resSetcur.cpp; sourceTree = ""; }; + 558B99191987FCBE00ADF159 /* rgbutil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rgbutil.cpp; sourceTree = ""; }; + 558B991A1987FCBE00ADF159 /* romlib_stubs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = romlib_stubs.cpp; sourceTree = ""; }; + 558B991B1987FCBE00ADF159 /* scrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scrap.cpp; sourceTree = ""; }; + 558B991C1987FCBE00ADF159 /* screen-dump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "screen-dump.cpp"; sourceTree = ""; }; + 558B991D1987FCBE00ADF159 /* script.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = script.cpp; sourceTree = ""; }; + 558B991E1987FCBE00ADF159 /* segment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = segment.cpp; sourceTree = ""; }; + 558B991F1987FCBE00ADF159 /* serial.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = serial.cpp; sourceTree = ""; usesTabs = 0; }; + 558B99201987FCBE00ADF159 /* setuid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = setuid.cpp; sourceTree = ""; }; + 558B99211987FCBE00ADF159 /* shutdown.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shutdown.cpp; sourceTree = ""; }; + 558B99221987FCBE00ADF159 /* sigio_multiplex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sigio_multiplex.cpp; sourceTree = ""; }; + 558B99241987FCBE00ADF159 /* snth5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = snth5.cpp; sourceTree = ""; }; + 558B99251987FCBE00ADF159 /* sound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sound.cpp; sourceTree = ""; }; + 558B99261987FCBE00ADF159 /* sounddriver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sounddriver.cpp; sourceTree = ""; }; + 558B99271987FCBE00ADF159 /* soundfake.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = soundfake.cpp; sourceTree = ""; }; + 558B99281987FCBE00ADF159 /* soundIMVI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = soundIMVI.cpp; sourceTree = ""; }; + 558B99291987FCBE00ADF159 /* splash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = splash.cpp; sourceTree = ""; }; + 558B992A1987FCBE00ADF159 /* srcblt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = srcblt.cpp; sourceTree = ""; }; + 558B992B1987FCBE00ADF159 /* stdfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = stdfile.cpp; sourceTree = ""; usesTabs = 0; }; + 558B992C1987FCBE00ADF159 /* stdmbdf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stdmbdf.cpp; sourceTree = ""; }; + 558B992D1987FCBE00ADF159 /* stdmdef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stdmdef.cpp; sourceTree = ""; }; + 558B992E1987FCBE00ADF159 /* string.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = string.cpp; sourceTree = ""; }; + 558B992F1987FCBE00ADF159 /* suffix_maps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = suffix_maps.cpp; sourceTree = ""; }; + 558B99301987FCBE00ADF159 /* syncint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = syncint.cpp; sourceTree = ""; }; + 558B99311987FCBE00ADF159 /* syserr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = syserr.cpp; sourceTree = ""; }; + 558B99321987FCBE00ADF159 /* system_error.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = system_error.cpp; sourceTree = ""; }; + 558B99331987FCBE00ADF159 /* teAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = teAccess.cpp; sourceTree = ""; }; + 558B99341987FCBE00ADF159 /* teDisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = teDisplay.cpp; sourceTree = ""; }; + 558B99351987FCBE00ADF159 /* teEdit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = teEdit.cpp; sourceTree = ""; }; + 558B99361987FCBE00ADF159 /* teIMIV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = teIMIV.cpp; sourceTree = ""; }; + 558B99371987FCBE00ADF159 /* teIMV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = teIMV.cpp; sourceTree = ""; }; + 558B99381987FCBE00ADF159 /* teInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = teInit.cpp; sourceTree = ""; }; + 558B99391987FCBE00ADF159 /* teInsert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = teInsert.cpp; sourceTree = ""; }; + 558B993A1987FCBE00ADF159 /* teMisc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = teMisc.cpp; sourceTree = ""; }; + 558B993B1987FCBE00ADF159 /* tempmem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tempmem.cpp; sourceTree = ""; }; + 558B993C1987FCBE00ADF159 /* teScrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = teScrap.cpp; sourceTree = ""; }; + 558B993D1987FCBE00ADF159 /* think.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = think.cpp; sourceTree = ""; usesTabs = 0; }; + 558B993E1987FCBE00ADF159 /* time.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = time.cpp; sourceTree = ""; }; + 558B993F1987FCBE00ADF159 /* toolevent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = toolevent.cpp; sourceTree = ""; }; + 558B99401987FCBE00ADF159 /* toolmath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = toolmath.cpp; sourceTree = ""; }; + 558B99411987FCBE00ADF159 /* toolutil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = toolutil.cpp; sourceTree = ""; }; + 558B99421987FCBE00ADF159 /* trapname.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = trapname.cpp; sourceTree = ""; }; + 558B99431987FCBE00ADF159 /* uniquefile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = uniquefile.cpp; sourceTree = ""; }; + 558B99441987FCBE00ADF159 /* unix_like.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unix_like.cpp; sourceTree = ""; }; + 558B99451987FCBE00ADF159 /* vbl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vbl.cpp; sourceTree = ""; }; + 558B99461987FCBE00ADF159 /* version.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = version.cpp; sourceTree = ""; }; + 558B99471987FCBE00ADF159 /* vgavdriver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vgavdriver.cpp; sourceTree = ""; }; + 558B99481987FCBE00ADF159 /* virtualint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = virtualint.cpp; sourceTree = ""; }; + 558B99491987FCBE00ADF159 /* windColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = windColor.cpp; sourceTree = ""; }; + 558B994A1987FCBF00ADF159 /* windDisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = windDisplay.cpp; sourceTree = ""; }; + 558B994B1987FCBF00ADF159 /* windDocdef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = windDocdef.cpp; sourceTree = ""; }; + 558B994C1987FCBF00ADF159 /* windInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = windInit.cpp; sourceTree = ""; }; + 558B994D1987FCBF00ADF159 /* windMisc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = windMisc.cpp; sourceTree = ""; }; + 558B994E1987FCBF00ADF159 /* windMouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = windMouse.cpp; sourceTree = ""; }; + 558B994F1987FCBF00ADF159 /* windSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = windSize.cpp; sourceTree = ""; }; + 558B99501987FCBF00ADF159 /* windUpdate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = windUpdate.cpp; sourceTree = ""; }; + 558B99511987FCBF00ADF159 /* xdata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdata.cpp; sourceTree = ""; }; + 558B99521987FCBF00ADF159 /* xdblt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdblt.cpp; sourceTree = ""; }; + 558B9A511987FCDF00ADF159 /* skel */ = {isa = PBXFileReference; lastKnownFileType = folder; path = skel; sourceTree = ""; }; + 558B9A571988049300ADF159 /* libsyn68k.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libsyn68k.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 558B9A5C198804D400ADF159 /* syn68k_public.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = syn68k_public.h; sourceTree = ""; }; + 559AF49E198ABFE600DE8472 /* Syn68k.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Syn68k.c; sourceTree = ""; }; + 559AF4A1198AC90F00DE8472 /* stub.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stub.c; sourceTree = ""; }; + 559AF4AD198AE03000DE8472 /* mkexpandtables */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mkexpandtables; sourceTree = BUILT_PRODUCTS_DIR; }; + 559AF4B4198AE0F400DE8472 /* mkexpandtables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mkexpandtables.c; sourceTree = ""; }; + 55A742A0198D79DD00F1A8A5 /* SoundOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SoundOSX.cpp; sourceTree = ""; }; + 55A742A1198D79DD00F1A8A5 /* SoundOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoundOSX.h; sourceTree = ""; }; + 55A742A6198D819E00F1A8A5 /* FileDouble-OSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "FileDouble-OSX.cpp"; sourceTree = ""; }; + 55A742A7198D819E00F1A8A5 /* FileDouble-OSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "FileDouble-OSX.h"; sourceTree = ""; }; + 55A742AF198DE1C100F1A8A5 /* slash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = slash.cpp; sourceTree = ""; }; + 55A742B1198DE36600F1A8A5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/Executor.xib; sourceTree = ""; }; + 55A742B2198DE37D00F1A8A5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Executor.strings; sourceTree = ""; }; + 55A742B4198DE48E00F1A8A5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/info.strings; sourceTree = ""; }; + 55D30F48198C1B08009BBB62 /* mkvol */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mkvol; sourceTree = BUILT_PRODUCTS_DIR; }; + 55D30F4F198C1B65009BBB62 /* mkvol_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mkvol_internal.h; sourceTree = ""; }; + 55D30F50198C1B65009BBB62 /* mkvol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = mkvol.cpp; sourceTree = ""; usesTabs = 0; }; + 55D30F51198C1B65009BBB62 /* mkvol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mkvol.h; sourceTree = ""; }; + 55D30F52198C1B65009BBB62 /* scsi_dump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = scsi_dump.c; sourceTree = ""; }; + 55D30F5A198C38DB009BBB62 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/info.xib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 556062EE1988679400D6F0B2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 556E040019856E5700FC4362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 559AF4A5198AC9AB00DE8472 /* rsys.framework in Frameworks */, + 559AF4A0198AC14900DE8472 /* libsyn68k.a in Frameworks */, + 557F308C19895414009873EB /* Carbon.framework in Frameworks */, + 557F308A1989540D009873EB /* ApplicationServices.framework in Frameworks */, + 557F308919895405009873EB /* CoreServices.framework in Frameworks */, + 558B98521987F5BA00ADF159 /* IOKit.framework in Frameworks */, + 556E040719856E5700FC4362 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 556E042119856E5700FC4362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 556E042719856E5700FC4362 /* Cocoa.framework in Frameworks */, + 556E042619856E5700FC4362 /* XCTest.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 556E05641985854000FC4362 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 556E061A1985873F00FC4362 /* ApplicationServices.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 557F30A119897619009873EB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 557F30AC19897653009873EB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 557F30B71989768A009873EB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 558B9A541988049300ADF159 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 559AF4AA198AE03000DE8472 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 55D30F45198C1B08009BBB62 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 5500AB371985A66A00FF62C0 /* NeXT Classes */ = { + isa = PBXGroup; + children = ( + 5500AB381985A66A00FF62C0 /* blockinterrupts.mm */, + 5500AB391985A66A00FF62C0 /* contextswitch.h */, + 5500AB3C1985A66A00FF62C0 /* Executor.xib */, + 55D30F5B198C38DB009BBB62 /* info.xib */, + 5500AB3E1985A66A00FF62C0 /* Executor.tiff */, + 5500AB3F1985A66A00FF62C0 /* Executor_main.mm */, + 5500AB401985A66A00FF62C0 /* host_bltmacros.h */, + 5500AB411985A66A00FF62C0 /* host_vdriver.h */, + 5500AB421985A66A00FF62C0 /* MacAppClass.h */, + 5500AB431985A66A00FF62C0 /* MacAppClass.mm */, + 5500AB441985A66A00FF62C0 /* MacPrintClass.h */, + 5500AB451985A66A00FF62C0 /* MacViewClass.h */, + 5500AB461985A66A00FF62C0 /* MacViewClass.mm */, + 5500AB471985A66A00FF62C0 /* MacWinClass.h */, + 5500AB481985A66A00FF62C0 /* MacWinClass.m */, + 5500AB491985A66A00FF62C0 /* NEXT.mm */, + 5500AB4A1985A66A00FF62C0 /* NEXTkeyboard.cpp */, + 5500AB4B1985A66A00FF62C0 /* NEXTmain.mm */, + 5500AB4C1985A66A00FF62C0 /* NEXTprint.mm */, + 5500AB4E1985A66A00FF62C0 /* nextstep.h */, + 5500AB501985A66A00FF62C0 /* ourstuff.h */, + 55A742A1198D79DD00F1A8A5 /* SoundOSX.h */, + 55A742A0198D79DD00F1A8A5 /* SoundOSX.cpp */, + ); + indentWidth = 2; + path = "NeXT Classes"; + sourceTree = ""; + usesTabs = 0; + }; + 5500AB611985B31E00FF62C0 /* Executor-Mac headers */ = { + isa = PBXGroup; + children = ( + 5500AB621985B31E00FF62C0 /* ADB.h */, + 5500AB631985B31E00FF62C0 /* AliasMgr.h */, + 5500AB641985B31E00FF62C0 /* AppleEvents.h */, + 5500AB651985B31E00FF62C0 /* AppleTalk.h */, + 5500AB661985B31E00FF62C0 /* BinaryDecimal.h */, + 5500AB671985B31E00FF62C0 /* CommTool.h */, + 5500AB681985B31E00FF62C0 /* Components.h */, + 5500AB691985B31E00FF62C0 /* ControlMgr.h */, + 5500AB6A1985B31E00FF62C0 /* CQuickDraw.h */, + 5500AB6B1985B31E00FF62C0 /* DeskMgr.h */, + 5500AB6C1985B31E00FF62C0 /* DeviceMgr.h */, + 5500AB6D1985B31E00FF62C0 /* DialogMgr.h */, + 5500AB6E1985B31E00FF62C0 /* Disk.h */, + 5500AB6F1985B31E00FF62C0 /* DiskInit.h */, + 5500AB701985B31E00FF62C0 /* EditionMgr.h */, + 5500AB711985B31E00FF62C0 /* EventMgr.h */, + 5500AB721985B31E00FF62C0 /* FileMgr.h */, + 5500AB731985B31E00FF62C0 /* Finder.h */, + 5500AB741985B31E00FF62C0 /* FontMgr.h */, + 5500AB751985B31E00FF62C0 /* Gestalt.h */, + 5500AB761985B31E00FF62C0 /* HelpMgr.h */, + 5500AB771985B31E00FF62C0 /* Iconutil.h */, + 5500AB781985B31E00FF62C0 /* IntlUtil.h */, + 5500AB791985B31E00FF62C0 /* ListMgr.h */, + 5500AB7A1985B31E00FF62C0 /* MacTypes.h */, + 5500AB7B1985B31E00FF62C0 /* MemoryMgr.h */, + 5500AB7C1985B31E00FF62C0 /* MenuMgr.h */, + 5500AB7D1985B31E00FF62C0 /* NotifyMgr.h */, + 5500AB7E1985B31E00FF62C0 /* OSEvent.h */, + 5500AB7F1985B31E00FF62C0 /* OSUtil.h */, + 5500AB801985B31E00FF62C0 /* Package.h */, + 5500AB811985B31E00FF62C0 /* paramline.h */, + 5500AB821985B31E00FF62C0 /* PPC.h */, + 5500AB831985B31E00FF62C0 /* PrintMgr.h */, + 5500AB841985B31E00FF62C0 /* ProcessMgr.h */, + 5500AB851985B31E00FF62C0 /* QuickDraw.h */, + 5500AB861985B31E00FF62C0 /* QuickTime.h */, + 5500AB871985B31E00FF62C0 /* ResourceMgr.h */, + 5500AC2F1985B31E00FF62C0 /* SANE.h */, + 5500AC301985B31E00FF62C0 /* ScrapMgr.h */, + 5500AC311985B31E00FF62C0 /* ScriptMgr.h */, + 5500AC321985B31E00FF62C0 /* SegmentLdr.h */, + 5500AC331985B31E00FF62C0 /* Serial.h */, + 5500AC341985B31E00FF62C0 /* ShutDown.h */, + 5500AC351985B31E00FF62C0 /* SoundDvr.h */, + 5500AC361985B31E00FF62C0 /* SoundMgr.h */, + 5500AC371985B31E00FF62C0 /* StartMgr.h */, + 5500AC381985B31E00FF62C0 /* StdFilePkg.h */, + 5500AC391985B31E00FF62C0 /* SysErr.h */, + 5500AC3A1985B31E00FF62C0 /* TextEdit.h */, + 5500AC3B1985B31E00FF62C0 /* ThinkC.h */, + 5500AC3C1985B31E00FF62C0 /* TimeMgr.h */, + 5500AC3D1985B31E00FF62C0 /* ToolboxEvent.h */, + 5500AC3E1985B31E00FF62C0 /* ToolboxUtil.h */, + 5500AC3F1985B31E00FF62C0 /* VDriver.h */, + 5500AC401985B31E00FF62C0 /* VRetraceMgr.h */, + 5500AC411985B31E00FF62C0 /* WindowMgr.h */, + ); + indentWidth = 2; + name = "Executor-Mac headers"; + path = ../../src/include; + sourceTree = ""; + }; + 551EE33A198D5E1E004A3A41 /* Window Sources */ = { + isa = PBXGroup; + children = ( + 558B99491987FCBE00ADF159 /* windColor.cpp */, + 558B994A1987FCBF00ADF159 /* windDisplay.cpp */, + 558B994B1987FCBF00ADF159 /* windDocdef.cpp */, + 558B994C1987FCBF00ADF159 /* windInit.cpp */, + 558B994D1987FCBF00ADF159 /* windMisc.cpp */, + 558B994E1987FCBF00ADF159 /* windMouse.cpp */, + 558B994F1987FCBF00ADF159 /* windSize.cpp */, + 558B99501987FCBF00ADF159 /* windUpdate.cpp */, + ); + name = "Window Sources"; + sourceTree = ""; + }; + 551EE33B198D5E37004A3A41 /* Controls */ = { + isa = PBXGroup; + children = ( + 558B98671987FCBD00ADF159 /* ctlArrows.cpp */, + 558B98681987FCBD00ADF159 /* ctlDisplay.cpp */, + 558B98691987FCBD00ADF159 /* ctlIMIV.cpp */, + 558B986A1987FCBD00ADF159 /* ctlInit.cpp */, + 558B986B1987FCBD00ADF159 /* ctlMisc.cpp */, + 558B986C1987FCBD00ADF159 /* ctlMouse.cpp */, + 558B986D1987FCBD00ADF159 /* ctlPopup.cpp */, + 558B986E1987FCBD00ADF159 /* ctlSet.cpp */, + 558B986F1987FCBD00ADF159 /* ctlSize.cpp */, + 558B98701987FCBD00ADF159 /* ctlStddef.cpp */, + ); + name = Controls; + sourceTree = ""; + }; + 551EE33C198D5E50004A3A41 /* Dialogs */ = { + isa = PBXGroup; + children = ( + 558B98791987FCBD00ADF159 /* dialAlert.cpp */, + 558B987A1987FCBD00ADF159 /* dialCreate.cpp */, + 558B987B1987FCBD00ADF159 /* dialDispatch.cpp */, + 558B987C1987FCBD00ADF159 /* dialHandle.cpp */, + 558B987D1987FCBD00ADF159 /* dialInit.cpp */, + 558B987E1987FCBD00ADF159 /* dialItem.cpp */, + 558B987F1987FCBD00ADF159 /* dialManip.cpp */, + ); + name = Dialogs; + sourceTree = ""; + }; + 551EE33D198D5E70004A3A41 /* File access */ = { + isa = PBXGroup; + children = ( + 558B98721987FCBD00ADF159 /* dcache.cpp */, + 558B988B1987FCBD00ADF159 /* fileAccess.cpp */, + 558B988C1987FCBD00ADF159 /* fileCreate.cpp */, + 558B988D1987FCBD00ADF159 /* fileDirs.cpp */, + 558B988E1987FCBD00ADF159 /* fileDouble.cpp */, + 55A742A7198D819E00F1A8A5 /* FileDouble-OSX.h */, + 55A742A6198D819E00F1A8A5 /* FileDouble-OSX.cpp */, + 558B988F1987FCBD00ADF159 /* fileHighlevel.cpp */, + 558B98901987FCBD00ADF159 /* fileInfo.cpp */, + 558B98911987FCBD00ADF159 /* fileMisc.cpp */, + 558B98921987FCBD00ADF159 /* fileVolumes.cpp */, + 558B992B1987FCBE00ADF159 /* stdfile.cpp */, + 557F308E198967BE009873EB /* stdfile-OSX.h */, + 557F308D198967BE009873EB /* stdfile-OSX.cpp */, + ); + name = "File access"; + sourceTree = ""; + }; + 551EE33E198D5EA0004A3A41 /* HFS sources */ = { + isa = PBXGroup; + children = ( + 558B989F1987FCBD00ADF159 /* hfsBtree.cpp */, + 558B98A01987FCBD00ADF159 /* hfsChanging.cpp */, + 558B98A11987FCBD00ADF159 /* hfsCreate.cpp */, + 558B98A21987FCBD00ADF159 /* hfsFile.cpp */, + 558B98A31987FCBD00ADF159 /* hfsHelper.cpp */, + 558B98A41987FCBD00ADF159 /* hfsHier.cpp */, + 558B98A51987FCBD00ADF159 /* hfsMisc.cpp */, + 558B98A61987FCBD00ADF159 /* hfsVolume.cpp */, + 558B98A71987FCBD00ADF159 /* hfsWorkingdir.cpp */, + 558B98A81987FCBD00ADF159 /* hfsXbar.cpp */, + ); + name = "HFS sources"; + sourceTree = ""; + }; + 551EE33F198D5EC1004A3A41 /* Lists */ = { + isa = PBXGroup; + children = ( + 558B98B61987FCBD00ADF159 /* listAccess.cpp */, + 558B98B71987FCBD00ADF159 /* listAddDel.cpp */, + 558B98B81987FCBD00ADF159 /* listCreate.cpp */, + 558B98B91987FCBD00ADF159 /* listDisplay.cpp */, + 558B98BA1987FCBD00ADF159 /* listMouse.cpp */, + 558B98BB1987FCBD00ADF159 /* listOps.cpp */, + 558B98BC1987FCBD00ADF159 /* listStdLDEF.cpp */, + ); + name = Lists; + sourceTree = ""; + }; + 551EE340198D5ED6004A3A41 /* Menus */ = { + isa = PBXGroup; + children = ( + 558B98C21987FCBD00ADF159 /* menu.cpp */, + 558B98C31987FCBD00ADF159 /* menuColor.cpp */, + 558B98C41987FCBD00ADF159 /* menuV.cpp */, + 558B992C1987FCBE00ADF159 /* stdmbdf.cpp */, + 558B992D1987FCBE00ADF159 /* stdmdef.cpp */, + ); + name = Menus; + sourceTree = ""; + }; + 551EE341198D5F17004A3A41 /* Resource Manager */ = { + isa = PBXGroup; + children = ( + 558B990F1987FCBE00ADF159 /* resGet.cpp */, + 558B99101987FCBE00ADF159 /* resGetinfo.cpp */, + 558B99111987FCBE00ADF159 /* resGettype.cpp */, + 558B99121987FCBE00ADF159 /* resIMIV.cpp */, + 558B99131987FCBE00ADF159 /* resInit.cpp */, + 558B99141987FCBE00ADF159 /* resMisc.cpp */, + 558B99151987FCBE00ADF159 /* resMod.cpp */, + 558B99161987FCBE00ADF159 /* resOpen.cpp */, + 558B99171987FCBE00ADF159 /* resPartial.cpp */, + 558B99181987FCBE00ADF159 /* resSetcur.cpp */, + ); + name = "Resource Manager"; + sourceTree = ""; + }; + 551EE343198D5F56004A3A41 /* Text Editing */ = { + isa = PBXGroup; + children = ( + 558B99331987FCBE00ADF159 /* teAccess.cpp */, + 558B99341987FCBE00ADF159 /* teDisplay.cpp */, + 558B99351987FCBE00ADF159 /* teEdit.cpp */, + 558B99361987FCBE00ADF159 /* teIMIV.cpp */, + 558B99371987FCBE00ADF159 /* teIMV.cpp */, + 558B99381987FCBE00ADF159 /* teInit.cpp */, + 558B99391987FCBE00ADF159 /* teInsert.cpp */, + 558B993A1987FCBE00ADF159 /* teMisc.cpp */, + 558B993C1987FCBE00ADF159 /* teScrap.cpp */, + ); + name = "Text Editing"; + sourceTree = ""; + }; + 551EE344198D5F7D004A3A41 /* Apple Events */ = { + isa = PBXGroup; + children = ( + 558B98561987FCBD00ADF159 /* AE.cpp */, + 558B98571987FCBD00ADF159 /* AE_coercion.cpp */, + 558B98581987FCBD00ADF159 /* AE_desc.cpp */, + 558B98591987FCBD00ADF159 /* AE_hdlr.cpp */, + ); + name = "Apple Events"; + sourceTree = ""; + }; + 551EE345198D5FA1004A3A41 /* QuickDraw */ = { + isa = PBXGroup; + children = ( + 558B98801987FCBD00ADF159 /* dirtyrect.cpp */, + 558B98E01987FCBD00ADF159 /* qBit.cpp */, + 558B990B1987FCBE00ADF159 /* rawpatblt.cpp */, + 558B990C1987FCBE00ADF159 /* rawsrcblt.cpp */, + 558B992A1987FCBE00ADF159 /* srcblt.cpp */, + 558B99511987FCBF00ADF159 /* xdata.cpp */, + 558B99521987FCBF00ADF159 /* xdblt.cpp */, + 558B98E11987FCBD00ADF159 /* qCConv.cpp */, + 558B98E21987FCBD00ADF159 /* qCGrafPort.cpp */, + 558B98E31987FCBE00ADF159 /* qColor.cpp */, + 558B98E41987FCBE00ADF159 /* qColorMgr.cpp */, + 558B98E51987FCBE00ADF159 /* qColorPicker.cpp */, + 558B98E61987FCBE00ADF159 /* qColorutil.cpp */, + 558B98E71987FCBE00ADF159 /* qCRegular.cpp */, + 558B98E81987FCBE00ADF159 /* qCursor.cpp */, + 558B98E91987FCBE00ADF159 /* qGDevice.cpp */, + 558B98EA1987FCBE00ADF159 /* qGrafport.cpp */, + 558B98EB1987FCBE00ADF159 /* qGWorld.cpp */, + 558B98EC1987FCBE00ADF159 /* qHooks.cpp */, + 558B98ED1987FCBE00ADF159 /* qIMIV.cpp */, + 558B98EE1987FCBE00ADF159 /* qIMV.cpp */, + 558B98EF1987FCBE00ADF159 /* qIMVI.cpp */, + 558B98F01987FCBE00ADF159 /* qIMVxfer.cpp */, + 558B98F11987FCBE00ADF159 /* qMisc.cpp */, + 558B98F21987FCBE00ADF159 /* qPaletteMgr.cpp */, + 558B98F31987FCBE00ADF159 /* qPen.cpp */, + 558B98F41987FCBE00ADF159 /* qPicstuff.cpp */, + 558B98F51987FCBE00ADF159 /* qPict2.cpp */, + 558B98F61987FCBE00ADF159 /* qPicture.cpp */, + 558B98F71987FCBE00ADF159 /* qPixMapConv.cpp */, + 558B98F81987FCBE00ADF159 /* qPoint.cpp */, + 558B98F91987FCBE00ADF159 /* qPoly.cpp */, + 558B98FA1987FCBE00ADF159 /* qRect.cpp */, + 558B98FB1987FCBE00ADF159 /* qRegion.cpp */, + 558B98FC1987FCBE00ADF159 /* qRegular.cpp */, + 558B98FD1987FCBE00ADF159 /* qScale.cpp */, + 558B98FE1987FCBE00ADF159 /* qStandard.cpp */, + 558B98FF1987FCBE00ADF159 /* qStdArc.cpp */, + 558B99001987FCBE00ADF159 /* qStdBits.cpp */, + 558B99011987FCBE00ADF159 /* qStdLine.cpp */, + 558B99021987FCBE00ADF159 /* qStdOval.cpp */, + 558B99031987FCBE00ADF159 /* qStdPic.cpp */, + 558B99041987FCBE00ADF159 /* qStdPoly.cpp */, + 558B99051987FCBE00ADF159 /* qStdRect.cpp */, + 558B99061987FCBE00ADF159 /* qStdRgn.cpp */, + 558B99071987FCBE00ADF159 /* qStdRRect.cpp */, + 558B99081987FCBE00ADF159 /* qStdText.cpp */, + 558B99091987FCBE00ADF159 /* qt.cpp */, + 558B990A1987FCBE00ADF159 /* qText.cpp */, + ); + name = QuickDraw; + sourceTree = ""; + }; + 556062F31988679400D6F0B2 /* rsys */ = { + isa = PBXGroup; + children = ( + 5560630F1988680000D6F0B2 /* aboutbox.h */, + 557F30D2198982DC009873EB /* CFriendly.h */, + 556063101988680000D6F0B2 /* aboutpanel.h */, + 556063111988680000D6F0B2 /* adb.h */, + 556063121988680000D6F0B2 /* alias.h */, + 556063131988680000D6F0B2 /* appearance.h */, + 556063141988680000D6F0B2 /* apple_events.h */, + 556063151988680000D6F0B2 /* arch.h */, + 556063161988680000D6F0B2 /* arrowkeys.h */, + 556063171988680000D6F0B2 /* autorefresh.h */, + 556063181988680000D6F0B2 /* blockdev.h */, + 556063191988680000D6F0B2 /* blockinterrupts.h */, + 5560631A1988680000D6F0B2 /* byteswap.h */, + 5560631B1988680000D6F0B2 /* cfm.h */, + 5560631C1988680000D6F0B2 /* check_structs.h */, + 5560631D1988680000D6F0B2 /* checkpoint.h */, + 5560631E1988680000D6F0B2 /* cleanup.h */, + 5560631F1988680000D6F0B2 /* color_wheel_bits.h */, + 556063201988680000D6F0B2 /* common.h */, + 556063211988680000D6F0B2 /* commonevt.h */, + 556063221988680000D6F0B2 /* cquick.h */, + 556063231988680000D6F0B2 /* crc.h */, + 556063241988680000D6F0B2 /* cruft.h */, + 556063251988680000D6F0B2 /* ctl.h */, + 556063261988680000D6F0B2 /* ctopflags.h */, + 556063271988680000D6F0B2 /* custom.h */, + 556063281988680000D6F0B2 /* dcache.h */, + 556063291988680000D6F0B2 /* depthconv.h */, + 5560632A1988680000D6F0B2 /* desk.h */, + 5560632B1988680000D6F0B2 /* desperate.h */, + 5560632C1988680000D6F0B2 /* device.h */, + 5560632D1988680000D6F0B2 /* dial.h */, + 5560632E1988680000D6F0B2 /* dirtyrect.h */, + 5560632F1988680000D6F0B2 /* drive_flags.h */, + 556063301988680000D6F0B2 /* dump.h */, + 556063311988680000D6F0B2 /* emustubs.h */, + 556063321988680000D6F0B2 /* error.h */, + 556063331988680000D6F0B2 /* everything.h */, + 556063341988680000D6F0B2 /* evil.h */, + 556063351988680000D6F0B2 /* executor.h */, + 556063361988680000D6F0B2 /* fauxdbm.h */, + 556063371988680000D6F0B2 /* file.h */, + 556063381988680000D6F0B2 /* filedouble.h */, + 556063391988680000D6F0B2 /* flags.h */, + 5560633A1988680000D6F0B2 /* float_fcw.h */, + 5560633B1988680000D6F0B2 /* float.h */, + 5560633C1988680000D6F0B2 /* floatconv.h */, + 5560633D1988680000D6F0B2 /* font.h */, + 5560633E1988680000D6F0B2 /* gestalt.h */, + 5560633F1988680000D6F0B2 /* glue.h */, + 556063401988680000D6F0B2 /* gworld.h */, + 556063411988680000D6F0B2 /* hfs_plus.h */, + 556063421988680000D6F0B2 /* hfs.h */, + 556063431988680000D6F0B2 /* hook.h */, + 556063441988680000D6F0B2 /* host.h */, + 556063451988680000D6F0B2 /* icon.h */, + 556063461988680000D6F0B2 /* image.h */, + 556063471988680000D6F0B2 /* ini.h */, + 556063481988680000D6F0B2 /* interfacelib.h */, + 556063491988680000D6F0B2 /* itm.h */, + 5560634A1988680000D6F0B2 /* iv.h */, + 5560634B1988680000D6F0B2 /* jumpvectors.h */, + 5560634C1988680000D6F0B2 /* keyboard.h */, + 5560634D1988680000D6F0B2 /* keyboards.h */, + 5560634E1988680000D6F0B2 /* keycode.h */, + 5560634F1988680000D6F0B2 /* launch.h */, + 556063501988680000D6F0B2 /* libcproto.h */, + 556063511988680000D6F0B2 /* licensetext.h */, + 556063521988680000D6F0B2 /* list.h */, + 556063531988680000D6F0B2 /* local_charset.h */, + 556063541988680000D6F0B2 /* lockunlock.h */, + 556063551988680000D6F0B2 /* lowglobals.h */, + 556063561988680000D6F0B2 /* m68kint.h */, + 556063571988680000D6F0B2 /* macros.h */, + 556063581988680000D6F0B2 /* mactype.h */, + 556063591988680000D6F0B2 /* mathlib.h */, + 5560635A1988680000D6F0B2 /* memory_layout.h */, + 5560635B1988680000D6F0B2 /* memsize.h */, + 5560635C1988680000D6F0B2 /* menu.h */, + 5560635D1988680000D6F0B2 /* misc.h */, + 5560635E1988680000D6F0B2 /* mixed_mode.h */, + 5560635F1988680000D6F0B2 /* mman_private.h */, + 556063601988680000D6F0B2 /* mman.h */, + 556063611988680000D6F0B2 /* mmanstubs.h */, + 556063621988680000D6F0B2 /* new_mmanstubs.h */, + 556063631988680000D6F0B2 /* newvga.h */, + 556063641988680000D6F0B2 /* next.h */, + 556063651988680000D6F0B2 /* nextprint.h */, + 556063661988680000D6F0B2 /* noreturn.h */, + 556063671988680000D6F0B2 /* notmac.h */, + 556063681988680000D6F0B2 /* Olibcproto.h */, + 556063691988680000D6F0B2 /* option.h */, + 5560636A1988680000D6F0B2 /* options.h */, + 5560636B1988680000D6F0B2 /* os.h */, + 5560636C1988680000D6F0B2 /* osevent.h */, + 5560636D1988680000D6F0B2 /* osutil.h */, + 5560636E1988680000D6F0B2 /* parse.h */, + 5560636F1988680000D6F0B2 /* parsenum.h */, + 556063701988680000D6F0B2 /* parseopt.h */, + 556063711988680000D6F0B2 /* partition.h */, + 556063721988680000D6F0B2 /* pef.h */, + 556063731988680000D6F0B2 /* picture.h */, + 556063741988680000D6F0B2 /* pragmal.h */, + 556063751988680000D6F0B2 /* pragmar.h */, + 556063761988680000D6F0B2 /* pragmas.h */, + 556063771988680000D6F0B2 /* prefpanel.h */, + 556063781988680000D6F0B2 /* prefs.h */, + 556063791988680000D6F0B2 /* print.h */, + 5560637A1988680000D6F0B2 /* process.h */, + 5560637B1988680000D6F0B2 /* PSstrings.h */, + 5560637C1988680000D6F0B2 /* pstuff.h */, + 5560637D1988680000D6F0B2 /* ptocflags.h */, + 5560637E1988680000D6F0B2 /* qcolor.h */, + 5560637F1988680000D6F0B2 /* quick.h */, + 556063801988680000D6F0B2 /* rawblt.h */, + 556063811988680000D6F0B2 /* redrawscreen.h */, + 556063821988680000D6F0B2 /* refresh.h */, + 556063831988680000D6F0B2 /* region.h */, + 556063841988680000D6F0B2 /* release.h */, + 556063851988680000D6F0B2 /* resource.h */, + 556063861988680000D6F0B2 /* rgbutil.h */, + 556063871988680000D6F0B2 /* safe_alloca.h */, + 556063881988680000D6F0B2 /* scrap.h */, + 556063891988680000D6F0B2 /* screen-dump.h */, + 5560638A1988680000D6F0B2 /* segment.h */, + 5560638B1988680000D6F0B2 /* serial.h */, + 5560638C1988680000D6F0B2 /* setuid.h */, + 5560638D1988680000D6F0B2 /* sigio_multiplex.h */, + 5560638E1988680000D6F0B2 /* slash.h */, + 5560638F1988680000D6F0B2 /* smash.h */, + 556063901988680000D6F0B2 /* sounddriver.h */, + 556063911988680000D6F0B2 /* soundfake.h */, + 556063921988680000D6F0B2 /* soundopts.h */, + 556063931988680000D6F0B2 /* splash.h */, + 556063941988680000D6F0B2 /* srcblt.h */, + 556063951988680000D6F0B2 /* stdbits.h */, + 556063961988680000D6F0B2 /* stdfile.h */, + 556063971988680000D6F0B2 /* stdio_smashage.h */, + 556063981988680000D6F0B2 /* string.h */, + 556063991988680000D6F0B2 /* stubify.h */, + 5560639A1988680000D6F0B2 /* suffix_maps.h */, + 5560639B1988680000D6F0B2 /* syncint.h */, + 5560639C1988680000D6F0B2 /* syserr.h */, + 5560639D1988680000D6F0B2 /* system_error.h */, + 5560639E1988680000D6F0B2 /* tempalloc.h */, + 5560639F1988680000D6F0B2 /* tesave.h */, + 556063A01988680000D6F0B2 /* text.h */, + 556063A11988680000D6F0B2 /* time.h */, + 556063A21988680000D6F0B2 /* toolevent.h */, + 556063A31988680000D6F0B2 /* toolutil.h */, + 556063A41988680000D6F0B2 /* trapdecl.h */, + 556063A51988680000D6F0B2 /* trapdefines.h */, + 556063A61988680000D6F0B2 /* trapglue.h */, + 556063A71988680000D6F0B2 /* trapname.h */, + 556063A81988680000D6F0B2 /* types.h */, + 556063A91988680000D6F0B2 /* uniquefile.h */, + 556063AA1988680000D6F0B2 /* vbl.h */, + 556063AB1988680000D6F0B2 /* vdriver.h */, + 556063AC1988680000D6F0B2 /* version.h */, + 556063AD1988680000D6F0B2 /* vgavdriver.h */, + 556063AE1988680000D6F0B2 /* wind.h */, + 556063AF1988680000D6F0B2 /* wrappers.h */, + 556063B01988680000D6F0B2 /* x.h */, + 556063B11988680000D6F0B2 /* xdata.h */, + 556063B21988680000D6F0B2 /* xdblt.h */, + 556063B31988680000D6F0B2 /* Xdefs.h */, + 556062F41988679400D6F0B2 /* Supporting Files */, + 559AF4A1198AC90F00DE8472 /* stub.c */, + ); + name = rsys; + path = src/include/rsys; + sourceTree = ""; + }; + 556062F41988679400D6F0B2 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 556062F51988679400D6F0B2 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 556E03FA19856E5700FC4362 = { + isa = PBXGroup; + children = ( + 556E040C19856E5700FC4362 /* CocoaExecutor */, + 556E042A19856E5700FC4362 /* CocoaExecutorTests */, + 556E05681985854000FC4362 /* map_to_c */, + 558B9A5B198804BF00ADF159 /* syn68k */, + 556062F31988679400D6F0B2 /* rsys */, + 557F30A519897619009873EB /* mkseedtables */, + 557F30B019897653009873EB /* mkultable */, + 557F30BB1989768A009873EB /* mksspairtable */, + 559AF4AE198AE03000DE8472 /* mkexpandtables */, + 55D30F49198C1B08009BBB62 /* mkvol */, + 556E040519856E5700FC4362 /* Frameworks */, + 556E040419856E5700FC4362 /* Products */, + ); + sourceTree = ""; + }; + 556E040419856E5700FC4362 /* Products */ = { + isa = PBXGroup; + children = ( + 556E040319856E5700FC4362 /* NeoClassic.app */, + 556E042419856E5700FC4362 /* CocoaExecutorTests.xctest */, + 556E05671985854000FC4362 /* map_to_c */, + 558B9A571988049300ADF159 /* libsyn68k.a */, + 556062F21988679400D6F0B2 /* rsys.framework */, + 557F30A419897619009873EB /* mkseedtables */, + 557F30AF19897653009873EB /* mkultable */, + 557F30BA1989768A009873EB /* mksspairtable */, + 559AF4AD198AE03000DE8472 /* mkexpandtables */, + 55D30F48198C1B08009BBB62 /* mkvol */, + ); + name = Products; + sourceTree = ""; + }; + 556E040519856E5700FC4362 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 557F308B19895414009873EB /* Carbon.framework */, + 557F308819895405009873EB /* CoreServices.framework */, + 558B98511987F5BA00ADF159 /* IOKit.framework */, + 556E06191985873F00FC4362 /* ApplicationServices.framework */, + 556E040619856E5700FC4362 /* Cocoa.framework */, + 556E042519856E5700FC4362 /* XCTest.framework */, + 556E040819856E5700FC4362 /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + 556E040819856E5700FC4362 /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 556E040919856E5700FC4362 /* AppKit.framework */, + 556E040A19856E5700FC4362 /* CoreData.framework */, + 556E040B19856E5700FC4362 /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 556E040C19856E5700FC4362 /* CocoaExecutor */ = { + isa = PBXGroup; + children = ( + 5500AB611985B31E00FF62C0 /* Executor-Mac headers */, + 558B98531987FCBD00ADF159 /* Executor-Mac sources */, + 5500AB371985A66A00FF62C0 /* NeXT Classes */, + 556E05461985847000FC4362 /* Interface Maps */, + 557F3090198974E4009873EB /* Templates */, + 5500AB321985911A00FF62C0 /* x86_64.cpp */, + 556E041E19856E5700FC4362 /* Images.xcassets */, + 558B9A511987FCDF00ADF159 /* skel */, + 556E040D19856E5700FC4362 /* Supporting Files */, + ); + name = CocoaExecutor; + path = "OSX-only/CocoaExecutor"; + sourceTree = ""; + }; + 556E040D19856E5700FC4362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 557F30D81989B5B2009873EB /* makerawblt.pl */, + 5500AB331985911A00FF62C0 /* host-arch-config.h */, + 5500AB351985A0F600FF62C0 /* host-os-config.h */, + 5500AB361985A40F00FF62C0 /* front-end-config.h */, + 557F30D619899569009873EB /* sound-config.h */, + 5500AB2F1985900000FF62C0 /* config.h */, + 557F309F19897549009873EB /* trapinfo */, + 556E040E19856E5700FC4362 /* CocoaExecutor-Info.plist */, + 556E040F19856E5700FC4362 /* InfoPlist.strings */, + 556E041419856E5700FC4362 /* CocoaExecutor-Prefix.pch */, + 556E041519856E5700FC4362 /* Credits.rtf */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 556E042A19856E5700FC4362 /* CocoaExecutorTests */ = { + isa = PBXGroup; + children = ( + 556E043019856E5700FC4362 /* CocoaExecutorTests.m */, + 556E042B19856E5700FC4362 /* Supporting Files */, + ); + name = CocoaExecutorTests; + path = "OSX-only/CocoaExecutorTests"; + sourceTree = ""; + }; + 556E042B19856E5700FC4362 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 556E042C19856E5700FC4362 /* CocoaExecutorTests-Info.plist */, + 556E042D19856E5700FC4362 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 556E05461985847000FC4362 /* Interface Maps */ = { + isa = PBXGroup; + children = ( + 556E0547198584DE00FC4362 /* active.map */, + 556E0548198584DE00FC4362 /* apple.map */, + 556E0549198584DE00FC4362 /* arrow_down_active.map */, + 556E054A198584DE00FC4362 /* arrow_down_inactive.map */, + 556E054B198584DE00FC4362 /* arrow_left_active.map */, + 556E054C198584DE00FC4362 /* arrow_left_inactive.map */, + 556E054D198584DE00FC4362 /* arrow_right_active.map */, + 556E054E198584DE00FC4362 /* arrow_right_inactive.map */, + 556E054F198584DE00FC4362 /* arrow_up_active.map */, + 556E0550198584DE00FC4362 /* arrow_up_inactive.map */, + 556E0551198584DE00FC4362 /* go_away.map */, + 556E0552198584DE00FC4362 /* grow.map */, + 556E0553198584DE00FC4362 /* ractive.map */, + 557F30CE19897991009873EB /* thumb_horiz.map */, + 557F30CF19897991009873EB /* thumb_vert.map */, + 556E0554198584DE00FC4362 /* zoom.map */, + ); + name = "Interface Maps"; + path = ../../src; + sourceTree = ""; + }; + 556E05681985854000FC4362 /* map_to_c */ = { + isa = PBXGroup; + children = ( + 556E05701985855100FC4362 /* map_to_c.cpp */, + ); + name = map_to_c; + path = src/map_to_c; + sourceTree = ""; + }; + 557F3090198974E4009873EB /* Templates */ = { + isa = PBXGroup; + children = ( + 557F3091198974E4009873EB /* genctopflags_h.tmpl */, + 557F3092198974E4009873EB /* geninterfacelib.tmpl */, + 557F3093198974E4009873EB /* genptocflags_h.tmpl */, + 557F3094198974E4009873EB /* genstubify_h.tmpl */, + 557F3095198974E4009873EB /* genstubify_s.tmpl */, + 557F3096198974E4009873EB /* pat-blitters.tmpl */, + 557F3097198974E4009873EB /* src-blitters.tmpl */, + ); + name = Templates; + path = ../../src; + sourceTree = ""; + }; + 557F30A519897619009873EB /* mkseedtables */ = { + isa = PBXGroup; + children = ( + 557F30C1198976A9009873EB /* mkseedtables.c */, + ); + name = mkseedtables; + path = src/mkseedtables; + sourceTree = ""; + }; + 557F30B019897653009873EB /* mkultable */ = { + isa = PBXGroup; + children = ( + 557F30C3198976DC009873EB /* mkultable.c */, + ); + name = mkultable; + path = src/mkultable; + sourceTree = ""; + }; + 557F30BB1989768A009873EB /* mksspairtable */ = { + isa = PBXGroup; + children = ( + 557F30C51989771D009873EB /* mksspairtable.c */, + ); + name = mksspairtable; + path = src/mksspairtable; + sourceTree = ""; + }; + 558B98531987FCBD00ADF159 /* Executor-Mac sources */ = { + isa = PBXGroup; + children = ( + 55A742AF198DE1C100F1A8A5 /* slash.cpp */, + 558B98541987FCBD00ADF159 /* aboutbox.cpp */, + 558B98551987FCBD00ADF159 /* adb.cpp */, + 551EE344198D5F7D004A3A41 /* Apple Events */, + 558B985A1987FCBD00ADF159 /* alias.cpp */, + 558B985B1987FCBD00ADF159 /* appearance.cpp */, + 558B985C1987FCBD00ADF159 /* autorefresh.cpp */, + 558B985D1987FCBD00ADF159 /* balloon.cpp */, + 558B985E1987FCBD00ADF159 /* bindec.cpp */, + 558B985F1987FCBD00ADF159 /* blockdev.cpp */, + 558B98601987FCBD00ADF159 /* cfm.cpp */, + 558B98611987FCBD00ADF159 /* check_structs.cpp */, + 558B98621987FCBD00ADF159 /* checkpoint.cpp */, + 558B98631987FCBD00ADF159 /* cleanup.cpp */, + 558B98641987FCBD00ADF159 /* color_wheel_bits.cpp */, + 558B98651987FCBD00ADF159 /* commtool.cpp */, + 558B98661987FCBD00ADF159 /* crc.cpp */, + 551EE33B198D5E37004A3A41 /* Controls */, + 558B98711987FCBD00ADF159 /* custom.cpp */, + 558B98731987FCBD00ADF159 /* dcconvert.cpp */, + 558B98741987FCBD00ADF159 /* dcmaketables.cpp */, + 558B98751987FCBD00ADF159 /* default_ctab_values.cpp */, + 558B98761987FCBD00ADF159 /* desk.cpp */, + 558B98771987FCBD00ADF159 /* desperate.cpp */, + 558B98781987FCBD00ADF159 /* device.cpp */, + 551EE33C198D5E50004A3A41 /* Dialogs */, + 558B98811987FCBD00ADF159 /* disk.cpp */, + 558B98821987FCBD00ADF159 /* diskinit.cpp */, + 558B98831987FCBD00ADF159 /* dump.cpp */, + 558B98841987FCBD00ADF159 /* edition.cpp */, + 558B98851987FCBD00ADF159 /* emustubs.cpp */, + 558B98861987FCBD00ADF159 /* emutrap.cpp */, + 558B98871987FCBD00ADF159 /* emutraptables.cpp */, + 558B98881987FCBD00ADF159 /* error.cpp */, + 558B98891987FCBD00ADF159 /* executor.cpp */, + 558B988A1987FCBD00ADF159 /* fauxdbm.c */, + 551EE33D198D5E70004A3A41 /* File access */, + 558B98931987FCBD00ADF159 /* finder.cpp */, + 558B98941987FCBD00ADF159 /* float4.cpp */, + 558B98951987FCBD00ADF159 /* float5.cpp */, + 558B98961987FCBD00ADF159 /* float7.cpp */, + 558B98971987FCBD00ADF159 /* floatnext.cpp */, + 558B98981987FCBD00ADF159 /* font.cpp */, + 558B98991987FCBD00ADF159 /* fontIMVI.cpp */, + 558B989A1987FCBD00ADF159 /* genfndecls.cpp */, + 558B989B1987FCBD00ADF159 /* genrand_h.c */, + 558B989C1987FCBD00ADF159 /* gensplash.cpp */, + 558B989D1987FCBD00ADF159 /* gestalt.cpp */, + 558B989E1987FCBD00ADF159 /* globals.cpp */, + 551EE33E198D5EA0004A3A41 /* HFS sources */, + 558B98A91987FCBD00ADF159 /* hintemplate.h */, + 558B98AA1987FCBD00ADF159 /* hle.cpp */, + 558B98AB1987FCBD00ADF159 /* ibm_keycodes.cpp */, + 558B98AC1987FCBD00ADF159 /* icon.cpp */, + 558B98AD1987FCBD00ADF159 /* image.cpp */, + 558B98AE1987FCBD00ADF159 /* image_inits.cpp */, + 558B98AF1987FCBD00ADF159 /* ini.cpp */, + 558B98B01987FCBD00ADF159 /* interfacelib.cpp */, + 558B98B11987FCBD00ADF159 /* iu.cpp */, + 558B98B21987FCBD00ADF159 /* iv-stubs.cpp */, + 558B98B31987FCBD00ADF159 /* keycode.mm */, + 558B98B41987FCBD00ADF159 /* launch.cpp */, + 551EE33F198D5EC1004A3A41 /* Lists */, + 558B98BD1987FCBD00ADF159 /* local_charset.cpp */, + 558B98BE1987FCBD00ADF159 /* lockrange.cpp */, + 558B98BF1987FCBD00ADF159 /* main.cpp */, + 558B98C11987FCBD00ADF159 /* mathlib.cpp */, + 551EE340198D5ED6004A3A41 /* Menus */, + 558B98C51987FCBD00ADF159 /* mixed_mode.cpp */, + 558B98CA1987FCBD00ADF159 /* mman.cpp */, + 558B98CB1987FCBD00ADF159 /* mmansubr.cpp */, + 558B98CC1987FCBD00ADF159 /* munger_test.c */, + 558B98CD1987FCBD00ADF159 /* notify.cpp */, + 558B98CE1987FCBD00ADF159 /* option.mm */, + 558B98CF1987FCBD00ADF159 /* osevent.cpp */, + 558B98D01987FCBD00ADF159 /* osutil.cpp */, + 558B98D11987FCBD00ADF159 /* pack.cpp */, + 558B98D21987FCBD00ADF159 /* paramline.c */, + 558B98D31987FCBD00ADF159 /* parse.y */, + 558B98D41987FCBD00ADF159 /* parsenum.cpp */, + 558B98D51987FCBD00ADF159 /* parseopt.cpp */, + 558B98D61987FCBD00ADF159 /* pef_hash.cpp */, + 558B98D71987FCBD00ADF159 /* prError.cpp */, + 558B98D81987FCBD00ADF159 /* prInit.cpp */, + 558B98D91987FCBD00ADF159 /* priv.cpp */, + 558B98DA1987FCBD00ADF159 /* prLowLevel.cpp */, + 558B98DB1987FCBD00ADF159 /* process.cpp */, + 558B98DC1987FCBD00ADF159 /* prPrinting.cpp */, + 558B98DD1987FCBD00ADF159 /* prRecords.cpp */, + 558B98DE1987FCBD00ADF159 /* PSprint.mm */, + 558B98DF1987FCBD00ADF159 /* PSstrings.cpp */, + 551EE345198D5FA1004A3A41 /* QuickDraw */, + 558B990D1987FCBE00ADF159 /* redrawscreen.cpp */, + 558B990E1987FCBE00ADF159 /* refresh.cpp */, + 551EE341198D5F17004A3A41 /* Resource Manager */, + 558B99191987FCBE00ADF159 /* rgbutil.cpp */, + 558B991A1987FCBE00ADF159 /* romlib_stubs.cpp */, + 558B991B1987FCBE00ADF159 /* scrap.cpp */, + 558B991C1987FCBE00ADF159 /* screen-dump.cpp */, + 558B991D1987FCBE00ADF159 /* script.cpp */, + 558B991E1987FCBE00ADF159 /* segment.cpp */, + 558B991F1987FCBE00ADF159 /* serial.cpp */, + 558B99201987FCBE00ADF159 /* setuid.cpp */, + 558B99211987FCBE00ADF159 /* shutdown.cpp */, + 558B99221987FCBE00ADF159 /* sigio_multiplex.cpp */, + 558B99241987FCBE00ADF159 /* snth5.cpp */, + 558B99251987FCBE00ADF159 /* sound.cpp */, + 558B99261987FCBE00ADF159 /* sounddriver.cpp */, + 558B99271987FCBE00ADF159 /* soundfake.cpp */, + 558B99281987FCBE00ADF159 /* soundIMVI.cpp */, + 558B99291987FCBE00ADF159 /* splash.cpp */, + 558B992E1987FCBE00ADF159 /* string.cpp */, + 558B992F1987FCBE00ADF159 /* suffix_maps.cpp */, + 558B99301987FCBE00ADF159 /* syncint.cpp */, + 558B99311987FCBE00ADF159 /* syserr.cpp */, + 558B99321987FCBE00ADF159 /* system_error.cpp */, + 551EE343198D5F56004A3A41 /* Text Editing */, + 558B993B1987FCBE00ADF159 /* tempmem.cpp */, + 558B993D1987FCBE00ADF159 /* think.cpp */, + 558B993E1987FCBE00ADF159 /* time.cpp */, + 558B993F1987FCBE00ADF159 /* toolevent.cpp */, + 558B99401987FCBE00ADF159 /* toolmath.cpp */, + 558B99411987FCBE00ADF159 /* toolutil.cpp */, + 558B99421987FCBE00ADF159 /* trapname.cpp */, + 558B99431987FCBE00ADF159 /* uniquefile.cpp */, + 558B99441987FCBE00ADF159 /* unix_like.cpp */, + 558B99451987FCBE00ADF159 /* vbl.cpp */, + 558B99461987FCBE00ADF159 /* version.cpp */, + 558B99471987FCBE00ADF159 /* vgavdriver.cpp */, + 558B99481987FCBE00ADF159 /* virtualint.cpp */, + 551EE33A198D5E1E004A3A41 /* Window Sources */, + 557F30D419898513009873EB /* CBridge.cpp */, + ); + indentWidth = 2; + name = "Executor-Mac sources"; + path = ../../src; + sourceTree = ""; + }; + 558B9A5B198804BF00ADF159 /* syn68k */ = { + isa = PBXGroup; + children = ( + 558B9A5C198804D400ADF159 /* syn68k_public.h */, + 559AF49E198ABFE600DE8472 /* Syn68k.c */, + ); + name = syn68k; + path = "OSX-only/syn68k"; + sourceTree = ""; + }; + 559AF4AE198AE03000DE8472 /* mkexpandtables */ = { + isa = PBXGroup; + children = ( + 559AF4B4198AE0F400DE8472 /* mkexpandtables.c */, + ); + name = mkexpandtables; + path = src/mkexpandtables; + sourceTree = ""; + }; + 55D30F49198C1B08009BBB62 /* mkvol */ = { + isa = PBXGroup; + children = ( + 55D30F4F198C1B65009BBB62 /* mkvol_internal.h */, + 55D30F50198C1B65009BBB62 /* mkvol.cpp */, + 55D30F51198C1B65009BBB62 /* mkvol.h */, + 55D30F52198C1B65009BBB62 /* scsi_dump.c */, + ); + name = mkvol; + path = src/mkvol; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 556062EF1988679400D6F0B2 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 556064341988680100D6F0B2 /* smash.h in Headers */, + 556064381988680100D6F0B2 /* splash.h in Headers */, + 556064071988680000D6F0B2 /* new_mmanstubs.h in Headers */, + 556063E91988680000D6F0B2 /* host.h in Headers */, + 5560644B1988680100D6F0B2 /* trapglue.h in Headers */, + 556063EF1988680000D6F0B2 /* iv.h in Headers */, + 556063F21988680000D6F0B2 /* keyboards.h in Headers */, + 556063F31988680000D6F0B2 /* keycode.h in Headers */, + 556063DE1988680000D6F0B2 /* flags.h in Headers */, + 556064551988680100D6F0B2 /* x.h in Headers */, + 556064271988680000D6F0B2 /* refresh.h in Headers */, + 556064371988680100D6F0B2 /* soundopts.h in Headers */, + 5560643B1988680100D6F0B2 /* stdfile.h in Headers */, + 556063BE1988680000D6F0B2 /* blockinterrupts.h in Headers */, + 556064481988680100D6F0B2 /* toolutil.h in Headers */, + 556063C51988680000D6F0B2 /* common.h in Headers */, + 5560642A1988680000D6F0B2 /* resource.h in Headers */, + 5560642F1988680000D6F0B2 /* segment.h in Headers */, + 5560644E1988680100D6F0B2 /* uniquefile.h in Headers */, + 556064301988680000D6F0B2 /* serial.h in Headers */, + 556063D41988680000D6F0B2 /* drive_flags.h in Headers */, + 556063FD1988680000D6F0B2 /* mactype.h in Headers */, + 556064311988680000D6F0B2 /* setuid.h in Headers */, + 556064101988680000D6F0B2 /* os.h in Headers */, + 5560643A1988680100D6F0B2 /* stdbits.h in Headers */, + 5560644C1988680100D6F0B2 /* trapname.h in Headers */, + 556063BB1988680000D6F0B2 /* arrowkeys.h in Headers */, + 556064141988680000D6F0B2 /* parsenum.h in Headers */, + 556063D81988680000D6F0B2 /* everything.h in Headers */, + 556063C91988680000D6F0B2 /* cruft.h in Headers */, + 5560643D1988680100D6F0B2 /* string.h in Headers */, + 556064441988680100D6F0B2 /* tesave.h in Headers */, + 5560644D1988680100D6F0B2 /* types.h in Headers */, + 5560641D1988680000D6F0B2 /* prefs.h in Headers */, + 556063C41988680000D6F0B2 /* color_wheel_bits.h in Headers */, + 556064031988680000D6F0B2 /* mixed_mode.h in Headers */, + 556063CA1988680000D6F0B2 /* ctl.h in Headers */, + 556063ED1988680000D6F0B2 /* interfacelib.h in Headers */, + 556064391988680100D6F0B2 /* srcblt.h in Headers */, + 556063B81988680000D6F0B2 /* appearance.h in Headers */, + 556064291988680000D6F0B2 /* release.h in Headers */, + 556064431988680100D6F0B2 /* tempalloc.h in Headers */, + 556064501988680100D6F0B2 /* vdriver.h in Headers */, + 556063E21988680000D6F0B2 /* font.h in Headers */, + 556064471988680100D6F0B2 /* toolevent.h in Headers */, + 556063FB1988680000D6F0B2 /* m68kint.h in Headers */, + 5560643F1988680100D6F0B2 /* suffix_maps.h in Headers */, + 556063B61988680000D6F0B2 /* adb.h in Headers */, + 556063F51988680000D6F0B2 /* libcproto.h in Headers */, + 556064151988680000D6F0B2 /* parseopt.h in Headers */, + 556063FA1988680000D6F0B2 /* lowglobals.h in Headers */, + 556064451988680100D6F0B2 /* text.h in Headers */, + 5560641B1988680000D6F0B2 /* pragmas.h in Headers */, + 556064411988680100D6F0B2 /* syserr.h in Headers */, + 556064131988680000D6F0B2 /* parse.h in Headers */, + 5560640C1988680000D6F0B2 /* notmac.h in Headers */, + 556063CC1988680000D6F0B2 /* custom.h in Headers */, + 556064081988680000D6F0B2 /* newvga.h in Headers */, + 556064061988680000D6F0B2 /* mmanstubs.h in Headers */, + 556064051988680000D6F0B2 /* mman.h in Headers */, + 556063C61988680000D6F0B2 /* commonevt.h in Headers */, + 5560642D1988680000D6F0B2 /* scrap.h in Headers */, + 556063B91988680000D6F0B2 /* apple_events.h in Headers */, + 5560640B1988680000D6F0B2 /* noreturn.h in Headers */, + 556063CF1988680000D6F0B2 /* desk.h in Headers */, + 556064111988680000D6F0B2 /* osevent.h in Headers */, + 556063F81988680000D6F0B2 /* local_charset.h in Headers */, + 556064021988680000D6F0B2 /* misc.h in Headers */, + 5560644A1988680100D6F0B2 /* trapdefines.h in Headers */, + 5560640E1988680000D6F0B2 /* option.h in Headers */, + 5560642C1988680000D6F0B2 /* safe_alloca.h in Headers */, + 556063C01988680000D6F0B2 /* cfm.h in Headers */, + 556063F01988680000D6F0B2 /* jumpvectors.h in Headers */, + 556063BD1988680000D6F0B2 /* blockdev.h in Headers */, + 556064511988680100D6F0B2 /* version.h in Headers */, + 557F30D3198982DC009873EB /* CFriendly.h in Headers */, + 556064491988680100D6F0B2 /* trapdecl.h in Headers */, + 556063C71988680000D6F0B2 /* cquick.h in Headers */, + 556064251988680000D6F0B2 /* rawblt.h in Headers */, + 556064351988680100D6F0B2 /* sounddriver.h in Headers */, + 556063E31988680000D6F0B2 /* gestalt.h in Headers */, + 556064541988680100D6F0B2 /* wrappers.h in Headers */, + 556064331988680000D6F0B2 /* slash.h in Headers */, + 556063EE1988680000D6F0B2 /* itm.h in Headers */, + 556063F61988680000D6F0B2 /* licensetext.h in Headers */, + 5560640A1988680000D6F0B2 /* nextprint.h in Headers */, + 5560641F1988680000D6F0B2 /* process.h in Headers */, + 556064401988680100D6F0B2 /* syncint.h in Headers */, + 556063E71988680000D6F0B2 /* hfs.h in Headers */, + 556063C31988680000D6F0B2 /* cleanup.h in Headers */, + 556063F11988680000D6F0B2 /* keyboard.h in Headers */, + 556063C81988680000D6F0B2 /* crc.h in Headers */, + 556063EC1988680000D6F0B2 /* ini.h in Headers */, + 556063EB1988680000D6F0B2 /* image.h in Headers */, + 556064011988680000D6F0B2 /* menu.h in Headers */, + 5560640D1988680000D6F0B2 /* Olibcproto.h in Headers */, + 556063DA1988680000D6F0B2 /* executor.h in Headers */, + 556063B41988680000D6F0B2 /* aboutbox.h in Headers */, + 556063D91988680000D6F0B2 /* evil.h in Headers */, + 556064231988680000D6F0B2 /* qcolor.h in Headers */, + 556064521988680100D6F0B2 /* vgavdriver.h in Headers */, + 556064261988680000D6F0B2 /* redrawscreen.h in Headers */, + 556063FC1988680000D6F0B2 /* macros.h in Headers */, + 556063DB1988680000D6F0B2 /* fauxdbm.h in Headers */, + 556063E01988680000D6F0B2 /* float.h in Headers */, + 5560643C1988680100D6F0B2 /* stdio_smashage.h in Headers */, + 556064581988680100D6F0B2 /* Xdefs.h in Headers */, + 556063D21988680000D6F0B2 /* dial.h in Headers */, + 5560643E1988680100D6F0B2 /* stubify.h in Headers */, + 5560642E1988680000D6F0B2 /* screen-dump.h in Headers */, + 556063BF1988680000D6F0B2 /* byteswap.h in Headers */, + 556064221988680000D6F0B2 /* ptocflags.h in Headers */, + 556063DF1988680000D6F0B2 /* float_fcw.h in Headers */, + 556063D01988680000D6F0B2 /* desperate.h in Headers */, + 556064531988680100D6F0B2 /* wind.h in Headers */, + 556064241988680000D6F0B2 /* quick.h in Headers */, + 556063BA1988680000D6F0B2 /* arch.h in Headers */, + 556064041988680000D6F0B2 /* mman_private.h in Headers */, + 556063DD1988680000D6F0B2 /* filedouble.h in Headers */, + 556063FF1988680000D6F0B2 /* memory_layout.h in Headers */, + 556064201988680000D6F0B2 /* PSstrings.h in Headers */, + 556063EA1988680000D6F0B2 /* icon.h in Headers */, + 556063B51988680000D6F0B2 /* aboutpanel.h in Headers */, + 556063D11988680000D6F0B2 /* device.h in Headers */, + 556064321988680000D6F0B2 /* sigio_multiplex.h in Headers */, + 556064561988680100D6F0B2 /* xdata.h in Headers */, + 556063CD1988680000D6F0B2 /* dcache.h in Headers */, + 556064211988680000D6F0B2 /* pstuff.h in Headers */, + 5560641A1988680000D6F0B2 /* pragmar.h in Headers */, + 556064571988680100D6F0B2 /* xdblt.h in Headers */, + 5560642B1988680000D6F0B2 /* rgbutil.h in Headers */, + 556063F91988680000D6F0B2 /* lockunlock.h in Headers */, + 556064421988680100D6F0B2 /* system_error.h in Headers */, + 556063D61988680000D6F0B2 /* emustubs.h in Headers */, + 556064181988680000D6F0B2 /* picture.h in Headers */, + 556063D71988680000D6F0B2 /* error.h in Headers */, + 556063E61988680000D6F0B2 /* hfs_plus.h in Headers */, + 556063DC1988680000D6F0B2 /* file.h in Headers */, + 556064361988680100D6F0B2 /* soundfake.h in Headers */, + 556063FE1988680000D6F0B2 /* mathlib.h in Headers */, + 5560640F1988680000D6F0B2 /* options.h in Headers */, + 556063BC1988680000D6F0B2 /* autorefresh.h in Headers */, + 5560641E1988680000D6F0B2 /* print.h in Headers */, + 556064191988680000D6F0B2 /* pragmal.h in Headers */, + 556064171988680000D6F0B2 /* pef.h in Headers */, + 5560644F1988680100D6F0B2 /* vbl.h in Headers */, + 556063CB1988680000D6F0B2 /* ctopflags.h in Headers */, + 5560641C1988680000D6F0B2 /* prefpanel.h in Headers */, + 556064461988680100D6F0B2 /* time.h in Headers */, + 556063F71988680000D6F0B2 /* list.h in Headers */, + 556063D31988680000D6F0B2 /* dirtyrect.h in Headers */, + 556063C21988680000D6F0B2 /* checkpoint.h in Headers */, + 556063F41988680000D6F0B2 /* launch.h in Headers */, + 556064121988680000D6F0B2 /* osutil.h in Headers */, + 556063E51988680000D6F0B2 /* gworld.h in Headers */, + 556063E11988680000D6F0B2 /* floatconv.h in Headers */, + 556063C11988680000D6F0B2 /* check_structs.h in Headers */, + 556063B71988680000D6F0B2 /* alias.h in Headers */, + 556064281988680000D6F0B2 /* region.h in Headers */, + 556063D51988680000D6F0B2 /* dump.h in Headers */, + 556064001988680000D6F0B2 /* memsize.h in Headers */, + 556063E81988680000D6F0B2 /* hook.h in Headers */, + 556063E41988680000D6F0B2 /* glue.h in Headers */, + 556063CE1988680000D6F0B2 /* depthconv.h in Headers */, + 556064091988680000D6F0B2 /* next.h in Headers */, + 556064161988680000D6F0B2 /* partition.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 558B9A551988049300ADF159 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 558B9A5D198804D400ADF159 /* syn68k_public.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 556062F11988679400D6F0B2 /* rsys */ = { + isa = PBXNativeTarget; + buildConfigurationList = 556063051988679500D6F0B2 /* Build configuration list for PBXNativeTarget "rsys" */; + buildPhases = ( + 556062ED1988679400D6F0B2 /* Sources */, + 556062EE1988679400D6F0B2 /* Frameworks */, + 556062EF1988679400D6F0B2 /* Headers */, + 556062F01988679400D6F0B2 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = rsys; + productName = rsys; + productReference = 556062F21988679400D6F0B2 /* rsys.framework */; + productType = "com.apple.product-type.framework"; + }; + 556E040219856E5700FC4362 /* CocoaExecutor */ = { + isa = PBXNativeTarget; + buildConfigurationList = 556E043419856E5700FC4362 /* Build configuration list for PBXNativeTarget "CocoaExecutor" */; + buildPhases = ( + 557F30C71989779F009873EB /* Generate Tables */, + 556E03FF19856E5700FC4362 /* Sources */, + 556E040019856E5700FC4362 /* Frameworks */, + 556E040119856E5700FC4362 /* Resources */, + ); + buildRules = ( + 5500AB2C19858B8F00FF62C0 /* PBXBuildRule */, + ); + dependencies = ( + 557F30C9198977AB009873EB /* PBXTargetDependency */, + 559AF4B7198AE20300DE8472 /* PBXTargetDependency */, + 557F30CB198977AB009873EB /* PBXTargetDependency */, + 557F30CD198977AB009873EB /* PBXTargetDependency */, + 5560630C198867C300D6F0B2 /* PBXTargetDependency */, + 5560630E198867C500D6F0B2 /* PBXTargetDependency */, + 5500AB2B19858A4F00FF62C0 /* PBXTargetDependency */, + ); + name = CocoaExecutor; + productName = CocoaExecutor; + productReference = 556E040319856E5700FC4362 /* NeoClassic.app */; + productType = "com.apple.product-type.application"; + }; + 556E042319856E5700FC4362 /* CocoaExecutorTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 556E043719856E5700FC4362 /* Build configuration list for PBXNativeTarget "CocoaExecutorTests" */; + buildPhases = ( + 556E042019856E5700FC4362 /* Sources */, + 556E042119856E5700FC4362 /* Frameworks */, + 556E042219856E5700FC4362 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 556E042919856E5700FC4362 /* PBXTargetDependency */, + 559AF4A4198AC99B00DE8472 /* PBXTargetDependency */, + ); + name = CocoaExecutorTests; + productName = CocoaExecutorTests; + productReference = 556E042419856E5700FC4362 /* CocoaExecutorTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 556E05661985854000FC4362 /* map_to_c */ = { + isa = PBXNativeTarget; + buildConfigurationList = 556E056D1985854000FC4362 /* Build configuration list for PBXNativeTarget "map_to_c" */; + buildPhases = ( + 556E05631985854000FC4362 /* Sources */, + 556E05641985854000FC4362 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 559AF4A7198AD3B400DE8472 /* PBXTargetDependency */, + ); + name = map_to_c; + productName = map_to_c; + productReference = 556E05671985854000FC4362 /* map_to_c */; + productType = "com.apple.product-type.tool"; + }; + 557F30A319897619009873EB /* mkseedtables */ = { + isa = PBXNativeTarget; + buildConfigurationList = 557F30A819897619009873EB /* Build configuration list for PBXNativeTarget "mkseedtables" */; + buildPhases = ( + 557F30A019897619009873EB /* Sources */, + 557F30A119897619009873EB /* Frameworks */, + 557F30A219897619009873EB /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = mkseedtables; + productName = mkseedtables; + productReference = 557F30A419897619009873EB /* mkseedtables */; + productType = "com.apple.product-type.tool"; + }; + 557F30AE19897653009873EB /* mkultable */ = { + isa = PBXNativeTarget; + buildConfigurationList = 557F30B319897653009873EB /* Build configuration list for PBXNativeTarget "mkultable" */; + buildPhases = ( + 557F30AB19897653009873EB /* Sources */, + 557F30AC19897653009873EB /* Frameworks */, + 557F30AD19897653009873EB /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = mkultable; + productName = mkultable; + productReference = 557F30AF19897653009873EB /* mkultable */; + productType = "com.apple.product-type.tool"; + }; + 557F30B91989768A009873EB /* mksspairtable */ = { + isa = PBXNativeTarget; + buildConfigurationList = 557F30BE1989768A009873EB /* Build configuration list for PBXNativeTarget "mksspairtable" */; + buildPhases = ( + 557F30B61989768A009873EB /* Sources */, + 557F30B71989768A009873EB /* Frameworks */, + 557F30B81989768A009873EB /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = mksspairtable; + productName = mksspairtable; + productReference = 557F30BA1989768A009873EB /* mksspairtable */; + productType = "com.apple.product-type.tool"; + }; + 558B9A561988049300ADF159 /* syn68k */ = { + isa = PBXNativeTarget; + buildConfigurationList = 558B9A581988049400ADF159 /* Build configuration list for PBXNativeTarget "syn68k" */; + buildPhases = ( + 558B9A531988049300ADF159 /* Sources */, + 558B9A541988049300ADF159 /* Frameworks */, + 558B9A551988049300ADF159 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = syn68k; + productName = syn68k; + productReference = 558B9A571988049300ADF159 /* libsyn68k.a */; + productType = "com.apple.product-type.library.static"; + }; + 559AF4AC198AE03000DE8472 /* mkexpandtables */ = { + isa = PBXNativeTarget; + buildConfigurationList = 559AF4B1198AE03000DE8472 /* Build configuration list for PBXNativeTarget "mkexpandtables" */; + buildPhases = ( + 559AF4A9198AE03000DE8472 /* Sources */, + 559AF4AA198AE03000DE8472 /* Frameworks */, + 559AF4AB198AE03000DE8472 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = mkexpandtables; + productName = mkexpandtables; + productReference = 559AF4AD198AE03000DE8472 /* mkexpandtables */; + productType = "com.apple.product-type.tool"; + }; + 55D30F47198C1B08009BBB62 /* mkvol */ = { + isa = PBXNativeTarget; + buildConfigurationList = 55D30F4C198C1B08009BBB62 /* Build configuration list for PBXNativeTarget "mkvol" */; + buildPhases = ( + 55D30F44198C1B08009BBB62 /* Sources */, + 55D30F45198C1B08009BBB62 /* Frameworks */, + 55D30F46198C1B08009BBB62 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = mkvol; + productName = mkvol; + productReference = 55D30F48198C1B08009BBB62 /* mkvol */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 556E03FB19856E5700FC4362 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = EXEC; + LastUpgradeCheck = 0510; + ORGANIZATIONNAME = "C.W. Betts"; + TargetAttributes = { + 556062F11988679400D6F0B2 = { + CreatedOnToolsVersion = 6.0; + }; + 556E042319856E5700FC4362 = { + TestTargetID = 556E040219856E5700FC4362; + }; + 557F30A319897619009873EB = { + CreatedOnToolsVersion = 6.0; + }; + 557F30AE19897653009873EB = { + CreatedOnToolsVersion = 6.0; + }; + 557F30B91989768A009873EB = { + CreatedOnToolsVersion = 6.0; + }; + 558B9A561988049300ADF159 = { + CreatedOnToolsVersion = 6.0; + }; + 559AF4AC198AE03000DE8472 = { + CreatedOnToolsVersion = 6.0; + }; + 55D30F47198C1B08009BBB62 = { + CreatedOnToolsVersion = 6.0; + }; + }; + }; + buildConfigurationList = 556E03FE19856E5700FC4362 /* Build configuration list for PBXProject "CocoaExecutor" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 556E03FA19856E5700FC4362; + productRefGroup = 556E040419856E5700FC4362 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 556E040219856E5700FC4362 /* CocoaExecutor */, + 556E042319856E5700FC4362 /* CocoaExecutorTests */, + 556E05661985854000FC4362 /* map_to_c */, + 558B9A561988049300ADF159 /* syn68k */, + 556062F11988679400D6F0B2 /* rsys */, + 557F30A319897619009873EB /* mkseedtables */, + 557F30AE19897653009873EB /* mkultable */, + 557F30B91989768A009873EB /* mksspairtable */, + 559AF4AC198AE03000DE8472 /* mkexpandtables */, + 55D30F47198C1B08009BBB62 /* mkvol */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 556062F01988679400D6F0B2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 556E040119856E5700FC4362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 55D30F59198C38DB009BBB62 /* info.xib in Resources */, + 5500AB541985A66A00FF62C0 /* Executor.xib in Resources */, + 556E041F19856E5700FC4362 /* Images.xcassets in Resources */, + 558B9A521987FCDF00ADF159 /* skel in Resources */, + 556E041719856E5700FC4362 /* Credits.rtf in Resources */, + 5500AB551985A66A00FF62C0 /* Executor.tiff in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 556E042219856E5700FC4362 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 556E042F19856E5700FC4362 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 557F30C71989779F009873EB /* Generate Tables */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/CocoaExecutor/Templates/pat-blitters.tmpl", + "$(SRCROOT)/CocoaExecutor/Templates/src-blitters.tmpl", + "${TARGET_BUILD_DIR}/mkexpandtables", + "${TARGET_BUILD_DIR}/mksspairtable", + "${TARGET_BUILD_DIR}/mkultable", + "${TARGET_BUILD_DIR}/mkseedtables", + ); + name = "Generate Tables"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/sspairtable.ctable", + "$(DERIVED_FILE_DIR)/ultable.ctable", + "$(DERIVED_FILE_DIR)/seedtables.ctable", + "$(DERIVED_FILE_DIR)/rawpatstubs.ctable", + "$(DERIVED_FILE_DIR)/rawsrcstubs.ctable", + "${DERIVED_FILE_DIR}/expandtables.ctable", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "${TARGET_BUILD_DIR}/mkseedtables > \"${DERIVED_FILE_DIR}/seedtables.ctable\"\n${TARGET_BUILD_DIR}/mkultable > \"${DERIVED_FILE_DIR}/ultable.ctable\"\n${TARGET_BUILD_DIR}/mksspairtable > \"${DERIVED_FILE_DIR}/sspairtable.ctable\"\n${TARGET_BUILD_DIR}/mkexpandtables > \"${DERIVED_FILE_DIR}/expandtables.ctable\"\n\nperl CocoaExecutor/makerawblt.pl < CocoaExecutor/Templates/pat-blitters.tmpl >\"${DERIVED_FILE_DIR}\"/rawpatstubs.ctable\nperl CocoaExecutor/makerawblt.pl < CocoaExecutor/Templates/src-blitters.tmpl >\"${DERIVED_FILE_DIR}\"/rawsrcstubs.ctable"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 556062ED1988679400D6F0B2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 559AF4A2198AC90F00DE8472 /* stub.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 556E03FF19856E5700FC4362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 55A742AC198DC09200F1A8A5 /* local_charset.cpp in Sources */, + 558B99C81987FCBF00ADF159 /* mman.cpp in Sources */, + 558B9A101987FCBF00ADF159 /* resIMIV.cpp in Sources */, + 558B99BF1987FCBF00ADF159 /* mathlib.cpp in Sources */, + 558B99E81987FCBF00ADF159 /* qGrafport.cpp in Sources */, + 558B99771987FCBF00ADF159 /* device.cpp in Sources */, + 558B996E1987FCBF00ADF159 /* ctlSize.cpp in Sources */, + 558B997B1987FCBF00ADF159 /* dialHandle.cpp in Sources */, + 5500AB571985A66A00FF62C0 /* MacAppClass.mm in Sources */, + 558B99A11987FCBF00ADF159 /* hfsFile.cpp in Sources */, + 558B99F61987FCBF00ADF159 /* qPoint.cpp in Sources */, + 5500AB561985A66A00FF62C0 /* Executor_main.mm in Sources */, + 558B99691987FCBF00ADF159 /* ctlInit.cpp in Sources */, + 558B99791987FCBF00ADF159 /* dialCreate.cpp in Sources */, + 5500AB591985A66A00FF62C0 /* MacWinClass.m in Sources */, + 558B99AD1987FCBF00ADF159 /* ini.cpp in Sources */, + 558B9A3E1987FCBF00ADF159 /* toolmath.cpp in Sources */, + 558B99721987FCBF00ADF159 /* dcconvert.cpp in Sources */, + 558B99D61987FCBF00ADF159 /* prInit.cpp in Sources */, + 556062EB1988441700D6F0B2 /* xdata.cpp in Sources */, + 5500AB5D1985A66A00FF62C0 /* NEXTprint.mm in Sources */, + 558B9A181987FCBF00ADF159 /* romlib_stubs.cpp in Sources */, + 558B9A421987FCBF00ADF159 /* unix_like.cpp in Sources */, + 558B9A2D1987FCBF00ADF159 /* suffix_maps.cpp in Sources */, + 558B99A71987FCBF00ADF159 /* hfsXbar.cpp in Sources */, + 558B99ED1987FCBF00ADF159 /* qIMVI.cpp in Sources */, + 558B99C11987FCBF00ADF159 /* menuColor.cpp in Sources */, + 558B997F1987FCBF00ADF159 /* dirtyrect.cpp in Sources */, + 558B9A2C1987FCBF00ADF159 /* string.cpp in Sources */, + 558B99F71987FCBF00ADF159 /* qPoly.cpp in Sources */, + 558B99D01987FCBF00ADF159 /* paramline.c in Sources */, + 558B99921987FCBF00ADF159 /* finder.cpp in Sources */, + 558B99C01987FCBF00ADF159 /* menu.cpp in Sources */, + 558B99D51987FCBF00ADF159 /* prError.cpp in Sources */, + 558B9A461987FCBF00ADF159 /* virtualint.cpp in Sources */, + 5500AB5C1985A66A00FF62C0 /* NEXTmain.mm in Sources */, + 558B9A0D1987FCBF00ADF159 /* resGet.cpp in Sources */, + 558B99C91987FCBF00ADF159 /* mmansubr.cpp in Sources */, + 558B9A151987FCBF00ADF159 /* resPartial.cpp in Sources */, + 557F30D71989ACFE009873EB /* fauxdbm.c in Sources */, + 558B99A51987FCBF00ADF159 /* hfsVolume.cpp in Sources */, + 558B9A0A1987FCBF00ADF159 /* rawsrcblt.cpp in Sources */, + 558B9A1F1987FCBF00ADF159 /* shutdown.cpp in Sources */, + 558B997D1987FCBF00ADF159 /* dialItem.cpp in Sources */, + 558B99E61987FCBF00ADF159 /* qCursor.cpp in Sources */, + 558B99D71987FCBF00ADF159 /* priv.cpp in Sources */, + 558B998F1987FCBF00ADF159 /* fileInfo.cpp in Sources */, + 558B9A3B1987FCBF00ADF159 /* think.cpp in Sources */, + 558B9A271987FCBF00ADF159 /* splash.cpp in Sources */, + 558B99951987FCBF00ADF159 /* float7.cpp in Sources */, + 558B99BA1987FCBF00ADF159 /* listStdLDEF.cpp in Sources */, + 556E0556198584DE00FC4362 /* apple.map in Sources */, + 558B99631987FCBF00ADF159 /* color_wheel_bits.cpp in Sources */, + 558B9A281987FCBF00ADF159 /* srcblt.cpp in Sources */, + 558B99EB1987FCBF00ADF159 /* qIMIV.cpp in Sources */, + 558B99EF1987FCBF00ADF159 /* qMisc.cpp in Sources */, + 556E0555198584DE00FC4362 /* active.map in Sources */, + 558B995F1987FCBF00ADF159 /* cfm.cpp in Sources */, + 558B99DD1987FCBF00ADF159 /* PSstrings.cpp in Sources */, + 558B99931987FCBF00ADF159 /* float4.cpp in Sources */, + 558B995C1987FCBF00ADF159 /* balloon.cpp in Sources */, + 558B99581987FCBF00ADF159 /* AE_hdlr.cpp in Sources */, + 558B9A261987FCBF00ADF159 /* soundIMVI.cpp in Sources */, + 558B99901987FCBF00ADF159 /* fileMisc.cpp in Sources */, + 558B99F51987FCBF00ADF159 /* qPixMapConv.cpp in Sources */, + 557F30D119897991009873EB /* thumb_vert.map in Sources */, + 558B99B01987FCBF00ADF159 /* iv-stubs.cpp in Sources */, + 558B998B1987FCBF00ADF159 /* fileCreate.cpp in Sources */, + 5500AB341985911A00FF62C0 /* x86_64.cpp in Sources */, + 558B999E1987FCBF00ADF159 /* hfsBtree.cpp in Sources */, + 558B9A3F1987FCBF00ADF159 /* toolutil.cpp in Sources */, + 558B9A041987FCBF00ADF159 /* qStdRgn.cpp in Sources */, + 558B9A1B1987FCBF00ADF159 /* script.cpp in Sources */, + 558B998A1987FCBF00ADF159 /* fileAccess.cpp in Sources */, + 558B99F11987FCBF00ADF159 /* qPen.cpp in Sources */, + 558B99BC1987FCBF00ADF159 /* lockrange.cpp in Sources */, + 558B99E41987FCBF00ADF159 /* qColorutil.cpp in Sources */, + 558B99DB1987FCBF00ADF159 /* prRecords.cpp in Sources */, + 558B9A451987FCBF00ADF159 /* vgavdriver.cpp in Sources */, + 558B998E1987FCBF00ADF159 /* fileHighlevel.cpp in Sources */, + 558B99E01987FCBF00ADF159 /* qCGrafPort.cpp in Sources */, + 556E0560198584DE00FC4362 /* grow.map in Sources */, + 559AF4B8198AF72B00DE8472 /* segment.cpp in Sources */, + 558B99871987FCBF00ADF159 /* error.cpp in Sources */, + 558B9A061987FCBF00ADF159 /* qStdText.cpp in Sources */, + 556E0559198584DE00FC4362 /* arrow_left_active.map in Sources */, + 556E0557198584DE00FC4362 /* arrow_down_active.map in Sources */, + 558B99861987FCBF00ADF159 /* emutraptables.cpp in Sources */, + 558B99711987FCBF00ADF159 /* dcache.cpp in Sources */, + 558B996A1987FCBF00ADF159 /* ctlMisc.cpp in Sources */, + 558B99981987FCBF00ADF159 /* fontIMVI.cpp in Sources */, + 558B9A0F1987FCBF00ADF159 /* resGettype.cpp in Sources */, + 558B998C1987FCBF00ADF159 /* fileDirs.cpp in Sources */, + 558B9A341987FCBF00ADF159 /* teIMIV.cpp in Sources */, + 558B99681987FCBF00ADF159 /* ctlIMIV.cpp in Sources */, + 558B99C31987FCBF00ADF159 /* mixed_mode.cpp in Sources */, + 558B99F21987FCBF00ADF159 /* qPicstuff.cpp in Sources */, + 558B996C1987FCBF00ADF159 /* ctlPopup.cpp in Sources */, + 558B99671987FCBF00ADF159 /* ctlDisplay.cpp in Sources */, + 558B9A051987FCBF00ADF159 /* qStdRRect.cpp in Sources */, + 558B99D91987FCBF00ADF159 /* process.cpp in Sources */, + 558B99B21987FCBF00ADF159 /* launch.cpp in Sources */, + 558B99B61987FCBF00ADF159 /* listCreate.cpp in Sources */, + 558B9A251987FCBF00ADF159 /* soundfake.cpp in Sources */, + 557F30D019897991009873EB /* thumb_horiz.map in Sources */, + 558B99A01987FCBF00ADF159 /* hfsCreate.cpp in Sources */, + 558B9A141987FCBF00ADF159 /* resOpen.cpp in Sources */, + 558B99F81987FCBF00ADF159 /* qRect.cpp in Sources */, + 558B99EC1987FCBF00ADF159 /* qIMV.cpp in Sources */, + 558B9A471987FCBF00ADF159 /* windColor.cpp in Sources */, + 558B99E11987FCBF00ADF159 /* qColor.cpp in Sources */, + 558B9A241987FCBF00ADF159 /* sounddriver.cpp in Sources */, + 558B999D1987FCBF00ADF159 /* globals.cpp in Sources */, + 558B99551987FCBF00ADF159 /* AE.cpp in Sources */, + 558B995E1987FCBF00ADF159 /* blockdev.cpp in Sources */, + 558B9A1E1987FCBF00ADF159 /* setuid.cpp in Sources */, + 558B9A011987FCBF00ADF159 /* qStdPic.cpp in Sources */, + 558B99B41987FCBF00ADF159 /* listAccess.cpp in Sources */, + 558B99EA1987FCBF00ADF159 /* qHooks.cpp in Sources */, + 558B99801987FCBF00ADF159 /* disk.cpp in Sources */, + 558B99CB1987FCBF00ADF159 /* notify.cpp in Sources */, + 558B9A191987FCBF00ADF159 /* scrap.cpp in Sources */, + 558B9A491987FCBF00ADF159 /* windDocdef.cpp in Sources */, + 558B9A171987FCBF00ADF159 /* rgbutil.cpp in Sources */, + 558B99CC1987FCBF00ADF159 /* option.mm in Sources */, + 558B9A2F1987FCBF00ADF159 /* syserr.cpp in Sources */, + 558B99F01987FCBF00ADF159 /* qPaletteMgr.cpp in Sources */, + 558B9A4D1987FCBF00ADF159 /* windSize.cpp in Sources */, + 558B9A1D1987FCBF00ADF159 /* serial.cpp in Sources */, + 558B99A41987FCBF00ADF159 /* hfsMisc.cpp in Sources */, + 558B99571987FCBF00ADF159 /* AE_desc.cpp in Sources */, + 558B99B11987FCBF00ADF159 /* keycode.mm in Sources */, + 558B9A3C1987FCBF00ADF159 /* time.cpp in Sources */, + 558B996F1987FCBF00ADF159 /* ctlStddef.cpp in Sources */, + 558B9A0E1987FCBF00ADF159 /* resGetinfo.cpp in Sources */, + 558B9A2B1987FCBF00ADF159 /* stdmdef.cpp in Sources */, + 558B99811987FCBF00ADF159 /* diskinit.cpp in Sources */, + 558B99971987FCBF00ADF159 /* font.cpp in Sources */, + 558B99F91987FCBF00ADF159 /* qRegion.cpp in Sources */, + 558B99741987FCBF00ADF159 /* default_ctab_values.cpp in Sources */, + 558B99881987FCBF00ADF159 /* executor.cpp in Sources */, + 558B9A291987FCBF00ADF159 /* stdfile.cpp in Sources */, + 558B99F31987FCBF00ADF159 /* qPict2.cpp in Sources */, + 556E0561198584DE00FC4362 /* ractive.map in Sources */, + 5500AB5A1985A66A00FF62C0 /* NEXT.mm in Sources */, + 557F30D519898513009873EB /* CBridge.cpp in Sources */, + 556E055E198584DE00FC4362 /* arrow_up_inactive.map in Sources */, + 55A742B0198DE1C100F1A8A5 /* slash.cpp in Sources */, + 558B99731987FCBF00ADF159 /* dcmaketables.cpp in Sources */, + 558B99CD1987FCBF00ADF159 /* osevent.cpp in Sources */, + 558B99FF1987FCBF00ADF159 /* qStdLine.cpp in Sources */, + 558B996D1987FCBF00ADF159 /* ctlSet.cpp in Sources */, + 558B99CF1987FCBF00ADF159 /* pack.cpp in Sources */, + 558B99DF1987FCBF00ADF159 /* qCConv.cpp in Sources */, + 558B9A4C1987FCBF00ADF159 /* windMouse.cpp in Sources */, + 558B99D41987FCBF00ADF159 /* pef_hash.cpp in Sources */, + 558B99B51987FCBF00ADF159 /* listAddDel.cpp in Sources */, + 55D30F56198C1FE2009BBB62 /* mkvol.cpp in Sources */, + 558B99A91987FCBF00ADF159 /* ibm_keycodes.cpp in Sources */, + 558B99541987FCBF00ADF159 /* adb.cpp in Sources */, + 558B99E91987FCBF00ADF159 /* qGWorld.cpp in Sources */, + 558B9A2E1987FCBF00ADF159 /* syncint.cpp in Sources */, + 55A742A2198D79DD00F1A8A5 /* SoundOSX.cpp in Sources */, + 558B99591987FCBF00ADF159 /* alias.cpp in Sources */, + 558B9A301987FCBF00ADF159 /* system_error.cpp in Sources */, + 558B99911987FCBF00ADF159 /* fileVolumes.cpp in Sources */, + 558B99C21987FCBF00ADF159 /* menuV.cpp in Sources */, + 558B9A3D1987FCBF00ADF159 /* toolevent.cpp in Sources */, + 558B9A071987FCBF00ADF159 /* qt.cpp in Sources */, + 558B99D31987FCBF00ADF159 /* parseopt.cpp in Sources */, + 558B9A231987FCBF00ADF159 /* sound.cpp in Sources */, + 558B99D21987FCBF00ADF159 /* parsenum.cpp in Sources */, + 558B99E31987FCBF00ADF159 /* qColorPicker.cpp in Sources */, + 558B9A201987FCBF00ADF159 /* sigio_multiplex.cpp in Sources */, + 556E055C198584DE00FC4362 /* arrow_right_inactive.map in Sources */, + 558B998D1987FCBF00ADF159 /* fileDouble.cpp in Sources */, + 558B9A161987FCBF00ADF159 /* resSetcur.cpp in Sources */, + 55A742AB198DB05100F1A8A5 /* emustubs.cpp in Sources */, + 558B99AB1987FCBF00ADF159 /* image.cpp in Sources */, + 558B999F1987FCBF00ADF159 /* hfsChanging.cpp in Sources */, + 558B99961987FCBF00ADF159 /* floatnext.cpp in Sources */, + 558B99701987FCBF00ADF159 /* custom.cpp in Sources */, + 558B99F41987FCBF00ADF159 /* qPicture.cpp in Sources */, + 558B99B71987FCBF00ADF159 /* listDisplay.cpp in Sources */, + 558B99A81987FCBF00ADF159 /* hle.cpp in Sources */, + 558B99851987FCBF00ADF159 /* emutrap.cpp in Sources */, + 558B99941987FCBF00ADF159 /* float5.cpp in Sources */, + 558B99D11987FCBF00ADF159 /* parse.y in Sources */, + 558B9A1A1987FCBF00ADF159 /* screen-dump.cpp in Sources */, + 558B9A401987FCBF00ADF159 /* trapname.cpp in Sources */, + 558B99EE1987FCBF00ADF159 /* qIMVxfer.cpp in Sources */, + 558B99AF1987FCBF00ADF159 /* iu.cpp in Sources */, + 558B9A131987FCBF00ADF159 /* resMod.cpp in Sources */, + 558B99E71987FCBF00ADF159 /* qGDevice.cpp in Sources */, + 558B9A361987FCBF00ADF159 /* teInit.cpp in Sources */, + 558B99751987FCBF00ADF159 /* desk.cpp in Sources */, + 558B9A481987FCBF00ADF159 /* windDisplay.cpp in Sources */, + 558B995A1987FCBF00ADF159 /* appearance.cpp in Sources */, + 558B997A1987FCBF00ADF159 /* dialDispatch.cpp in Sources */, + 558B99AA1987FCBF00ADF159 /* icon.cpp in Sources */, + 558B99B81987FCBF00ADF159 /* listMouse.cpp in Sources */, + 558B9A001987FCBF00ADF159 /* qStdOval.cpp in Sources */, + 558B9A031987FCBF00ADF159 /* qStdRect.cpp in Sources */, + 558B99A61987FCBF00ADF159 /* hfsWorkingdir.cpp in Sources */, + 558B995D1987FCBF00ADF159 /* bindec.cpp in Sources */, + 558B9A2A1987FCBF00ADF159 /* stdmbdf.cpp in Sources */, + 558B9A391987FCBF00ADF159 /* tempmem.cpp in Sources */, + 558B9A021987FCBF00ADF159 /* qStdPoly.cpp in Sources */, + 558B997E1987FCBF00ADF159 /* dialManip.cpp in Sources */, + 558B99DA1987FCBF00ADF159 /* prPrinting.cpp in Sources */, + 558B99FD1987FCBF00ADF159 /* qStdArc.cpp in Sources */, + 5500AB581985A66A00FF62C0 /* MacViewClass.mm in Sources */, + 558B99CE1987FCBF00ADF159 /* osutil.cpp in Sources */, + 556062EC198844B800D6F0B2 /* xdblt.cpp in Sources */, + 558B99FC1987FCBF00ADF159 /* qStandard.cpp in Sources */, + 558B99AE1987FCBF00ADF159 /* interfacelib.cpp in Sources */, + 558B997C1987FCBF00ADF159 /* dialInit.cpp in Sources */, + 558B99FA1987FCBF00ADF159 /* qRegular.cpp in Sources */, + 558B9A441987FCBF00ADF159 /* version.cpp in Sources */, + 558B9A4B1987FCBF00ADF159 /* windMisc.cpp in Sources */, + 558B99781987FCBF00ADF159 /* dialAlert.cpp in Sources */, + 558B99761987FCBF00ADF159 /* desperate.cpp in Sources */, + 5500AB5B1985A66A00FF62C0 /* NEXTkeyboard.cpp in Sources */, + 558B99531987FCBF00ADF159 /* aboutbox.cpp in Sources */, + 558B9A331987FCBF00ADF159 /* teEdit.cpp in Sources */, + 557F308F198967BE009873EB /* stdfile-OSX.cpp in Sources */, + 558B9A411987FCBF00ADF159 /* uniquefile.cpp in Sources */, + 558B99D81987FCBF00ADF159 /* prLowLevel.cpp in Sources */, + 55A742A8198D819E00F1A8A5 /* FileDouble-OSX.cpp in Sources */, + 558B99831987FCBF00ADF159 /* edition.cpp in Sources */, + 558B99DE1987FCBF00ADF159 /* qBit.cpp in Sources */, + 558B9A4E1987FCBF00ADF159 /* windUpdate.cpp in Sources */, + 558B99641987FCBF00ADF159 /* commtool.cpp in Sources */, + 558B99FB1987FCBF00ADF159 /* qScale.cpp in Sources */, + 558B99E21987FCBF00ADF159 /* qColorMgr.cpp in Sources */, + 558B99FE1987FCBF00ADF159 /* qStdBits.cpp in Sources */, + 558B9A4A1987FCBF00ADF159 /* windInit.cpp in Sources */, + 558B99E51987FCBF00ADF159 /* qCRegular.cpp in Sources */, + 558B99561987FCBF00ADF159 /* AE_coercion.cpp in Sources */, + 556E055B198584DE00FC4362 /* arrow_right_active.map in Sources */, + 556E055F198584DE00FC4362 /* go_away.map in Sources */, + 558B9A111987FCBF00ADF159 /* resInit.cpp in Sources */, + 558B995B1987FCBF00ADF159 /* autorefresh.cpp in Sources */, + 558B9A431987FCBF00ADF159 /* vbl.cpp in Sources */, + 558B99BD1987FCBF00ADF159 /* main.cpp in Sources */, + 558B99651987FCBF00ADF159 /* crc.cpp in Sources */, + 558B9A091987FCBF00ADF159 /* rawpatblt.cpp in Sources */, + 558B9A221987FCBF00ADF159 /* snth5.cpp in Sources */, + 558B996B1987FCBF00ADF159 /* ctlMouse.cpp in Sources */, + 558B9A3A1987FCBF00ADF159 /* teScrap.cpp in Sources */, + 556E0562198584DE00FC4362 /* zoom.map in Sources */, + 558B99AC1987FCBF00ADF159 /* image_inits.cpp in Sources */, + 558B9A311987FCBF00ADF159 /* teAccess.cpp in Sources */, + 558B99DC1987FCBF00ADF159 /* PSprint.mm in Sources */, + 556E055A198584DE00FC4362 /* arrow_left_inactive.map in Sources */, + 558B9A121987FCBF00ADF159 /* resMisc.cpp in Sources */, + 558B999C1987FCBF00ADF159 /* gestalt.cpp in Sources */, + 558B9A351987FCBF00ADF159 /* teIMV.cpp in Sources */, + 558B9A0B1987FCBF00ADF159 /* redrawscreen.cpp in Sources */, + 558B99B91987FCBF00ADF159 /* listOps.cpp in Sources */, + 55A742AE198DE07900F1A8A5 /* check_structs.cpp in Sources */, + 556E055D198584DE00FC4362 /* arrow_up_active.map in Sources */, + 558B9A0C1987FCBF00ADF159 /* refresh.cpp in Sources */, + 558B99661987FCBF00ADF159 /* ctlArrows.cpp in Sources */, + 558B99A31987FCBF00ADF159 /* hfsHier.cpp in Sources */, + 558B9A321987FCBF00ADF159 /* teDisplay.cpp in Sources */, + 558B99821987FCBF00ADF159 /* dump.cpp in Sources */, + 558B9A371987FCBF00ADF159 /* teInsert.cpp in Sources */, + 556E0558198584DE00FC4362 /* arrow_down_inactive.map in Sources */, + 558B9A081987FCBF00ADF159 /* qText.cpp in Sources */, + 558B9A381987FCBF00ADF159 /* teMisc.cpp in Sources */, + 553B0B6C19888B690041B809 /* hfsHelper.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 556E042019856E5700FC4362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 556E043119856E5700FC4362 /* CocoaExecutorTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 556E05631985854000FC4362 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 556E05711985855100FC4362 /* map_to_c.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 557F30A019897619009873EB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 557F30C2198976A9009873EB /* mkseedtables.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 557F30AB19897653009873EB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 557F30C4198976DC009873EB /* mkultable.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 557F30B61989768A009873EB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 557F30C61989771D009873EB /* mksspairtable.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 558B9A531988049300ADF159 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 559AF49F198ABFE600DE8472 /* Syn68k.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 559AF4A9198AE03000DE8472 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 559AF4B5198AE0F400DE8472 /* mkexpandtables.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 55D30F44198C1B08009BBB62 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 55D30F55198C1E3C009BBB62 /* parsenum.cpp in Sources */, + 55D30F53198C1B65009BBB62 /* mkvol.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 5500AB2B19858A4F00FF62C0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 556E05661985854000FC4362 /* map_to_c */; + targetProxy = 5500AB2A19858A4F00FF62C0 /* PBXContainerItemProxy */; + }; + 5560630C198867C300D6F0B2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 556062F11988679400D6F0B2 /* rsys */; + targetProxy = 5560630B198867C300D6F0B2 /* PBXContainerItemProxy */; + }; + 5560630E198867C500D6F0B2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 558B9A561988049300ADF159 /* syn68k */; + targetProxy = 5560630D198867C500D6F0B2 /* PBXContainerItemProxy */; + }; + 556E042919856E5700FC4362 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 556E040219856E5700FC4362 /* CocoaExecutor */; + targetProxy = 556E042819856E5700FC4362 /* PBXContainerItemProxy */; + }; + 557F30C9198977AB009873EB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 557F30A319897619009873EB /* mkseedtables */; + targetProxy = 557F30C8198977AB009873EB /* PBXContainerItemProxy */; + }; + 557F30CB198977AB009873EB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 557F30AE19897653009873EB /* mkultable */; + targetProxy = 557F30CA198977AB009873EB /* PBXContainerItemProxy */; + }; + 557F30CD198977AB009873EB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 557F30B91989768A009873EB /* mksspairtable */; + targetProxy = 557F30CC198977AB009873EB /* PBXContainerItemProxy */; + }; + 559AF4A4198AC99B00DE8472 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 556E040219856E5700FC4362 /* CocoaExecutor */; + targetProxy = 559AF4A3198AC99B00DE8472 /* PBXContainerItemProxy */; + }; + 559AF4A7198AD3B400DE8472 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 556062F11988679400D6F0B2 /* rsys */; + targetProxy = 559AF4A6198AD3B400DE8472 /* PBXContainerItemProxy */; + }; + 559AF4B7198AE20300DE8472 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 559AF4AC198AE03000DE8472 /* mkexpandtables */; + targetProxy = 559AF4B6198AE20300DE8472 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 5500AB3C1985A66A00FF62C0 /* Executor.xib */ = { + isa = PBXVariantGroup; + children = ( + 55A742B1198DE36600F1A8A5 /* Base */, + 55A742B2198DE37D00F1A8A5 /* en */, + ); + name = Executor.xib; + sourceTree = ""; + }; + 556E040F19856E5700FC4362 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 556E041019856E5700FC4362 /* en */, + ); + name = InfoPlist.strings; + path = "NeXT Classes"; + sourceTree = ""; + }; + 556E041519856E5700FC4362 /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + 556E041619856E5700FC4362 /* en */, + ); + name = Credits.rtf; + path = "NeXT Classes"; + sourceTree = ""; + }; + 556E042D19856E5700FC4362 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 556E042E19856E5700FC4362 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 55D30F5B198C38DB009BBB62 /* info.xib */ = { + isa = PBXVariantGroup; + children = ( + 55D30F5A198C38DB009BBB62 /* Base */, + 55A742B4198DE48E00F1A8A5 /* en */, + ); + name = info.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 556063061988679500D6F0B2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_VERSION = A; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = rsys/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 556063071988679500D6F0B2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = rsys/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 556E043219856E5700FC4362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = NO; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_MACRO = "DEBUG=1"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "MACOSX_=1", + BOOLEAN_T_TYPEDEFED, + "$(inherited)", + "$(DEBUG_MACRO)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + WARNING_CFLAGS = "-Wno-deprecated-register"; + }; + name = Debug; + }; + 556E043319856E5700FC4362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = NO; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_MACRO = NDEBUG; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "MACOSX_=1", + BOOLEAN_T_TYPEDEFED, + "$(inherited)", + "$(DEBUG_MACRO)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LLVM_LTO = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + SDKROOT = macosx; + WARNING_CFLAGS = "-Wno-deprecated-register"; + }; + name = Release; + }; + 556E043519856E5700FC4362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_OBJC_ARC = NO; + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CocoaExecutor/CocoaExecutor-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + Sound_MACOSX_, + _DARWIN_NO_64_BIT_INODE, + "$(inherited)", + ); + HEADER_SEARCH_PATHS = ( + syn68k, + "$(inherited)", + ); + INFOPLIST_FILE = "CocoaExecutor/CocoaExecutor-Info.plist"; + PRODUCT_NAME = NeoClassic; + USER_HEADER_SEARCH_PATHS = CocoaExecutor; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 556E043619856E5700FC4362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_OBJC_ARC = NO; + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CocoaExecutor/CocoaExecutor-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + Sound_MACOSX_, + _DARWIN_NO_64_BIT_INODE, + "$(inherited)", + ); + HEADER_SEARCH_PATHS = ( + syn68k, + "$(inherited)", + ); + INFOPLIST_FILE = "CocoaExecutor/CocoaExecutor-Info.plist"; + LLVM_LTO = NO; + PRODUCT_NAME = NeoClassic; + USER_HEADER_SEARCH_PATHS = CocoaExecutor; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 556E043819856E5700FC4362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/CocoaExecutor.app/Contents/MacOS/CocoaExecutor"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CocoaExecutor/CocoaExecutor-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + HEADER_SEARCH_PATHS = ( + syn68k, + "$(inherited)", + ); + INFOPLIST_FILE = "CocoaExecutorTests/CocoaExecutorTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + USER_HEADER_SEARCH_PATHS = CocoaExecutor; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 556E043919856E5700FC4362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/CocoaExecutor.app/Contents/MacOS/CocoaExecutor"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CocoaExecutor/CocoaExecutor-Prefix.pch"; + HEADER_SEARCH_PATHS = ( + syn68k, + "$(inherited)", + ); + INFOPLIST_FILE = "CocoaExecutorTests/CocoaExecutorTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + USER_HEADER_SEARCH_PATHS = CocoaExecutor; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; + 556E056E1985854000FC4362 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + HEADER_SEARCH_PATHS = ( + syn68k, + "$(inherited)", + ); + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + USER_HEADER_SEARCH_PATHS = CocoaExecutor; + }; + name = Debug; + }; + 556E056F1985854000FC4362 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + HEADER_SEARCH_PATHS = ( + syn68k, + "$(inherited)", + ); + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + USER_HEADER_SEARCH_PATHS = CocoaExecutor; + }; + name = Release; + }; + 557F30A919897619009873EB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 557F30AA19897619009873EB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 557F30B419897653009873EB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 557F30B519897653009873EB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 557F30BF1989768A009873EB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 557F30C01989768A009873EB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 558B9A591988049400ADF159 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + EXECUTABLE_PREFIX = lib; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 558B9A5A1988049400ADF159 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + EXECUTABLE_PREFIX = lib; + LLVM_LTO = NO; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 559AF4B2198AE03000DE8472 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + HEADER_SEARCH_PATHS = ( + syn68k, + "$(inherited)", + ); + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 559AF4B3198AE03000DE8472 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + HEADER_SEARCH_PATHS = ( + syn68k, + "$(inherited)", + ); + MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 55D30F4D198C1B08009BBB62 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + MKVOL_PROGRAM, + "$(inherited)", + ); + HEADER_SEARCH_PATHS = ( + syn68k, + "$(inherited)", + ); + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 55D30F4E198C1B08009BBB62 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + MKVOL_PROGRAM, + "$(inherited)", + ); + HEADER_SEARCH_PATHS = ( + syn68k, + "$(inherited)", + ); + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 556063051988679500D6F0B2 /* Build configuration list for PBXNativeTarget "rsys" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 556063061988679500D6F0B2 /* Debug */, + 556063071988679500D6F0B2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 556E03FE19856E5700FC4362 /* Build configuration list for PBXProject "CocoaExecutor" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 556E043219856E5700FC4362 /* Debug */, + 556E043319856E5700FC4362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 556E043419856E5700FC4362 /* Build configuration list for PBXNativeTarget "CocoaExecutor" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 556E043519856E5700FC4362 /* Debug */, + 556E043619856E5700FC4362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 556E043719856E5700FC4362 /* Build configuration list for PBXNativeTarget "CocoaExecutorTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 556E043819856E5700FC4362 /* Debug */, + 556E043919856E5700FC4362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 556E056D1985854000FC4362 /* Build configuration list for PBXNativeTarget "map_to_c" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 556E056E1985854000FC4362 /* Debug */, + 556E056F1985854000FC4362 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 557F30A819897619009873EB /* Build configuration list for PBXNativeTarget "mkseedtables" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 557F30A919897619009873EB /* Debug */, + 557F30AA19897619009873EB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 557F30B319897653009873EB /* Build configuration list for PBXNativeTarget "mkultable" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 557F30B419897653009873EB /* Debug */, + 557F30B519897653009873EB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 557F30BE1989768A009873EB /* Build configuration list for PBXNativeTarget "mksspairtable" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 557F30BF1989768A009873EB /* Debug */, + 557F30C01989768A009873EB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 558B9A581988049400ADF159 /* Build configuration list for PBXNativeTarget "syn68k" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 558B9A591988049400ADF159 /* Debug */, + 558B9A5A1988049400ADF159 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 559AF4B1198AE03000DE8472 /* Build configuration list for PBXNativeTarget "mkexpandtables" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 559AF4B2198AE03000DE8472 /* Debug */, + 559AF4B3198AE03000DE8472 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 55D30F4C198C1B08009BBB62 /* Build configuration list for PBXNativeTarget "mkvol" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 55D30F4D198C1B08009BBB62 /* Debug */, + 55D30F4E198C1B08009BBB62 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 556E03FB19856E5700FC4362 /* Project object */; +} diff --git a/OSX-only/CocoaExecutor/CocoaExecutor-Info.plist b/OSX-only/CocoaExecutor/CocoaExecutor-Info.plist new file mode 100644 index 00000000..132f1d06 --- /dev/null +++ b/OSX-only/CocoaExecutor/CocoaExecutor-Info.plist @@ -0,0 +1,34 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.github.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 2.2 + CFBundleSignature + ???? + CFBundleVersion + 2.2 + LSApplicationCategoryType + public.app-category.productivity + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSHumanReadableCopyright + Copyright © 2014 C.W. Betts. All rights reserved. + NSMainNibFile + Executor + NSPrincipalClass + NSApplication + + diff --git a/OSX-only/CocoaExecutor/CocoaExecutor-Prefix.pch b/OSX-only/CocoaExecutor/CocoaExecutor-Prefix.pch new file mode 100644 index 00000000..f6b18d8c --- /dev/null +++ b/OSX-only/CocoaExecutor/CocoaExecutor-Prefix.pch @@ -0,0 +1,11 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#include + +#ifdef __OBJC__ + #import +#endif diff --git a/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Contents.json b/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..b1446b6c --- /dev/null +++ b/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,63 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "Executor 16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "Executor copy cop1y copy-1.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "Executor copy cop1y copy.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "Executor 64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "Executor 128.png", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor 128.png b/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor 128.png new file mode 100644 index 0000000000000000000000000000000000000000..03fe7e3a8c482ffb917a829781128e883bcd6d40 GIT binary patch literal 3967 zcmX9=XE+>O(>{ynExHIXReuhX6|#Yi8a*Mpdh_N3IL$c(o{9NM&ykV6JDQP@^*vQK;o@w z;RgU2?TtY|Rt^&Yqz0}kDu#wGUjANwE?(YHEfp20x38D8tA`T+L9-ZRgo*JcgB))0 zP+2DinWE!mL{AJgQjSB?C35qzlTd5Nu;~EUyYG zqDVQt0X1=*BfH-P2Lzmi!C(*Xw-dDiNYFSLF=*GzZWq2AeMPmUocRQTd<|*$Pkf|9 zjHCmKAqmPwKv5ln#AI+AgFFIYJLq7)0t^L!El>FGae%~}WQIb3RSG*jBrg#_X`NzJ zfr~7t73R8{YnQ;~DOuigT%2<)m0|iEG+jE{7QSRM(y+EcjD$m0S?XRRb30G_IH3YrYmDfAKppqhu`t5IS(>|o+=C%oHn zYrcc*+*b0nGG}+EGPN?PBl51V?SqO}%DhoSHLQHLLO&E)#oOU7QOVwvf}N(HDCNAV z{@M}ecJQ{KNC=erh-vNEXJa7tZ_GIoh#4~@PuM#&325Rtq5Uy*@cTN65}G1LZ%m-3 znymYBzIf8nPt-pr%Ju=#SLabJ8X_sETDaT~@&=Wr5~(|{)!&nSck~y@LNnxLfA_7w zBNs23zy7`4g=!WpuhJ{rzQIH!*6krI*wdx_@ew~svcurV`xWHnJ$GszSKv3t9yyGB z3?!gIskM_x5(Fwk?bwtw&2`Q7r!`BUcR9sx&yq-y;J=1<^4w1@(W&SDeEYPU$zD_> z+FX;LW0D35+2WdaIFkEk9o=h* zq*M5z5BnllF{@pxVyi5x?E6-v7<)yZ4=2XIc#Q_!w3*ka*TmNdoiap~ObfD%7E1C> zZcCsol`HeHM%D1>5?b-+S<*uh3|cycmG4u>@3=6!;9RRW{6F7bNM+Mc|86!mxT&#` zzJY%jNKO$&AJH3w;APHcB4R=?2QpP>=oT@L$1(Ss2uq12?{Ye1PYDv{`BCfs#2e*9GyjyHk`$Jx57&bAKF~c@eY0 z94A*+nlG&)rY&YxXLOL_tU$Dq;d7GXuTQehTbzCn_GXc8@4>GJEJfnFO(ITD+{@C^ z)6B~?%i-l3+pUsSJH?oyR<&k}GZdv#uQtyU9t{L~_!ef}c*c04n6#KdPfq5jO0dkm zkR`uaHSo)`;@yngwx`HkU9aNB;MVoOcV7x!m|S@NEk4p9Hz%wk=OmmXA7+AmmGJR` zu?qFh{ei1kcPXkA+NIj1FTYM~8if^1sQ;r*74O>fWQB9Zv&XZifSZt;om)q5OK&&J zNUy2rL6NMktZwhnx1sk#lbI6Paw1cr>)GqsQ`t+6ww6Jb{MZugCnv4iRm&oaU2My< zNK0vpLUU6~>pJyHOeNQ3b7gb!?cyf=Wc~8oNkmu8A8bFiw2`@HZJKbd3hRk|X@{_9 zL^OV_>e@|iO@8_L)QD ztzc;fA9TB7jI+lz5R8Z>zlejFxLBQ6gM#Vug4rxR3w^Dt+WtpA*2^JdN0{uo?9QE% zx$0fXUDw^{`FG#M-#y5+5cB)q)u-|kzBZ~r_AXV}eW@bMK*a!sXjtbEau7;1tDLH7 zEDS8e+3hjPAItl`TajOZNiB*lTG)J(YH#do95m?i%C(7HQVHj{a=Z$;8U@8jE(iiY z7Nvx;!aF+&dBOfAK|yBD>9}@gM=3t9Nr_$w{i^cST1O?jOW(h5E7@`D8N-Rgu9T66 zVH=a*iR^yc#dU>|^F&5Rnnfujc*mIE85K#F2ppYP@mo^;tD2^|n2iuIkggWcmf({w z6Lf>kN_`gptk5IqZ1HWv9AmEKp>tPSkgrPenMd2w`OZP~FU&8pl~BeEp+0Nx;QZmv z!^mQWQb8JinKVV+82v{n|0z-Pl`zC}?b8NwC6ESpvUVcw3yn&S#!Ra`;bYU^*W}X+ zN%}XjMIxBm-Ihj_Gh@`}~KFVe6ddXPC7UH*a zz+i<_WbNhGXK{@}Y^g;3?sab~ZdnMBVwH!n4()ua z8<=}5m9zKmYKNwiW;qF47^Pz-z-s=xwZcuh7UmN?N4i3P>tWPm!V1`@H&{N;34`(- zv-GO4R_+izchu94fma<35ch2|Q_{7_m)rAGJJtr~LKaI6c7LNVEb{cRZ>s3#7}M#) zr+Mdt)>xvw2EJs@r_`60cQ-kXIFC7R{$3QwwW3TbOaGlt`HW&_ww_|?asAHGvD%za z`VjA2a|BkUso)FjQ;Sn^|L~Bkg2@MyLzBNIlDlII4R%u}&qjAyLR*f-|DBk#YQbH| z_qWZNLQM50oF|;lw9e{q3RSUXn!dZsiq$jtYdN}M(D|h z+ZvR;_u4Kodw~KJk`$)@9UmjDtid&a$ksW@r|H*&9c5aQhUd ztE%aVd(&=6YeT3rZj&WfYIxzWHTVz1)#OC3wA@1LL5LUbEAD8CVIjT-U1Z$8|uJuvTJbY25T7#T5gnRtYzQn`iBL=Q$$L~Z9j zl9!hLrQmz9d0wnC;yA*c%Xs>x;=IXhg z&K|b5{va`tr-zTvb~*y*16lV9mZ%I?UqHiouUt+)9vOcxK1*g!PQD_*&p0@D5EGcY z-Z!BRnnrp6gm7K&p%DO_UR~oR0MCU1*s=vcCIbLQuOyqV>HrXwX{joi1kL`7u}bFm~jJ4xuw^I8X*qdW9PPL91h%>M69~AuG?FqV)A( z$$L|E=(SI24##bm^Io<5apz&`5U3-AWMTB^o3noWjBp1!Kue7H?KK$Tx(r3Qh<9;( znTm%$o15LP$$;&^e8Weug%{)NM#lx*jJKc!fE_9<*{IpV{Sn>kaMGtduz3_xNea(W zwVKsv=GH=In$dwZ9TMtS zbfhPBQ@EEcW6E2r$Bqg|3Q3Od-n#{4zzZnB>Ibo{4GBaQ#(2P)l)cc3`9=7Fs*$~dXcS_d-t;rl zEIQuZt=vXWvgO?bql!X4K3EoDZH}y$Z{G>n2ZFw)?k){?2v1uPwWUs0`QSBx5{L)PEW(s_ z`0N&EYB_rsO+0t9hefI0mj6k&>qrW4mZVNV;K>=79?j4Tn4*!u7Ce((Cl4Wj=EI#kL&slJ|}?R zB!bd1S#OE+eO;Ockc<{YKQUX~LNa(w6 z2;KD)`)_D^G9#e;UtDg7+o^$r0P7J?NuR|xUT|m(9vyqd!+FIcrt(*Z_8pzV*9wE(W_2sdU?lo zPa4NWd9C&Kgq-+~h9a51GUBwZa45Pn4`e7l6016b3=7V+GS9UAzqF5iKD&G9ZA{yo zy$8HV)*TyBXiwkq4Wa8V3jl9E=aKm~C%N-oskcoGUi5FV0pW+2$Db6s6!(F*^Cbni XU1VZv85Bft4Tx07wm;mUmPX*B8g%%xo{TU6vwc>AklFq%OTkl_mFQv@x1^BM1TV}0C2duqR=S6Xn?LjUp6xrb&~O43j*Nv zEr418u3H3zGns$s|L;SQD-ufpfWpxLJ03rmi*g~#S@{x?OrJ!Vo{}kJ7$ajbnjp%m zGEV!%=70KpVow?KvV}a4moSaFCQKV= zXBIPnpP$8-NG!rR+)R#`$7JVZi#Wn10DSspSrkx`)s~4C+0n+?(b2-z5-tDd^^cpM zz5W?wz5V3zGUCskL5!X++LzcbT23thtSPiMTfS&1I{|204}j|3FPi>70OSh+Xzlyz zdl<5LNtZ}OE>>3g`T3RtKG#xK(9i3CI(+v0d-&=+OWAp!Ysd8Ar*foO5~i%E+?=c& zshF87;&Ay)i~kOm zCIB-Z!^JGdti+UJsxgN!t(Y#%b<8kk67vyD#cE*9urAm@Y#cTXn~yERR$}Y1E!Yd# zo7hq8Ya9;8z!~A3Z~?e@Tn26#t`xT$*Ni)h>&K1Yrto;Y8r}@=h7ZGY@Dh9xekcA2 z{tSKqKZ<`tAQQ9+wgf*y0zpVvOQ<9qCY&Y=5XJ~ILHOG0j2XwBQ%7jM`P2tv~{#P+6CGu9Y;5!2hua>CG_v;z4S?CC1rc%807-x z8s$^ULkxsr$OvR)G0GUn7`GVjR5Vq*RQM{JRGL%DRgX~5SKp(4L49HleU9rK?wsN|$L8GCfHh1tA~lw29MI^|n9|hJ z^w$(=?$kW5IibbS^3=-Es?a*EHLgw5cGnhYS7@Kne#%s4dNH$@Rm?8tq>hG8fR0pW zzfP~tjINRHeBHIW&AJctNO~;2RJ{tlPQ6KeZT(RF<@$~KcMXUJEQ54|9R}S7(}qTd zv4$HA+YFx=sTu_uEj4O1x^GN1_Ap*-Tx)#81ZToB$u!w*a?KPrbudjgtugI0gUuYx z1ZKO<`pvQC&gMe%TJu2*iiMX&o<*a@uqDGX#B!}=o8@yWeX9hktybMuAFUm%v#jf^ z@7XBX1lg>$>9G0T*3_13TVs2}j%w#;x5}>F?uEUXJ>Pzh{cQ)DL#V?BhfaqNj!uqZ z$0o;dCw-@6r(I5iEIKQkRm!^LjCJ;QUgdn!`K^nii^S!a%Wtk0u9>cfU7yS~n#-SC zH+RHM*Nx-0-)+d9>7MMq&wa>4$AjZh>+#4_&y(j_?>XjW;+5fb#Ot}YwYS*2#e16V z!d}5X>x20C`xN{1`YQR(_pSDQ=%?$K=GW*q>F?mb%>QfvHXt})YrtTjW*|4PA#gIt zDQHDdS1=_wD!4lMQHW`XIHV&K4h;(37J7f4!93x-wlEMD7`83!LAX));_x3Ma1r4V zH4%>^Z6cRPc1O{olA;bry^i*dE{nc5-*~=serJq)Okzw!%yg_zYWi`#ol25V;v^kU#wN!mA5MPH z3FFjqrcwe^cBM>m+1wr6XFN|{1#g`1#xLiOrMjh-r#?w@OWT$Wgg6&&5F%x&L(6hXP*!%2{VOVIa)adIsGCtQITk9vCHD^izmgw;`&@D zcVTY3gpU49^+=7S>!rha?s+wNZ}MaEj~6Hw2n%|am@e70WNfM5(r=exmT{MLF4tMU zX8G_6uNC`OLMu~NcCOM}Rk&(&wg2ivYe;J{*Zj2BdTsgISLt?eJQu}$~QLORDCnMIdyYynPb_W zEx0YhEw{FMY&}%2SiZD;WLxOA)(U1tamB0cN!u@1+E?z~LE0hRF;o>&)xJ}I=a!xC ztJAA*)_B)6@6y<{Y1i~_-tK`to_m`1YVIxB`);3L-|hYW`&(-bYby`n4&)tpTo+T< z{VnU;hI;k-lKKw^g$IWYMIP#EaB65ctZ}%k5pI+=jvq-pa_u{x@7kLzn)Wv{noEv? zqtc^Kzfb=D*0JDYoyS?nn|?6(VOI;SrMMMpUD7()mfkkh9^c-7BIrbChiga6kCs0k zJgIZC=9KcOveTr~g{NoFEIl)IR&;jaT-v#j&ZN$J=i|=b=!)p-y%2oi(nY_E=exbS z&s=i5bn>#xz3Ke>~2=f&N;yEFGz-^boBexUH6@}b7V+Mi8+ZXR+R zIyLMw-18{v(Y+Dw$g^K^e|bMz_?Y^*a!h-y;fd{&ljDBl*PbqTI{HlXY-Xb9SH)j< zJvV;-!*8Cy^-RW1j=m7TnEk!pMzeeF4y#%{fE_4&9T=brPtmcUL{gW zkn++wE3vZf<(n zY&Oqsv2Zy2>-6+AluD&G^ZDEri9}?*UW>=$(PF`1P#nk6Zar7Kuiql1wILG#cq% z3$QZH7^4Y*E%A6<#^bS)NV%&zXF&?;d#AYCGG6&Od5@bjzT4%kdUME z^K%`MnNLmK+;Aq&$pTz=yImm)2C>s%Fpx|pBk6Qn<0vKLLZOi82+-UiOh9ySVPow; z8J(LFk{dK|a=9F8+790exNso35P^l6!u5Kc(qQS)8KDMWoW)K!+YN_9LqsU#BB9LT zJ@xUz-@rrg4V?Bq`Yf8?Y&Q;xg&DlgOZUklgT6uVt?SQ$FK1%Ha-v&ggn|3ok^Y!&ukh{ jIB>lOnHD5ppy~P#?^{;|;9#6K00000NkvXXu0mjfw0LvM literal 0 HcmV?d00001 diff --git a/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor 64.png b/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor 64.png new file mode 100644 index 0000000000000000000000000000000000000000..4f4410d4e424992f0b0a1a1a5a55d527cbe491ef GIT binary patch literal 5469 zcmV-j6{6~iP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000VzNkl7(07RP_{GKt5DT|4!ZxTzsFZJG2lNde(XkpeAxYQ=&?iiB8D z6|q5L0UN~ftt%E!Z}C)iDX@5(qI82O0{S5;VW|;SDn#vs$__PjiYIE^OdC6%WZt43 z%bv_Q6Y7+P9;s?(&RoyE|9j5=oO|va!8A>tWcdeAxCo=8qbqJsOiTbA-@SYH*u{$% zxqJ8Sh8$c+M+ZYgL;U>n&u;^#UU=aJ&lVsXh9NI3EU=MX#57G778WoJLk480XGE8_ zAE~N(e0Fx0QmM3I0a#dAAeBl{sZ>6S#bRB+hpPb~10MmyhGEDpEiLTZw-2Asw;=&2 zm&;@_8Os8OAKX3xXjKk)@x>Qw+r)wM*=#mmDwXK!>LL^h(bCegApuxgTB2Aia_iPD zBuOHXNaTQ5fLzrAE?>Uv*f<`KqbLd&FJ7djr3Fcn>U^t;pdhTcwm(;U&+enOdOP3P z+nJ`>@SgRzX_}NuC6exI1 z5C{a2W!Z6nf*^4H`gPLjG}&x+O#rmDwV@~qyLRnj%a$#518@Sk5m4!Lns2}T7C{g= zbm$PlV9=ABh|Tb|bUIBwpC=xVuc=+7Qek3Zg3iuPwrtt*P<>EUl?xXx0I+-aZqMyJ z0U!uMbtdfSo2E%Nn=OQ}grloH=ub%a<=xC=^^f{pFWma`*0Cwr}6Q;`bYIhusot z|IcQ#oI7_8(=>VY)mNMA0$!z5Dv?U1_~Va1R^^OnG+G6q8KSBx=g*%9VDH|&>%#$d z3vdfdZZ6~X_npF;np+ko}_qC}U@K;JL2Q)noaARS+RkXCU z5Q#)Qt$l7_U|{_?z>Ng$I?DoHd+jxzfBt#b-|Ow|B^V4=0dNDfQ4(esNs{pS ze6DRDDF^iS_R`ziyCJw^U7~#x7go;`c&?pcHdux;BmN4Ke+*}1tnKKtx5hKGmQv}u#)O!TqH0|o~N85|s} zUSGO&slE~`%k15|*L5(0AaLQr1-}0JYmOW_QU&0VaX=%>ute8&a=DzRcAtFm2>|cD z`!0rIxUL0i-{bT72#3SW&COLg!OA7vGRLL^;8u_j1c9?>&ssZ5t4eowHvn(G`6jBW zx~>Ik-K@XApGYLa*w`4wVv%Gr$y;x|<%xrux*BxK#10=m%$_}aTvvkjwv&^S2!g=y z@Gz!nvTN5a*Y$(der9HdZ@&44&dyH4;V^|lfzLnxoRN`{74^ThfYKBWun5d60L#nE zsH$35A4sRu)oVpjh(@C;a{Y;k35JG-Xm4+4W@d&|D#g*GM?Duno8khESa-GMtED@9 z_%NwdicdfN)UgUYGBQFS5OAE?_V#u_vh#5Ieq#xKA#U&RUeuFp@|11R8{5s@4shydYWuDOQBG}FbwkfJi4x<>pJ;- z9>Xvw6be=SjT<-W^p#2lS(Y&jgCBnQp}MS%Mxz`&c(7{v(P)%pGFi7}_ek;pHrsU_Idybiz831~EdRSOk;F)KhsfH~t`l+cYP1p4^I2?6-SXmc( z-?nYrm91O1-tFw{{O9E4BwbxyNRmV*lcBG#k6X8HQ7)HJ6a_E(+1c5DEiW(s7r6Jx zGC^6EtBV%9Sc{kL?rt)f4CQheS(dBU*=$xT6bhPQ7!->|e*N`V0E)#TQ&Usb+~3*} zT1{^lh9=9hR=aA{G!386hoUI_{`>C$4g2es3y5xK`(#
DnJXB~iw#bR8)ew}i; zOdt@bUTc~*sA<|@ZBk`PKA*44HN5D7!9XDJOHWVFCF}i~rXh+Vu~@8{_FDaQI!sl& z6;}s<(?;D3su98nYnzu!+XnIsyGRx3DuzaK?WSgRg50{rj6J08m@FzEC7-rv7} ze}5+2&F3eiY!)eCI;fFKC{rfL2g_z!Sty#d$(40_Hm zbbT?Y9*^y_&w36KwhbFskc%@j?H*$|c|zR{$0l7pqm6+8G7L+!h(4 zD6UvNHd=KxS>Ac@udYw`?zu+Ex9tFkqDWg?+kF5snM@t~t|sMjnOH3LSmpGps&f1G zZO_lgVlnpZ+jk#;?(Xh2Z8=+cz~dz0aM(2ua1tvliU5&Fgh(X9($Z30QSxuM@)Je6 zy1Hm>ZLQ`9b&kBaxXASMwDql>UM`n&t0DNfNFxsN`Fy%4iunD0HgDcs1z<%KkR*wh zUU~`BG|A`lXRltpI`Mayc|}n)tJ-YeNfPbFNWb52<@vhL=hGWmKwDcI`}gnv%Us4{ z@4Tx07wm;mUmPX*B8g%%xo{TU6vwc>AklFq%OTkl_mFQv@x1^BM1TV}0C2duqR=S6Xn?LjUp6xrb&~O43j*Nv zEr418u3H3zGns$s|L;SQD-ufpfWpxLJ03rmi*g~#S@{x?OrJ!Vo{}kJ7$ajbnjp%m zGEV!%=70KpVow?KvV}a4moSaFCQKV= zXBIPnpP$8-NG!rR+)R#`$7JVZi#Wn10DSspSrkx`)s~4C+0n+?(b2-z5-tDd^^cpM zz5W?wz5V3zGUCskL5!X++LzcbT23thtSPiMTfS&1I{|204}j|3FPi>70OSh+Xzlyz zdl<5LNtZ}OE>>3g`T3RtKG#xK(9i3CI(+v0d-&=+OWAp!Ysd8Ar*foO5~i%E+?=c& zshF87;&Ay)i~kOm zCIB-Z!^JGdti+UJsxgN!t(Y#%b<8kk67vyD#cE*9urAm@Y#cTXn~yERR$}Y1E!Yd# zo7hq8Ya9;8z!~A3Z~?e@Tn26#t`xT$*Ni)h>&K1Yrto;Y8r}@=h7ZGY@Dh9xekcA2 z{tSKqKZ<`tAQQ9+wgf*y0zpVvOQ<9qCY&Y=5XJ~ILHOG0j2XwBQ%7jM`P2tv~{#P+6CGu9Y;5!2hua>CG_v;z4S?CC1rc%807-x z8s$^ULkxsr$OvR)G0GUn7`GVjR5Vq*RQM{JRGL%DRgX~5SKp(4L49HleU9rK?wsN|$L8GCfHh1tA~lw29MI^|n9|hJ z^w$(=?$kW5IibbS^3=-Es?a*EHLgw5cGnhYS7@Kne#%s4dNH$@Rm?8tq>hG8fR0pW zzfP~tjINRHeBHIW&AJctNO~;2RJ{tlPQ6KeZT(RF<@$~KcMXUJEQ54|9R}S7(}qTd zv4$HA+YFx=sTu_uEj4O1x^GN1_Ap*-Tx)#81ZToB$u!w*a?KPrbudjgtugI0gUuYx z1ZKO<`pvQC&gMe%TJu2*iiMX&o<*a@uqDGX#B!}=o8@yWeX9hktybMuAFUm%v#jf^ z@7XBX1lg>$>9G0T*3_13TVs2}j%w#;x5}>F?uEUXJ>Pzh{cQ)DL#V?BhfaqNj!uqZ z$0o;dCw-@6r(I5iEIKQkRm!^LjCJ;QUgdn!`K^nii^S!a%Wtk0u9>cfU7yS~n#-SC zH+RHM*Nx-0-)+d9>7MMq&wa>4$AjZh>+#4_&y(j_?>XjW;+5fb#Ot}YwYS*2#e16V z!d}5X>x20C`xN{1`YQR(_pSDQ=%?$K=GW*q>F?mb%>QfvHXt})YrtTjW*|4PA#gIt zDQHDdS1=_wD!4lMQHW`XIHV&K4h;(37J7f4!93x-wlEMD7`83!LAX));_x3Ma1r4V zH4%>^Z6cRPc1O{olA;bry^i*dE{nc5-*~=serJq)Okzw!%yg_zYWi`#ol25V;v^kU#wN!mA5MPH z3FFjqrcwe^cBM>m+1wr6XFN|{1#g`1#xLiOrMjh-r#?w@OWT$Wgg6&&5F%x&L(6hXP*!%2{VOVIa)adIsGCtQITk9vCHD^izmgw;`&@D zcVTY3gpU49^+=7S>!rha?s+wNZ}MaEj~6Hw2n%|am@e70WNfM5(r=exmT{MLF4tMU zX8G_6uNC`OLMu~NcCOM}Rk&(&wg2ivYe;J{*Zj2BdTsgISLt?eJQu}$~QLORDCnMIdyYynPb_W zEx0YhEw{FMY&}%2SiZD;WLxOA)(U1tamB0cN!u@1+E?z~LE0hRF;o>&)xJ}I=a!xC ztJAA*)_B)6@6y<{Y1i~_-tK`to_m`1YVIxB`);3L-|hYW`&(-bYby`n4&)tpTo+T< z{VnU;hI;k-lKKw^g$IWYMIP#EaB65ctZ}%k5pI+=jvq-pa_u{x@7kLzn)Wv{noEv? zqtc^Kzfb=D*0JDYoyS?nn|?6(VOI;SrMMMpUD7()mfkkh9^c-7BIrbChiga6kCs0k zJgIZC=9KcOveTr~g{NoFEIl)IR&;jaT-v#j&ZN$J=i|=b=!)p-y%2oi(nY_E=exbS z&s=i5bn>#xz3Ke>~2=f&N;yEFGz-^boBexUH6@}b7V+Mi8+ZXR+R zIyLMw-18{v(Y+Dw$g^K^e|bMz_?Y^*a!h-y;fd{&ljDBl*PbqTI{HlXY-Xb9SH)j< zJvV;-!*8Cy^-RW1j=m7TnEk!1O!4d-E1I0I4h|z$=yo`C6OlJE19OwS}n`GKWX?x)Q?(g2;d7pF7 zJwLNAkm%^>Nao-F^C>SYfgm1?9E;Z0)}Ok&yPIZaW+t>uvG*^+d}(QEMN3OdZ&z2> z&w0LyNP))2#&a)Tyg0vU(QWD`8dkOr?%F3+2 zzuy|ZX=v~5>%AacSHMo3I8pQH(W9XiD^?^cDk^4|E?t^L7z5^&m6euECT)Ix-i0Fs zB^aMReX{B4>1cnU0vI5^zCAQFlof7ze0)5+YuB#2>({T3cpUV#N~3@8-o3SZ_Uy?W zI&>&8J3H$_(O#Z$Ay@!IlwqH-Wy=<;uC6XnF0KR~di(aR$tZjN{CTdguP^cN;lp9! ze62C&zFWV3y$uf!r#^rFY>HD(L&ha+*|KH!`0-=gw{M^A+_}?afx!?ZmM>p!;9t9T z&DN}0<9m1vIv{vZyzJGhSBCQPZfhK(a}-czkk0SJ$e*{7v+d+kbmIGZQHiF2VTB>=^-VQ$OMXJPuvPL z|M201TYB^6P1~?xgNNYa#fv6)dVGWBaXQ}FCx@OqdEy=;3>X)Oq6$D500LrOQ&Z!X zFvI-t;ls9M$&%<~1pGKHdw6cgjvej+a%tg-S)>5W!w5`KfY{%-al@3PHZn5eF-3u3 zQCu+e0T6ii?p^mlRaKQM6uvPRC;;I?MkE>ucjn9)tE;Osk|)G<>(;Fvnsho{Ku3%N zA8?NyJ7(bAzJ1%hCKDqa3KW1SC=uSV9wrDrefqQ$PEAdDSUCT{$B!S~6M+_mp~E}y z!3&I_lq!tV@hDJ$jUYHMb0iT5;3(d@b<4`j%l&u~suMZqJ5Lt(%ckcX7U9nZGR{8OU2g($Kzf}P1 z>g((M{C9SCx)m@Zo~mljys4?lnG^RA`}+E??DFNycKrBp+r4{tf!u|PEK(pKFr&cA zl`HMYkt0!P;Kn!Aa-*=|o!;JF$J@Mlv&Ww5iQs$p?s+Jvs8Rf5M;u-S3cwh|Fi0fe z-Me>&`>{TJ3rCOyrC2?C_RQUW@ZdqmS+{Oo=6clYj0wMy5>4OIktgWrh z<32bzXbkE&B^kG)92XLGf)dN!p?dG-noUgS^%_A_P)`w&ZwCsy0D*+Cy8Cp1sDMnf>l_3;-WR?1a0gkc}rd5toS?^p;hH~!r>^N;wq zPVG%;#GBik*H>Xgf)y$5mQg*67l!`7V9`l+jh2O0| zqf0@i*8$uv!mOUm1V@aaz3}-T&4CAelq)%{@pyCx{Q*F>xp^IC Rnv(zk002ovPDHLkV1mHOV-^4a literal 0 HcmV?d00001 diff --git a/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor copy cop1y copy.png b/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor copy cop1y copy.png new file mode 100644 index 0000000000000000000000000000000000000000..15f111e7d2c49714c90a9089c2f7dd2eee09e2a0 GIT binary patch literal 4375 zcmV+y5$NuTP)4Tx07wm;mUmPX*B8g%%xo{TU6vwc>AklFq%OTkl_mFQv@x1^BM1TV}0C2duqR=S6Xn?LjUp6xrb&~O43j*Nv zEr418u3H3zGns$s|L;SQD-ufpfWpxLJ03rmi*g~#S@{x?OrJ!Vo{}kJ7$ajbnjp%m zGEV!%=70KpVow?KvV}a4moSaFCQKV= zXBIPnpP$8-NG!rR+)R#`$7JVZi#Wn10DSspSrkx`)s~4C+0n+?(b2-z5-tDd^^cpM zz5W?wz5V3zGUCskL5!X++LzcbT23thtSPiMTfS&1I{|204}j|3FPi>70OSh+Xzlyz zdl<5LNtZ}OE>>3g`T3RtKG#xK(9i3CI(+v0d-&=+OWAp!Ysd8Ar*foO5~i%E+?=c& zshF87;&Ay)i~kOm zCIB-Z!^JGdti+UJsxgN!t(Y#%b<8kk67vyD#cE*9urAm@Y#cTXn~yERR$}Y1E!Yd# zo7hq8Ya9;8z!~A3Z~?e@Tn26#t`xT$*Ni)h>&K1Yrto;Y8r}@=h7ZGY@Dh9xekcA2 z{tSKqKZ<`tAQQ9+wgf*y0zpVvOQ<9qCY&Y=5XJ~ILHOG0j2XwBQ%7jM`P2tv~{#P+6CGu9Y;5!2hua>CG_v;z4S?CC1rc%807-x z8s$^ULkxsr$OvR)G0GUn7`GVjR5Vq*RQM{JRGL%DRgX~5SKp(4L49HleU9rK?wsN|$L8GCfHh1tA~lw29MI^|n9|hJ z^w$(=?$kW5IibbS^3=-Es?a*EHLgw5cGnhYS7@Kne#%s4dNH$@Rm?8tq>hG8fR0pW zzfP~tjINRHeBHIW&AJctNO~;2RJ{tlPQ6KeZT(RF<@$~KcMXUJEQ54|9R}S7(}qTd zv4$HA+YFx=sTu_uEj4O1x^GN1_Ap*-Tx)#81ZToB$u!w*a?KPrbudjgtugI0gUuYx z1ZKO<`pvQC&gMe%TJu2*iiMX&o<*a@uqDGX#B!}=o8@yWeX9hktybMuAFUm%v#jf^ z@7XBX1lg>$>9G0T*3_13TVs2}j%w#;x5}>F?uEUXJ>Pzh{cQ)DL#V?BhfaqNj!uqZ z$0o;dCw-@6r(I5iEIKQkRm!^LjCJ;QUgdn!`K^nii^S!a%Wtk0u9>cfU7yS~n#-SC zH+RHM*Nx-0-)+d9>7MMq&wa>4$AjZh>+#4_&y(j_?>XjW;+5fb#Ot}YwYS*2#e16V z!d}5X>x20C`xN{1`YQR(_pSDQ=%?$K=GW*q>F?mb%>QfvHXt})YrtTjW*|4PA#gIt zDQHDdS1=_wD!4lMQHW`XIHV&K4h;(37J7f4!93x-wlEMD7`83!LAX));_x3Ma1r4V zH4%>^Z6cRPc1O{olA;bry^i*dE{nc5-*~=serJq)Okzw!%yg_zYWi`#ol25V;v^kU#wN!mA5MPH z3FFjqrcwe^cBM>m+1wr6XFN|{1#g`1#xLiOrMjh-r#?w@OWT$Wgg6&&5F%x&L(6hXP*!%2{VOVIa)adIsGCtQITk9vCHD^izmgw;`&@D zcVTY3gpU49^+=7S>!rha?s+wNZ}MaEj~6Hw2n%|am@e70WNfM5(r=exmT{MLF4tMU zX8G_6uNC`OLMu~NcCOM}Rk&(&wg2ivYe;J{*Zj2BdTsgISLt?eJQu}$~QLORDCnMIdyYynPb_W zEx0YhEw{FMY&}%2SiZD;WLxOA)(U1tamB0cN!u@1+E?z~LE0hRF;o>&)xJ}I=a!xC ztJAA*)_B)6@6y<{Y1i~_-tK`to_m`1YVIxB`);3L-|hYW`&(-bYby`n4&)tpTo+T< z{VnU;hI;k-lKKw^g$IWYMIP#EaB65ctZ}%k5pI+=jvq-pa_u{x@7kLzn)Wv{noEv? zqtc^Kzfb=D*0JDYoyS?nn|?6(VOI;SrMMMpUD7()mfkkh9^c-7BIrbChiga6kCs0k zJgIZC=9KcOveTr~g{NoFEIl)IR&;jaT-v#j&ZN$J=i|=b=!)p-y%2oi(nY_E=exbS z&s=i5bn>#xz3Ke>~2=f&N;yEFGz-^boBexUH6@}b7V+Mi8+ZXR+R zIyLMw-18{v(Y+Dw$g^K^e|bMz_?Y^*a!h-y;fd{&ljDBl*PbqTI{HlXY-Xb9SH)j< zJvV;-!*8Cy^-RW1j=m7TnEk!1O!4d-E1I0I4h|z$=yo`C6OlJE19OwS}n`GKWX?x)Q?(g2;d7pF7 zJwLNAkm%^>Nao-F^C>SYfgm1?9E;Z0)}Ok&yPIZaW+t>uvG*^+d}(QEMN3OdZ&z2> z&w0LyNP))2#&a)Tyg0vU(QWD`8dkOr?%F3+2 zzuy|ZX=v~5>%AacSHMo3I8pQH(W9XiD^?^cDk^4|E?t^L7z5^&m6euECT)Ix-i0Fs zB^aMReX{B4>1cnU0vI5^zCAQFlof7ze0)5+YuB#2>({T3cpUV#N~3@8-o3SZ_Uy?W zI&>&8J3H$_(O#Z$Ay@!IlwqH-Wy=<;uC6XnF0KR~di(aR$tZjN{CTdguP^cN;lp9! ze62C&zFWV3y$uf!r#^rFY>HD(L&ha+*|KH!`0-=gw{M^A+_}?afx!?ZmM>p!;9t9T z&DN}0<9m1vIv{vZyzJGhSBCQPZfhK(a}-czkk0SJ$e*{7v+d+kbmIGZQHiF2VTB>=^-VQ$OMXJPuvPL z|M201TYB^6P1~?xgNNYa#fv6)dVGWBaXQ}FCx@OqdEy=;3>X)Oq6$D500LrOQ&Z!X zFvI-t;ls9M$&%<~1pGKHdw6cgjvej+a%tg-S)>5W!w5`KfY{%-al@3PHZn5eF-3u3 zQCu+e0T6ii?p^mlRaKQM6uvPRC;;I?MkE>ucjn9)tE;Osk|)G<>(;Fvnsho{Ku3%N zA8?NyJ7(bAzJ1%hCKDqa3KW1SC=uSV9wrDrefqQ$PEAdDSUCT{$B!S~6M+_mp~E}y z!3&I_lq!tV@hDJ$jUYHMb0iT5;3(d@b<4`j%l&u~suMZqJ5Lt(%ckcX7U9nZGR{8OU2g($Kzf}P1 z>g((M{C9SCx)m@Zo~mljys4?lnG^RA`}+E??DFNycKrBp+r4{tf!u|PEK(pKFr&cA zl`HMYkt0!P;Kn!Aa-*=|o!;JF$J@Mlv&Ww5iQs$p?s+Jvs8Rf5M;u-S3cwh|Fi0fe z-Me>&`>{TJ3rCOyrC2?C_RQUW@ZdqmS+{Oo=6clYj0wMy5>4OIktgWrh z<32bzXbkE&B^kG)92XLGf)dN!p?dG-noUgS^%_A_P)`w&ZwCsy0D*+Cy8Cp1sDMnf>l_3;-WR?1a0gkc}rd5toS?^p;hH~!r>^N;wq zPVG%;#GBik*H>Xgf)y$5mQg*67l!`7V9`l+jh2O0| zqf0@i*8$uv!mOUm1V@aaz3}-T&4CAelq)%{@pyCx{Q*F>xp^IC Rnv(zk002ovPDHLkV1mHOV-^4a literal 0 HcmV?d00001 diff --git a/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor copy cop1y.png b/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor copy cop1y.png new file mode 100644 index 0000000000000000000000000000000000000000..b3d37dc039bc90b42e17d927cdb5b92666ef7524 GIT binary patch literal 3529 zcmV;)4L0(LP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0008?NklTI^jjn`T$aNqzPAfock z`gLd4Qq18;vS zr4S+4Zl6B&Qhv$nLXTnhlZV)}i4&VtGR#fl&6|s`VfWru6)`(Eb)>z6|v4V&N5mU1G>9Kqi#1Sf9EJY~wctbY=o}2K{ z94((~7SdOpTQoYYwbEKk(VcqP$4fX_qVd=#tDUs5JVjC#`s9$VqiI*iiHFW`B8%#l zOkw`$x~?v(SP9Ext3x#EvBXHA)mqE4ET*p`;_il4VfWFNa-@H@ESfP-R^1+QA@3vE z=7<;yBx@#Fd3t%}P$u^LUst16X*|!f>EAkdIbm^OsAI)LZwLWP0IwY2xz^e)SXLrL z`QT6xTh*bL`XlSGOX#50$kbZj`iv<14>dHBzvZTub$f?o9=`8ox*-H2Mv;M9Yc1=# zmStJ?>$Yv?yvzw!cW3p)hl@E`uj?$zwF(jK!b+j}o`vRlMo%BxSoPA!TFNM>*_!MU zeAV+&eXpAwD+W%}Xe9i|;Z}BpViCw;8a)%Jmz*=oQ!f_2Cy>1QC8ODqp+tIX_n~F(p4KRj(qq0H~UQ!KT6r$jnVGNmQuF&B-gas<2f8tFQvHLBje< z3ScEA*|tg%z5xo(`9-M;rg|oN21<5Z3JMA~MJZ`kK`w4k?LeNbQbtKhft9{~d3m{B zxv^e;QM$gNrKP35fswwEkuFe$ZgFK^Nn(X=Ua>O75STeGsl~}fnFS@8`FRQ;a}$&D zOG|8(lt3220mPjpnP~`{@`|C}0(wv%B%^PrXP^%^8>rO=Bx)5AlvC2unFfg9=ba4!c;Jh2oIH^^EW9!_# zi)1(P-RyE{5K8%)UVhE~uggc<3dvBf|0|yA?){?e;Xb=>o`lV@c_n2}{!ZDxwc)9H zLy~UNTA7-e+K={V33kNZ-mai`*LC*xHIZwxIG)^@rEqmys=G%+o^uK3n%8!gEV%{= z)+{gdg!2|>Gp_x){+j1)Av@LFO#cmOhm{pxIJ&tzb-FR+dzdi&_ZDKk?x4PQt=;aW zySeppE^};Ieo@(x?bgq}(n9gT#Fpyl=@T>#ce8BDc#&lyz3a43yUHRP6^AS3#u<#o zS?&v}qD-e`$~MKtdiU)N3(scrlws;?s*=!+vbC*z`B|W`W=_GG4=UT`d_A5B{dhW4 zqeg!^!+qnT&hu6VuROHMXX}}kO3R)2dqdxYMNeRP>4Q%{>?ddlCCqr>b;)qWmj%(A z#b%qw%W``j4P%+~v$gJMS@}h76}PXKR&4TnExFBuRZeiPMlDwyHE-s!{gbUo}c>t}crsLs!yfnap$6(Hu<=^mKyl+!NO9zdXC*eT~`*`S5jH U68`GBZUW_KPgg&ebxsLQ0Cm=a_y7O^ literal 0 HcmV?d00001 diff --git a/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor.png b/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor.png new file mode 100644 index 0000000000000000000000000000000000000000..1d40a48efa04fca977979e2644738ae040ca1e52 GIT binary patch literal 972 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}t&H|6fVg?3oVGw3ym^DX&fq`*p zW=KRygs+cPa(=E}VoH8es$NBI0Z=sqgH44MkeQoWlBiITo0C^;Rbi_HR$&EXgM{^! z6u?SKvTcDSm?5wAYV@L$&-EhW9tqL4l=k8r3yNT~+mrH|C%GdPrYxaL#KH64DhI;*9 z@l<#37i|ys*?sdQY>v$X<|?a%esJZ}rxspe+-Z%8|= ztnk9o&E2WfjUnH|gz3Mx5bJdZ^|fp5b}!w{t(S9|W6Sc3%8qQee)g3XiU%gPR7X#r zpmDgHWmCqBEEDNnr+wO07TKscTq!rsU@XpZUr-fgIwe!KDK6H#Z)aF|Hk+pmQ(se+ zgl?3rZRN|)0*y6u3eJ2`*)Hen@kHpy)0rAI`qLTi8y9t+w=#I;p;bOx&$Lup?!@04 z`W`HL0?SJueEMNOK|?5E#sjZQhAX}-h~6wV+dN*D+w*7`%cP&Jbw|s}FLJB6eZ90| zlizE}Z62(0f_pWZIoEZUwwXrQuSIvgiJ)QDSp-SsWR15D8G5S`njxgN@xNAExKgS literal 0 HcmV?d00001 diff --git a/OSX-only/CocoaExecutor/NeXT Classes/Base.lproj/Executor.xib b/OSX-only/CocoaExecutor/NeXT Classes/Base.lproj/Executor.xib new file mode 100644 index 00000000..28443411 --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/Base.lproj/Executor.xib @@ -0,0 +1,848 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + Left to Right + + + + Right to Left + + + + + + + + Default + + + + Left to Right + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Use this space to describe the problem you are reporting. Please include a way to reproduce the problem (if possible) and other information you may think is relevant. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + Comments1 +2 +3 +4 +5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A123, A123, A123 +A123, A123, A123 +A123, A123, A123 +A123, A123, A123 +A123, A123, A123 +A123, A123, A123 +A123, A123, A123 +A123, A123, A123 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OSX-only/CocoaExecutor/NeXT Classes/Base.lproj/info.xib b/OSX-only/CocoaExecutor/NeXT Classes/Base.lproj/info.xib new file mode 100644 index 00000000..89c394b4 --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/Base.lproj/info.xib @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copyright 1991 - 1995 by ARDI + Suite 4-101 + 1650 University Blvd., NE + Albuquerque, NM 87102 + ++1 505 766 9115 Phone +1 505 247 1899 FAX + +ftp://ftp.ardi.com http://www.ardi.com + + + + + + + + + Limitations in this release: + No Sound + Limited System 7 + No AppleTalk + No Script Manager (i.e. No International Localization) + + + + + + + + + + + + + + + + + + + + + + + + + + Apple, Macintosh and AppleTalk are registered trademarks of Apple Computer, Inc. +ROMlib and Executor are registered trademarks of Abacus Research and Development, Inc. + + + + + + + + + + + + + + + + + + + + + + + + + Self Explanatory: bugs@ardi.com, suggestions@ardi.com, questions@ardi.com + +Send a request here to join an Executor users mailing list: executor-request@nacm.com + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OSX-only/CocoaExecutor/NeXT Classes/Executor.tiff b/OSX-only/CocoaExecutor/NeXT Classes/Executor.tiff new file mode 100644 index 0000000000000000000000000000000000000000..714108c7c79e7eb264bd7a20ad9add9557e61d14 GIT binary patch literal 1302 zcmeH_u};H442FG4TA>cmR8%ZH0J@1cXaxIg=U@H*{->=ksYo-d2SQ^+hnvX1zUc&NODh7s)v z>kAq}518Mos=Ac^%e(pfTA4hFFukh}df#|f%?!g#cUjIT)R*UZ-A%R4?EM9cVYi9r z;T0?AHC$2s4`lq*(nS)ApVcBCdX&0ZNN8e#e4g;sOn23|W3D9Ly(aCJO5$BLmZ358g dnxW|Q%N*7EzBz96=|@v5|7wrQFX%4({S7r-EAapT literal 0 HcmV?d00001 diff --git a/src/config/front-ends/nextstep/Executor/Executor_main.m b/OSX-only/CocoaExecutor/NeXT Classes/Executor_main.mm similarity index 68% rename from src/config/front-ends/nextstep/Executor/Executor_main.m rename to OSX-only/CocoaExecutor/NeXT Classes/Executor_main.mm index 596e870f..c3a08f43 100644 --- a/src/config/front-ends/nextstep/Executor/Executor_main.m +++ b/OSX-only/CocoaExecutor/NeXT Classes/Executor_main.mm @@ -3,34 +3,26 @@ */ #include "rsys/common.h" -#ifndef OPENSTEP -#import -#else /* OPENSTEP */ #import -#endif /* OPENSTEP */ #include "MacAppClass.h" #include #include #include "rsys/memory_layout.h" - +#include "ourstuff.h" #if defined(i386) #define NEXT_STACK_SIZE (512L * 1024) #endif /* defined(i386) */ -#ifndef OPENSTEP -void main(int argc, char *argv[]) { -#else /* OPENSTEP */ int ExecutorArgc; -char **ExecutorArgv; +const char **ExecutorArgv; -int main(int argc, char *argv[]) { -#endif /* OPENSTEP */ +int main(int argc, const char *argv[]) { -#if 1 /* THIS IS A TEMPORARY HACK */ +#if 0 /* THIS IS A TEMPORARY HACK */ void *where; kern_return_t r; @@ -60,19 +52,9 @@ int main(int argc, char *argv[]) { #endif -#ifndef OPENSTEP - [MacAppClass new]; - if ([NXApp loadNibSection:"Executor.nib" owner:NXApp withNames:NO]) - [NXApp run]; - else - fprintf(stderr, "death1\n"); - - - [NXApp free]; - exit(0); -#else /* OPENSTEP */ ExecutorArgc = argc; ExecutorArgv = argv; + Executor::nextmain(); + return NSApplicationMain (argc, argv); -#endif /* OPENSTEP */ } diff --git a/OSX-only/CocoaExecutor/NeXT Classes/MacAppClass.h b/OSX-only/CocoaExecutor/NeXT Classes/MacAppClass.h new file mode 100644 index 00000000..cf124cca --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/MacAppClass.h @@ -0,0 +1,41 @@ + +/* Generated by Interface Builder */ + +#import + +@class MacViewClass; +@class MacWindow; + +@interface MacAppClass : NSObject +{ + IBOutlet MacWindow *gameWindow; + IBOutlet MacViewClass *game; + IBOutlet NSPanel *infoPanel; + IBOutlet id myButton; + IBOutlet id myForm; + IBOutlet id doneButton; + IBOutlet NSTextField *sptext; + IBOutlet NSTextField *starsptext; + IBOutlet NSTextField *pctext; + IBOutlet NSTextField *starpctext; + IBOutlet NSTextField *d0text; + IBOutlet NSTextField *psltext; + IBOutlet NSTextField *sigtext; + IBOutlet NSTextField *debtext; + IBOutlet NSTextField *debtable; + IBOutlet NSWindow *deathwindow; + IBOutlet NSTextField *commenttext; + IBOutlet NSWindow *prefWindow; + IBOutlet NSMenu *myMenu; + IBOutlet NSWindow *splashScreen; + IBOutlet id deathMenuCell; + IBOutlet NSTextField *versionString; + id printView; +} + +- (void) windowDidBecomeKey:(NSNotification *)anotification; +- (void) windowDidResignKey:(NSNotification *)anotification; +- (IBAction) showInfo:(id)sender; +- (IBAction) printGame:(id)sender; + +@end diff --git a/OSX-only/CocoaExecutor/NeXT Classes/MacAppClass.mm b/OSX-only/CocoaExecutor/NeXT Classes/MacAppClass.mm new file mode 100644 index 00000000..78babbb6 --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/MacAppClass.mm @@ -0,0 +1,317 @@ +/* + * Here is the original comment... it's not too relevant anymore: + * + * BreakApp.m, subclass of Application for BreakApp. + * Author: Ali Ozer + * Written for 1.0 July 89. + * Modified for 2.0 Sept 90; separated the panels into their own .nib files. + * + * This class manages the windows & such for the BreakApp application. + * + * You may freely copy, distribute and reuse the code in this example. + * NeXT disclaims any warranty of any kind, expressed or implied, + * as to its fitness for any particular use. + */ + +#include "rsys/common.h" +#define Cursor NeXT_Cursor +#define Control NeXT_Control +#import +#undef Cursor +#undef Control + +#include "QuickDraw.h" +#include "rsys/next.h" +#import "MacAppClass.h" +#import "MacViewClass.h" +#import "MacWinClass.h" + +#include "SegmentLdr.h" +#include "MemoryMgr.h" +#include "rsys/soundopts.h" +#include "rsys/blockinterrupts.h" +#include +#include "rsys/prefs.h" +#include "rsys/hfs.h" +#include "rsys/segment.h" +#include "rsys/notmac.h" +#include +#include +#include "rsys/version.h" +#include "FileMgr.h" +#include "rsys/file.h" +#include "ourstuff.h" +#include "rsys/parse.h" + +using namespace Executor; + +@implementation MacAppClass + +char ROMlib_started; + +MacWindow *global_gameWindow; +NSMenu *Executor::global_menu; +id global_myForm; +id global_myButton; +id global_registerDone; +id global_doneButton; +id global_sptext; +id global_starsptext; +id global_pctext; +id global_starpctext; +id global_d0text; +id global_pstext; +id global_sigtext; +id global_debtext; +id global_debtable; +id global_deathwindow; +id global_deathMenuCell; +id global_commenttext; +MacViewClass *global_game; +id global_splashScreen; + +- (void)applicationDidFinishLaunching:(NSNotification *)notification +{ + + NSArray *types = @[NSRTFPboardType, NSPostScriptPboardType, + NSStringPboardType, NSTIFFPboardType, NSPICTPboardType]; + + global_gameWindow = gameWindow; + global_game = game; + global_splashScreen = splashScreen; + global_menu = myMenu; + global_myForm = myForm; + global_myButton = myButton; + global_doneButton = doneButton; + + global_sptext = sptext; + global_starsptext = starsptext; + global_pctext = pctext; + global_starpctext = starpctext; + global_d0text = d0text; + global_pstext = psltext; + global_sigtext = sigtext; + global_debtext = debtext; + global_debtable = debtable; + global_deathwindow = deathwindow; + global_deathMenuCell = deathMenuCell; + global_commenttext = commenttext; + + [[NSApplication sharedApplication] registerServicesMenuSendTypes:types returnTypes:types]; +} + +// Constrain window resizing. + +short ROMlib_constrained = NO; + +- (void) windowDidBecomeKey : (NSNotification *)anotification +{ + NSRect tempr; + + /* + * NOTE: we could become the key window while the mouse is outside our window + * (because some application hid, for instance). The following three + * lines will insure that we notice that we are on the outside if this + * happens. + */ + + tempr = [game bounds]; + + /* NOTE: userData of 0 may cause trouble ... I have vague recollections + of that happening under NEXTSTEP */ + +#if 0 + [gameWindow addTrackingRect:tempr owner:game userData:0 assumeInside:YES]; +#else +#warning need to fix trackingrect stuff +#endif + if (CrsrVis) + [realcursor set]; + else + [blankcursor set]; + if (ROMlib_started >= 3) + sendresumeevent([[NSPasteboard generalPasteboard] changeCount] > + ROMlib_ourchangecount); +} + +- (void) windowDidResignKey : (NSNotification *)anotification +{ + if (ROMlib_started >= 3) + sendsuspendevent(); +} + +// printGame: allows us to print the game window. We could've just connected +// the "Print..." menu item to the window's smartPrintPSCode:; however, we +// wanted to be able to change the title to reflect the status. +/* ctm NOTE: we no longer change the title */ + +- (IBAction)printGame:(id)sender +{ + [gameWindow print:sender]; +} + + +// Method to load the .nib file for the info panel. + +- (IBAction)showInfo:(id)sender +{ + if (!infoPanel) { + [NSBundle loadNibNamed:@"info" owner:self]; + [versionString setStringValue:@(ROMlib_executor_version)]; + } + [infoPanel makeKeyAndOrderFront:sender]; +} + +- (void)applicationWillTerminate:(NSNotification *)notification +{ + ROMlib_OurClose(); +} + +@end + +#define KEYTYPE \ +"Registration Keys are thirteen lower case letters and/or digits." + +#define FILLIN \ +"You must fill in the Owner and Registration Key fields." + +#define NOTVALID \ +"That registration key is not valid\nCall Abacus R&D Inc. at +1 505 766 9115." + +#define TOOMANYONCPU \ +"You may only run up to ten copies of this application simultaneously on one CPU." + +#define TOOMANYONNET "This program is already in use on the maximum number of CPUs that your current license allows. Call ARDI at +1 505 766 9115 to increase your limit." + +#define NEGSERIALNUMBERS + +LONGINT Executor::ROMlib_whichapps; + +void toomanycopiesonnet( void ) +{ + ROMlib_started = 4; + NSRunAlertPanel(nil, @TOOMANYONNET, nil, nil, nil); + C_ExitToShell(); +} + +void toomanycopiesonthiscpu( void ) +{ + ROMlib_started = 4; + NSRunAlertPanel(nil, @TOOMANYONCPU, nil, nil, nil); + C_ExitToShell(); +} + +void warnuser( const char *str ) +{ + NSRunAlertPanel(@"Warning", @"%s", nil, nil, nil, str); +} + +#define WILLSETPERMS \ +"The permissions for this program are not properly set. I will reset them for you." + +#define MUSTBESETUID \ +"The permissions for this program are not set properly. You need to run this program once as \"root\" so the permissions will be reset." + +#define CANNOTCREATECONFIG \ +"The configuration file could not be created." + +#define SOMEONEELSEONFLOPPY \ +"The floppy drive is already in use by a running program, so this program will not be able to use the floppy drive." + +#define BADFILESYSTEM \ +"The filesystem that Executor is installed on does not support setuid root programs. Contact your system administrator for more help." + +void willsetperms( void ) +{ + NSRunAlertPanel(nil, @WILLSETPERMS, nil, nil, nil); +} + +void cannotcreatconfig( void ) +{ + NSRunAlertPanel(nil, @CANNOTCREATECONFIG, nil, nil, nil); +} + +void mustbesetuid( void ) +{ + ROMlib_started = 4; + NSRunAlertPanel(nil, @MUSTBESETUID, nil, nil, nil); + C_ExitToShell(); +} + +void badfilesystem( void ) +{ + ROMlib_started = 4; + NSRunAlertPanel(nil, @BADFILESYSTEM, nil, nil, nil); + C_ExitToShell(); +} + +void someoneelseonfloppy( void ) +{ + NSRunAlertPanel(nil, @SOMEONEELSEONFLOPPY, nil, nil, nil); +} + +/* + * WindowName 1 + * WindowLocation x 2, y 3 + * WindowSize x 4, y 5 + * Delay 6 // No longer supported + * WriteWhen 7 + * Refresh 8 + * Noclock 9 + * PretendSound 10 + * debug 11 // No longer supported + * NewLinetoCR 15 + * PassPostscript 16 + * DirectDiskAccess 17 + * Accelerated 18 + * NoWarn32 19 + * FlushOften 20 + */ + +typedef enum { NAME = 1, DELAY = 6, WRITEWHEN, REFRESH, NOCLOCK, PRETENDSOUND, + NEWLINETOCR = 15, PASSPOSTSCRIPT, DIRECTDISKACCESS, + ACCELERATED, NOWARN32, FLUSHOFTEN} pref_t; + +#define ROMLIB_DEBUG_BIT (1 << 1) + +#define HASHBITS 4091 /* DON'T EVER CHANGE THIS NUMBER, OR YOU'LL */ + /* MESS UP EXISTING CONFIGURATION FILES! */ +#define NCACHEBYTES ((HASHBITS+7)/ 8) + +static void mydelay( long usec ) +{ + struct timeval now, later, timeout; + struct timezone tz; + fd_set foofds; + + gettimeofday(&now, &tz); + later.tv_usec = now.tv_usec + usec; + later.tv_sec = now.tv_sec + later.tv_usec / 1000000L; + later.tv_usec %= 1000000L; + FD_ZERO(&foofds); + while (usec > 0) { + timeout.tv_sec = usec / 1000000L; + timeout.tv_usec = usec % 1000000L; + select(0, &foofds, &foofds, &foofds, &timeout); + gettimeofday(&now, &tz); + usec = (later.tv_sec - now.tv_sec) * 1000000 + + (later.tv_usec - now.tv_usec); + } +} + +void ROMlib_updateworkspace( void ) +{ + virtual_int_state_t block; + + block = block_virtual_ints (); + mydelay(1250000); + + [[NSWorkspace sharedWorkspace] noteFileSystemChanged]; + + restore_virtual_ints (block); +} + +void ROMlib_splashscreen( void ) +{ + [global_splashScreen makeKeyAndOrderFront:0]; +} diff --git a/src/config/front-ends/nextstep/MacPrintClass.h b/OSX-only/CocoaExecutor/NeXT Classes/MacPrintClass.h similarity index 78% rename from src/config/front-ends/nextstep/MacPrintClass.h rename to OSX-only/CocoaExecutor/NeXT Classes/MacPrintClass.h index 771ebd7b..4965d553 100644 --- a/src/config/front-ends/nextstep/MacPrintClass.h +++ b/OSX-only/CocoaExecutor/NeXT Classes/MacPrintClass.h @@ -1,8 +1,6 @@ -#import -#import +#import - -@interface MacPrintClass:View +@interface MacPrintClass : NSView { } diff --git a/src/config/front-ends/nextstep/MacViewClass.h b/OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.h similarity index 84% rename from src/config/front-ends/nextstep/MacViewClass.h rename to OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.h index cff2aaaa..4f736578 100644 --- a/src/config/front-ends/nextstep/MacViewClass.h +++ b/OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.h @@ -1,19 +1,5 @@ -#ifndef OPENSTEP -#import -#import -#import -#import -#import - -#else /* OPENSTEP */ - -#import -#import -#import -#import - -#endif /* OPENSTEP */ +#import /* Artifical mappings */ #define MACCHAR_THORN 161 @@ -314,62 +300,20 @@ #define NEXTCHAR_tHORN 252 #define NEXTCHAR_yDIERESIS 253 -#ifndef OPENSTEP -#import -#else /* OPENSTEP */ #import -#endif /* OPENSTEP */ +#import -#ifndef OPENSTEP -@interface MacViewClass:View -#else /* OPENSTEP */ -@interface MacViewClass:NSView -#endif /* OPENSTEP */ -{ -} +@interface MacViewClass : NSView -- step; -#ifndef OPENSTEP -- initFrame:(const NXRect *)frm; -#endif /* not OPENSTEP */ -- (BOOL)acceptsFirstMouse; +- (id)step; - (BOOL) acceptsFirstResponder; -#ifndef OPENSTEP -- sizeTo:(NXCoord) width :(NXCoord)height; -- mouseDown:(NXEvent *)eventp; -- mouseMoved:(NXEvent *)eventp; -- mouseUp:(NXEvent *)eventp; -- keyDown:(NXEvent *)eventp; -- keyUp:(NXEvent *)eventp; -- drawSelf:(const NXRect *)rects :(int)rectCount ; -- validRequestorForSendType:(NXAtom)typeSent - andReturnType:(NXAtom)typeReturned; -- readSelectionFromPasteboard:pboard; -- (BOOL)writeSelectionToPasteboard:pboard types:(NXAtom *)types; -- (BOOL)getRect:(NXRect *)theRect forPage:(int)page; -#else /* OPENSTEP */ - (void) mouseDown:(NSEvent *)eventp; - (void) mouseMoved:(NSEvent *)eventp; - (void) mouseUp:(NSEvent *)eventp; - (void) keyDown:(NSEvent *)eventp; - (void) keyUp:(NSEvent *)eventp; -- (void) readSelectionFromPasteboard:pboard; -#endif /* OPENSTEP */ -- (BOOL)knowsPagesFirst:(int *)firstPageNum last:(int *)lastPageNum; -#ifndef OPENSTEP -- beginPageSetupRect:(const NXRect * )aRect - placement:(const NXPoint *) location; -- endPage; -- endPSOutput; -- pause:sender; -- abort:sender; -- mailARDI:sender; -- (void) installinfo:(const char *)name :(const char *) version; -#else /* OPENSTEP */ -- (void) beginPageSetupRect:(NSRect)aRect placement:(NSPoint) location; -- (void) endPage; -- (void) pause:sender; -- (void) abort:sender; -#endif /* OPENSTEP */ +- (void)readSelectionFromPasteboard:(NSPasteboard*)pboard; +- (IBAction)pause:(id)sender; +- (IBAction)abort:(id)sender; @end diff --git a/OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.mm b/OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.mm new file mode 100644 index 00000000..e0d9a545 --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.mm @@ -0,0 +1,2206 @@ +#if !defined (OMIT_RCSID_STRINGS) +char ROMlib_rcsid_MacViewClass[] = + "$Id: MacViewClass.m,v 2.34 1997/05/09 09:51:14 ctm Exp $"; +#endif + +#import +#define Cursor NeXT_Cursor +#include "rsys/common.h" +#import "MacViewClass.h" +#undef Cursor +#include "ToolboxEvent.h" +#include "rsys/vdriver.h" +#include "rsys/depthconv.h" +#include "rsys/cquick.h" +#include "rsys/dirtyrect.h" +#include "rsys/next.h" +#include "rsys/nextprint.h" +#include "rsys/blockinterrupts.h" +#include "rsys/refresh.h" +#include "rsys/print.h" +#include "rsys/flags.h" +#include "rsys/PSstrings.h" +#include "ourstuff.h" +#include "OSEvent.h" +#include "rsys/osevent.h" +#include "contextswitch.h" +#include "rsys/executor.h" +#include "MemoryMgr.h" +#include "ScrapMgr.h" +#include "rsys/vdriver.h" +#include "host_vdriver.h" +#include "rsys/parse.h" +#include "rsys/notmac.h" +#include "rsys/host.h" +#include + +using namespace Executor; +/* NOTE: This isn't a very good MACOSX_ object, because much of its + * data is stored in static variables, instead of in instance + * variables. That means we can only have one instantiation. We do + * this because we are constrained to adhere to the C semantics of the + * vdriver interface, and because we have no interest in running two + * of these simultaneously. + */ + +/* NSBitmapImageReps for the screen in various formats. */ +static NSBitmapImageRep *rgb_screen_bitmap; +static NSBitmapImageRep *two_bpp_screen_bitmap; +NSCursor *Executor::realcursor, *Executor::blankcursor; +NSImage *blankcursorimage, *cursorimage; +NSBitmapImageRep *cursorrep, *blankcursorrep; +NSTimer *our_timer = nil; + +void +Executor::vdriver_shutdown (void) +{ +} + + +void +Executor::vdriver_opt_register (void) +{ +} + +static NSBitmapImageRep *current_screen_bitmap; /* An alias for one of the other three */ +static NSBitmapImageRep *one_bpp_screen_bitmap; + +/* Do we need to convert from internal screen to real screen? */ +static boolean_t screen_needs_conversion_p; + +/* This is here for easy access by C functions. */ +static MacViewClass *self_view; + +/* Function to convert the screen to NeXT format. */ +static depthconv_func_t conversion_func = NULL; + +/* Space for depth conversion tables. */ +static uint8 depth_table_space[DEPTHCONV_MAX_TABLE_SIZE]; + +/* Color mapping table. */ +static Executor::ColorSpec color_table[256]; + +/* Pointer to base memory for the NeXT-format frame buffer. */ +static uint32 *ns_fbuf; + +/* Pointer to base memory for the shadow screen (for refresh). */ +static uint32 *shadow_fbuf; + +/* Row bytes for the NeXT-format frame buffer. */ +static uint32 ns_fbuf_row_bytes; + +/* Size of allocated internal frame buffer. */ +static uint32 fbuf_size; + + +/* These variables are required by the vdriver interface. */ + +uint8 *Executor::vdriver_fbuf; + +int Executor::vdriver_row_bytes; + +int Executor::vdriver_width = VDRIVER_DEFAULT_SCREEN_WIDTH; + +int Executor::vdriver_height = VDRIVER_DEFAULT_SCREEN_HEIGHT; + +int Executor::vdriver_bpp, Executor::vdriver_log2_bpp; + +int Executor::vdriver_max_bpp, Executor::vdriver_log2_max_bpp; + +rgb_spec_t *Executor::vdriver_rgb_spec = NULL; + + +static rgb_spec_t ns_rgb_spec; + +extern vdriver_nextstep_mode_t vdriver_nextstep_modes; + +/* For now, just force black and white cursors. */ +int Executor::host_cursor_depth = 1; + +/* True iff our display is two bit grayscale. */ +static boolean_t two_bit_grayscale_display_p; + +/* True if we should be drawing in grayscale. */ +boolean_t Executor::vdriver_grayscale_p; + +/* True if the CLUT cannot be changed. */ +boolean_t Executor::vdriver_fixed_clut_p; + +static void +create_our_timer (id who) +{ + SEL temp_sel; + NSMethodSignature *temp_sig; + NSInvocation *invoke_step; + + temp_sel = @selector (step); + temp_sig = [who methodSignatureForSelector:temp_sel]; + invoke_step = [NSInvocation invocationWithMethodSignature:temp_sig]; + [invoke_step setSelector:temp_sel]; + [invoke_step setTarget:who]; + our_timer = [NSTimer scheduledTimerWithTimeInterval:.00000001 + invocation:invoke_step repeats:YES]; +} + +static void +flip_2bpp_pixels (const void *table, + const uint8 *src_base, int src_row_bytes, + uint8 *dst_base, int dst_row_bytes, + int top, int left, int bottom, int right) +{ + int bytes_from_left; + int num_longs, num_rows; + int src_add, dst_add; + const uint32 *s; + uint32 *d; + + bytes_from_left = ((left >> 2) & ~3); + s = (const uint32 *) (src_base + (top * src_row_bytes) + bytes_from_left); + d = (uint32 *) (dst_base + (top * dst_row_bytes) + bytes_from_left); + + num_longs = ((right + 15) >> 4) - (left >> 4); + + src_add = src_row_bytes - (num_longs * 4); + dst_add = dst_row_bytes - (num_longs * 4); + +#define FLIP_LOOP(extra) \ +do { \ +for (num_rows = bottom - top; num_rows > 0; num_rows--) \ +{ \ +int n; \ +\ +for (n = num_longs; (n -= 4) >= 0; ) \ +{ \ +*d++ = ~*s++; \ +*d++ = ~*s++; \ +*d++ = ~*s++; \ +*d++ = ~*s++; \ +} \ +extra; \ +\ +s = (const uint32 *) ((const uint8 *) s + src_add); \ +d = (uint32 *) ((uint8 *) d + dst_add); \ +} \ +} while (0) + + switch (num_longs & 3) + { + case 0: + FLIP_LOOP ((void) 0); + break; + case 1: + FLIP_LOOP (*d++ = ~*s++); + break; + case 2: + FLIP_LOOP (*d++ = ~*s++; *d++ = ~*s++); + break; + case 3: + FLIP_LOOP (*d++ = ~*s++; *d++ = ~*s++; *d++ = ~*s++); + break; + } +} + + +int +Executor::vdriver_update_screen_rects (int num_rects, const vdriver_rect_t *r, + boolean_t cursor_p) +{ + NSRect *nxr; + int i; + + if (num_rects == 0 || current_screen_bitmap == nil) + return 0; + + /* + * While we're printing, send no bits to the screen. This is ugly, but + * that's the way E/NS 1.3x works. + */ + + if (printstate != __idle) + return 0; + + if (screen_needs_conversion_p) { + if (conversion_func == NULL) + { + if (current_screen_bitmap == rgb_screen_bitmap) + conversion_func = (depthconv_make_ind_to_rgb_table + (depth_table_space, vdriver_bpp, + NULL, color_table, &ns_rgb_spec)); + else if (current_screen_bitmap == two_bpp_screen_bitmap) + { + if (vdriver_bpp == 1) { + static const uint32 one_to_two_table[2] = { 0x3, 0 }; + + conversion_func = (depthconv_make_raw_table + (depth_table_space, 1, 2, + NULL, one_to_two_table)); + } else if (vdriver_bpp == 2) { + conversion_func = flip_2bpp_pixels; + } else + abort (); + } else + abort (); + } + + /* Convert from the current format to our internal screen format. */ + for (i = 0; i < num_rects; i++) { + int top, left, bottom, right; + + top = r[i].top; + left = r[i].left; + bottom = r[i].bottom; + right = r[i].right; + + (*conversion_func) (depth_table_space, vdriver_fbuf, + vdriver_row_bytes, (uint8 *) ns_fbuf, + ns_fbuf_row_bytes, top, left, bottom, right); + } + } + + /* Set up to transfer to the real screen. */ + nxr = (NSRect *) alloca (num_rects * sizeof nxr[0]); + for (i = 0; i < num_rects; i++) { + int left, top, height; + left = r[i].left; + nxr[i].origin.x = left; + nxr[i].size.width = r[i].right - left; + top = r[i].top; + height = r[i].bottom - top; + nxr[i].size.height = height; + nxr[i].origin.y = vdriver_height - top - height; + } + + BLOCK_REAL_INTERRUPTS_EXCURSION + ({ + [self_view lockFocus]; + + /* I'm not sure where Mat learned about this call */ + NSRectClipList (nxr, num_rects); + + [current_screen_bitmap draw]; + [self_view unlockFocus]; + }); + + return 0; +} + + +int +Executor::vdriver_update_screen (int top, int left, int bottom, int right, + boolean_t cursor_p) +{ + vdriver_rect_t r; + + if (top < 0) + top = 0; + if (left < 0) + left = 0; + + if (bottom > vdriver_height) + bottom = vdriver_height; + if (right > vdriver_width) + right = vdriver_width; + + r.top = top; + r.left = left; + r.bottom = bottom; + r.right = right; + + return vdriver_update_screen_rects (1, &r, cursor_p); +} + +static void +repaint_screen (void) +{ + dirty_rect_accrue (0, 0, vdriver_height, vdriver_width); + dirty_rect_update_screen (); +} + +void +Executor::vdriver_set_colors (int first_color, int num_colors, const Executor::ColorSpec *colors) +{ + if (!vdriver_fixed_clut_p + && memcmp (&color_table[first_color], colors, + num_colors * sizeof colors[0])) + { + memcpy (&color_table[first_color], colors, + num_colors * sizeof colors[0]); + conversion_func = NULL; /* Invalidate old conversion stuff. */ + repaint_screen (); + vdriver_flush_display(); /* Make sure changed colors are visible. */ + } +} + + +boolean_t +Executor::vdriver_acceptable_mode_p (int width, int height, int bpp, + boolean_t grayscale_p, + boolean_t exact_match_p) +{ + if (exact_match_p && two_bit_grayscale_display_p && !grayscale_p) + return FALSE; + + if (width == 0) + width = vdriver_width; + if (height == 0) + height = vdriver_height; + if (bpp == 0) + { + bpp = vdriver_bpp; + if (bpp == 0) + bpp = vdriver_max_bpp; + } + + if (width < VDRIVER_MIN_SCREEN_WIDTH || width > vdriver_width + || height < VDRIVER_MIN_SCREEN_HEIGHT || height > vdriver_height + || bpp < 1 || bpp > vdriver_max_bpp + || (bpp != 1 && bpp != 2 && bpp != 4 && bpp != 8)) + return FALSE; + + return TRUE; +} + + +boolean_t +Executor::vdriver_set_mode (int width, int height, int bpp, boolean_t grayscale_p) +{ + if (!vdriver_acceptable_mode_p (width, height, bpp, grayscale_p, FALSE)) + return FALSE; + + if (width == 0) + width = vdriver_width; + if (height == 0) + height = vdriver_height; + if (bpp == 0) { + bpp = vdriver_bpp; + if (bpp == 0) + bpp = vdriver_max_bpp; + } + + vdriver_width = width; + vdriver_height = height; + + if (bpp != vdriver_bpp) { + static boolean_t first_mode_set_p = TRUE; + int i; + + /* Change depth. */ + vdriver_bpp = bpp; + vdriver_log2_bpp = ROMlib_log2[bpp]; + + vdriver_row_bytes = ((((width << vdriver_log2_bpp) + 127) / 128U) * 16); + + /* Invalidate the conversion function. */ + conversion_func = NULL; + + if (bpp == 1 && one_bpp_screen_bitmap != nil) + { + current_screen_bitmap = one_bpp_screen_bitmap; + vdriver_row_bytes = [one_bpp_screen_bitmap bytesPerRow]; + screen_needs_conversion_p = FALSE; + } + else if ((bpp == 1 || bpp == 2) && two_bpp_screen_bitmap != nil) + { + current_screen_bitmap = two_bpp_screen_bitmap; + screen_needs_conversion_p = TRUE; + } + else + { + /* Set CLUT to all gray; this makes depths sets look nicer. */ + for (i = 0; i < 256; i++) + color_table[i] = ROMlib_gray_cspec; + + current_screen_bitmap = rgb_screen_bitmap; + screen_needs_conversion_p = TRUE; + } + + /* Clear the screen. */ + memset (vdriver_fbuf, first_mode_set_p ? 0 : ~0, + vdriver_height * vdriver_row_bytes); + first_mode_set_p = FALSE; + + assert (current_screen_bitmap != nil); + } + + vdriver_grayscale_p = (two_bit_grayscale_display_p || grayscale_p); + + return TRUE; +} + + +void +Executor::vdriver_get_colors (int first_color, int num_colors, + struct Executor::ColorSpec *color_array) +{ + if (vdriver_fixed_clut_p) { + static const Executor::ColorSpec one_bpp_gray_cspecs[2] = { + { CWC (0), { CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF) } }, + { CWC (1), { CWC (0x0000), CWC (0x0000), CWC (0x0000) } }, + }; + static const Executor::ColorSpec two_bpp_gray_cspecs[4] = { + { CWC (0), { CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF) } }, + { CWC (1), { CWC ((unsigned short)0xAAAA), CWC ((unsigned short)0xAAAA), CWC ((unsigned short)0xAAAA) } }, + { CWC (2), { CWC (0x5555), CWC (0x5555), CWC (0x5555) } }, + { CWC (3), { CWC (0x0000), CWC (0x0000), CWC (0x0000) } }, + }; + + gui_assert (two_bit_grayscale_display_p); + gui_assert (first_color >= 0 && first_color + num_colors <= 4); + + memcpy (color_array, + ((vdriver_bpp == 2) + ? &two_bpp_gray_cspecs[first_color] + : &one_bpp_gray_cspecs[first_color]), + num_colors * sizeof color_array[0]); + } else { + gui_fatal ("should not be asking for colors! CLUT not fixed"); + } +} + + +vdriver_nextstep_mode_t vdriver_nextstep_modes = +{ + /* contiguous_range_p */ TRUE, + /* num_sizes */ 2, + { + /* min */ { VDRIVER_MIN_SCREEN_WIDTH, VDRIVER_MIN_SCREEN_HEIGHT }, + /* default maximum */ + /* max */ { VDRIVER_DEFAULT_SCREEN_WIDTH, VDRIVER_DEFAULT_SCREEN_HEIGHT }, + }, +}; + + +void +Executor::vdriver_flush_display (void) +{ + /* If you take this out, Speedometer 3.23 starts paging massively + * during the 8-bit color QuickDraw tests. It appears that tons + * of stuff starts getting queued up via the Mach message passing + * mechanisms, although that's a very rough guess. Always flushing + * makes it consistently slow but we don't get massive paging. + * And of course we only call this in animation mode. + */ + BLOCK_REAL_INTERRUPTS_EXCURSION + ({ + [[NSGraphicsContext currentContext] flushGraphics]; + }); +} + + +void +Executor::host_beep_at_user (void) +{ + NSBeep (); +} + + +void Executor::querypointerX( LONGINT *xp, LONGINT *yp, LONGINT *modp ) +{ + NSPoint p; + + BLOCK_REAL_INTERRUPTS_EXCURSION + ({ + p = [[self_view window] mouseLocationOutsideOfEventStream]; + *xp = p.x; + *yp = (vdriver_height - p.y); + }); +} + +void +Executor::showcursorX(LONGINT show) +{ + BLOCK_REAL_INTERRUPTS_EXCURSION + ({ + if (show) + [realcursor set]; + else + [blankcursor set]; + }); +} + +extern void Executor::setcursorX(INTEGER *data, INTEGER *mask, LONGINT hotx, LONGINT hoty ) +{ + char *datap; + short i; + short mymask[16], mydata[16], gray_bits; + NSPoint p; + static char beenhere = NO; + + if (hotx < 0) + hotx = 0; + else if (hotx > 16) + hotx = 16; + + if (hoty < 0) + hoty = 0; + else if (hoty > 16) + hoty = 16; + + BLOCK_REAL_INTERRUPTS_EXCURSION + ({ + if (!beenhere) + { + [[self_view window] disableCursorRects]; + beenhere = YES; + } + gray_bits = 0x5555; + for (i = 0; i < 16; ++i) + { + mymask[i] = ~(data[i] | mask[i]); + gray_bits = ~gray_bits; + mydata[i] = data[i] & ~(gray_bits & (~mask[i] & data[i])); + } + + datap = (char *)[cursorrep bitmapData]; + memcpy (datap, mydata, 32); + memcpy (datap + 32, mymask, 32); + [cursorimage recache]; + if (CrsrVis) + [blankcursor set]; + + p.x = hotx; + p.y = hoty; + + realcursor = [[NSCursor alloc] initWithImage:cursorimage hotSpot:p]; + + if (CrsrVis) + [realcursor set]; + }); +} + +/* + * ROMlib_printtimeout is specifically for Excel, when you try to + * print an empty page. Excel starts the printing process and then + * writes an message to the screen, informing you that you have a + * blank worksheet. This doesn't fit in with our printing paradigm, + * so ROMlib_printtimeout is a hack to solve this one instance of the + * general class of printing problems. + * + * ROMlib_printtimeout is positive when we're counting context + * switches, looking for an OpenPage. + * + * ROMlib_printtimeout is zero if we've timed out, but haven't + * yet finished printing from the NeXT's perspective. + * + * ROMlib_printtimeout is negative when we've finished printing. + * This will result in the screen being updated once we + * drop back into the Mac universe. + */ + +long Executor::ROMlib_printtimeout = 10000; /* any positive number will do */ + +boolean_t +Executor::vdriver_init (int _max_width, int _max_height, int _max_bpp, + boolean_t fixed_p, int *argc, char *argv[]) +{ + int width, height, i; + NSWindow *view_window; + + make_rgb_spec (&ns_rgb_spec, 16, FALSE, CLC (0x000F000F), +#if defined (LITTLEENDIAN) + 4, 4, 4, 0, 4, 12, +#else + 4, 12, 4, 8, 4, 4, +#endif + CL (GetCTSeed ())); + + /* Allocate the NeXT bitmap. */ + width = flag_width ? flag_width : MAX (_max_width, vdriver_width); + width = MAX (width, VDRIVER_MIN_SCREEN_WIDTH); + width = (width + 7) & ~7; /* round width up to multiple of 8. */ + height = flag_height ? flag_height : MAX (_max_height, vdriver_height); + height = MAX (height, VDRIVER_MIN_SCREEN_HEIGHT); + if (two_bit_grayscale_display_p) + ns_fbuf_row_bytes = (width / 4 + 15) & ~15; + else + ns_fbuf_row_bytes = (width * 2 + 15) & ~15; + + vdriver_width = width; + vdriver_height = height; + + /* Size the window to the appropriate size. */ + view_window = [self_view window]; + + { + NSSize temp_size; + + temp_size.width = width; + temp_size.height = height; + [view_window setContentSize:temp_size]; + } + + [view_window makeKeyAndOrderFront:self_view]; + +#warning need to set up tracking rectangle + + [view_window useOptimizedDrawing:YES]; + [view_window setAcceptsMouseMovedEvents:YES]; + + ns_fbuf = (uint32*)valloc (((ns_fbuf_row_bytes * height) + 8191) & ~8191); + + /* Allocate the internal bitmap, enough space for max bpp. Make each + * rowbytes divisible by 16. + */ + vdriver_row_bytes = (((width << vdriver_log2_max_bpp) + 127) / 128U) * 16; + fbuf_size = vdriver_row_bytes * height; + vdriver_fbuf = (uint8*)valloc (fbuf_size); + memset (vdriver_fbuf, 0, fbuf_size); + + if (!two_bit_grayscale_display_p) { + uint32 white_pixel; + + white_pixel = ns_rgb_spec.white_pixel; + for (i = ns_fbuf_row_bytes * height / sizeof (uint32) - 1; i >= 0; i--) + ns_fbuf[i] = white_pixel; + + + rgb_screen_bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:(unsigned char **)&ns_fbuf + pixelsWide:width pixelsHigh:height bitsPerSample:4 + samplesPerPixel:3 hasAlpha:NO isPlanar:NO + colorSpaceName:NSDeviceRGBColorSpace + bytesPerRow:ns_fbuf_row_bytes bitsPerPixel:16]; + + one_bpp_screen_bitmap = nil; + two_bpp_screen_bitmap = nil; + } else { + memset (ns_fbuf, ~0, ns_fbuf_row_bytes * height); + + two_bpp_screen_bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:(unsigned char **)&ns_fbuf + pixelsWide:width pixelsHigh:height bitsPerSample:2 + samplesPerPixel:1 hasAlpha:NO isPlanar:NO + colorSpaceName:NSDeviceWhiteColorSpace + bytesPerRow:(((width >> 2) + 15) & ~15) + bitsPerPixel:2]; + + /* No need for one bpp screen...we'll do the conversion ourselves. */ + one_bpp_screen_bitmap = nil; + rgb_screen_bitmap = nil; + } + + vdriver_nextstep_modes.size[1].width = width; + vdriver_nextstep_modes.size[1].height = height; + + return TRUE; +} + +void converthex(char **h, const unsigned char *table) +{ + unsigned int val, val2; + char *p; + + p = *h; + if (*p <= 'f' && *p >= 'a') + val = *p - 'a' + 10; + else if (*p <= 'F' && *p >= 'A') + val = *p - 'A' + 10; + else + val = *p - '0'; + + if (*(p + 1) <= 'f' && *(p + 1) >= 'a') + val = val * 16 + *(p + 1) - 'a' + 10; + else if (*(p + 1) <= 'F' && *(p + 1) >= 'A') + val = val * 16 + *(p + 1) - 'A' + 10; + else + val = val * 16 + *(p + 1) - '0'; + + val = table[val]; + val2 = val/16; + if (val2 > 9) + *p++ = val2 + 'a' - 10; + else + *p++ = val2 + '0'; + + val2 = val & 0xF; + if (val2 > 9) + *p++ = val2 + 'a' - 10; + else + *p++ = val2 + '0'; +} + +void Executor::convertchars(char *data, long length, const unsigned char *table) +{ + char *ep; + int escaped; + + escaped = NO; + ep = data + length; + while (data < ep) { + if (escaped && *data == '\'') { + *data++ = '\''; + converthex(&data, table); + } + if (*data == '\\') + escaped = YES; + else + escaped = NO; + data[1] = table[*(unsigned char *)data]; + data++; + } +} + +static int unixrtfconvert(int length, const char *ip, char *op) +{ + const char *fromp, *ep; + int retval; + + retval = length; + fromp = ip; + ep = ip + length; + while (fromp < ep) { + if (*fromp == '\n') { + *op++ = '\r'; + fromp++; + } else if (*fromp == '\\') { + *op++ = '\\'; + fromp++; + if (fromp < ep && *fromp == '\n') { +#if !defined (WEDONTNEEDNOSTEENINGPAR) + strcpy(op, "par \n"); + op += 5; + fromp++; + retval += 4; +#else /* WEDONTNEEDNOSTEENINGPAR */ + *op++ = '\r'; + fromp++; +#endif /* WEDONTNEEDNOSTEENINGPAR */ + } else if (fromp + 2 < ep && !strncmp(fromp, "ul0", 3)) { + strcpy(op, "ulnone"); + op += 6; + fromp += 3; + retval += 3; + } else if (fromp + 6 < ep && !strncmp(fromp, "fonttbl", 6)) { + strcpy(op, "fonttbl\\f99\\fa b;"); + op += 17; + fromp += 7; + retval += 10; + } else + *op++ = *fromp++; + } else + *op++ = *fromp++; + } + return retval; +} + +static inline void copyandtranslate( char *cp, const char **ipp, char **opp) +{ + *cp = *(*ipp)++; + if (*cp == '\r') + *cp = '\n'; + *(*opp)++ = *cp; +} + +typedef NS_ENUM(int, convertdir_t) { + MacToUNIX, + UNIXToMac, + MacRTFToUNIX, + UNIXRTFToMac +}; + +static const unsigned char mactonext[] = { + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, /* NEXTCHAR_QUOTESINGLE, */ + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, /* NEXTCHAR_GRAVE, */ + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + NEXTCHAR_ADIERESIS, + NEXTCHAR_ARING, + NEXTCHAR_CCEDILLA, + NEXTCHAR_EACUTE, + NEXTCHAR_NTILDE, + NEXTCHAR_ODIERESIS, + NEXTCHAR_UDIERESIS, + NEXTCHAR_aACUTE, + NEXTCHAR_aGRAVE, + NEXTCHAR_aCIRCUMFLEX, + NEXTCHAR_aDIERESIS, + NEXTCHAR_aTILDE, + NEXTCHAR_aRING, + NEXTCHAR_cCEDILLA, + NEXTCHAR_eACUTE, + NEXTCHAR_eGRAVE, + NEXTCHAR_eCIRCUMFLEX, + NEXTCHAR_eDIERESIS, + NEXTCHAR_iACUTE, + NEXTCHAR_iGRAVE, + NEXTCHAR_iCIRCUMFLEX, + NEXTCHAR_iDIERESIS, + NEXTCHAR_nTILDE, + NEXTCHAR_oACUTE, + NEXTCHAR_oGRAVE, + NEXTCHAR_oCIRCUMFLEX, + NEXTCHAR_oDIERESIS, + NEXTCHAR_oTILDE, + NEXTCHAR_uACUTE, + NEXTCHAR_uGRAVE, + NEXTCHAR_uCIRCUMFLEX, + NEXTCHAR_uDIERESIS, + NEXTCHAR_DAGGER, + NEXTCHAR_DEGREE, + NEXTCHAR_CENT, + NEXTCHAR_STERLING, + NEXTCHAR_SECTION, + NEXTCHAR_BULLET, + NEXTCHAR_PARAGRAPH, + NEXTCHAR_GERMANDBLS, + NEXTCHAR_REGISTERED, + NEXTCHAR_COPYRIGHT, + NEXTCHAR_TRADEMARK, + NEXTCHAR_ACUTE, + NEXTCHAR_DIERESIS, + NEXTCHAR_NOTEQUAL, + NEXTCHAR_AE, + NEXTCHAR_OSLASH, + NEXTCHAR_INFINITY, + NEXTCHAR_PLUSMINUS, + NEXTCHAR_LESSEQUAL, + NEXTCHAR_GREATEQUAL, + NEXTCHAR_YEN, + NEXTCHAR_MU, + NEXTCHAR_PARTIALDIFF, + NEXTCHAR_SUMMATION, + NEXTCHAR_PRODUCT, + NEXTCHAR_PI, + NEXTCHAR_INTEGRAL, + NEXTCHAR_ORDFEMININE, + NEXTCHAR_ORDMASCULINE, + NEXTCHAR_OMEGA, + NEXTCHAR_ae, + NEXTCHAR_oSLASH, + NEXTCHAR_QUESTIONDOWN, + NEXTCHAR_EXCLAMDOWN, + NEXTCHAR_LOGICALNOT, + NEXTCHAR_RADICAL, + NEXTCHAR_FLORIN, + NEXTCHAR_APPROXEQUAL, + NEXTCHAR_DELTA, + NEXTCHAR_GUILLEMOTLEFT, + NEXTCHAR_GUILLEMOTRIGHT, + NEXTCHAR_ELLIPSIS, + NEXTCHAR_FIGSP, + NEXTCHAR_AGRAVE, + NEXTCHAR_ATILDE, + NEXTCHAR_OTILDE, + NEXTCHAR_OE, + NEXTCHAR_oe, + NEXTCHAR_ENDASH, + NEXTCHAR_EMDASH, + NEXTCHAR_QUOTEDBLLEFT, + NEXTCHAR_QUOTEDBLRIGHT, + NEXTCHAR_GRAVE, /* NEXTCHAR_QUOTELEFT, */ + NEXTCHAR_QUOTESINGLE, /* NEXTCHAR_QUOTERIGHT, */ + NEXTCHAR_DIVIDE, + NEXTCHAR_LOZENGE, + NEXTCHAR_yDIERESIS, + NEXTCHAR_YDIERESIS, + NEXTCHAR_FRACTION, + NEXTCHAR_CURRENCY, + NEXTCHAR_GUILSINGLLEFT, + NEXTCHAR_GUILSINGLRIGHT, + NEXTCHAR_FI, + NEXTCHAR_FL, + NEXTCHAR_DAGGERDBL, + NEXTCHAR_PERIODCENTERED, + NEXTCHAR_QUOTESINGLBASE, + NEXTCHAR_QUOTEDBLBASE, + NEXTCHAR_PERTHOUSAND, + NEXTCHAR_ACIRCUMFLEX, + NEXTCHAR_ECIRCUMFLEX, + NEXTCHAR_AACUTE, + NEXTCHAR_EDIERESIS, + NEXTCHAR_EGRAVE, + NEXTCHAR_IACUTE, + NEXTCHAR_ICIRCUMFLEX, + NEXTCHAR_IDIERESIS, + NEXTCHAR_IGRAVE, + NEXTCHAR_OACUTE, + NEXTCHAR_OCIRCUMFLEX, + NEXTCHAR_APPLE, + NEXTCHAR_OGRAVE, + NEXTCHAR_UACUTE, + NEXTCHAR_UCIRCUMFLEX, + NEXTCHAR_UGRAVE, + NEXTCHAR_DOTLESSI, + NEXTCHAR_CIRCUMFLEX, + NEXTCHAR_TILDE, + NEXTCHAR_MACRON, + NEXTCHAR_BREVE, + NEXTCHAR_DOTACCENT, + NEXTCHAR_RING, + NEXTCHAR_CEDILLA, + NEXTCHAR_HUNGARUMLAUT, + NEXTCHAR_OGONEK, + NEXTCHAR_CARON +}; + +static const unsigned char nexttomac[] = { + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, /* MACCHAR_QUOTERIGHT, */ + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, /* MACCHAR_QUOTELEFT, */ + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + MACCHAR_FIGSP, + MACCHAR_AGRAVE, + MACCHAR_AACUTE, + MACCHAR_ACIRCUMFLEX, + MACCHAR_ATILDE, + MACCHAR_ADIERESIS, + MACCHAR_ARING, + MACCHAR_CCEDILLA, + MACCHAR_EGRAVE, + MACCHAR_EACUTE, + MACCHAR_ECIRCUMFLEX, + MACCHAR_EDIERESIS, + MACCHAR_IGRAVE, + MACCHAR_IACUTE, + MACCHAR_ICIRCUMFLEX, + MACCHAR_IDIERESIS, + MACCHAR_ETH, + MACCHAR_NTILDE, + MACCHAR_OGRAVE, + MACCHAR_OACUTE, + MACCHAR_OCIRCUMFLEX, + MACCHAR_OTILDE, + MACCHAR_ODIERESIS, + MACCHAR_UGRAVE, + MACCHAR_UACUTE, + MACCHAR_UCIRCUMFLEX, + MACCHAR_UDIERESIS, + MACCHAR_YACUTE, + MACCHAR_THORN, + MACCHAR_MU, + MACCHAR_MULTIPLY, + MACCHAR_DIVIDE, + MACCHAR_COPYRIGHT, + MACCHAR_EXCLAMDOWN, + MACCHAR_CENT, + MACCHAR_STERLING, + MACCHAR_FRACTION, + MACCHAR_YEN, + MACCHAR_FLORIN, + MACCHAR_SECTION, + MACCHAR_CURRENCY, + MACCHAR_QUOTERIGHT, /* MACCHAR_QUOTESINGLE, */ + MACCHAR_QUOTEDBLLEFT, + MACCHAR_GUILLEMOTLEFT, + MACCHAR_GUILSINGLLEFT, + MACCHAR_GUILSINGLRIGHT, + MACCHAR_FI, + MACCHAR_FL, + MACCHAR_REGISTERED, + MACCHAR_ENDASH, + MACCHAR_DAGGER, + MACCHAR_DAGGERDBL, + MACCHAR_PERIODCENTERED, + MACCHAR_BROKENBAR, + MACCHAR_PARAGRAPH, + MACCHAR_BULLET, + MACCHAR_QUOTESINGLBASE, + MACCHAR_QUOTEDBLBASE, + MACCHAR_QUOTEDBLRIGHT, + MACCHAR_GUILLEMOTRIGHT, + MACCHAR_ELLIPSIS, + MACCHAR_PERTHOUSAND, + MACCHAR_LOGICALNOT, + MACCHAR_QUESTIONDOWN, + MACCHAR_ONESUPERIOR, + MACCHAR_QUOTELEFT, /* MACCHAR_GRAVE, */ + MACCHAR_ACUTE, + MACCHAR_CIRCUMFLEX, + MACCHAR_TILDE, + MACCHAR_MACRON, + MACCHAR_BREVE, + MACCHAR_DOTACCENT, + MACCHAR_DIERESIS, + MACCHAR_TWOSUPERIOR, + MACCHAR_RING, + MACCHAR_CEDILLA, + MACCHAR_THREESUPERIOR, + MACCHAR_HUNGARUMLAUT, + MACCHAR_OGONEK, + MACCHAR_CARON, + MACCHAR_EMDASH, + MACCHAR_PLUSMINUS, + MACCHAR_ONEQUARTER, + MACCHAR_ONEHALF, + MACCHAR_THREEQUARTERS, + MACCHAR_aGRAVE, + MACCHAR_aACUTE, + MACCHAR_aCIRCUMFLEX, + MACCHAR_aTILDE, + MACCHAR_aDIERESIS, + MACCHAR_aRING, + MACCHAR_cCEDILLA, + MACCHAR_eGRAVE, + MACCHAR_eACUTE, + MACCHAR_eCIRCUMFLEX, + MACCHAR_eDIERESIS, + MACCHAR_iGRAVE, + MACCHAR_AE, + MACCHAR_iACUTE, + MACCHAR_ORDFEMININE, + MACCHAR_iCIRCUMFLEX, + MACCHAR_iDIERESIS, + MACCHAR_eTH, + MACCHAR_nTILDE, + MACCHAR_LSLASH, + MACCHAR_OSLASH, + MACCHAR_OE, + MACCHAR_ORDMASCULINE, + MACCHAR_oGRAVE, + MACCHAR_oACUTE, + MACCHAR_oCIRCUMFLEX, + MACCHAR_oTILDE, + MACCHAR_oDIERESIS, + MACCHAR_ae, + MACCHAR_uGRAVE, + MACCHAR_uACUTE, + MACCHAR_uCIRCUMFLEX, + MACCHAR_DOTLESSI, + MACCHAR_uDIERESIS, + MACCHAR_yACUTE, + MACCHAR_lSLASH, + MACCHAR_oSLASH, + MACCHAR_oe, + MACCHAR_GERMANDBLS, + MACCHAR_tHORN, + MACCHAR_yDIERESIS, + MACCHAR_NEXT254, + MACCHAR_NEXT255 +}; + +#define PREFIX "\\endnhere" +#define NCHARPREFIX (sizeof(PREFIX)-1) + +#define STICKIN \ +"{\\fonttbl" \ +"{\\f0\\fswiss Helvetica;}" \ +"{\\f3\\fmodern Courier;}" \ +"{\\f4\\fmodern Ohlfs;}" \ +"{\\f20\\froman Times;}" \ +"{\\f21\\fswiss Helvetica;}" \ +"{\\f22\\fmodern Courier;}" \ +"}\\f0" +#define NCHARSTICKIN (sizeof(STICKIN)-1) + +static int macrtfconvert(int length, const char *ip, char *op) +{ + int retval, index; + char c; + SETUPA5; + + retval = length; + index = 0; + while (length > 0 && index < NCHARPREFIX) { + copyandtranslate(&c, &ip, &op); + if (PREFIX[index] == c) + ++index; + else if (PREFIX[0] == c) + index = 1; + else + index = 0; + --length; + } + if (length > 0) { + retval += insertfonttbl(&op, (char) -1); + } + while (--length >= 0) + copyandtranslate(&c, &ip, &op); + RESTOREA5; + return retval; +} + +static int convertreturns(const char *datain, char *dataout, int length, + convertdir_t dir) +{ + char from, to; + + switch (dir) { + case MacToUNIX: + bcopy(datain, dataout, length); + from = '\r'; + to = '\n'; + break; + case UNIXToMac: + bcopy(datain, dataout, length); + from = '\n'; + to = '\r'; + break; + case MacRTFToUNIX: + /*-->*/ return macrtfconvert(length, datain, dataout); + break; + case UNIXRTFToMac: + /*-->*/ return unixrtfconvert(length, datain, dataout); + break; + default: + from = 0; + to = 0; + gui_abort(); + } + while (--length >= 0) + if (*dataout++ == from) + dataout[-1] = to; + return 0; +} + +/* + * NOTE: the code below should be table driven. + */ + +enum { + TEXT = (Executor::OSType)(('T'<<24)|('E'<<16)|('X'<<8)|'T'), + EPS = (Executor::OSType)(('E'<<24)|('P'<<16)|('S'<<8)|' '), + RTF = (Executor::OSType)(('R'<<24)|('T'<<16)|('F'<<8)|' '), + TIFF = (Executor::OSType)(('T'<<24)|('I'<<16)|('F'<<8)|'F'), + PICT = (Executor::OSType)(('P'<<24)|('I'<<16)|('C'<<8)|'T') +}; + +NSPasteboard *Executor::ROMlib_pasteboard = nil; +NSInteger ROMlib_ourchangecount; + +void Executor::PutScrapX (Executor::OSType type, LONGINT length, char *p, int scrp_cnt) +{ + static int count = 0; + static int textcount = 0, epscount = 0, rtfcount = 0, tiffcount = 0, + pictcount = 0; + char *textdata = nullptr, *epsdata = nullptr, *rtfdata = nullptr, *tiffdata = nullptr, *pictdata = nullptr; + long textlength = 0, epslength = 0, rtflength = 0, tifflength = 0, pictlength = 0; + char doit; + NSMutableArray *types; + virtual_int_state_t block; + long fonttblextra; + + SETUPA5; + types = [NSMutableArray arrayWithCapacity:5]; + + block = block_virtual_ints (); + if (!ROMlib_pasteboard) + ROMlib_pasteboard = [[NSPasteboard generalPasteboard] retain]; + doit = NO; + switch (type) { + case TEXT: + if (count == textcount) + ++count; + textcount = count; + if (textdata) + free (textdata); + textdata = (char*)malloc (length); + convertreturns (p, textdata, length, MacToUNIX); + convertchars (textdata, length, mactonext); + textlength = length; + doit = YES; + break; + case EPS: + if (count == epscount) + ++count; + epscount = count; + if (epsdata) + free (epsdata); + epsdata = (char*)malloc (length); + convertreturns (p, epsdata, length, MacToUNIX); + epslength = length; + doit = YES; + break; + case RTF: + if (count == rtfcount) + ++count; + rtfcount = count; + if (rtfdata) + free (rtfdata); + fonttblextra = insertfonttbl ((char **) 0, (char) 0); + + rtfdata = (char*)malloc (length + fonttblextra); + rtflength = convertreturns (p, rtfdata, length, MacRTFToUNIX); + convertchars (rtfdata, rtflength, mactonext); + doit = YES; + break; + case TIFF: + if (count == tiffcount) + ++count; + tiffcount = count; + if (tiffdata) + free (tiffdata); + tiffdata = (char*)malloc (length); + memcpy (tiffdata, p, length); + tifflength = length; + doit = YES; + break; + case PICT: + if (count == pictcount) + ++count; + pictcount = count; + if (pictdata) + free (pictdata); + pictdata = (char*)malloc (length); + memcpy (pictdata, p, length); + pictlength = length; + doit = YES; + break; + default: + ; + } + + if (doit) { + if (rtfcount == count) + [types addObject:NSRTFPboardType]; + if (epscount == count) + [types addObject:NSPostScriptPboardType]; + if (textcount == count) + [types addObject:NSStringPboardType]; + if (tiffcount == count) + [types addObject:NSTIFFPboardType]; + if (pictcount == count) + [types addObject:NSPICTPboardType]; + [ROMlib_pasteboard declareTypes: types owner:NULL]; + + if (rtfcount == count) + [ROMlib_pasteboard setData: [NSData dataWithBytesNoCopy:rtfdata length:rtflength] forType:NSRTFPboardType]; + if (epscount == count) + [ROMlib_pasteboard setData:[NSData dataWithBytesNoCopy:epsdata length:epslength] forType:NSPostScriptPboardType]; + if (textcount == count) + [ROMlib_pasteboard setData:[NSData dataWithBytesNoCopy:textdata length:textlength] forType:NSStringPboardType]; + if (tiffcount == count) + [ROMlib_pasteboard setData:[NSData dataWithBytesNoCopy:tiffdata length:tifflength] forType:NSTIFFPboardType]; + if (pictcount == count) + [ROMlib_pasteboard setData:[NSData dataWithBytesNoCopy:pictdata length:pictlength] forType:NSPICTPboardType]; + } + ROMlib_ourchangecount =[ROMlib_pasteboard changeCount]; + restore_virtual_ints (block); + RESTOREA5; +} + +LONGINT Executor::GetScrapX (OSType type, char **h) +{ + @autoreleasepool { + NSArray *types; + NSData *data; + NSString *tofind; + long retval; + int temp; + virtual_int_state_t block; + + SETUPA5; + block = block_virtual_ints (); + if (!ROMlib_pasteboard) + ROMlib_pasteboard = [[NSPasteboard generalPasteboard] retain]; + retval = -1; + switch (type) { + case TEXT: + tofind = NSStringPboardType; + break; + case RTF: + tofind = NSRTFPboardType; + break; + case EPS: + tofind = NSPostScriptPboardType; + break; + case TIFF: + tofind = NSTIFFPboardType; + break; + case PICT: + tofind = NSPICTPboardType; + break; + default: + tofind = 0; + break; + } + if (tofind && + (temp = [ROMlib_pasteboard changeCount]) > ROMlib_ourchangecount) + { + types =[ROMlib_pasteboard types]; + + if ([types indexOfObject:tofind] != NSNotFound + && (data = [ROMlib_pasteboard dataForType:tofind])) + { + if (tofind == NSRTFPboardType) + { + ReallocHandle ((Handle) h, [data length] * 2); + if (MemErr != noErr) + { + retval = -1; + /*-->*/ goto DONE; + } + retval = convertreturns ((const char*)[data bytes], MR (*h), [data length], UNIXRTFToMac); + convertchars (MR (*h), retval, nexttomac); + ReallocHandle ((Handle) h, retval); + if (MemErr != noErr) + retval = -1; + /*-->*/ goto DONE; + } else { + ReallocHandle ((Handle) h, [data length]); + if (MemErr != noErr) { + retval = -1; + /*-->*/ goto DONE; + } + if (![tofind isEqualToString: NSTIFFPboardType] && ![tofind isEqualToString:NSPICTPboardType]) + convertreturns ((const char*)[data bytes], MR (*h), [data length], UNIXToMac); + else + memcpy (MR (*h), [data bytes], [data length]); + if ([tofind isEqualToString:NSStringPboardType]) + convertchars (MR (*h), [data length], nexttomac); + } + retval = [data length]; + } + else + { + ROMlib_ZeroScrap (); + } + } + DONE: + restore_virtual_ints (block); + RESTOREA5; + return retval; + } +} + + +void +ROMlib_SetTitle (char *newtitle) +{ + BLOCK_REAL_INTERRUPTS_EXCURSION + ({ + @autoreleasepool { + [[self_view window] setTitle:[NSString stringWithCString:newtitle encoding:NSMacOSRomanStringEncoding]]; + } + }); +} + +void +Executor::host_set_cursor (char *cursor_data, + unsigned short cursor_mask[16], + int hotspot_x, int hotspot_y) +{ + setcursorX ((short *)cursor_data, (short *)cursor_mask, + hotspot_x, hotspot_y); +} + + +int +Executor::host_set_cursor_visible (int show_p) +{ + static int prev_show_p = FALSE; + int retval; + + showcursorX (show_p); + retval = prev_show_p; + prev_show_p = show_p; + return retval; +} + + +void +Executor::host_flush_shadow_screen (void) +{ + int top_long, left_long, bottom_long, right_long; + + /* Lazily allocate a shadow screen. We won't be doing refresh that often, + * so don't waste the memory unless we need it. + */ + if (shadow_fbuf == NULL) + { + shadow_fbuf = (uint32*)malloc (fbuf_size); + memcpy (shadow_fbuf, vdriver_fbuf, vdriver_row_bytes * vdriver_height); + vdriver_update_screen (0, 0, vdriver_height, vdriver_width, FALSE); + } + else if (find_changed_rect_and_update_shadow ((uint32 *) vdriver_fbuf, + (uint32 *) shadow_fbuf, + (vdriver_row_bytes + / sizeof (uint32)), + vdriver_height, + &top_long, &left_long, + &bottom_long, &right_long)) + { + vdriver_update_screen (top_long, (left_long * 32) >> vdriver_log2_bpp, + bottom_long, + (right_long * 32) >> vdriver_log2_bpp, FALSE); + } +} + +typedef enum { + APP_NOT_STARTED, + APP_IS_RUNNING, + APP_DIED +} app_state_t; + +static app_state_t app_state = APP_NOT_STARTED; + +extern void ROMlib_startapp( void ); + +void ROMlib_startapp( void ) +{ + id abort_cell; + + abort_cell = [global_menu itemWithTag:11]; + [abort_cell setTitle:@"Abort..."]; + app_state = APP_IS_RUNNING; +} + +char * +ROMlib_GetTitle (void) +{ + NSString *temp_title; + char *retval; + + temp_title = [[self_view window] title]; + NSUInteger maxLen = [temp_title lengthOfBytesUsingEncoding:NSMacOSRomanStringEncoding]; + retval = (char*)malloc (maxLen + 1); + [temp_title getCString:retval maxLength:maxLen + 1 encoding:NSMacOSRomanStringEncoding]; + return retval; +} + +void +ROMlib_FreeTitle (char *title) +{ + free (title); +} + + +#if 0 +void set_malloc_debug (int level) +{ + malloc_debug (level); +} +#endif + + +@implementation MacViewClass + +- (id) initWithFrame:(NSRect)frameRect +{ + NSSize size; + char *datap; + int bytecount; + + self = [super initWithFrame:frameRect]; + if (!self) { + [self release]; + return nil; + } + + /* Since we will be repeatedly focused on, allocate a gstate. */ + [self allocateGState]; + + two_bit_grayscale_display_p + = NSBitsPerSampleFromDepth([NSWindow defaultDepthLimit]) == 2; + + vdriver_fixed_clut_p = two_bit_grayscale_display_p; + vdriver_grayscale_p = two_bit_grayscale_display_p; + + /* Set up our max bpp appropriately. */ + if (two_bit_grayscale_display_p) + vdriver_max_bpp = 2; + else + vdriver_max_bpp = 8; + vdriver_log2_max_bpp = ROMlib_log2[vdriver_max_bpp]; + + current_screen_bitmap = nil; + self_view = self; + + vdriver_width = frameRect.size.width; + vdriver_height = frameRect.size.height; + + /* make the cursor */ + + cursorrep = [NSBitmapImageRep alloc]; + [cursorrep initWithBitmapDataPlanes:NULL pixelsWide: 16 pixelsHigh:16 + bitsPerSample: 1 samplesPerPixel: 2 hasAlpha: YES isPlanar:YES + colorSpaceName: NSDeviceBlackColorSpace bytesPerRow:0 + bitsPerPixel:0]; + memset ([cursorrep bitmapData], 0, [cursorrep bytesPerRow] * 16 * 2); + + size.width = size.height = 16; + cursorimage = [[NSImage alloc] initWithSize:size]; + [cursorimage addRepresentation:cursorrep]; + + realcursor = [NSCursor alloc]; + + { + NSPoint spot; + + spot.x = 1; + spot.y = 1; + [realcursor initWithImage:cursorimage hotSpot:spot]; + } + /* make the blank cursor (for when it's hidden) */ + + blankcursorrep =[NSBitmapImageRep alloc]; + [blankcursorrep initWithBitmapDataPlanes:NULL pixelsWide: 16 pixelsHigh:16 + bitsPerSample: 1 samplesPerPixel: 2 hasAlpha: YES isPlanar:YES + colorSpaceName: NSDeviceBlackColorSpace bytesPerRow:0 bitsPerPixel:0]; + + datap = (char *)[blankcursorrep bitmapData]; + bytecount = [blankcursorrep bytesPerRow] * 16; + memset (datap, 0, bytecount); + memset (datap + bytecount, ~0, 16 * sizeof (short)); + + size.width = size.height = 16; + blankcursorimage = [[NSImage alloc] initWithSize:size]; + [blankcursorimage addRepresentation:blankcursorrep]; + blankcursor = [NSCursor alloc]; + { + NSPoint spot; + + spot.x = 1; + spot.y = 1; + [blankcursor initWithImage:blankcursorimage hotSpot:spot]; + } + +#warning no longer disabling dead keys. Eventually we should rethink +#warning how Executor handles the keyboard + +/* + * see the comment around line 540 of NEXT.c -- basically we should give + * the user the option of using the keymappings that are already present + * on the underlying operating system. + */ + create_our_timer (self); + + return self; +} + +- (void) drawRect:(NSRect)rect +{ + SETUPA5; + + switch (printstate) { + case __idle: + BLOCK_REAL_INTERRUPTS_EXCURSION + ({ + if (current_screen_bitmap == nil) + { + [[NSColor whiteColor] set]; + NSRectFill ([self bounds]); + } + else + { + NSRectClip (rect); /* is this needed? */ + [current_screen_bitmap draw]; + } + }); + break; + case seenOpenPage: + RESTOREA5; + do + contextswitch(&nextstep_sp, &romlib_sp); + while (printstate != __idle && printstate != seenClosePage); + goto avoidrestorea5; + break; + default: + /* seenClosePage may get us in here, but we can't do anything + without sploding (I think) */ + break; + } + RESTOREA5; +avoidrestorea5: + return; +} + +- (id)step +{ + /* NOTE: we may need to be doing SETUPA5 now as well as protect us stuff, + since timerswitch is no longer called */ + + [self lockFocus]; + + do { + contextswitch (&nextstep_sp, &romlib_sp); + } while (printstate != seenOpenDoc && printstate != seenPageSetUp + && [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:[NSDate distantPast] + inMode:NSDefaultRunLoopMode + dequeue:NO] == nil + ); + + [self unlockFocus]; + { + SETUPA5; + if (printstate == seenOpenDoc) + { + [self print:self]; + if (ROMlib_printtimeout == 0) + ROMlib_printtimeout = -1; + } + else if (printstate == seenPageSetUp) + { + [NSApp runPageLayout:self]; + printstate = __idle; + } + RESTOREA5; + } + return self; +} + + +/* The following allows MacViewClass to grab the mousedown event that activates + * the window. By default, the View's acceptsFirstMouse returns NO. + */ +- (BOOL) acceptsFirstResponder +{ + return YES; +} + +/* These are methods in this file and also Mac #defines. */ +#undef mouseUp +#undef mouseDown +#undef keyDown +#undef keyUp + +- (void)mouseDown:(NSEvent *) eventp +{ + SETUPA5; + postnextevent (eventp); + RESTOREA5; +} + +- (void)mouseMoved:(NSEvent *) eventp +{ + SETUPA5; + ROMlib_updatemouselocation (eventp); + RESTOREA5; +} + +-(void)mouseDragged:(NSEvent *) eventp +{ + SETUPA5; + ROMlib_updatemouselocation (eventp); + RESTOREA5; +} + +- (void)mouseUp:(NSEvent *) eventp +{ + SETUPA5; + postnextevent (eventp); + RESTOREA5; +} + +-(void)mouseEntered:(NSEvent *) eventp +{ + SETUPA5; + if (CrsrVis) + [realcursor set]; + else + [blankcursor set]; + postnextevent (eventp); + RESTOREA5; +} + +-(void)mouseExited:(NSEvent *) eventp +{ + SETUPA5; +#warning need to call setOnMouseExited when we set up the view ... + postnextevent (eventp); + RESTOREA5; +} + +-(void)keyDown:(NSEvent *) eventp +{ + SETUPA5; + postnextevent (eventp); + RESTOREA5; +} + +static struct +{ + NSEventModifierFlags mask; + char key; +} maskkeys[] = { + { NSAlphaShiftKeyMask, 0x39, }, + { NSShiftKeyMask, 0x38, }, + { NSControlKeyMask, 0x3B, }, + { NSAlternateKeyMask, 0x3A, }, + { NSCommandKeyMask, 0x37, }, +}; + +-(void)flagsChanged:(NSEvent *) eventp +{ + int i; + + SETUPA5; + for (i = NELEM (maskkeys); --i >= 0;) + { + ROMlib_zapmap (maskkeys[i].key, !!([eventp modifierFlags] & maskkeys[i].mask)); + } + /* If shift is down, assume caps lock is not. The NeXT doesn't give us + * a separate bit for just caps lock, which we need for Solarian. This + * will give us a decent (but imperfect) approximation... + */ + if ([eventp modifierFlags] & NSShiftKeyMask) + ROMlib_zapmap (0x39, 0); + ROMlib_mods = ROMlib_next_butmods_to_mac_butmods ([eventp modifierFlags]); + RESTOREA5; +} + +-(BOOL) performKeyEquivalent:(NSEvent *) eventp +{ + if (app_state == APP_IS_RUNNING) { + SETUPA5; + postnextevent (eventp); + RESTOREA5; + return YES; + } else { + return [super performKeyEquivalent:eventp]; + } +} + +-(void) keyUp:(NSEvent *) eventp +{ + SETUPA5; + postnextevent (eventp); + RESTOREA5; +} + + +- (IBAction) pause:(id)sender +{ + id pause_cell; + static char oldtitle[80]; + + pause_cell = [global_menu itemWithTag:10]; + if ([[pause_cell title] characterAtIndex:0] == 'P') { + [our_timer invalidate]; + [[[self window] title] getCString:oldtitle maxLength:sizeof(oldtitle)-1 encoding:NSUTF8StringEncoding]; + [[self window] setTitle:@"Executor is PAUSED"]; + [pause_cell setTitle:@"Continue"]; + } else { + [[self window] setTitle:@(oldtitle)]; + [pause_cell setTitle:@"Pause"]; + create_our_timer (self); + } +} + +- (IBAction) abort:(id)sender +{ + if (app_state != APP_IS_RUNNING + || (NSRunAlertPanel + (@"Are You Sure", + @"Hitting the \"Abort Anyway\" button will cause Executor to stop immediately, without giving the currently running program a chance to quit gracefully. This can result in corrupted files.", + @"Cancel", @"Abort Anyway", nil) + == NSAlertAlternateReturn)) + [NSApp terminate:sender]; +} + + +- (id)validRequestorForSendType:(NSString*)typeSent andReturnType:(NSString*) typeReturned +{ + return self; +} + +- (void)readSelectionFromPasteboard:(NSPasteboard*)pboard +{ + id saveROMlib_pasteboard; + + { + SETUPA5; + sendsuspendevent (); + RESTOREA5; + } + contextswitch (&nextstep_sp, &romlib_sp); + contextswitch (&nextstep_sp, &romlib_sp); + contextswitch (&nextstep_sp, &romlib_sp); + saveROMlib_pasteboard = ROMlib_pasteboard; + ROMlib_pasteboard = pboard; + { + SETUPA5; + sendresumeevent (YES); + RESTOREA5; + } + contextswitch (&nextstep_sp, &romlib_sp); + contextswitch (&nextstep_sp, &romlib_sp); + contextswitch (&nextstep_sp, &romlib_sp); + ROMlib_pasteboard = saveROMlib_pasteboard; + { + SETUPA5; + sendpaste (); + RESTOREA5; + } + contextswitch (&nextstep_sp, &romlib_sp); + contextswitch (&nextstep_sp, &romlib_sp); + contextswitch (&nextstep_sp, &romlib_sp); +} + +- (BOOL) writeSelectionToPasteboard:(NSPasteboard *) pboard + types:(NSArray *) types +{ + id saveROMlib_pasteboard; + + { + SETUPA5; + sendcopy (); + RESTOREA5; + } + contextswitch (&nextstep_sp, &romlib_sp); + contextswitch (&nextstep_sp, &romlib_sp); + contextswitch (&nextstep_sp, &romlib_sp); + saveROMlib_pasteboard = ROMlib_pasteboard; + ROMlib_pasteboard = pboard; + { + SETUPA5; + sendsuspendevent (); + RESTOREA5; + } + contextswitch (&nextstep_sp, &romlib_sp); + contextswitch (&nextstep_sp, &romlib_sp); + contextswitch (&nextstep_sp, &romlib_sp); + ROMlib_pasteboard = saveROMlib_pasteboard; + { + SETUPA5; + sendresumeevent (NO); + RESTOREA5; + } + return YES; +} + +-(NSRect) rectForPage:(NSInteger) page +{ + NSRect retval; + + pagewanted = page; + retval.origin.x = 0; + retval.origin.y = 0; + retval.size = [[NSPrintInfo sharedPrintInfo] paperSize]; + ROMlib_printtimeout = 10000; + while (printstate != __idle && printstate != seenOpenPage && + --ROMlib_printtimeout != 0) + contextswitch (&nextstep_sp, &romlib_sp); + if (ROMlib_printtimeout == 0) + printstate = __idle; + return printstate == __idle ? NSZeroRect : retval; +} + +-(BOOL) knowsPagesFirst:(int *) firstPageNum last:(int *) lastPageNum +{ + return YES; +} + +char Executor::ROMlib_needtorestore; + +#if 0 +- (void) beginPageSetupRect:(NSRect) aRect placement:(NSPoint) location +{ + [super beginPageSetupRect: aRect placement:location]; + ROMlib_needtorestore = 0; + ROMlib_suppressclip = 0; +} + +-(void) addToPageSetup +{ + float scale; +#warning need to implement scaling factor (dictionary lookup) + scale = 1.0; + PStranslate (0,[[NSPrintInfo sharedPrintInfo] paperSize].height); + PSscale (1 * scale, -1 * scale); +/* + * NOTE: we should probably check to see whether pse and psb are + * defined before blowing them away, but then again, just + * 'cause they're defined doesn't mean they're what we want. + */ + DPSPrintf (DPSGetCurrentContext (), "/pse {} def\n" + "/psb {} def\n" + "/execuserobject {\n" + " dup UserObjects length ge\n" + " { pop }\n" + " { UserObjects exch get exec }\n" + " ifelse\n" + "} def\n" + "/currentmouse { 0 0 } def\n" + "/printobject { pop pop } def\n" + ); + [super addToPageSetup]; +} + +/* + * NOTE: %% is needed to get just one % + */ + +-(void)endPageSetup +{ + [super endPageSetup]; + +#if 0 + DPSPrintf (DPSGetCurrentContext (), + "%% The following is a lie that is necessary because Word 5\n" + "%% doesn't wrap EPS files properly and we can't tell where\n" + "%% the PostScript we're printing comes from.\n" + "%%%%BeginDocument: IWishWeDidntHaveToDoThis\n"); +#endif +} + +- (void) endPage +{ + if (ROMlib_needtorestore) + PSgrestore (); + DPSPrintf (DPSGetCurrentContext (), ROMlib_page_end); + [super endPage]; +} + +- (void) endTrailer +{ + [super endTrailer]; + + pagewanted = 1024 * 1024; /* i.e. real big */ + + /* we can't repaint the screen from where we are, but we can accrue a + very large dirty rect so the next repaint will redraw everything */ + + dirty_rect_accrue (0, 0, vdriver_height, vdriver_width); +} +#endif + +#if 0 +- (void) endPrologue +{ + extern int pageno; + + pageno = 0; + + //DPSPrintf(DPSGetCurrentContext(), ROMlib_doc_prolog); + [super endPrologue]; +} +#endif + +@end diff --git a/OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.h b/OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.h new file mode 100644 index 00000000..5e6590bd --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.h @@ -0,0 +1,10 @@ + +/* Generated by Interface Builder */ + +#import + +@interface MacWindow : NSWindow + +- (BOOL)commandKey:(NSEvent *)theEvent; + +@end diff --git a/src/config/front-ends/nextstep/MacWinClass.m b/OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.m similarity index 57% rename from src/config/front-ends/nextstep/MacWinClass.m rename to OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.m index 405c2f97..215f8ebb 100644 --- a/src/config/front-ends/nextstep/MacWinClass.m +++ b/OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.m @@ -5,22 +5,15 @@ @implementation MacWindow -#ifndef OPENSTEP -- (BOOL)commandKey:(NXEvent *)theEvent -#else /* OPENSTEP */ - (BOOL)commandKey:(NSEvent *)theEvent -#endif /* OPENSTEP */ { -#ifndef OPENSTEP - if ( [contentView performKeyEquivalent:theEvent] ) -#else /* OPENSTEP */ if ( [[self contentView] performKeyEquivalent:theEvent] ) -#endif /* OPENSTEP */ return( YES ); else return( NO ); } +extern void ROMlib_dummywincall( void ); void ROMlib_dummywincall( void ) { } diff --git a/src/config/front-ends/nextstep/NEXT.c b/OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm similarity index 67% rename from src/config/front-ends/nextstep/NEXT.c rename to OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm index e9220cb3..f2b8e787 100644 --- a/src/config/front-ends/nextstep/NEXT.c +++ b/OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm @@ -7,16 +7,11 @@ char ROMlib_rcsid_NEXT[] = "$Id: NEXT.c 63 2004-12-24 18:19:43Z ctm $"; #endif -#include "rsys/common.h" -#ifdef OPENSTEP +#include "rsys/common.h" #include "rsys/notmac.h" -#include - -#endif /* OPENSTEP */ - -#if defined(NEXT) || defined(MSDOS) || defined (EVENT_SVGALIB) +#include #include "QuickDraw.h" #include "rsys/keyboards.h" @@ -26,12 +21,40 @@ char ROMlib_rcsid_NEXT[] = #include "rsys/flags.h" #include "rsys/print.h" #include "rsys/vdriver.h" +#include "rsys/stubify.h" +#include "rsys/arrowkeys.h" +#include "ourstuff.h" + +#include "ToolboxEvent.h" +#include "ResourceMgr.h" + +using namespace Executor; + +PUBLIC keyboard_enum_t Executor::ROMlib_keyboard_type; + +#define DIACREP1START 0x81 +unsigned char diacrep1[] = { + 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0x82, /* 0x81 - 0x87 */ + 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, /* 0x88 - 0x8F */ + 0x00, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0xf4, /* 0x90 - 0x97 */ + 0xf2, 0xf3, 0x86, /* 0x98 - 0x9A */ +}; + +#define DIACREP2START 0xD5 +unsigned char diacrep2[] = { + 0x88, 0x87, 0x89, /* 0xD5 - 0xD7 */ + 0x8b, 0x8a, 0x8c, 0x8d, 0x8f, 0x8e, 0x90, 0x91, /* 0xD8 - 0xDF */ + 0x93, 0xae, 0x92, 0xbb, 0x94, 0x95, 0x00, 0x96, /* 0xE0 - 0xE7 */ + 0x00, 0x00, 0x00, 0x00, 0x98, 0x97, 0x99, 0x9b, /* 0xE8 - 0xEF */ + 0x9a, 0xbe, 0x9d, 0x9c, 0x9e, 0x00, 0x9f, 0x00, /* 0xF0 - 0xF7 */ + 0x00, 0xbf, 0xcf, 0x00, 0x00, 0xd8, /* 0xF8 - 0xFD */ +}; /* * NOTE: this table is used in DOS land also */ -unsigned char next_virt_to_mac_virt[NVIRTMAPS][NKEYSTOMAP] = +unsigned char Executor::next_virt_to_mac_virt[NVIRTMAPS][NKEYSTOMAP] = { { 0xFF, /* unused 0x00 */ @@ -76,7 +99,8 @@ unsigned char next_virt_to_mac_virt[NVIRTMAPS][NKEYSTOMAP] = 0x18, /* '=' 0x27 numeric keypad */ /*CTMHACK*/ 0x2C, /* '/' 0x28 numeric keypad */ /*CTMHACK*/ 0xFF, /* unused 0x29 */ - 0x24, /* ' ' 0x2a carraige return */ + 0x24, /* ' +' 0x2a carraige return */ 0x27, /* ''' 0x2b */ 0x29, /* ';' 0x2c */ 0x25, /* 'l' 0x2d */ @@ -247,93 +271,19 @@ unsigned char next_virt_to_mac_virt[NVIRTMAPS][NKEYSTOMAP] = } }; -#endif /* defined(NEXT) || defined(MSDOS) */ - -#if defined(NEXT) - -#ifndef OPENSTEP -#include -#endif /* not OPENSTEP */ - -#include "OSEvent.h" -#include "ResourceMgr.h" -#include "ToolboxEvent.h" -#include "rsys/arrowkeys.h" -#include "rsys/nextprint.h" -#include "ourstuff.h" - - -PUBLIC keyboard_enum_t ROMlib_keyboard_type; - -#define DIACREP1START 0x81 -unsigned char diacrep1[] = { - 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0x82, /* 0x81 - 0x87 */ - 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, /* 0x88 - 0x8F */ - 0x00, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0xf4, /* 0x90 - 0x97 */ - 0xf2, 0xf3, 0x86, /* 0x98 - 0x9A */ -}; - -#define DIACREP2START 0xD5 -unsigned char diacrep2[] = { - 0x88, 0x87, 0x89, /* 0xD5 - 0xD7 */ - 0x8b, 0x8a, 0x8c, 0x8d, 0x8f, 0x8e, 0x90, 0x91, /* 0xD8 - 0xDF */ - 0x93, 0xae, 0x92, 0xbb, 0x94, 0x95, 0x00, 0x96, /* 0xE0 - 0xE7 */ - 0x00, 0x00, 0x00, 0x00, 0x98, 0x97, 0x99, 0x9b, /* 0xE8 - 0xEF */ - 0x9a, 0xbe, 0x9d, 0x9c, 0x9e, 0x00, 0x9f, 0x00, /* 0xF0 - 0xF7 */ - 0x00, 0xbf, 0xcf, 0x00, 0x00, 0xd8, /* 0xF8 - 0xFD */ -}; - -#ifndef OPENSTEP -#undef NX_ALPHASHIFTMASK -#define NX_ALPHASHIFTMASK (1L << 16) - -#undef NX_SHIFTMASK -#define NX_SHIFTMASK (1L << 17) - -#undef NX_CONTROLMASK -#define NX_CONTROLMASK (1L << 18) - -#undef NX_ALTERNATEMASK -#define NX_ALTERNATEMASK (1L << 19) - -#undef NX_COMMANDMASK -#define NX_COMMANDMASK (1L << 20) - -#undef NX_NUMERICPADMASK -#define NX_NUMERICPADMASK (1L << 21) - -A1(PUBLIC, INTEGER, ROMlib_next_butmods_to_mac_butmods, LONGINT, nextflags) -#else /* OPENSTEP */ -A1(PUBLIC, INTEGER, ROMlib_next_butmods_to_mac_butmods, - unsigned int, nextflags) -#endif /* OPENSTEP */ +A1(PUBLIC, Executor::INTEGER, ROMlib_next_butmods_to_mac_butmods, + NSEventModifierFlags, nextflags) { INTEGER retval; retval = 0; -#ifndef OPENSTEP - if (nextflags & NX_SHIFTMASK) -#else /* OPENSTEP */ if (nextflags & NSShiftKeyMask) -#endif /* OPENSTEP */ retval |= shiftKey; -#ifndef OPENSTEP - if (nextflags & NX_CONTROLMASK) -#else /* OPENSTEP */ if (nextflags & NSControlKeyMask) -#endif /* OPENSTEP */ retval |= ControlKey; -#ifndef OPENSTEP - if (nextflags & NX_ALTERNATEMASK) -#else /* OPENSTEP */ if (nextflags & NSAlternateKeyMask) -#endif /* OPENSTEP */ retval |= optionKey; -#ifndef OPENSTEP - if (nextflags & NX_COMMANDMASK) -#else /* OPENSTEP */ if (nextflags & NSCommandKeyMask) -#endif /* OPENSTEP */ retval |= cmdKey; retval |= ROMlib_mods & btnState; return retval; @@ -343,134 +293,69 @@ A1(PUBLIC, INTEGER, ROMlib_next_butmods_to_mac_butmods, * NOTE: We are probably not consistent with KeyTrans. */ -#ifndef OPENSTEP - -A3(PRIVATE, LONGINT, next_keydata_to_mac_keydata, NXEvent *, neventp, - boolean_t, down_p, unsigned char *, virtp) - -#else /* OPENSTEP */ +namespace Executor { + PRIVATE Executor::LONGINT next_keydata_to_mac_keydata(NSEvent*, boolean_t, unsigned char*); +} -A3(PRIVATE, LONGINT, next_keydata_to_mac_keydata, NSEvent *, neventp, +A3(PRIVATE, Executor::LONGINT, next_keydata_to_mac_keydata, NSEvent *, neventp, boolean_t, down_p, unsigned char *, virtp) - -#endif /* OPENSTEP */ { - INTEGER macmodifiers; -#ifndef OPENSTEP - unsigned char charcode, keycode, c, rep; - -#define NEXT_LEFTARROW 0xAC /* NOTE: These are charCodes */ -#define NEXT_DOWNARROW 0xAF /* We're allowed to use them */ -#define NEXT_RIGHTARROW 0xAE /* but the arrow keys are in the "symbol" */ -#define NEXT_UPARROW 0xAD /* charSet */ -#else /* OPENSTEP */ - unsigned char charcode, keycode, rep; - unsigned int next_flags; - unichar thechar; -#endif /* OPENSTEP */ + INTEGER macmodifiers; + unsigned char charcode, keycode, rep; + unsigned int next_flags; + unichar thechar; #define NEXT_DELETE 0x7F -#ifndef OPENSTEP - if (neventp->data.key.charSet == NX_SYMBOLSET) { - switch (neventp->data.key.charCode) { - case NEXT_UPARROW: - neventp->data.key.charCode = ASCIIUPARROW; - break; - case NEXT_DOWNARROW: - neventp->data.key.charCode = ASCIIDOWNARROW; - break; - case NEXT_LEFTARROW: - neventp->data.key.charCode = ASCIILEFTARROW; - break; - case NEXT_RIGHTARROW: - neventp->data.key.charCode = ASCIIRIGHTARROW; - break; - default: - break; - } - } else if (neventp->data.key.charCode == NEXT_DELETE) - neventp->data.key.charCode = 8; /* back space */ -#else /* OPENSTEP */ - thechar = [[neventp characters] characterAtIndex:0]; + thechar = [[neventp characters] characterAtIndex:0]; - switch (thechar) - { - case NSUpArrowFunctionKey: - thechar = ASCIIUPARROW; - break; - case NSDownArrowFunctionKey: - thechar = ASCIIDOWNARROW; - break; - case NSLeftArrowFunctionKey: - thechar = ASCIILEFTARROW; - break; - case NSRightArrowFunctionKey: - thechar = ASCIIRIGHTARROW; - break; - default: - break; - } + switch (thechar) { + case NSUpArrowFunctionKey: + thechar = ASCIIUPARROW; + break; + case NSDownArrowFunctionKey: + thechar = ASCIIDOWNARROW; + break; + case NSLeftArrowFunctionKey: + thechar = ASCIILEFTARROW; + break; + case NSRightArrowFunctionKey: + thechar = ASCIIRIGHTARROW; + break; + default: + break; + } - if (thechar == NEXT_DELETE) + if (thechar == NEXT_DELETE) thechar = 8; /* back space */ -#endif /* OPENSTEP */ - -#ifndef OPENSTEP - c = neventp->data.key.charCode; -#endif /* not OPENSTEP */ - rep = 0; -#ifndef OPENSTEP - if (c >= DIACREP1START && c < DIACREP1START + sizeof(diacrep1)) - rep = diacrep1[c - DIACREP1START]; - else if (c >= DIACREP2START && c < DIACREP2START + sizeof(diacrep2)) - rep = diacrep2[c - DIACREP2START]; -#else /* OPENSTEP */ - if (thechar >= DIACREP1START && thechar < DIACREP1START + sizeof(diacrep1)) + + rep = 0; + if (thechar >= DIACREP1START && thechar < DIACREP1START + sizeof(diacrep1)) rep = diacrep1[thechar - DIACREP1START]; - else if (thechar >= DIACREP2START && thechar < DIACREP2START + sizeof(diacrep2)) + else if (thechar >= DIACREP2START && thechar < DIACREP2START + sizeof(diacrep2)) rep = diacrep2[thechar - DIACREP2START]; - next_flags = [neventp modifierFlags]; -#endif /* OPENSTEP */ - if (rep) { -#ifndef OPENSTEP - neventp->flags &= ~(NX_SHIFTMASK | NX_CONTROLMASK | NX_ALTERNATEMASK | - NX_COMMANDMASK); -#else /* OPENSTEP */ + next_flags = [neventp modifierFlags]; + if (rep) { next_flags &= ~(NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | - NSCommandKeyMask); -#endif /* OPENSTEP */ + NSCommandKeyMask); charcode = rep; - } else { -#ifndef OPENSTEP - charcode = c; -#else /* OPENSTEP */ + } else { charcode = thechar; -#endif /* OPENSTEP */ - } - keycode = ROMlib_keyboard_type ? -#ifndef OPENSTEP - next_virt_to_mac_virt[ROMlib_keyboard_type-1][neventp->data.key.keyCode] -#else /* OPENSTEP */ - next_virt_to_mac_virt[ROMlib_keyboard_type-1][[neventp keyCode]] -#endif /* OPENSTEP */ - : -#ifndef OPENSTEP - neventp->data.key.keyCode; - macmodifiers = ROMlib_next_butmods_to_mac_butmods(neventp->flags); -#else /* OPENSTEP */ - [neventp keyCode]; - macmodifiers = ROMlib_next_butmods_to_mac_butmods(next_flags); -#endif /* OPENSTEP */ - if ((macmodifiers & optionKey) && (macmodifiers & cmdKey)) - macmodifiers &= ~(cmdKey|optionKey); - *virtp = keycode; - return ROMlib_xlate(keycode & 0xff, macmodifiers, down_p); + } + keycode = ROMlib_keyboard_type ? + next_virt_to_mac_virt[ROMlib_keyboard_type-1][[neventp keyCode]] + : + [neventp keyCode]; + macmodifiers = ROMlib_next_butmods_to_mac_butmods(next_flags); + if ((macmodifiers & optionKey) && (macmodifiers & cmdKey)) + macmodifiers &= ~(cmdKey|optionKey); + *virtp = keycode; + return ROMlib_xlate(keycode & 0xff, macmodifiers, down_p); } #define SANE_DEBUGGING #if defined (SANE_DEBUGGING) -int sane_debugging_on = 0; /* Leave this off and let the person doing the +static int sane_debugging_on = 0; /* Leave this off and let the person doing the debugging turn it on if he/she wants. If this is set to non-zero, it breaks code. Not a very nice thing to do. */ @@ -565,27 +450,15 @@ PRIVATE void pinmouse(INTEGER *hp, INTEGER *vp, BOOLEAN swap) } } -#ifndef OPENSTEP -A1(PUBLIC, void, ROMlib_updatemouselocation, NXEvent *, neventp) /* INTERNAL */ -#else /* OPENSTEP */ A1(PUBLIC, void, ROMlib_updatemouselocation, NSEvent *, neventp) /* INTERNAL */ -#endif /* OPENSTEP */ { -#ifndef OPENSTEP - MouseLocation.h = CW (neventp->location.x); - MouseLocation.v = CW (vdriver_height - neventp->location.y); -#else /* OPENSTEP */ MouseLocation.h = CW ([neventp locationInWindow].x); MouseLocation.v = CW (vdriver_height - [neventp locationInWindow].y); -#endif /* OPENSTEP */ pinmouse(&MouseLocation.h, &MouseLocation.v, TRUE); } -#ifndef OPENSTEP -A1(PUBLIC, void, postnextevent, NXEvent *, neventp) /* INTERNAL */ -#else /* OPENSTEP */ PRIVATE void -getwhere (Point *wherep, NSEvent *event) +getwhere (Executor::Point *wherep, NSEvent *event) { switch ([event type]) { @@ -608,7 +481,6 @@ getwhere (Point *wherep, NSEvent *event) } A1(PUBLIC, void, postnextevent, NSEvent *, neventp) /* INTERNAL */ -#endif /* OPENSTEP */ { LONGINT when; Point where; @@ -617,44 +489,20 @@ A1(PUBLIC, void, postnextevent, NSEvent *, neventp) /* INTERNAL */ unsigned char virt; when = TickCount(); -#ifndef OPENSTEP - butmods = ROMlib_next_butmods_to_mac_butmods(neventp->flags); - where.h = neventp->location.x; - where.v = vdriver_height - neventp->location.y; - pinmouse(&where.h, &where.v, FALSE); -#else /* OPENSTEP */ butmods = ROMlib_next_butmods_to_mac_butmods([neventp modifierFlags]); getwhere (&where, neventp); -#endif /* OPENSTEP */ -#ifndef OPENSTEP - switch (neventp->type) { - case NX_MOUSEDOWN: -#else /* OPENSTEP */ switch ([neventp type]) { case NSLeftMouseDown: case NSRightMouseDown: -#endif /* OPENSTEP */ butmods &= ~btnState; ROMlib_PPostEvent(mouseDown, 0, (HIDDEN_EvQElPtr *) 0, when, where, butmods); break; -#ifndef OPENSTEP - case NX_MOUSEUP: -#else /* OPENSTEP */ case NSLeftMouseUp: case NSRightMouseUp: -#endif /* OPENSTEP */ butmods |= btnState; ROMlib_PPostEvent(mouseUp, 0, (HIDDEN_EvQElPtr *) 0, when, where, butmods); break; -#ifndef OPENSTEP - case NX_KEYDOWN: - if (neventp->data.key.charCode == '\\') { - butmods &= shiftKey; - keywhat = '\\'; - virt = 0x2A; - } else -#else /* OPENSTEP */ case NSKeyDown: #warning some sort of special translation needs to be done here @@ -671,7 +519,6 @@ A1(PUBLIC, void, postnextevent, NSEvent *, neventp) /* INTERNAL */ * will still conceivably need to be done for non-portable apps. */ -#endif /* OPENSTEP */ keywhat = next_keydata_to_mac_keydata(neventp, TRUE, &virt); post_keytrans_key_events (keyDown, keywhat, when, where, butmods, virt); @@ -686,27 +533,20 @@ A1(PUBLIC, void, postnextevent, NSEvent *, neventp) /* INTERNAL */ virt); } break; -#ifndef OPENSTEP - case NX_KEYUP: - if (neventp->data.key.charCode == '\\') { - butmods &= shiftKey; - keywhat = '\\'; - virt = 0x2A; - } else -#else /* OPENSTEP */ case NSKeyUp: #warning some sort of special translation needs to be done here -#endif /* OPENSTEP */ keywhat = next_keydata_to_mac_keydata(neventp, FALSE, &virt); post_keytrans_key_events (keyUp, keywhat, when, where, butmods, virt); break; -#ifdef OPENSTEP default: break; -#endif /* OPENSTEP */ } } +namespace Executor { + static LONGINT addtoop(char*, INTEGER, char**, char); +} + A4(PRIVATE, LONGINT, addtoop, char *, string, INTEGER, size, char **, op, char, doit) { @@ -758,5 +598,3 @@ A2(PUBLIC, LONGINT, insertfonttbl, char **, op, char, doit) retval += addtoop(TABLEEND, sizeof(TABLEEND) - 1, op, doit); return retval; } - -#endif /* defined(NEXT) */ diff --git a/OSX-only/CocoaExecutor/NeXT Classes/NEXTkeyboard.cpp b/OSX-only/CocoaExecutor/NeXT Classes/NEXTkeyboard.cpp new file mode 100644 index 00000000..fe49feff --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/NEXTkeyboard.cpp @@ -0,0 +1,46 @@ +#include "rsys/common.h" +#define Point NeXT_Point +#include "IOKit/hidsystem/IOHIDTypes.h" +#include "IOKit/hidsystem/event_status_driver.h" +#undef Point +#include "rsys/keyboards.h" + +#warning TODO: Update/replace with more modern code! + +using namespace Executor; + +keyboard_enum_t Executor::ROMlib_get_keyboard_type( void ) +{ + NXEventHandle handle; + NXEventSystemDevice dev[NX_EVS_DEVICE_MAX]; + unsigned int cnt, i; + int interface, id; + keyboard_enum_t retval; + + if ( (handle = NXOpenEventStatus()) == 0 ) + return no_keyboard; + cnt = NX_EVS_DEVICE_INFO_COUNT; + NXEventSystemInfo( handle, NX_EVS_DEVICE_INFO, (int *)dev, &cnt ); + NXCloseEventStatus( handle ); + interface = -1; + id = 0; + for (i = 0; i < cnt/(sizeof (NXEventSystemDevice)/sizeof (int)); ++i) { + if ( dev[i].dev_type == NX_EVS_DEVICE_TYPE_KEYBOARD ) { + interface = dev[i].interface; + id = dev[i].id; + break; + } + } + switch (interface) { + default: + retval = default_keyboard; + break; + case NX_EVS_DEVICE_INTERFACE_ADB: + retval = adb_keyboard; + break; + case NX_EVS_DEVICE_INTERFACE_ACE: + retval = pc_keyboard; + break; + } + return retval; +} diff --git a/src/config/front-ends/nextstep/NEXTmain.m b/OSX-only/CocoaExecutor/NeXT Classes/NEXTmain.mm similarity index 67% rename from src/config/front-ends/nextstep/NEXTmain.m rename to OSX-only/CocoaExecutor/NeXT Classes/NEXTmain.mm index c9f7365b..59944193 100644 --- a/src/config/front-ends/nextstep/NEXTmain.m +++ b/OSX-only/CocoaExecutor/NeXT Classes/NEXTmain.mm @@ -2,61 +2,42 @@ #include "MacTypes.h" #include +#include #include #include -#ifndef OPENSTEP -#import -#import -#else /* OPENSTEP */ -#import -#import -#endif /* OPENSTEP */ - +#import #include "rsys/keyboards.h" #include "MemoryMgr.h" -#import -#import - -#if !defined(NX_CURRENT_COMPILER_RELEASE) || \ - (NX_CURRENT_COMPILER_RELEASE < NX_COMPILER_RELEASE_3_0) -#include -#include -#include -#else +//#import +//#import -#if !defined (STRICT_OPENSTEP) #include #include -#endif - -#define _DB_INCLUDED_ /* So they won't include it ... it's not needed - and it only gets in the way */ -#ifndef OPENSTEP -#include -#endif /* not OPENSTEP */ -#endif #import "MacAppClass.h" #include "rsys/next.h" #include "rsys/setuid.h" #include "rsys/blockinterrupts.h" -#include "rsys/syn68k_public.h" +#include #include "ourstuff.h" #include "contextswitch.h" #warning "punt this #include" #include "rsys/memory_layout.h" -char *romlib_sp; -char *nextstep_sp; +using namespace Executor; + +char *Executor::romlib_sp; +char *Executor::nextstep_sp; char ROMlib_040; +extern "C" void ROMlib_dummywincall( void ); + void ROMlib_calldummies( void ) { - extern void ROMlib_dummywincall( void ); SETUPA5; ROMlib_dummywincall(); @@ -70,7 +51,7 @@ void ROMlib_determine040ness( void ) unsigned int count; count=HOST_BASIC_INFO_COUNT; - ret = host_info(host_self(), HOST_BASIC_INFO, (host_info_t)&basic_info, + ret = host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)&basic_info, &count); if (ret != KERN_SUCCESS) mach_error("host_info() call failed", ret); @@ -88,15 +69,7 @@ void ROMlib_checkadb( void ) extern int ROMlib_keyboardisadb( void ); SETUPA5; -#ifndef OPENSTEP - if ([Application version] < NS_3_0_VERSION) - ROMlib_keyboard_type = default_keyboard; - else { - ROMlib_keyboard_type = ROMlib_get_keyboard_type(); - } -#else /* OPENSTEP */ ROMlib_keyboard_type = ROMlib_get_keyboard_type(); -#endif /* OPENSTEP */ RESTOREA5; } @@ -107,13 +80,13 @@ void ROMlib_checkadb( void ) * of things modifies a5 and then you restore a5 afterward... */ -void contextswitch(char **from_spp, char **to_spp) +void Executor::contextswitch(char **from_spp, char **to_spp) { static virtual_int_state_t block; static char blockinitted = FALSE; if (from_spp == &romlib_sp) { - block = block_virtual_ints (); + block = block_virtual_ints(); blockinitted = TRUE; } else if (blockinitted) @@ -136,6 +109,7 @@ void contextswitch(char **from_spp, char **to_spp) "\n\tmoveml sp@+, d2-d7/a2-a6" "\n\trts" "\n\tcont:" : "=m" (*from_spp) : "m" (*to_spp)); +#warning This code is too processor-specific! #elif defined(i386) || defined(i486) asm("pushl $cont\n\t" "pushal\n\t" @@ -163,20 +137,18 @@ void contextswitch(char **from_spp, char **to_spp) "ret\n\t" "cont:" : "=m" (*from_spp) : "m" (*to_spp)); #else - This will not compile +#error This will not compile #endif } +extern int ExecutorArgc; +extern char **ExecutorArgv; + +extern "C" void calloldmain(); + void calloldmain() { -#ifndef OPENSTEP - oldmain(NXArgc, NXArgv); -#else /* OPENSTEP */ - extern int ExecutorArgc; - extern char **ExecutorArgv; - oldmain(ExecutorArgc, ExecutorArgv); -#endif /* OPENSTEP */ exit(-1); /* shouldn't ever get here */ } @@ -186,9 +158,7 @@ void calloldmain() #include -#if !defined (STRICT_OPENSTEP) #include -#endif #include #include @@ -284,61 +254,62 @@ void ROMlib_install_ardi_mods(void) return retval; } - -void nextmain(void) { - long ourstackstart; - kern_return_t err; - vm_address_t addr_we_want; - - addr_we_want = SYS_ZONE_START; - low_memory_start = (char *) addr_we_want; - low_memory_end = low_memory_start + SYS_ZONE_SIZE + APPL_ZONE_SIZE; - - err = vm_allocate (task_self(), &addr_we_want, - (SYS_ZONE_SIZE + APPL_ZONE_SIZE - + MAC_STACK_SIZE + MAGIC_SIZE), - FALSE); - if (err != KERN_SUCCESS) - { - mach_error("vm_allocate returned value of ", err); - exit(1); - } - +void Executor::nextmain(void) +{ + long ourstackstart; + kern_return_t err; + vm_address_t addr_we_want; + + addr_we_want = SYS_ZONE_START; + low_memory_start = (char *) addr_we_want; + low_memory_end = low_memory_start + SYS_ZONE_SIZE + APPL_ZONE_SIZE; + + err = vm_allocate (mach_task_self(), &addr_we_want, + (SYS_ZONE_SIZE + APPL_ZONE_SIZE + + MAC_STACK_SIZE + MAGIC_SIZE), + 0); + if (err != KERN_SUCCESS) + { + fprintf(stderr, "vm_allocate returned value of %s\n", mach_error_string(err)); + exit(1); + } + #if defined(SYN68K) - ourstackstart = NATIVE_STACK_START + NATIVE_STACK_SIZE; + ourstackstart = NATIVE_STACK_START + NATIVE_STACK_SIZE; #else - ourstackstart = MAC_STACK_START + MAC_STACK_SIZE; + ourstackstart = MAC_STACK_START + MAC_STACK_SIZE; #endif - -/* - * ASM NOTE: see the note in in contextswitch - */ - + + /* + * ASM NOTE: see the note in in contextswitch + */ + #if defined(mc68000) - asm(" movel %1, a0" - "\n\tmovel #_calloldmain, a0@-" - "\n\tmoveml d2-d7/a2-a6, a0@-" - "\n\tfmovem fp0-fp7, a0@-" - "\n\tfmovem fpcr/fpsr, a0@-" - "\n\tmovel a0, %0" - : "=g" (romlib_sp) : "g" (ourstackstart) : "a0"); + asm(" movel %1, a0" + "\n\tmovel #_calloldmain, a0@-" + "\n\tmoveml d2-d7/a2-a6, a0@-" + "\n\tfmovem fp0-fp7, a0@-" + "\n\tfmovem fpcr/fpsr, a0@-" + "\n\tmovel a0, %0" + : "=g" (romlib_sp) : "g" (ourstackstart) : "a0"); +#warning This code is too processor-specific! #elif defined(i386) || defined(i486) - asm(" movl %%esp, %%eax" - "\n\tmovl %1, %%esp" - "\n\tpushl $_calloldmain" - "\n\tpushal" - "\n\tpushfl" - "\n\tsubl $108,%%esp" - "\n\tfnsave (%%esp)" - "\n\tpush %%ss" - "\n\tpush %%ds" - "\n\tpush %%es" - "\n\tpush %%fs" - "\n\tpush %%gs" - "\n\tmovl %%esp, %0" - "\n\tmovl %%eax, %%esp" - : "=g" (romlib_sp) : "g" (ourstackstart) : "%eax"); + asm(" movl %%esp, %%eax" + "\n\tmovl %1, %%esp" + "\n\tpushl $_calloldmain" + "\n\tpushal" + "\n\tpushfl" + "\n\tsubl $108,%%esp" + "\n\tfnsave (%%esp)" + "\n\tpush %%ss" + "\n\tpush %%ds" + "\n\tpush %%es" + "\n\tpush %%fs" + "\n\tpush %%gs" + "\n\tmovl %%esp, %0" + "\n\tmovl %%eax, %%esp" + : "=g" (romlib_sp) : "g" (ourstackstart) : "%eax"); #else - This will not compile +#error This will not compile #endif } diff --git a/OSX-only/CocoaExecutor/NeXT Classes/NEXTprint.mm b/OSX-only/CocoaExecutor/NeXT Classes/NEXTprint.mm new file mode 100644 index 00000000..6c4cdbf2 --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/NEXTprint.mm @@ -0,0 +1,70 @@ +#include "rsys/common.h" + +#import + + +#include "rsys/mactype.h" +#include "rsys/nextprint.h" +#include "rsys/blockinterrupts.h" +#include "rsys/next.h" +#include + +#if !defined (OMIT_RCSID_STRINGS) +char ROMlib_rcsid_NEXTprint[] = + "$Id: NEXTprint.m,v 2.5 1997/07/19 01:17:09 ctm Exp $"; +#endif + +/* + * Copyright 1992 by Abacus Research and Development, Inc. + * All rights reserved. + * + */ + +namespace Executor { +void ROMlib_newFont(char *font, float txSize) +{ + [[NSFont fontWithName:[NSString stringWithCString:font encoding:NSMacOSRomanStringEncoding] size:txSize] set]; +} + +void ROMlib_updatenextpagerect(comRect *rp) +{ + NSSize new_paper_size; + virtual_int_state_t block = block_virtual_ints(); + + new_paper_size.height = CW(rp->bottom) - CW(rp->top); + new_paper_size.width = CW(rp->right) - CW(rp->left); + [[NSPrintInfo sharedPrintInfo] setPaperSize:new_paper_size]; + restore_virtual_ints(block); +} + +#define HALFINCH 36 + +static CGFloat printer_scaling_factor (void) +{ + CGFloat retval = [[NSPrintInfo sharedPrintInfo] scalingFactor]; + + return retval; +} + +void ROMlib_updatemacpagerect(comRect *paperp, comRect *page1p, + comRect *page2p) +{ + NSSize new_size; + virtual_int_state_t block = block_virtual_ints(); + CGFloat scaling_factor; + + new_size = [[NSPrintInfo sharedPrintInfo] paperSize]; + paperp->top = CW(0 - HALFINCH); + paperp->left = CW(0 - HALFINCH); + + scaling_factor = printer_scaling_factor (); + paperp->bottom = CW(new_size.height * (1 / scaling_factor) - HALFINCH); + paperp->right = CW(new_size.width * (1 / scaling_factor) - HALFINCH); + + page1p->top = page2p->top = 0; + page1p->left = page2p->left = 0; + page1p->bottom = page2p->bottom = CW(CW(paperp->bottom) - HALFINCH); + page1p->right = page2p->right = CW(CW(paperp->right) - HALFINCH); + restore_virtual_ints(block); +} +} diff --git a/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.cpp b/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.cpp new file mode 100644 index 00000000..ec535080 --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.cpp @@ -0,0 +1,112 @@ +// +// SoundOSX.cpp +// CocoaExecutor +// +// Created by C.W. Betts on 8/2/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#include "SoundOSX.h" + +using namespace Executor; + + +bool SoundOSX::sound_init() +{ + return false; +} + +void SoundOSX::sound_shutdown() +{ + +} + +bool SoundOSX::sound_works() +{ + return false; +} + +bool SoundOSX::sound_silent() +{ + return false; +} + +void SoundOSX::sound_go() +{ + +} + +void SoundOSX::sound_stop() +{ + +} + +void SoundOSX::HungerStart() +{ + +} + +struct hunger_info SoundOSX::GetHungerInfo() +{ + struct hunger_info theHung = {0}; + + return theHung; +} + +void SoundOSX::HungerFinish() +{ + +} + +void SoundOSX::sound_clear_pending() +{ + +} + +syn68k_addr_t SoundOSX::handle_fake_sound_callback (syn68k_addr_t addr, void *ourself) +{ + //SoundOSX* ourSelfUn = (SoundOSX*)ourself; + //if (ourSelfUn->num_fake_buffers_enqueued > 0) + // --ourSelfUn->num_fake_buffers_enqueued; + + //if (!ourSelfUn->no_more_sound_p && ourSelfUn->num_fake_buffers_enqueued > 0) + { + M68kReg saved_regs[16]; + CCRElement saved_ccnz, saved_ccn, saved_ccc, saved_ccv, saved_ccx; + + /* Save the 68k registers and cc bits away. */ + memcpy (saved_regs, &cpu_state.regs, sizeof saved_regs); + saved_ccnz = cpu_state.ccnz; + saved_ccn = cpu_state.ccn; + saved_ccc = cpu_state.ccc; + saved_ccv = cpu_state.ccv; + saved_ccx = cpu_state.ccx; + + //ourSelfUn->set_up_tm_task (); + //ourSelfUn->note_sound_interrupt (); + + memcpy (&cpu_state.regs, saved_regs, sizeof saved_regs); + cpu_state.ccnz = saved_ccnz; + cpu_state.ccn = saved_ccn; + cpu_state.ccc = saved_ccc; + cpu_state.ccv = saved_ccv; + cpu_state.ccx = saved_ccx; + } + + return POPADDR (); +} + +bool SoundOSX::HasSoundClearPending() +{ + return false; +} + +void Executor::ROMlib_callcompletion( void *chanp ) +{ + +} + +void Executor::ROMlib_outbuffer( char *buf, LONGINT nsamples, LONGINT rate, void *chanp) +{ + +} diff --git a/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h b/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h new file mode 100644 index 00000000..05c61187 --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h @@ -0,0 +1,42 @@ +// +// SoundOSX.h +// CocoaExecutor +// +// Created by C.W. Betts on 8/2/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#ifndef __CocoaExecutor__SoundOSX__ +#define __CocoaExecutor__SoundOSX__ + +#include +#include + +#include "rsys/common.h" +#include "rsys/sounddriver.h" + +namespace Executor { + class SoundOSX : SoundDriver { + public: + virtual bool sound_init(); + virtual void sound_shutdown(); + virtual bool sound_works(); + virtual bool sound_silent(); + virtual void sound_go(); + virtual void sound_stop(); + virtual void HungerStart(); + virtual struct hunger_info GetHungerInfo(); + virtual void HungerFinish(); + virtual void sound_clear_pending(); + virtual bool HasSoundClearPending(); + + private: + AudioUnit AudioUnit; + size_t BufferOffset; + char *Buffer; + static syn68k_addr_t handle_fake_sound_callback (syn68k_addr_t addr, void *ourself); + + }; +} + +#endif /* defined(__CocoaExecutor__SoundOSX__) */ diff --git a/src/config/front-ends/nextstep/blockinterrupts.m b/OSX-only/CocoaExecutor/NeXT Classes/blockinterrupts.mm similarity index 97% rename from src/config/front-ends/nextstep/blockinterrupts.m rename to OSX-only/CocoaExecutor/NeXT Classes/blockinterrupts.mm index d5e58db9..5166514a 100644 --- a/src/config/front-ends/nextstep/blockinterrupts.m +++ b/OSX-only/CocoaExecutor/NeXT Classes/blockinterrupts.mm @@ -1,6 +1,8 @@ #include "rsys/common.h" #include "rsys/mactype.h" -#include +#include +#include +#include #include #include #include diff --git a/src/config/front-ends/nextstep/contextswitch.h b/OSX-only/CocoaExecutor/NeXT Classes/contextswitch.h similarity index 90% rename from src/config/front-ends/nextstep/contextswitch.h rename to OSX-only/CocoaExecutor/NeXT Classes/contextswitch.h index 029d5a80..2a791c82 100644 --- a/src/config/front-ends/nextstep/contextswitch.h +++ b/OSX-only/CocoaExecutor/NeXT Classes/contextswitch.h @@ -1,10 +1,12 @@ #if !defined (_CONTEXTSWITCH_H_) #define _CONTEXTSWITCH_H_ +namespace Executor { extern char *romlib_sp, *nextstep_sp; extern void contextswitch( char **from_spp, char **to_spp ); extern long ROMlib_printtimeout; +} #endif /* !_CONTEXTSWITCH_H_ */ diff --git a/OSX-only/CocoaExecutor/NeXT Classes/en.lproj/Credits.rtf b/OSX-only/CocoaExecutor/NeXT Classes/en.lproj/Credits.rtf new file mode 100644 index 00000000..46576ef2 --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/en.lproj/Credits.rtf @@ -0,0 +1,29 @@ +{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw9840\paperh8400 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs24 \cf0 Engineering: +\b0 \ + Some people\ +\ + +\b Human Interface Design: +\b0 \ + Some other people\ +\ + +\b Testing: +\b0 \ + Hopefully not nobody\ +\ + +\b Documentation: +\b0 \ + Whoever\ +\ + +\b With special thanks to: +\b0 \ + Mom\ +} diff --git a/OSX-only/CocoaExecutor/NeXT Classes/en.lproj/Executor.strings b/OSX-only/CocoaExecutor/NeXT Classes/en.lproj/Executor.strings new file mode 100644 index 00000000..3532dc64 --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/en.lproj/Executor.strings @@ -0,0 +1,438 @@ + +/* Class = "NSMenu"; title = "OtherViews"; ObjectID = "7"; */ +"7.title" = "OtherViews"; + +/* Class = "NSFormCell"; title = "Version Number:"; ObjectID = "10"; */ +"10.title" = "Version Number:"; + +/* Class = "NSBox"; title = "Information About the Problem"; ObjectID = "12"; */ +"12.title" = "Information About the Problem"; + +/* Class = "NSBox"; title = "Title"; ObjectID = "16"; */ +"16.title" = "Title"; + +/* Class = "NSMenuItem"; title = "App Crash/Hang"; ObjectID = "21"; */ +"21.title" = "App Crash/Hang"; + +/* Class = "NSPanel"; title = "Send Problem Report to ARDI"; ObjectID = "24"; */ +"24.title" = "Send Problem Report to ARDI"; + +/* Class = "NSMenuItem"; title = "Avoidable Bug"; ObjectID = "25"; */ +"25.title" = "Avoidable Bug"; + +/* Class = "NSFormCell"; title = "Application Name:"; ObjectID = "28"; */ +"28.title" = "Application Name:"; + +/* Class = "NSBox"; title = "Software With Problems Under Executor"; ObjectID = "31"; */ +"31.title" = "Software With Problems Under Executor"; + +/* Class = "NSPanel"; title = "Unexpected Signal"; ObjectID = "37"; */ +"37.title" = "Unexpected Signal"; + +/* Class = "NSMenuItem"; title = "Unavoidable Bug"; ObjectID = "41"; */ +"41.title" = "Unavoidable Bug"; + +/* Class = "NSMenuItem"; title = "Software"; ObjectID = "44"; */ +"44.title" = "Software"; + +/* Class = "NSMenuItem"; title = "Annoyance"; ObjectID = "45"; */ +"45.title" = "Annoyance"; + +/* Class = "NSMenu"; title = "OtherViews"; ObjectID = "48"; */ +"48.title" = "OtherViews"; + +/* Class = "NSFormCell"; stringValue = "maddthesane@gmail.com"; ObjectID = "49"; */ +"49.stringValue" = "maddthesane@gmail.com"; + +/* Class = "NSFormCell"; title = "Bug Report Address:"; ObjectID = "49"; */ +"49.title" = "Bug Report Address:"; + +/* Class = "NSMenuItem"; title = "Suggestion"; ObjectID = "51"; */ +"51.title" = "Suggestion"; + +/* Class = "NSMenuItem"; title = "System Crash/Hang"; ObjectID = "54"; */ +"54.title" = "System Crash/Hang"; + +/* Class = "MacWindow"; title = "Executor"; ObjectID = "57"; */ +"57.title" = "Executor"; + +/* Class = "NSMenuItem"; title = "Unknown"; ObjectID = "63"; */ +"63.title" = "Unknown"; + +/* Class = "NSMenuItem"; title = "Documentation"; ObjectID = "66"; */ +"66.title" = "Documentation"; + +/* Class = "NSFormCell"; title = "Synopsis:"; ObjectID = "67"; */ +"67.title" = "Synopsis:"; + +/* Class = "NSBox"; title = "Death Certificate"; ObjectID = "71"; */ +"71.title" = "Death Certificate"; + +/* Class = "NSMenuItem"; title = "Logged Out"; ObjectID = "73"; */ +"73.title" = "Logged Out"; + +/* Class = "NSButtonCell"; title = "Cancel"; ObjectID = "101"; */ +"101.title" = "Cancel"; + +/* Class = "NSTextFieldCell"; title = "Severity:"; ObjectID = "103"; */ +"103.title" = "Severity:"; + +/* Class = "NSTextFieldCell"; title = "Class: "; ObjectID = "105"; */ +"105.title" = "Class: "; + +/* Class = "NSButtonCell"; title = "Send"; ObjectID = "106"; */ +"106.title" = "Send"; + +/* Class = "NSTextFieldCell"; title = "PSL = 0x12345678"; ObjectID = "109"; */ +"109.title" = "PSL = 0x12345678"; + +/* Class = "NSTextFieldCell"; title = "deb = 0x12345678"; ObjectID = "110"; */ +"110.title" = "deb = 0x12345678"; + +/* Class = "NSTextFieldCell"; title = " D0 = 0x12345678"; ObjectID = "111"; */ +"111.title" = " D0 = 0x12345678"; + +/* Class = "NSTextFieldCell"; title = " PC = 0x12345678"; ObjectID = "112"; */ +"112.title" = " PC = 0x12345678"; + +/* Class = "NSTextFieldCell"; title = " SP = 0x12345678"; ObjectID = "113"; */ +"113.title" = " SP = 0x12345678"; + +/* Class = "NSTextFieldCell"; title = "Executor has died. There is no chance for recovery. You can still print a screen-dump."; ObjectID = "114"; */ +"114.title" = "Executor has died. There is no chance for recovery. You can still print a screen-dump."; + +/* Class = "NSTextFieldCell"; title = "*PC = 0x12345678"; ObjectID = "115"; */ +"115.title" = "*PC = 0x12345678"; + +/* Class = "NSTextFieldCell"; title = "Comments1\n2\n3\n4\n5"; ObjectID = "116"; */ +"116.title" = "Comments1\n2\n3\n4\n5"; + +/* Class = "NSTextFieldCell"; title = "SIG = 0x12345678"; ObjectID = "117"; */ +"117.title" = "SIG = 0x12345678"; + +/* Class = "NSTextFieldCell"; title = "A123, A123, A123\nA123, A123, A123\nA123, A123, A123\nA123, A123, A123\nA123, A123, A123\nA123, A123, A123\nA123, A123, A123\nA123, A123, A123"; ObjectID = "118"; */ +"118.title" = "A123, A123, A123\nA123, A123, A123\nA123, A123, A123\nA123, A123, A123\nA123, A123, A123\nA123, A123, A123\nA123, A123, A123\nA123, A123, A123"; + +/* Class = "NSTextFieldCell"; title = "*SP = 0x12345678"; ObjectID = "119"; */ +"119.title" = "*SP = 0x12345678"; + +/* Class = "NSFormCell"; title = "Field:"; ObjectID = "120"; */ +"120.title" = "Field:"; + +/* Class = "NSFormCell"; title = "Field:"; ObjectID = "121"; */ +"121.title" = "Field:"; + +/* Class = "NSFormCell"; title = "Field:"; ObjectID = "122"; */ +"122.title" = "Field:"; + +/* Class = "NSMenuItem"; title = "Paragraph"; ObjectID = "0TP-DO-dSS"; */ +"0TP-DO-dSS.title" = "Paragraph"; + +/* Class = "NSMenuItem"; title = "\tLeft to Right"; ObjectID = "0rJ-tf-8cB"; */ +"0rJ-tf-8cB.title" = "\tLeft to Right"; + +/* Class = "NSMenuItem"; title = "Abort"; ObjectID = "1ex-Rz-Gp1"; */ +"1ex-Rz-Gp1.title" = "Abort"; + +/* Class = "NSMenu"; title = "File"; ObjectID = "1vL-FU-rql"; */ +"1vL-FU-rql.title" = "File"; + +/* Class = "NSMenu"; title = "Baseline"; ObjectID = "2MN-we-BJT"; */ +"2MN-we-BJT.title" = "Baseline"; + +/* Class = "NSMenu"; title = "Open Recent"; ObjectID = "33Z-D2-QZj"; */ +"33Z-D2-QZj.title" = "Open Recent"; + +/* Class = "NSMenuItem"; title = "Minimize"; ObjectID = "3Hd-cD-FU6"; */ +"3Hd-cD-FU6.title" = "Minimize"; + +/* Class = "NSMenuItem"; title = "Jump to Selection"; ObjectID = "3un-A6-bYC"; */ +"3un-A6-bYC.title" = "Jump to Selection"; + +/* Class = "NSMenuItem"; title = "Help"; ObjectID = "4Rj-2q-JGZ"; */ +"4Rj-2q-JGZ.title" = "Help"; + +/* Class = "NSMenuItem"; title = "Show Fonts"; ObjectID = "50R-D7-gX7"; */ +"50R-D7-gX7.title" = "Show Fonts"; + +/* Class = "NSMenuItem"; title = "Show Toolbar"; ObjectID = "59l-dH-K0U"; */ +"59l-dH-K0U.title" = "Show Toolbar"; + +/* Class = "NSMenuItem"; title = "Cut"; ObjectID = "5RZ-1f-7K7"; */ +"5RZ-1f-7K7.title" = "Cut"; + +/* Class = "NSMenuItem"; title = "Baseline"; ObjectID = "5ch-7p-XQf"; */ +"5ch-7p-XQf.title" = "Baseline"; + +/* Class = "NSMenuItem"; title = "Paste Ruler"; ObjectID = "5ye-5U-YT3"; */ +"5ye-5U-YT3.title" = "Paste Ruler"; + +/* Class = "NSMenuItem"; title = "\tRight to Left"; ObjectID = "6Mi-3c-CAk"; */ +"6Mi-3c-CAk.title" = "\tRight to Left"; + +/* Class = "NSMenu"; title = "Main Menu"; ObjectID = "6Rd-cm-XHP"; */ +"6Rd-cm-XHP.title" = "Main Menu"; + +/* Class = "NSMenuItem"; title = "View"; ObjectID = "7OX-rt-eQ9"; */ +"7OX-rt-eQ9.title" = "View"; + +/* Class = "NSMenu"; title = "Writing Direction"; ObjectID = "7r4-ug-iVi"; */ +"7r4-ug-iVi.title" = "Writing Direction"; + +/* Class = "NSMenu"; title = "Services"; ObjectID = "8Hg-J2-GFx"; */ +"8Hg-J2-GFx.title" = "Services"; + +/* Class = "NSMenuItem"; title = "Quit CocoaExecutor"; ObjectID = "8I8-DG-XD0"; */ +"8I8-DG-XD0.title" = "Quit CocoaExecutor"; + +/* Class = "NSMenuItem"; title = "CocoaExecutor"; ObjectID = "8Nr-h2-P12"; */ +"8Nr-h2-P12.title" = "CocoaExecutor"; + +/* Class = "NSMenuItem"; title = "Superscript"; ObjectID = "8dY-8H-Xx8"; */ +"8dY-8H-Xx8.title" = "Superscript"; + +/* Class = "NSMenuItem"; title = "Bigger"; ObjectID = "8oH-Ld-sok"; */ +"8oH-Ld-sok.title" = "Bigger"; + +/* Class = "NSMenuItem"; title = "Subscript"; ObjectID = "Aeh-9T-9zs"; */ +"Aeh-9T-9zs.title" = "Subscript"; + +/* Class = "NSMenuItem"; title = "Bring All to Front"; ObjectID = "Ank-E5-i4L"; */ +"Ank-E5-i4L.title" = "Bring All to Front"; + +/* Class = "NSBox"; title = "Box"; ObjectID = "B5k-iH-SvX"; */ +"B5k-iH-SvX.title" = "Box"; + +/* Class = "NSMenuItem"; title = "Undo"; ObjectID = "CN0-bL-m8d"; */ +"CN0-bL-m8d.title" = "Undo"; + +/* Class = "NSMenuItem"; title = "Bold"; ObjectID = "D2U-yM-e5V"; */ +"D2U-yM-e5V.title" = "Bold"; + +/* Class = "NSMenuItem"; title = "Font"; ObjectID = "D9a-yp-m2j"; */ +"D9a-yp-m2j.title" = "Font"; + +/* Class = "NSMenu"; title = "Ligatures"; ObjectID = "DF6-4r-KUX"; */ +"DF6-4r-KUX.title" = "Ligatures"; + +/* Class = "NSMenuItem"; title = "Align Right"; ObjectID = "ETz-3m-G2u"; */ +"ETz-3m-G2u.title" = "Align Right"; + +/* Class = "NSMenuItem"; title = "Use None"; ObjectID = "FUL-wy-uQl"; */ +"FUL-wy-uQl.title" = "Use None"; + +/* Class = "NSMenu"; title = "Edit"; ObjectID = "GpM-oP-DKk"; */ +"GpM-oP-DKk.title" = "Edit"; + +/* Class = "NSMenuItem"; title = "Smaller"; ObjectID = "IMM-Kb-CXs"; */ +"IMM-Kb-CXs.title" = "Smaller"; + +/* Class = "NSMenuItem"; title = "Open Recent"; ObjectID = "Irv-ne-onz"; */ +"Irv-ne-onz.title" = "Open Recent"; + +/* Class = "NSBox"; title = "Box"; ObjectID = "J7c-Qg-V3r"; */ +"J7c-Qg-V3r.title" = "Box"; + +/* Class = "NSMenuItem"; title = "Redo"; ObjectID = "JlG-To-U4B"; */ +"JlG-To-U4B.title" = "Redo"; + +/* Class = "NSMenuItem"; title = "Open…"; ObjectID = "KOn-gn-nFY"; */ +"KOn-gn-nFY.title" = "Open…"; + +/* Class = "NSMenu"; title = "Window"; ObjectID = "KZe-Hv-t3G"; */ +"KZe-Hv-t3G.title" = "Window"; + +/* Class = "NSMenuItem"; title = "Kern"; ObjectID = "LOa-NJ-gIe"; */ +"LOa-NJ-gIe.title" = "Kern"; + +/* Class = "NSMenuItem"; title = "Copy"; ObjectID = "LsL-hN-ScR"; */ +"LsL-hN-ScR.title" = "Copy"; + +/* Class = "NSMenuItem"; title = "Selection"; ObjectID = "NUf-7y-rdP"; */ +"NUf-7y-rdP.title" = "Selection"; + +/* Class = "NSMenuItem"; title = "Align Left"; ObjectID = "Ne6-zV-Iqw"; */ +"Ne6-zV-Iqw.title" = "Align Left"; + +/* Class = "NSMenuItem"; title = "Find"; ObjectID = "O9t-dk-106"; */ +"O9t-dk-106.title" = "Find"; + +/* Class = "NSMenu"; title = "Text"; ObjectID = "Pgc-c1-jj0"; */ +"Pgc-c1-jj0.title" = "Text"; + +/* Class = "NSMenuItem"; title = "Show Ruler"; ObjectID = "Q6P-YY-UbY"; */ +"Q6P-YY-UbY.title" = "Show Ruler"; + +/* Class = "NSMenuItem"; title = "Tighten"; ObjectID = "QJh-V2-0fa"; */ +"QJh-V2-0fa.title" = "Tighten"; + +/* Class = "NSMenuItem"; title = "Center"; ObjectID = "QO0-QB-sUZ"; */ +"QO0-QB-sUZ.title" = "Center"; + +/* Class = "NSMenu"; title = "View"; ObjectID = "S5D-PS-gTE"; */ +"S5D-PS-gTE.title" = "View"; + +/* Class = "NSMenuItem"; title = "Use Default"; ObjectID = "SAr-GI-hrj"; */ +"SAr-GI-hrj.title" = "Use Default"; + +/* Class = "NSMenuItem"; title = "File"; ObjectID = "SaY-i9-N7C"; */ +"SaY-i9-N7C.title" = "File"; + +/* Class = "NSMenuItem"; title = "Delete"; ObjectID = "TU0-F9-dAW"; */ +"TU0-F9-dAW.title" = "Delete"; + +/* Class = "NSMenuItem"; title = "Find Next"; ObjectID = "U2f-lA-Vbw"; */ +"U2f-lA-Vbw.title" = "Find Next"; + +/* Class = "NSMenuItem"; title = "Use Selection for Find"; ObjectID = "VOl-ip-WvA"; */ +"VOl-ip-WvA.title" = "Use Selection for Find"; + +/* Class = "NSMenuItem"; title = "Paste and Match Style"; ObjectID = "VzM-Uv-gEu"; */ +"VzM-Uv-gEu.title" = "Paste and Match Style"; + +/* Class = "NSMenuItem"; title = "Paste"; ObjectID = "WM2-1Q-XEm"; */ +"WM2-1Q-XEm.title" = "Paste"; + +/* Class = "NSMenuItem"; title = "Use Default"; ObjectID = "Wd3-Ss-Rh2"; */ +"Wd3-Ss-Rh2.title" = "Use Default"; + +/* Class = "NSMenuItem"; title = "Paste Style"; ObjectID = "XZj-10-7EW"; */ +"XZj-10-7EW.title" = "Paste Style"; + +/* Class = "NSMenuItem"; title = "Use None"; ObjectID = "YA2-2l-2nx"; */ +"YA2-2l-2nx.title" = "Use None"; + +/* Class = "NSMenuItem"; title = "Raise"; ObjectID = "YBd-Gq-kzy"; */ +"YBd-Gq-kzy.title" = "Raise"; + +/* Class = "NSMenuItem"; title = "\tLeft to Right"; ObjectID = "aIv-Gd-Cws"; */ +"aIv-Gd-Cws.title" = "\tLeft to Right"; + +/* Class = "NSMenuItem"; title = "\tDefault"; ObjectID = "aj0-S2-CxZ"; */ +"aj0-S2-CxZ.title" = "\tDefault"; + +/* Class = "NSMenuItem"; title = "Copy Ruler"; ObjectID = "an4-Gn-zkz"; */ +"an4-Gn-zkz.title" = "Copy Ruler"; + +/* Class = "NSMenuItem"; title = "\tRight to Left"; ObjectID = "avg-Ff-Q7i"; */ +"avg-Ff-Q7i.title" = "\tRight to Left"; + +/* Class = "NSMenuItem"; title = "Show All"; ObjectID = "b00-W9-V6f"; */ +"b00-W9-V6f.title" = "Show All"; + +/* Class = "NSMenuItem"; title = "Page Setup…"; ObjectID = "bA1-wI-f5I"; */ +"bA1-wI-f5I.title" = "Page Setup…"; + +/* Class = "NSMenuItem"; title = "Find…"; ObjectID = "bGP-1o-Zng"; */ +"bGP-1o-Zng.title" = "Find…"; + +/* Class = "NSMenuItem"; title = "Lower"; ObjectID = "ceu-hJ-SqU"; */ +"ceu-hJ-SqU.title" = "Lower"; + +/* Class = "NSMenuItem"; title = "Select All"; ObjectID = "dEy-fn-BVZ"; */ +"dEy-fn-BVZ.title" = "Select All"; + +/* Class = "NSMenuItem"; title = "Text"; ObjectID = "dU3-2B-FHq"; */ +"dU3-2B-FHq.title" = "Text"; + +/* Class = "NSMenuItem"; title = "Justify"; ObjectID = "dbe-ry-00K"; */ +"dbe-ry-00K.title" = "Justify"; + +/* Class = "NSMenuItem"; title = "Zoom"; ObjectID = "dfq-Lq-qGg"; */ +"dfq-Lq-qGg.title" = "Zoom"; + +/* Class = "NSMenuItem"; title = "\tDefault"; ObjectID = "fMt-fB-B8h"; */ +"fMt-fB-B8h.title" = "\tDefault"; + +/* Class = "NSMenuItem"; title = "Find and Replace…"; ObjectID = "gU3-pO-lGy"; */ +"gU3-pO-lGy.title" = "Find and Replace…"; + +/* Class = "NSMenuItem"; title = "Copy Style"; ObjectID = "gqM-gs-dQc"; */ +"gqM-gs-dQc.title" = "Copy Style"; + +/* Class = "NSMenuItem"; title = "Format"; ObjectID = "h80-nm-fdq"; */ +"h80-nm-fdq.title" = "Format"; + +/* Class = "NSMenuItem"; title = "Spelling and Grammar"; ObjectID = "hzk-NN-Q0K"; */ +"hzk-NN-Q0K.title" = "Spelling and Grammar"; + +/* Class = "NSMenuItem"; title = "CocoaExecutor Help"; ObjectID = "iKq-69-BvS"; */ +"iKq-69-BvS.title" = "CocoaExecutor Help"; + +/* Class = "NSMenuItem"; title = "About CocoaExecutor"; ObjectID = "j2d-0R-4TY"; */ +"j2d-0R-4TY.title" = "About CocoaExecutor"; + +/* Class = "NSMenu"; title = "Kern"; ObjectID = "jPu-gU-p0v"; */ +"jPu-gU-p0v.title" = "Kern"; + +/* Class = "NSMenu"; title = "Format"; ObjectID = "kDm-aK-oMb"; */ +"kDm-aK-oMb.title" = "Format"; + +/* Class = "NSMenuItem"; title = "Services"; ObjectID = "l2x-DS-zeF"; */ +"l2x-DS-zeF.title" = "Services"; + +/* Class = "NSMenuItem"; title = "Customize Toolbar…"; ObjectID = "n4U-Jh-ngc"; */ +"n4U-Jh-ngc.title" = "Customize Toolbar…"; + +/* Class = "NSMenuItem"; title = "Edit"; ObjectID = "nHD-xv-cFl"; */ +"nHD-xv-cFl.title" = "Edit"; + +/* Class = "NSMenu"; title = "Help"; ObjectID = "nJh-cg-CSj"; */ +"nJh-cg-CSj.title" = "Help"; + +/* Class = "NSMenuItem"; title = "Use Default"; ObjectID = "nNs-Yb-7Ca"; */ +"nNs-Yb-7Ca.title" = "Use Default"; + +/* Class = "NSMenu"; title = "CocoaExecutor"; ObjectID = "nV5-S2-83F"; */ +"nV5-S2-83F.title" = "CocoaExecutor"; + +/* Class = "NSMenuItem"; title = "Show Colors"; ObjectID = "ouc-iz-9lj"; */ +"ouc-iz-9lj.title" = "Show Colors"; + +/* Class = "NSMenuItem"; title = "Pause"; ObjectID = "p3e-V7-GGE"; */ +"p3e-V7-GGE.title" = "Pause"; + +/* Class = "NSMenuItem"; title = "Print…"; ObjectID = "rdg-I7-9o5"; */ +"rdg-I7-9o5.title" = "Print…"; + +/* Class = "NSMenuItem"; title = "Find Previous"; ObjectID = "rx4-dl-yCF"; */ +"rx4-dl-yCF.title" = "Find Previous"; + +/* Class = "NSMenuItem"; title = "Window"; ObjectID = "sD3-5v-bfE"; */ +"sD3-5v-bfE.title" = "Window"; + +/* Class = "NSMenuItem"; title = "Italic"; ObjectID = "sIf-yg-aGc"; */ +"sIf-yg-aGc.title" = "Italic"; + +/* Class = "NSMenuItem"; title = "Ligatures"; ObjectID = "sTP-9k-Res"; */ +"sTP-9k-Res.title" = "Ligatures"; + +/* Class = "NSMenuItem"; title = "Preferences…"; ObjectID = "uXh-dB-7Mc"; */ +"uXh-dB-7Mc.title" = "Preferences…"; + +/* Class = "NSMenuItem"; title = "Clear Menu"; ObjectID = "v29-jK-sGc"; */ +"v29-jK-sGc.title" = "Clear Menu"; + +/* Class = "NSMenuItem"; title = "Loosen"; ObjectID = "vEr-ze-Am7"; */ +"vEr-ze-Am7.title" = "Loosen"; + +/* Class = "NSMenuItem"; title = "Underline"; ObjectID = "vHF-6c-TBx"; */ +"vHF-6c-TBx.title" = "Underline"; + +/* Class = "NSMenu"; title = "Font"; ObjectID = "vWW-gl-6SW"; */ +"vWW-gl-6SW.title" = "Font"; + +/* Class = "NSMenuItem"; title = "Use All"; ObjectID = "vqm-3d-c5b"; */ +"vqm-3d-c5b.title" = "Use All"; + +/* Class = "NSMenuItem"; title = "Hide CocoaExecutor"; ObjectID = "wfY-fT-S1r"; */ +"wfY-fT-S1r.title" = "Hide CocoaExecutor"; + +/* Class = "NSMenu"; title = "Find"; ObjectID = "yeo-RB-BfW"; */ +"yeo-RB-BfW.title" = "Find"; + +/* Class = "NSMenuItem"; title = "Writing Direction"; ObjectID = "yk4-57-YJu"; */ +"yk4-57-YJu.title" = "Writing Direction"; + +/* Class = "NSMenuItem"; title = "Hide Others"; ObjectID = "zSI-89-8YE"; */ +"zSI-89-8YE.title" = "Hide Others"; diff --git a/OSX-only/CocoaExecutor/NeXT Classes/en.lproj/InfoPlist.strings b/OSX-only/CocoaExecutor/NeXT Classes/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..477b28ff --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/OSX-only/CocoaExecutor/NeXT Classes/en.lproj/info.strings b/OSX-only/CocoaExecutor/NeXT Classes/en.lproj/info.strings new file mode 100644 index 00000000..562d597e --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/en.lproj/info.strings @@ -0,0 +1,36 @@ + +/* Class = "NSPanel"; title = "Executor Info"; ObjectID = "13"; */ +"13.title" = "Executor Info"; + +/* Class = "NSTextFieldCell"; title = "Trademarks"; ObjectID = "19"; */ +"19.title" = "Trademarks"; + +/* Class = "NSTextFieldCell"; title = "Self Explanatory: bugs@ardi.com, suggestions@ardi.com, questions@ardi.com\n\nSend a request here to join an Executor users mailing list: executor-request@nacm.com"; ObjectID = "20"; */ +"20.title" = "Self Explanatory: bugs@ardi.com, suggestions@ardi.com, questions@ardi.com\n\nSend a request here to join an Executor users mailing list: executor-request@nacm.com"; + +/* Class = "NSTextFieldCell"; title = "Limitations in this release:\n\tNo Sound\n\tLimited System 7\n\tNo AppleTalk\n\tNo Script Manager (i.e. No International Localization)"; ObjectID = "21"; */ +"21.title" = "Limitations in this release:\n\tNo Sound\n\tLimited System 7\n\tNo AppleTalk\n\tNo Script Manager (i.e. No International Localization)"; + +/* Class = "NSTextFieldCell"; title = "Apple, Macintosh and AppleTalk are registered trademarks of Apple Computer, Inc.\nROMlib and Executor are registered trademarks of Abacus Research and Development, Inc."; ObjectID = "22"; */ +"22.title" = "Apple, Macintosh and AppleTalk are registered trademarks of Apple Computer, Inc.\nROMlib and Executor are registered trademarks of Abacus Research and Development, Inc."; + +/* Class = "NSTextFieldCell"; title = "Copyright 1991 - 1995 by\t\tARDI\n\t\t\t\t\t\t\tSuite 4-101\n\t\t\t\t\t\t\t1650 University Blvd., NE\n\t\t\t\t\t\t\tAlbuquerque, NM 87102 \n\t\t\t\t\t\t\t\n+1 505 766 9115 Phone \t\t\t+1 505 247 1899 FAX\n\nftp://ftp.ardi.com\t\thttp://www.ardi.com"; ObjectID = "23"; */ +"23.title" = "Copyright 1991 - 1995 by\t\tARDI\n\t\t\t\t\t\t\tSuite 4-101\n\t\t\t\t\t\t\t1650 University Blvd., NE\n\t\t\t\t\t\t\tAlbuquerque, NM 87102 \n\t\t\t\t\t\t\t\n+1 505 766 9115 Phone \t\t\t+1 505 247 1899 FAX\n\nftp://ftp.ardi.com\t\thttp://www.ardi.com"; + +/* Class = "NSTextFieldCell"; title = "E-mail Addresses"; ObjectID = "24"; */ +"24.title" = "E-mail Addresses"; + +/* Class = "NSTextFieldCell"; title = "Limitations"; ObjectID = "25"; */ +"25.title" = "Limitations"; + +/* Class = "NSBox"; title = "Box"; ObjectID = "J5b-Fj-1m8"; */ +"J5b-Fj-1m8.title" = "Box"; + +/* Class = "NSBox"; title = "Box"; ObjectID = "RM7-un-kVu"; */ +"RM7-un-kVu.title" = "Box"; + +/* Class = "NSTextFieldCell"; title = "Label"; ObjectID = "Zjh-mp-LhE"; */ +"Zjh-mp-LhE.title" = "Label"; + +/* Class = "NSBox"; title = "Box"; ObjectID = "lzs-Ts-eaJ"; */ +"lzs-Ts-eaJ.title" = "Box"; diff --git a/src/config/front-ends/nextstep/host_bltmacros.h b/OSX-only/CocoaExecutor/NeXT Classes/host_bltmacros.h similarity index 100% rename from src/config/front-ends/nextstep/host_bltmacros.h rename to OSX-only/CocoaExecutor/NeXT Classes/host_bltmacros.h diff --git a/src/config/front-ends/nextstep/host_vdriver.h b/OSX-only/CocoaExecutor/NeXT Classes/host_vdriver.h similarity index 80% rename from src/config/front-ends/nextstep/host_vdriver.h rename to OSX-only/CocoaExecutor/NeXT Classes/host_vdriver.h index 051b10c9..91acd1fd 100644 --- a/src/config/front-ends/nextstep/host_vdriver.h +++ b/OSX-only/CocoaExecutor/NeXT Classes/host_vdriver.h @@ -1,3 +1,6 @@ + +#ifndef __NEXT_HOST_VDRIVER_H_ +#define __NEXT_HOST_VDRIVER_H_ #define vdriver_system_busy 0 #define VDRIVER_DISPLAYED_IN_WINDOW @@ -13,7 +16,9 @@ typedef VDRIVER_MODE_LIST_TYPE (2) vdriver_nextstep_mode_t; #define VDRIVER_DIRTY_RECT_BYTE_ALIGNMENT 4 /* Align to long boundaries. */ -extern vdriver_nextstep_mode_t vdriver_nextstep_modes; +extern "C" vdriver_nextstep_mode_t vdriver_nextstep_modes; #define vdriver_mode_list \ ((const vdriver_modes_t *) &vdriver_nextstep_modes) + +#endif diff --git a/OSX-only/CocoaExecutor/NeXT Classes/nextstep.h b/OSX-only/CocoaExecutor/NeXT Classes/nextstep.h new file mode 100644 index 00000000..56ceae5f --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/nextstep.h @@ -0,0 +1,3 @@ +#if !defined (MACOSX_) +# define MACOSX_ +#endif diff --git a/OSX-only/CocoaExecutor/NeXT Classes/ourstuff.h b/OSX-only/CocoaExecutor/NeXT Classes/ourstuff.h new file mode 100644 index 00000000..d80e7b38 --- /dev/null +++ b/OSX-only/CocoaExecutor/NeXT Classes/ourstuff.h @@ -0,0 +1,35 @@ +#if !defined (_OURSTUFF_H_) + +#import +#include + +#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101000 +typedef NSUInteger NSEventModifierFlags; +#endif + +namespace Executor { +extern void sendresumeevent(LONGINT cvtclip); +extern void sendsuspendevent(void); +extern void ROMlib_writenameorgkey(char *name, char *org, char *key); +extern void contextswitch(char **from_spp, char **to_spp); +extern LONGINT insertfonttbl(char **op, char doit); + +extern INTEGER ROMlib_next_butmods_to_mac_butmods (NSEventModifierFlags nextflags); +extern void postnextevent(NSEvent * neventp); +extern void ROMlib_updatemouselocation(NSEvent * neventp); + +extern void sendpaste(void); +extern void sendcopy(void); +extern void oldmain(int argc, char **argv); +extern void convertchars(char *data, long length, const unsigned char *table); +extern void nextmain(void); + +#if defined (__OBJC__) +extern NSMenu *global_menu; +extern NSCursor *realcursor, *blankcursor; +extern NSPasteboard *ROMlib_pasteboard; +#endif +} +extern NSInteger ROMlib_ourchangecount; + +#endif /* _OURSTUFF_H_ */ diff --git a/OSX-only/CocoaExecutor/build-arch-config.h b/OSX-only/CocoaExecutor/build-arch-config.h new file mode 120000 index 00000000..a071d370 --- /dev/null +++ b/OSX-only/CocoaExecutor/build-arch-config.h @@ -0,0 +1 @@ +host-arch-config.h \ No newline at end of file diff --git a/OSX-only/CocoaExecutor/build-os-config.h b/OSX-only/CocoaExecutor/build-os-config.h new file mode 120000 index 00000000..39c023de --- /dev/null +++ b/OSX-only/CocoaExecutor/build-os-config.h @@ -0,0 +1 @@ +host-os-config.h \ No newline at end of file diff --git a/OSX-only/CocoaExecutor/config.h b/OSX-only/CocoaExecutor/config.h new file mode 100644 index 00000000..99b785bb --- /dev/null +++ b/OSX-only/CocoaExecutor/config.h @@ -0,0 +1,118 @@ +// +// config.h +// CocoaExecutor +// +// Created by C.W. Betts on 7/27/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +/* Enable the macros that store Macintosh addresses in a union of a 32-bit + unsigned int and an array of zero pointers; this currently doesn't work, + but eventually it is how we'll support 64-bit architectures */ +//#define FORCE_EXPERIMENTAL_PACKED_MACROS 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Define to 1 if you have the `db' library (-ldb). */ +/* #undef HAVE_LIBDB */ + +/* Define to 1 if you have the `dxguid' library (-ldxguid). */ +/* #undef HAVE_LIBDXGUID */ + +/* Define to 1 if you have the `gdi32' library (-lgdi32). */ +/* #undef HAVE_LIBGDI32 */ + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#define HAVE_LIBPTHREAD 1 + +/* Define to 1 if you have the `SDL' library (-lSDL). */ +/* #undef HAVE_LIBSDL */ + +#define USE_BSD_SIGNALS 1 + +/* Define to 1 if you have the `syn68k' library (-lsyn68k). */ +#define HAVE_LIBSYN68K 1 + +/* Define to 1 if you have the `user32' library (-luser32). */ +/* #undef HAVE_LIBUSER32 */ + +/* Define to 1 if you have the `vga' library (-lvga). */ +/* #undef HAVE_LIBVGA */ + +/* Define to 1 if you have the `winmm' library (-lwinmm). */ +/* #undef HAVE_LIBWINMM */ + +/* Define to 1 if you have the `X11' library (-lX11). */ +/* #undef HAVE_LIBX11 */ + +/* Define to 1 if you have the `Xext' library (-lXext). */ +/* #undef HAVE_LIBXEXT */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "executorosx" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "computers57@hotmail.com" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "CocoaExecutor" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "executor 2.1.17" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "executor" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.1.17" + +/* The size of `char *', as computed by sizeof. */ +#define SIZEOF_CHAR_P 4 + +/* Define to 1 if you have the ANSI C header files. */ +/* #undef STDC_HEADERS */ + +/* Version number of package */ +#define VERSION "2.1.17" + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ diff --git a/OSX-only/CocoaExecutor/front-end-config.h b/OSX-only/CocoaExecutor/front-end-config.h new file mode 100644 index 00000000..6bf6a62d --- /dev/null +++ b/OSX-only/CocoaExecutor/front-end-config.h @@ -0,0 +1,13 @@ +// +// front-end-config.h +// CocoaExecutor +// +// Created by C.W. Betts on 7/27/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#ifndef CocoaExecutor_front_end_config_h +#define CocoaExecutor_front_end_config_h + + +#endif diff --git a/OSX-only/CocoaExecutor/host-arch-config.h b/OSX-only/CocoaExecutor/host-arch-config.h new file mode 100644 index 00000000..8b5424e2 --- /dev/null +++ b/OSX-only/CocoaExecutor/host-arch-config.h @@ -0,0 +1,22 @@ +#if !defined (__arch_x86_64_h__) +#define __arch_x86_64_h__ + +#define LITTLEENDIAN +#define SYN68K + +/* TODO: only do these if the compiler supports it, check to see if we can + get a better swap16 w/o using builtin_bswap32 */ + +#define swap16(v) ((uint16_t) (__builtin_bswap32 ((int32_t) (v)) >> 16)) + +#define swap32(v)((uint32_t) __builtin_bswap32 ((int32_t)(v))) + +typedef enum { + ARCH_TYPE_I386, + ARCH_TYPE_I486 +} arch_type_t; + +#define arch_type ARCH_TYPE_I486 + + +#endif /* !defined (__arch_x86_64_h__) */ diff --git a/OSX-only/CocoaExecutor/host-os-config.h b/OSX-only/CocoaExecutor/host-os-config.h new file mode 100644 index 00000000..dd1e5c46 --- /dev/null +++ b/OSX-only/CocoaExecutor/host-os-config.h @@ -0,0 +1,111 @@ +#if !defined (__OS_MACOSX_H_) +#define __OS_MACOSX_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#undef trap +#include +#define trap + +#if !defined (__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1) + +#undef GLIBC_DB1_INCLUDES_NDBM + +#else + +#define GLIBC_DB1_INCLUDES_NDBM +#include + +#endif + +#if !defined (MACOSX_) +# define MACOSX_ +#endif + +#if !defined (O_BINARY) +# define O_BINARY 0 +#endif + +#if !defined (PRIVATE) +# define PRIVATE static +#endif + +#if !defined (MMAP_LOW_GLOBALS) +/* define `MMAP_LOW_GLOBALS' if the zero page needs to be + `mmap ()'ed for the low globals (see main:main.c) */ +#define MMAP_LOW_GLOBALS +#endif /* !MMAP_LOW_GLOBALS */ + +extern void mmap_lowglobals (void); + +#define TRY_TO_MMAP_ZONES +extern void *mmap_permanent_memory (unsigned long amount_wanted); + +#if !defined (REINSTALL_SIGNAL_HANDLER) +/* define `REINSTALL_SIGNAL_HANDLER' if signal handlers are + de-installed after the signals occur, and require reinstallation */ +#define REINSTALL_SIGNAL_HANDLER +#endif /* !REINSTALL_SIGNAL_HANDLER */ + +/* These functions don't exist in the math library, so use some + * approximately correct versions of our own. + */ +#define NEED_SCALB +#define NEED_LOGB + +#define HAVE_MMAP + +#define CONFIG_OFFSET_P 1 /* Use offset memory, at least for the first port */ + + +extern int ROMlib_launch_native_app (int n_filenames, char **filenames); + +/* #if !defined (GLIBC_DB1_INCLUDES_NDBM) */ +/* #include */ +/* #else */ +/* #include */ +/* #endif */ +/* to be fixed, 12/08/03 */ + +// DO NOT COMMIT THESE UNCONDITIONAL HACKS +// #define DB_DBM_HSEARCH 1 +// #include + +#include + +#if !defined (COMPILE_FOR_BUILD) + +#ifdef __cplusplus +extern "C" { +#endif +extern void _dbm_fetch (datum *datump, DBM *db, datum datum); +extern void _dbm_firstkey (datum *datump, DBM *db); +extern void _dbm_nextkey (datum *datump, DBM *db); +#ifdef __cplusplus +} +#endif + +#define DBM_FETCH(datump, db, datum) _dbm_fetch ((datump), (db), (datum)) +#define DBM_FIRSTKEY(datump, db) _dbm_firstkey ((datump), (db)) +#define DBM_NEXTKEY(datump, db) _dbm_nextkey ((datump), (db)) + +#endif + +#include +#include +#include +#include + +#endif /* !defined(__OS_MACOSX_H_) */ diff --git a/OSX-only/CocoaExecutor/skel/README b/OSX-only/CocoaExecutor/skel/README new file mode 100644 index 00000000..9bb4bd16 --- /dev/null +++ b/OSX-only/CocoaExecutor/skel/README @@ -0,0 +1,6 @@ +The skel directory contains a single directory "volume", which is the +read-only template used to create an initial ExecutorVolume when one +can't be found at Executor's startup. ExecutorVolume at minimum needs +a "System Folder" directory that contains an Executor compatible "System" +file (traditionally represented as a pair of files "System" and "%System"). + diff --git a/OSX-only/CocoaExecutor/skel/volume/Freeware/About Freeware b/OSX-only/CocoaExecutor/skel/volume/Freeware/About Freeware new file mode 100644 index 00000000..a1682131 --- /dev/null +++ b/OSX-only/CocoaExecutor/skel/volume/Freeware/About Freeware @@ -0,0 +1 @@ +This folder contains software packages that you are free to use without needing to compensate the author. \ No newline at end of file diff --git a/OSX-only/CocoaExecutor/skel/volume/Freeware/Desktop Textures Vol. I b/OSX-only/CocoaExecutor/skel/volume/Freeware/Desktop Textures Vol. I new file mode 100644 index 00000000..e69de29b diff --git a/OSX-only/CocoaExecutor/skel/volume/Freeware/Risk! b/OSX-only/CocoaExecutor/skel/volume/Freeware/Risk! new file mode 100644 index 00000000..e69de29b diff --git a/OSX-only/CocoaExecutor/skel/volume/System Folder/Browser b/OSX-only/CocoaExecutor/skel/volume/System Folder/Browser new file mode 100644 index 00000000..e69de29b diff --git a/OSX-only/CocoaExecutor/skel/volume/System Folder/ParamRAM b/OSX-only/CocoaExecutor/skel/volume/System Folder/ParamRAM new file mode 100644 index 0000000000000000000000000000000000000000..0b62b4cfe5e5fc9a9d1bc8a3b2e7a5dff7e9571c GIT binary patch literal 20 acmZ3%z`$^Z>kJo=VqjoOKEvE`h5-OC%mm#4 literal 0 HcmV?d00001 diff --git a/OSX-only/CocoaExecutor/skel/volume/System Folder/Preferences/CVS b/OSX-only/CocoaExecutor/skel/volume/System Folder/Preferences/CVS new file mode 100644 index 00000000..1e679e26 --- /dev/null +++ b/OSX-only/CocoaExecutor/skel/volume/System Folder/Preferences/CVS @@ -0,0 +1 @@ +This is here so that the directory is visible to git, but the file won't be copied via Xcode. diff --git a/OSX-only/CocoaExecutor/skel/volume/System Folder/Printer b/OSX-only/CocoaExecutor/skel/volume/System Folder/Printer new file mode 100644 index 00000000..e69de29b diff --git a/OSX-only/CocoaExecutor/skel/volume/System Folder/System b/OSX-only/CocoaExecutor/skel/volume/System Folder/System new file mode 100644 index 00000000..e69de29b diff --git a/OSX-only/CocoaExecutor/skel/volume/System Folder/godata.sav b/OSX-only/CocoaExecutor/skel/volume/System Folder/godata.sav new file mode 100644 index 00000000..561dd1ad --- /dev/null +++ b/OSX-only/CocoaExecutor/skel/volume/System Folder/godata.sav @@ -0,0 +1 @@ +/::home:executor:Demoware:StuffIt Expanderª 4.0.1 Folder:StuffIt Expanderª /::home:executor:Shareware:Tex-Edit:Tex-Edit /::home:executor:Demoware:Ultimate Solitaire Demo /::home:executor:Freeware:Globe:Globe /::home:executor:Demoware:MacBreadboardÄ:MacBreadboard DEMO 1.1 /::home:executor:Shareware:CompactPro1.50:Compact Pro /::home:executor:Demoware:MoreLemmingsDemo:Oh No! More Lemmings Demo /::home:executor:Shareware:Speedometer3.23 /::home:executor:Demoware /::home:executor:Freeware /::home:executor:Shareware /::tmp /::home:executor:Shareware:Tex-Edit:Tex-Edit Reference /::home:executor:Shareware:About Shareware /::home:executor:Shareware 203 97 545 189 /::home:executor:Freeware 138 215 477 313 /::home:executor 13 90 108 286 /::home:executor:Demoware 11 344 500 442 \ No newline at end of file diff --git a/OSX-only/CocoaExecutor/skel/volume/System Folder/mac.rsrc b/OSX-only/CocoaExecutor/skel/volume/System Folder/mac.rsrc new file mode 100644 index 00000000..e69de29b diff --git a/OSX-only/CocoaExecutor/skel/volume/System Folder/system.ard b/OSX-only/CocoaExecutor/skel/volume/System Folder/system.ard new file mode 100644 index 00000000..e69de29b diff --git a/OSX-only/CocoaExecutor/skel/volume/System Folder/windows.rsrc b/OSX-only/CocoaExecutor/skel/volume/System Folder/windows.rsrc new file mode 100644 index 00000000..e69de29b diff --git a/OSX-only/CocoaExecutor/sound-config.h b/OSX-only/CocoaExecutor/sound-config.h new file mode 100644 index 00000000..204343c5 --- /dev/null +++ b/OSX-only/CocoaExecutor/sound-config.h @@ -0,0 +1,13 @@ +// +// sound_config.h +// CocoaExecutor +// +// Created by C.W. Betts on 7/30/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#ifndef CocoaExecutor_sound_config_h +#define CocoaExecutor_sound_config_h + + +#endif diff --git a/OSX-only/CocoaExecutor/trapinfo b/OSX-only/CocoaExecutor/trapinfo new file mode 100644 index 00000000..22780d9b --- /dev/null +++ b/OSX-only/CocoaExecutor/trapinfo @@ -0,0 +1,2708 @@ +0xA000 _PBOpen +0xA001 _PBClose +0xA002 _PBRead +0xA003 _PBWrite +0xA004 _PBControl +0xA005 _PBStatus +0xA006 _PBKillIO +0xA007 _PBGetVInfo +0xA008 _PBCreate +0xA009 _PBDelete +0xA00A _PBOpenRF +0xA00B _PBRename +0xA00C _PBGetFInfo +0xA00D _PBSetFInfo +0xA00E _PBUnmountVol +0xA00F _PBMountVol +0xA010 _PBAllocate +0xA011 _PBGetEOF +0xA012 _PBSetEOF +0xA013 _PBFlushVol +0xA014 _PBGetVol +0xA015 _PBSetVol +0xA016 _FInitQueue +0xA017 _PBEject +0xA018 _PBGetFPos +0xA019 R_InitZone +0xA01A +0xA01B R_SetZone +0xA01C R_FreeMem +0xA01D +0xA01E +0xA01F R_DisposPtr +0xA020 R_SetPtrSize +0xA021 R_GetPtrSize +0xA022 +0xA023 R_DisposHandle +0xA024 R_SetHandleSize +0xA025 R_GetHandleSize +0xA026 +0xA027 R_ReallocHandle +0xA028 +0xA029 R_HLock +0xA02A R_HUnlock +0xA02B R_EmptyHandle +0xA02C R_InitApplZone +0xA02D R_SetApplLimit +0xA02E R_BlockMove +0xA02F _PostEvent +0xA030 _OSEventAvail +0xA031 _GetOSEvent +0xA032 _FlushEvents +0xA033 _VInstall +0xA034 _VRemove +0xA035 _PBOffLine +0xA036 R_MoreMasters +0xA037 +0xA038 WriteParam +0xA039 _ReadDateTime +0xA03A _SetDateTime +0xA03B _Delay +0xA03C _EqualString +0xA03D _DrvrInstall +0xA03E _DrvrRemove +0xA03F InitUtil +0xA040 R_ResrvMem +0xA041 _PBSetFLock +0xA042 _PBRstFLock +0xA043 _PBSetFVers +0xA044 _PBSetFPos +0xA045 _PBFlushFile +0xA046 +0xA047 _SetTrapAddress +0xA048 +0xA049 R_HPurge +0xA04A R_HNoPurge +0xA04B R_SetGrowZone +0xA04C R_CompactMem +0xA04D R_PurgeMem +0xA04E _AddDrive +0xA04F _RDrvrInstall +0xA050 _RelString +0xA051 IMVI_ReadXPRam +0xA052 IMVI_WriteXPRam +0xA053 +0xA054 _UprString +0xA055 _StripAddress +0xA056 IMVI_LowerText +0xA057 R_SetApplBase +0xA058 _InsTime +0xA059 _RmvTime +0xA05A _PrimeTime +0xA05B +0xA05B PowerOff +0xA05C IMVI_MemoryDispatch +0xA05D _SwapMMUMode +0xA05E _NMInstall +0xA05F _NMRemove +0xA060 +0xA061 R_MaxBlock +0xA062 R_PurgeSpace +0xA063 R_MaxApplZone +0xA064 R_MoveHHi +0xA065 R_StackSpace +0xA066 +0xA067 R_HSetRBit +0xA068 R_HClrRBit +0xA069 R_HGetState +0xA06A R_HSetState +0xA06B +0xA06C +0xA06C InitFS +0xA06D +0xA06D InitEvents +0xA06E _SlotManager +0xA06F _SlotVInstall +0xA070 _SlotVRemove +0xA071 _AttachVBL +0xA072 _DoVBLTask +0xA073 +0xA074 +0xA075 _DTInstall +0xA076 _SIntRemove +0xA077 _CountADBs +0xA078 _GetIndADB +0xA079 _GetADBInfo +0xA07A _SetADBInfo +0xA07B _ADBReInit +0xA07C _ADBOp +0xA07D _GetDefaultStartup +0xA07E _SetDefaultStartup +0xA07F _InternalWait +0xA080 _GetVideoDefault +0xA081 _SetVideoDefault +0xA082 _SIntInstall +0xA083 _SetOSDefault +0xA084 _GetOSDefault +0xA085 +0xA086 +0xA086 IOPInfoAccess +0xA087 +0xA087 IOPMsgRequest +0xA088 +0xA088 IOPMoveData +0xA089 +0xA089 SCSIAtomic +0xA08A +0xA08B CommToolboxDispatch +0xA08C +0xA08D IMVI_DebugUtil +0xA08E +0xA08F IMVI_DeferUserFn +0xA090 _SysEnvirons +0xA091 +0xA092 +0xA092 EgretDispatch +0xA093 +0xA094 +0xA095 +0xA096 +0xA097 +0xA098 +0xA099 +0xA09A +0xA09B +0xA09C +0xA09D +0xA09E +0xA09F +0xA09F PowerDispatch +0xA0A0 +0xA0A1 +0xA0A2 +0xA0A3 +0xA0A4 +0xA0A4 HeapDispatch +0xA0A5 +0xA0A6 +0xA0A7 +0xA0A8 +0xA0A9 +0xA0AA +0xA0AB +0xA0AC +0xA0AD +0xA0AE +0xA0AE VADBProc +0xA0AF +0xA0B0 +0xA0B1 +0xA0B2 +0xA0B3 +0xA0B4 +0xA0B5 +0xA0B6 +0xA0B7 +0xA0B8 +0xA0B9 +0xA0BA +0xA0BB +0xA0BC +0xA0BD flushcache +0xA0BE +0xA0BF +0xA0C0 +0xA0C1 +0xA0C2 +0xA0C3 +0xA0C4 +0xA0C5 +0xA0C6 +0xA0C7 +0xA0C8 +0xA0C9 +0xA0CA +0xA0CB +0xA0CC +0xA0CD +0xA0CE +0xA0CF +0xA0D0 +0xA0D1 +0xA0D2 +0xA0D3 +0xA0D4 +0xA0D5 +0xA0D6 +0xA0D7 +0xA0D8 +0xA0D9 +0xA0DA +0xA0DB +0xA0DC +0xA0DD IMVI_PPC +0xA0DE +0xA0DF +0xA0E0 +0xA0E1 +0xA0E2 +0xA0E3 +0xA0E4 +0xA0E5 +0xA0E6 +0xA0E7 +0xA0E8 +0xA0E9 +0xA0EA +0xA0EB +0xA0EC +0xA0ED +0xA0EE +0xA0EF +0xA0F0 +0xA0F1 +0xA0F2 +0xA0F3 +0xA0F4 +0xA0F5 +0xA0F6 +0xA0F7 +0xA0F8 +0xA0F9 +0xA0FA +0xA0FB +0xA0FC _ResourceStub +0xA0FD +0xA0FE +0xA0FE TEFindWord +0xA0FF +0xA0FF TEFindLine +0xA100 +0xA101 +0xA102 +0xA103 +0xA104 +0xA105 +0xA106 +0xA107 +0xA108 +0xA109 +0xA10A +0xA10B +0xA10C +0xA10D +0xA10E +0xA10F +0xA110 +0xA111 +0xA112 +0xA113 +0xA114 +0xA115 +0xA116 +0xA117 +0xA118 +0xA119 +0xA11A R_GetZone +0xA11B +0xA11C +0xA11D R_MaxMem +0xA11E R_NewPtr +0xA11F +0xA120 +0xA121 +0xA122 R_NewHandle +0xA123 +0xA124 +0xA125 +0xA126 R_HandleZone +0xA127 +0xA128 R_RecoverHandle +0xA129 +0xA12A +0xA12B +0xA12C +0xA12D +0xA12E +0xA12F +0xA130 +0xA131 +0xA132 +0xA133 +0xA134 +0xA135 +0xA136 +0xA137 +0xA138 +0xA139 +0xA13A +0xA13B +0xA13C +0xA13D +0xA13E +0xA13F +0xA140 +0xA141 +0xA142 +0xA143 +0xA144 +0xA145 +0xA146 _GetTrapAddress +0xA147 +0xA148 R_PtrZone +0xA149 +0xA14A +0xA14B +0xA14C +0xA14D +0xA14E +0xA14F +0xA150 +0xA151 +0xA152 +0xA153 +0xA154 +0xA155 +0xA156 +0xA157 +0xA158 +0xA159 +0xA15A +0xA15B +0xA15C +0xA15D +0xA15E +0xA15F +0xA160 +0xA161 +0xA162 +0xA163 +0xA164 +0xA165 +0xA166 R_NewEmptyHandle +0xA167 +0xA168 +0xA169 +0xA16A +0xA16B +0xA16C +0xA16D +0xA16E +0xA16F +0xA170 +0xA171 +0xA172 +0xA173 +0xA174 +0xA175 +0xA176 +0xA177 +0xA178 +0xA179 +0xA17A +0xA17B +0xA17C +0xA17D +0xA17E +0xA17F +0xA180 +0xA181 +0xA182 +0xA183 +0xA184 +0xA185 +0xA186 +0xA187 +0xA188 +0xA189 +0xA18A +0xA18B +0xA18C +0xA18D +0xA18E +0xA18F +0xA190 +0xA191 IMVI_Translate24To32 +0xA192 +0xA193 +0xA193 Microseconds +0xA194 +0xA195 +0xA196 +0xA197 +0xA198 _HWPriv +0xA199 +0xA19A +0xA19B +0xA19C +0xA19D +0xA19E +0xA19F +0xA1A0 +0xA1A1 +0xA1A2 +0xA1A3 +0xA1A4 +0xA1A5 +0xA1A6 +0xA1A7 +0xA1A8 +0xA1A9 +0xA1AA +0xA1AB +0xA1AC +0xA1AD _Gestalt +0xA1AE +0xA1AF +0xA1B0 +0xA1B1 +0xA1B2 +0xA1B3 +0xA1B4 +0xA1B5 +0xA1B6 +0xA1B7 +0xA1B8 +0xA1B9 +0xA1BA +0xA1BB +0xA1BC +0xA1BD +0xA1BE +0xA1BF +0xA1C0 +0xA1C1 +0xA1C2 +0xA1C3 +0xA1C4 +0xA1C5 +0xA1C6 +0xA1C7 +0xA1C8 +0xA1C9 +0xA1CA +0xA1CB +0xA1CC +0xA1CD +0xA1CE +0xA1CF +0xA1D0 +0xA1D1 +0xA1D2 +0xA1D3 +0xA1D4 +0xA1D5 +0xA1D6 +0xA1D7 +0xA1D8 +0xA1D9 +0xA1DA +0xA1DB +0xA1DC +0xA1DD +0xA1DE +0xA1DF +0xA1E0 +0xA1E1 +0xA1E2 +0xA1E3 +0xA1E4 +0xA1E5 +0xA1E6 +0xA1E7 +0xA1E8 +0xA1E9 +0xA1EA +0xA1EB +0xA1EC +0xA1ED +0xA1EE +0xA1EF +0xA1F0 +0xA1F1 +0xA1F2 +0xA1F3 +0xA1F4 +0xA1F5 +0xA1F6 +0xA1F7 +0xA1F8 +0xA1F9 +0xA1FA +0xA1FB +0xA1FC +0xA1FD +0xA1FE +0xA1FF +0xA200 +0xA201 +0xA202 +0xA203 +0xA204 +0xA205 +0xA206 +0xA207 +0xA208 +0xA209 +0xA20A +0xA20B +0xA20C +0xA20D +0xA20E +0xA20F +0xA210 +0xA211 +0xA212 +0xA213 +0xA214 +0xA215 +0xA216 +0xA217 +0xA218 +0xA219 +0xA21A +0xA21B +0xA21C +0xA21D +0xA21E +0xA21F +0xA220 +0xA221 +0xA222 +0xA223 +0xA224 +0xA225 +0xA226 +0xA227 +0xA228 +0xA229 +0xA22A +0xA22B +0xA22C +0xA22D +0xA22E +0xA22F +0xA230 +0xA231 +0xA232 +0xA233 +0xA234 +0xA235 +0xA236 +0xA237 +0xA238 +0xA239 +0xA23A +0xA23B +0xA23C +0xA23D +0xA23E +0xA23F +0xA240 +0xA241 +0xA242 +0xA243 +0xA244 +0xA245 +0xA246 +0xA247 +0xA248 +0xA249 +0xA24A +0xA24B +0xA24C +0xA24D +0xA24E +0xA24F +0xA250 +0xA251 +0xA252 +0xA253 +0xA254 +0xA255 +0xA256 +0xA257 +0xA258 +0xA259 +0xA25A +0xA25B +0xA25C +0xA25D +0xA25E +0xA25F +0xA260 _HFSDispatch +0xA261 +0xA262 +0xA263 +0xA264 +0xA265 +0xA266 +0xA267 +0xA268 +0xA269 +0xA26A +0xA26B +0xA26C +0xA26D +0xA26E +0xA26F +0xA270 +0xA271 +0xA272 +0xA273 +0xA274 +0xA275 +0xA276 +0xA277 +0xA278 +0xA279 +0xA27A +0xA27B +0xA27C +0xA27D +0xA27E +0xA27F +0xA280 +0xA281 +0xA282 +0xA283 +0xA284 +0xA285 IMVI_IdleUpdate +0xA286 +0xA287 +0xA288 +0xA289 +0xA28A IMVI_SlpQInstall +0xA28B +0xA28C +0xA28D +0xA28E +0xA28F +0xA290 +0xA291 +0xA292 +0xA293 +0xA294 +0xA295 +0xA296 +0xA297 +0xA298 +0xA299 +0xA29A +0xA29B +0xA29C +0xA29D +0xA29E +0xA29F +0xA2A0 +0xA2A1 +0xA2A2 +0xA2A3 +0xA2A4 +0xA2A5 +0xA2A6 +0xA2A7 +0xA2A8 +0xA2A9 +0xA2AA +0xA2AB +0xA2AC +0xA2AD +0xA2AE +0xA2AF +0xA2B0 +0xA2B1 +0xA2B2 +0xA2B3 +0xA2B4 +0xA2B5 +0xA2B6 +0xA2B7 +0xA2B8 +0xA2B9 +0xA2BA +0xA2BB +0xA2BC +0xA2BD +0xA2BE +0xA2BF +0xA2C0 +0xA2C1 +0xA2C2 +0xA2C3 +0xA2C4 +0xA2C5 +0xA2C6 +0xA2C7 +0xA2C8 +0xA2C9 +0xA2CA +0xA2CB +0xA2CC +0xA2CD +0xA2CE +0xA2CF +0xA2D0 +0xA2D1 +0xA2D2 +0xA2D3 +0xA2D4 +0xA2D5 +0xA2D6 +0xA2D7 +0xA2D8 +0xA2D9 +0xA2DA +0xA2DB +0xA2DC +0xA2DD +0xA2DE +0xA2DF +0xA2E0 +0xA2E1 +0xA2E2 +0xA2E3 +0xA2E4 +0xA2E5 +0xA2E6 +0xA2E7 +0xA2E8 +0xA2E9 +0xA2EA +0xA2EB +0xA2EC +0xA2ED +0xA2EE +0xA2EF +0xA2F0 +0xA2F1 +0xA2F2 +0xA2F3 +0xA2F4 +0xA2F5 +0xA2F6 +0xA2F7 +0xA2F8 +0xA2F9 +0xA2FA +0xA2FB +0xA2FC +0xA2FD +0xA2FE +0xA2FF +0xA300 +0xA301 +0xA302 +0xA303 +0xA304 +0xA305 +0xA306 +0xA307 +0xA308 +0xA309 +0xA30A +0xA30B +0xA30C +0xA30D +0xA30E +0xA30F +0xA310 +0xA311 +0xA312 +0xA313 +0xA314 +0xA315 +0xA316 +0xA317 +0xA318 +0xA319 +0xA31A +0xA31B +0xA31C +0xA31D +0xA31E +0xA31F +0xA320 +0xA321 +0xA322 +0xA323 +0xA324 +0xA325 +0xA326 +0xA327 +0xA328 +0xA329 +0xA32A +0xA32B +0xA32C +0xA32D +0xA32E +0xA32F +0xA330 +0xA331 +0xA332 +0xA333 +0xA334 +0xA335 +0xA336 +0xA337 +0xA338 +0xA339 +0xA33A +0xA33B +0xA33C +0xA33D +0xA33E +0xA33F +0xA340 +0xA341 +0xA342 +0xA343 +0xA344 +0xA345 +0xA346 +0xA347 +0xA348 +0xA349 +0xA34A +0xA34B +0xA34C +0xA34D +0xA34E +0xA34F +0xA350 +0xA351 +0xA352 +0xA353 +0xA354 +0xA355 +0xA356 +0xA357 +0xA358 +0xA359 +0xA35A +0xA35B +0xA35C +0xA35D +0xA35E +0xA35F +0xA360 +0xA361 +0xA362 +0xA363 +0xA364 +0xA365 +0xA366 +0xA367 +0xA368 +0xA369 +0xA36A +0xA36B +0xA36C +0xA36D +0xA36E +0xA36F +0xA370 +0xA371 +0xA372 +0xA373 +0xA374 +0xA375 +0xA376 +0xA377 +0xA378 +0xA379 +0xA37A +0xA37B +0xA37C +0xA37D +0xA37E +0xA37F +0xA380 +0xA381 +0xA382 +0xA383 +0xA384 +0xA385 +0xA386 +0xA387 +0xA388 +0xA389 +0xA38A +0xA38B +0xA38C +0xA38D +0xA38E +0xA38F +0xA390 +0xA391 +0xA392 +0xA393 +0xA394 +0xA395 +0xA396 +0xA397 +0xA398 +0xA399 +0xA39A +0xA39B +0xA39C +0xA39D +0xA39E +0xA39F +0xA3A0 +0xA3A1 +0xA3A2 +0xA3A3 +0xA3A4 +0xA3A5 +0xA3A6 +0xA3A7 +0xA3A8 +0xA3A9 +0xA3AA +0xA3AB +0xA3AC +0xA3AD +0xA3AE +0xA3AF +0xA3B0 +0xA3B1 +0xA3B2 +0xA3B3 +0xA3B4 +0xA3B5 +0xA3B6 +0xA3B7 +0xA3B8 +0xA3B9 +0xA3BA +0xA3BB +0xA3BC +0xA3BD +0xA3BE +0xA3BF +0xA3C0 +0xA3C1 +0xA3C2 +0xA3C3 +0xA3C4 +0xA3C5 +0xA3C6 +0xA3C7 +0xA3C8 +0xA3C9 +0xA3CA +0xA3CB +0xA3CC +0xA3CD +0xA3CE +0xA3CF +0xA3D0 +0xA3D1 +0xA3D2 +0xA3D3 +0xA3D4 +0xA3D5 +0xA3D6 +0xA3D7 +0xA3D8 +0xA3D9 +0xA3DA +0xA3DB +0xA3DC +0xA3DD +0xA3DE +0xA3DF +0xA3E0 +0xA3E1 +0xA3E2 +0xA3E3 +0xA3E4 +0xA3E5 +0xA3E6 +0xA3E7 +0xA3E8 +0xA3E9 +0xA3EA +0xA3EB +0xA3EC +0xA3ED +0xA3EE +0xA3EF +0xA3F0 +0xA3F1 +0xA3F2 +0xA3F3 +0xA3F4 +0xA3F5 +0xA3F6 +0xA3F7 +0xA3F8 +0xA3F9 +0xA3FA +0xA3FB +0xA3FC +0xA3FD +0xA3FE +0xA3FF +0xA400 +0xA401 +0xA402 +0xA403 +0xA404 +0xA405 +0xA406 +0xA407 +0xA408 +0xA409 +0xA40A +0xA40B +0xA40C +0xA40D +0xA40E +0xA40F +0xA410 +0xA411 +0xA412 +0xA413 +0xA414 +0xA415 +0xA416 +0xA417 +0xA418 +0xA419 +0xA41A +0xA41B +0xA41C +0xA41D +0xA41E +0xA41F +0xA420 +0xA421 +0xA422 +0xA423 +0xA424 +0xA425 +0xA426 +0xA427 +0xA428 +0xA429 +0xA42A +0xA42B +0xA42C +0xA42D +0xA42E +0xA42F +0xA430 +0xA431 +0xA432 +0xA433 +0xA434 +0xA435 +0xA436 +0xA437 +0xA438 +0xA439 +0xA43A +0xA43B +0xA43C +0xA43D +0xA43E +0xA43F +0xA440 +0xA441 +0xA442 +0xA443 +0xA444 +0xA445 +0xA446 +0xA447 +0xA448 +0xA449 +0xA44A +0xA44B +0xA44C +0xA44D +0xA44E +0xA44F +0xA450 +0xA451 +0xA452 +0xA453 +0xA454 +0xA455 +0xA456 +0xA457 +0xA458 +0xA459 +0xA45A +0xA45B +0xA45C +0xA45D +0xA45E +0xA45F +0xA460 +0xA461 +0xA462 +0xA463 +0xA464 +0xA465 +0xA466 +0xA467 +0xA468 +0xA469 +0xA46A +0xA46B +0xA46C +0xA46D +0xA46E +0xA46F +0xA470 +0xA471 +0xA472 +0xA473 +0xA474 +0xA475 +0xA476 +0xA477 +0xA478 +0xA479 +0xA47A +0xA47B +0xA47C +0xA47D +0xA47E +0xA47F +0xA480 +0xA481 +0xA482 +0xA483 +0xA484 +0xA485 +0xA486 +0xA487 +0xA488 +0xA489 +0xA48A +0xA48B +0xA48C +0xA48D +0xA48E +0xA48F +0xA490 +0xA491 +0xA492 +0xA493 +0xA494 +0xA495 +0xA496 +0xA497 +0xA498 +0xA499 +0xA49A +0xA49B +0xA49C +0xA49D +0xA49E +0xA49F +0xA4A0 +0xA4A1 +0xA4A2 +0xA4A3 +0xA4A4 +0xA4A5 +0xA4A6 +0xA4A7 +0xA4A8 +0xA4A9 +0xA4AA +0xA4AB +0xA4AC +0xA4AD +0xA4AE +0xA4AF +0xA4B0 +0xA4B1 +0xA4B2 +0xA4B3 +0xA4B4 +0xA4B5 +0xA4B6 +0xA4B7 +0xA4B8 +0xA4B9 +0xA4BA +0xA4BB +0xA4BC +0xA4BD +0xA4BE +0xA4BF +0xA4C0 +0xA4C1 +0xA4C2 +0xA4C3 +0xA4C4 +0xA4C5 +0xA4C6 +0xA4C7 +0xA4C8 +0xA4C9 +0xA4CA +0xA4CB +0xA4CC +0xA4CD +0xA4CE +0xA4CF +0xA4D0 +0xA4D1 +0xA4D2 +0xA4D3 +0xA4D4 +0xA4D5 +0xA4D6 +0xA4D7 +0xA4D8 +0xA4D9 +0xA4DA +0xA4DB +0xA4DC +0xA4DD +0xA4DE +0xA4DF +0xA4E0 +0xA4E1 +0xA4E2 +0xA4E3 +0xA4E4 +0xA4E5 +0xA4E6 +0xA4E7 +0xA4E8 +0xA4E9 +0xA4EA +0xA4EB +0xA4EC +0xA4ED +0xA4EE +0xA4EF +0xA4F0 +0xA4F1 +0xA4F2 +0xA4F3 +0xA4F4 +0xA4F5 +0xA4F6 +0xA4F7 +0xA4F8 +0xA4F9 +0xA4FA +0xA4FB +0xA4FC +0xA4FD +0xA4FE +0xA4FF +0xA500 +0xA501 +0xA502 +0xA503 +0xA504 +0xA505 +0xA506 +0xA507 +0xA508 +0xA509 +0xA50A +0xA50B +0xA50C +0xA50D +0xA50E +0xA50F +0xA510 +0xA511 +0xA512 +0xA513 +0xA514 +0xA515 +0xA516 +0xA517 +0xA518 +0xA519 +0xA51A +0xA51B +0xA51C +0xA51D +0xA51E +0xA51F +0xA520 +0xA521 +0xA522 +0xA523 +0xA524 +0xA525 +0xA526 +0xA527 +0xA528 +0xA529 +0xA52A +0xA52B +0xA52C +0xA52D +0xA52E +0xA52F +0xA530 +0xA531 +0xA532 +0xA533 +0xA534 +0xA535 +0xA536 +0xA537 +0xA538 +0xA539 +0xA53A +0xA53B +0xA53C +0xA53D +0xA53E +0xA53F +0xA540 +0xA541 +0xA542 +0xA543 +0xA544 +0xA545 +0xA546 +0xA547 +0xA548 +0xA549 +0xA54A +0xA54B +0xA54C +0xA54D +0xA54E +0xA54F +0xA550 +0xA551 +0xA552 +0xA553 +0xA554 +0xA555 +0xA556 +0xA557 +0xA558 +0xA559 +0xA55A +0xA55B +0xA55C +0xA55D +0xA55E +0xA55F +0xA560 +0xA561 +0xA562 +0xA563 +0xA564 +0xA565 +0xA566 +0xA567 +0xA568 +0xA569 +0xA56A +0xA56B +0xA56C +0xA56D +0xA56E +0xA56F +0xA570 +0xA571 +0xA572 +0xA573 +0xA574 +0xA575 +0xA576 +0xA577 +0xA578 +0xA579 +0xA57A +0xA57B +0xA57C +0xA57D +0xA57E +0xA57F +0xA580 +0xA581 +0xA582 +0xA583 +0xA584 +0xA585 +0xA586 +0xA587 +0xA588 +0xA589 +0xA58A +0xA58B +0xA58C +0xA58D +0xA58E +0xA58F +0xA590 +0xA591 +0xA592 +0xA593 +0xA594 +0xA595 +0xA596 +0xA597 +0xA598 +0xA599 +0xA59A +0xA59B +0xA59C +0xA59D +0xA59E +0xA59F +0xA5A0 +0xA5A1 +0xA5A2 +0xA5A3 +0xA5A4 +0xA5A5 +0xA5A6 +0xA5A7 +0xA5A8 +0xA5A9 +0xA5AA +0xA5AB +0xA5AC +0xA5AD +0xA5AE +0xA5AF +0xA5B0 +0xA5B1 +0xA5B2 +0xA5B3 +0xA5B4 +0xA5B5 +0xA5B6 +0xA5B7 +0xA5B8 +0xA5B9 +0xA5BA +0xA5BB +0xA5BC +0xA5BD +0xA5BE +0xA5BF +0xA5C0 +0xA5C1 +0xA5C2 +0xA5C3 +0xA5C4 +0xA5C5 +0xA5C6 +0xA5C7 +0xA5C8 +0xA5C9 +0xA5CA +0xA5CB +0xA5CC +0xA5CD +0xA5CE +0xA5CF +0xA5D0 +0xA5D1 +0xA5D2 +0xA5D3 +0xA5D4 +0xA5D5 +0xA5D6 +0xA5D7 +0xA5D8 +0xA5D9 +0xA5DA +0xA5DB +0xA5DC +0xA5DD +0xA5DE +0xA5DF +0xA5E0 +0xA5E1 +0xA5E2 +0xA5E3 +0xA5E4 +0xA5E5 +0xA5E6 +0xA5E7 +0xA5E8 +0xA5E9 +0xA5EA +0xA5EB +0xA5EC +0xA5ED +0xA5EE +0xA5EF +0xA5F0 +0xA5F1 +0xA5F2 +0xA5F3 +0xA5F4 +0xA5F5 +0xA5F6 +0xA5F7 +0xA5F8 +0xA5F9 +0xA5FA +0xA5FB +0xA5FC +0xA5FD +0xA5FE +0xA5FF +0xA600 +0xA601 +0xA602 +0xA603 +0xA604 +0xA605 +0xA606 +0xA607 +0xA608 +0xA609 +0xA60A +0xA60B +0xA60C +0xA60D +0xA60E +0xA60F +0xA610 +0xA611 +0xA612 +0xA613 +0xA614 +0xA615 +0xA616 +0xA617 +0xA618 +0xA619 +0xA61A +0xA61B +0xA61C +0xA61D +0xA61E +0xA61F +0xA620 +0xA621 +0xA622 +0xA623 +0xA624 +0xA625 +0xA626 +0xA627 +0xA628 +0xA629 +0xA62A +0xA62B +0xA62C +0xA62D +0xA62E +0xA62F +0xA630 +0xA631 +0xA632 +0xA633 +0xA634 +0xA635 +0xA636 +0xA637 +0xA638 +0xA639 +0xA63A +0xA63B +0xA63C +0xA63D +0xA63E +0xA63F +0xA640 +0xA641 +0xA642 +0xA643 +0xA644 +0xA645 +0xA646 +0xA647 +0xA648 +0xA649 +0xA64A +0xA64B +0xA64C +0xA64D +0xA64E +0xA64F +0xA650 +0xA651 +0xA652 +0xA653 +0xA654 +0xA655 +0xA656 +0xA657 +0xA658 +0xA659 +0xA65A +0xA65B +0xA65C +0xA65D +0xA65E +0xA65F +0xA660 +0xA661 +0xA662 +0xA663 +0xA664 +0xA665 +0xA666 +0xA667 +0xA668 +0xA669 +0xA66A +0xA66B +0xA66C +0xA66D +0xA66E +0xA66F +0xA670 +0xA671 +0xA672 +0xA673 +0xA674 +0xA675 +0xA676 +0xA677 +0xA678 +0xA679 +0xA67A +0xA67B +0xA67C +0xA67D +0xA67E +0xA67F +0xA680 +0xA681 +0xA682 +0xA683 +0xA684 +0xA685 +0xA686 +0xA687 +0xA688 +0xA689 +0xA68A +0xA68B +0xA68C +0xA68D +0xA68E +0xA68F +0xA690 +0xA691 +0xA692 +0xA693 +0xA694 +0xA695 +0xA696 +0xA697 +0xA698 +0xA699 +0xA69A +0xA69B +0xA69C +0xA69D +0xA69E +0xA69F +0xA6A0 +0xA6A1 +0xA6A2 +0xA6A3 +0xA6A4 +0xA6A5 +0xA6A6 +0xA6A7 +0xA6A8 +0xA6A9 +0xA6AA +0xA6AB +0xA6AC +0xA6AD +0xA6AE +0xA6AF +0xA6B0 +0xA6B1 +0xA6B2 +0xA6B3 +0xA6B4 +0xA6B5 +0xA6B6 +0xA6B7 +0xA6B8 +0xA6B9 +0xA6BA +0xA6BB +0xA6BC +0xA6BD +0xA6BE +0xA6BF +0xA6C0 +0xA6C1 +0xA6C2 +0xA6C3 +0xA6C4 +0xA6C5 +0xA6C6 +0xA6C7 +0xA6C8 +0xA6C9 +0xA6CA +0xA6CB +0xA6CC +0xA6CD +0xA6CE +0xA6CF +0xA6D0 +0xA6D1 +0xA6D2 +0xA6D3 +0xA6D4 +0xA6D5 +0xA6D6 +0xA6D7 +0xA6D8 +0xA6D9 +0xA6DA +0xA6DB +0xA6DC +0xA6DD +0xA6DE +0xA6DF +0xA6E0 +0xA6E1 +0xA6E2 +0xA6E3 +0xA6E4 +0xA6E5 +0xA6E6 +0xA6E7 +0xA6E8 +0xA6E9 +0xA6EA +0xA6EB +0xA6EC +0xA6ED +0xA6EE +0xA6EF +0xA6F0 +0xA6F1 +0xA6F2 +0xA6F3 +0xA6F4 +0xA6F5 +0xA6F6 +0xA6F7 +0xA6F8 +0xA6F9 +0xA6FA +0xA6FB +0xA6FC +0xA6FD +0xA6FE +0xA6FF +0xA700 +0xA701 +0xA702 +0xA703 +0xA704 +0xA705 +0xA706 +0xA707 +0xA708 +0xA709 +0xA70A +0xA70B +0xA70C +0xA70D +0xA70E +0xA70F +0xA710 +0xA711 +0xA712 +0xA713 +0xA714 +0xA715 +0xA716 +0xA717 +0xA718 +0xA719 +0xA71A +0xA71B +0xA71C +0xA71D +0xA71E +0xA71F +0xA720 +0xA721 +0xA722 +0xA723 +0xA724 +0xA725 +0xA726 +0xA727 +0xA728 +0xA729 +0xA72A +0xA72B +0xA72C +0xA72D +0xA72E +0xA72F +0xA730 +0xA731 +0xA732 +0xA733 +0xA734 +0xA735 +0xA736 +0xA737 +0xA738 +0xA739 +0xA73A +0xA73B +0xA73C +0xA73D +0xA73E +0xA73F +0xA740 +0xA741 +0xA742 +0xA743 +0xA744 +0xA745 +0xA746 +0xA747 +0xA748 +0xA749 +0xA74A +0xA74B +0xA74C +0xA74D +0xA74E +0xA74F +0xA750 +0xA751 +0xA752 +0xA753 +0xA754 +0xA755 +0xA756 +0xA757 +0xA758 +0xA759 +0xA75A +0xA75B +0xA75C +0xA75D +0xA75E +0xA75F +0xA760 +0xA761 +0xA762 +0xA763 +0xA764 +0xA765 +0xA766 +0xA767 +0xA768 +0xA769 +0xA76A +0xA76B +0xA76C +0xA76D +0xA76E +0xA76F +0xA770 +0xA771 +0xA772 +0xA773 +0xA774 +0xA775 +0xA776 +0xA777 +0xA778 +0xA779 +0xA77A +0xA77B +0xA77C +0xA77D +0xA77E +0xA77F +0xA780 +0xA781 +0xA782 +0xA783 +0xA784 +0xA785 +0xA786 +0xA787 +0xA788 +0xA789 +0xA78A +0xA78B +0xA78C +0xA78D +0xA78E +0xA78F +0xA790 +0xA791 +0xA792 +0xA793 +0xA794 +0xA795 +0xA796 +0xA797 +0xA798 +0xA799 +0xA79A +0xA79B +0xA79C +0xA79D +0xA79E +0xA79F +0xA7A0 +0xA7A1 +0xA7A2 +0xA7A3 +0xA7A4 +0xA7A5 +0xA7A6 +0xA7A7 +0xA7A8 +0xA7A9 +0xA7AA +0xA7AB +0xA7AC +0xA7AD +0xA7AE +0xA7AF +0xA7B0 +0xA7B1 +0xA7B2 +0xA7B3 +0xA7B4 +0xA7B5 +0xA7B6 +0xA7B7 +0xA7B8 +0xA7B9 +0xA7BA +0xA7BB +0xA7BC +0xA7BD +0xA7BE +0xA7BF +0xA7C0 +0xA7C1 +0xA7C2 +0xA7C3 +0xA7C4 +0xA7C5 +0xA7C6 +0xA7C7 +0xA7C8 +0xA7C9 +0xA7CA +0xA7CB +0xA7CC +0xA7CD +0xA7CE +0xA7CF +0xA7D0 +0xA7D1 +0xA7D2 +0xA7D3 +0xA7D4 +0xA7D5 +0xA7D6 +0xA7D7 +0xA7D8 +0xA7D9 +0xA7DA +0xA7DB +0xA7DC +0xA7DD +0xA7DE +0xA7DF +0xA7E0 +0xA7E1 +0xA7E2 +0xA7E3 +0xA7E4 +0xA7E5 +0xA7E6 +0xA7E7 +0xA7E8 +0xA7E9 +0xA7EA +0xA7EB +0xA7EC +0xA7ED +0xA7EE +0xA7EF +0xA7F0 +0xA7F1 +0xA7F2 +0xA7F3 +0xA7F4 +0xA7F5 +0xA7F6 +0xA7F7 +0xA7F8 +0xA7F9 +0xA7FA +0xA7FB +0xA7FC +0xA7FD +0xA7FE +0xA7FF +0xA800 SoundDispatch FinaleUnknown1 DirectorUnknown3 MACEVersion SPBVersion FinaleUnknown2 Comp3to1 Exp1to3 SndSoundManagerVersion Comp6to1 SndChannelStatus Exp1to6 SndManagerStatus SndGetSysBeepState DirectorUnknown4 SndSetSysBeepState SndPlayDoubleBuffer SPBSignOutDevice SndSetSysBeepState SndPauseFilePlay SndGetSysBeepState SPBCloseDevice GetSysBeepVolume SPBPauseRecording SetSysBeepVolume SPBResumeRecording GetDefaultOutputVolume SPBStopRecording SetDefaultOutputVolume SndStopFilePlay SPBSignInDevice SndManagerStatus SPBRecord GetSoundHeaderOffset SndPlayDoubleBuffer SPBRecordToFile SPBMillisecondsToBytes SPBBytesToMilliseconds SndChannelStatus SPBGetIndexedDevice SPBOpenDevice UnsignedFixedMulDiv SetSoundPreference SPBGetDeviceInfo GetSoundPreference SPBSetDeviceInfo SndGetInfo SndSetInfo SndRecordToFile GetCompressionInfo SndRecord SetupAIFFHeader SndStartFilePlay SetupSndHeader SPBGetRecordingStatus +0xA801 SndDisposeChannel +0xA802 SndAddModifier +0xA803 SndDoCommand +0xA804 SndDoImmediate +0xA805 SndPlay +0xA806 SndControl +0xA807 SndNewChannel +0xA808 InitProcMenu +0xA809 GetCVariant +0xA80A GetWVariant +0xA80B PopUpMenuSelect +0xA80C RGetResource +0xA80D Count1Resources +0xA80E Get1IndResource +0xA80F Get1IndType +0xA810 Unique1ID +0xA811 TESelView +0xA812 TEPinScroll +0xA813 TEAutoView +0xA814 SetFractEnable +0xA815 SCSIDispatch +0xA816 Pack8 AESetInteractionAllowed AEDisposeDesc AEResetTimer AEGetTheCurrentEvent AEProcessAppleEvent AEGetInteractionAllowed AESuspendTheCurrentEvent AESetTheCurrentEvent AEDisposeToken AEDuplicateDesc AECountItems AEDeleteItem AEDeleteKeyDesc AEManagerInfo AEInstallSpecialHandler AERemoveSpecialHandler AEGetSpecialHandler AEREesolve AECoerceDesc AEPutDesc AEPutKeyDesc AEInteractWithUser AEPutAttributeDesc AECreateList AERemoveEventHandler AERemoveCoercionHandler AERemoveObjectAccessor AEGetKeyDesc AEResumeTheCurrentEvent AECreateDesc AEGetAttributeDesc AESizeOfAttribute AESizeOfKeyDesc AESizeOfNthItem AEInstallEventHandler AEGetEventHandler AEInstallObjectAccessor AEGetObjectAccessor AECoercePtr AEPutPtr AEGetNthDesc AEPutKeyPtr AEPutAttributePtr AEInstallCoercionHandler AEPutArray AECreateAppleEvent AEGetCoercionHandler AECallObjectAccessor AEGetArray AESend AEGetKeyPtr AEGetAttributePtr AESetObjectCallbacks AEGetNthPtr AEDeleteParam AEPutParamDesc AEGetParamPtr AEDeleteAttribute _AE_hdlr_delete _AE_hdlr_install _AE_hdlr_lookup _AE_hdlr_table_alloc +0xA817 CopyMask +0xA818 FixAtan2 +0xA819 +0xA81A HOpenResFile +0xA81B HCreateResFile +0xA81C Count1Types +0xA81D InvalMenuBar +0xA81E +0xA81F Get1Resource +0xA820 Get1NamedResource +0xA821 MaxSizeRsrc +0xA822 ResourceDispatch ReadPartialResource WritePartialResource SetResourceSize GetNextFOND +0xA823 AliasDispatch FindFolder NewAlias ResolveAlias MatchAlias UpdateAlias GetAliasInfo NewAliasMinimal NewAliasMinimalFromFullPath ResolveAliasFile +0xA824 +0xA825 +0xA826 InsMenuItem +0xA827 HideDItem +0xA828 ShowDItem +0xA829 +0xA82A ComponentDispatch +0xA82B Pack9 +0xA82C Pack10 +0xA82D Pack11 InitEditionPack NewSection RegisterSection UnRegisterSection IsRegisteredSection AssociateSection CreateEditionContainerFile DeleteEditionContainerFile SetEditionFormatMark GetEditionFormatMark OpenEdition EditionHasFormat ReadEdition OpenNewEdition WriteEdition CloseEdition GetLastEditionContainerUsed NewSubscriberDialog NewPublisherDialog SectionOptionsDialog NewSubscriberExpDialog NewPublisherExpDialog SectionOptionsExpDialog GetEditionInfo GoToPublisherSection GetStandardFormats GetEditionOpenerProc SetEditionOpenerProc CallEditionOpenerProc CallFormatIOProc +0xA82E Pack12 Fix2SmallFract SmallFract2Fix CMY2RGB RGB2CMY HSL2RGB RGB2HSL HSV2RGB RGB2HSV GetColor +0xA82F Pack13 +0xA830 Pack14 HMGetHelpMenuHandle HMShowBalloon HMRemoveBalloon HMGetBalloons HMSetBalloons HMShowMenuBalloon HMIsBalloon HMSetFont HMSetFontSize HMGetFont HMGetFontSize HMSetDialogResID HMSetMenuResID HMBalloonRect HMGetMenuResID HMScanTemplateItems HMExtractHelpMsg HMGetDialogResID HMGetMenuResID HMGetBalloonWindow HMBalloonPict +0xA831 Pack15 GetPictInfo GetPixMapInfo NewPictInfo RecordPictInfo RecordPixMapInfo RetrievePictInfo DisposePictInfo +0xA832 +0xA833 +0xA834 SetFScaleDisable +0xA835 FontMetrics +0xA836 GetMaskTable +0xA837 MeasureText +0xA838 CalcMask +0xA839 SeedFill +0xA83A ZoomWindow +0xA83B TrackBox +0xA83C TEGetOffset +0xA83D TEDispatch TEStylPaste TESetStyle TEReplaceStyle TEGetStyle GetStylHandle SetStylHandle GetStylScrap TEStylInsert TEGetPoint TEGetHeight TEContinuousStyle SetStylScrap TECustomHook TENumStyles TEFeatureFlag +0xA83E TEStylNew +0xA83F Long2Fix +0xA840 Fix2Long +0xA841 Fix2Frac +0xA842 Frac2Fix +0xA843 _Fix2X +0xA844 R_X2Fix +0xA845 _Frac2X +0xA846 R_X2Frac +0xA847 FracCos +0xA848 FracSin +0xA849 FracSqrt +0xA84A FracMul +0xA84B FracDiv +0xA84C +0xA84D FixDiv +0xA84E GetItemCmd +0xA84F SetItemCmd +0xA850 InitCursor +0xA851 SetCursor +0xA852 HideCursor +0xA853 ShowCursor +0xA854 FontDispatch IsOutline SetOutlinePreferred OutlineMetrics GetOutlinePreferred SetPreserveGlyph GetPreserveGlyph FlushFonts +0xA855 ShieldCursor +0xA856 ObscureCursor +0xA857 +0xA858 BitAnd +0xA859 BitXor +0xA85A BitNot +0xA85B BitOr +0xA85C BitShift +0xA85D BitTst +0xA85E BitSet +0xA85F BitClr +0xA860 WaitNextEvent +0xA861 Random +0xA862 ForeColor +0xA863 BackColor +0xA864 ColorBit +0xA865 GetPixel +0xA866 StuffHex +0xA867 LongMul +0xA868 FixMul +0xA869 FixRatio +0xA86A HiWord +0xA86B LoWord +0xA86C FixRound +0xA86D InitPort +0xA86E InitGraf +0xA86F OpenPort +0xA870 LocalToGlobal +0xA871 GlobalToLocal +0xA872 GrafDevice +0xA873 SetPort +0xA874 GetPort +0xA875 SetPortBits +0xA876 PortSize +0xA877 MovePortTo +0xA878 SetOrigin +0xA879 SetClip +0xA87A GetClip +0xA87B ClipRect +0xA87C BackPat +0xA87D ClosePort +0xA87E AddPt +0xA87F SubPt +0xA880 SetPt +0xA881 EqualPt +0xA882 StdText +0xA883 DrawChar +0xA884 DrawString +0xA885 DrawText +0xA886 TextWidth +0xA887 TextFont +0xA888 TextFace +0xA889 TextMode +0xA88A TextSize +0xA88B GetFontInfo +0xA88C StringWidth +0xA88D CharWidth +0xA88E SpaceExtra +0xA88F OSDispatch TempMaxMem TempTopMem TempFreeMem TempNewHandle TempHLock TempHUnlock TempDisposeHandle AcceptHighLevelEvent PostHighLevelEvent GetProcessSerialNumberFromPortName LaunchDeskAccessory GetCurrentProcess GetNextProcess GetFrontProcess GetProcessInformation SetFrontProcess WakeUpProcess SameProcess GetSpecificHighLevelEvent GetPortNameFromProcessSerialNumber +0xA890 StdLine +0xA891 LineTo +0xA892 Line +0xA893 MoveTo +0xA894 Move +0xA895 ShutDown ShutDwnPower ShutDwnStart ShutDwnInstall ShutDwnRemove +0xA896 HidePen +0xA897 ShowPen +0xA898 GetPenState +0xA899 SetPenState +0xA89A GetPen +0xA89B PenSize +0xA89C PenMode +0xA89D PenPat +0xA89E PenNormal +0xA89F Unimplemented +0xA8A0 StdRect +0xA8A1 FrameRect +0xA8A2 PaintRect +0xA8A3 EraseRect +0xA8A4 InvertRect +0xA8A5 FillRect +0xA8A6 EqualRect +0xA8A7 SetRect +0xA8A8 OffsetRect +0xA8A9 InsetRect +0xA8AA SectRect +0xA8AB UnionRect +0xA8AC Pt2Rect +0xA8AD PtInRect +0xA8AE EmptyRect +0xA8AF StdRRect +0xA8B0 FrameRoundRect +0xA8B1 PaintRoundRect +0xA8B2 EraseRoundRect +0xA8B3 InvertRoundRect +0xA8B4 FillRoundRect +0xA8B5 ScriptUtil FontScript IntlScript KeyScript Font2Script GetEnvirons SetEnvirons GetScript SetScript CharByte CharType Pixel2Char Char2Pixel Transliterate FindWord HiliteText DrawJust MeasureJust ParseTable FindScriptRun VisibleLength PixelToChar CharToPixel DrawJustified NMeasureJust PortionText ReplaceText TruncText TruncString NFindWord ValidDate FormatStr2X FormatX2Str Format2Str Str2Format ToggleDate LongSecs2Date LongDate2Secs String2Time String2Date InitDateCache IntlTokenize GetFormatOrder StyledLineBreak FillParseTable CharacterByteType CharacterType TransliterateText LowercaseText StripDiacritics UppercaseText UppercaseStripDiacritics TruncString StringToExtended ExtendedToString StringToFormatRec PortionLine +0xA8B6 StdOval +0xA8B7 FrameOval +0xA8B8 PaintOval +0xA8B9 EraseOval +0xA8BA InvertOval +0xA8BB FillOval +0xA8BC SlopeFromAngle +0xA8BD StdArc +0xA8BE FrameArc +0xA8BF PaintArc +0xA8C0 EraseArc +0xA8C1 InvertArc +0xA8C2 FillArc +0xA8C3 PtToAngle +0xA8C4 AngleFromSlope +0xA8C5 StdPoly +0xA8C6 FramePoly +0xA8C7 PaintPoly +0xA8C8 ErasePoly +0xA8C9 InvertPoly +0xA8CA FillPoly +0xA8CB OpenPoly +0xA8CC ClosePoly +0xA8CD KillPoly +0xA8CE OffsetPoly +0xA8CF PackBits +0xA8D0 UnpackBits +0xA8D1 StdRgn +0xA8D2 FrameRgn +0xA8D3 PaintRgn +0xA8D4 EraseRgn +0xA8D5 InvertRgn +0xA8D6 FillRgn +0xA8D7 BitMapToRegion +0xA8D8 NewRgn +0xA8D9 DisposeRgn +0xA8DA OpenRgn +0xA8DB CloseRgn +0xA8DC CopyRgn +0xA8DD SetEmptyRgn +0xA8DE SetRectRgn +0xA8DF RectRgn +0xA8E0 OffsetRgn +0xA8E1 InsetRgn +0xA8E2 EmptyRgn +0xA8E3 EqualRgn +0xA8E4 SectRgn +0xA8E5 UnionRgn +0xA8E6 DiffRgn +0xA8E7 XorRgn +0xA8E8 PtInRgn +0xA8E9 RectInRgn +0xA8EA SetStdProcs +0xA8EB StdBits +0xA8EC CopyBits +0xA8ED StdTxMeas +0xA8EE StdGetPic +0xA8EF ScrollRect +0xA8F0 StdPutPic +0xA8F1 StdComment +0xA8F2 PicComment +0xA8F3 OpenPicture +0xA8F4 ClosePicture +0xA8F5 KillPicture +0xA8F6 DrawPicture +0xA8F7 +0xA8F8 ScalePt +0xA8F9 MapPt +0xA8FA MapRect +0xA8FB MapRgn +0xA8FC MapPoly +0xA8FD _PrGlue PrOpenDoc PrCloseDoc PrOpenPage PrClosePage PrintDefault PrStlDialog PrJobDialog PrStlInit PrJobInit PrDlgMain PrValidate PrJobMerge PrPicFile PrGeneral PrDrvrOpen PrDrvrClose PrDrvrDCE PrDrvrVers PrCtlCall PrPurge PrNoPurge PrError PrSetError PrOpen PrClose +0xA8FE InitFonts +0xA8FF GetFontName +0xA900 GetFNum +0xA901 FMSwapFont +0xA902 RealFont +0xA903 SetFontLock +0xA904 DrawGrowIcon +0xA905 DragGrayRgn +0xA906 NewString +0xA907 SetString +0xA908 ShowHide +0xA909 CalcVis +0xA90A CalcVisBehind +0xA90B ClipAbove +0xA90C PaintOne +0xA90D PaintBehind +0xA90E SaveOld +0xA90F DrawNew +0xA910 GetWMgrPort +0xA911 CheckUpdate +0xA912 InitWindows +0xA913 NewWindow +0xA914 DisposeWindow +0xA915 ShowWindow +0xA916 HideWindow +0xA917 GetWRefCon +0xA918 SetWRefCon +0xA919 GetWTitle +0xA91A SetWTitle +0xA91B MoveWindow +0xA91C HiliteWindow +0xA91D SizeWindow +0xA91E TrackGoAway +0xA91F SelectWindow +0xA920 BringToFront +0xA921 SendBehind +0xA922 BeginUpdate +0xA923 EndUpdate +0xA924 FrontWindow +0xA925 DragWindow +0xA926 DragTheRgn +0xA927 InvalRgn +0xA928 InvalRect +0xA929 ValidRgn +0xA92A ValidRect +0xA92B GrowWindow +0xA92C FindWindow +0xA92D CloseWindow +0xA92E SetWindowPic +0xA92F GetWindowPic +0xA930 InitMenus +0xA931 NewMenu +0xA932 DisposeMenu +0xA933 AppendMenu +0xA934 ClearMenuBar +0xA935 InsertMenu +0xA936 DeleteMenu +0xA937 DrawMenuBar +0xA938 HiliteMenu +0xA939 EnableItem +0xA93A DisableItem +0xA93B GetMenuBar +0xA93C SetMenuBar +0xA93D MenuSelect +0xA93E MenuKey +0xA93F GetItemIcon +0xA940 SetItemIcon +0xA941 GetItemStyle +0xA942 SetItemStyle +0xA943 GetItemMark +0xA944 SetItemMark +0xA945 CheckItem +0xA946 GetItem +0xA947 SetItem +0xA948 CalcMenuSize +0xA949 GetMHandle +0xA94A SetMenuFlash +0xA94B PlotIcon +0xA94C FlashMenuBar +0xA94D AddResMenu +0xA94E PinRect +0xA94F DeltaPoint +0xA950 CountMItems +0xA951 InsertResMenu +0xA952 DelMenuItem +0xA953 UpdtControl +0xA954 NewControl +0xA955 DisposeControl +0xA956 KillControls +0xA957 ShowControl +0xA958 HideControl +0xA959 MoveControl +0xA95A GetCRefCon +0xA95B SetCRefCon +0xA95C SizeControl +0xA95D HiliteControl +0xA95E GetCTitle +0xA95F SetCTitle +0xA960 GetCtlValue +0xA961 GetCtlMin +0xA962 GetCtlMax +0xA963 SetCtlValue +0xA964 SetCtlMin +0xA965 SetCtlMax +0xA966 TestControl +0xA967 DragControl +0xA968 TrackControl +0xA969 DrawControls +0xA96A GetCtlAction +0xA96B SetCtlAction +0xA96C FindControl +0xA96D Draw1Control +0xA96E Dequeue +0xA96F Enqueue +0xA970 GetNextEvent +0xA971 EventAvail +0xA972 GetMouse +0xA973 StillDown +0xA974 Button +0xA975 TickCount +0xA976 GetKeys +0xA977 WaitMouseUp +0xA978 UpdtDialog +0xA979 CouldDialog +0xA97A FreeDialog +0xA97B InitDialogs +0xA97C GetNewDialog +0xA97D NewDialog +0xA97E SelIText +0xA97F IsDialogEvent +0xA980 DialogSelect +0xA981 DrawDialog +0xA982 CloseDialog +0xA983 DisposDialog +0xA984 FindDItem +0xA985 Alert +0xA986 StopAlert +0xA987 NoteAlert +0xA988 CautionAlert +0xA989 CouldAlert +0xA98A FreeAlert +0xA98B ParamText +0xA98C ErrorSound +0xA98D GetDItem +0xA98E SetDItem +0xA98F SetIText +0xA990 GetIText +0xA991 ModalDialog +0xA992 DetachResource +0xA993 SetResPurge +0xA994 CurResFile +0xA995 InitResources +0xA996 RsrcZoneInit +0xA997 OpenResFile +0xA998 UseResFile +0xA999 UpdateResFile +0xA99A CloseResFile +0xA99B SetResLoad +0xA99C CountResources +0xA99D GetIndResource +0xA99E CountTypes +0xA99F GetIndType +0xA9A0 __GetResource +0xA9A1 GetNamedResource +0xA9A2 LoadResource +0xA9A3 ReleaseResource +0xA9A4 HomeResFile +0xA9A5 SizeResource +0xA9A6 GetResAttrs +0xA9A7 SetResAttrs +0xA9A8 GetResInfo +0xA9A9 SetResInfo +0xA9AA ChangedResource +0xA9AB AddResource +0xA9AC AddReference +0xA9AD RmveResource +0xA9AE RmveReference +0xA9AF ResError +0xA9B0 WriteResource +0xA9B1 CreateResFile +0xA9B2 SystemEvent +0xA9B3 SystemClick +0xA9B4 SystemTask +0xA9B5 SystemMenu +0xA9B6 OpenDeskAcc +0xA9B7 CloseDeskAcc +0xA9B8 GetPattern +0xA9B9 GetCursor +0xA9BA GetString +0xA9BB GetIcon +0xA9BC GetPicture +0xA9BD GetNewWindow +0xA9BE GetNewControl +0xA9BF GetMenu +0xA9C0 GetNewMBar +0xA9C1 UniqueID +0xA9C2 SystemEdit +0xA9C3 KeyTrans +0xA9C4 OpenRFPerm +0xA9C5 RsrcMapEntry +0xA9C6 Secs2Date +0xA9C7 Date2Secs +0xA9C8 SysBeep +0xA9C9 SysError +0xA9CA +0xA9CA PutIcon +0xA9CB TEGetText +0xA9CC TEInit +0xA9CD TEDispose +0xA9CE TextBox +0xA9CF TESetText +0xA9D0 TECalText +0xA9D1 TESetSelect +0xA9D2 TENew +0xA9D3 TEUpdate +0xA9D4 TEClick +0xA9D5 TECopy +0xA9D6 TECut +0xA9D7 TEDelete +0xA9D8 TEActivate +0xA9D9 TEDeactivate +0xA9DA TEIdle +0xA9DB TEPaste +0xA9DC TEKey +0xA9DD TEScroll +0xA9DE TEInsert +0xA9DF TESetJust +0xA9E0 Munger +0xA9E1 HandToHand +0xA9E2 PtrToXHand +0xA9E3 PtrToHand +0xA9E4 HandAndHand +0xA9E5 InitPack +0xA9E6 InitAllPacks +0xA9E7 Pack0 LActivate LAddColumn LAddRow LAddToCell LAutoScroll LCellSize LClick LClrCell LDelColumn LDelRow LDispose LDoDraw LDraw LFind LGetCell LGetSelect LLastClick LNew LNextCell LRect LScroll LSearch LSetCell LSetSelect LSize LUpdate +0xA9E8 Pack1 +0xA9E9 Pack2 DIBadMount DILoad DIUnload DIFormat DIVerify DIZero +0xA9EA Pack3 SFPutFile SFGetFile SFPPutFile SFPGetFile StandardPutFile StandardGetFile CustomPutFile CustomGetFile +0xA9EB Pack4 ROMlib_Faddx ROMlib_Fsetenv ROMlib_Fsubx ROMlib_Fgetenv ROMlib_Fmulx ROMlib_Fdivx ROMlib_Fcmpx ROMlib_Fdec2x ROMlib_FcpXx ROMlib_Fx2dec ROMlib_Fremx ROMlib_FnegX ROMlib_Fx2X ROMlib_FabsX ROMlib_FX2x ROMlib_Fcpysgnx ROMlib_FsqrtX ROMlib_FrintX ROMlib_FtintX ROMlib_Fprocentry ROMlib_FscalbX ROMlib_Fprocexit ROMlib_FlogbX ROMlib_Ftestxcp ROMlib_Fclassx +0xA9EC Pack5 ROMlib_FlnX ROMlib_Flog2X ROMlib_Fln1X ROMlib_Flog21X ROMlib_FexpX ROMlib_Fexp2X ROMlib_Fexp1X ROMlib_Fexp21X ROMlib_Fxpwri ROMlib_Fxpwry ROMlib_Fcompound ROMlib_Fannuity ROMlib_FsinX ROMlib_FcosX ROMlib_FtanX ROMlib_FatanX ROMlib_FrandX +0xA9ED Pack6 IUDateString IUTimeString IUMetric IUGetIntl IUSetIntl IUMagString IUMagIDString IUDatePString IUTimePString IUMystery IULDateString IULTimeString IUClearCache IUMagPString IUMagIDPString IUScriptOrder IULangOrder IUTextOrder IUGetItlTable +0xA9EE Pack7 ROMlib_Fpstr2dec ROMlib_Fdec2str ROMlib_Fcstr2dec NumToString StringToNum +0xA9EF PtrAndHand +0xA9F0 _LoadSeg +0xA9F1 UnloadSeg +0xA9F2 Launch +0xA9F3 Chain +0xA9F4 ExitToShell +0xA9F5 GetAppParms +0xA9F6 GetResFileAttrs +0xA9F7 SetResFileAttrs +0xA9F8 +0xA9F8 MethodDispatch +0xA9F9 InfoScrap +0xA9FA UnloadScrap +0xA9FB LoadScrap +0xA9FC ZeroScrap +0xA9FD GetScrap +0xA9FE PutScrap +0xA9FF Debugger +0xAA00 OpenCPort +0xAA01 InitCPort +0xAA02 CloseCPort +0xAA03 NewPixMap +0xAA04 DisposPixMap +0xAA05 CopyPixMap +0xAA06 SetPortPix +0xAA07 NewPixPat +0xAA08 DisposPixPat +0xAA09 CopyPixPat +0xAA0A PenPixPat +0xAA0B BackPixPat +0xAA0C GetPixPat +0xAA0D MakeRGBPat +0xAA0E FillCRect +0xAA0F FillCOval +0xAA10 FillCRoundRect +0xAA11 FillCArc +0xAA12 FillCRgn +0xAA13 FillCPoly +0xAA14 RGBForeColor +0xAA15 RGBBackColor +0xAA16 SetCPixel +0xAA17 GetCPixel +0xAA18 GetCTable +0xAA19 GetForeColor +0xAA1A GetBackColor +0xAA1B GetCCursor +0xAA1C SetCCursor +0xAA1D AllocCursor +0xAA1E GetCIcon +0xAA1F PlotCIcon +0xAA20 OpenCPicture +0xAA21 OpColor +0xAA22 HiliteColor +0xAA23 CharExtra +0xAA24 DisposCTable +0xAA25 DisposeCIcon +0xAA26 DisposCCursor +0xAA27 GetMaxDevice +0xAA28 GetCTSeed +0xAA29 GetDeviceList +0xAA2A GetMainDevice +0xAA2B GetNextDevice +0xAA2C TestDeviceAttribute +0xAA2D SetDeviceAttribute +0xAA2E InitGDevice +0xAA2F NewGDevice +0xAA30 DisposGDevice +0xAA31 SetGDevice +0xAA32 GetGDevice +0xAA33 Color2Index +0xAA34 Index2Color +0xAA35 InvertColor +0xAA36 RealColor +0xAA37 GetSubTable +0xAA38 +0xAA39 MakeITable +0xAA3A AddSearch +0xAA3B AddComp +0xAA3C SetClientID +0xAA3D ProtectEntry +0xAA3E ReserveEntry +0xAA3F SetEntries +0xAA40 QDError +0xAA41 SetWinColor +0xAA42 GetAuxWin +0xAA43 SetCtlColor +0xAA44 GetAuxCtl +0xAA45 NewCWindow +0xAA46 GetNewCWindow +0xAA47 SetDeskCPat +0xAA48 GetCWMgrPort +0xAA49 SaveEntries +0xAA4A RestoreEntries +0xAA4B NewCDialog +0xAA4C DelSearch +0xAA4D DelComp +0xAA4E SetStdCProcs +0xAA4F CalcCMask +0xAA50 SeedCFill +0xAA51 IMVI_CopyDeepMask +0xAA52 HighLevelFSDispatch FSMakeFSSpec FSpOpenDF FSpOpenRF FSpCreate FSpDirCrate FSpDirCreate FSpDelete FSpGetFInfo FSpSetFInfo FSpSetFLock FSpRstFLock FSpRename FSpCatMove FSpOpenResFile FSpCreateResFile FSpExchangeFiles +0xAA53 +0xAA54 +0xAA55 +0xAA56 +0xAA57 DockingDispatch +0xAA58 +0xAA59 MixedModeDispatch NewRoutineDescriptor DisposeRoutineDescriptor NewFatRoutineDescriptor SaveMixedModeState RestoreMixedModeState +0xAA5A CodeFragDispatch GetSharedLibrary GetDiskFragment GetMemFragment CloseConnection FindSymbol CountSymbols GetIndSymbol +0xAA5B +0xAA5C +0xAA5D +0xAA5E +0xAA5F +0xAA60 DelMCEntries +0xAA61 GetMCInfo +0xAA62 SetMCInfo +0xAA63 DispMCInfo +0xAA64 GetMCEntry +0xAA65 SetMCEntries +0xAA66 MenuChoice +0xAA68 DialogDispatch GetStdFilterProc SetDialogDefaultItem SetDialogCancelItem SetDialogTracksCursor +0xAA90 InitPalettes +0xAA91 NewPalette +0xAA92 GetNewPalette +0xAA93 DisposePalette +0xAA94 ActivatePalette +0xAA95 NSetPalette +0xAA96 GetPalette +0xAA97 PmForeColor +0xAA98 PmBackColor +0xAA99 AnimateEntry +0xAA9A AnimatePalette +0xAA9B GetEntryColor +0xAA9C SetEntryColor +0xAA9D GetEntryUsage +0xAA9E SetEntryUsage +0xAA9F CTab2Palette +0xAAA0 Palette2CTab +0xAAA1 CopyPalette +0xAAA2 PaletteDispatch Entry2Index RestoreClutDevice ResizePalette PMgrVersion SaveFore SaveBack RestoreFore RestoreBack GetPaletteUpdates SetPaletteUpdates SetDepth HasDepth GetGray +0xAAAA QuickTime EnterMovies ExitMovies MoviesTask PrerollMovie SetMovieActive StartMovie StopMovie GoToBeginningOfMovie SetMovieGWorld UpdateMovie DisposeMovie GetMovieVolume CloseMovieFile IsMovieDone NewMovieFromFile GetMoviePreferredRate GetMovieBox SetMovieBox NewMovieController DisposeMovieController OpenMovieFile +0xAAFE modeswitch +0xAB03 WackyQD32Trap +0xAB1D QDExtensions NewGWorld LockPixels UnlockPixels UpdateGWorld DisposeGWorld GetGWorld SetGWorld CTabChanged PixPatChanged PortChanged GDeviceChanged AllowPurgePixels NoPurgePixels GetPixelsState SetPixelsState GetPixBaseAddr NewScreenBuffer DisposeScreenBuffer GetGWorldDevice PixMap32Bit GetGWorldPixMap QDDone OffscreenVersion NewTempScreenBuffer +0xABC9 IconDispatch PlotIconID PlotIconMethod PlotIconHandle PlotCIconHandle PlotSICNHandle GetIconSuite NewIconSuite AddIconToSuite GetIconFromSuite PlotIconSuite ForEachIconDo GetSuiteLabel SetSuiteLabel GetLabel DisposeIconSuite IconSuiteToRgn IconIDToRgn IconMethodToRgn PtInIconSuite PtInIconID PtInIconMethod RectInIconSuite RectInIconID RectInIconMethod MakeIconCache GetIconCacheData SetIconCacheData GetIconCacheProc SetIconCacheProc LoadIconCache +0xABCA DeviceLoop +0xABED DragManagerDispatch +0xABF8 StdOpcodeProc +0xABFF DebugStr diff --git a/OSX-only/CocoaExecutor/x86_64.cpp b/OSX-only/CocoaExecutor/x86_64.cpp new file mode 100644 index 00000000..a8beedbb --- /dev/null +++ b/OSX-only/CocoaExecutor/x86_64.cpp @@ -0,0 +1,8 @@ +#include "rsys/common.h" +#include "rsys/arch.h" + +boolean_t +Executor::arch_init (void) +{ + return TRUE; +} diff --git a/OSX-only/CocoaExecutorTests/CocoaExecutorTests-Info.plist b/OSX-only/CocoaExecutorTests/CocoaExecutorTests-Info.plist new file mode 100644 index 00000000..d783a87b --- /dev/null +++ b/OSX-only/CocoaExecutorTests/CocoaExecutorTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.github.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/OSX-only/CocoaExecutorTests/CocoaExecutorTests.m b/OSX-only/CocoaExecutorTests/CocoaExecutorTests.m new file mode 100644 index 00000000..fcb126e5 --- /dev/null +++ b/OSX-only/CocoaExecutorTests/CocoaExecutorTests.m @@ -0,0 +1,34 @@ +// +// CocoaExecutorTests.m +// CocoaExecutorTests +// +// Created by C.W. Betts on 7/27/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#import + +@interface CocoaExecutorTests : XCTestCase + +@end + +@implementation CocoaExecutorTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/OSX-only/CocoaExecutorTests/en.lproj/InfoPlist.strings b/OSX-only/CocoaExecutorTests/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..477b28ff --- /dev/null +++ b/OSX-only/CocoaExecutorTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/OSX-only/syn68k/Syn68k.c b/OSX-only/syn68k/Syn68k.c new file mode 100644 index 00000000..a88084cf --- /dev/null +++ b/OSX-only/syn68k/Syn68k.c @@ -0,0 +1,115 @@ +// +// Syn68k.c +// CocoaExecutor +// +// Created by C.W. Betts on 7/31/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#include +#include "syn68k_public.h" + +// "When in doubt, stub it out." +// --Ryan C. Gordon, Steam Dev Days 2014 + +CPUState cpu_state = {0}; + +void initialize_68k_emulator (void (*while_busy)(int), int native_p, + uint32 trap_vector_storage[64], + uint32 dos_int_flag_addr) +{ + +} + +#if defined (SYNCHRONOUS_INTERRUPTS) +void interrupt_generate (unsigned priority) +{ + +} + +void interrupt_note_if_present (void) +{ + +} + +syn68k_addr_t interrupt_process_any_pending (syn68k_addr_t pc) +{ + return 0; +} +#endif /* SYNCHRONOUS_INTERRUPTS */ + +void interpret_code (const uint16 *code) +{ + +} + +const uint16 *hash_lookup_code_and_create_if_needed (syn68k_addr_t adr) +{ + return NULL; +} + +unsigned long destroy_blocks (syn68k_addr_t low_m68k_address, + uint32 num_bytes) +{ + return 0; +} + +syn68k_addr_t callback_install (callback_handler_t func, + void *arbitrary_argument) +{ + return 0; +} + +void callback_remove (syn68k_addr_t m68k_address) +{ + +} + +void trap_install_handler (unsigned trap_number, + callback_handler_t func, + void *arbitrary_argument) +{ + +} + +void trap_remove_handler (unsigned trap_number) +{ + +} + +void *callback_argument (syn68k_addr_t callback_address) +{ + return NULL; +} + +callback_handler_t callback_function (syn68k_addr_t callback_address) +{ + return 0; +} + +extern void dump_profile (const char *file) +{ + +} + +uint16 callback_dummy_address_space[CALLBACK_SLOP] = {0}; + + +#if SIZEOF_CHAR_P == 4 +uint32 ROMlib_offset = 0; +#elif SIZEOF_CHAR_P == 8 +uint64 ROMlib_offset = 0; +#endif + +#if defined (CHECKSUM_BLOCKS) +unsigned long destroy_blocks_with_checksum_mismatch +(syn68k_addr_t low_m68k_address, uint32 num_bytes) +{ + return 0; +} +#endif + +void m68kaddr (const uint16 *pc) +{ + +} diff --git a/OSX-only/syn68k/syn68k_public.h b/OSX-only/syn68k/syn68k_public.h new file mode 100644 index 00000000..721c64f6 --- /dev/null +++ b/OSX-only/syn68k/syn68k_public.h @@ -0,0 +1,698 @@ +// +// syn68k_public.h +// CocoaExecutor +// +// Created by C.W. Betts on 7/29/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#if !defined (_syn68k_public_h_) +#define _syn68k_public_h_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Decide whether we are big or little endian here. Add more machines as + * they are supported. + */ +#if !defined(BIGENDIAN) && !defined(LITTLEENDIAN) +# if defined(__BIG_ENDIAN__) || defined(m68k) || defined(mc68000) \ +|| defined(sparc) || defined(powerpc) || defined (__ppc__) +# define BIGENDIAN /* ARDI naming convention, why rock the boat? */ +# elif defined(__alpha) || defined(i860) || defined(vax) || defined(i386) \ +|| defined(__x86_64) +# define LITTLEENDIAN +# else +# error "Unknown CPU type" +# endif +#endif + + +/* Define this for CPUs that require n byte data be aligned + * on addresses congruent to zero modulo n. The name "QUADALIGN" + * is another ARDI convention, why rock the boat? + */ + +/* + * Alpha not quad aligned right now because that breaks Mat's code and the + * alpha can get by, for now. + */ + +#if !defined (QUADALIGN) +# if defined(sparc) || /* defined(__alpha) || */ defined (i860) || defined(mips) +# define QUADALIGN +# elif !defined(m68k) && !defined(mc68000) && !defined(i386) \ +&& !defined(vax) && !defined(__alpha) && !defined(powerpc) \ +&& !defined (__ppc__) && !defined(__x86_64) +# error Unknown CPU type +# endif +#endif + + +/* Turn this on if you want to enable destroying only blocks with checksum + * mismatches. + */ +#define CHECKSUM_BLOCKS + + +/* Turn this on if you want syn68k to poll for interrupts, instead of + * being interrupted by the real OS. + */ +#define SYNCHRONOUS_INTERRUPTS + +/* Turn this on if you want to let the BIOS event wait manage the low + * memory interrupt flag. + */ +#if 0 && defined (MSDOS) && defined (SYNCHRONOUS_INTERRUPTS) +# define USE_BIOS_TIMER +#endif + +/* Portability typedefs for signed and unsigned n-bit numbers. */ + +/* TODO: just use the ones from stdint.h instead of our own */ +#if !defined (INT_TYPES_TYPEDEFED) +typedef int8_t int8; +typedef uint8_t uint8; +typedef int16_t int16; +typedef uint16_t uint16; +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +#define INT_TYPES_TYPEDEFED +#endif + + +/* Typedef for address in 68k space. */ +typedef uint32 syn68k_addr_t; + +/* Integral type big enough to hold a pointer. Presumably we'll need to use + * unsigned long long on machines with 64 bit pointers. + */ +typedef unsigned long ptr_sized_uint; + +/* Because a 68k register can be referenced as a byte, word, or int32, + * we represent them as a union of these types. Although not guaranteed + * to be portable, operations on appropriate byte- and word- union elements + * should leave the other bytes unaffected (just as they do on the 68k). + * on the 68k). + */ +#if defined (LITTLEENDIAN) +typedef union { + struct { uint32 n; } ul; + struct { int32 n; } sl; + struct { uint16 n, hi; } uw; + struct { int16 n, hi; } sw; + struct { uint8 n, b1, b2, b3; } ub; + struct { int8 n, b1, b2, b3; } sb; +} M68kReg; +#else +typedef union { + struct { uint32 n; } ul; + struct { int32 n; } sl; + struct { uint16 hi, n; } uw; + struct { int16 hi, n; } sw; + struct { uint8 b3, b2, b1, n; } ub; + struct { int8 b3, b2, b1, n; } sb; +} M68kReg; +#endif + +/* Function type that handles callbacks (and therefore traps). */ +typedef syn68k_addr_t (*callback_handler_t)(syn68k_addr_t, void *); + +typedef struct { + syn68k_addr_t callback_address; + callback_handler_t func; + void *arg; +} TrapHandlerInfo; + + +#if (defined(i386) || defined(m68k)) && !defined (NO_CCR_SPEEDUPS) +#define CCR_ELEMENT_8_BITS +#endif + +#if defined (CCR_ELEMENT_8_BITS) +typedef uint8 CCRElement; /* So we can setb, etc. them directly. */ +#else /* !CCR_ELEMENT_8_BITS */ +typedef int32 CCRElement; +#endif /* !CCR_ELEMENT_8_BITS */ + +typedef struct { + syn68k_addr_t tag; + const uint16 *code; +} jsr_stack_elt_t; + +#define JSR_STACK_SIZE 8 + +typedef struct { + M68kReg regs[16]; /* d0...d7 followed by a0...a7 */ + CCRElement ccnz, ccn, ccc, ccv, ccx; /* 0 or non-0, NOT 0 or 1! */ +#if defined (MINIMAL_CPU_STATE) + uint8 filler[3]; /* So we can copy small cpu states w/out boundary cruft. */ +#else /* !MINIMAL_CPU_STATE */ + char *amode_p, *reversed_amode_p; /* Used in interpreter. */ +#if !defined (USE_BIOS_TIMER) && defined (SYNCHRONOUS_INTERRUPTS) + volatile int32 interrupt_status_changed; /* High bit set when interrupted. */ +#endif + jmp_buf *setjmp_buf; + jsr_stack_elt_t jsr_stack[JSR_STACK_SIZE]; + unsigned jsr_stack_byte_index; /* # of **BYTES** into jsr stack for top. */ + volatile uint16 sr; /* Status register, except cc bits (low 5 bits) == 0. */ + syn68k_addr_t vbr; /* Vector base register (in 68k address space). */ + uint32 cacr, caar; /* Cache Control Register/Cache Address Register. */ + uint32 usp, msp, isp; /* Various stack pointers. Whichever one is + * currently in use can only be found in a7; + * the value here will be outdated. */ + volatile uint8 interrupt_pending[8]; /* 1 if interrupt pending. */ + volatile TrapHandlerInfo trap_handler_info[64]; +#endif /* !MINIMAL_CPU_STATE */ +} CPUState; + + +/* This lets us put syn68k.c's global register variable before the + * inline functions in this file, since that is an error. + */ +#if defined (GLOBAL_REGISTER_DECLS) +GLOBAL_REGISTER_DECLS +#endif + + +#define EM_DREG(X) (cpu_state.regs[X].ul.n) +#define EM_AREG(X) (cpu_state.regs[8 + (X)].ul.n) +#define EM_D0 EM_DREG (0) +#define EM_D1 EM_DREG (1) +#define EM_D2 EM_DREG (2) +#define EM_D3 EM_DREG (3) +#define EM_D4 EM_DREG (4) +#define EM_D5 EM_DREG (5) +#define EM_D6 EM_DREG (6) +#define EM_D7 EM_DREG (7) +#define EM_A0 EM_AREG (0) +#define EM_A1 EM_AREG (1) +#define EM_A2 EM_AREG (2) +#define EM_A3 EM_AREG (3) +#define EM_A4 EM_AREG (4) +#define EM_A5 EM_AREG (5) +#define EM_A6 EM_AREG (6) +#define EM_A7 EM_AREG (7) +#define EM_FP EM_A6 +#define EM_SP EM_A7 + +/* We need a range of "magic" addresses where we know legitimate 68k + * code will be stored. When code at those addresses is "executed" by + * the 68k, we will instead take special actions. We want those + * addresses to be dereferenceable so we'll overlay them over a big + * block of legitimate memory that can never contain m68k code. + * We'll start a few bytes into the array in case anyone examines + * memory before the array. + */ +extern uint16 callback_dummy_address_space[]; +#define CALLBACK_SLOP 16 +#define MAGIC_ADDRESS_BASE \ +((syn68k_addr_t) US_TO_SYN68K((unsigned long) (&callback_dummy_address_space[CALLBACK_SLOP]))) +#define MAGIC_EXIT_EMULATOR_ADDRESS (MAGIC_ADDRESS_BASE + 0) +#define MAGIC_RTE_ADDRESS (MAGIC_ADDRESS_BASE + 2) + +/* Address bits that have meaning, for the CLEAN() macro, below. */ +#define LEGAL_ADDRESS_BITS 0xFFFFFFFFUL + +/* Here is a macro to "clean" an address; if you make it mask out the + * nasty bits, you risk a noticeable performance downgrade. + */ +#if 1 +# define CLEAN(addr) ((ptr_sized_uint)(addr)) +#else +# define CLEAN(addr) (((ptr_sized_uint)(addr)) & LEGAL_ADDRESS_BITS) +#endif + + +/* TODO: see if get rid of need for SIZEOF_CHAR_P, since that's something + that comes from config.h and we shouldn't require users of + syn68k_public.h to require config.h */ + +#if !defined(SIZEOF_CHAR_P) + +#if !defined(__x86_64) +# define SIZEOF_CHAR_P 4 +#else +# define SIZEOF_CHAR_P 8 +#endif + +#endif + + +#if SIZEOF_CHAR_P == 4 + +extern uint32 ROMlib_offset; +#define SYN68K_TO_US(addr) ((uint16 *) ((unsigned long)addr + ROMlib_offset)) /* uint16 * only the default. */ +#define US_TO_SYN68K(addr) (/*(syn68k_addr_t)*/(int32) (addr) - ROMlib_offset) + +#elif SIZEOF_CHAR_P == 8 + +extern uint64 ROMlib_offset; +#define SYN68K_TO_US(addr) ((uint16 *) ((uint64)(uint32)addr + ROMlib_offset)) /* uint16 * only the default. */ +#define US_TO_SYN68K(addr) ((uint32) ((long) (addr) - ROMlib_offset)) + +#else +#error "SIZEOF_CHAR_P unknown" +#endif + +/* These macros should not be used within Syn68k, but are needed in + ROMlib for translations of addresses where it's important to preserve + the address 0 as 0 */ + +#define SYN68K_TO_US_CHECK0(addr) ({ typeof(addr) t; t = addr; t ? SYN68K_TO_US(t) : (uint16 *) 0; }) +#define US_TO_SYN68K_CHECK0(addr) ({ typeof(addr) t; t = addr; t ? US_TO_SYN68K(t) : (int32) 0; }) + +/* Macros for byte swapping + specifying signedness. On a big endian + * machine, these macros are dummies and don't actually swap bytes. + * You may wish to replace these with the most efficient inline assembly + * you can get, as these macros are performance-critical. + * The "_IFLE" suffix stands for "if little endian". + */ + +/* Byte swapping macros. */ +#define SWAPUB(val) ((uint8) (val)) /* Here for symmetry. */ +#define SWAPSB(val) ((int8) (val)) + +#if defined (CWV) && defined (CLV) +#define ROMlib_SwapShort(n) CWV ((uint16) (n)) +#define ROMlib_SwapLong(n) CLV ((uint32) (n)) +#define SWAPUW(n) CWV ((uint16) (n)) +#define SWAPUL(n) CLV ((uint32) (n)) +#elif defined(i386) + +static inline uint16 +ROMlib_SwapShort (unsigned short us) __attribute__ ((const)); + +static inline uint16 +ROMlib_SwapShort (unsigned short us) +{ + uint16 retval; + asm ("rorw $8,%w0" : "=r" (retval) : "0" (us) : "cc"); + return retval; +} + +static inline uint32 +ROMlib_SwapLong (uint32 ul) __attribute__ ((const)); + +static inline uint32 +ROMlib_SwapLong (uint32 ul) +{ + uint32 retval; +#if defined (NeXT) || defined (USE_BSWAP) || defined (ALWAYS_ON_I486) + asm ("bswap %0" : "=r" (retval) : "0" (ul)); +#else + asm ("rorw $8,%w0\n\t" + "rorl $16,%k0\n\t" + "rorw $8,%w0" + : "=r" (retval) : "0" (ul) : "cc"); +#endif + return retval; +} + +# define SWAPUW(val) ROMlib_SwapShort(val) +# define SWAPUL(val) ROMlib_SwapLong(val) + +#elif 0 && defined(__alpha) + +static inline unsigned short const +ROMlib_SwapShort (unsigned short us) +{ + unsigned short retval; + + asm("extbl %1, 1, $2\n\t" /* r2 = 0x0A */ + "sll %1, 8, %0\n\t" /* %0 = 0xB0 */ + "or %0, $2, %0" /* %0 = 0xBA */ + + : "=r" (retval) : "r" (us) : "$2"); + + return retval; +} + +static inline uint32 const +ROMlib_SwapLong (uint32 ul) +{ + uint32 retval; + + asm("extbl %1, 3, $2\n\t" /* r2 = 0x000A */ + "sll %1, 24, $3\n\t" /* r3 = 0xD000 */ + + "srl %1, 8, $5\n\t" /* r5 = 0x0ABC */ + "and %1, 65280, %0\n\t" /* %0 = 0x00C0 */ + + "or $2, $3, $4\n\t" /* r4 = 0xD00A */ + "and $5, 65280, $6\n\t" /* r6 = 0x00B0 */ + + "sll %0, 8, %0\n\t" /* %0 = 0x0C00 */ + "or $4, $6, $7\n\t" /* r7 = 0xD0BA */ + + "or $7, %0, %0" /* %0 = 0xDCBA */ + + : "=r" (retval) : "r" (ul) : "$2", "$3", "$4", "$5", "$6", "$7"); + + return retval; +} + +# define SWAPUW(val) ROMlib_SwapShort(val) +# define SWAPUL(val) ROMlib_SwapLong(val) + +#elif defined(LITTLEENDIAN) + +#if defined(__GNUC__) +# define SWAPUW(val) ({ uint16 _v = (val); (uint16) ((_v >> 8) | (_v << 8)); }) +# define SWAPUL(val) \ +({ uint32 _v = (val); \ +(uint32) ((_v >> 24) | (_v << 24) | ((_v >> 8) & 0xFF00) \ +| ((_v & 0xFF00) << 8)); \ +}) +#else + +static uint16 _swapuw(uint16 v) +{ + return (v >> 8) | (v << 8); +} + +#define SWAPUW(val) _swapuw(val) + +static uint32 _swapul(uint32 v) +{ + return (v >> 24) | (v << 24) | ((v >> 8) & 0xFF00) | ((v & 0xFF00) << 8); +} + +#define SWAPUL(val) _swapul(val) + +#endif + +#define ROMlib_SwapShort(val) SWAPUW(val) +#define ROMlib_SwapLong(val) SWAPUL(val) + +#endif +#define SWAPSW(val) ((int16) SWAPUW (val)) +#define SWAPSL(val) ((int32) SWAPUL (val)) + +#define SWAPUB_IFLE(n) ((uint8) (n)) /* Here for symmetry. */ +#define SWAPSB_IFLE(n) ((int8) (n)) + +#if defined (BIGENDIAN) +# define SWAPUW_IFLE(n) ((uint16) (n)) +# define SWAPSW_IFLE(n) ((int16) (n)) +# define SWAPUL_IFLE(n) ((uint32) (n)) +# define SWAPSL_IFLE(n) ((int32) (n)) +#else /* LITTLEENDIAN */ +# define SWAPUW_IFLE(n) SWAPUW(n) +# define SWAPSW_IFLE(n) SWAPSW(n) +# define SWAPUL_IFLE(n) SWAPUL(n) +# define SWAPSL_IFLE(n) SWAPSL(n) +#endif + + +/* The "slow" variants are here to facilitate compile-time reduction of + * swapped constants. The non-slow versions may use inline assembly, which + * the C compiler won't be able to deal with, but the slow versions are + * guaranteed to use standard C operators. You would only want to use the + * slow versions for swapping constants. + */ +#define SLOW_SWAPUB(val) ((uint8) (val)) /* Here for symmetry. */ +#define SLOW_SWAPSB(val) ((int8) (val)) + +#if defined(__GNUC__) +#define SLOW_SWAPUW(val) \ +({ uint16 _v = (val); (uint16) ((_v >> 8) | (_v << 8)); }) +#else +#define SLOW_SWAPUW(v) ((uint16) (((v) >> 8) | ((v) << 8))) +#endif + +#define SLOW_SWAPSW(val) ((int16) SLOW_SWAPUW (val)) + +#if defined(__GNUC__) +#define SLOW_SWAPUL(val) \ +({ uint32 _v = (val); \ +(uint32) ((_v >> 24) | (_v << 24) | ((_v >> 8) & 0xFF00) \ +| ((_v & 0xFF00) << 8)); \ +}) +#else +#define SLOW_SWAPUL(v) ((uint32) (((v) >> 24) | \ +((v) << 24) | \ +(((v) >> 8) & 0xFF00) | \ +(((v) & 0xFF00) << 8))) +#endif + +#define SLOW_SWAPSL(val) ((int32) SLOW_SWAPUL (val)) + +#define SLOW_SWAPUB_IFLE(n) ((uint8) (n)) /* Here for symmetry. */ +#define SLOW_SWAPSB_IFLE(n) ((int8) (n)) + +#if defined (BIGENDIAN) +# define SLOW_SWAPUW_IFLE(n) ((uint16) (n)) +# define SLOW_SWAPSW_IFLE(n) ((int16) (n)) +# define SLOW_SWAPUL_IFLE(n) ((uint32) (n)) +# define SLOW_SWAPSL_IFLE(n) ((int32) (n)) +#else /* LITTLEENDIAN */ +# define SLOW_SWAPUW_IFLE(n) SLOW_SWAPUW(n) +# define SLOW_SWAPSW_IFLE(n) SLOW_SWAPSW(n) +# define SLOW_SWAPUL_IFLE(n) SLOW_SWAPUL(n) +# define SLOW_SWAPSL_IFLE(n) SLOW_SWAPSL(n) +#endif + + +/* Handy memory access macros. These implicity refer to the 68k addr space + except for the _US variants that refer to the native address space.*/ + +/* Memory reads. */ +#define READUB(addr) (*(const uint8 *) SYN68K_TO_US (CLEAN (addr))) +#define READUW(addr) SWAPUW_IFLE (*(const uint16 *)SYN68K_TO_US (CLEAN (addr))) + +#if defined (BIGENDIAN) && defined (QUADALIGN) +# define READUL(addr) \ +({ const uint16 *_p = SYN68K_TO_US (CLEAN (addr)); \ +(uint32) ((_p[0] << 16) | _p[1]); \ +}) +# define READUL_US(addr) \ +({ const uint16 *_p = CLEAN (addr); \ +(uint32) ((_p[0] << 16) | _p[1]); \ +}) +#elif defined (BIGENDIAN) && !defined (QUADALIGN) +# define READUL(addr) (*(uint32 *) SYN68K_TO_US (CLEAN (addr))) +# define READUL_US(addr) (*(uint32 *) CLEAN (addr)) +#elif !defined (BIGENDIAN) && defined (QUADALIGN) + +#if defined(__GNUC__) +# define READUL(addr) \ +({ const uint8 *_p = (const uint8 *) SYN68K_TO_US (CLEAN (addr)); \ +(uint32) ((_p[0] << 24) | (_p[1] << 16) | (_p[2] << 8) | _p[3]); \ +}) +# define READUL_US(addr) \ +({ const uint8 *_p = (const uint8 *) CLEAN (addr); \ +(uint32) ((_p[0] << 24) | (_p[1] << 16) | (_p[2] << 8) | _p[3]); \ +}) +#else +static uint32 _readul(syn68k_addr_t addr) +{ + const uint8 *p; + + p = (const uint8 *) SYN68K_TO_US (CLEAN (addr)); + return (uint32) ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); +} + +#define READUL(addr) _readul(addr) +static uint32 _readul_us(syn68k_addr_t addr) +{ + const uint8 *p; + + p = (const uint8 *) CLEAN (addr); + return (uint32) ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); +} + +#define READUL_US(addr) _readul_us(addr) +#endif + + +#else /* !defined (BIGENDIAN) && !defined (QUADALIGN) */ +# define READUL(addr) SWAPUL (*(uint32 *) SYN68K_TO_US (CLEAN (addr))) +# define READUL_US(addr) SWAPUL (*(uint32 *) CLEAN (addr)) +#endif +#define READSB(addr) ((int8) READUB (addr)) +#define READSW(addr) ((int16) READUW (addr)) +#define READSL(addr) ((int32) READUL (addr)) + +/* Memory writes. */ +#define WRITEUB(addr, val) (*(uint8 *) SYN68K_TO_US (CLEAN (addr)) = (val)) + +#if defined (BIGENDIAN) +# define WRITEUW(addr, val) (*(uint16 *) SYN68K_TO_US (CLEAN (addr)) = (val)) +#else +# define WRITEUW(addr, val) \ +(*(uint16 *) SYN68K_TO_US (CLEAN (addr)) = SWAPUW (val)) +#endif + +#if defined (BIGENDIAN) && defined (QUADALIGN) +# define WRITEUL(addr, val) \ +do { uint32 _v = (val); \ +uint16 *_p = (uint16 *) SYN68K_TO_US (CLEAN (addr)); \ +_p[0] = _v >> 16; \ +_p[1] = _v; \ +} while (0) +#elif defined (BIGENDIAN) && !defined (QUADALIGN) +# define WRITEUL(addr, val) (*(uint32 *) (SYN68K_TO_US (CLEAN (addr))) = (val)) +#elif !defined (BIGENDIAN) && defined (QUADALIGN) +# define WRITEUL(addr, val) \ +do { uint32 _v = (val); \ +uint8 *_p = (uint8 *) SYN68K_TO_US (CLEAN (addr)); \ +_p[0] = _v >> 24; \ +_p[1] = _v >> 16; \ +_p[2] = _v >> 8; \ +_p[3] = _v; \ +} while (0) +#else /* !defined (BIGENDIAN) && !defined (QUADALIGN) */ +# define WRITEUL(addr, val) \ +(*(uint32 *) SYN68K_TO_US (CLEAN (addr)) = SWAPUL (val)) +#endif + +#define WRITESB(addr, val) WRITEUB ((addr), (uint8) (val)) +#define WRITESW(addr, val) WRITEUW ((addr), (uint16) (val)) +#define WRITESL(addr, val) WRITEUL ((addr), (uint32) (val)) + +/* Pop instructions. */ +#define POPUB() (EM_A7 += 2, READUB (EM_A7 - 2)) +#define POPUW() (EM_A7 += 2, READUW (EM_A7 - 2)) +#define POPUL() (EM_A7 += 4, READUL (EM_A7 - 4)) +#define POPSB() ((int8) POPUB ()) +#define POPSW() ((int16) POPUW ()) +#define POPSL() ((int32) POPUL ()) +#define POPADDR() POPUL() + +/* Push instructions */ +#define PUSHUB(val) WRITEUB (EM_A7 -= 2, (val)) +#define PUSHUW(val) WRITEUW (EM_A7 -= 2, (val)) +#define PUSHUL(val) WRITEUL (EM_A7 -= 4, (val)) +#define PUSHSB(val) PUSHUB ((uint8) (val)) +#define PUSHSW(val) PUSHUW ((uint16) (val)) +#define PUSHSL(val) PUSHUL ((uint32) (val)) +#define PUSHADDR(val) PUSHUL (val) + +#if !defined (CALL_EMULATOR) +#define CALL_EMULATOR(addr) \ +do {PUSHADDR (MAGIC_EXIT_EMULATOR_ADDRESS); \ +(interpret_code (hash_lookup_code_and_create_if_needed (addr)));} while (0) +#endif + +/* Global struct describing the CPU state. */ +extern CPUState cpu_state; + + +/* I hate to put this here, but we want our interrupt polling to + * be extremely fast so we can check for interrupts anywhere in + * executor that might be time consuming. + */ +#if defined (SYNCHRONOUS_INTERRUPTS) + +#define M68K_TIMER_PRIORITY 4 +#define M68K_TIMER_VECTOR (24 + M68K_TIMER_PRIORITY) + +#define INTERRUPT_STATUS_CHANGED (-1) +#define INTERRUPT_STATUS_UNCHANGED 0x7FFFFFFF + +#if defined (USE_BIOS_TIMER) + +extern uint16 dos_memory_selector; +extern uint32 dos_interrupt_flag_addr; + +# ifdef SYN68K_C + +/* If we're in syn68k.c, we know that %fs holds the dos mem selector value. */ +# define FETCH_INTERRUPT_STATUS() \ +({ \ +int32 n; \ +asm ("movl %%fs:(%1),%0" \ +: "=r" (n) \ +: "r" (dos_interrupt_flag_addr)); \ +n; \ +}) +# define SET_INTERRUPT_STATUS(n) \ +asm ("movl %0,%%fs:(%1)" \ +: : "g" (n), "r" (dos_interrupt_flag_addr)) +# else /* !SYN68K_C */ + +/* Temporarily use %fs to reference DOS memory. */ +# define FETCH_INTERRUPT_STATUS() \ +({ \ +int32 n; \ +asm ("pushl %%fs\n\t" \ +"movw %2,%%fs\n\t" \ +"movl %%fs:(%1),%0\n\t" \ +"popl %%fs" \ +: "=r" (n) \ +: "r" (dos_interrupt_flag_addr), "g" (dos_memory_selector)); \ +n; \ +}) +# define SET_INTERRUPT_STATUS(n) \ +asm ("pushl %%fs\n\t" \ +"movw %2,%%fs\n\t" \ +"movl %0,%%fs:(%1)\n\t" \ +"popl %%fs" \ +: : "g" (n), "r" (dos_interrupt_flag_addr), \ +"g" (dos_memory_selector)) +# endif /* !SYN68K_C */ + +#else /* !USE_BIOS_TIMER */ +#define FETCH_INTERRUPT_STATUS() cpu_state.interrupt_status_changed +#define SET_INTERRUPT_STATUS(n) \ +((void) (cpu_state.interrupt_status_changed = (n))) + +#endif /* !USE_BIOS_TIMER */ + +#define INTERRUPT_PENDING() (FETCH_INTERRUPT_STATUS () < 0) + +#endif /* SYNCHRONOUS_INTERRUPTS */ + + +/* Functions to be called from outside the emulator. */ +extern void initialize_68k_emulator (void (*while_busy)(int), int native_p, + uint32 trap_vector_storage[64], + uint32 dos_int_flag_addr); + +#if defined (SYNCHRONOUS_INTERRUPTS) +extern void interrupt_generate (unsigned priority); +extern void interrupt_note_if_present (void); +/* called from `host_interrupt_status_changed' assembly stub in + host-native.c */ +extern syn68k_addr_t interrupt_process_any_pending (syn68k_addr_t pc) +asm ("_interrupt_process_any_pending"); +#endif /* SYNCHRONOUS_INTERRUPTS */ + +extern void interpret_code (const uint16 *code); +/* called from asm; hence the need for the asm label, see + `host_interrupt_status_changed' stub asm in host-native.c */ +extern const uint16 *hash_lookup_code_and_create_if_needed (syn68k_addr_t adr) +asm ("_hash_lookup_code_and_create_if_needed"); + +extern unsigned long destroy_blocks (syn68k_addr_t low_m68k_address, + uint32 num_bytes); +extern syn68k_addr_t callback_install (callback_handler_t func, + void *arbitrary_argument); +extern void callback_remove (syn68k_addr_t m68k_address); +extern void trap_install_handler (unsigned trap_number, + callback_handler_t func, + void *arbitrary_argument); +extern void trap_remove_handler (unsigned trap_number); +extern void *callback_argument (syn68k_addr_t callback_address); +extern callback_handler_t callback_function (syn68k_addr_t callback_address); +extern void dump_profile (const char *file); + +#if defined (CHECKSUM_BLOCKS) +extern unsigned long destroy_blocks_with_checksum_mismatch +(syn68k_addr_t low_m68k_address, uint32 num_bytes); +#endif + +extern void m68kaddr (const uint16 *pc); + +#ifdef __cplusplus +} +#endif + +#endif /* Not _syn68k_public_h_ */ diff --git a/src/AE.c b/src/AE.cpp similarity index 92% rename from src/AE.c rename to src/AE.cpp index 0a07be11..1751149a 100644 --- a/src/AE.c +++ b/src/AE.cpp @@ -24,7 +24,19 @@ char ROMlib_rcsid_AE[] = #include "rsys/mman.h" #include "rsys/flags.h" +namespace Executor { boolean_t send_application_open_aevt_p; + PUBLIC pascal OSErr C_EventHandlerTemplate(AppleEvent *evt, AppleEvent *reply, + int32 refcon); + PUBLIC pascal OSErr C_CoercePtrTemplate(DescType data_type, Ptr data, Size data_size, + DescType to_type, int32 refcon, AEDesc * desc_out); + + PUBLIC pascal OSErr C_CoerceDescTemplate(AEDesc * desc, DescType to_type, int32 refcon, + AEDesc * desc_out); + +} +using namespace Executor; + /* dispatching apple events */ @@ -48,7 +60,7 @@ P1 (PUBLIC pascal trap, OSErr, AEProcessAppleEvent, Size dummy_size; TargetID dummy_target_id; - AppleEvent *evt = alloca (sizeof *evt); + AppleEvent *evt = (AppleEvent*)alloca (sizeof *evt); EventHandlerProcPtr hdlr; Handle evt_data; @@ -122,8 +134,8 @@ P1 (PUBLIC pascal trap, OSErr, AEProcessAppleEvent, refcon = CL (refcon); { - AppleEvent *reply = alloca (sizeof *reply); - AEDesc *target = alloca (sizeof *target); + AppleEvent *reply = (AppleEvent*)alloca (sizeof *reply); + AEDesc *target = (AEDesc*)alloca (sizeof *target); ProcessSerialNumber psn; GetCurrentProcess (&psn); @@ -137,7 +149,7 @@ P1 (PUBLIC pascal trap, OSErr, AEProcessAppleEvent, /* dummy */ -1, /* dummy */ -1, reply); - retval = CToPascalCall (hdlr, + retval = CToPascalCall (&hdlr, CTOP_EventHandlerTemplate, evt, reply, refcon); @@ -153,12 +165,12 @@ P7 (PUBLIC pascal trap, OSErr, AESend, AESendMode, send_mode, AESendPriority, send_priority, int32, timeout, IdleProcPtr, idle_proc, EventFilterProcPtr, filter_proc) { - AEDesc *target = alloca (sizeof *target); + AEDesc *target = (AEDesc*)alloca (sizeof *target); DescType target_type, dummy_type; Size target_size, dummy_size; - ProcessSerialNumber *target_psn = alloca (sizeof *target_psn); - ProcessSerialNumber *current_psn = alloca (sizeof *current_psn); + ProcessSerialNumber *target_psn = (ProcessSerialNumber *)alloca (sizeof *target_psn); + ProcessSerialNumber *current_psn = (ProcessSerialNumber *)alloca (sizeof *current_psn); AEEventID event_id; AEEventClass event_class; @@ -424,20 +436,20 @@ P5 (PUBLIC pascal trap, OSErr, AECoercePtr, if (is_desc_hdlr_p) { - descriptor_t *desc = alloca (sizeof *desc); + descriptor_t *desc = (descriptor_t*)alloca (sizeof *desc); err = AECreateDesc (data_type, data, data_size, desc); if (err != noErr) return memFullErr; - err = CToPascalCall (coercion_hdlr, PTOC_CoerceDescTemplate, + err = CToPascalCall (&coercion_hdlr, PTOC_CoerceDescTemplate, desc, result_type, refcon, desc_out); AEDisposeDesc (desc); } else { - err = CToPascalCall (coercion_hdlr, PTOC_CoercePtrTemplate, + err = CToPascalCall (&coercion_hdlr, PTOC_CoercePtrTemplate, data_type, data, data_size, result_type, refcon, desc_out); } @@ -558,7 +570,7 @@ P3 (PUBLIC pascal trap, OSErr, AECoerceDesc, if (is_desc_hdlr_p) { - err = CToPascalCall (coercion_hdlr, PTOC_CoerceDescTemplate, + err = CToPascalCall (&coercion_hdlr, PTOC_CoerceDescTemplate, desc, result_type, refcon, desc_out); } else @@ -570,7 +582,7 @@ P3 (PUBLIC pascal trap, OSErr, AECoerceDesc, LOCK_HANDLE_EXCURSION_1 (desc_data, { - err = CToPascalCall (coercion_hdlr, PTOC_CoercePtrTemplate, + err = CToPascalCall (&coercion_hdlr, PTOC_CoercePtrTemplate, desc_type, STARH (desc_data), GetHandleSize (desc_data), result_type, refcon, desc_out); @@ -584,7 +596,7 @@ P3 (PUBLIC pascal trap, OSErr, AECoerceDesc, fail: desc_out->descriptorType = CLC (typeNull); - desc_out->dataHandle = CLC (0); + desc_out->dataHandle = (Handle)CLC (0); AE_RETURN_ERROR (errAECoercionFail); } diff --git a/src/AE_coercion.c b/src/AE_coercion.cpp similarity index 83% rename from src/AE_coercion.c rename to src/AE_coercion.cpp index 890b3813..ca5996d0 100644 --- a/src/AE_coercion.c +++ b/src/AE_coercion.cpp @@ -7,5 +7,10 @@ char ROMlib_rcsid_AE_coercion[] = "$Id: AE_coercion.c 63 2004-12-24 18:19:43Z ctm $"; #endif +#include "rsys/common.h" + +using namespace Executor; + + /* default coercion handlers */ diff --git a/src/AE_desc.c b/src/AE_desc.cpp similarity index 96% rename from src/AE_desc.c rename to src/AE_desc.cpp index b4dec971..6f3228c5 100644 --- a/src/AE_desc.c +++ b/src/AE_desc.cpp @@ -15,6 +15,8 @@ char ROMlib_rcsid_AE_desc[] = #include "rsys/mman.h" #include "rsys/apple_events.h" +using namespace Executor; + #define LIST_CLASS_P(desc) \ ( DESC_TYPE_X (desc) == CLC (typeAEList) \ || DESC_TYPE_X (desc) == CLC (typeAERecord) \ @@ -30,8 +32,7 @@ get_subdesc_info (Handle aggr_desc_h, subdesc_info_t *info, boolean_t attribute_p) { if (ATTRIBUTE_COUNT (aggr_desc_h) == typeAEList - || ATTRIBUTE_COUNT (aggr_desc_h) == typeAERecord) - { + || ATTRIBUTE_COUNT (aggr_desc_h) == typeAERecord) { if (attribute_p) AE_RETURN_ERROR (errAEWrongDataType); @@ -699,7 +700,7 @@ P6 (PUBLIC pascal trap, OSErr, AECreateAppleEvent, target_size = GetHandleSize (target_data); event_size = sizeof *event_data + target_size + 10; - event_data = alloca (event_size); + event_data = (ae_header_t *)alloca (event_size); memset (event_data, '\000', event_size); event_data->param_offset = CL (event_size + 2); @@ -834,7 +835,7 @@ P5 (PUBLIC pascal trap, OSErr, AEGetNthDesc, DescType, desired_type, AEKeyword *, keyword_out, AEDesc *, desc_out) { - descriptor_t *desc = alloca (sizeof *desc); + descriptor_t *desc = (descriptor_t *)alloca (sizeof *desc); if (! LIST_CLASS_P (list)) AE_RETURN_ERROR (errAEWrongDataType); @@ -851,8 +852,8 @@ P8 (PUBLIC pascal trap, OSErr, AEGetNthPtr, DescType *, type_out, Ptr, data, int32, max_size, Size *, size_out) { - descriptor_t *desc = alloca (sizeof *desc); - descriptor_t *coerced_desc = alloca (sizeof *coerced_desc); + descriptor_t *desc = (descriptor_t *)alloca (sizeof *desc); + descriptor_t *coerced_desc = (descriptor_t *)alloca (sizeof *coerced_desc); OSErr err; if (! LIST_CLASS_P (list)) @@ -894,7 +895,7 @@ P5 (PUBLIC pascal trap, OSErr, AEPutPtr, if (! LIST_CLASS_P (list)) AE_RETURN_ERROR (errAEWrongDataType); - desc = alloca (sizeof *desc); + desc = (descriptor_t *)alloca (sizeof *desc); err = AECreateDesc (type, data, data_size, desc); if (err != noErr) AE_RETURN_ERROR (err); @@ -920,7 +921,7 @@ P4 (PUBLIC pascal trap, OSErr, AESizeOfNthItem, AEDescList *, list, int32, index, DescType *, type_out, Size *, size_out) { - descriptor_t *desc = alloca (sizeof *desc); + descriptor_t *desc = (descriptor_t *)alloca (sizeof *desc); if (! LIST_CLASS_P (list)) AE_RETURN_ERROR (errAEWrongDataType); @@ -946,7 +947,7 @@ P4 (PUBLIC pascal trap, OSErr, AEGetKeyDesc, AE_RETURN_ERROR (errAEWrongDataType); desc = aggr_get_key_desc (DESC_DATA (record), keyword, FALSE, - alloca (sizeof *desc)); + (descriptor_t *)alloca (sizeof *desc)); if (desc == NULL) AE_RETURN_ERROR (errAEDescNotFound); @@ -971,8 +972,8 @@ P7 (PUBLIC pascal trap, OSErr, AEGetKeyPtr, DescType, desired_type, DescType *, type_out, Ptr, data, Size, max_size, Size *, size_out) { - descriptor_t *desc = alloca (sizeof *desc); - descriptor_t *coerced_desc = alloca (sizeof *coerced_desc); + descriptor_t *desc = (descriptor_t *)alloca (sizeof *desc); + descriptor_t *coerced_desc = (descriptor_t *)alloca (sizeof *coerced_desc); OSErr err; if (! RECORD_CLASS_P (record)) @@ -1001,7 +1002,7 @@ P5 (PUBLIC pascal trap, OSErr, AEPutKeyPtr, if (! RECORD_CLASS_P (record)) AE_RETURN_ERROR (errAEWrongDataType); - desc = alloca (sizeof *desc); + desc = (descriptor_t *)alloca (sizeof *desc); err = AECreateDesc (type, data, data_size, desc); if (err != noErr) AE_RETURN_ERROR (err); @@ -1030,7 +1031,7 @@ P4 (PUBLIC pascal trap, OSErr, AESizeOfKeyDesc, AERecord *, record, AEKeyword, keyword, DescType *, type_out, Size *, size_out) { - descriptor_t *desc = alloca (sizeof *desc); + descriptor_t *desc = (descriptor_t *)alloca (sizeof *desc); if (! RECORD_CLASS_P (record)) AE_RETURN_ERROR (errAEWrongDataType); @@ -1056,7 +1057,7 @@ P5 (PUBLIC pascal trap, OSErr, AEPutAttributePtr, if (! APPLE_EVENT_CLASS_P (evt)) AE_RETURN_ERROR (errAEWrongDataType); - desc = alloca (sizeof *desc); + desc = (descriptor_t *)alloca (sizeof *desc); err = AECreateDesc (type, data, data_size, desc); if (err != noErr) AE_RETURN_ERROR (err); @@ -1092,7 +1093,7 @@ P4 (PUBLIC pascal trap, OSErr, AEGetAttributeDesc, AE_RETURN_ERROR (errAEWrongDataType); desc = aggr_get_key_desc (DESC_DATA (evt), keyword, TRUE, - alloca (sizeof *desc)); + (descriptor_t *)alloca (sizeof *desc)); if (desc == NULL) AE_RETURN_ERROR (errAEDescNotFound); @@ -1105,14 +1106,14 @@ P7 (PUBLIC pascal trap, OSErr, AEGetAttributePtr, Ptr, data, Size, max_size, Size *, size_out) { descriptor_t *desc; - descriptor_t *coerced_desc = alloca (sizeof *coerced_desc); + descriptor_t *coerced_desc = (descriptor_t *)alloca (sizeof *coerced_desc); OSErr err; if (! APPLE_EVENT_CLASS_P (evt)) AE_RETURN_ERROR (errAEWrongDataType); desc = aggr_get_key_desc (DESC_DATA (evt), keyword, TRUE, - alloca (sizeof *desc)); + (descriptor_t *)alloca (sizeof *desc)); if (desc == NULL) AE_RETURN_ERROR (errAEDescNotFound); @@ -1148,7 +1149,7 @@ P4 (PUBLIC pascal trap, OSErr, AESizeOfAttribute, AE_RETURN_ERROR (errAEWrongDataType); desc = aggr_get_key_desc (DESC_DATA (evt), keyword, TRUE, - alloca (sizeof *desc)); + (descriptor_t *)alloca (sizeof *desc)); if (desc == NULL) AE_RETURN_ERROR (errAEDescNotFound); diff --git a/src/AE_hdlr.c b/src/AE_hdlr.cpp similarity index 98% rename from src/AE_hdlr.c rename to src/AE_hdlr.cpp index ac751493..116cb0e0 100644 --- a/src/AE_hdlr.c +++ b/src/AE_hdlr.cpp @@ -16,6 +16,8 @@ char ROMlib_rcsid_AE_hdlr[] = #include "rsys/system_error.h" #include "rsys/mman.h" +using namespace Executor; + #define hdlr_table(system_p, class) \ ({ \ AE_info_t *info; \ @@ -31,7 +33,7 @@ char ROMlib_rcsid_AE_hdlr[] = }) void -AE_init (void) +Executor::AE_init (void) { AE_info_t *info; OSErr err; @@ -65,7 +67,7 @@ AE_init (void) } void -AE_reinit (void) +Executor::AE_reinit (void) { AE_info_t *info; OSErr err; @@ -98,7 +100,7 @@ AE_reinit (void) } -OSErr +static OSErr hdlr_table_elt (AE_hdlr_table_h table, AE_hdlr_selector_t *selector, AE_hdlr_t *hdlr, boolean_t create_p, @@ -237,7 +239,7 @@ P4 (PUBLIC pascal trap, OSErr, _AE_hdlr_install, AE_RETURN_ERROR (noErr); } -boolean_t application_accepts_open_app_aevt_p; +boolean_t Executor::application_accepts_open_app_aevt_p; P5 (PUBLIC pascal trap, OSErr, AEInstallEventHandler, AEEventClass, event_class, AEEventID, event_id, @@ -425,7 +427,7 @@ P4 (PUBLIC pascal trap, OSErr, AERemoveCoercionHandler, #define k_special_sel1 (T ('\000', '\000', '\000', '\000')) -ProcPtr AE_OSL_select_fn; +ProcPtr Executor::AE_OSL_select_fn; P3 (PUBLIC pascal trap, OSErr, AEInstallSpecialHandler, AEKeyword, function_class, ProcPtr, hdlr_fn, diff --git a/src/CBridge.cpp b/src/CBridge.cpp new file mode 100644 index 00000000..3522f17a --- /dev/null +++ b/src/CBridge.cpp @@ -0,0 +1,64 @@ +// +// CBridge.cpp +// CocoaExecutor +// +// Created by C.W. Betts on 7/30/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#include "rsys/common.h" +#include "rsys/options.h" +#include "rsys/prefs.h" +#include "rsys/crc.h" +#include "rsys/parse.h" +#include "rsys/parseopt.h" +#include "rsys/gestalt.h" +#include "rsys/launch.h" +#include "rsys/print.h" +#include "rsys/version.h" + +using namespace Executor; + +extern "C" { +#include "CFriendly.h" +} + +#undef getthecrc +#undef ROMlib_version_long +#undef ROMlib_delay +#undef ROMlib_add_to_gestalt_list + +short CB_getthecrc(ResType typ, long id1) +{ + return getthecrc(typ, id1); +} + +long CGet_ROMlib_version_long() +{ + return ROMlib_version_long; +} + +uint32 ROMlib_PrDrvrVers_Set(uint32 toSet){ + ROMlib_PrDrvrVers = toSet; + return ROMlib_PrDrvrVers; +} + +int CGet_ROMlib_delay() +{ + return ROMlib_delay; +} + +int *CGet_ROMlib_delayp() +{ + return &ROMlib_delay; +} + +int *CGet_ROMlib_refreshp() +{ + return &ROMlib_refresh; +} + +void CB_ROMlib_add_to_gestalt_list(OSType selector, OSErr retval, uint32 new_value) +{ + ROMlib_add_to_gestalt_list(selector, retval, new_value); +} diff --git a/src/FileDouble-OSX.cpp b/src/FileDouble-OSX.cpp new file mode 100644 index 00000000..d91b5d79 --- /dev/null +++ b/src/FileDouble-OSX.cpp @@ -0,0 +1,11 @@ +// +// FileDouble-OSX.cpp +// CocoaExecutor +// +// Created by C.W. Betts on 8/2/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#include +#include "rsys/common.h" +#include "FileDouble-OSX.h" diff --git a/src/FileDouble-OSX.h b/src/FileDouble-OSX.h new file mode 100644 index 00000000..5751d1b2 --- /dev/null +++ b/src/FileDouble-OSX.h @@ -0,0 +1,20 @@ +// +// FileDouble-OSX.h +// CocoaExecutor +// +// Created by C.W. Betts on 8/2/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#ifndef __CocoaExecutor__FileDouble_OSX__ +#define __CocoaExecutor__FileDouble_OSX__ + +#include "rsys/filedouble.h" +#include "rsys/suffix_maps.h" +#include "rsys/osutil.h" + +namespace MacBridge { + +} + +#endif /* defined(__CocoaExecutor__FileDouble_OSX__) */ diff --git a/src/PSprint.c b/src/PSprint.mm similarity index 92% rename from src/PSprint.c rename to src/PSprint.mm index 3d0a81c8..5e22a270 100644 --- a/src/PSprint.c +++ b/src/PSprint.mm @@ -14,20 +14,8 @@ char ROMlib_rcsid_PSprint[] = "$Id: PSprint.c 87 2005-05-25 01:57:33Z ctm $"; #endif -#if defined(NEXTSTEP) - - -#if !defined(OPENSTEP) -#include -#include -#else -#include -#include -#include -#endif - -#include -#endif +#import +#import #include "MemoryMgr.h" #include "QuickDraw.h" @@ -46,6 +34,8 @@ char ROMlib_rcsid_PSprint[] = #include +using namespace Executor; + typedef struct { boolean_t rotated_p; @@ -57,10 +47,8 @@ rotation_t; PRIVATE rotation_t rotation; -#if !defined(NEXTSTEP) PUBLIC FILE *ROMlib_printfile; #define DPSContext long -typedef enum { NO, YES } boolean; PRIVATE DPSContext DPSGetCurrentContext(void) { @@ -319,7 +307,7 @@ PRIVATE void PSscale(float sx, float sy) } -PRIVATE void PSsendboolean(boolean flag) +PRIVATE void PSsendboolean(Executor::Boolean flag) { if (ROMlib_printfile) fprintf(ROMlib_printfile, "%s\n", flag ? "true" : "false"); @@ -409,12 +397,10 @@ PRIVATE void PStranslate(float x, float y) fprintf(ROMlib_printfile, "%f %f translate\n", x, y); } -#endif - typedef struct { - char *macfontname; - char *nextfontname; - char *suffix[4]; + const char *macfontname; + const char *nextfontname; + const char *suffix[4]; } fontentry_t; static fontentry_t fonttable[] = { @@ -476,7 +462,7 @@ static fontentry_t fonttable[] = { { "", "", "", "" } }, }; -comGrafPort printport; +comGrafPort Executor::printport; #define patCopy 8 @@ -791,7 +777,7 @@ static void doimage(LONGINT verb, comRect *rp, comGrafPtr thePortp) TEMP_ALLOC_FREE (temp_alloc_space); } -void ROMlib_gsave( void ) +void Executor::ROMlib_gsave( void ) { virtual_int_state_t block; @@ -800,7 +786,7 @@ void ROMlib_gsave( void ) restore_virtual_ints (block); } -void ROMlib_grestore( void ) +void Executor::ROMlib_grestore( void ) { virtual_int_state_t block; @@ -809,12 +795,12 @@ void ROMlib_grestore( void ) restore_virtual_ints (block); } -char ROMlib_suppressclip = NO; +char Executor::ROMlib_suppressclip = NO; static char reloadclip = NO; PRIVATE double save_xoffset, save_yoffset; -void ROMlib_rotatebegin( LONGINT flippage, LONGINT angle ) +void Executor::ROMlib_rotatebegin( LONGINT flippage, LONGINT angle ) { virtual_int_state_t block; @@ -827,7 +813,7 @@ void ROMlib_rotatebegin( LONGINT flippage, LONGINT angle ) restore_virtual_ints (block); } -void ROMlib_rotatecenter( double yoffset, double xoffset ) +void Executor::ROMlib_rotatecenter( double yoffset, double xoffset ) { DPSContext context; virtual_int_state_t block; @@ -845,7 +831,7 @@ void ROMlib_rotatecenter( double yoffset, double xoffset ) restore_virtual_ints (block); } -void ROMlib_rotateend( void ) +void Executor::ROMlib_rotateend( void ) { virtual_int_state_t block; @@ -974,7 +960,7 @@ static void findpreferred(StringPtr fname, int index, char *retval) int i; for (i = 0; i < (int) NELEM(fonttable); ++i) { - if (match255c(fname, fonttable[i].macfontname)) + if (match255c(fname, (char*)fonttable[i].macfontname)) /*-->*/ break; } if (i < (int) NELEM(fonttable)) @@ -987,7 +973,7 @@ static void findpreferred(StringPtr fname, int index, char *retval) } } -#if defined(NEXTSTEP) +#if defined(MACOSX_) /* * Trytomatch looks at the fonts that are actually present and verifies @@ -995,7 +981,7 @@ static void findpreferred(StringPtr fname, int index, char *retval) * is made. */ -static char *normals[] = { "UltraLight", +static const char *normals[] = { "UltraLight", "Thin", "Light", "ExtraLight", @@ -1006,7 +992,7 @@ static char *normals[] = { "UltraLight", "Medium", }; -static char *bolds[] = { "Demi", +static const char *bolds[] = { "Demi", "DemiBold", "SemiBold", "Bold", @@ -1020,7 +1006,7 @@ static char *bolds[] = { "Demi", "ExtraBlack", "Obese" }; -static char *italics[] = { "Italic", "Oblique" }; +static const char *italics[] = { "Italic", "Oblique" }; static int lookfor( char *str, char *table[], int tablelen, char startatleft ) { @@ -1066,20 +1052,10 @@ static int matchpercentage(char *value, int indx, const char *tomatch) retval = 0; if (( dash && strncmp(value, tomatch, dash - tomatch) == 0) || (!dash && strcmp (value, tomatch) == 0)) { -#if 0 - if (!dash || ndashes(value) == ndashes(tomatch)) - if (!indx) - retval = 100; /* perfect match */ - else - retval = 25; /* got the name, but nothing else */ - else { /* } */ -#else - { -#endif ++dash; - isnormal = lookfor(dash, normals, NELEM(normals), YES); - isbold = lookfor(dash, bolds, NELEM(bolds), YES); - isitalic = lookfor(dash, italics, NELEM(italics), NO); + isnormal = lookfor(dash, (char**)normals, NELEM(normals), YES); + isbold = lookfor(dash, (char**)bolds, NELEM(bolds), YES); + isitalic = lookfor(dash, (char**)italics, NELEM(italics), NO); switch (indx) { case 0: if (isnormal) @@ -1111,82 +1087,57 @@ static int matchpercentage(char *value, int indx, const char *tomatch) break; } } - } return retval; } -void ROMlib_trytomatch(char *retval, LONGINT index) +void Executor::ROMlib_trytomatch(char *retval, LONGINT index) { -#ifndef OPENSTEP - char **list, **pp; -#endif /* not OPENSTEP */ -/* id fmgr; */ +@autoreleasepool { const char *bestp; int bestn; int n; -#ifdef OPENSTEP NSArray *font_list; int i; -#endif /* OPENSTEP */ virtual_int_state_t block; block = block_virtual_ints (); -#ifndef OPENSTEP - list = ROMlib_availableFonts(); -#else /* OPENSTEP */ font_list = [[NSFontManager sharedFontManager] availableFonts]; -#endif /* OPENSTEP */ bestn = 0; #if !defined(LETGCCWAIL) bestp = 0; #endif -#ifndef OPENSTEP - for (pp = list; *pp && bestn != 100; ++pp) { - n = matchpercentage(retval, index, *pp); -#else /* OPENSTEP */ for (i = 0; i < [font_list count] && bestn != 100; ++i) { const char *font_name; - font_name = [[font_list objectAtIndex:i] cString]; - n = matchpercentage(retval, index, font_name); -#endif /* OPENSTEP */ - if (n > bestn) { - bestn = n; -#ifndef OPENSTEP - bestp = *pp; -#else /* OPENSTEP */ - bestp = font_name; -#endif /* OPENSTEP */ - } + font_name = [[font_list objectAtIndex:i] cStringUsingEncoding:NSMacOSRomanStringEncoding]; + n = matchpercentage(retval, index, font_name); + if (n > bestn) { + bestn = n; + bestp = font_name; + } } if (bestn > 0) - strcpy(retval, bestp); + strcpy(retval, bestp); else { - switch(index) { -#ifdef OPENSTEP -#warning We can do much better matching fonts under OpenStep -#endif /* OPENSTEP */ - default: - strcpy(retval, "Times-Roman"); - break; - case bold: - strcpy(retval, "Times-Bold"); - break; - case italic: - strcpy(retval, "Times-Italic"); - break; - case bold|italic: - strcpy(retval, "Times-BoldItalic"); - break; - } + switch(index) { + default: + strcpy(retval, "Times-Roman"); + break; + case bold: + strcpy(retval, "Times-Bold"); + break; + case italic: + strcpy(retval, "Times-Italic"); + break; + case bold|italic: + strcpy(retval, "Times-BoldItalic"); + break; + } } -#ifndef OPENSTEP - free(list); -#endif /* not OPENSTEP */ restore_virtual_ints (block); } -#endif +} static char *fnametofont(StringPtr fname, LONGINT txFace) { @@ -1195,9 +1146,7 @@ static char *fnametofont(StringPtr fname, LONGINT txFace) index = txFace & (bold|italic); findpreferred(fname, index, retval); -#if defined(NEXTSTEP) ROMlib_trytomatch(retval, index); -#endif if (txFace & outline) strcat(retval, "-Outline"); @@ -1225,12 +1174,12 @@ static char *fnametofont(StringPtr fname, LONGINT txFace) typedef struct { const char *old; - const char *new; + const char *new1; float multiplier; } substitute_t; -PUBLIC boolean_t substitute_fonts_p = FALSE; +PUBLIC boolean_t Executor::substitute_fonts_p = FALSE; PRIVATE float substitute_font_if_needed (char **fontp, LONGINT orig_size, @@ -1261,9 +1210,9 @@ substitute_font_if_needed (char **fontp, LONGINT orig_size, { char *newname; - newname = malloc (strlen (font) - len + - strlen (substitutions[i].new) + 1); - sprintf (newname, "%s%s", substitutions[i].new, font + len); + newname = (char*)malloc (strlen (font) - len + + strlen (substitutions[i].new1) + 1); + sprintf (newname, "%s%s", substitutions[i].new1, font + len); *fontp = newname; *need_to_freep = TRUE; retval = orig_size * substitutions[i].multiplier; @@ -1276,7 +1225,7 @@ substitute_font_if_needed (char **fontp, LONGINT orig_size, } void NeXTSetText(StringPtr fname, LONGINT txFace, LONGINT txSize, - LONGINT spExtra) + LONGINT spExtra) { char *font; float matrix[6]; @@ -1293,9 +1242,7 @@ void NeXTSetText(StringPtr fname, LONGINT txFace, LONGINT txSize, font_size = substitute_font_if_needed (&font, txSize, &need_to_free); -#if defined(NEXTSTEP) ROMlib_newFont(font, font_size); -#endif PSsendchararray(font, strlen(font)); matrix[0] = font_size; matrix[1] = 0; @@ -1360,7 +1307,7 @@ void pnupdate(comGrafPtr thePortp) } -void NeXTPrArc(LONGINT verb, comRect *rp, LONGINT starta, LONGINT arca, +void Executor::NeXTPrArc(LONGINT verb, comRect *rp, LONGINT starta, LONGINT arca, comGrafPtr thePortp) { if (rp->left != rp->right && @@ -1413,7 +1360,7 @@ void NeXTPrArc(LONGINT verb, comRect *rp, LONGINT starta, LONGINT arca, } PRIVATE int -num_image_bytes (numbytes, pixelsize, direct_color_p) +num_image_bytes (int numbytes, int pixelsize, int direct_color_p) { int retval; @@ -1446,7 +1393,7 @@ num_image_bytes (numbytes, pixelsize, direct_color_p) #define ROWMASK 0x1FFF #endif -void NeXTPrBits(comBitMap *srcbmp, comRect *srcrp, comRect *dstrp, +void Executor::NeXTPrBits(comBitMap *srcbmp, comRect *srcrp, comRect *dstrp, LONGINT mode, comRgnHandle mask, comGrafPtr thePortp) { float scalex, scaley; @@ -1562,12 +1509,12 @@ void NeXTPrBits(comBitMap *srcbmp, comRect *srcrp, comRect *dstrp, } else { - ColorSpec *ctab; + Executor::ColorSpec *ctab; int i; HIDDEN_PixMapPtr pxp; boolean_t has_warned_p; - pxp.p = (PixMapPtr) RM (srcpmp); + pxp.p = (Executor::PixMapPtr) RM (srcpmp); DPSPrintf (DPSGetCurrentContext (), "[/Indexed /DeviceRGB %d <\n", (1 << pixelsize) - 1); @@ -1634,7 +1581,7 @@ void NeXTPrBits(comBitMap *srcbmp, comRect *srcrp, comRect *dstrp, TEMP_ALLOC_FREE (temp_alloc_space); } -void NeXTPrLine(comPoint to, comGrafPtr thePortp) +void Executor::NeXTPrLine(comPoint to, comGrafPtr thePortp) { float temp, fromh, fromv, toh, tov; short psh, psv; @@ -1690,23 +1637,23 @@ void NeXTPrLine(comPoint to, comGrafPtr thePortp) restore_virtual_ints (block); } -void NeXTPrOval(LONGINT verb, comRect *rp, comGrafPtr thePortp) +void Executor::NeXTPrOval(LONGINT verb, comRect *rp, comGrafPtr thePortp) { NeXTPrArc(verb, rp, 0, 360, thePortp); } #if 1 -void NeXTPrGetPic(comPtr dp, LONGINT bc, comGrafPtr thePortp) +void Executor::NeXTPrGetPic(comPtr dp, LONGINT bc, comGrafPtr thePortp) { gui_abort(); } #endif -void NeXTPrPutPic(comPtr sp, LONGINT bc, comGrafPtr thePortp) +void Executor::NeXTPrPutPic(comPtr sp, LONGINT bc, comGrafPtr thePortp) { } -void NeXTPrPoly(LONGINT verb, comPolyHandle ph, comGrafPtr thePortp) +void Executor::NeXTPrPoly(LONGINT verb, comPolyHandle ph, comGrafPtr thePortp) { comPoint *pp, *ep, firstp; virtual_int_state_t block; @@ -1750,7 +1697,7 @@ void NeXTPrPoly(LONGINT verb, comPolyHandle ph, comGrafPtr thePortp) restore_virtual_ints (block); } -void NeXTPrRRect(LONGINT verb, comRect *rp, LONGINT width, LONGINT height, +void Executor::NeXTPrRRect(LONGINT verb, comRect *rp, LONGINT width, LONGINT height, comGrafPtr thePortp) { float sfactor, midy, rt, rb, rl, rr, sfactor2; @@ -1807,7 +1754,7 @@ void NeXTPrRRect(LONGINT verb, comRect *rp, LONGINT width, LONGINT height, } -void NeXTPrRect(LONGINT verb, comRect *rp, comGrafPtr thePortp) +void Executor::NeXTPrRect(LONGINT verb, comRect *rp, comGrafPtr thePortp) { short psh, psv; virtual_int_state_t block; @@ -1838,15 +1785,15 @@ void NeXTPrRect(LONGINT verb, comRect *rp, comGrafPtr thePortp) restore_virtual_ints (block); } -void NeXTPrRgn(LONGINT verb, comRgnHandle rgn, comGrafPtr thePortp) +void Executor::NeXTPrRgn(LONGINT verb, comRgnHandle rgn, comGrafPtr thePortp) { /* NOP */ } -short NeXTPrTxMeas(LONGINT n, comPtr p, comPoint *nump, comPoint *denp, +short Executor::NeXTPrTxMeas(LONGINT n, comPtr p, comPoint *nump, comPoint *denp, comFontInfo *finfop, comGrafPtr thePortp) { - Point num, den; + Executor::Point num, den; virtual_int_state_t block; short retval; @@ -1854,7 +1801,7 @@ short NeXTPrTxMeas(LONGINT n, comPtr p, comPoint *nump, comPoint *denp, block = block_virtual_ints (); num.h = num.v = den.h = den.v = CWC (0x100); retval = ROMlib_StdTxMeas(n, - (Ptr) p, (Point *) &num, (Point *) &den, NULL); + (Ptr) p, &num, &den, NULL); restore_virtual_ints (block); RESTOREA5; return (float) retval * CW (num.h) / CW (den.h); @@ -1983,7 +1930,7 @@ static void doashow(char *translated, LONGINT n, int i, short total) DPSPrintf(DPSGetCurrentContext(), "ashow\n"); } -void NeXTsendps (LONGINT n, comPtr textbufp) +void Executor::NeXTsendps (LONGINT n, comPtr textbufp) { virtual_int_state_t block; @@ -2048,8 +1995,8 @@ enum symbol_char #define CHAR_REPLACE(s) \ case mac_char_ ## s: \ - retval = symbol_char_ ##s; \ - is_symbol = TRUE; \ + retval = symbol_char_ ##s; \ + is_symbol = TRUE; \ break PRIVATE unsigned char @@ -2126,7 +2073,7 @@ find_run_of_symbol_chars (LONGINT n, comPtr textbufp, int *run_startp, *run_stopp = stop; } -void NeXTPrText(LONGINT n, comPtr textbufp, comPoint num, comPoint den, +void Executor::NeXTPrText(LONGINT n, comPtr textbufp, comPoint num, comPoint den, comGrafPtr thePortp) { virtual_int_state_t block; @@ -2188,7 +2135,7 @@ void NeXTPrText(LONGINT n, comPtr textbufp, comPoint num, comPoint den, } total = NeXTPrTxMeas(n, textbufp, &num, &den, (comFontInfo *) 0, thePortp); - translated = alloca(n + 1); + translated = (char*)alloca(n + 1); memcpy(translated, textbufp, n); /* strip trailing s */ while (n > 0 && translated[n-1] == '\r') @@ -2230,7 +2177,7 @@ void NeXTPrText(LONGINT n, comPtr textbufp, comPoint num, comPoint den, } } -void NeXTOpenPage( void ) +void Executor::NeXTOpenPage( void ) { /* * TODO: make sure that the open page really conforms to what InitPort @@ -2256,23 +2203,23 @@ enable_copybits (void) #define FIX_TO_FLOAT(x) ((float) (x) / (1 << 16)) PUBLIC void -do_textbegin (TTxtPicHdl h) +Executor::do_textbegin (TTxtPicHdl h) { disable_copybits (); - rotation.angle = GetHandleSize ((Handle) h) >= 10 + rotation.angle = Executor::GetHandleSize ((Handle) h) >= 10 ? FIX_TO_FLOAT (TEXTPIC_ANGLE_FIXED (h)) : TEXTPIC_ANGLE (h); rotation.rotated_p = TRUE; } PUBLIC void -do_textcenter (TCenterRecHdl h) +Executor::do_textcenter (TCenterRecHdl h) { rotation.center_x = FIX_TO_FLOAT (TEXTCENTER_X (h)); rotation.center_y = FIX_TO_FLOAT (TEXTCENTER_Y (h)); } PUBLIC void -do_textend (void) +Executor::do_textend (void) { if (rotation.rotated_p) { @@ -2280,3 +2227,5 @@ do_textend (void) enable_copybits (); } } + +#endif diff --git a/src/PSstrings.c b/src/PSstrings.cpp similarity index 95% rename from src/PSstrings.c rename to src/PSstrings.cpp index 99350544..d45aa99a 100644 --- a/src/PSstrings.c +++ b/src/PSstrings.cpp @@ -10,7 +10,9 @@ char ROMlib_rcsid_PSstrings[] = #include "rsys/common.h" #include "rsys/PSstrings.h" -const char ROMlib_doc_begin[] = +using namespace Executor; + +const char Executor::ROMlib_doc_begin[] = "%%!PS-Adobe-3.0\n" "%%%%Creator: Executor\n" "%%%%DocumentFonts: (atend)\n" @@ -22,7 +24,7 @@ const char ROMlib_doc_begin[] = "%%%%BeginProlog\n" "\n"; -const char ROMlib_doc_prolog[] = +const char Executor::ROMlib_doc_prolog[] = "/MacEncoding StandardEncoding 256 array copy def\n" "\n" "128\n" @@ -159,7 +161,7 @@ const char ROMlib_doc_prolog[] = "%% } if\n" "%% } if\n"; -const char ROMlib_doc_end_prolog[] = +const char Executor::ROMlib_doc_end_prolog[] = "gsave\n" "-1 -9 translate\n" " /__NXbasematrix matrix currentmatrix def\n" @@ -173,12 +175,12 @@ const char ROMlib_doc_end_prolog[] = "%%%%EndSetup\n"; -const char ROMlib_doc_end[] = +const char Executor::ROMlib_doc_end[] = "%%%%Trailer\n" "%%%%Pages: %d\n" "%%%%BoundingBox:0 0 %d %d\n"; -const char ROMlib_page_begin[] = +const char Executor::ROMlib_page_begin[] = "%%%%Page: %d %d\n" "%%%%PageBoundingBox: 0 0 %d %d\n" "%%%%PageFonts: (atend)\n" @@ -210,21 +212,15 @@ const char ROMlib_page_begin[] = "%% doesn't wrap EPS files properly and we can't tell where\n" "%% the PostScript we're printing comes from.\n" "%%%%BeginDocument: IWishWeDidntHaveToDoThis\n" -#if !defined (NEXTSTEP) "gsave\n" -#endif ; -const char ROMlib_page_end[] = -#if !defined (NEXTSTEP) +const char Executor::ROMlib_page_end[] = "grestore\n" -#endif "%%%%EndDocument\n" "/showpage systemdict begin { showpage } bind end def\n" -#if !defined (NEXTSTEP) "showpage\n" "__NXsheetsavetoken restore\n" "%%%%PageTrailer\n" -#endif ; diff --git a/src/aboutbox.c b/src/aboutbox.cpp similarity index 86% rename from src/aboutbox.c rename to src/aboutbox.cpp index c5163534..996224b7 100644 --- a/src/aboutbox.c +++ b/src/aboutbox.cpp @@ -25,10 +25,10 @@ char ROMlib_rcsid_aboutbox[] = #include "FontMgr.h" #include "OSUtil.h" #include -#include -#include -#include -#include +#include "rsys/file.h" +#include "rsys/osutil.h" +#include "SegmentLdr.h" +#include "rsys/segment.h" #include "rsys/notmac.h" #include "rsys/custom.h" #include "rsys/gestalt.h" @@ -55,7 +55,9 @@ char ROMlib_rcsid_aboutbox[] = #define COPYRIGHT_STRING_1 "Copyright \251 ARDI 1986-2006" #define COPYRIGHT_STRING_2 "All rights reserved." -static struct { char *name, *text; ControlHandle ctl; } about_box_buttons[] = { +using namespace Executor; + +static struct { const char *name;char *text; ControlHandle ctl; } about_box_buttons[] = { { LICENSE_BUTTON_NAME, NULL /* generated on the fly from licensetext.c */, NULL }, @@ -160,7 +162,7 @@ enough_time_has_passed (void) } /* Menu name for the about box. */ -StringPtr about_box_menu_name_pstr = (StringPtr) "\022\000About Executor..."; +StringPtr Executor::about_box_menu_name_pstr = (StringPtr) "\022\000About Executor..."; static void help_scroll (ControlHandle c, INTEGER part) @@ -245,12 +247,13 @@ create_license_text (void) if (about_box_buttons[b].text == NULL) { long new_size; - char *license_text, *p, *q, *licensep; + char *license_text, *p, *q; + const char *licensep; new_size = 0; /* Compute the length of the license string. */ - for (licensep = ROMlib_licensep ? (char *) ROMlib_licensep->chars : ""; + for (licensep = ROMlib_licensep ? (const char *) ROMlib_licensep->chars : ""; *licensep;) { int title_len; @@ -350,7 +353,7 @@ find_tips (tip_t *tips, const char *p) } static void -add_to_str (char **pp, char *ip, int n) +add_to_str (char **pp, const char *ip, int n) { int i; @@ -370,7 +373,7 @@ parse_and_randomize_tips (char *buf) int i; n_tips = approximate_tips (buf); - tips = alloca (n_tips * sizeof *tips); + tips = (tip_t*)alloca (n_tips * sizeof *tips); n_tips = find_tips (tips, buf); chars_needed = 0; @@ -378,7 +381,7 @@ parse_and_randomize_tips (char *buf) chars_needed += tips[i].tip_length; chars_needed += 2 * (n_tips - 1) + 1; - retval = malloc (chars_needed); + retval = (char*)malloc (chars_needed); seen_tip = FALSE; p = retval; while (n_tips) @@ -410,7 +413,7 @@ create_tips_text (void) { srand (Ticks); /* NOTE: we don't care that rand/srand is not a particular good way to generate random numbers */ - orig_text = about_box_buttons[b].text; + orig_text = (char*)about_box_buttons[b].text; } if (about_box_buttons[b].text == orig_text) { @@ -651,72 +654,69 @@ event_loop (boolean_t executor_p) old_scroll_bar_value = GetCtlValue (about_scrollbar); - for (done_p = FALSE; !done_p; ) - { - GetNextEvent (( mDownMask | mUpMask - | keyDownMask | keyUpMask | autoKeyMask - | updateMask | activMask), &evt); - - TEIdle (about_te); - - switch (CW (evt.what)) - { - case updateEvt: - BeginUpdate (about_box); - PenNormal (); - ForeColor (blackColor); - BackColor (whiteColor); - EraseRect (&about_box->portRect); - TextFont (helvetica); - TextSize (24); - MoveTo (TE_LEFT, 30); - if (executor_p) - DrawText_c_string ((char *) ROMlib_executor_full_name); - else - DrawText_c_string ((char *) "Carbonless Copies Runtime System"); - TextSize (12); - MoveTo (TE_LEFT, 49); - DrawText_c_string (COPYRIGHT_STRING_1); - MoveTo (TE_LEFT, 62); - DrawText_c_string (COPYRIGHT_STRING_2); - draw_status_info (executor_p); - FrameRect (&frame_rect); - TEUpdate (&te_dest_rect, about_te); - DrawControls (about_box); - EndUpdate (about_box); - break; - - case keyDown: - case autoKey: + for (done_p = FALSE; !done_p; ) { + GetNextEvent (( mDownMask | mUpMask + | keyDownMask | keyUpMask | autoKeyMask + | updateMask | activMask), &evt); + + TEIdle (about_te); + + switch (CW (evt.what)) { + case updateEvt: + BeginUpdate (about_box); + PenNormal (); + ForeColor (blackColor); + BackColor (whiteColor); + EraseRect (&about_box->portRect); + TextFont (helvetica); + TextSize (24); + MoveTo (TE_LEFT, 30); + if (executor_p) + DrawText_c_string ((char *) ROMlib_executor_full_name); + else + DrawText_c_string ((char *) "Carbonless Copies Runtime System"); + TextSize (12); + MoveTo (TE_LEFT, 49); + DrawText_c_string (COPYRIGHT_STRING_1); + MoveTo (TE_LEFT, 62); + DrawText_c_string (COPYRIGHT_STRING_2); + draw_status_info (executor_p); + FrameRect (&frame_rect); + TEUpdate (&te_dest_rect, about_te); + DrawControls (about_box); + EndUpdate (about_box); + break; + + case keyDown: + case autoKey: { char ch; - + ch = CL (evt.message) & 0xFF; - switch (ch) - { + switch (ch) { case '\r': case NUMPAD_ENTER: - done_p = TRUE; - break; + done_p = TRUE; + break; default: - TEKey (ch, about_te); - break; - } + TEKey (ch, about_te); + break; + } } - break; - + break; + #define _FindControl(arg0, arg1, arg2) \ - ({ \ - int16 retval; \ - HIDDEN_ControlHandle bogo_c; \ - \ - retval = FindControl (arg0, arg1, &bogo_c); \ - *(arg2) = MR (bogo_c.p); \ - \ - retval; \ - }) - - case mouseDown: +({ \ +int16 retval; \ +HIDDEN_ControlHandle bogo_c; \ +\ +retval = FindControl (arg0, arg1, &bogo_c); \ +*(arg2) = MR (bogo_c.p); \ +\ +retval; \ +}) + + case mouseDown: { Point local_pt; boolean_t control_p; @@ -729,65 +729,62 @@ event_loop (boolean_t executor_p) control_p = _FindControl (local_pt, about_box, &c); if (!control_p) SysBeep (1); - else - { - if (c == about_scrollbar) - { + else { + if (c == about_scrollbar) { int new_val, delta; INTEGER part; part = TestControl (c, local_pt); if (TrackControl (c, local_pt, - (part == inThumb - ? (ProcPtr) -1 - : scroll_bar_callback)) - == inThumb) - { - new_val = GetCtlValue (about_scrollbar); - delta = new_val - old_scroll_bar_value; - if (delta != 0) + (part == inThumb + ? (ProcPtr) -1 + : scroll_bar_callback)) + == inThumb) { + new_val = GetCtlValue (about_scrollbar); + delta = new_val - old_scroll_bar_value; + if (delta != 0) { TEScroll (0, -delta * TE_LINE_HEIGHT (about_te), - about_te); + about_te); } - } + } old_scroll_bar_value = GetCtlValue (about_scrollbar); } - else if (TrackControl (c, local_pt, (ProcPtr) -1) - == inButton) + else if (TrackControl (c, local_pt, (ProcPtr) -1) + == inButton) { int new_text; new_text = CTL_REF_CON (c); if (new_text != which_text) - { - if (!strcmp (about_box_buttons[new_text].name, - DONE_BUTTON_NAME)) - done_p = TRUE; - else + { + if (!strcmp (about_box_buttons[new_text].name, + DONE_BUTTON_NAME)) + done_p = TRUE; + else { set_current_button (new_text); which_text = new_text; } - } + } } - } + } } - break; + break; - case activateEvt: - case mouseUp: - case keyUp: - break; + case activateEvt: + case mouseUp: + case keyUp: + break; } - } + } } void -do_about_box (void) +Executor::do_about_box (void) { static boolean_t busy_p = FALSE; diff --git a/src/adb.c b/src/adb.cpp similarity index 92% rename from src/adb.c rename to src/adb.cpp index 1e167bca..b5c7c9e1 100644 --- a/src/adb.c +++ b/src/adb.cpp @@ -42,21 +42,23 @@ char ROMlib_rcsid_adb[] = * make sense to think of all the ways it is incomplete */ +using namespace Executor; + PUBLIC void -ADBReInit (void) +Executor::ADBReInit (void) { warning_unimplemented (NULL_STRING); } PUBLIC OSErr -ADBOp (Ptr data, ProcPtr procp, Ptr buffer, INTEGER command) +Executor::ADBOp (Ptr data, ProcPtr procp, Ptr buffer, INTEGER command) { warning_unimplemented (NULL_STRING); return noErr; } PUBLIC INTEGER -CountADBs (void) +Executor::CountADBs (void) { warning_unimplemented (NULL_STRING); return 1; @@ -68,18 +70,18 @@ PRIVATE Ptr adb_service_procp = 0; /* stored as though in lowglobal */ PRIVATE Ptr adb_data_ptr = (Ptr) 0x90ABCDEF; PUBLIC void -C_adb_service_stub (void) +Executor::C_adb_service_stub (void) { } PUBLIC void -reset_adb_vector (void) +Executor::reset_adb_vector (void) { adb_service_procp = 0; } PUBLIC OSErr -GetIndADB (ADBDataBlock *adbp, INTEGER index) +Executor::GetIndADB (ADBDataBlock *adbp, INTEGER index) { OSErr retval; @@ -100,7 +102,7 @@ GetIndADB (ADBDataBlock *adbp, INTEGER index) } PUBLIC OSErr -GetADBInfo (ADBDataBlock *adbp, INTEGER address) +Executor::GetADBInfo (ADBDataBlock *adbp, INTEGER address) { OSErr retval; @@ -113,7 +115,7 @@ GetADBInfo (ADBDataBlock *adbp, INTEGER address) } PUBLIC OSErr -SetADBInfo (ADBSetInfoBlock *adbp, INTEGER address) +Executor::SetADBInfo (ADBSetInfoBlock *adbp, INTEGER address) { OSErr retval; @@ -153,7 +155,7 @@ call_patched_adb_vector (char *message) EM_A0 = save_a0; } -static int +static inline int pin (int val, int min, int max) { int retval; @@ -178,7 +180,7 @@ enum { BUTTON_UP_BIT = 0x80 }; */ PUBLIC void -adb_apeiron_hack (boolean_t deltas_p, ...) +Executor::adb_apeiron_hack (boolean_t deltas_p, ...) { static boolean_t been_here = FALSE; static long old_x; diff --git a/src/alias.c b/src/alias.cpp similarity index 97% rename from src/alias.c rename to src/alias.cpp index a69b1925..7e2de42e 100644 --- a/src/alias.c +++ b/src/alias.cpp @@ -27,6 +27,8 @@ char ROMlib_rcsid_alias[] = #define paramErr (-50) +using namespace Executor; + /* NOTE: if we want to be more like the Mac, we should have a 'fld#',0 resource that will have in it: type, four bytes of 0, pascal string, potential padding to even things up, type, four bytes of 0, ... */ @@ -72,7 +74,7 @@ get_sys_vref_and_dirid (INTEGER *sys_vrefp, LONGINT *sys_diridp) wdp.ioVRefNum = BootDrive; wdp.ioWDIndex = CWC (0); - wdp.ioNamePtr = CLC (0); + wdp.ioNamePtr = (StringPtr)CLC (0); err = PBGetWDInfo (&wdp, FALSE); if (err == noErr) { @@ -156,41 +158,38 @@ last_chance_tmp_vref_and_dirid (INTEGER vref, INTEGER *tmp_vrefp, LONGINT *tmp_diridp) { OSErr retval; - HParamBlockRec pb; - - memset (&pb, 0, sizeof pb); + HParamBlockRec pb = {0}; + pb.volumeParam.ioVRefNum = CW (vref); retval = PBHGetVInfo (&pb, FALSE); - if (retval == noErr) - { - static char *top_level_names[] = - { - "\3tmp", - "\4temp", - }; - int i; - OSErr err; - - *tmp_vrefp = vref; - - for (i = 0, err = fnfErr; - err != noErr && i < NELEM (top_level_names); - ++i) + if (retval == noErr) { + static const unsigned char *top_level_names[] = { + "\ptmp", + "\ptemp", + }; + int i; + OSErr err; + + *tmp_vrefp = vref; + + for (i = 0, err = fnfErr; + err != noErr && i < NELEM (top_level_names); + ++i) { CInfoPBRec hpb; - + memset (&hpb, 0, sizeof hpb); hpb.dirInfo.ioNamePtr = (StringPtr) RM (top_level_names[i]); hpb.dirInfo.ioVRefNum = pb.volumeParam.ioVRefNum; hpb.dirInfo.ioDrDirID = CLC (2); err = PBGetCatInfo (&hpb, FALSE); if (err == noErr && (hpb.hFileInfo.ioFlAttrib & ATTRIB_ISADIR)) - *tmp_diridp = CL (hpb.dirInfo.ioDrDirID); + *tmp_diridp = CL (hpb.dirInfo.ioDrDirID); } - if (err != noErr) - *tmp_diridp = CLC (2); - } - + if (err != noErr) + *tmp_diridp = CLC (2); + } + return retval; } @@ -232,7 +231,7 @@ get_tmp_vref_and_dirid (INTEGER vref, INTEGER *tmp_vrefp, LONGINT *tmp_diridp) if (guesses[j]) { - p = alloca (strlen (guesses[j]) + 1); + p = (char*)alloca (strlen (guesses[j]) + 1); strcpy (p, guesses[j]); ROMlib_automount (p); } @@ -466,11 +465,10 @@ P3 (PUBLIC pascal trap, OSErr, GetAliasInfo, } PRIVATE int -EVENUP (n) +EVENUP (int n) { - int retval; + int retval = n; - retval = n; if (retval & 1) ++retval; return retval; diff --git a/src/appearance.c b/src/appearance.cpp similarity index 90% rename from src/appearance.c rename to src/appearance.cpp index 9a769c4c..1c843a51 100644 --- a/src/appearance.c +++ b/src/appearance.cpp @@ -20,6 +20,8 @@ char ROMlib_rcsid_appearance[] = #include "rsys/error.h" #include "rsys/options.h" +using namespace Executor; + PRIVATE appearance_t appearance = appearance_sys7; /* @@ -28,8 +30,8 @@ PRIVATE appearance_t appearance = appearance_sys7; PRIVATE StringPtr res_filenames[] = { - (StringPtr) "\010mac.rsrc", - (StringPtr) "\014windows.rsrc", + (StringPtr) "\pmac.rsrc", + (StringPtr) "\pwindows.rsrc", }; /* Exactly the same as CountTypes, except only the resource file with the @@ -206,12 +208,12 @@ silently_replace_resources (INTEGER master_file_rn, INTEGER from_file_rn) } PUBLIC void -ROMlib_set_appearance (void) +Executor::ROMlib_set_appearance (void) { INTEGER res_file; if (appearance < 0 || appearance >= NELEM (res_filenames)) - appearance = 0; + appearance = (appearance_t)0; res_file = OpenRFPerm (res_filenames[appearance], CW (BootDrive), fsRdPerm); if (res_file != CWC (-1)) @@ -221,32 +223,28 @@ ROMlib_set_appearance (void) } else if (appearance != 0) { - appearance = 0; + appearance = (appearance_t)0; ROMlib_set_appearance (); } } PUBLIC boolean_t -ROMlib_parse_appearance (const char *appearance_str) +Executor::ROMlib_parse_appearance (const char *appearance_str) { - boolean_t retval; - - retval = TRUE; - + boolean_t retval = TRUE; + if (strcasecmp (appearance_str, "mac") == 0) - appearance = appearance_sys7; - else if (strcasecmp (appearance_str, "windows") == 0) - { - ROMlib_options |= ROMLIB_RECT_SCREEN_BIT; - appearance = appearance_win3; - } - else - retval = FALSE; - + appearance = appearance_sys7; + else if (strcasecmp (appearance_str, "windows") == 0) { + ROMlib_options |= ROMLIB_RECT_SCREEN_BIT; + appearance = appearance_win3; + } else + retval = FALSE; + return retval; } -PUBLIC appearance_t ROMlib_get_appearance (void) +PUBLIC appearance_t Executor::ROMlib_get_appearance (void) { return appearance; } diff --git a/src/autorefresh.c b/src/autorefresh.cpp similarity index 99% rename from src/autorefresh.c rename to src/autorefresh.cpp index defe27b2..f9f3454f 100644 --- a/src/autorefresh.c +++ b/src/autorefresh.cpp @@ -24,6 +24,7 @@ char ROMlib_rcsid_autorefresh[] = * of the screen, we know we need to turn on "refresh" mode. */ +namespace Executor { static boolean_t executor_changed_screen_p[NUM_AUTOREFRESH_STRIPS]; @@ -150,3 +151,4 @@ autodetect_refresh (void) return need_refresh_p; } +} diff --git a/src/balloon.c b/src/balloon.cpp similarity index 98% rename from src/balloon.c rename to src/balloon.cpp index 69a1300d..4a2177df 100644 --- a/src/balloon.c +++ b/src/balloon.cpp @@ -10,6 +10,8 @@ char ROMlib_rcsid_balloon[] = #include "rsys/common.h" #include "HelpMgr.h" +using namespace Executor; + P0 (PUBLIC pascal trap, BOOLEAN, HMGetBalloons) { warning_unimplemented (NULL_STRING); @@ -53,7 +55,7 @@ P0 (PUBLIC pascal trap, OSErr, HMRemoveBalloon) P1 (PUBLIC pascal trap, OSErr, HMGetHelpMenuHandle, MenuHandle *, mhp) { warning_unimplemented (NULL_STRING); - *mhp = CLC (0); + *mhp = (MenuHandle)CLC (0); return noErr; } diff --git a/src/bindec.c b/src/bindec.cpp similarity index 56% rename from src/bindec.c rename to src/bindec.cpp index 1d9c50a1..d1c9e18e 100644 --- a/src/bindec.c +++ b/src/bindec.cpp @@ -11,56 +11,59 @@ char ROMlib_rcsid_bindec[] = #include "rsys/common.h" #include "rsys/glue.h" +#include "BinaryDecimal.h" + +using namespace Executor; A2(PUBLIC trap, void, NumToString, LONGINT, l, StringPtr, s) { - register Byte *p = s+1; - register LONGINT d; + Byte *p = s+1; + LONGINT d; if (l == 0) { - s[0] = 1; - *p = '0'; - return; + s[0] = 1; + *p = '0'; + return; } else if ((uint32) l == 0x80000000L) { - register char *q = "-2147483648"; - s[0] = 11; - while (*q) - *p++ = *q++; /* DON'T put the null byte in */ - return; + const char *q = "-2147483648"; + s[0] = 11; + while (*q) + *p++ = *q++; /* DON'T put the null byte in */ + return; } else if (l < 0) { - *p++ = '-'; - l = -l; + *p++ = '-'; + l = -l; } d = 1000000000L; while (!(*p = l / d)) /* must find something */ - d /= 10; + d /= 10; l -= d * *p; d /= 10; *p++ += '0'; while (d) { - l -= (*p = l / d) * d; - *p++ += '0'; - d /= 10; + l -= (*p = l / d) * d; + *p++ += '0'; + d /= 10; } s[0] = p - (s+1); } A2(PUBLIC trap, void, StringToNum, StringPtr, s, LONGINT *, lp) { - register char *p = (char *)s+1; - register char *ep = p + s[0]; - register LONGINT l = 0; + char *p = (char *)s+1; + char *ep = p + s[0]; + LONGINT l = 0; int sign = 1; if (p != ep) { - if (*p == '+') - p++; - else if (*p == '-') { - p++; - sign = -1; - } + if (*p == '+') + p++; + else if (*p == '-') { + p++; + sign = -1; + } } while (p != ep) - l = l * 10 + (*p++ & 0xF); + l = l * 10 + (*p++ & 0xF); *lp = sign * l; } diff --git a/src/blockdev.c b/src/blockdev.cpp similarity index 93% rename from src/blockdev.c rename to src/blockdev.cpp index 41e4ae37..813b9570 100644 --- a/src/blockdev.c +++ b/src/blockdev.cpp @@ -13,6 +13,7 @@ char ROMlib_rcsid_blockdev[] = #include "rsys/dcache.h" #include "rsys/file.h" +using namespace Executor; /* Opens and returns a new blockdev_t structure. Close it with * blockdev_close when you are done with it. @@ -30,7 +31,7 @@ blockdev_open (uint32 block_size, { blockdev_t *b; - b = malloc (sizeof *b); + b = (blockdev_t*)malloc (sizeof *b); if (b) { static uint32 unique_dcache_tag; @@ -61,7 +62,7 @@ blockdev_open (uint32 block_size, * the given device. Returns TRUE on success, else FALSE. */ boolean_t -blockdev_seek_set (blockdev_t *b, uint32 offset) +Executor::blockdev_seek_set (blockdev_t *b, uint32 offset) { boolean_t success_p; success_p = (b->seek_func (offset, L_SET) == 0); @@ -77,7 +78,7 @@ blockdev_seek_set (blockdev_t *b, uint32 offset) * the given device. Returns TRUE on success, else FALSE. */ boolean_t -blockdev_read (blockdev_t *b, uint32 offset, void *buf, uint32 num_bytes) +Executor::blockdev_read (blockdev_t *b, uint32 offset, void *buf, uint32 num_bytes) { boolean_t retval; @@ -135,7 +136,7 @@ blockdev_read (blockdev_t *b, uint32 offset, void *buf, uint32 num_bytes) * the given device. Returns TRUE on success, else FALSE. */ boolean_t -blockdev_write (blockdev_t *b, uint32 offset, const void *buf, +Executor::blockdev_write (blockdev_t *b, uint32 offset, const void *buf, uint32 num_bytes) { boolean_t retval; @@ -192,12 +193,11 @@ blockdev_write (blockdev_t *b, uint32 offset, const void *buf, void -blockdev_close (blockdev_t *b) +Executor::blockdev_close (blockdev_t *b) { if (!b->valid_p) gui_fatal ("Closing an invalid block device!"); - else - { + else { dcache_invalidate (b->dcache_tag); b->close_func (b->fd); b->valid_p = FALSE; diff --git a/src/cfm.c b/src/cfm.cpp similarity index 99% rename from src/cfm.c rename to src/cfm.cpp index afb853f1..51ca499e 100644 --- a/src/cfm.c +++ b/src/cfm.cpp @@ -34,6 +34,8 @@ #include "ppc_stubs.h" +using namespace Executor; + typedef enum { process_share = 1, diff --git a/src/check_structs.c b/src/check_structs.cpp similarity index 92% rename from src/check_structs.c rename to src/check_structs.cpp index c98612b7..a359e205 100644 --- a/src/check_structs.c +++ b/src/check_structs.cpp @@ -18,62 +18,62 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ADB.h" +#include "AliasMgr.h" +#include "AppleEvents.h" +#include "AppleTalk.h" +#include "BinaryDecimal.h" +#include "CommTool.h" +#include "Components.h" +#include "ControlMgr.h" +#include "CQuickDraw.h" +#include "DeskMgr.h" +#include "DeviceMgr.h" +#include "DialogMgr.h" +#include "Disk.h" +#include "DiskInit.h" +#include "EditionMgr.h" +#include "EventMgr.h" +#include "FileMgr.h" +#include "Finder.h" +#include "FontMgr.h" +#include "Gestalt.h" +#include "HelpMgr.h" +#include "Iconutil.h" +#include "IntlUtil.h" +#include "ListMgr.h" +#include "MacTypes.h" +#include "MemoryMgr.h" +#include "MenuMgr.h" +#include "NotifyMgr.h" +#include "OSEvent.h" +#include "OSUtil.h" +#include "Package.h" +#include "PPC.h" +#include "PrintMgr.h" +#include "ProcessMgr.h" +#include "QuickDraw.h" +#include "QuickTime.h" +#include "ResourceMgr.h" +#include "SANE.h" +#include "ScrapMgr.h" +#include "ScriptMgr.h" +#include "SegmentLdr.h" +#include "Serial.h" +#include "ShutDown.h" +#include "SoundDvr.h" +#include "SoundMgr.h" +#include "StartMgr.h" +#include "StdFilePkg.h" +#include "SysErr.h" +#include "TextEdit.h" +#include "ThinkC.h" +#include "TimeMgr.h" +#include "ToolboxEvent.h" +#include "ToolboxUtil.h" +#include "VDriver.h" +#include "VRetraceMgr.h" +#include "WindowMgr.h" #include #include @@ -119,7 +119,9 @@ (size_t) expected_size, sizeof(type)); \ } while (false) -void check_structs(void) +using namespace Executor; + +void Executor::check_structs(void) { /* ADB.h */ check (ADBDataBlock, 10); diff --git a/src/checkpoint.c b/src/checkpoint.cpp similarity index 100% rename from src/checkpoint.c rename to src/checkpoint.cpp diff --git a/src/cleanup.c b/src/cleanup.cpp similarity index 100% rename from src/cleanup.c rename to src/cleanup.cpp diff --git a/src/color_wheel_bits.c b/src/color_wheel_bits.c deleted file mode 100644 index db67911a..00000000 --- a/src/color_wheel_bits.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright 1995-1997 by Abacus Research and - * Development, Inc. All rights reserved. - */ - -#if !defined (OMIT_RCSID_STRINGS) -char ROMlib_rcsid_color_wheel_bits[] = "$Id: color_wheel_bits.c 63 2004-12-24 18:19:43Z ctm $"; -#endif - -#include "rsys/color_wheel_bits.h" - -char color_wheel_bits_4[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,143,255,255,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,248,56,136,56,136,136,136,136,136,136,130,136,130,136,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,243,131,136,56,131,136,136,131,35,136,136,136,130,50,136,130,136,40,130,130,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,243,131,131,136,56,131,136,131,136,136,136,136,136,136,136,130,136,136,40,130,130,136,40,40,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,243,131,131,131,131,136,56,131,136,131,136,136,131,35,35,40,136,136,130,136,130,136,40,40,40,40,34,130,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,51,131,56,56,56,56,56,56,131,136,131,35,136,136,136,136,136,136,130,136,130,136,40,130,136,40,40,40,34,130,47,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,243,56,51,131,56,56,56,56,56,131,136,56,136,131,136,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,243,51,131,51,131,131,56,56,56,131,136,56,136,56,136,136,136,50,50,50,136,136,130,136,130,136,40,40,130,130,130,130,40,34,40,34,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,51,51,131,51,131,56,56,56,56,56,56,56,131,136,131,136,136,50,50,50,50,136,136,130,136,130,136,40,130,130,130,130,40,34,130,34,130,34,47,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,51,51,51,131,51,131,56,56,56,56,56,56,131,136,56,136,131,136,136,136,136,136,136,130,136,130,136,40,130,130,130,130,130,40,34,130,34,130,34,34,47,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,51,51,51,131,51,131,56,51,131,56,56,56,56,131,136,131,136,136,136,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,40,34,130,34,130,34,34,34,47,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,51,51,51,51,51,131,51,131,56,56,56,56,56,56,131,136,56,136,56,136,131,35,136,136,130,136,136,35,40,130,136,40,40,40,40,34,130,40,34,34,130,34,34,34,47,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,51,51,51,51,51,131,51,131,56,51,131,56,56,56,131,136,56,136,56,136,131,35,35,40,136,136,136,35,40,40,130,136,40,40,40,40,34,130,40,34,130,34,34,34,34,34,47,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,51,51,51,51,51,51,51,131,51,56,51,131,131,131,131,131,136,56,131,136,136,131,35,35,136,136,136,35,40,136,40,130,136,40,40,40,40,34,130,40,34,34,34,130,34,34,34,34,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,243,51,51,51,51,51,51,131,51,56,51,131,131,131,131,131,136,56,131,136,131,136,136,131,35,40,136,136,35,40,130,136,130,130,136,40,40,40,34,130,40,34,40,34,34,34,34,34,34,34,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,243,51,51,51,51,51,51,51,51,131,51,131,56,51,131,131,131,136,56,131,136,131,136,136,136,136,136,136,136,35,40,136,40,130,136,40,40,40,40,34,130,40,34,34,130,34,34,34,34,34,34,34,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,51,51,51,51,51,51,51,51,51,131,51,131,56,56,56,56,56,56,56,131,136,136,56,136,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,130,34,34,34,34,34,34,34,34,34,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,51,51,51,51,51,51,51,51,51,131,51,131,56,51,131,56,56,56,56,131,136,56,136,131,35,136,136,136,136,136,35,40,136,40,130,136,40,40,40,40,34,130,40,34,34,34,130,34,34,34,34,34,34,34,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,243,51,51,51,51,51,51,51,51,51,51,131,51,131,56,56,56,56,56,131,136,56,136,56,136,136,136,136,136,136,136,35,40,130,136,130,130,136,40,40,40,34,130,40,34,40,34,34,34,34,34,34,34,34,34,34,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,51,51,51,51,51,51,51,51,51,51,51,131,51,131,56,56,56,56,56,56,56,131,136,131,136,131,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,34,34,130,34,34,34,34,34,34,34,34,34,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,51,51,51,51,51,51,51,51,51,51,51,131,51,131,56,51,131,56,56,56,56,131,136,56,136,131,35,136,136,136,136,136,40,136,130,136,130,130,136,40,40,34,130,130,34,130,40,34,34,34,34,34,34,34,34,34,34,34,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,243,51,57,51,51,51,51,51,51,51,51,51,51,131,51,56,51,131,131,131,131,136,56,131,136,131,136,136,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,34,34,34,34,34,34,34,34,34,34,34,39,34,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,51,147,51,51,51,147,51,51,51,51,51,51,51,131,56,51,131,131,131,131,131,131,136,56,131,136,136,131,136,136,136,136,130,136,136,40,136,40,130,130,130,130,130,130,40,34,40,34,40,34,34,34,34,34,34,34,34,39,34,34,34,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,51,147,51,57,51,51,51,51,51,51,51,51,51,131,51,56,51,131,56,51,131,131,136,56,131,136,136,56,136,136,136,136,136,136,136,40,136,40,130,130,136,40,40,34,130,40,34,130,34,34,34,34,34,34,34,34,34,39,34,34,39,34,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,57,51,57,51,51,57,51,51,51,51,51,51,51,51,131,51,131,56,56,56,56,56,56,131,136,56,136,131,136,136,136,136,136,136,40,136,130,136,130,136,40,40,40,40,40,34,130,34,130,34,130,34,34,34,34,34,34,34,39,34,39,34,39,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,57,51,57,51,51,147,51,51,57,51,51,51,51,57,51,56,51,131,56,51,131,131,131,131,136,56,136,56,136,136,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,34,130,34,34,34,34,34,34,114,34,39,34,39,34,39,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,57,51,147,51,147,51,57,51,51,51,57,51,51,51,131,51,131,51,131,131,131,131,131,136,56,131,136,131,136,136,56,136,136,136,130,136,136,40,136,40,40,130,130,130,130,130,40,34,40,34,34,34,34,34,34,39,34,34,39,34,39,34,39,34,114,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,57,51,147,57,51,57,51,57,51,51,147,51,51,51,51,56,51,56,51,131,56,51,131,131,136,56,131,136,131,136,136,136,136,136,136,136,136,40,136,40,136,40,40,40,40,40,34,130,40,34,40,34,34,40,34,34,34,39,34,34,114,34,114,39,34,114,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,147,147,57,51,147,57,51,57,51,51,51,147,51,51,147,51,56,51,131,56,56,56,56,56,56,131,136,56,136,131,136,136,136,136,136,136,40,136,130,136,40,130,136,40,40,40,34,130,40,34,40,34,34,34,39,34,39,34,34,114,34,114,39,34,114,39,39,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,57,51,147,57,51,147,57,51,57,51,57,51,51,51,147,51,56,51,56,51,131,56,56,56,56,56,131,136,56,131,136,136,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,40,34,34,114,34,34,34,114,34,39,34,114,39,34,114,114,39,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,147,147,147,147,147,57,51,147,51,147,51,57,51,51,51,56,51,57,56,51,131,147,131,131,136,56,56,131,136,136,131,136,136,136,136,136,136,40,136,130,136,130,136,40,40,40,40,40,34,130,40,34,39,34,34,40,34,114,34,114,34,114,39,34,114,114,39,39,39,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,57,57,57,51,147,57,51,147,57,51,147,57,51,57,51,57,51,57,56,51,131,56,56,56,56,56,56,131,136,131,136,136,131,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,114,34,130,34,114,34,39,34,39,34,114,39,34,114,114,39,39,39,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,153,57,57,57,57,57,51,147,57,51,147,51,147,51,57,51,51,131,51,131,56,57,56,56,56,61,56,131,136,56,136,56,136,136,136,136,136,136,40,136,130,136,130,136,40,40,40,40,40,39,40,34,40,34,39,34,34,114,34,114,34,114,39,34,114,114,39,39,39,39,39,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,147,147,147,147,147,147,57,57,57,51,147,57,51,57,51,57,51,51,147,56,57,56,56,56,61,56,56,56,131,136,56,136,136,56,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,39,40,34,130,39,34,40,34,114,39,34,39,34,114,39,39,34,114,114,114,114,114,114,127,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,147,147,147,147,147,147,147,147,57,51,147,57,51,147,57,51,57,51,131,57,56,51,131,147,131,131,131,211,136,56,136,56,136,136,136,136,136,136,136,40,136,136,40,130,136,40,40,120,40,40,34,130,114,40,34,114,34,114,34,114,39,34,114,39,39,34,114,114,114,114,114,119,39,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,147,153,57,147,147,147,147,147,147,57,57,57,51,147,57,51,57,51,131,57,51,131,61,51,131,211,131,211,131,136,56,137,136,131,136,136,136,136,136,136,136,130,136,130,136,40,130,135,40,40,39,40,34,210,34,114,45,34,39,34,114,39,34,114,39,39,39,39,39,39,39,114,114,119,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,147,153,57,57,57,147,147,147,147,147,147,57,51,147,57,51,147,51,147,56,51,211,56,57,56,56,56,61,56,131,211,136,131,136,136,136,136,136,136,136,130,136,136,40,136,40,120,40,40,45,40,34,210,34,130,45,34,39,34,114,39,34,114,39,39,39,39,39,39,39,39,114,114,119,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,153,57,57,147,147,147,147,147,147,147,147,57,57,51,147,57,51,147,56,57,51,61,51,131,211,61,56,56,131,211,136,131,136,136,136,136,56,136,136,136,136,136,40,136,40,120,40,45,40,40,39,40,34,210,39,34,114,45,34,114,39,34,114,114,39,39,39,39,39,39,39,114,119,39,114,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,147,153,57,147,153,57,147,147,147,147,147,147,147,57,57,51,147,57,56,57,51,131,61,51,211,56,61,56,61,56,131,136,137,136,131,216,136,136,136,136,136,136,40,135,136,40,130,210,136,40,45,34,130,210,34,130,114,45,34,114,39,34,114,114,39,39,39,39,39,39,39,114,114,119,39,114,127,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,57,153,57,147,153,57,57,147,147,147,147,147,147,147,57,57,57,51,147,57,51,211,51,211,56,61,56,56,61,56,131,211,136,131,216,136,136,136,136,136,136,120,136,136,45,130,136,40,120,40,45,34,210,40,39,34,210,39,34,114,39,39,34,114,114,114,114,114,114,119,39,114,119,39,114,119,114,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,249,147,153,147,153,57,147,147,153,57,57,57,57,57,57,57,57,51,147,57,56,51,147,131,147,131,147,131,211,131,211,136,131,216,131,136,136,136,136,141,136,136,136,135,136,40,135,130,210,130,210,40,40,39,40,39,34,210,39,40,39,39,39,39,39,34,114,114,114,114,119,39,39,114,119,114,119,114,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,147,153,147,153,57,147,153,147,147,153,57,57,57,57,57,57,51,147,147,131,147,147,131,211,61,51,211,131,211,131,211,136,152,56,136,211,136,141,56,136,136,136,120,136,136,120,40,130,210,130,210,130,210,45,34,210,39,40,39,39,39,39,39,39,39,39,39,39,39,114,119,39,114,119,39,119,39,119,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,249,153,57,153,52,57,147,153,57,147,147,153,57,57,57,57,57,57,57,51,147,147,131,211,61,51,211,131,211,131,211,136,61,56,141,56,136,141,55,136,136,141,136,136,135,130,141,40,210,136,45,40,45,34,130,210,39,45,34,114,210,39,45,34,114,114,114,114,114,114,119,39,114,119,39,119,39,119,33,39,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,153,57,153,153,57,147,153,57,147,153,57,147,147,153,57,57,57,57,57,57,56,57,51,211,57,56,57,56,61,56,61,56,137,136,61,136,136,61,136,136,141,136,136,135,136,136,45,130,136,45,40,45,40,39,40,45,34,130,114,210,39,45,34,114,114,114,114,114,114,119,39,114,119,39,119,39,119,33,39,119,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,153,153,57,153,147,153,153,57,153,57,147,147,153,57,57,57,57,57,57,57,57,61,51,147,131,211,61,61,56,61,56,61,56,141,56,136,152,136,136,216,136,136,135,136,136,120,130,216,45,40,135,45,40,45,34,210,45,34,210,39,45,34,114,114,114,114,114,119,39,39,114,119,39,119,39,119,33,39,119,39,127,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,153,52,57,153,147,153,147,153,57,147,153,57,147,153,57,57,57,57,57,57,56,57,61,51,211,61,51,211,61,56,61,61,56,137,136,61,136,141,55,56,216,136,136,141,40,141,40,141,40,135,45,40,45,34,210,45,34,210,39,45,39,39,39,39,39,114,114,119,39,114,119,39,119,39,119,39,119,114,119,119,119,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,249,153,52,57,153,153,57,153,147,153,147,153,57,147,153,57,57,147,153,57,57,61,57,57,56,61,51,211,131,211,137,61,56,211,136,211,141,55,61,136,136,136,216,136,120,141,40,141,40,135,45,45,45,40,45,34,210,39,45,39,39,40,114,114,119,39,39,114,114,114,119,39,119,39,119,39,119,114,18,119,119,119,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,153,153,153,153,147,153,153,147,153,147,153,147,153,57,147,153,57,57,57,57,57,131,147,211,61,57,56,61,51,211,137,61,131,211,216,61,136,141,56,141,136,216,136,136,216,136,120,136,45,45,45,40,45,40,45,34,210,45,39,40,45,39,39,45,39,39,39,114,114,119,39,119,39,119,39,119,114,18,119,119,119,119,127,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,153,153,153,57,153,153,147,67,153,147,153,147,153,147,153,57,57,147,153,57,131,147,147,211,147,137,61,61,51,211,141,56,152,131,216,61,136,61,136,141,136,136,141,136,120,136,120,141,45,40,136,120,45,45,34,210,114,210,45,39,39,45,39,39,39,114,114,119,39,114,119,39,119,39,119,114,18,119,119,119,119,119,119,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,249,153,153,153,153,153,147,67,153,147,67,153,147,153,57,147,153,57,147,147,153,57,147,211,147,211,61,57,61,51,211,137,61,61,61,55,61,136,141,55,137,136,141,136,136,120,216,130,216,45,130,210,210,130,210,210,45,34,210,114,210,114,114,210,119,39,114,119,39,114,119,39,119,39,119,114,18,119,119,119,119,33,39,119,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,153,153,153,153,153,153,147,67,153,153,147,153,147,153,147,153,57,147,153,57,57,147,211,147,211,147,211,61,56,61,61,61,61,61,55,61,131,216,61,136,141,136,141,136,120,216,136,120,141,40,210,210,135,130,210,210,45,39,45,34,210,114,210,114,119,39,114,119,39,114,119,114,119,119,39,119,119,119,114,18,119,119,119,119,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,153,153,153,153,153,153,153,153,153,57,153,147,153,147,153,147,153,147,153,57,147,152,147,147,211,147,211,147,211,61,61,56,61,61,61,131,216,141,56,216,136,216,136,216,136,141,136,120,141,40,210,135,130,210,210,210,45,45,39,45,39,45,39,114,119,45,39,39,114,119,39,119,39,119,119,114,119,119,119,119,119,119,119,119,127,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,153,153,153,153,153,153,153,52,57,153,153,153,57,153,147,153,147,153,57,147,153,57,137,57,147,211,147,211,211,152,61,61,61,61,56,211,141,61,136,141,136,152,216,136,216,135,136,210,210,210,210,210,210,210,210,120,45,39,45,39,45,39,114,210,119,39,114,119,114,119,114,119,119,114,119,119,119,119,119,119,119,119,119,119,113,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,249,148,153,153,153,153,153,153,153,153,153,57,153,153,57,153,147,153,57,153,57,152,147,153,61,57,131,211,211,147,211,211,61,61,61,131,216,141,56,216,137,141,136,141,136,120,216,135,136,210,216,130,210,210,210,130,210,114,210,210,120,45,39,114,210,119,39,119,39,119,39,119,114,119,119,119,119,33,39,119,119,119,119,119,113,33,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,153,153,153,148,52,153,153,153,153,153,52,57,153,153,147,153,147,153,147,153,147,153,57,152,61,57,147,211,152,61,61,61,61,61,56,211,216,61,136,211,216,141,136,216,141,136,216,135,141,41,45,45,130,210,210,210,210,210,210,114,210,119,45,39,114,119,114,210,119,39,119,39,119,119,39,119,119,119,119,119,119,119,119,119,113,33,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,148,153,148,52,153,153,153,153,153,153,153,153,153,57,153,153,147,153,153,57,153,57,152,147,157,57,211,152,147,211,211,61,61,61,61,131,216,137,141,55,152,141,136,216,141,136,120,216,141,45,45,130,210,210,210,130,210,210,120,114,210,210,119,45,114,119,135,114,119,119,39,119,114,119,119,119,119,119,119,119,119,119,119,23,119,119,31,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,148,52,153,153,153,153,153,153,153,153,153,153,52,57,153,147,153,153,57,153,57,152,147,163,152,147,211,157,61,57,137,61,61,61,61,131,216,152,211,216,141,136,216,141,136,216,135,141,45,136,120,210,210,210,210,210,210,120,114,210,210,119,135,45,114,119,114,119,119,39,119,114,119,119,119,119,119,119,119,119,119,119,119,119,23,119,113,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,249,148,153,153,73,153,153,148,52,52,52,57,153,153,153,153,153,147,153,153,57,153,147,153,137,147,211,217,61,61,61,61,61,61,61,61,131,216,211,216,141,61,141,136,216,141,135,141,136,216,120,210,210,210,210,210,210,120,45,45,39,210,210,125,39,119,45,114,119,119,39,119,119,119,119,119,119,119,119,119,119,119,113,119,119,119,23,119,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,148,153,148,153,153,153,73,153,153,153,153,153,153,153,153,147,153,153,153,57,153,147,153,137,147,217,61,57,152,147,211,211,211,211,211,211,216,152,211,216,211,125,61,136,216,141,141,136,216,120,210,210,216,45,130,210,210,210,210,125,39,210,119,45,114,215,39,119,119,44,39,119,114,119,119,119,119,119,119,119,119,119,119,113,119,119,23,119,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,148,153,153,73,153,67,73,153,153,153,153,153,153,153,153,153,153,147,153,153,147,153,153,147,217,61,153,61,147,211,211,211,211,211,211,211,216,61,141,61,141,61,141,136,216,216,135,216,135,141,45,136,125,45,45,45,45,39,210,210,210,125,45,114,119,119,114,215,44,39,119,119,119,119,119,119,119,119,119,119,119,113,119,119,113,119,113,119,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,148,153,73,153,153,73,153,153,148,153,153,153,153,153,153,153,153,153,153,57,153,153,137,153,61,147,157,57,211,211,217,61,147,211,211,211,216,211,216,211,216,216,141,141,136,216,216,141,135,141,135,141,45,45,45,45,45,45,39,210,215,45,114,125,39,119,210,119,119,119,119,39,119,119,119,119,119,119,119,119,113,33,119,113,33,119,113,119,31,240,0,0,0,0,0,0,0,0,0,0,0,0,0,244,153,148,153,148,153,153,73,153,153,153,148,52,153,153,153,153,153,57,153,153,153,147,153,152,153,153,137,147,217,147,217,61,61,61,61,137,211,211,216,211,216,216,141,141,136,216,216,120,216,210,216,45,141,45,45,45,45,45,114,215,45,114,215,119,120,119,114,194,119,119,39,119,119,119,119,119,119,119,119,119,113,33,119,113,119,113,119,23,113,240,0,0,0,0,0,0,0,0,0,0,0,0,15,249,73,148,153,148,153,67,73,153,73,153,153,153,153,153,153,153,153,153,153,153,57,153,153,152,153,61,147,217,61,147,217,141,61,61,61,61,141,61,141,61,141,61,141,141,141,136,216,216,120,216,125,45,45,45,45,45,125,45,45,114,215,114,215,45,119,45,119,119,119,135,119,119,119,119,119,119,119,119,119,23,119,113,119,119,23,119,23,113,119,255,0,0,0,0,0,0,0,0,0,0,0,0,15,73,148,153,73,148,153,148,153,153,148,153,153,73,153,153,153,153,153,153,153,57,153,153,152,153,157,61,153,157,61,147,217,61,61,157,61,61,61,211,216,211,221,141,141,141,141,141,135,141,141,135,141,45,141,45,45,210,210,215,45,114,215,120,119,119,45,119,114,215,119,119,119,119,119,119,119,119,119,119,18,23,119,113,119,113,119,23,113,119,23,127,0,0,0,0,0,0,0,0,0,0,0,0,15,73,148,153,73,148,153,148,153,148,153,153,67,73,153,153,153,153,153,153,153,153,153,153,153,152,153,153,211,157,61,147,221,61,157,61,61,61,211,211,216,211,216,216,211,216,216,141,141,141,135,216,210,216,210,210,210,210,215,45,125,45,114,215,125,45,119,114,215,119,119,119,119,119,119,119,119,119,119,18,23,119,23,119,113,119,113,119,113,119,23,31,0,0,0,0,0,0,0,0,0,0,0,0,255,73,148,153,73,148,153,148,153,148,153,153,73,153,153,153,73,153,153,153,153,153,153,153,152,153,157,57,211,217,147,217,211,211,217,61,211,211,216,211,221,61,216,211,215,141,141,141,141,135,216,210,216,210,210,221,45,125,45,125,45,45,119,210,125,44,45,119,119,119,119,114,194,119,119,119,119,119,18,23,119,18,23,113,119,113,119,23,113,113,119,31,240,0,0,0,0,0,0,0,0,0,0,0,249,73,73,73,148,153,73,148,153,148,153,153,67,73,153,153,153,153,153,153,153,153,153,153,153,157,57,217,153,157,61,147,217,211,217,211,211,221,61,211,216,211,216,216,216,216,216,216,216,216,125,141,45,210,215,141,45,45,125,45,45,119,210,215,119,135,119,119,210,119,119,119,119,119,119,119,119,18,23,119,119,23,119,23,113,119,23,113,113,119,23,23,240,0,0,0,0,0,0,0,0,0,0,0,244,148,153,73,73,148,153,73,148,153,148,153,73,153,148,153,153,148,153,153,153,153,153,153,152,153,153,211,157,61,153,211,217,211,211,217,211,211,211,221,61,216,211,221,141,141,141,141,141,120,216,216,125,45,141,45,45,210,215,45,125,45,119,125,45,119,125,44,119,119,125,119,119,119,119,119,23,119,119,23,119,23,119,23,119,23,113,119,23,23,113,113,240,0,0,0,0,0,0,0,0,0,0,15,244,148,148,153,73,73,73,148,153,73,153,73,153,148,153,153,148,153,153,153,153,153,153,153,153,157,153,157,58,152,153,211,217,211,217,211,211,221,61,211,216,211,221,141,141,141,141,141,141,216,215,141,45,210,221,45,125,45,125,45,125,45,119,45,119,215,44,120,119,119,119,119,119,119,119,119,119,23,119,113,119,113,119,113,119,23,113,119,23,23,23,23,255,0,0,0,0,0,0,0,0,0,0,15,73,73,73,73,73,148,153,73,148,153,73,153,73,153,153,73,153,153,153,153,153,153,153,153,157,153,152,153,217,157,61,153,211,217,211,217,211,221,61,211,221,141,61,216,216,221,61,125,141,141,135,216,210,221,45,45,210,215,210,215,210,215,125,119,210,199,135,119,125,119,119,119,119,119,119,113,119,119,23,119,113,119,23,113,119,23,113,113,113,119,23,23,31,0,0,0,0,0,0,0,0,0,0,15,73,73,73,73,73,148,148,153,73,148,153,73,153,73,153,73,153,153,73,153,153,153,153,153,153,157,153,153,211,217,157,147,217,211,217,211,217,211,216,211,221,61,216,216,211,221,141,141,141,125,141,135,216,210,221,45,210,215,210,215,210,215,125,45,119,215,119,215,119,119,119,119,119,199,119,119,113,119,119,23,113,119,113,119,23,113,113,113,113,113,113,113,127,0,0,0,0,0,0,0,0,0,0,15,73,73,73,73,73,73,148,148,153,73,148,153,73,153,73,153,148,153,153,153,153,153,153,153,217,153,157,153,217,157,61,153,217,211,217,211,221,61,211,221,61,216,211,221,216,221,141,141,216,216,215,216,210,221,45,125,45,210,215,210,215,215,125,119,210,199,135,119,125,119,119,215,119,119,119,23,119,113,119,23,119,23,113,119,23,23,113,113,113,113,113,113,127,0,0,0,0,0,0,0,0,0,0,255,73,73,73,73,73,73,73,148,148,153,73,148,153,73,153,73,153,153,73,153,153,73,153,217,153,157,153,157,153,157,153,211,217,217,211,217,217,211,221,61,211,221,211,221,141,141,141,216,215,216,216,215,210,221,45,215,210,215,210,215,215,125,45,119,215,119,215,119,119,125,119,119,124,119,119,23,119,23,119,23,113,119,23,23,113,113,113,113,113,113,113,113,31,240,0,0,0,0,0,0,0,0,0,244,148,73,73,73,73,73,73,73,148,148,153,73,148,153,73,153,73,153,153,148,153,153,217,153,154,153,157,153,157,153,211,217,217,211,217,217,211,221,61,211,221,141,211,221,141,216,221,141,141,216,215,216,210,221,45,210,221,125,45,125,125,44,125,119,215,119,215,119,215,119,124,119,119,113,119,119,23,119,23,113,119,23,113,113,119,23,23,23,23,23,23,23,17,240,0,0,0,0,0,0,0,0,0,244,148,73,73,73,73,73,73,73,73,148,148,153,73,153,73,153,73,153,73,153,153,169,153,154,153,217,153,217,157,153,217,217,157,157,152,217,211,221,157,141,61,211,221,216,216,221,141,216,216,215,216,215,216,215,210,221,125,45,125,125,44,215,135,215,125,119,125,119,119,199,119,119,124,119,119,23,119,23,113,119,23,113,113,119,23,23,23,23,23,23,23,17,113,240,0,0,0,0,0,0,0,0,0,244,73,73,68,148,73,73,73,73,73,73,148,153,73,73,148,153,148,153,153,148,153,153,169,153,217,153,217,153,217,157,153,217,137,217,211,217,221,61,211,221,157,211,221,216,221,61,216,221,125,141,216,215,210,221,45,215,210,221,125,45,125,125,119,215,125,119,125,119,119,215,119,199,119,113,119,124,119,23,113,119,23,113,113,113,113,113,113,113,113,113,23,17,113,240,0,0,0,0,0,0,0,0,15,244,148,73,68,148,148,148,148,148,148,148,148,153,73,148,153,73,153,73,153,169,153,169,153,217,153,157,72,157,153,217,157,157,157,152,168,217,217,211,221,157,61,221,61,216,221,141,221,141,141,216,215,216,215,221,45,210,221,125,125,125,125,119,215,125,119,215,119,215,119,199,119,119,199,119,113,119,23,113,119,23,113,113,113,113,113,113,113,113,113,113,23,23,17,255,0,0,0,0,0,0,0,0,15,68,148,73,68,148,148,148,148,148,148,148,148,148,148,153,73,148,153,148,153,148,217,153,148,217,153,168,77,153,217,157,157,153,217,211,217,217,211,221,211,221,211,221,216,221,60,157,141,215,216,221,125,141,125,45,221,125,125,45,215,215,125,125,119,215,125,119,215,124,119,119,215,23,119,199,113,215,23,113,119,23,23,113,113,113,113,113,113,113,113,23,17,113,23,31,0,0,0,0,0,0,0,0,15,68,148,73,68,148,73,68,148,148,148,148,148,153,73,73,148,153,73,153,77,148,153,154,153,157,72,77,153,217,157,153,217,217,217,217,217,217,221,157,211,221,211,221,211,221,216,221,216,221,141,216,215,216,221,45,215,210,221,125,125,125,45,125,119,215,125,119,124,119,215,119,199,119,199,113,215,23,113,119,23,113,113,113,113,113,113,113,113,113,23,17,113,23,17,31,0,0,0,0,0,0,0,0,15,68,148,73,68,148,73,73,68,148,148,148,148,148,153,73,73,148,153,73,154,153,148,217,148,217,157,72,169,157,153,217,217,157,153,217,217,216,157,211,221,157,211,221,221,141,221,60,216,221,141,215,216,221,45,221,125,210,221,125,125,125,125,125,119,215,125,124,125,119,124,119,124,119,113,215,23,113,119,29,23,113,113,113,113,113,113,113,113,23,17,113,23,17,113,31,0,0,0,0,0,0,0,0,15,68,73,68,148,73,68,148,148,148,148,148,148,148,148,153,73,148,153,169,73,148,217,77,153,154,153,217,157,77,153,217,157,157,157,157,157,157,217,217,221,61,221,211,221,211,221,216,221,216,221,216,215,221,125,210,221,125,215,215,215,215,215,215,215,125,124,125,119,125,119,199,119,209,119,29,113,119,29,23,113,113,113,113,113,113,113,113,23,17,113,23,17,113,17,31,0,0,0,0,0,0,0,0,15,68,148,68,148,68,148,73,68,148,73,73,73,73,73,73,73,148,148,153,169,148,217,73,157,73,212,217,157,72,169,217,217,157,157,157,157,157,157,211,221,217,221,61,221,216,221,221,141,221,141,125,216,221,125,215,221,45,215,215,215,215,215,215,125,124,125,119,215,124,119,124,119,29,113,209,119,113,209,113,113,113,113,113,113,113,113,23,17,113,23,17,113,17,113,31,0,0,0,0,0,0,0,0,255,68,73,68,73,68,148,73,68,148,148,73,73,73,73,73,73,73,169,73,148,212,153,212,157,73,217,153,169,217,157,153,212,221,157,157,157,157,217,221,157,217,221,141,211,184,221,141,221,141,221,141,215,221,141,125,215,221,125,125,215,215,215,215,215,125,119,215,199,125,29,119,29,113,215,113,209,119,23,113,113,209,113,113,113,113,23,17,113,23,17,113,17,113,17,31,240,0,0,0,0,0,0,0,244,68,73,68,68,148,73,68,148,73,73,73,68,148,148,148,153,73,169,73,212,153,169,148,217,153,169,212,217,157,77,157,157,157,157,157,157,157,217,221,157,141,217,221,211,184,221,221,141,221,141,215,221,141,125,215,221,45,215,215,215,215,215,215,199,215,199,215,124,125,23,125,23,209,119,29,23,113,209,113,209,113,113,113,113,23,17,113,23,17,113,17,113,17,23,17,240,0,0,0,0,0,0,0,244,68,73,68,68,148,68,148,73,68,148,73,73,73,73,73,73,164,153,73,169,77,73,212,157,77,72,169,157,77,157,77,157,157,77,157,157,217,217,221,157,217,221,61,221,221,141,221,216,221,221,216,221,125,215,221,43,215,215,221,125,125,125,125,124,125,119,215,199,125,29,119,29,113,209,119,29,23,23,113,113,113,113,113,113,23,17,113,23,17,23,17,17,113,17,17,240,0,0,0,0,0,0,0,244,68,68,148,68,73,68,73,68,148,73,68,148,73,73,73,73,164,153,77,73,77,73,212,157,77,148,217,77,157,77,157,157,77,157,157,217,217,221,157,217,221,141,221,157,221,61,221,221,216,221,125,221,125,221,125,215,221,125,125,125,125,125,199,215,215,199,215,199,125,23,209,125,23,124,113,209,119,29,23,23,28,113,23,23,17,113,23,17,23,17,23,17,17,23,17,240,0,0,0,0,0,0,0,244,68,68,73,68,68,148,68,148,73,68,148,73,73,73,74,73,73,77,73,77,73,212,157,73,154,153,212,217,212,217,217,157,157,157,157,157,217,221,157,217,221,157,221,211,221,221,221,141,221,221,141,215,221,141,215,221,125,215,221,125,125,199,215,215,199,215,199,209,215,29,113,215,29,23,209,113,209,113,113,209,23,23,23,17,113,23,17,23,17,23,17,17,23,17,17,240,0,0,0,0,0,0,0,244,68,73,68,68,148,68,148,68,73,68,148,73,73,74,73,73,77,73,77,73,148,212,157,77,77,77,148,217,212,217,212,217,212,221,157,77,217,221,157,217,221,217,221,221,221,216,221,221,216,221,215,221,221,125,215,221,125,215,221,125,199,215,215,205,119,209,215,209,215,29,113,209,125,23,29,23,29,23,23,23,29,17,113,23,17,113,23,17,17,23,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,148,68,73,68,148,73,68,148,73,73,77,73,77,73,77,73,169,77,77,72,77,154,157,77,153,212,217,217,212,221,157,217,221,157,217,221,217,221,217,221,221,221,141,221,221,215,221,221,125,221,125,215,221,125,199,215,215,220,125,124,215,124,125,29,29,113,209,125,23,29,23,29,23,29,17,113,113,29,17,113,23,17,23,17,17,17,113,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,148,68,68,73,68,68,148,68,148,73,74,73,73,74,73,77,73,77,77,77,73,212,212,217,77,157,77,157,77,212,221,157,212,221,157,217,221,217,221,217,221,221,141,221,221,221,141,221,215,221,215,221,215,221,125,200,205,125,215,205,125,29,125,29,29,119,29,29,113,209,125,23,29,23,29,17,113,193,113,23,17,113,17,113,17,17,113,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,148,68,73,68,73,68,148,74,73,73,74,77,73,77,73,77,73,77,77,73,212,217,77,157,77,77,212,221,157,157,212,221,157,217,221,173,217,221,221,221,157,221,221,141,221,215,221,221,215,221,215,221,125,205,125,125,199,215,205,125,29,29,113,221,29,29,23,209,113,209,113,209,23,29,17,113,113,193,113,23,17,17,113,17,17,17,17,23,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,148,68,73,68,68,148,73,74,73,77,68,212,148,212,148,212,212,157,77,73,212,212,217,173,157,77,157,77,212,221,157,217,221,77,221,221,157,221,221,221,216,221,221,221,221,215,221,215,221,215,220,215,221,125,199,215,209,215,209,215,209,209,209,209,125,23,193,209,209,113,209,29,17,113,193,113,29,17,23,17,113,17,17,113,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,73,68,68,68,73,68,73,68,164,148,77,68,148,212,73,164,212,212,154,77,77,77,77,154,157,77,77,212,221,157,77,221,157,173,157,221,217,221,221,217,221,221,221,221,221,221,125,221,221,125,221,125,215,221,29,215,209,221,29,209,209,209,215,209,209,209,209,209,209,209,113,209,29,17,209,23,28,29,17,23,17,28,17,23,17,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,68,148,68,73,68,164,148,73,68,212,73,77,68,212,148,212,212,157,77,77,77,77,77,157,77,212,217,212,221,157,77,221,77,221,212,122,221,221,221,157,221,221,221,221,221,215,221,221,125,220,215,221,205,125,205,29,209,215,209,221,29,29,29,29,23,209,209,113,209,199,29,17,113,193,113,23,17,209,17,113,17,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,68,68,73,68,68,148,74,73,68,212,77,68,212,148,212,212,154,77,77,77,77,77,154,157,77,212,212,221,212,221,212,221,221,157,221,217,221,221,157,221,221,221,221,215,221,221,215,221,205,215,221,29,215,209,221,29,209,215,209,209,215,29,29,29,29,23,29,28,29,23,29,17,209,23,29,17,209,17,113,17,23,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,15,244,68,68,68,68,68,68,68,68,68,73,68,74,68,148,164,77,68,212,74,148,212,148,212,212,212,212,212,212,212,221,77,77,212,221,77,212,221,217,221,77,221,212,201,221,221,221,221,221,221,221,221,215,221,221,205,215,221,29,209,167,209,221,29,209,209,221,29,29,29,29,29,29,29,29,23,29,17,209,29,17,29,17,17,113,17,193,17,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,15,84,68,68,68,68,68,68,68,68,148,68,74,68,148,74,77,68,212,73,74,77,68,212,212,212,212,212,212,212,212,212,221,77,212,221,77,221,77,221,77,221,212,201,221,221,221,221,221,221,221,221,215,221,221,205,215,221,29,221,209,221,29,209,221,29,209,209,209,209,209,209,209,124,29,23,29,17,209,29,17,193,23,17,209,17,193,17,23,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,15,244,68,68,68,68,68,68,68,68,68,74,68,148,74,73,68,212,74,77,77,68,212,212,164,212,212,212,212,212,212,221,77,77,212,221,77,221,77,221,77,221,212,205,221,212,205,157,221,221,221,221,221,221,205,215,221,26,209,221,209,221,29,209,221,29,29,209,209,209,209,209,209,209,209,193,209,209,29,17,193,113,193,209,17,193,17,113,17,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,68,68,164,68,148,74,68,164,212,74,77,68,164,212,164,212,212,212,212,212,212,212,218,157,77,212,221,77,212,221,212,221,221,173,221,212,221,221,221,221,221,221,221,221,221,205,221,221,205,215,221,205,209,221,209,221,29,205,29,29,209,209,209,209,209,209,209,209,193,209,29,17,209,29,17,28,17,113,28,17,28,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,68,68,68,164,68,164,73,68,164,148,164,212,148,212,212,164,212,212,164,212,212,212,218,157,77,173,77,212,221,173,212,221,173,212,221,221,221,221,218,221,221,221,221,221,205,221,221,205,215,221,205,209,221,209,221,29,209,221,29,205,29,29,193,209,209,209,193,209,209,29,28,23,28,17,209,23,17,193,17,209,17,17,28,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,68,164,68,74,68,148,74,68,212,77,68,212,164,212,164,212,212,169,212,212,212,218,154,212,221,77,212,221,173,77,221,173,212,125,173,221,218,221,221,221,221,221,221,189,221,221,205,215,221,205,209,167,220,209,221,205,205,29,205,29,29,29,193,209,209,209,209,209,193,209,29,28,29,17,193,29,17,28,17,17,193,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,164,68,74,68,74,68,164,148,164,77,68,212,164,212,164,212,212,164,212,212,218,77,169,212,218,212,221,173,77,221,77,218,221,218,221,218,221,221,218,221,221,221,189,221,221,205,221,221,205,220,221,209,221,220,209,221,29,209,220,209,220,209,209,209,209,209,209,193,209,193,209,29,17,193,113,193,28,17,209,17,28,17,28,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,68,164,68,164,68,164,148,164,164,212,74,77,68,212,164,212,212,212,212,212,218,77,173,77,173,77,212,221,173,76,155,217,218,221,218,221,221,173,221,221,221,189,221,221,221,221,205,221,205,221,205,220,215,220,220,209,221,205,29,205,29,29,193,209,220,29,28,209,193,209,193,113,193,209,28,29,17,193,17,193,17,28,17,17,17,193,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,74,68,164,68,164,68,164,74,68,164,212,74,77,74,77,74,148,212,164,212,218,164,218,212,218,212,221,77,218,212,221,173,212,221,218,221,218,221,221,173,221,221,189,221,221,221,205,221,220,221,220,221,125,205,220,209,221,205,29,205,29,29,205,29,29,193,220,29,28,113,209,193,209,193,209,28,29,17,193,28,17,193,28,17,17,193,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,164,68,68,74,68,68,164,74,68,164,148,164,164,212,77,74,77,74,164,212,218,77,77,164,218,212,212,218,218,212,221,173,173,218,218,221,173,221,173,221,221,173,221,221,221,189,221,221,109,221,220,221,205,220,220,215,220,221,29,220,209,221,205,29,29,204,209,209,209,209,209,204,113,209,193,209,29,17,193,28,23,17,193,17,193,17,17,28,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,164,68,164,68,164,74,68,164,148,164,164,212,74,77,74,77,74,212,212,173,77,164,218,212,212,218,218,212,218,218,218,212,221,218,221,173,221,173,218,221,219,221,219,221,221,219,221,221,205,221,205,220,221,205,220,220,220,220,209,220,209,220,205,29,193,209,209,220,28,209,193,209,193,209,193,193,193,124,17,193,193,28,17,28,17,28,17,17,17,28,17,240,0,0,0,0,0,0,0,244,68,74,68,68,164,68,164,68,164,74,68,164,164,164,164,164,212,164,169,164,212,164,218,77,74,212,218,169,180,218,212,218,218,212,221,218,218,221,173,218,221,218,221,219,221,218,221,221,189,221,205,221,104,189,220,221,205,220,220,215,220,209,221,205,204,209,220,209,209,220,193,220,29,28,209,193,209,193,209,193,113,193,193,28,17,193,28,17,28,17,17,28,17,17,17,240,0,0,0,0,0,0,0,244,68,68,74,68,74,68,74,68,164,74,68,164,164,74,73,164,164,212,164,212,170,154,77,170,77,170,154,212,218,212,218,218,212,221,173,173,218,221,173,218,221,173,219,221,173,221,189,221,221,189,221,104,189,220,221,205,220,221,205,205,205,205,205,29,205,29,204,209,220,193,220,29,27,28,124,29,28,28,28,28,28,28,28,17,193,28,17,193,17,28,17,17,28,17,17,240,0,0,0,0,0,0,0,244,68,164,68,74,68,74,68,164,74,68,164,164,74,74,74,74,148,170,77,74,164,218,77,77,170,154,212,218,212,218,218,212,219,155,155,155,218,218,221,173,218,219,221,173,221,189,221,219,221,220,221,189,220,221,220,221,205,205,220,220,220,220,220,220,123,29,205,29,193,220,205,29,28,209,204,29,28,193,209,193,209,28,28,28,28,17,193,17,193,17,193,17,28,17,17,240,0,0,0,0,0,0,0,244,68,74,68,74,68,74,68,164,74,68,164,164,164,164,164,212,164,173,74,77,164,212,170,173,74,212,218,173,75,154,218,218,218,218,218,218,218,221,173,218,219,221,173,221,189,221,189,221,219,221,189,220,221,214,221,205,220,220,220,220,220,220,209,220,220,209,220,205,29,204,29,27,29,28,199,193,204,29,28,28,28,28,28,28,17,193,28,17,193,17,193,28,17,17,28,240,0,0,0,0,0,0,0,255,68,74,68,74,68,164,74,68,164,164,164,164,164,164,164,164,170,74,154,74,164,218,164,218,77,170,173,77,170,218,212,218,218,218,218,218,221,173,173,218,221,173,219,221,173,219,221,219,221,221,189,220,214,139,221,205,214,221,205,220,220,220,220,220,124,220,205,29,204,205,29,204,29,193,204,124,29,28,28,29,28,28,28,28,17,193,28,17,193,28,17,17,193,17,31,240,0,0,0,0,0,0,0,15,68,74,68,74,68,164,74,68,164,164,74,74,74,74,74,164,169,164,170,77,164,212,180,218,170,154,173,77,170,212,189,170,218,218,218,218,218,221,173,189,173,219,218,221,189,221,189,221,189,221,205,189,214,139,221,205,220,221,205,205,205,205,199,205,204,220,205,27,124,205,28,205,28,204,124,29,28,193,209,204,28,28,28,28,17,193,193,193,28,17,28,17,193,28,31,0,0,0,0,0,0,0,0,15,68,164,74,68,164,74,68,164,164,164,164,164,164,164,164,169,164,170,77,74,170,164,218,164,218,173,77,170,218,173,173,77,173,173,173,173,173,173,173,173,219,218,221,189,173,189,221,189,219,221,189,214,139,220,221,109,220,220,220,220,220,220,220,220,220,205,29,204,209,205,193,220,193,209,204,193,209,204,28,28,28,28,28,28,28,17,193,28,17,193,28,17,28,17,31,0,0,0,0,0,0,0,0,15,68,164,68,164,74,68,164,164,164,164,164,164,164,164,170,74,164,170,77,164,170,212,170,212,173,75,169,170,218,173,75,218,173,173,173,173,173,173,189,173,189,173,189,173,219,221,189,221,189,221,189,220,219,220,221,109,220,214,221,205,205,205,204,220,205,204,220,204,209,177,220,193,220,204,29,193,204,28,204,28,193,193,193,193,193,193,193,28,17,193,28,17,193,28,31,0,0,0,0,0,0,0,0,15,68,164,74,68,164,164,164,74,74,68,164,164,164,164,170,74,164,170,74,170,154,164,218,170,173,74,218,170,218,173,170,218,218,218,173,173,173,189,173,173,189,173,219,218,221,189,221,189,219,221,205,189,214,221,104,189,205,220,220,214,220,220,220,205,204,220,199,205,204,204,124,204,204,29,193,204,193,209,204,28,193,193,193,193,193,193,193,193,193,28,28,17,193,17,207,0,0,0,0,0,0,0,0,15,68,164,74,68,164,164,74,74,74,74,74,74,164,164,170,74,164,170,154,164,218,164,218,170,77,170,173,170,212,185,173,170,218,218,218,219,173,173,173,189,173,189,173,213,221,219,221,189,219,221,189,205,214,221,214,221,205,109,220,220,220,220,220,205,204,220,205,204,205,29,204,204,124,193,177,209,204,193,204,28,193,193,204,28,28,28,17,193,193,28,28,17,193,28,31,0,0,0,0,0,0,0,0,15,244,74,68,164,164,74,74,74,74,74,74,74,164,170,74,164,170,74,164,218,164,170,170,173,75,169,170,218,170,218,173,173,170,218,218,189,173,173,189,173,93,218,213,122,219,221,87,189,219,221,189,205,189,214,221,205,109,220,214,220,220,214,125,204,220,205,204,220,204,204,209,204,209,177,220,193,204,193,204,28,193,193,204,28,28,28,28,28,28,28,17,193,28,17,255,0,0,0,0,0,0,0,0,0,244,164,164,74,74,74,74,74,74,74,74,164,164,170,74,164,170,164,170,164,170,173,74,173,74,173,170,173,170,218,173,170,218,186,218,218,218,189,173,93,218,219,213,117,221,189,221,189,219,221,189,189,205,189,205,109,220,214,221,205,205,205,109,204,220,205,204,205,204,124,204,209,177,204,204,193,204,193,204,28,193,204,28,28,28,28,28,28,28,17,193,193,28,17,240,0,0,0,0,0,0,0,0,0,244,164,74,74,74,74,74,74,74,74,164,164,170,74,164,170,74,170,164,170,173,74,170,170,218,170,173,170,173,170,173,170,218,218,218,186,218,219,173,213,221,93,213,122,221,189,189,219,219,221,189,205,189,109,214,221,109,220,214,220,214,220,220,205,204,220,205,204,204,220,204,204,204,124,204,193,204,193,220,28,193,204,28,28,28,28,28,28,28,28,28,28,28,17,240,0,0,0,0,0,0,0,0,0,244,74,74,74,74,74,74,74,74,74,164,170,74,164,170,74,170,74,170,170,74,170,173,170,170,173,170,173,170,173,170,218,186,218,186,218,213,221,171,218,213,221,213,221,189,189,213,221,189,205,189,189,205,189,205,109,220,214,221,205,204,214,220,220,205,204,205,204,204,205,204,199,204,204,193,220,193,204,193,204,193,204,28,28,193,204,28,28,28,28,28,28,17,193,240,0,0,0,0,0,0,0,0,0,255,74,74,74,74,74,74,74,74,164,164,170,74,164,170,164,170,170,74,170,170,170,170,170,154,170,173,170,173,170,218,186,218,173,173,171,218,213,218,213,221,93,219,219,221,93,219,221,189,189,205,189,189,109,214,221,109,214,220,214,220,220,220,205,103,188,205,204,205,204,204,204,204,193,220,193,204,204,28,193,204,28,193,204,28,28,28,193,193,193,193,193,193,207,240,0,0,0,0,0,0,0,0,0,15,74,74,74,74,74,74,74,164,164,170,74,164,170,164,170,164,170,170,170,170,154,170,170,218,170,173,170,170,218,170,218,173,171,173,171,213,218,213,221,93,213,221,93,219,219,221,189,189,202,205,189,205,189,109,214,220,214,220,214,220,214,220,205,103,188,205,204,204,204,220,204,199,204,204,204,204,28,204,193,204,193,204,28,193,204,28,28,193,193,193,193,193,31,0,0,0,0,0,0,0,0,0,0,15,74,74,74,74,74,74,164,164,170,74,164,170,164,170,170,164,170,170,74,170,170,170,170,170,218,170,173,170,186,218,171,173,171,173,93,173,93,213,221,93,213,221,189,189,213,221,189,189,202,205,189,189,109,214,220,214,221,109,205,109,205,204,214,220,205,204,204,220,204,204,204,204,204,204,28,204,204,28,204,28,193,204,28,193,204,28,28,193,193,193,193,193,207,0,0,0,0,0,0,0,0,0,0,15,74,74,74,74,74,164,164,170,74,164,170,164,170,170,74,170,170,74,170,170,170,170,170,218,170,170,173,170,170,218,186,173,171,173,93,173,93,213,218,213,221,189,93,219,219,219,219,219,219,219,220,189,205,109,214,221,109,205,109,205,109,204,214,123,204,205,204,204,205,204,204,204,204,204,204,193,204,204,28,204,193,204,193,204,28,193,193,193,193,193,193,193,207,0,0,0,0,0,0,0,0,0,0,15,244,164,164,170,74,74,164,170,74,170,74,170,164,170,170,74,170,170,170,170,170,170,170,170,170,218,170,186,218,171,173,171,173,93,173,93,173,93,93,213,219,219,213,221,189,189,189,219,220,219,219,205,189,109,214,214,220,214,220,214,220,214,220,205,103,109,204,205,108,204,204,204,204,204,204,204,193,204,204,28,204,28,193,204,28,193,204,28,193,204,28,28,255,0,0,0,0,0,0,0,0,0,0,0,244,164,170,74,74,164,170,74,164,170,164,170,170,74,170,170,170,170,170,170,170,170,170,170,218,170,170,218,171,170,173,93,170,213,218,213,213,221,93,189,93,213,221,189,189,93,202,203,219,219,219,205,109,189,109,214,214,220,214,214,220,205,109,204,205,103,188,204,204,205,204,204,204,204,204,28,204,204,28,204,28,204,193,204,193,204,28,193,204,28,28,28,240,0,0,0,0,0,0,0,0,0,0,0,244,164,170,74,74,164,170,74,170,74,170,164,170,170,164,170,170,164,170,170,170,170,170,170,170,171,170,171,170,213,218,171,173,93,93,165,221,93,93,93,213,221,189,93,189,189,189,189,189,188,219,219,214,221,109,109,205,109,109,205,109,109,204,205,109,204,204,204,214,204,204,204,204,204,204,204,204,28,204,204,193,204,193,204,193,204,28,193,204,28,28,28,240,0,0,0,0,0,0,0,0,0,0,0,255,164,164,170,74,164,170,164,170,164,170,170,164,170,170,170,170,170,170,170,170,170,170,170,171,170,173,170,186,170,213,218,93,173,93,171,213,213,221,93,213,219,219,219,219,219,219,219,219,219,220,189,109,189,109,109,109,109,205,109,109,204,214,205,108,205,108,214,124,204,204,204,204,204,204,204,204,204,193,204,204,193,204,193,204,193,204,28,193,204,28,31,240,0,0,0,0,0,0,0,0,0,0,0,15,164,164,170,74,164,170,164,170,170,74,170,170,170,69,74,170,170,170,170,170,170,170,170,170,171,170,170,186,213,218,93,173,93,93,93,93,213,213,219,213,219,213,219,219,219,219,219,219,205,189,188,189,109,109,214,220,189,109,109,204,214,214,220,204,205,108,204,204,203,204,204,204,204,204,204,193,204,204,204,193,204,204,193,204,193,204,193,204,28,28,207,0,0,0,0,0,0,0,0,0,0,0,0,15,164,170,74,164,170,164,170,164,170,170,164,170,170,170,170,170,170,170,170,170,170,170,90,171,170,173,90,213,218,171,173,93,93,93,173,93,93,93,213,219,213,219,219,219,213,219,219,205,187,219,205,189,109,188,214,214,214,220,109,109,198,220,198,220,109,204,204,188,204,204,204,204,204,204,204,204,204,204,193,97,204,193,97,204,193,204,193,204,28,193,207,0,0,0,0,0,0,0,0,0,0,0,0,15,250,74,164,170,164,170,164,84,170,164,84,170,170,170,170,170,170,170,170,170,90,170,170,170,171,170,165,218,165,218,93,93,170,93,93,93,93,186,213,219,213,219,219,213,220,189,189,189,187,220,189,109,188,189,109,109,109,109,109,198,220,109,204,109,204,109,204,198,118,204,204,198,204,204,204,204,204,204,204,204,193,97,204,193,204,193,204,28,193,204,255,0,0,0,0,0,0,0,0,0,0,0,0,0,250,74,170,74,170,74,170,164,84,170,170,170,170,170,170,170,170,170,170,170,170,165,170,171,170,165,218,165,218,93,165,213,218,93,93,93,93,189,93,189,93,189,189,189,189,187,219,189,188,189,189,109,188,189,109,109,109,109,198,220,109,198,220,109,204,109,198,118,220,204,198,124,204,204,204,204,204,204,204,28,204,204,193,97,204,193,204,193,204,28,240,0,0,0,0,0,0,0,0,0,0,0,0,0,255,164,170,164,170,170,74,170,170,170,170,69,74,170,170,170,170,170,165,170,170,170,165,170,171,170,93,165,218,93,165,213,213,218,189,93,93,93,93,189,93,189,93,189,187,219,219,189,189,188,189,109,188,189,109,109,109,109,109,109,198,214,220,109,204,109,204,198,204,204,198,204,204,108,204,204,204,204,204,204,204,193,97,204,193,97,204,193,204,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,15,164,170,164,170,170,170,74,170,170,69,74,170,170,170,170,170,165,74,165,170,165,170,171,170,93,165,218,93,93,165,213,213,213,213,213,213,219,213,219,213,219,219,189,187,219,219,189,188,189,189,109,182,214,214,214,214,214,220,109,109,198,220,109,103,108,203,204,198,220,204,198,204,204,204,204,204,204,204,204,204,193,97,204,193,97,204,193,204,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,170,74,170,164,170,170,170,170,69,69,170,170,170,170,170,90,170,165,170,170,170,90,170,93,165,218,93,165,173,90,213,213,213,213,213,213,213,219,213,219,213,219,189,189,187,219,189,188,189,187,203,214,214,214,214,214,214,214,214,214,214,205,108,205,108,204,109,198,204,198,204,204,204,108,204,204,204,204,204,204,204,204,193,97,204,193,204,204,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,164,170,170,170,74,170,170,170,170,170,170,170,170,84,170,90,170,170,90,170,90,171,170,165,173,90,171,165,213,213,213,213,213,213,213,219,93,189,93,187,219,189,92,171,219,203,219,189,109,188,189,109,182,214,214,214,214,214,214,205,108,203,198,214,204,198,204,204,198,204,204,108,204,204,204,204,204,204,204,204,22,28,204,204,193,204,204,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,170,69,74,170,170,170,170,170,170,170,170,170,170,165,170,170,165,170,170,90,170,165,170,186,93,90,165,213,213,213,165,213,213,213,213,219,93,189,93,187,213,219,189,187,219,189,188,189,187,203,189,109,109,109,109,109,108,182,214,205,108,198,214,204,198,220,108,198,204,204,108,204,204,204,108,204,204,204,204,204,204,204,204,28,204,204,28,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,170,69,74,170,170,164,84,170,170,170,170,170,165,69,170,165,170,170,90,170,90,171,165,170,93,90,213,213,165,213,213,213,213,186,181,219,93,189,93,187,213,202,189,187,219,188,189,187,203,214,214,214,219,109,109,109,109,108,214,198,214,214,204,188,198,220,108,204,198,204,204,108,204,97,108,204,204,204,204,204,204,204,204,204,193,204,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,170,69,74,170,170,170,170,170,170,170,170,90,170,170,165,170,170,90,170,90,165,170,93,90,170,93,90,93,93,90,181,213,213,213,213,219,93,187,171,213,202,189,187,219,188,189,187,189,182,219,182,219,109,109,109,109,108,109,109,108,188,109,108,198,214,204,108,198,220,108,204,198,204,204,204,204,204,204,204,204,204,204,193,97,204,204,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,170,170,170,170,170,170,170,170,170,84,90,170,165,170,170,90,170,90,165,170,90,170,93,90,93,93,90,93,93,90,93,91,165,219,93,181,219,213,219,189,187,189,187,219,187,219,203,189,109,182,219,109,109,109,108,109,109,108,109,109,108,109,108,198,220,108,198,204,198,204,198,204,198,204,204,108,204,204,204,204,204,204,204,204,193,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,170,170,170,170,170,170,170,170,170,84,90,170,170,90,170,90,170,90,165,170,165,186,90,171,93,90,93,93,90,93,93,93,93,93,93,181,219,181,219,189,92,189,187,189,187,203,189,187,203,188,189,109,109,107,109,109,108,109,109,108,109,108,198,214,204,108,198,204,198,204,198,204,204,198,204,204,204,204,204,204,204,204,204,204,204,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,170,170,69,74,170,170,170,165,170,170,170,90,170,90,170,90,165,170,90,165,170,90,186,93,90,93,90,93,91,93,93,93,91,171,181,219,93,189,93,187,189,92,186,188,187,219,187,203,189,109,109,109,107,203,109,109,109,108,109,108,109,108,108,198,204,109,108,198,204,108,204,108,198,22,204,204,198,204,204,204,204,204,204,204,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,170,170,170,170,170,170,90,170,170,165,170,170,90,170,90,165,170,90,165,170,90,186,90,93,90,93,90,93,93,91,93,91,171,93,93,189,93,187,189,93,187,189,187,189,187,188,187,214,189,109,107,188,109,109,109,102,214,109,108,109,108,109,108,109,108,108,198,204,108,198,204,108,204,198,204,204,204,204,198,22,204,204,204,204,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,170,170,170,170,84,84,90,170,165,170,165,170,165,170,165,170,90,165,165,170,90,93,90,93,90,93,91,93,93,91,93,93,93,93,93,181,219,92,187,213,203,189,187,187,219,188,187,189,107,214,189,109,107,109,102,214,198,214,109,108,108,109,108,108,198,204,108,198,204,108,204,108,204,198,204,198,204,204,204,204,204,204,204,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,170,170,170,170,84,90,170,165,170,165,69,170,90,165,170,90,165,165,170,90,93,90,90,93,85,213,93,85,213,93,93,91,93,92,93,181,219,187,171,187,219,187,189,187,188,187,189,107,214,188,182,214,188,109,102,214,214,109,108,109,108,108,109,108,108,108,198,198,204,108,198,204,108,204,198,22,204,204,108,204,204,204,204,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,170,170,165,69,170,170,165,170,170,90,165,170,90,165,170,90,90,165,165,165,165,165,186,90,91,93,90,91,93,91,93,93,91,186,181,219,187,171,189,187,187,219,187,187,219,188,187,109,182,214,214,188,182,214,214,109,102,214,109,108,108,109,108,108,108,198,198,204,108,198,204,108,204,108,198,22,204,204,204,204,198,22,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,170,165,69,170,165,69,170,90,170,90,170,90,165,170,90,90,90,165,165,171,90,90,93,90,93,85,213,93,93,91,93,93,91,213,187,213,189,187,187,213,187,219,187,203,187,189,107,214,187,109,107,214,182,214,109,102,214,108,109,102,198,198,198,198,198,204,108,108,198,204,108,204,108,204,108,204,108,204,108,204,204,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,170,165,69,170,165,69,170,165,170,90,165,170,90,90,90,165,165,165,165,165,165,213,90,93,85,213,93,91,93,91,93,91,181,219,181,219,187,93,187,187,219,187,187,188,187,188,182,219,109,107,182,214,182,214,109,102,198,214,108,109,102,198,214,198,198,198,204,108,108,108,198,204,108,204,108,204,204,97,108,204,204,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,170,165,170,170,165,170,90,165,170,165,170,90,90,165,165,165,165,165,165,165,181,165,165,181,213,93,85,213,93,91,93,91,213,187,171,181,219,187,187,219,187,187,188,187,189,107,187,109,107,188,182,214,214,109,102,214,107,108,109,102,198,214,198,198,198,198,198,198,204,108,198,204,108,204,108,204,108,204,204,198,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,170,165,69,170,90,170,90,170,90,165,170,90,90,165,165,165,165,165,165,165,165,165,181,213,93,85,181,171,91,93,91,171,93,91,187,213,187,189,91,187,187,189,187,187,187,203,187,109,182,214,182,214,182,198,214,109,102,214,108,107,198,198,108,108,108,108,108,198,198,198,204,108,198,204,198,204,198,204,198,22,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,165,170,170,90,170,90,165,170,90,90,90,165,165,165,165,165,165,165,165,181,165,213,90,91,90,93,91,93,91,93,91,181,219,91,189,91,187,187,219,187,187,187,203,187,182,219,109,107,182,214,182,214,182,214,107,108,102,214,108,102,214,108,108,108,108,108,108,108,108,198,198,204,108,198,204,198,204,198,22,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,170,90,170,90,165,170,90,165,170,90,90,90,90,90,90,90,90,85,165,165,181,165,93,85,213,91,93,91,93,91,93,91,187,93,187,187,187,213,187,187,187,203,187,188,187,109,182,187,198,214,182,214,107,108,109,102,214,108,107,108,108,108,108,108,108,108,108,108,108,198,204,108,198,204,108,204,108,204,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,165,170,90,165,170,90,165,165,170,90,90,90,90,90,90,85,165,165,90,85,213,85,213,91,93,85,213,93,91,93,181,189,91,187,93,181,203,187,187,187,187,187,187,203,182,187,203,107,182,214,182,203,109,102,182,198,109,102,198,109,102,198,108,108,108,108,108,108,108,108,198,204,108,198,204,198,204,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,165,170,165,170,90,165,165,165,165,165,165,165,165,165,90,90,85,165,91,90,85,213,91,90,91,91,93,91,93,91,181,187,181,219,181,197,187,187,187,219,187,188,187,182,219,107,182,214,182,214,182,182,109,102,198,182,108,102,214,108,102,198,198,108,108,108,108,108,108,108,198,198,204,108,198,204,198,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,165,170,90,165,165,170,90,165,165,165,165,165,165,165,90,90,85,165,90,85,181,90,91,93,85,213,91,93,91,91,186,181,219,91,187,187,187,187,187,187,187,187,182,219,107,187,109,107,182,182,214,109,102,182,198,109,102,214,108,102,198,198,108,108,102,198,198,198,198,198,198,204,108,198,204,108,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,90,165,170,90,90,90,90,90,90,90,90,85,165,165,90,85,165,91,90,85,181,93,85,181,181,213,91,181,213,187,91,187,181,219,187,187,187,187,187,187,188,187,187,107,187,109,107,109,107,107,108,107,102,214,102,214,102,198,108,102,198,108,102,198,198,198,198,198,198,204,108,108,198,204,108,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,165,170,90,90,165,165,165,165,165,165,90,90,85,165,90,85,165,90,85,181,165,91,90,91,85,213,181,213,181,187,93,181,187,187,91,187,187,187,187,187,187,182,187,182,214,187,107,107,109,107,107,109,102,109,102,102,198,109,102,198,108,102,198,198,108,102,198,198,198,198,204,108,108,198,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,165,165,170,90,90,90,90,90,90,90,90,85,165,90,85,165,85,165,85,165,93,85,181,93,85,181,213,181,187,93,91,187,91,187,187,187,187,187,187,187,187,188,182,187,182,187,107,203,107,107,108,107,102,182,108,102,182,108,102,108,102,198,108,102,198,198,198,198,198,198,198,198,198,204,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,165,165,165,165,165,165,165,165,90,85,165,90,85,165,85,165,85,181,90,85,181,93,85,181,213,181,181,187,91,181,187,187,91,187,187,181,187,187,187,188,187,182,187,182,187,107,107,109,102,182,182,198,182,109,102,108,102,198,108,102,198,108,102,198,108,102,198,198,198,198,198,204,108,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,165,165,165,165,165,165,165,165,90,85,165,90,85,90,85,90,85,90,85,181,93,85,181,181,181,181,181,213,187,91,187,91,187,187,91,187,187,187,187,182,187,182,187,182,187,109,107,107,107,108,107,102,214,102,108,102,182,108,102,198,108,102,198,108,102,198,198,198,198,198,198,198,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,165,165,165,165,165,165,90,85,165,90,85,165,85,165,85,90,85,181,91,85,181,93,85,181,181,213,181,187,91,187,91,187,187,187,187,187,187,187,187,107,187,107,182,187,107,107,107,109,102,182,107,102,182,102,214,102,108,102,108,102,108,102,108,102,198,198,108,108,108,108,108,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,90,90,90,90,85,165,90,85,165,90,85,90,85,85,165,85,85,181,85,213,91,85,181,181,213,181,181,187,91,187,91,187,91,187,187,187,187,187,107,187,187,107,182,187,107,107,109,102,182,182,107,102,198,102,102,198,102,108,102,108,102,108,102,198,108,108,108,108,108,108,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,165,90,90,85,165,90,85,165,90,85,85,165,85,85,90,85,85,181,91,85,181,181,165,181,181,187,91,181,187,181,187,187,187,187,187,187,187,187,182,187,107,182,187,107,107,107,107,102,182,109,102,107,102,102,214,102,108,102,108,102,108,102,198,108,102,198,108,108,108,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,90,90,85,165,165,90,85,165,85,90,85,85,165,85,85,91,85,90,85,181,91,91,91,91,91,91,181,187,91,187,181,187,187,91,187,187,187,107,187,107,187,107,182,182,182,182,182,182,198,107,102,107,102,102,102,198,102,108,102,108,102,102,198,108,102,198,198,108,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,90,85,165,90,85,165,85,165,85,90,85,85,85,165,85,91,85,181,91,85,181,181,181,181,181,187,91,181,187,187,91,187,187,187,187,187,187,107,187,107,182,182,187,107,107,107,102,182,107,102,107,102,108,102,102,108,102,102,108,102,108,102,108,102,198,108,108,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,85,165,90,85,165,85,165,85,90,85,85,85,165,85,85,85,181,91,85,181,181,181,181,181,187,91,181,187,181,187,187,187,187,187,187,182,187,187,107,187,107,182,182,182,182,182,182,107,102,182,102,107,102,102,102,102,108,102,102,108,102,108,102,198,108,108,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,90,85,165,85,165,85,90,85,85,85,165,85,85,85,181,85,91,85,181,91,85,181,181,181,187,91,181,187,181,187,187,187,187,187,187,187,107,187,107,182,187,107,107,107,107,102,182,107,102,107,102,102,102,108,102,102,102,198,102,108,102,108,102,198,108,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,85,165,85,165,85,90,85,85,85,165,85,85,85,85,85,181,91,85,181,91,91,91,91,181,181,187,91,187,181,187,187,187,187,187,187,107,187,182,187,182,187,107,107,107,107,102,182,107,102,102,182,102,102,102,102,102,198,102,102,108,102,108,102,108,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,85,165,85,165,85,85,90,85,85,85,85,85,85,181,85,91,85,181,91,91,91,91,91,181,187,91,181,187,187,187,187,187,187,187,187,182,187,182,187,107,107,107,107,107,102,182,107,102,102,182,102,102,102,102,102,102,102,198,102,108,102,108,102,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,85,90,85,85,90,85,85,85,85,85,85,85,85,85,181,85,181,91,91,85,181,181,181,187,91,181,187,187,181,187,187,187,187,187,107,187,182,187,107,182,187,107,107,107,102,182,102,182,102,102,102,182,102,102,102,102,198,102,102,102,198,102,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,85,85,165,85,85,85,85,85,85,85,85,85,181,85,181,85,181,91,91,91,91,91,91,181,187,181,187,187,187,187,187,187,187,187,107,187,107,182,187,107,107,107,107,102,182,107,102,107,102,102,102,102,102,102,102,102,102,108,102,102,198,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,245,85,85,85,90,85,85,85,85,85,85,85,85,181,85,181,91,91,91,91,91,91,181,187,91,187,181,187,187,187,187,187,187,107,187,182,187,182,182,187,107,107,107,102,182,107,102,102,107,102,102,102,102,102,102,102,102,102,108,102,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,85,85,165,85,85,85,85,85,85,85,85,181,85,91,85,91,91,85,181,181,181,187,91,187,91,187,187,187,187,187,187,187,187,107,187,107,182,187,107,107,107,107,102,182,107,102,107,102,102,102,102,102,102,102,102,102,108,102,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,85,85,85,85,85,85,85,85,85,85,85,91,85,91,91,85,181,181,181,187,91,181,187,181,187,187,91,187,187,187,187,101,107,187,107,182,187,107,107,107,107,102,182,107,102,102,102,102,102,102,102,102,102,102,102,102,102,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,245,85,85,85,85,85,85,85,85,85,91,85,91,85,181,91,91,91,91,91,181,187,91,187,181,187,187,187,187,187,187,107,187,107,187,107,182,182,182,182,182,182,107,102,107,102,107,102,102,102,102,102,102,102,102,102,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,85,85,85,85,85,85,85,85,85,85,181,85,181,91,91,91,91,91,91,181,187,91,187,187,187,187,187,187,187,187,187,101,107,182,187,107,182,182,182,182,107,102,182,102,182,102,102,102,102,102,102,102,102,102,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,85,85,85,85,85,85,85,85,181,85,181,91,85,181,91,91,91,91,181,187,181,187,91,187,181,101,187,187,107,187,101,107,182,187,107,107,107,107,107,102,182,107,102,102,182,102,102,102,102,102,102,102,102,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,245,85,85,85,85,85,85,85,85,181,85,91,85,181,181,181,181,187,91,181,187,187,91,187,187,187,187,187,187,187,107,187,107,182,187,107,107,107,107,102,182,107,102,182,102,102,102,102,102,102,102,102,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,245,85,85,85,85,85,85,85,181,91,85,181,181,181,181,181,187,91,181,187,91,187,187,86,91,187,187,107,187,187,107,182,187,107,107,182,182,182,182,107,102,182,102,102,102,182,102,102,102,102,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,85,85,85,85,85,85,181,85,91,85,181,91,85,181,181,187,91,181,187,181,187,187,187,187,187,187,187,182,187,182,187,182,187,107,107,107,102,182,182,102,182,102,107,102,102,102,102,102,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,85,85,85,85,85,85,181,85,181,91,91,91,91,91,91,181,187,91,187,181,187,187,187,187,187,182,86,187,187,107,182,187,107,107,107,107,102,182,107,102,107,102,102,102,102,102,111,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,85,85,85,85,181,85,181,91,85,181,91,91,91,181,181,187,91,187,181,101,187,187,187,187,187,187,107,187,107,182,187,107,107,107,107,102,182,107,102,102,102,182,102,102,111,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,85,85,85,85,181,85,91,85,181,181,181,181,181,187,91,187,91,187,187,187,187,187,187,187,101,107,187,107,182,187,107,107,107,107,102,182,107,102,182,102,102,102,111,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,85,85,85,181,91,85,181,181,181,181,181,187,91,181,187,181,187,187,91,187,187,187,187,101,107,182,187,182,182,187,107,107,107,102,182,107,102,102,182,102,111,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,85,85,91,85,91,85,181,91,91,91,91,181,187,91,187,181,187,187,187,187,187,187,101,107,187,107,182,187,107,107,107,107,102,182,107,102,102,182,111,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,245,85,91,85,181,91,91,91,91,181,181,187,181,187,187,187,187,187,187,187,187,101,107,182,187,107,182,182,182,182,182,182,107,102,182,102,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,245,85,91,91,91,91,91,91,91,181,187,91,187,91,187,181,101,187,187,101,107,187,107,187,107,182,182,182,182,182,107,102,182,102,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,85,85,181,91,91,91,91,181,187,91,187,187,91,187,187,187,187,187,107,187,182,187,107,182,182,182,182,182,182,182,111,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,245,181,91,91,91,181,187,91,187,91,187,187,187,187,187,187,187,187,107,187,107,182,187,107,182,182,182,102,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,245,181,181,181,187,91,181,187,181,187,187,187,187,187,182,187,187,107,187,107,182,182,182,182,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,245,181,187,91,181,187,187,187,181,101,187,187,187,182,187,187,107,182,182,182,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,251,187,181,187,187,187,187,187,187,187,187,187,107,182,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,}; -char color_wheel_bits_8[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,8,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,3,8,3,8,8,3,8,8,3,8,8,8,8,8,3,2,3,8,8,8,8,8,8,8,2,3,2,8,8,8,2,8,8,2,8,8,2,8,2,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,2,8,2,8,8,2,8,2,8,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,3,2,3,2,3,2,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,8,3,2,3,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,2,8,2,2,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,3,3,3,8,3,3,3,8,3,8,3,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,3,2,3,2,3,2,8,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,8,2,8,2,8,2,8,2,2,8,2,2,2,8,2,2,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,8,3,8,8,8,8,3,2,3,2,3,2,3,2,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,8,2,2,8,2,2,2,8,2,2,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,3,2,3,8,8,8,8,8,2,8,8,8,8,2,3,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,8,2,2,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,3,2,3,2,3,2,8,8,8,8,8,8,8,2,3,2,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,8,3,2,3,2,3,8,8,8,8,8,8,2,3,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,2,2,8,2,2,2,2,2,2,2,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,3,2,3,2,8,8,8,8,8,2,3,2,8,8,2,8,8,8,2,8,2,8,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,3,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,2,3,8,8,8,8,8,8,8,8,8,8,2,3,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,3,2,8,8,2,8,8,8,2,8,2,8,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,2,3,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,2,8,8,2,8,2,8,2,2,8,2,8,2,2,2,8,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,9,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,7,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,3,9,3,3,3,3,3,3,3,9,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,8,3,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,2,8,2,8,2,8,2,2,8,2,2,2,8,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,7,2,2,2,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,9,3,3,3,3,9,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,8,2,8,2,8,2,2,8,2,2,8,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,7,2,2,2,2,2,7,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,9,3,3,3,9,3,3,3,3,3,9,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,2,8,2,8,2,8,2,2,8,2,2,2,8,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,7,2,2,2,7,2,2,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,3,3,9,3,3,3,3,9,3,3,3,3,3,3,9,3,3,3,3,3,3,3,3,3,9,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,7,2,2,2,2,7,2,2,2,7,2,2,2,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,9,3,3,9,3,3,3,9,3,3,3,3,9,3,3,3,3,3,3,3,9,3,3,3,3,3,3,8,3,3,3,8,3,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,7,2,2,2,2,2,7,2,2,2,7,2,2,2,7,2,2,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,9,3,3,3,3,9,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,8,2,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,2,8,2,2,2,2,2,2,2,7,2,2,2,2,7,2,2,2,7,2,2,7,2,2,7,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,9,3,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,3,3,3,9,3,3,3,3,3,9,3,3,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,2,2,2,7,2,2,2,7,2,2,2,2,7,2,2,2,7,2,2,7,2,2,7,2,2,7,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,9,3,3,3,3,3,3,9,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,7,2,2,2,2,2,2,2,7,2,2,2,2,7,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,9,3,9,3,9,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,3,9,3,3,3,3,3,3,3,8,3,3,3,9,3,8,3,3,8,3,9,3,8,3,8,3,8,8,3,8,3,8,8,3,8,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,7,2,2,2,2,2,8,2,2,7,2,2,2,7,2,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,9,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,9,3,3,3,9,3,8,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,8,3,8,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,7,2,2,2,8,2,2,2,7,2,2,2,2,7,2,2,2,7,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,3,9,3,3,3,3,8,3,3,3,8,3,3,8,3,9,3,8,3,8,3,8,3,13,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,2,8,2,8,2,8,2,7,2,8,2,2,2,8,2,2,2,7,2,2,2,2,7,2,2,2,7,2,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,9,3,3,3,3,9,3,3,8,3,9,3,8,3,8,3,8,3,13,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,7,2,8,2,2,8,2,2,7,2,2,2,8,2,2,7,2,2,7,2,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,3,9,3,3,8,3,3,9,3,8,3,3,8,3,9,3,8,3,8,3,8,3,13,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,8,2,8,8,2,8,8,2,8,2,8,7,8,2,8,2,8,2,2,8,2,7,2,2,8,2,2,7,2,2,2,7,2,2,2,7,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,3,9,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,9,3,3,9,3,3,9,3,3,3,9,3,3,8,3,3,9,3,3,8,3,3,13,3,3,8,3,13,3,8,3,13,3,8,3,8,8,3,8,8,9,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,7,2,8,2,8,2,7,2,8,2,2,13,2,2,2,7,2,2,13,2,2,2,7,2,2,7,2,2,7,2,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,2,7,7,2,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,3,9,9,3,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,3,9,3,3,8,3,3,13,3,3,8,3,9,3,8,3,8,3,8,3,13,3,8,8,3,13,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,7,8,2,8,2,8,2,13,2,8,2,2,13,2,2,2,8,2,2,13,2,2,2,7,2,2,7,2,2,7,2,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,2,7,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,3,9,3,3,9,3,3,9,3,3,8,3,9,3,3,3,13,3,3,8,3,13,3,3,13,3,8,3,8,8,3,13,3,8,8,8,3,8,8,8,8,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,7,8,2,8,2,13,2,8,2,8,2,7,2,8,2,2,13,2,2,7,2,2,7,2,2,13,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,7,2,7,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,3,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,3,9,3,3,9,3,8,3,9,3,3,8,3,3,13,3,3,13,3,3,8,3,13,3,8,3,13,3,8,8,3,8,8,8,9,8,8,8,3,13,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,7,8,8,2,8,8,2,13,2,8,8,2,8,2,13,2,2,8,2,13,2,2,2,8,2,7,2,2,13,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,2,7,7,2,7,7,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,3,9,9,9,3,9,9,3,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,9,3,3,9,3,3,9,3,3,13,3,3,3,13,3,3,8,3,13,3,8,3,8,3,13,3,8,8,3,13,3,8,8,8,3,13,8,8,8,8,8,8,8,8,8,8,8,8,8,7,8,8,8,8,8,2,13,8,2,8,8,2,8,7,8,2,8,2,13,2,2,13,2,2,8,2,7,2,2,13,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,3,9,9,9,3,9,9,3,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,3,9,3,8,3,3,9,3,8,3,9,3,8,3,9,3,8,3,13,3,8,3,13,3,8,8,8,3,13,8,8,3,8,8,8,8,8,8,8,8,8,13,8,8,8,8,8,8,8,7,8,8,2,8,8,7,8,2,13,2,8,2,13,2,2,8,2,8,2,7,2,8,2,7,2,2,13,2,2,7,2,8,2,7,2,7,2,7,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,7,2,7,2,7,7,2,7,7,7,2,7,7,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,3,9,9,9,3,9,9,3,9,9,3,9,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,8,3,9,3,9,3,8,3,13,3,3,13,3,3,13,3,8,3,13,3,8,3,13,3,8,8,9,8,3,8,8,8,13,3,8,8,8,13,3,8,8,8,8,8,8,8,7,8,8,8,8,8,7,8,2,8,8,2,13,2,8,2,13,2,8,2,13,2,2,13,2,2,13,2,2,7,2,8,2,7,2,7,2,7,2,7,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,9,3,9,9,9,3,4,3,9,9,3,9,9,3,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,8,3,13,3,3,13,3,3,13,3,8,3,13,3,8,3,13,3,8,8,3,13,3,8,8,13,3,8,8,8,8,13,3,7,8,8,8,8,8,13,8,8,8,8,8,7,8,2,8,13,2,8,13,2,8,8,2,13,2,8,2,13,2,2,8,2,13,2,2,7,2,13,2,2,7,2,13,2,2,7,2,13,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,2,1,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,3,9,9,9,9,9,3,9,9,3,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,8,3,9,3,3,13,3,3,9,3,8,3,9,3,8,3,13,3,8,3,13,3,8,8,9,8,8,3,13,8,8,8,8,3,13,8,8,8,8,8,13,8,8,8,8,8,7,8,8,8,8,2,13,8,2,8,8,2,13,2,8,2,13,2,8,2,7,2,8,2,13,2,2,8,2,7,2,13,2,2,7,2,13,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,2,1,2,7,7,7,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,9,9,3,9,9,9,9,3,9,9,9,9,3,9,9,9,3,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,13,3,3,9,3,8,3,13,3,3,13,3,13,3,8,3,13,3,8,3,13,3,8,8,13,3,8,8,8,9,8,8,8,8,8,13,8,8,8,8,8,8,7,8,8,8,8,7,8,8,2,13,8,2,13,2,8,8,7,2,13,2,8,2,13,2,2,13,2,2,13,2,2,13,2,2,7,2,13,2,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,2,1,2,7,7,7,2,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,9,3,4,3,9,9,9,9,3,9,9,9,3,9,9,3,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,8,3,9,3,13,3,3,13,3,3,13,3,3,13,3,3,13,3,8,3,13,3,13,3,8,8,9,8,8,3,13,8,8,8,13,3,7,3,8,13,8,8,8,8,8,8,13,2,8,8,13,2,8,8,13,2,8,8,7,2,13,2,8,2,13,2,2,13,2,2,13,2,2,13,2,2,7,2,13,2,7,2,7,2,7,2,7,2,7,7,2,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,2,7,7,7,7,2,7,7,7,7,7,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,9,3,4,3,9,9,9,9,9,3,9,9,9,9,3,9,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,9,3,9,9,3,9,3,9,3,13,3,9,3,9,3,8,3,13,3,3,13,3,8,3,13,3,8,9,3,13,3,8,13,3,8,8,13,3,8,13,3,7,3,13,8,8,8,8,8,8,13,8,8,8,7,8,8,13,2,8,8,13,2,8,8,7,2,13,2,13,2,13,2,8,2,13,2,2,13,2,2,7,2,13,2,7,2,7,2,8,7,2,7,2,7,7,2,7,2,7,7,2,7,2,7,2,7,7,2,7,7,7,2,7,7,7,2,7,7,7,7,2,1,2,7,7,7,7,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,3,9,9,9,3,9,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,3,9,3,9,3,9,8,3,9,3,13,3,3,13,3,9,3,8,3,13,3,3,13,3,8,9,3,13,8,3,13,3,13,8,3,13,8,8,8,13,3,8,8,13,8,8,13,8,8,8,8,8,13,8,8,8,7,8,8,8,2,13,2,13,2,13,2,8,2,13,2,8,2,13,2,2,13,2,2,13,2,7,2,8,2,13,2,7,2,7,2,13,2,7,2,7,2,7,7,2,7,2,7,7,2,7,7,7,2,7,7,7,2,7,7,7,7,2,1,2,7,7,7,7,7,7,7,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,9,9,9,9,9,3,9,9,9,9,9,9,3,4,3,9,9,9,3,9,9,9,3,9,9,9,3,9,9,3,9,3,9,9,3,9,9,3,9,8,3,9,3,9,3,13,3,9,3,8,9,3,13,3,13,3,3,13,3,8,13,3,8,9,8,8,3,13,8,3,13,8,8,3,13,8,8,8,13,8,8,8,8,8,13,8,8,7,8,8,8,7,8,8,13,2,13,2,8,8,8,7,8,2,13,2,13,2,2,13,2,7,2,13,2,2,13,2,7,2,7,2,13,2,7,2,7,2,7,7,2,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,7,2,1,2,7,7,7,7,7,7,7,7,7,7,7,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,9,9,9,9,9,9,9,9,9,9,3,4,3,9,9,9,3,4,3,9,9,9,3,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,9,3,9,9,3,13,3,9,3,13,3,3,13,3,9,3,13,3,3,13,3,8,9,3,13,3,13,3,13,3,7,3,13,8,8,8,13,3,7,8,9,8,8,8,13,8,8,8,8,7,8,13,8,8,2,13,8,2,13,8,2,13,2,13,2,8,2,13,2,13,2,2,13,2,2,13,2,7,2,13,2,7,2,7,2,13,2,7,7,2,7,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,7,2,1,2,7,7,7,7,7,7,7,7,2,1,2,7,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,9,9,9,9,9,9,9,9,9,9,9,3,4,3,9,9,9,9,9,3,9,9,9,3,9,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,9,3,13,3,9,3,13,3,9,3,13,3,3,13,3,8,3,13,3,13,3,13,3,13,3,13,3,7,3,13,8,3,13,8,3,13,8,8,8,13,8,8,8,13,8,8,7,8,13,8,8,8,7,8,8,13,2,8,13,2,13,2,8,7,8,2,13,2,13,2,2,13,2,7,2,13,2,2,13,2,7,2,13,2,7,2,7,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,7,2,7,7,7,7,7,7,7,7,2,1,2,7,7,7,7,7,7,7,7,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,3,9,9,9,3,9,9,9,3,9,9,9,3,9,9,3,9,9,3,9,8,9,3,9,3,13,3,9,3,13,3,9,3,13,3,3,13,3,13,3,8,3,13,3,13,3,13,8,3,13,8,8,13,3,8,13,8,8,8,13,8,8,8,13,8,8,8,8,13,8,8,7,8,8,13,2,8,13,2,8,7,8,2,13,2,13,2,13,2,2,13,2,13,2,7,2,13,2,7,2,13,2,7,7,2,7,7,2,13,2,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,4,3,9,9,9,9,9,9,9,3,9,9,9,9,3,9,9,9,3,9,9,3,9,9,3,9,9,3,9,8,9,3,9,9,3,13,3,9,3,13,3,13,3,9,8,3,13,3,13,3,13,3,13,3,8,13,3,8,13,3,13,8,8,8,13,8,8,9,8,13,8,8,8,13,8,8,7,8,8,13,2,13,2,13,2,13,2,13,2,13,2,13,2,13,2,7,8,2,13,2,7,2,13,2,7,2,13,2,7,7,2,13,2,7,7,2,7,7,2,7,7,7,2,7,7,7,2,7,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,3,9,9,9,9,3,9,9,3,9,9,9,3,9,9,8,9,3,9,9,3,13,3,9,8,3,13,3,13,3,9,3,13,3,13,3,3,13,3,13,3,13,8,3,13,8,8,13,3,8,13,8,8,9,8,13,8,8,8,13,8,8,7,8,13,8,8,7,8,8,13,2,13,8,8,2,13,2,13,2,13,2,8,2,13,2,7,2,13,2,13,2,7,8,2,13,2,7,7,2,13,2,7,7,2,7,7,7,2,7,7,7,2,7,7,7,7,2,7,7,7,7,7,7,7,7,2,1,2,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,9,9,9,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,3,4,3,9,9,9,9,9,9,3,9,9,9,3,9,9,9,3,9,9,9,3,9,9,3,9,9,8,3,13,3,9,9,3,13,3,9,8,3,13,3,13,3,13,3,13,3,13,3,8,13,3,13,8,3,13,8,8,13,3,13,8,8,13,8,8,13,8,8,13,8,8,13,8,8,7,8,13,2,9,2,13,2,13,8,2,13,2,13,2,13,2,13,2,13,2,13,2,7,2,13,2,7,7,2,13,2,7,7,2,7,7,7,2,13,2,7,7,2,7,7,7,2,7,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,4,9,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,9,3,9,9,9,9,3,9,9,9,3,9,9,8,9,3,9,13,3,9,13,3,9,8,9,3,13,3,13,3,3,13,3,13,3,13,3,13,8,3,13,8,8,9,8,13,3,7,9,8,8,13,8,8,13,8,8,13,8,8,7,8,13,8,8,13,2,13,2,13,8,2,13,2,13,2,13,2,8,2,13,2,13,2,7,8,7,2,13,2,13,2,7,7,2,13,7,2,7,7,8,7,7,2,7,7,7,7,2,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,7,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,4,3,9,9,9,9,3,9,9,9,9,3,9,9,9,3,9,9,8,9,3,10,3,9,8,9,3,13,3,9,13,3,13,3,9,8,9,3,13,3,13,3,13,3,13,8,3,13,8,9,8,13,3,13,8,8,13,8,8,13,8,8,13,8,8,13,8,8,7,8,13,2,13,8,8,7,8,13,2,13,2,13,2,13,2,13,2,13,2,7,8,7,2,13,2,13,2,7,7,8,7,2,13,7,2,7,7,7,2,7,7,7,7,2,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,4,9,9,9,9,4,9,9,9,9,9,9,4,3,4,3,4,3,4,3,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,3,9,9,9,9,3,9,9,8,9,9,3,13,3,13,9,3,13,3,13,3,13,3,13,3,13,3,13,3,13,3,13,8,3,13,8,13,3,13,8,8,13,3,13,8,13,8,8,13,8,8,13,8,7,8,13,8,8,13,8,7,8,13,2,13,2,13,2,13,2,13,2,13,2,7,8,2,13,2,13,2,7,13,2,13,2,7,13,2,7,7,7,2,13,7,2,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,7,7,1,7,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,4,9,9,9,4,9,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,9,3,9,9,9,9,3,9,9,8,9,9,3,13,9,3,13,3,9,9,8,9,3,13,3,13,3,13,3,13,3,13,3,13,3,13,8,9,8,13,3,13,8,13,3,7,13,3,13,8,8,13,8,8,13,8,13,8,8,13,8,7,8,13,2,13,2,13,8,2,13,8,2,13,2,13,2,13,2,13,2,7,13,2,7,13,2,7,7,2,13,7,2,13,7,2,7,7,7,7,7,2,12,2,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,1,7,7,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,4,9,9,9,9,4,9,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,3,9,9,9,9,9,3,13,9,3,13,9,9,3,13,9,3,13,3,13,3,13,3,13,3,13,3,13,3,13,3,13,8,3,13,8,13,3,13,8,13,3,13,8,13,8,8,13,8,13,8,8,7,13,8,8,7,8,13,2,13,8,8,7,13,2,13,2,13,2,13,2,13,2,7,13,2,13,2,13,2,7,13,2,13,7,2,7,7,7,7,7,2,13,7,2,12,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,7,1,7,7,7,1,7,7,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,4,9,9,4,9,9,9,9,9,4,9,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,8,9,9,9,3,13,9,3,9,13,3,9,13,3,13,3,13,9,3,13,9,3,13,3,13,3,13,3,13,8,13,3,13,8,13,3,13,8,13,8,8,13,8,13,8,8,13,8,13,8,8,13,8,7,8,13,8,7,8,13,2,13,2,13,2,13,2,13,2,13,2,13,2,7,13,2,13,7,2,13,7,2,7,13,2,7,7,7,13,2,7,7,7,7,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,7,7,7,1,2,1,7,7,7,1,7,7,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,9,9,4,9,9,9,4,9,9,9,9,4,9,9,9,9,9,9,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,9,9,9,3,9,9,9,8,9,9,9,9,8,9,9,3,13,9,9,3,13,9,3,13,3,13,3,13,3,13,8,9,13,3,13,3,13,8,13,3,13,8,13,8,8,13,8,13,8,8,13,8,13,8,7,8,13,8,13,2,13,8,2,13,8,13,2,13,2,13,2,13,2,13,2,13,7,2,13,7,2,13,7,2,13,7,7,7,7,8,7,7,7,2,12,2,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,7,7,7,1,7,7,7,1,7,7,1,7,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,4,9,9,4,9,9,9,4,9,9,4,3,4,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,9,8,9,9,3,13,9,3,13,9,3,13,9,3,13,9,8,13,3,13,3,13,3,13,3,13,8,13,3,13,8,13,3,13,8,13,3,13,8,13,8,13,8,13,8,8,13,8,13,8,7,8,13,8,7,13,2,13,2,13,2,13,2,13,2,13,7,13,2,13,2,13,7,2,13,7,7,2,13,7,2,13,7,7,2,13,7,7,7,7,7,7,8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,1,7,7,7,7,1,7,7,7,1,7,7,1,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,9,4,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,9,8,9,9,9,13,3,13,9,9,9,13,3,13,9,3,13,9,3,13,3,13,9,13,3,13,3,13,3,13,13,3,13,8,13,3,13,13,8,13,8,13,8,13,8,13,8,13,8,7,8,13,8,13,8,7,8,13,2,13,8,13,2,13,2,13,13,2,13,2,13,7,2,13,7,2,13,7,7,8,7,7,7,7,2,13,7,7,7,2,13,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,7,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,7,1,7,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,4,9,9,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,8,9,9,9,9,13,3,9,13,3,13,9,3,13,13,3,13,9,13,3,13,3,13,3,13,13,3,13,3,13,8,13,3,13,8,13,8,13,3,13,8,13,8,8,13,8,13,8,13,8,7,13,8,13,2,13,8,13,2,13,2,13,2,13,2,13,7,2,13,7,13,2,13,7,2,13,7,7,13,2,13,7,7,7,2,13,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,7,7,7,1,7,7,7,7,1,7,7,7,1,7,7,7,1,7,7,1,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,4,9,9,9,9,4,9,9,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,8,9,9,9,13,3,9,13,3,13,9,9,3,13,9,13,3,13,3,13,9,3,13,13,3,13,3,13,8,13,3,13,13,3,13,13,8,13,3,13,7,8,13,8,13,8,13,8,13,8,7,13,8,13,2,13,8,13,2,13,2,13,13,2,13,7,13,2,13,7,13,2,13,2,13,7,7,13,2,7,13,2,12,2,13,7,7,7,7,7,7,7,7,7,2,12,2,7,7,7,7,7,7,7,7,7,7,1,2,1,7,7,7,1,2,1,7,7,1,7,7,7,1,7,7,1,7,7,1,7,1,7,7,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,4,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,13,3,9,13,9,9,9,9,13,3,13,9,3,13,9,13,3,13,9,13,3,13,3,13,13,3,13,13,3,13,8,13,3,13,8,13,8,13,8,13,8,13,8,13,8,13,8,13,8,7,13,8,13,2,13,13,2,13,7,8,13,2,13,2,13,7,13,2,13,2,13,7,7,13,2,13,7,7,7,8,7,7,7,7,7,13,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,7,7,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,4,9,9,9,9,4,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,8,9,9,9,9,13,3,9,13,3,13,9,9,13,3,13,9,13,3,13,3,13,9,13,3,13,3,13,3,13,13,3,13,13,8,13,3,13,13,8,13,8,13,8,13,8,13,8,13,7,8,13,8,13,8,7,13,2,13,8,13,2,13,2,13,13,2,13,7,2,13,7,13,2,13,7,7,7,13,2,13,7,7,7,13,2,12,7,7,7,7,7,13,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,7,1,7,7,7,1,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,9,4,9,4,9,9,4,9,4,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,4,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,13,9,9,9,13,3,10,9,8,9,9,13,3,13,9,13,3,13,9,13,3,13,3,13,13,3,13,13,3,13,8,13,3,13,13,8,13,8,13,8,13,8,13,8,13,8,13,13,8,13,7,8,13,2,13,13,2,13,13,2,13,7,13,2,13,7,13,2,13,7,13,2,13,7,7,2,13,7,7,13,7,2,12,7,8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,1,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,1,7,1,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,4,9,4,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,13,9,9,9,8,9,9,13,9,9,13,3,13,9,9,13,3,13,9,13,3,13,9,13,3,13,13,3,13,13,3,13,13,8,13,3,13,13,8,13,8,13,13,3,13,7,13,8,13,8,13,8,7,13,8,13,2,13,13,2,13,2,13,13,2,13,7,13,2,13,7,13,2,13,7,7,13,7,7,13,2,12,7,8,7,7,7,7,13,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,1,7,7,7,7,1,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,1,7,7,1,7,1,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,4,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,13,9,9,9,9,13,3,13,9,9,13,9,3,13,9,13,3,13,9,13,3,13,9,13,3,13,8,13,3,13,13,3,13,13,8,13,8,13,3,13,13,8,13,8,13,8,13,7,13,8,13,8,7,13,8,13,2,13,13,2,13,13,2,13,7,13,2,13,7,13,2,13,7,7,13,2,13,7,7,13,7,7,7,13,7,7,7,7,7,7,7,7,7,7,7,12,7,7,7,7,7,7,1,7,7,7,7,1,7,7,1,7,7,7,1,7,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,13,9,9,9,9,13,9,9,13,9,9,13,3,13,9,9,13,9,13,3,13,9,13,3,13,13,3,13,13,3,13,13,3,13,13,8,13,3,13,13,13,8,13,13,8,13,8,13,13,8,13,8,13,7,13,8,13,2,13,13,2,13,7,13,2,13,13,2,13,7,13,2,13,7,13,7,7,13,7,7,13,2,12,7,8,7,7,7,7,13,7,7,7,7,13,7,7,7,7,7,7,7,1,7,7,7,7,1,7,7,1,7,7,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,9,4,9,9,9,9,9,4,9,9,9,13,9,9,9,9,13,9,9,9,13,9,9,9,13,9,9,13,3,13,9,13,9,13,3,13,9,13,9,13,3,13,13,3,13,13,3,13,13,13,3,13,13,8,13,8,13,8,13,13,8,13,7,13,8,13,8,13,7,13,2,13,13,2,13,13,7,13,2,13,7,13,2,13,7,13,7,7,13,2,13,7,7,13,7,7,7,13,7,7,7,7,7,7,13,7,7,7,7,7,12,7,7,7,7,1,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,9,9,4,9,9,9,9,13,9,9,9,9,10,9,9,9,13,9,9,9,13,9,9,13,3,13,9,13,9,13,3,13,9,13,9,13,3,13,13,3,13,13,3,13,13,8,13,13,3,13,13,8,13,13,8,13,13,8,13,8,13,13,8,13,7,13,8,13,2,13,13,2,13,13,2,13,13,7,13,2,13,7,13,7,13,2,12,7,13,7,7,13,7,7,7,13,7,7,7,13,7,7,7,7,12,7,7,7,7,7,1,7,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,9,4,9,9,9,4,9,9,9,4,9,9,9,9,9,10,9,9,9,9,10,9,9,13,9,9,9,13,9,9,13,9,9,13,9,13,9,9,13,9,13,9,8,13,9,13,3,13,13,9,13,8,13,3,13,13,3,13,13,13,8,13,8,13,13,8,13,13,8,13,8,13,7,13,8,13,7,13,8,13,7,13,2,13,13,7,13,2,13,7,13,7,13,2,12,13,7,8,7,13,7,7,13,7,7,7,13,7,7,7,7,12,7,7,7,7,7,7,12,7,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,9,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,9,4,9,4,9,9,4,9,9,9,4,9,9,9,9,9,4,9,9,9,9,10,9,9,9,13,9,9,9,13,9,9,9,13,9,9,13,9,9,13,9,8,9,13,9,13,3,13,9,13,13,3,13,13,3,13,13,9,13,13,3,13,13,13,8,13,13,3,13,13,8,13,13,7,13,8,13,13,8,13,7,13,2,13,13,2,13,13,7,13,2,13,13,7,13,2,13,7,13,7,13,7,7,13,7,7,13,7,7,7,13,7,7,7,7,13,7,7,7,12,7,7,7,7,1,7,7,7,12,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,10,9,9,9,10,9,9,9,13,9,9,9,9,13,4,8,9,13,9,9,13,9,9,13,9,13,9,13,9,8,10,8,13,9,13,9,13,3,13,13,9,13,3,13,13,13,3,13,13,8,13,13,8,13,13,13,8,13,8,13,13,8,13,7,13,8,13,7,13,13,2,13,13,2,13,13,7,13,7,13,7,13,7,13,7,7,13,7,7,13,7,7,13,7,7,7,13,7,7,7,12,7,7,7,7,7,12,7,7,7,7,1,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,7,1,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,4,13,9,9,9,9,4,13,9,9,9,10,8,4,13,9,9,13,9,9,13,9,13,9,9,13,9,13,3,13,9,13,9,13,3,13,13,13,3,13,13,13,3,13,13,13,8,13,13,3,12,9,13,8,13,13,7,13,8,13,13,7,13,8,13,7,13,2,13,13,13,7,13,7,13,2,13,13,7,13,7,7,13,7,13,7,7,13,7,7,13,7,7,13,7,7,12,7,7,7,7,13,7,1,7,7,7,12,7,7,1,13,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,9,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,9,4,13,9,4,9,9,9,10,9,9,9,13,4,8,4,13,9,9,13,9,9,13,9,9,13,9,13,9,13,9,13,9,13,9,13,9,13,13,9,13,13,3,13,13,13,3,13,13,13,3,13,13,13,8,13,13,13,8,13,13,8,13,13,8,13,7,13,8,13,13,2,13,13,7,13,2,13,13,7,13,7,13,7,13,2,13,7,13,7,7,13,7,7,13,7,7,7,12,7,7,13,7,7,7,12,7,7,7,12,7,7,1,13,7,1,7,7,1,7,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,10,9,9,9,4,13,9,9,4,13,9,9,13,4,8,10,9,9,13,9,9,13,9,13,9,9,13,9,9,13,9,13,9,13,8,9,13,13,3,13,13,9,13,13,3,13,13,13,13,8,13,13,13,3,12,13,8,13,13,8,13,13,7,13,8,13,13,2,13,13,13,7,13,13,2,13,13,7,13,7,13,7,13,7,13,7,13,7,7,13,7,7,13,7,12,7,13,7,7,7,12,7,7,7,12,7,7,7,1,13,7,1,7,7,1,7,7,1,13,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,9,4,9,9,10,9,4,9,9,4,13,9,4,13,9,9,9,10,9,9,13,9,9,13,4,13,9,9,13,9,9,13,9,13,9,13,9,13,9,13,9,13,13,9,13,9,13,13,3,13,13,13,13,3,13,13,13,3,13,13,13,8,13,13,13,8,13,13,13,8,13,7,13,13,7,13,13,2,13,13,7,13,13,7,13,7,13,7,13,7,13,7,13,7,13,7,7,13,7,12,7,13,7,7,7,13,7,7,12,7,7,7,13,1,7,7,1,13,7,1,7,7,1,13,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,9,4,4,4,9,4,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,10,9,9,4,13,9,4,9,9,13,4,9,13,4,13,9,9,13,4,8,10,9,13,9,13,9,9,13,9,13,9,13,9,13,9,13,9,13,13,3,13,13,13,9,13,13,3,13,13,13,13,8,13,13,13,13,8,13,13,13,8,13,7,13,13,8,13,13,7,13,13,7,13,13,2,13,13,7,13,7,13,7,13,7,13,7,13,7,7,13,7,12,7,13,7,7,13,7,7,12,7,7,7,12,7,7,1,13,7,1,13,1,7,7,7,1,13,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,1,7,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,4,4,9,4,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,10,9,4,9,9,4,13,4,9,9,13,4,9,13,4,9,13,9,9,9,10,9,13,9,9,13,9,9,13,4,13,13,9,13,9,13,9,13,9,13,13,9,13,13,9,13,13,9,13,13,8,13,13,3,11,8,13,13,8,13,13,13,8,13,13,13,8,13,13,7,13,13,8,13,7,13,13,7,13,13,7,13,7,13,13,7,13,7,13,7,13,7,13,7,7,13,7,7,13,7,12,7,7,13,1,13,7,7,1,13,7,1,13,7,7,1,13,1,7,7,1,7,7,1,7,1,13,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,1,7,1,1,1,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,9,4,4,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,4,9,4,9,4,9,4,9,9,4,9,10,9,4,9,13,4,9,9,10,9,9,4,13,9,9,9,10,9,13,4,13,9,9,13,4,13,9,13,9,13,9,13,9,13,9,13,9,13,9,13,13,9,13,13,9,13,8,13,13,9,13,13,13,3,11,8,13,13,13,13,8,13,13,13,8,13,13,7,13,13,8,13,7,13,13,7,13,13,2,13,13,7,13,7,13,7,13,7,13,7,13,7,12,7,13,7,12,7,13,7,7,12,7,13,1,7,7,13,1,7,13,1,7,7,1,13,1,7,7,1,13,1,7,1,13,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,1,7,1,1,1,1,7,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,9,4,4,4,4,9,4,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,10,4,9,9,4,9,10,9,4,13,4,9,13,4,9,13,4,13,4,8,10,9,9,13,4,13,9,13,4,13,9,13,9,13,4,13,9,13,9,13,13,9,13,9,13,13,9,13,13,9,13,13,3,13,13,13,13,13,8,13,13,13,13,8,13,13,13,13,13,8,13,13,7,13,13,7,13,13,2,11,13,7,13,7,13,13,7,13,7,13,7,13,7,13,7,12,7,13,7,7,13,7,12,7,7,13,1,13,7,7,1,13,7,1,13,1,7,7,1,13,1,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,1,7,1,1,1,1,7,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,9,4,4,4,4,9,4,4,4,9,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,9,10,4,9,9,4,13,4,9,4,13,4,9,13,4,9,13,4,13,9,4,13,9,4,13,9,13,4,13,9,13,9,13,4,13,9,13,9,13,13,9,13,9,13,13,9,13,13,9,13,13,8,13,13,13,9,13,13,13,3,13,13,13,13,13,13,8,13,13,7,13,13,13,7,13,13,13,7,13,13,7,13,13,7,13,7,13,7,13,7,13,7,13,12,7,13,7,13,7,12,7,13,7,12,7,7,13,1,7,13,1,7,13,1,7,7,12,7,1,13,1,7,7,1,13,1,7,1,7,1,12,7,1,1,7,1,7,1,1,7,1,1,7,1,1,1,7,1,1,1,7,1,1,1,1,1,7,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,9,4,4,4,4,9,4,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,10,4,9,4,9,4,13,4,9,4,13,4,9,13,4,9,13,4,9,9,10,9,9,13,4,13,9,13,4,13,9,13,9,9,13,9,13,9,13,9,13,9,13,13,9,13,13,9,13,13,9,13,13,9,13,13,13,13,3,13,13,13,13,13,13,8,13,13,13,13,13,8,13,13,7,13,13,8,13,13,7,13,13,7,13,13,7,13,13,7,13,7,13,12,7,13,7,13,7,12,7,13,7,12,7,13,1,13,7,1,13,7,1,13,7,1,13,1,7,13,1,7,1,13,1,7,1,7,1,13,1,1,7,1,7,1,7,1,1,7,1,1,7,1,1,1,7,1,1,1,7,1,1,1,1,1,7,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,9,4,4,4,4,9,4,4,4,9,4,4,4,4,9,4,4,9,4,4,9,4,9,4,10,4,9,4,9,4,13,4,9,4,13,4,9,9,4,13,4,9,13,4,13,4,13,4,13,9,4,13,9,13,4,13,9,13,4,13,9,13,4,13,13,9,13,4,13,13,9,13,13,9,13,13,9,13,13,13,9,13,13,13,13,13,13,13,8,13,13,13,13,13,8,13,13,13,7,13,13,13,13,7,13,13,7,13,13,7,13,13,7,13,13,7,13,12,7,13,7,13,7,12,13,7,7,13,1,13,7,13,1,13,7,1,13,7,1,13,1,7,13,1,7,1,13,1,7,1,13,1,7,1,7,1,7,1,13,1,1,7,1,1,7,1,1,7,1,1,7,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,9,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,13,4,9,4,13,4,9,4,13,4,9,10,9,4,13,4,13,4,8,4,13,9,10,9,13,4,13,9,9,13,4,13,9,13,9,13,4,13,13,9,13,13,9,13,13,9,13,13,9,13,13,13,9,13,13,13,9,13,13,13,13,13,13,8,13,13,13,13,13,13,7,13,13,13,13,7,13,13,13,7,13,13,7,13,13,7,13,12,7,13,7,13,7,13,12,7,13,7,12,13,7,7,12,7,13,1,13,1,13,7,1,13,1,7,13,1,7,1,13,1,7,1,13,1,7,1,13,1,1,7,1,7,1,1,13,1,1,7,1,1,7,1,1,1,7,1,1,1,1,1,1,7,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,9,4,4,4,4,4,4,9,4,4,4,4,9,4,4,4,9,4,4,9,4,10,4,9,4,9,4,10,4,9,4,13,4,9,4,13,4,13,4,13,4,9,13,4,13,4,13,9,4,13,9,13,4,13,9,13,4,13,13,4,13,13,9,13,13,4,13,13,9,13,13,9,13,13,13,9,13,13,13,9,13,13,13,13,8,13,13,13,13,13,13,13,8,13,13,13,13,7,13,13,13,7,13,13,13,7,13,13,7,13,12,8,12,13,7,13,13,7,12,13,7,13,1,13,7,13,1,13,1,13,7,7,1,13,1,13,7,1,13,1,7,13,1,7,1,13,1,7,1,13,1,1,7,1,12,1,7,1,1,7,1,1,7,1,1,1,7,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,9,4,4,4,9,4,4,9,4,4,10,4,9,4,9,4,10,4,13,4,9,4,13,4,9,4,13,4,9,4,13,4,13,4,9,13,4,13,9,4,13,9,13,4,13,4,13,13,4,13,13,9,13,9,13,13,4,13,13,9,13,13,9,13,13,10,13,13,9,13,13,13,13,13,13,9,13,13,13,13,13,8,13,13,13,13,7,13,13,13,13,13,7,13,13,13,7,13,13,7,13,12,13,7,13,7,13,12,7,13,7,12,13,7,13,1,13,1,13,7,1,13,13,1,13,1,13,1,7,13,1,7,1,13,1,7,1,13,1,1,7,1,13,1,1,7,1,7,1,12,1,7,1,1,7,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,7,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,9,4,4,4,4,9,4,4,9,4,10,4,9,4,13,4,4,13,4,9,4,13,4,9,4,13,4,13,4,9,13,4,13,4,9,13,4,13,4,13,9,10,13,9,13,4,13,9,13,4,13,13,4,13,13,9,13,13,9,13,13,4,13,13,13,13,13,9,13,13,13,13,13,13,13,13,8,13,13,13,13,13,13,13,13,13,7,13,13,13,7,13,13,13,7,13,12,13,7,13,13,7,13,12,7,13,7,13,1,13,7,13,1,13,7,13,1,13,1,13,1,13,1,7,13,1,7,12,1,13,1,13,1,7,1,13,1,1,13,1,1,7,1,12,1,7,1,1,13,1,1,1,7,1,1,7,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,4,4,4,9,4,4,4,9,4,4,10,4,9,4,4,13,4,4,9,4,13,4,4,9,10,4,13,4,13,4,9,10,4,13,4,13,4,13,4,13,9,10,9,13,4,13,4,13,13,4,13,13,9,13,4,13,13,13,9,13,10,13,9,13,13,13,13,9,13,13,13,13,13,9,13,13,13,13,13,13,13,13,13,13,13,13,7,13,13,13,13,13,7,13,13,13,7,13,13,7,13,13,1,13,13,7,13,1,13,13,1,13,13,1,13,1,13,1,13,7,13,1,13,1,13,1,13,1,13,1,13,1,13,1,7,1,13,1,1,13,1,1,13,1,1,7,1,12,1,13,1,1,1,7,1,1,1,12,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,9,4,4,10,4,9,4,4,9,4,4,13,4,4,9,4,13,4,4,13,4,9,4,13,4,13,4,9,13,4,13,4,13,4,13,4,13,4,13,9,13,4,13,13,4,13,9,13,4,13,13,9,13,4,13,13,13,4,13,13,13,13,4,7,10,13,13,13,13,13,13,9,13,13,13,13,13,13,13,13,13,13,13,13,7,13,13,13,13,7,13,13,12,13,7,13,13,12,13,7,13,12,13,1,13,13,1,13,7,13,1,13,13,1,13,1,13,1,13,1,13,1,7,13,1,13,1,7,1,13,1,12,7,1,13,1,1,7,1,12,1,7,1,1,7,1,1,13,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,9,4,4,10,4,9,4,4,13,4,4,13,4,4,13,4,9,4,13,4,13,4,9,10,4,13,4,13,4,13,4,13,4,13,9,10,9,13,4,13,13,4,13,4,13,13,13,4,13,13,13,4,13,13,13,13,9,13,13,13,13,9,13,13,13,13,9,13,13,13,13,13,13,13,13,13,13,7,13,13,13,13,13,7,13,13,12,13,13,7,13,13,1,13,13,7,13,1,13,13,1,13,13,1,13,7,13,1,13,1,13,7,1,13,1,13,1,13,1,13,1,7,1,13,1,12,1,13,1,7,1,13,1,1,13,1,1,7,1,13,1,1,13,1,1,1,7,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,10,4,4,9,4,10,4,4,13,4,4,13,4,4,10,9,4,13,4,9,4,13,4,13,4,13,4,13,4,13,4,13,4,13,4,13,13,4,13,4,13,13,4,13,13,4,13,13,4,13,13,13,9,13,13,4,13,13,13,13,4,12,9,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,7,13,13,13,13,12,13,13,7,13,13,1,13,13,1,10,7,13,1,13,13,1,13,13,1,13,1,13,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,7,1,13,1,1,13,1,1,13,1,1,1,13,1,1,1,1,7,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,10,4,4,9,4,4,10,4,13,4,4,13,4,4,9,4,10,4,13,4,4,13,4,13,4,13,4,13,4,13,4,13,4,13,4,13,4,13,4,13,13,4,13,13,4,13,13,4,13,13,13,4,13,13,13,4,13,13,13,13,4,12,9,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,7,13,13,13,13,12,13,13,7,13,13,1,13,13,13,13,1,13,13,1,13,13,1,13,13,1,13,13,1,13,1,13,1,13,1,13,1,13,1,13,1,7,12,1,13,1,7,1,13,1,1,13,1,1,13,1,1,12,1,1,7,1,1,13,1,1,1,12,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,9,4,4,10,4,9,4,4,13,4,4,10,4,13,4,13,4,4,13,4,13,4,10,4,13,4,13,4,13,4,13,4,13,4,13,4,13,13,4,13,4,13,13,4,13,13,4,13,13,13,4,13,13,13,4,13,13,13,13,4,12,13,13,13,13,4,12,13,9,13,13,13,13,13,13,13,13,13,13,13,13,13,12,13,13,7,13,13,1,10,13,1,13,13,13,1,13,13,1,13,13,1,13,13,1,13,1,13,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,12,1,13,1,13,1,1,13,1,1,12,1,7,1,12,1,13,1,1,1,12,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,9,4,4,10,4,4,10,4,13,4,4,10,4,13,4,4,10,4,13,4,10,4,13,4,13,4,13,4,13,4,13,4,13,4,13,4,13,10,9,13,4,13,13,4,13,13,4,13,13,4,13,13,13,4,13,13,13,13,10,13,13,13,13,4,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,13,13,13,13,13,12,13,13,7,13,13,12,13,13,1,13,13,13,1,13,13,1,13,12,13,1,13,1,13,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,12,1,13,1,1,13,1,1,13,1,1,13,1,1,1,12,1,1,7,1,1,12,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,10,4,4,9,4,4,10,4,9,4,10,4,13,4,9,4,13,4,13,4,10,4,13,4,13,4,10,4,13,4,13,4,13,4,13,10,9,13,4,13,10,13,4,13,13,4,13,13,10,13,13,4,13,13,10,13,13,4,13,13,13,13,13,13,13,13,13,10,13,13,13,13,13,13,13,13,13,13,12,13,13,13,13,13,12,13,13,7,13,13,12,13,13,1,13,13,13,1,13,13,1,13,13,1,13,13,1,13,12,13,1,13,1,13,12,1,13,1,13,1,13,1,12,1,13,1,13,1,1,13,1,12,1,7,1,12,1,1,13,1,1,7,1,1,12,1,1,1,13,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,4,10,4,4,9,4,4,10,4,4,13,4,4,13,4,4,13,4,10,4,13,4,10,4,13,4,13,4,10,9,13,4,13,4,13,4,13,10,9,10,13,4,13,13,4,13,13,4,13,13,10,13,4,13,13,13,10,13,13,4,7,13,10,13,13,13,13,10,13,13,13,13,13,13,13,13,13,13,13,13,11,13,13,13,13,13,12,13,13,7,13,13,12,13,13,1,10,7,13,12,13,1,13,13,12,13,12,13,1,13,12,13,1,13,1,13,1,13,12,1,13,1,13,1,13,1,13,1,13,1,12,1,13,1,1,13,1,12,1,13,1,1,12,1,1,13,1,1,1,12,1,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,4,10,4,4,4,10,4,4,10,4,9,4,10,4,4,13,4,4,13,4,10,4,13,4,10,4,13,4,13,4,10,4,13,4,13,4,13,10,4,13,10,9,13,4,13,10,13,4,13,13,10,13,4,13,13,13,4,13,13,10,13,13,13,10,13,13,13,10,13,13,13,13,13,10,13,13,13,13,13,13,11,13,13,13,13,13,12,13,13,13,13,13,12,13,13,12,13,13,13,1,13,13,13,12,13,1,13,13,1,13,13,1,13,12,13,1,13,12,13,1,13,1,13,1,13,1,13,1,13,1,12,1,13,1,12,1,13,1,1,13,1,1,12,1,7,1,12,1,1,12,1,1,13,1,1,1,1,12,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,10,4,4,4,10,4,9,4,10,4,10,4,13,4,4,10,4,13,4,4,13,4,10,4,13,4,13,4,13,4,13,4,13,4,13,10,4,13,10,13,4,13,10,13,4,13,13,4,13,13,10,13,4,12,9,11,13,9,13,10,13,13,13,10,13,13,13,13,10,13,13,13,13,13,13,13,11,13,13,13,13,13,13,13,13,13,12,13,13,13,12,13,13,13,12,13,13,12,13,7,13,12,13,12,13,1,13,13,12,13,1,13,12,13,1,13,1,13,12,1,13,1,13,12,1,13,1,12,13,1,12,1,13,1,12,1,7,1,12,1,13,1,1,12,1,13,1,1,12,1,1,1,12,1,1,1,1,12,1,1,1,1,1,1,12,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,10,4,4,10,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,13,4,4,10,4,13,4,10,4,13,4,10,9,4,13,4,10,4,13,4,13,10,10,4,13,10,13,4,13,10,13,4,13,13,4,13,13,10,13,4,13,13,10,13,13,4,13,13,13,10,13,13,13,10,13,13,13,13,10,13,13,13,13,13,11,13,13,13,13,13,13,13,12,13,13,13,13,12,13,13,13,12,13,13,7,13,12,13,13,12,13,1,13,13,12,13,1,13,12,13,1,13,1,13,12,13,1,13,1,13,12,1,13,12,1,13,1,12,7,1,13,1,12,1,13,1,12,1,13,1,1,12,1,13,1,1,12,1,1,12,1,1,12,1,1,12,1,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,10,4,4,4,4,4,4,10,4,4,4,4,10,4,4,10,4,4,10,4,9,4,10,4,10,4,13,4,4,13,4,10,4,13,4,10,10,4,13,4,13,10,4,13,4,13,10,4,13,10,13,4,13,4,13,10,13,10,13,4,13,13,10,13,10,13,13,10,13,10,13,13,10,13,13,13,10,13,13,13,13,13,10,13,13,13,13,13,13,13,11,13,13,13,13,13,6,13,13,13,13,12,13,13,12,13,13,12,13,12,13,7,13,12,13,13,1,13,13,12,13,1,13,13,12,13,1,13,1,13,12,12,13,1,13,1,13,1,13,1,13,1,12,12,7,1,13,1,12,1,13,1,1,13,1,1,12,1,1,12,1,7,1,1,12,1,1,1,12,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,10,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,9,4,10,4,10,4,13,4,4,10,4,13,4,10,4,13,4,10,13,4,13,4,10,13,4,13,10,4,13,10,13,4,13,4,13,10,13,10,13,4,13,10,13,10,13,10,13,4,13,13,13,10,13,13,10,13,13,13,10,13,13,10,13,13,13,11,13,13,13,11,13,13,13,13,13,11,13,13,13,13,12,13,13,13,12,13,13,12,13,13,12,13,13,12,13,12,13,12,13,12,13,1,13,12,13,1,13,12,12,13,1,13,12,1,13,1,13,1,13,12,1,12,13,1,12,1,13,1,12,1,13,1,12,1,12,1,12,1,7,12,1,1,12,1,12,1,1,12,1,1,1,12,1,1,1,12,1,1,1,1,1,1,1,12,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,10,4,4,4,4,10,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,10,4,10,4,10,4,10,4,13,4,10,4,10,9,10,4,13,4,10,4,13,10,4,13,4,10,13,4,13,10,10,9,11,4,13,10,13,4,13,10,13,10,13,4,13,13,13,10,13,10,13,13,10,13,13,10,13,13,13,10,13,13,13,11,13,13,13,10,13,13,13,13,11,13,13,13,12,13,13,13,6,8,11,13,13,12,13,13,12,13,13,12,13,12,13,7,13,12,13,1,13,13,12,13,12,12,13,1,13,12,13,1,13,1,13,12,12,1,13,12,1,13,1,12,13,1,12,1,13,1,12,1,13,1,12,1,7,1,12,1,12,1,1,12,1,1,12,1,1,12,1,1,1,12,1,1,1,1,1,12,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,10,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,4,10,4,10,4,4,10,4,9,10,4,10,4,13,4,10,4,13,4,10,10,9,10,4,13,10,10,4,13,10,10,9,10,13,4,13,10,13,4,13,10,13,10,13,4,13,13,10,13,10,13,13,10,13,13,10,13,13,10,13,13,10,13,13,11,13,13,10,13,13,13,11,13,13,13,13,13,11,13,13,13,6,8,11,13,13,12,13,13,12,13,13,12,13,13,12,13,12,13,12,13,12,13,12,13,1,13,12,13,1,13,12,12,13,1,13,12,12,1,13,12,1,13,1,11,1,12,7,12,1,13,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,1,12,1,1,12,1,1,1,1,12,1,1,1,1,1,12,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,10,4,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,4,10,4,10,4,4,10,4,10,4,10,4,10,9,4,10,10,4,13,4,10,10,4,13,10,4,13,4,13,10,10,9,10,13,4,13,10,13,4,13,10,13,10,13,4,13,11,9,11,9,11,9,11,13,10,13,10,13,13,10,13,13,10,13,11,13,13,10,13,13,13,11,13,13,13,13,11,13,13,13,12,13,13,11,13,13,12,13,13,13,12,13,13,12,13,12,13,13,12,13,12,13,12,13,12,13,12,13,12,7,11,1,13,12,13,1,13,12,1,13,12,12,13,1,13,1,12,13,1,12,12,1,13,1,12,12,1,13,1,12,1,13,1,1,12,1,12,1,12,1,12,1,1,12,1,1,1,12,1,1,1,12,1,1,1,1,12,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,10,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,4,10,4,10,4,10,4,10,4,10,4,13,4,10,4,10,13,4,10,4,13,10,4,13,4,10,10,10,13,4,10,13,4,13,10,10,13,4,11,9,10,13,10,13,10,13,10,13,10,13,10,13,10,13,10,13,13,10,13,13,10,13,11,13,13,10,13,13,13,11,13,13,13,11,13,13,13,13,11,13,13,11,13,13,12,13,13,13,6,13,13,12,13,13,12,13,12,13,12,13,12,13,12,13,12,13,1,13,12,13,12,13,1,13,12,12,13,1,13,12,12,1,13,1,11,1,13,1,12,12,7,12,1,12,12,1,13,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,1,12,1,1,12,1,1,1,12,1,1,12,1,1,1,1,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,9,10,4,10,10,4,13,10,10,4,13,10,4,13,10,10,10,13,4,13,10,10,13,10,13,4,13,10,13,10,13,10,13,10,13,10,13,13,10,13,10,13,13,10,13,13,10,13,13,11,13,13,10,13,13,11,13,13,13,11,13,13,13,13,11,13,13,12,13,6,8,11,13,13,12,13,13,6,13,13,12,13,13,12,13,12,13,12,13,12,13,12,7,12,13,12,12,13,1,13,12,12,12,13,1,13,12,12,1,13,12,1,12,12,7,12,1,13,1,12,1,12,1,13,1,12,1,12,1,12,1,12,1,1,12,1,1,12,1,1,12,1,1,12,1,1,1,1,12,1,1,1,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,4,10,4,10,4,4,10,4,10,4,10,4,10,4,10,10,4,10,9,10,4,10,10,4,13,10,4,13,4,11,4,13,10,10,10,9,10,10,13,4,13,10,10,13,4,11,13,10,10,13,10,13,10,13,10,13,10,13,10,13,13,10,13,11,13,10,13,13,11,13,10,13,13,11,13,13,13,11,13,13,13,11,13,13,13,12,13,11,13,13,6,8,11,13,13,12,13,13,12,13,13,12,13,12,13,12,13,12,13,12,7,12,13,12,12,13,12,12,13,1,11,7,12,12,13,1,12,12,13,1,12,12,12,7,12,1,13,1,12,12,1,13,1,12,12,1,12,1,12,1,12,1,12,1,1,12,1,12,1,12,1,1,12,1,1,1,12,1,1,12,1,1,12,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,10,4,4,10,4,4,10,4,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,9,10,4,10,10,4,13,4,10,10,10,10,4,13,10,10,4,13,10,10,13,4,13,10,10,13,10,10,13,10,13,4,13,10,13,10,13,10,13,10,13,10,13,10,13,10,13,10,13,13,11,13,10,13,13,11,13,10,13,11,13,13,13,11,13,13,11,13,13,11,13,13,6,8,11,13,12,13,13,6,13,13,12,13,12,13,12,13,12,13,12,13,12,13,12,13,12,13,12,12,13,1,13,12,12,13,1,12,13,12,1,13,12,12,1,13,1,12,12,12,1,13,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,1,12,1,1,12,1,1,12,1,1,1,12,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,10,4,4,4,10,4,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,10,4,10,10,4,13,10,4,10,10,13,4,10,10,13,4,10,13,4,11,10,9,10,10,13,10,10,13,4,11,13,10,10,13,10,13,10,13,10,13,10,13,10,13,11,13,10,13,11,13,10,13,11,13,10,13,13,11,13,13,11,13,13,13,11,13,13,13,11,13,13,12,13,11,13,12,13,13,6,13,13,12,13,6,13,13,12,13,12,13,12,13,12,12,13,12,12,13,12,12,13,12,12,12,13,1,11,1,13,12,12,1,13,12,12,12,1,13,12,1,12,12,1,12,12,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,1,12,1,1,12,1,1,12,1,1,12,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,10,4,4,10,4,4,10,4,10,4,10,4,4,10,4,10,4,4,10,4,10,4,10,4,10,4,10,10,4,10,10,4,10,10,4,10,10,10,9,10,10,4,13,10,10,10,10,13,4,10,13,10,10,10,13,10,10,13,10,10,13,10,13,10,13,10,10,13,10,13,10,13,11,13,10,13,10,13,11,13,10,13,13,11,13,10,13,13,11,13,13,13,11,13,13,11,13,13,12,13,11,13,13,6,13,13,6,8,11,13,12,13,13,12,13,12,13,6,13,12,13,12,13,12,12,13,12,12,13,12,12,7,12,13,12,12,12,12,7,12,12,12,12,12,1,13,12,1,12,12,12,1,13,1,12,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,12,1,1,12,1,1,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,10,4,4,10,4,4,10,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,9,10,10,4,13,10,10,4,13,10,10,10,4,13,10,10,10,13,10,10,13,4,11,9,10,13,10,10,13,10,13,10,13,10,13,11,10,13,10,13,10,13,11,13,10,13,11,13,10,13,13,5,13,13,13,11,13,13,11,13,13,11,13,13,11,13,12,13,13,6,13,13,13,6,13,13,12,13,6,13,13,12,13,12,13,12,13,12,13,12,12,13,12,12,13,12,12,13,12,12,12,13,1,13,12,12,12,12,7,12,12,1,11,1,13,1,12,12,12,1,12,12,1,12,12,1,12,1,12,12,1,12,1,12,1,12,1,1,12,1,12,1,1,12,1,12,1,1,12,1,1,12,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,4,10,4,4,10,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,10,4,10,10,4,10,10,4,10,10,4,13,10,10,4,10,10,10,10,10,13,4,11,10,9,10,10,13,10,10,10,13,10,10,13,10,13,10,10,13,10,13,10,11,13,10,13,10,13,11,13,10,13,5,13,13,10,13,5,7,10,13,11,13,13,5,7,11,13,13,11,13,13,11,13,12,13,11,13,13,6,13,13,12,13,6,13,13,12,13,6,13,12,13,12,13,6,7,13,12,12,13,12,12,13,12,12,13,12,12,12,12,12,13,1,12,12,13,1,11,1,13,12,12,1,12,12,12,1,12,12,1,12,12,1,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,1,12,1,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,4,10,10,10,13,4,10,10,13,4,10,10,13,10,10,10,13,10,10,13,10,10,13,10,10,13,10,11,10,13,10,13,10,13,10,11,13,10,13,5,13,13,10,13,11,13,5,7,5,13,13,11,13,13,13,11,13,13,11,13,13,11,13,11,13,12,13,11,13,12,13,6,13,13,12,13,6,13,13,12,13,12,13,12,13,6,13,12,12,13,12,12,13,12,12,12,13,12,12,7,12,12,12,13,1,11,1,12,12,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,12,1,1,12,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,4,10,10,10,10,4,10,10,10,13,4,10,10,10,10,10,13,10,10,10,10,13,10,10,10,13,10,10,10,13,10,10,13,10,13,10,13,10,11,10,13,10,13,11,10,13,13,5,13,13,5,13,13,5,7,10,13,13,11,13,11,13,13,11,13,11,13,13,11,13,12,13,11,13,6,13,13,6,13,13,6,13,13,12,13,6,13,12,13,6,13,12,13,12,12,13,12,12,13,12,12,13,12,12,12,12,13,12,12,12,12,12,12,12,7,12,12,12,12,1,12,12,12,1,13,12,1,12,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,10,4,10,10,10,10,13,10,10,10,10,10,13,10,10,10,13,10,10,10,13,10,10,13,10,11,10,13,10,11,10,13,10,13,5,13,13,10,11,13,10,13,5,13,13,13,5,13,13,11,13,11,13,13,5,13,13,11,13,12,13,11,13,11,13,12,13,11,13,12,13,6,13,13,12,13,6,13,13,12,13,12,12,13,6,13,12,13,12,12,13,12,12,12,13,12,12,12,12,12,13,12,12,12,7,12,12,12,12,12,1,13,12,12,1,12,12,12,1,12,12,12,1,12,12,1,12,1,12,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,13,10,10,10,13,10,10,13,10,11,10,13,10,10,13,10,13,10,11,13,10,13,5,13,10,13,5,13,13,5,13,13,11,13,11,13,13,5,13,13,11,13,13,11,13,11,13,12,13,11,13,11,13,6,13,13,6,13,13,6,13,13,6,13,12,13,6,13,12,13,12,13,12,12,13,6,7,11,12,12,13,12,12,12,13,12,12,12,12,12,12,12,12,12,1,13,12,12,1,12,12,12,12,1,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,4,10,10,10,10,10,10,10,10,9,10,10,10,10,10,13,10,10,10,10,13,10,10,10,10,13,10,10,10,13,10,10,13,10,11,10,13,10,11,13,5,13,10,13,5,13,13,5,13,13,5,13,13,5,13,13,11,13,11,13,13,11,13,11,13,12,10,12,13,11,13,12,13,11,13,6,13,13,6,13,12,13,6,13,12,13,6,13,12,13,6,13,12,12,13,6,7,11,12,12,13,12,12,12,12,12,12,13,12,12,12,12,7,12,12,12,12,12,12,12,12,1,12,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,12,1,12,1,12,1,12,1,12,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,13,10,10,10,10,13,10,10,11,10,13,10,10,11,10,13,10,11,10,13,5,13,10,13,5,13,13,5,13,13,5,13,13,5,13,13,11,13,11,13,13,5,13,13,11,13,11,13,12,10,12,13,11,13,11,13,6,13,13,6,13,12,13,6,13,13,6,13,12,13,6,13,12,13,12,12,13,6,13,12,12,13,12,12,12,12,13,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,12,1,12,1,12,1,12,1,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,13,10,10,10,10,10,10,13,10,10,10,10,13,10,11,10,10,13,10,11,10,13,5,13,10,13,5,13,13,5,13,10,13,5,13,13,11,13,5,13,13,11,13,11,13,11,13,11,13,11,13,11,13,11,13,12,11,13,12,13,6,13,13,6,13,13,6,13,12,13,6,13,12,13,6,13,12,12,13,6,7,11,12,12,12,13,12,12,12,12,12,13,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,1,12,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,13,10,10,10,11,10,13,10,10,11,10,13,10,11,10,13,5,13,10,13,5,13,10,13,5,13,5,13,13,5,13,11,13,11,13,5,13,13,11,13,11,13,11,13,13,11,13,12,13,11,13,11,12,13,11,13,6,13,13,6,13,6,13,12,13,6,13,12,13,6,13,12,13,6,13,12,12,13,6,7,6,13,12,12,12,13,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,13,10,10,10,10,10,13,10,10,11,10,10,10,13,5,13,10,10,13,5,13,10,13,5,13,5,13,13,5,13,11,13,5,13,13,5,13,13,11,13,11,13,5,13,12,10,12,11,13,11,13,11,13,11,12,13,6,13,11,13,6,13,13,6,13,6,13,12,13,6,13,6,13,12,12,13,6,13,12,12,12,13,6,7,11,12,12,12,12,12,12,13,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,1,12,12,12,1,12,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,10,4,10,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,10,10,10,11,10,10,13,5,13,10,10,11,10,13,5,13,5,13,10,5,13,13,5,13,5,13,5,13,13,5,13,13,11,13,5,13,11,13,11,13,11,13,11,13,11,13,11,12,13,11,13,11,13,6,13,13,6,13,6,13,12,13,6,13,6,13,12,13,6,13,6,13,12,12,12,13,6,13,12,12,12,12,12,12,13,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,12,1,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,4,10,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,10,10,10,13,10,10,11,10,10,10,13,5,13,10,5,13,10,13,5,13,10,11,13,5,13,5,13,13,5,13,13,5,13,11,13,11,13,11,13,11,13,11,13,11,13,11,13,11,13,11,13,12,11,13,6,13,11,13,6,13,6,13,6,13,6,13,12,13,6,13,6,13,12,12,13,6,12,13,6,12,12,13,6,12,13,6,7,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,1,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,10,10,10,10,11,10,13,5,13,10,5,13,10,13,5,13,5,13,5,13,5,13,13,5,13,5,13,11,13,5,13,11,13,5,13,11,13,11,13,11,13,11,13,11,13,11,12,13,11,13,11,12,11,13,6,13,6,13,13,6,13,12,11,13,6,13,6,13,12,12,13,6,13,6,13,12,12,12,12,13,6,12,12,12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,12,12,1,12,12,12,12,12,1,12,12,12,1,12,12,12,1,12,12,1,12,1,12,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,4,10,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,11,10,10,10,13,5,10,13,5,13,10,10,11,10,13,5,13,5,13,5,13,10,13,5,13,5,13,5,13,13,5,13,11,13,5,13,11,13,11,13,11,13,5,13,11,13,11,12,13,11,11,13,11,12,13,11,13,6,13,11,12,13,6,13,6,13,6,13,12,6,13,6,13,12,6,13,12,12,6,13,12,6,13,12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,1,6,1,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,4,10,10,4,10,10,10,4,10,10,10,4,5,4,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,10,10,10,10,10,10,11,10,10,10,5,13,10,10,5,13,10,5,13,5,13,10,10,5,13,5,13,5,13,5,13,11,10,13,5,13,11,13,5,13,11,13,11,13,5,13,12,11,13,11,13,11,13,11,11,13,12,11,13,6,13,11,12,11,13,6,13,6,13,6,13,6,13,6,13,12,6,13,12,6,13,12,12,6,13,12,12,6,13,12,12,12,6,7,6,12,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,4,10,10,10,4,10,10,10,4,10,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,10,11,10,10,10,5,13,10,10,5,13,10,5,13,10,5,13,5,13,10,5,13,5,13,5,13,5,13,11,13,5,13,11,13,5,13,11,13,11,13,11,13,11,13,11,11,13,11,11,13,11,12,11,13,11,13,6,13,11,12,11,13,6,13,6,13,6,13,6,13,12,6,13,12,6,13,12,6,13,12,6,13,12,12,6,13,12,6,7,6,13,12,12,12,12,6,7,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,12,1,6,1,12,12,12,1,12,12,12,1,12,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,10,10,10,10,10,5,10,10,10,11,10,10,5,13,10,5,13,10,5,13,10,5,13,5,13,5,13,10,11,13,5,13,5,13,5,13,5,13,11,13,5,13,11,13,5,13,11,13,11,11,13,11,13,11,11,13,11,13,11,12,11,13,6,13,11,12,11,13,6,13,6,13,6,13,6,13,6,13,6,13,12,6,13,6,13,12,6,13,12,12,6,13,12,12,12,6,12,12,12,12,12,6,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,1,6,1,12,12,12,1,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,4,10,10,10,4,10,10,10,10,10,10,4,10,10,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,5,4,10,10,5,10,10,10,5,10,10,10,11,10,10,5,13,10,5,13,10,5,13,5,13,10,5,13,5,13,5,13,5,13,5,13,5,13,5,13,11,13,5,13,11,13,5,13,11,13,11,11,13,11,11,13,11,13,11,11,13,11,12,11,13,11,13,6,13,11,6,13,6,13,6,13,6,13,6,13,6,13,12,6,13,6,13,12,6,13,12,6,13,6,7,6,12,12,11,12,12,12,6,13,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,1,6,1,12,12,12,1,12,12,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,10,4,5,4,5,10,10,10,10,10,10,10,10,10,10,5,10,10,10,10,5,10,10,10,10,10,10,5,10,10,10,5,13,10,5,13,10,5,13,10,5,10,13,5,10,13,5,13,5,13,5,13,5,13,5,13,5,13,5,13,11,13,5,13,11,13,5,13,11,11,13,11,13,11,11,13,11,11,13,11,12,11,13,11,11,12,11,13,6,13,6,13,6,13,6,13,6,13,6,13,6,13,6,13,6,13,6,12,13,6,12,12,13,6,12,12,12,6,13,12,6,12,12,12,6,12,12,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,1,12,12,12,12,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,4,10,10,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,4,10,10,5,10,10,10,10,10,5,10,10,10,5,10,10,11,10,10,10,5,10,13,5,10,10,11,10,5,13,5,13,5,13,5,13,5,13,5,13,5,13,5,13,11,5,13,11,13,5,13,11,11,13,11,11,13,5,12,10,11,13,11,12,11,13,11,11,13,6,13,11,12,11,13,6,13,11,6,13,6,13,6,13,6,13,6,13,6,13,6,12,13,6,12,12,11,12,6,13,6,12,12,12,6,12,12,12,12,12,6,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,12,12,12,1,12,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,10,10,10,5,10,10,10,10,5,10,10,10,10,5,10,10,11,10,5,13,5,10,10,5,13,5,13,5,13,5,10,5,13,5,13,5,13,5,13,5,13,11,5,13,11,13,5,13,11,11,13,5,13,11,11,13,11,11,13,11,11,13,11,12,11,13,11,11,12,11,11,13,6,13,6,13,6,13,6,13,6,13,6,12,11,6,13,6,12,13,6,12,12,6,13,6,12,12,12,6,13,12,6,12,12,6,12,12,12,12,6,12,12,12,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,4,5,4,10,10,10,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,5,4,5,10,10,10,5,10,10,10,10,5,10,10,10,5,10,10,11,10,5,10,10,5,13,5,10,13,5,13,5,10,5,13,5,13,5,13,5,13,5,11,10,11,5,13,11,5,13,11,13,5,13,11,11,13,5,12,10,11,13,11,11,13,11,11,12,11,13,11,11,12,11,13,6,13,6,13,6,13,11,6,13,6,13,6,13,6,13,6,12,13,6,12,6,13,6,13,6,12,12,11,12,12,6,13,12,6,12,12,12,12,6,12,12,12,12,6,12,12,12,6,1,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,10,10,10,10,5,10,10,10,10,5,10,10,10,5,10,10,5,10,10,5,13,5,10,10,10,5,13,5,10,5,13,5,13,5,10,11,5,13,5,13,5,13,5,13,5,13,11,5,13,11,11,10,11,13,5,12,10,11,13,11,11,13,11,11,12,11,13,11,11,11,13,11,6,13,11,11,6,13,11,6,13,6,13,6,13,6,13,6,12,6,13,6,13,6,12,11,12,6,13,6,12,12,6,13,6,12,12,6,12,12,6,13,12,6,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,12,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,4,5,10,10,10,10,5,10,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,10,10,5,13,5,10,5,13,5,13,5,10,5,13,5,13,5,10,5,13,5,11,10,5,13,11,5,13,11,5,13,11,13,5,13,11,11,13,11,11,11,13,11,11,13,11,11,11,13,11,12,11,11,13,6,13,11,6,13,11,6,13,6,13,6,13,6,12,6,13,6,13,6,12,6,13,6,13,6,12,6,13,6,12,12,6,13,12,6,12,12,6,12,12,12,6,12,12,12,6,12,12,12,6,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,4,5,10,10,10,10,10,5,10,10,10,5,10,10,10,5,10,10,5,10,10,10,5,11,10,5,10,10,11,5,13,5,10,5,13,5,13,5,10,5,13,5,13,5,13,5,13,5,13,5,13,11,5,13,11,11,5,13,11,11,13,5,12,11,13,11,11,11,13,11,11,12,11,11,13,11,11,12,11,11,12,11,13,6,13,6,13,6,11,6,13,6,13,6,12,6,13,6,13,6,12,6,13,6,12,12,6,13,6,12,12,6,12,12,6,12,12,12,6,12,12,12,6,12,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,10,10,4,5,4,10,10,10,10,10,10,10,10,5,10,10,10,10,10,10,5,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,10,5,10,10,5,10,11,10,5,13,5,10,5,13,5,10,5,13,5,11,5,13,5,13,5,13,5,11,10,11,11,5,13,11,5,13,11,13,5,13,11,11,11,13,5,12,11,10,11,12,11,11,13,11,11,11,12,11,11,13,6,13,6,13,6,13,6,11,12,11,6,13,6,13,6,13,6,12,6,13,6,12,6,13,6,12,6,12,12,6,12,12,6,13,6,12,12,6,12,12,6,12,12,12,6,12,12,6,1,6,12,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,10,10,10,10,5,10,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,10,5,10,10,5,10,11,10,5,10,5,13,5,10,5,13,5,10,5,13,5,13,5,11,5,13,5,11,10,11,5,13,5,13,11,13,5,13,11,11,11,13,5,13,11,11,11,13,11,11,11,13,11,11,11,12,11,11,13,6,11,13,6,13,6,11,11,12,6,13,6,13,6,13,6,6,13,6,6,13,6,12,6,13,6,12,6,13,6,12,6,13,6,12,6,12,12,6,12,12,6,12,12,6,12,12,6,12,12,12,12,6,12,12,12,12,12,12,12,12,12,6,1,6,12,12,12,12,12,12,12,12,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,10,10,10,10,10,10,10,5,4,5,4,5,10,10,10,10,5,10,10,10,5,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,5,10,10,5,10,5,13,5,10,5,13,5,10,5,13,5,11,5,13,5,13,5,11,5,13,5,13,5,13,5,13,5,13,11,5,13,11,5,12,11,11,13,5,12,11,11,13,11,11,11,11,13,11,11,12,11,11,11,13,6,11,13,6,11,13,6,13,6,11,6,13,6,6,13,6,12,6,13,6,6,13,6,12,6,12,6,13,6,12,6,12,12,6,12,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,12,6,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,10,10,10,10,10,10,10,5,4,5,10,10,10,10,5,10,10,10,5,4,5,10,10,5,10,10,5,10,10,5,10,10,5,10,5,10,10,5,10,5,13,5,10,5,10,5,13,5,5,13,5,5,13,5,5,13,5,5,13,5,13,5,11,5,13,5,12,5,13,11,5,13,11,11,11,10,11,11,11,13,11,11,11,11,13,11,11,11,12,11,11,11,13,6,11,13,6,11,12,11,6,13,6,11,12,6,13,6,6,13,6,13,6,6,13,6,12,6,13,6,12,6,12,6,13,6,12,6,12,6,12,12,6,12,6,12,12,6,12,12,6,12,12,6,12,12,12,12,6,1,6,12,12,12,12,6,12,12,12,12,12,12,12,12,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,10,10,10,5,4,5,10,10,10,10,10,5,10,10,10,10,5,10,10,5,10,10,5,10,10,5,10,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,11,10,5,10,5,11,5,13,5,10,5,11,5,13,5,11,5,13,5,13,5,11,11,10,11,5,13,11,11,11,10,11,11,13,11,11,11,11,13,11,11,11,11,11,13,11,11,12,11,11,6,13,11,6,13,6,13,6,11,12,11,6,13,6,13,6,6,13,6,6,13,6,6,13,6,12,6,12,6,13,6,12,6,12,6,12,12,6,12,6,12,12,6,12,12,6,12,12,6,12,12,12,6,12,12,6,1,6,12,12,12,12,12,12,12,12,12,6,1,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,10,10,5,4,5,10,10,10,5,4,5,10,10,5,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,5,10,5,10,10,5,10,5,10,11,5,10,5,10,5,13,5,10,5,13,5,5,13,5,5,13,5,13,5,11,5,13,5,13,5,11,13,5,11,11,13,5,11,13,11,11,11,11,13,5,11,11,13,11,11,11,12,11,11,11,11,13,6,11,13,6,11,11,6,13,6,11,13,6,11,6,13,6,6,13,6,6,13,6,6,12,6,13,6,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,6,12,12,12,6,12,12,12,6,12,12,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,10,10,5,4,5,10,10,10,5,4,5,10,10,10,5,10,10,5,10,10,5,10,10,5,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,13,5,5,10,5,13,5,5,13,5,5,13,5,11,5,13,5,11,5,13,5,11,11,5,13,11,11,5,13,11,11,11,5,13,11,11,11,11,13,11,11,11,11,11,11,12,11,11,11,12,11,6,13,11,6,13,6,11,11,6,13,6,11,6,13,6,6,13,6,6,12,6,13,6,6,12,6,13,6,6,12,6,13,6,12,6,12,6,12,6,12,12,6,12,6,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,12,12,6,1,6,12,12,12,12,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,10,5,10,10,10,10,10,5,10,10,5,10,10,5,10,10,10,5,10,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,11,5,10,5,10,5,11,5,13,5,5,13,5,5,13,5,5,13,5,11,5,13,5,11,13,5,11,11,10,11,11,5,13,11,11,11,11,11,13,11,11,11,11,11,11,12,11,11,11,13,6,11,11,11,6,13,6,11,11,12,11,6,13,6,13,6,6,13,6,6,13,6,6,11,6,12,6,13,6,6,12,6,13,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,6,12,12,12,12,12,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,10,5,4,5,10,10,5,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,11,5,13,5,5,13,5,5,11,5,10,11,5,11,5,13,5,11,10,11,5,13,5,11,11,11,13,5,11,11,11,13,5,11,11,11,11,11,11,13,11,11,11,11,11,11,12,11,11,11,6,13,11,6,13,6,11,6,13,6,11,6,12,6,13,6,6,13,6,6,13,6,6,12,6,11,12,6,12,6,6,12,6,12,6,12,6,12,6,12,12,6,12,6,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,6,12,12,12,6,1,6,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,5,10,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,11,5,10,5,13,5,5,10,5,11,5,10,5,13,5,11,5,13,5,11,5,13,5,11,11,5,13,11,5,11,11,13,5,11,11,11,11,11,13,11,11,11,11,11,11,11,12,11,11,11,11,6,13,11,6,13,6,11,11,6,13,6,11,6,13,6,11,6,13,6,6,11,6,12,6,6,13,6,6,12,6,6,13,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,6,1,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,5,10,10,10,5,10,10,5,10,10,5,10,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,10,5,11,5,10,5,5,13,5,5,13,5,5,11,5,13,5,11,5,13,5,11,5,13,5,11,11,11,5,13,11,11,11,11,11,11,13,5,11,11,11,11,11,11,12,11,11,11,11,12,11,11,6,13,11,6,11,11,12,6,13,6,11,6,13,6,6,11,6,12,6,13,6,6,13,6,6,12,6,11,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,5,10,10,5,10,10,5,10,10,5,10,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,10,5,5,10,5,5,13,5,5,5,13,5,5,11,5,13,5,5,13,5,5,13,5,11,5,13,11,5,11,13,5,11,11,11,5,13,11,5,12,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,6,11,11,12,11,6,11,11,6,13,6,11,6,12,11,6,13,6,6,11,6,12,6,6,13,6,6,12,6,6,13,6,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,12,6,12,12,6,12,12,12,6,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,5,10,10,10,5,10,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,10,5,5,10,5,5,11,5,10,5,5,13,5,5,11,5,10,5,11,5,11,5,13,5,11,5,13,5,11,11,5,11,11,11,5,13,11,11,5,12,5,11,11,11,11,11,11,13,11,11,11,11,12,11,11,11,6,13,11,6,11,11,6,13,6,11,6,13,6,11,6,11,6,6,13,6,6,12,6,11,6,6,12,6,6,13,6,6,12,6,6,12,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,6,12,12,6,12,12,6,12,12,12,6,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,5,10,10,5,10,10,5,10,5,10,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,10,5,5,10,5,5,10,5,5,11,5,5,10,5,11,5,13,5,5,13,5,5,11,5,13,5,11,5,11,11,10,11,5,13,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,13,11,6,11,11,11,6,13,6,11,11,6,11,6,13,6,6,13,6,6,11,6,12,6,6,13,6,6,13,6,6,12,6,6,12,6,12,6,6,12,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,12,6,12,12,6,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,5,10,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,10,5,5,10,5,5,10,5,5,11,5,10,5,5,11,5,5,13,5,5,11,5,11,5,13,5,5,11,11,5,13,5,11,11,5,11,11,11,11,5,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,6,11,11,11,6,13,6,11,6,13,6,11,6,11,6,12,6,11,6,6,13,6,6,6,13,6,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,6,12,12,6,12,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,5,10,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,10,5,5,11,5,10,5,5,11,5,10,5,11,5,5,13,5,11,5,13,5,11,5,11,11,5,13,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,13,6,11,11,6,11,6,11,6,13,6,11,6,11,6,13,6,6,6,13,6,6,6,6,12,6,6,13,6,6,12,6,6,12,6,6,12,6,12,6,6,12,6,6,12,6,12,6,12,6,12,6,12,12,6,12,6,12,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,10,5,5,13,5,5,11,5,5,13,5,5,11,5,13,5,11,5,11,11,5,13,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,6,11,11,11,6,11,11,6,11,12,11,6,11,6,11,6,12,6,11,6,6,11,6,6,12,6,6,11,6,6,12,6,6,6,12,6,6,12,6,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,11,5,5,10,5,5,11,5,5,13,5,5,11,5,13,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,5,11,11,11,11,11,11,11,12,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,13,6,6,11,6,11,6,12,6,11,6,6,13,6,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,10,5,5,5,10,5,5,11,5,5,13,5,5,11,5,11,5,11,5,11,5,11,5,13,5,11,11,5,11,11,11,5,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,11,6,11,11,6,13,6,11,6,11,6,11,6,12,6,11,6,6,13,6,6,6,6,12,6,6,11,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,5,10,5,5,11,5,5,11,5,5,11,5,5,13,5,5,11,5,11,5,13,5,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,13,6,6,11,6,6,11,6,6,11,6,6,6,13,6,6,6,6,12,6,6,6,12,6,6,6,12,6,6,6,12,6,6,12,6,12,6,6,12,6,12,6,12,6,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,10,5,10,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,5,10,5,5,5,5,5,11,5,5,5,13,5,5,11,5,5,11,5,11,5,13,5,11,5,11,5,11,11,5,11,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,11,6,11,11,6,11,11,6,11,6,11,6,13,6,6,11,6,11,6,6,11,6,6,12,6,6,6,6,6,12,6,6,6,6,12,6,6,6,12,6,6,6,12,6,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,10,5,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,10,5,5,5,5,10,5,5,5,5,5,5,10,5,5,5,5,11,5,5,11,5,5,11,5,11,5,10,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,13,6,6,6,11,6,6,6,6,13,6,6,6,6,12,6,6,6,12,6,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,10,5,10,5,5,10,5,10,5,5,10,5,5,10,5,5,5,5,10,5,5,5,5,10,5,5,5,5,5,5,11,5,5,5,10,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,6,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,12,6,6,11,6,6,6,11,6,6,6,6,6,6,12,6,6,6,6,12,6,6,6,12,6,6,6,6,12,6,6,12,6,6,12,6,12,6,6,12,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,10,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,5,10,5,5,5,5,5,5,10,5,5,5,5,11,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,6,11,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,11,6,6,6,12,6,6,6,6,6,12,6,6,6,6,6,12,6,6,6,12,6,6,6,12,6,6,12,6,6,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,5,10,5,5,5,5,5,5,10,5,5,5,5,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,11,6,6,6,6,6,6,6,6,6,12,6,6,6,6,6,12,6,6,6,12,6,6,12,6,6,12,6,12,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,10,5,5,10,5,5,5,10,5,5,5,5,10,5,5,5,5,5,5,10,5,5,5,5,5,5,5,11,5,5,5,5,11,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,11,6,6,6,6,6,6,6,12,6,6,6,6,6,6,12,6,6,6,6,12,6,6,6,12,6,6,12,6,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,10,5,5,5,10,5,5,5,5,10,5,5,5,5,5,5,10,5,5,5,5,5,5,5,5,5,5,5,11,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,11,5,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,12,6,6,6,6,6,6,12,6,6,6,12,6,6,6,12,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,10,5,5,5,10,5,5,5,5,5,5,10,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,6,6,6,6,12,6,6,6,12,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,10,5,5,5,5,5,10,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,6,11,6,6,6,11,6,6,6,6,6,6,6,11,6,6,6,6,6,6,6,6,6,12,6,6,6,6,6,6,6,12,6,6,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,5,5,10,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,6,6,6,6,12,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,10,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,11,6,11,6,11,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,5,10,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,5,11,5,5,5,11,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,6,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,6,5,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,6,11,6,6,6,11,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,5,6,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,11,5,11,11,5,11,11,11,11,5,6,5,11,11,11,11,6,11,11,11,6,5,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,5,11,5,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,5,11,11,11,11,11,5,6,5,11,11,11,11,11,6,11,11,11,11,11,6,11,11,6,11,11,6,11,6,11,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,6,6,6,11,6,6,6,6,6,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,5,11,5,5,11,5,5,11,5,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,6,11,6,11,6,6,6,11,6,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,6,5,6,11,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,5,11,5,5,11,5,11,5,11,11,5,11,5,11,11,5,11,11,11,11,5,6,5,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,6,6,11,6,6,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,11,5,5,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,5,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,11,6,6,6,6,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,6,5,6,11,11,6,11,11,11,6,11,6,11,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,11,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,11,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,6,5,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,11,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,5,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,11,5,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,5,6,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,11,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,5,6,5,11,11,11,11,6,5,6,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,5,5,5,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,11,6,6,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,5,11,5,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,11,6,11,6,11,6,6,6,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,5,11,5,11,11,5,11,11,5,11,11,11,11,11,11,11,5,6,5,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,6,11,6,11,6,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,6,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -}; diff --git a/src/color_wheel_bits.cpp b/src/color_wheel_bits.cpp new file mode 100644 index 00000000..0307866b --- /dev/null +++ b/src/color_wheel_bits.cpp @@ -0,0 +1,73 @@ +/* Copyright 1995-1997 by Abacus Research and + * Development, Inc. All rights reserved. + */ + +#if !defined (OMIT_RCSID_STRINGS) +char ROMlib_rcsid_color_wheel_bits[] = "$Id: color_wheel_bits.c 63 2004-12-24 18:19:43Z ctm $"; +#endif + +#include "rsys/color_wheel_bits.h" + +using namespace Executor; + +const unsigned char Executor::color_wheel_bits_4[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 255,255,255,255,255,255,255,143,255,255,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,248,56,136,56, + 136,136,136,136,136,136,130,136,130,136,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,243,131,136,56,131,136,136,131,35, + 136,136,136,130,50,136,130,136,40,130,130,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,243,131,131,136,56,131,136,131,136,136,136, + 136,136,136,136,130,136,136,40,130,130,136,40,40,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,243,131,131,131,131,136,56,131,136,131,136,136, + 131,35,35,40,136,136,130,136,130,136,40,40,40,40,34,130,255,255,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,51,131,56,56,56,56,56,56,131,136,131,35,136, + 136,136,136,136,136,130,136,130,136,40,130,136,40,40,40,34,130,47,255,240,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,243,56,51,131,56,56,56,56,56,131,136,56,136, + 131,136,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,255,240,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,243,51,131,51,131,131,56,56,56,131,136,56, + 136,56,136,136,136,50,50,50,136,136,130,136,130,136,40,40,130,130,130,130,40,34,40,34, + 255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,51,51,131,51,131,56,56,56,56,56,56, + 56,131,136,131,136,136,50,50,50,50,136,136,130,136,130,136,40,130,130,130,130,40,34,130, + 34,130,34,47,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,51,51,51,131,51,131,56,56,56,56, + 56,56,131,136,56,136,131,136,136,136,136,136,136,130,136,130,136,40,130,130,130,130,130, + 40,34,130,34,130,34,34,47,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,51,51,51,131,51,131, + 56,51,131,56,56,56,56,131,136,131,136,136,136,136,136,136,136,136,136,40,136,40,130,136, + 40,40,40,40,40,34,130,34,130,34,34,34,47,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,51,51,51, + 51,51,131,51,131,56,56,56,56,56,56,131,136,56,136,56,136,131,35,136,136,130,136,136,35, + 40,130,136,40,40,40,40,34,130,40,34,34,130,34,34,34,47,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255, + 51,51,51,51,51,131,51,131,56,51,131,56,56,56,131,136,56,136,56,136,131,35,35,40,136,136,136,35,40,40,130,136,40,40,40,40,34,130,40,34,130,34,34,34,34,34,47,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,51,51,51,51,51,51,51,131,51,56,51,131,131,131,131,131,136,56,131,136,136,131,35,35,136,136,136,35,40,136,40,130,136,40,40,40,40,34,130,40,34,34,34,130,34,34,34,34,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,243,51,51,51,51,51,51,131,51,56,51,131,131,131,131,131,136,56,131,136,131,136,136,131,35,40,136,136,35,40,130,136,130,130,136,40,40,40,34,130,40,34,40,34,34,34,34,34,34,34,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,243,51,51,51,51,51,51,51,51,131,51,131,56,51,131,131,131,136,56,131,136,131,136,136,136,136,136,136,136,35,40,136,40,130,136,40,40,40,40,34,130,40,34,34,130,34,34,34,34,34,34,34,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,51,51,51,51,51,51,51,51,51,131,51,131,56,56,56,56,56,56,56,131,136,136,56,136,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,130,34,34,34,34,34,34,34,34,34,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,51,51,51,51,51,51,51,51,51,131,51,131,56,51,131,56,56,56,56,131,136,56,136,131,35,136,136,136,136,136,35,40,136,40,130,136,40,40,40,40,34,130,40,34,34,34,130,34,34,34,34,34,34,34,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,243,51,51,51,51,51,51,51,51,51,51,131,51,131,56,56,56,56,56,131,136,56,136,56,136,136,136,136,136,136,136,35,40,130,136,130,130,136,40,40,40,34,130,40,34,40,34,34,34,34,34,34,34,34,34,34,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,51,51,51,51,51,51,51,51,51,51,51,131,51,131,56,56,56,56,56,56,56,131,136,131,136,131,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,34,34,130,34,34,34,34,34,34,34,34,34,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,51,51,51,51,51,51,51,51,51,51,51,131,51,131,56,51,131,56,56,56,56,131,136,56,136,131,35,136,136,136,136,136,40,136,130,136,130,130,136,40,40,34,130,130,34,130,40,34,34,34,34,34,34,34,34,34,34,34,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,243,51,57,51,51,51,51,51,51,51,51,51,51,131,51,56,51,131,131,131,131,136,56,131,136,131,136,136,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,34,34,34,34,34,34,34,34,34,34,34,39,34,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,51,147,51,51,51,147,51,51,51,51,51,51,51,131,56,51,131,131,131,131,131,131,136,56,131,136,136,131,136,136,136,136,130,136,136,40,136,40,130,130,130,130,130,130,40,34,40,34,40,34,34,34,34,34,34,34,34,39,34,34,34,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,51,147,51,57,51,51,51,51,51,51,51,51,51,131,51,56,51,131,56,51,131,131,136,56,131,136,136,56,136,136,136,136,136,136,136,40,136,40,130,130,136,40,40,34,130,40,34,130,34,34,34,34,34,34,34,34,34,39,34,34,39,34,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,57,51,57,51,51,57,51,51,51,51,51,51,51,51,131,51,131,56,56,56,56,56,56,131,136,56,136,131,136,136,136,136,136,136,40,136,130,136,130,136,40,40,40,40,40,34,130,34,130,34,130,34,34,34,34,34,34,34,39,34,39,34,39,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,57,51,57,51,51,147,51,51,57,51,51,51,51,57,51,56,51,131,56,51,131,131,131,131,136,56,136,56,136,136,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,34,130,34,34,34,34,34,34,114,34,39,34,39,34,39,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,57,51,147,51,147,51,57,51,51,51,57,51,51,51,131,51,131,51,131,131,131,131,131,136,56,131,136,131,136,136,56,136,136,136,130,136,136,40,136,40,40,130,130,130,130,130,40,34,40,34,34,34,34,34,34,39,34,34,39,34,39,34,39,34,114,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,57,51,147,57,51,57,51,57,51,51,147,51,51,51,51,56,51,56,51,131,56,51,131,131,136,56,131,136,131,136,136,136,136,136,136,136,136,40,136,40,136,40,40,40,40,40,34,130,40,34,40,34,34,40,34,34,34,39,34,34,114,34,114,39,34,114,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,147,147,57,51,147,57,51,57,51,51,51,147,51,51,147,51,56,51,131,56,56,56,56,56,56,131,136,56,136,131,136,136,136,136,136,136,40,136,130,136,40,130,136,40,40,40,34,130,40,34,40,34,34,34,39,34,39,34,34,114,34,114,39,34,114,39,39,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,57,51,147,57,51,147,57,51,57,51,57,51,51,51,147,51,56,51,56,51,131,56,56,56,56,56,131,136,56,131,136,136,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,40,34,34,114,34,34,34,114,34,39,34,114,39,34,114,114,39,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,147,147,147,147,147,57,51,147,51,147,51,57,51,51,51,56,51,57,56,51,131,147,131,131,136,56,56,131,136,136,131,136,136,136,136,136,136,40,136,130,136,130,136,40,40,40,40,40,34,130,40,34,39,34,34,40,34,114,34,114,34,114,39,34,114,114,39,39,39,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,57,57,57,51,147,57,51,147,57,51,147,57,51,57,51,57,51,57,56,51,131,56,56,56,56,56,56,131,136,131,136,136,131,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,34,130,40,34,114,34,130,34,114,34,39,34,39,34,114,39,34,114,114,39,39,39,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,153,57,57,57,57,57,51,147,57,51,147,51,147,51,57,51,51,131,51,131,56,57,56,56,56,61,56,131,136,56,136,56,136,136,136,136,136,136,40,136,130,136,130,136,40,40,40,40,40,39,40,34,40,34,39,34,34,114,34,114,34,114,39,34,114,114,39,39,39,39,39,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,147,147,147,147,147,147,57,57,57,51,147,57,51,57,51,57,51,51,147,56,57,56,56,56,61,56,56,56,131,136,56,136,136,56,136,136,136,136,136,136,40,136,40,130,136,40,40,40,40,39,40,34,130,39,34,40,34,114,39,34,39,34,114,39,39,34,114,114,114,114,114,114,127,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,147,147,147,147,147,147,147,147,57,51,147,57,51,147,57,51,57,51,131,57,56,51,131,147,131,131,131,211,136,56,136,56,136,136,136,136,136,136,136,40,136,136,40,130,136,40,40,120,40,40,34,130,114,40,34,114,34,114,34,114,39,34,114,39,39,34,114,114,114,114,114,119,39,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,147,153,57,147,147,147,147,147,147,57,57,57,51,147,57,51,57,51,131,57,51,131,61,51,131,211,131,211,131,136,56,137,136,131,136,136,136,136,136,136,136,130,136,130,136,40,130,135,40,40,39,40,34,210,34,114,45,34,39,34,114,39,34,114,39,39,39,39,39,39,39,114,114,119,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,147,153,57,57,57,147,147,147,147,147,147,57,51,147,57,51,147,51,147,56,51,211,56,57,56,56,56,61,56,131,211,136,131,136,136,136,136,136,136,136,130,136,136,40,136,40,120,40,40,45,40,34,210,34,130,45,34,39,34,114,39,34,114,39,39,39,39,39,39,39,39,114,114,119,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,243,153,57,57,147,147,147,147,147,147,147,147,57,57,51,147,57,51,147,56,57,51,61,51,131,211,61,56,56,131,211,136,131,136,136,136,136,56,136,136,136,136,136,40,136,40,120,40,45,40,40,39,40,34,210,39,34,114,45,34,114,39,34,114,114,39,39,39,39,39,39,39,114,119,39,114,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,147,153,57,147,153,57,147,147,147,147,147,147,147,57,57,51,147,57,56,57,51,131,61,51,211,56,61,56,61,56,131,136,137,136,131,216,136,136,136,136,136,136,40,135,136,40,130,210,136,40,45,34,130,210,34,130,114,45,34,114,39,34,114,114,39,39,39,39,39,39,39,114,114,119,39,114,127,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,57,153,57,147,153,57,57,147,147,147,147,147,147,147,57,57,57,51,147,57,51,211,51,211,56,61,56,56,61,56,131,211,136,131,216,136,136,136,136,136,136,120,136,136,45,130,136,40,120,40,45,34,210,40,39,34,210,39,34,114,39,39,34,114,114,114,114,114,114,119,39,114,119,39,114,119,114,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,249,147,153,147,153,57,147,147,153,57,57,57,57,57,57,57,57,51,147,57,56,51,147,131,147,131,147,131,211,131,211,136,131,216,131,136,136,136,136,141,136,136,136,135,136,40,135,130,210,130,210,40,40,39,40,39,34,210,39,40,39,39,39,39,39,34,114,114,114,114,119,39,39,114,119,114,119,114,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,147,153,147,153,57,147,153,147,147,153,57,57,57,57,57,57,51,147,147,131,147,147,131,211,61,51,211,131,211,131,211,136,152,56,136,211,136,141,56,136,136,136,120,136,136,120,40,130,210,130,210,130,210,45,34,210,39,40,39,39,39,39,39,39,39,39,39,39,39,114,119,39,114,119,39,119,39,119,47,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,249,153,57,153,52,57,147,153,57,147,147,153,57,57,57,57,57,57,57,51,147,147,131,211,61,51,211,131,211,131,211,136,61,56,141,56,136,141,55,136,136,141,136,136,135,130,141,40,210,136,45,40,45,34,130,210,39,45,34,114,210,39,45,34,114,114,114,114,114,114,119,39,114,119,39,119,39,119,33,39,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,153,57,153,153,57,147,153,57,147,153,57,147,147,153,57,57,57,57,57,57,56,57,51,211,57,56,57,56,61,56,61,56,137,136,61,136,136,61,136,136,141,136,136,135,136,136,45,130,136,45,40,45,40,39,40,45,34,130,114,210,39,45,34,114,114,114,114,114,114,119,39,114,119,39,119,39,119,33,39,119,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,153,153,57,153,147,153,153,57,153,57,147,147,153,57,57,57,57,57,57,57,57,61,51,147,131,211,61,61,56,61,56,61,56,141,56,136,152,136,136,216,136,136,135,136,136,120,130,216,45,40,135,45,40,45,34,210,45,34,210,39,45,34,114,114,114,114,114,119,39,39,114,119,39,119,39,119,33,39,119,39,127,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,153,52,57,153,147,153,147,153,57,147,153,57,147,153,57,57,57,57,57,57,56,57,61,51,211,61,51,211,61,56,61,61,56,137,136,61,136,141,55,56,216,136,136,141,40,141,40,141,40,135,45,40,45,34,210,45,34,210,39,45,39,39,39,39,39,114,114,119,39,114,119,39,119,39,119,39,119,114,119,119,119,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,249,153,52,57,153,153,57,153,147,153,147,153,57,147,153,57,57,147,153,57,57,61,57,57,56,61,51,211,131,211,137,61,56,211,136,211,141,55,61,136,136,136,216,136,120,141,40,141,40,135,45,45,45,40,45,34,210,39,45,39,39,40,114,114,119,39,39,114,114,114,119,39,119,39,119,39,119,114,18,119,119,119,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,153,153,153,153,147,153,153,147,153,147,153,147,153,57,147,153,57,57,57,57,57,131,147,211,61,57,56,61,51,211,137,61,131,211,216,61,136,141,56,141,136,216,136,136,216,136,120,136,45,45,45,40,45,40,45,34,210,45,39,40,45,39,39,45,39,39,39,114,114,119,39,119,39,119,39,119,114,18,119,119,119,119,127,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,153,153,153,57,153,153,147,67,153,147,153,147,153,147,153,57,57,147,153,57,131,147,147,211,147,137,61,61,51,211,141,56,152,131,216,61,136,61,136,141,136,136,141,136,120,136,120,141,45,40,136,120,45,45,34,210,114,210,45,39,39,45,39,39,39,114,114,119,39,114,119,39,119,39,119,114,18,119,119,119,119,119,119,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,249,153,153,153,153,153,147,67,153,147,67,153,147,153,57,147,153,57,147,147,153,57,147,211,147,211,61,57,61,51,211,137,61,61,61,55,61,136,141,55,137,136,141,136,136,120,216,130,216,45,130,210,210,130,210,210,45,34,210,114,210,114,114,210,119,39,114,119,39,114,119,39,119,39,119,114,18,119,119,119,119,33,39,119,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,153,153,153,153,153,153,147,67,153,153,147,153,147,153,147,153,57,147,153,57,57,147,211,147,211,147,211,61,56,61,61,61,61,61,55,61,131,216,61,136,141,136,141,136,120,216,136,120,141,40,210,210,135,130,210,210,45,39,45,34,210,114,210,114,119,39,114,119,39,114,119,114,119,119,39,119,119,119,114,18,119,119,119,119,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,153,153,153,153,153,153,153,153,153,57,153,147,153,147,153,147,153,147,153,57,147,152,147,147,211,147,211,147,211,61,61,56,61,61,61,131,216,141,56,216,136,216,136,216,136,141,136,120,141,40,210,135,130,210,210,210,45,45,39,45,39,45,39,114,119,45,39,39,114,119,39,119,39,119,119,114,119,119,119,119,119,119,119,119,127,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,153,153,153,153,153,153,153,52,57,153,153,153,57,153,147,153,147,153,57,147,153,57,137,57,147,211,147,211,211,152,61,61,61,61,56,211,141,61,136,141,136,152,216,136,216,135,136,210,210,210,210,210,210,210,210,120,45,39,45,39,45,39,114,210,119,39,114,119,114,119,114,119,119,114,119,119,119,119,119,119,119,119,119,119,113,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,249,148,153,153,153,153,153,153,153,153,153,57,153,153,57,153,147,153,57,153,57,152,147,153,61,57,131,211,211,147,211,211,61,61,61,131,216,141,56,216,137,141,136,141,136,120,216,135,136,210,216,130,210,210,210,130,210,114,210,210,120,45,39,114,210,119,39,119,39,119,39,119,114,119,119,119,119,33,39,119,119,119,119,119,113,33,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,153,153,153,148,52,153,153,153,153,153,52,57,153,153,147,153,147,153,147,153,147,153,57,152,61,57,147,211,152,61,61,61,61,61,56,211,216,61,136,211,216,141,136,216,141,136,216,135,141,41,45,45,130,210,210,210,210,210,210,114,210,119,45,39,114,119,114,210,119,39,119,39,119,119,39,119,119,119,119,119,119,119,119,119,113,33,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,148,153,148,52,153,153,153,153,153,153,153,153,153,57,153,153,147,153,153,57,153,57,152,147,157,57,211,152,147,211,211,61,61,61,61,131,216,137,141,55,152,141,136,216,141,136,120,216,141,45,45,130,210,210,210,130,210,210,120,114,210,210,119,45,114,119,135,114,119,119,39,119,114,119,119,119,119,119,119,119,119,119,119,23,119,119,31,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,148,52,153,153,153,153,153,153,153,153,153,153,52,57,153,147,153,153,57,153,57,152,147,163,152,147,211,157,61,57,137,61,61,61,61,131,216,152,211,216,141,136,216,141,136,216,135,141,45,136,120,210,210,210,210,210,210,120,114,210,210,119,135,45,114,119,114,119,119,39,119,114,119,119,119,119,119,119,119,119,119,119,119,119,23,119,113,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,249,148,153,153,73,153,153,148,52,52,52,57,153,153,153,153,153,147,153,153,57,153,147,153,137,147,211,217,61,61,61,61,61,61,61,61,131,216,211,216,141,61,141,136,216,141,135,141,136,216,120,210,210,210,210,210,210,120,45,45,39,210,210,125,39,119,45,114,119,119,39,119,119,119,119,119,119,119,119,119,119,119,113,119,119,119,23,119,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,148,153,148,153,153,153,73,153,153,153,153,153,153,153,153,147,153,153,153,57,153,147,153,137,147,217,61,57,152,147,211,211,211,211,211,211,216,152,211,216,211,125,61,136,216,141,141,136,216,120,210,210,216,45,130,210,210,210,210,125,39,210,119,45,114,215,39,119,119,44,39,119,114,119,119,119,119,119,119,119,119,119,119,113,119,119,23,119,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,148,153,153,73,153,67,73,153,153,153,153,153,153,153,153,153,153,147,153,153,147,153,153,147,217,61,153,61,147,211,211,211,211,211,211,211,216,61,141,61,141,61,141,136,216,216,135,216,135,141,45,136,125,45,45,45,45,39,210,210,210,125,45,114,119,119,114,215,44,39,119,119,119,119,119,119,119,119,119,119,119,113,119,119,113,119,113,119,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,148,153,73,153,153,73,153,153,148,153,153,153,153,153,153,153,153,153,153,57,153,153,137,153,61,147,157,57,211,211,217,61,147,211,211,211,216,211,216,211,216,216,141,141,136,216,216,141,135,141,135,141,45,45,45,45,45,45,39,210,215,45,114,125,39,119,210,119,119,119,119,39,119,119,119,119,119,119,119,119,113,33,119,113,33,119,113,119,31,240,0,0,0,0,0,0,0,0,0,0,0,0,0,244,153,148,153,148,153,153,73,153,153,153,148,52,153,153,153,153,153,57,153,153,153,147,153,152,153,153,137,147,217,147,217,61,61,61,61,137,211,211,216,211,216,216,141,141,136,216,216,120,216,210,216,45,141,45,45,45,45,45,114,215,45,114,215,119,120,119,114,194,119,119,39,119,119,119,119,119,119,119,119,119,113,33,119,113,119,113,119,23,113,240,0,0,0,0,0,0,0,0,0,0,0,0,15,249,73,148,153,148,153,67,73,153,73,153,153,153,153,153,153,153,153,153,153,153,57,153,153,152,153,61,147,217,61,147,217,141,61,61,61,61,141,61,141,61,141,61,141,141,141,136,216,216,120,216,125,45,45,45,45,45,125,45,45,114,215,114,215,45,119,45,119,119,119,135,119,119,119,119,119,119,119,119,119,23,119,113,119,119,23,119,23,113,119,255,0,0,0,0,0,0,0,0,0,0,0,0,15,73,148,153,73,148,153,148,153,153,148,153,153,73,153,153,153,153,153,153,153,57,153,153,152,153,157,61,153,157,61,147,217,61,61,157,61,61,61,211,216,211,221,141,141,141,141,141,135,141,141,135,141,45,141,45,45,210,210,215,45,114,215,120,119,119,45,119,114,215,119,119,119,119,119,119,119,119,119,119,18,23,119,113,119,113,119,23,113,119,23,127,0,0,0,0,0,0,0,0,0,0,0,0,15,73,148,153,73,148,153,148,153,148,153,153,67,73,153,153,153,153,153,153,153,153,153,153,153,152,153,153,211,157,61,147,221,61,157,61,61,61,211,211,216,211,216,216,211,216,216,141,141,141,135,216,210,216,210,210,210,210,215,45,125,45,114,215,125,45,119,114,215,119,119,119,119,119,119,119,119,119,119,18,23,119,23,119,113,119,113,119,113,119,23,31,0,0,0,0,0,0,0,0,0,0,0,0,255,73,148,153,73,148,153,148,153,148,153,153,73,153,153,153,73,153,153,153,153,153,153,153,152,153,157,57,211,217,147,217,211,211,217,61,211,211,216,211,221,61,216,211,215,141,141,141,141,135,216,210,216,210,210,221,45,125,45,125,45,45,119,210,125,44,45,119,119,119,119,114,194,119,119,119,119,119,18,23,119,18,23,113,119,113,119,23,113,113,119,31,240,0,0,0,0,0,0,0,0,0,0,0,249,73,73,73,148,153,73,148,153,148,153,153,67,73,153,153,153,153,153,153,153,153,153,153,153,157,57,217,153,157,61,147,217,211,217,211,211,221,61,211,216,211,216,216,216,216,216,216,216,216,125,141,45,210,215,141,45,45,125,45,45,119,210,215,119,135,119,119,210,119,119,119,119,119,119,119,119,18,23,119,119,23,119,23,113,119,23,113,113,119,23,23,240,0,0,0,0,0,0,0,0,0,0,0,244,148,153,73,73,148,153,73,148,153,148,153,73,153,148,153,153,148,153,153,153,153,153,153,152,153,153,211,157,61,153,211,217,211,211,217,211,211,211,221,61,216,211,221,141,141,141,141,141,120,216,216,125,45,141,45,45,210,215,45,125,45,119,125,45,119,125,44,119,119,125,119,119,119,119,119,23,119,119,23,119,23,119,23,119,23,113,119,23,23,113,113,240,0,0,0,0,0,0,0,0,0,0,15,244,148,148,153,73,73,73,148,153,73,153,73,153,148,153,153,148,153,153,153,153,153,153,153,153,157,153,157,58,152,153,211,217,211,217,211,211,221,61,211,216,211,221,141,141,141,141,141,141,216,215,141,45,210,221,45,125,45,125,45,125,45,119,45,119,215,44,120,119,119,119,119,119,119,119,119,119,23,119,113,119,113,119,113,119,23,113,119,23,23,23,23,255,0,0,0,0,0,0,0,0,0,0,15,73,73,73,73,73,148,153,73,148,153,73,153,73,153,153,73,153,153,153,153,153,153,153,153,157,153,152,153,217,157,61,153,211,217,211,217,211,221,61,211,221,141,61,216,216,221,61,125,141,141,135,216,210,221,45,45,210,215,210,215,210,215,125,119,210,199,135,119,125,119,119,119,119,119,119,113,119,119,23,119,113,119,23,113,119,23,113,113,113,119,23,23,31,0,0,0,0,0,0,0,0,0,0,15,73,73,73,73,73,148,148,153,73,148,153,73,153,73,153,73,153,153,73,153,153,153,153,153,153,157,153,153,211,217,157,147,217,211,217,211,217,211,216,211,221,61,216,216,211,221,141,141,141,125,141,135,216,210,221,45,210,215,210,215,210,215,125,45,119,215,119,215,119,119,119,119,119,199,119,119,113,119,119,23,113,119,113,119,23,113,113,113,113,113,113,113,127,0,0,0,0,0,0,0,0,0,0,15,73,73,73,73,73,73,148,148,153,73,148,153,73,153,73,153,148,153,153,153,153,153,153,153,217,153,157,153,217,157,61,153,217,211,217,211,221,61,211,221,61,216,211,221,216,221,141,141,216,216,215,216,210,221,45,125,45,210,215,210,215,215,125,119,210,199,135,119,125,119,119,215,119,119,119,23,119,113,119,23,119,23,113,119,23,23,113,113,113,113,113,113,127,0,0,0,0,0,0,0,0,0,0,255,73,73,73,73,73,73,73,148,148,153,73,148,153,73,153,73,153,153,73,153,153,73,153,217,153,157,153,157,153,157,153,211,217,217,211,217,217,211,221,61,211,221,211,221,141,141,141,216,215,216,216,215,210,221,45,215,210,215,210,215,215,125,45,119,215,119,215,119,119,125,119,119,124,119,119,23,119,23,119,23,113,119,23,23,113,113,113,113,113,113,113,113,31,240,0,0,0,0,0,0,0,0,0,244,148,73,73,73,73,73,73,73,148,148,153,73,148,153,73,153,73,153,153,148,153,153,217,153,154,153,157,153,157,153,211,217,217,211,217,217,211,221,61,211,221,141,211,221,141,216,221,141,141,216,215,216,210,221,45,210,221,125,45,125,125,44,125,119,215,119,215,119,215,119,124,119,119,113,119,119,23,119,23,113,119,23,113,113,119,23,23,23,23,23,23,23,17,240,0,0,0,0,0,0,0,0,0,244,148,73,73,73,73,73,73,73,73,148,148,153,73,153,73,153,73,153,73,153,153,169,153,154,153,217,153,217,157,153,217,217,157,157,152,217,211,221,157,141,61,211,221,216,216,221,141,216,216,215,216,215,216,215,210,221,125,45,125,125,44,215,135,215,125,119,125,119,119,199,119,119,124,119,119,23,119,23,113,119,23,113,113,119,23,23,23,23,23,23,23,17,113,240,0,0,0,0,0,0,0,0,0,244,73,73,68,148,73,73,73,73,73,73,148,153,73,73,148,153,148,153,153,148,153,153,169,153,217,153,217,153,217,157,153,217,137,217,211,217,221,61,211,221,157,211,221,216,221,61,216,221,125,141,216,215,210,221,45,215,210,221,125,45,125,125,119,215,125,119,125,119,119,215,119,199,119,113,119,124,119,23,113,119,23,113,113,113,113,113,113,113,113,113,23,17,113,240,0,0,0,0,0,0,0,0,15,244,148,73,68,148,148,148,148,148,148,148,148,153,73,148,153,73,153,73,153,169,153,169,153,217,153,157,72,157,153,217,157,157,157,152,168,217,217,211,221,157,61,221,61,216,221,141,221,141,141,216,215,216,215,221,45,210,221,125,125,125,125,119,215,125,119,215,119,215,119,199,119,119,199,119,113,119,23,113,119,23,113,113,113,113,113,113,113,113,113,113,23,23,17,255,0,0,0,0,0,0,0,0,15,68,148,73,68,148,148,148,148,148,148,148,148,148,148,153,73,148,153,148,153,148,217,153,148,217,153,168,77,153,217,157,157,153,217,211,217,217,211,221,211,221,211,221,216,221,60,157,141,215,216,221,125,141,125,45,221,125,125,45,215,215,125,125,119,215,125,119,215,124,119,119,215,23,119,199,113,215,23,113,119,23,23,113,113,113,113,113,113,113,113,23,17,113,23,31,0,0,0,0,0,0,0,0,15,68,148,73,68,148,73,68,148,148,148,148,148,153,73,73,148,153,73,153,77,148,153,154,153,157,72,77,153,217,157,153,217,217,217,217,217,217,221,157,211,221,211,221,211,221,216,221,216,221,141,216,215,216,221,45,215,210,221,125,125,125,45,125,119,215,125,119,124,119,215,119,199,119,199,113,215,23,113,119,23,113,113,113,113,113,113,113,113,113,23,17,113,23,17,31,0,0,0,0,0,0,0,0,15,68,148,73,68,148,73,73,68,148,148,148,148,148,153,73,73,148,153,73,154,153,148,217,148,217,157,72,169,157,153,217,217,157,153,217,217,216,157,211,221,157,211,221,221,141,221,60,216,221,141,215,216,221,45,221,125,210,221,125,125,125,125,125,119,215,125,124,125,119,124,119,124,119,113,215,23,113,119,29,23,113,113,113,113,113,113,113,113,23,17,113,23,17,113,31,0,0,0,0,0,0,0,0,15,68,73,68,148,73,68,148,148,148,148,148,148,148,148,153,73,148,153,169,73,148,217,77,153,154,153,217,157,77,153,217,157,157,157,157,157,157,217,217,221,61,221,211,221,211,221,216,221,216,221,216,215,221,125,210,221,125,215,215,215,215,215,215,215,125,124,125,119,125,119,199,119,209,119,29,113,119,29,23,113,113,113,113,113,113,113,113,23,17,113,23,17,113,17,31,0,0,0,0,0,0,0,0,15,68,148,68,148,68,148,73,68,148,73,73,73,73,73,73,73,148,148,153,169,148,217,73,157,73,212,217,157,72,169,217,217,157,157,157,157,157,157,211,221,217,221,61,221,216,221,221,141,221,141,125,216,221,125,215,221,45,215,215,215,215,215,215,125,124,125,119,215,124,119,124,119,29,113,209,119,113,209,113,113,113,113,113,113,113,113,23,17,113,23,17,113,17,113,31,0,0,0,0,0,0,0,0,255,68,73,68,73,68,148,73,68,148,148,73,73,73,73,73,73,73,169,73,148,212,153,212,157,73,217,153,169,217,157,153,212,221,157,157,157,157,217,221,157,217,221,141,211,184,221,141,221,141,221,141,215,221,141,125,215,221,125,125,215,215,215,215,215,125,119,215,199,125,29,119,29,113,215,113,209,119,23,113,113,209,113,113,113,113,23,17,113,23,17,113,17,113,17,31,240,0,0,0,0,0,0,0,244,68,73,68,68,148,73,68,148,73,73,73,68,148,148,148,153,73,169,73,212,153,169,148,217,153,169,212,217,157,77,157,157,157,157,157,157,157,217,221,157,141,217,221,211,184,221,221,141,221,141,215,221,141,125,215,221,45,215,215,215,215,215,215,199,215,199,215,124,125,23,125,23,209,119,29,23,113,209,113,209,113,113,113,113,23,17,113,23,17,113,17,113,17,23,17,240,0,0,0,0,0,0,0,244,68,73,68,68,148,68,148,73,68,148,73,73,73,73,73,73,164,153,73,169,77,73,212,157,77,72,169,157,77,157,77,157,157,77,157,157,217,217,221,157,217,221,61,221,221,141,221,216,221,221,216,221,125,215,221,43,215,215,221,125,125,125,125,124,125,119,215,199,125,29,119,29,113,209,119,29,23,23,113,113,113,113,113,113,23,17,113,23,17,23,17,17,113,17,17,240,0,0,0,0,0,0,0,244,68,68,148,68,73,68,73,68,148,73,68,148,73,73,73,73,164,153,77,73,77,73,212,157,77,148,217,77,157,77,157,157,77,157,157,217,217,221,157,217,221,141,221,157,221,61,221,221,216,221,125,221,125,221,125,215,221,125,125,125,125,125,199,215,215,199,215,199,125,23,209,125,23,124,113,209,119,29,23,23,28,113,23,23,17,113,23,17,23,17,23,17,17,23,17,240,0,0,0,0,0,0,0,244,68,68,73,68,68,148,68,148,73,68,148,73,73,73,74,73,73,77,73,77,73,212,157,73,154,153,212,217,212,217,217,157,157,157,157,157,217,221,157,217,221,157,221,211,221,221,221,141,221,221,141,215,221,141,215,221,125,215,221,125,125,199,215,215,199,215,199,209,215,29,113,215,29,23,209,113,209,113,113,209,23,23,23,17,113,23,17,23,17,23,17,17,23,17,17,240,0,0,0,0,0,0,0,244,68,73,68,68,148,68,148,68,73,68,148,73,73,74,73,73,77,73,77,73,148,212,157,77,77,77,148,217,212,217,212,217,212,221,157,77,217,221,157,217,221,217,221,221,221,216,221,221,216,221,215,221,221,125,215,221,125,215,221,125,199,215,215,205,119,209,215,209,215,29,113,209,125,23,29,23,29,23,23,23,29,17,113,23,17,113,23,17,17,23,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,148,68,73,68,148,73,68,148,73,73,77,73,77,73,77,73,169,77,77,72,77,154,157,77,153,212,217,217,212,221,157,217,221,157,217,221,217,221,217,221,221,221,141,221,221,215,221,221,125,221,125,215,221,125,199,215,215,220,125,124,215,124,125,29,29,113,209,125,23,29,23,29,23,29,17,113,113,29,17,113,23,17,23,17,17,17,113,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,148,68,68,73,68,68,148,68,148,73,74,73,73,74,73,77,73,77,77,77,73,212,212,217,77,157,77,157,77,212,221,157,212,221,157,217,221,217,221,217,221,221,141,221,221,221,141,221,215,221,215,221,215,221,125,200,205,125,215,205,125,29,125,29,29,119,29,29,113,209,125,23,29,23,29,17,113,193,113,23,17,113,17,113,17,17,113,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,148,68,73,68,73,68,148,74,73,73,74,77,73,77,73,77,73,77,77,73,212,217,77,157,77,77,212,221,157,157,212,221,157,217,221,173,217,221,221,221,157,221,221,141,221,215,221,221,215,221,215,221,125,205,125,125,199,215,205,125,29,29,113,221,29,29,23,209,113,209,113,209,23,29,17,113,113,193,113,23,17,17,113,17,17,17,17,23,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,148,68,73,68,68,148,73,74,73,77,68,212,148,212,148,212,212,157,77,73,212,212,217,173,157,77,157,77,212,221,157,217,221,77,221,221,157,221,221,221,216,221,221,221,221,215,221,215,221,215,220,215,221,125,199,215,209,215,209,215,209,209,209,209,125,23,193,209,209,113,209,29,17,113,193,113,29,17,23,17,113,17,17,113,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,73,68,68,68,73,68,73,68,164,148,77,68,148,212,73,164,212,212,154,77,77,77,77,154,157,77,77,212,221,157,77,221,157,173,157,221,217,221,221,217,221,221,221,221,221,221,125,221,221,125,221,125,215,221,29,215,209,221,29,209,209,209,215,209,209,209,209,209,209,209,113,209,29,17,209,23,28,29,17,23,17,28,17,23,17,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,68,148,68,73,68,164,148,73,68,212,73,77,68,212,148,212,212,157,77,77,77,77,77,157,77,212,217,212,221,157,77,221,77,221,212,122,221,221,221,157,221,221,221,221,221,215,221,221,125,220,215,221,205,125,205,29,209,215,209,221,29,29,29,29,23,209,209,113,209,199,29,17,113,193,113,23,17,209,17,113,17,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,68,68,73,68,68,148,74,73,68,212,77,68,212,148,212,212,154,77,77,77,77,77,154,157,77,212,212,221,212,221,212,221,221,157,221,217,221,221,157,221,221,221,221,215,221,221,215,221,205,215,221,29,215,209,221,29,209,215,209,209,215,29,29,29,29,23,29,28,29,23,29,17,209,23,29,17,209,17,113,17,23,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,15,244,68,68,68,68,68,68,68,68,68,73,68,74,68,148,164,77,68,212,74,148,212,148,212,212,212,212,212,212,212,221,77,77,212,221,77,212,221,217,221,77,221,212,201,221,221,221,221,221,221,221,221,215,221,221,205,215,221,29,209,167,209,221,29,209,209,221,29,29,29,29,29,29,29,29,23,29,17,209,29,17,29,17,17,113,17,193,17,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,15,84,68,68,68,68,68,68,68,68,148,68,74,68,148,74,77,68,212,73,74,77,68,212,212,212,212,212,212,212,212,212,221,77,212,221,77,221,77,221,77,221,212,201,221,221,221,221,221,221,221,221,215,221,221,205,215,221,29,221,209,221,29,209,221,29,209,209,209,209,209,209,209,124,29,23,29,17,209,29,17,193,23,17,209,17,193,17,23,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,15,244,68,68,68,68,68,68,68,68,68,74,68,148,74,73,68,212,74,77,77,68,212,212,164,212,212,212,212,212,212,221,77,77,212,221,77,221,77,221,77,221,212,205,221,212,205,157,221,221,221,221,221,221,205,215,221,26,209,221,209,221,29,209,221,29,29,209,209,209,209,209,209,209,209,193,209,209,29,17,193,113,193,209,17,193,17,113,17,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,68,68,164,68,148,74,68,164,212,74,77,68,164,212,164,212,212,212,212,212,212,212,218,157,77,212,221,77,212,221,212,221,221,173,221,212,221,221,221,221,221,221,221,221,221,205,221,221,205,215,221,205,209,221,209,221,29,205,29,29,209,209,209,209,209,209,209,209,193,209,29,17,209,29,17,28,17,113,28,17,28,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,68,68,68,164,68,164,73,68,164,148,164,212,148,212,212,164,212,212,164,212,212,212,218,157,77,173,77,212,221,173,212,221,173,212,221,221,221,221,218,221,221,221,221,221,205,221,221,205,215,221,205,209,221,209,221,29,209,221,29,205,29,29,193,209,209,209,193,209,209,29,28,23,28,17,209,23,17,193,17,209,17,17,28,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,68,164,68,74,68,148,74,68,212,77,68,212,164,212,164,212,212,169,212,212,212,218,154,212,221,77,212,221,173,77,221,173,212,125,173,221,218,221,221,221,221,221,221,189,221,221,205,215,221,205,209,167,220,209,221,205,205,29,205,29,29,29,193,209,209,209,209,209,193,209,29,28,29,17,193,29,17,28,17,17,193,17,17,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,164,68,74,68,74,68,164,148,164,77,68,212,164,212,164,212,212,164,212,212,218,77,169,212,218,212,221,173,77,221,77,218,221,218,221,218,221,221,218,221,221,221,189,221,221,205,221,221,205,220,221,209,221,220,209,221,29,209,220,209,220,209,209,209,209,209,209,193,209,193,209,29,17,193,113,193,28,17,209,17,28,17,28,17,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,68,68,68,164,68,164,68,164,148,164,164,212,74,77,68,212,164,212,212,212,212,212,218,77,173,77,173,77,212,221,173,76,155,217,218,221,218,221,221,173,221,221,221,189,221,221,221,221,205,221,205,221,205,220,215,220,220,209,221,205,29,205,29,29,193,209,220,29,28,209,193,209,193,113,193,209,28,29,17,193,17,193,17,28,17,17,17,193,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,74,68,164,68,164,68,164,74,68,164,212,74,77,74,77,74,148,212,164,212,218,164,218,212,218,212,221,77,218,212,221,173,212,221,218,221,218,221,221,173,221,221,189,221,221,221,205,221,220,221,220,221,125,205,220,209,221,205,29,205,29,29,205,29,29,193,220,29,28,113,209,193,209,193,209,28,29,17,193,28,17,193,28,17,17,193,17,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,164,68,68,74,68,68,164,74,68,164,148,164,164,212,77,74,77,74,164,212,218,77,77,164,218,212,212,218,218,212,221,173,173,218,218,221,173,221,173,221,221,173,221,221,221,189,221,221,109,221,220,221,205,220,220,215,220,221,29,220,209,221,205,29,29,204,209,209,209,209,209,204,113,209,193,209,29,17,193,28,23,17,193,17,193,17,17,28,17,17,17,17,240,0,0,0,0,0,0,0,244,68,68,68,68,164,68,164,68,164,74,68,164,148,164,164,212,74,77,74,77,74,212,212,173,77,164,218,212,212,218,218,212,218,218,218,212,221,218,221,173,221,173,218,221,219,221,219,221,221,219,221,221,205,221,205,220,221,205,220,220,220,220,209,220,209,220,205,29,193,209,209,220,28,209,193,209,193,209,193,193,193,124,17,193,193,28,17,28,17,28,17,17,17,28,17,240,0,0,0,0,0,0,0,244,68,74,68,68,164,68,164,68,164,74,68,164,164,164,164,164,212,164,169,164,212,164,218,77,74,212,218,169,180,218,212,218,218,212,221,218,218,221,173,218,221,218,221,219,221,218,221,221,189,221,205,221,104,189,220,221,205,220,220,215,220,209,221,205,204,209,220,209,209,220,193,220,29,28,209,193,209,193,209,193,113,193,193,28,17,193,28,17,28,17,17,28,17,17,17,240,0,0,0,0,0,0,0,244,68,68,74,68,74,68,74,68,164,74,68,164,164,74,73,164,164,212,164,212,170,154,77,170,77,170,154,212,218,212,218,218,212,221,173,173,218,221,173,218,221,173,219,221,173,221,189,221,221,189,221,104,189,220,221,205,220,221,205,205,205,205,205,29,205,29,204,209,220,193,220,29,27,28,124,29,28,28,28,28,28,28,28,17,193,28,17,193,17,28,17,17,28,17,17,240,0,0,0,0,0,0,0,244,68,164,68,74,68,74,68,164,74,68,164,164,74,74,74,74,148,170,77,74,164,218,77,77,170,154,212,218,212,218,218,212,219,155,155,155,218,218,221,173,218,219,221,173,221,189,221,219,221,220,221,189,220,221,220,221,205,205,220,220,220,220,220,220,123,29,205,29,193,220,205,29,28,209,204,29,28,193,209,193,209,28,28,28,28,17,193,17,193,17,193,17,28,17,17,240,0,0,0,0,0,0,0,244,68,74,68,74,68,74,68,164,74,68,164,164,164,164,164,212,164,173,74,77,164,212,170,173,74,212,218,173,75,154,218,218,218,218,218,218,218,221,173,218,219,221,173,221,189,221,189,221,219,221,189,220,221,214,221,205,220,220,220,220,220,220,209,220,220,209,220,205,29,204,29,27,29,28,199,193,204,29,28,28,28,28,28,28,17,193,28,17,193,17,193,28,17,17,28,240,0,0,0,0,0,0,0,255,68,74,68,74,68,164,74,68,164,164,164,164,164,164,164,164,170,74,154,74,164,218,164,218,77,170,173,77,170,218,212,218,218,218,218,218,221,173,173,218,221,173,219,221,173,219,221,219,221,221,189,220,214,139,221,205,214,221,205,220,220,220,220,220,124,220,205,29,204,205,29,204,29,193,204,124,29,28,28,29,28,28,28,28,17,193,28,17,193,28,17,17,193,17,31,240,0,0,0,0,0,0,0,15,68,74,68,74,68,164,74,68,164,164,74,74,74,74,74,164,169,164,170,77,164,212,180,218,170,154,173,77,170,212,189,170,218,218,218,218,218,221,173,189,173,219,218,221,189,221,189,221,189,221,205,189,214,139,221,205,220,221,205,205,205,205,199,205,204,220,205,27,124,205,28,205,28,204,124,29,28,193,209,204,28,28,28,28,17,193,193,193,28,17,28,17,193,28,31,0,0,0,0,0,0,0,0,15,68,164,74,68,164,74,68,164,164,164,164,164,164,164,164,169,164,170,77,74,170,164,218,164,218,173,77,170,218,173,173,77,173,173,173,173,173,173,173,173,219,218,221,189,173,189,221,189,219,221,189,214,139,220,221,109,220,220,220,220,220,220,220,220,220,205,29,204,209,205,193,220,193,209,204,193,209,204,28,28,28,28,28,28,28,17,193,28,17,193,28,17,28,17,31,0,0,0,0,0,0,0,0,15,68,164,68,164,74,68,164,164,164,164,164,164,164,164,170,74,164,170,77,164,170,212,170,212,173,75,169,170,218,173,75,218,173,173,173,173,173,173,189,173,189,173,189,173,219,221,189,221,189,221,189,220,219,220,221,109,220,214,221,205,205,205,204,220,205,204,220,204,209,177,220,193,220,204,29,193,204,28,204,28,193,193,193,193,193,193,193,28,17,193,28,17,193,28,31,0,0,0,0,0,0,0,0,15,68,164,74,68,164,164,164,74,74,68,164,164,164,164,170,74,164,170,74,170,154,164,218,170,173,74,218,170,218,173,170,218,218,218,173,173,173,189,173,173,189,173,219,218,221,189,221,189,219,221,205,189,214,221,104,189,205,220,220,214,220,220,220,205,204,220,199,205,204,204,124,204,204,29,193,204,193,209,204,28,193,193,193,193,193,193,193,193,193,28,28,17,193,17,207,0,0,0,0,0,0,0,0,15,68,164,74,68,164,164,74,74,74,74,74,74,164,164,170,74,164,170,154,164,218,164,218,170,77,170,173,170,212,185,173,170,218,218,218,219,173,173,173,189,173,189,173,213,221,219,221,189,219,221,189,205,214,221,214,221,205,109,220,220,220,220,220,205,204,220,205,204,205,29,204,204,124,193,177,209,204,193,204,28,193,193,204,28,28,28,17,193,193,28,28,17,193,28,31,0,0,0,0,0,0,0,0,15,244,74,68,164,164,74,74,74,74,74,74,74,164,170,74,164,170,74,164,218,164,170,170,173,75,169,170,218,170,218,173,173,170,218,218,189,173,173,189,173,93,218,213,122,219,221,87,189,219,221,189,205,189,214,221,205,109,220,214,220,220,214,125,204,220,205,204,220,204,204,209,204,209,177,220,193,204,193,204,28,193,193,204,28,28,28,28,28,28,28,17,193,28,17,255,0,0,0,0,0,0,0,0,0,244,164,164,74,74,74,74,74,74,74,74,164,164,170,74,164,170,164,170,164,170,173,74,173,74,173,170,173,170,218,173,170,218,186,218,218,218,189,173,93,218,219,213,117,221,189,221,189,219,221,189,189,205,189,205,109,220,214,221,205,205,205,109,204,220,205,204,205,204,124,204,209,177,204,204,193,204,193,204,28,193,204,28,28,28,28,28,28,28,17,193,193,28,17,240,0,0,0,0,0,0,0,0,0,244,164,74,74,74,74,74,74,74,74,164,164,170,74,164,170,74,170,164,170,173,74,170,170,218,170,173,170,173,170,173,170,218,218,218,186,218,219,173,213,221,93,213,122,221,189,189,219,219,221,189,205,189,109,214,221,109,220,214,220,214,220,220,205,204,220,205,204,204,220,204,204,204,124,204,193,204,193,220,28,193,204,28,28,28,28,28,28,28,28,28,28,28,17,240,0,0,0,0,0,0,0,0,0,244,74,74,74,74,74,74,74,74,74,164,170,74,164,170,74,170,74,170,170,74,170,173,170,170,173,170,173,170,173,170,218,186,218,186,218,213,221,171,218,213,221,213,221,189,189,213,221,189,205,189,189,205,189,205,109,220,214,221,205,204,214,220,220,205,204,205,204,204,205,204,199,204,204,193,220,193,204,193,204,193,204,28,28,193,204,28,28,28,28,28,28,17,193,240,0,0,0,0,0,0,0,0,0,255,74,74,74,74,74,74,74,74,164,164,170,74,164,170,164,170,170,74,170,170,170,170,170,154,170,173,170,173,170,218,186,218,173,173,171,218,213,218,213,221,93,219,219,221,93,219,221,189,189,205,189,189,109,214,221,109,214,220,214,220,220,220,205,103,188,205,204,205,204,204,204,204,193,220,193,204,204,28,193,204,28,193,204,28,28,28,193,193,193,193,193,193,207,240,0,0,0,0,0,0,0,0,0,15,74,74,74,74,74,74,74,164,164,170,74,164,170,164,170,164,170,170,170,170,154,170,170,218,170,173,170,170,218,170,218,173,171,173,171,213,218,213,221,93,213,221,93,219,219,221,189,189,202,205,189,205,189,109,214,220,214,220,214,220,214,220,205,103,188,205,204,204,204,220,204,199,204,204,204,204,28,204,193,204,193,204,28,193,204,28,28,193,193,193,193,193,31,0,0,0,0,0,0,0,0,0,0,15,74,74,74,74,74,74,164,164,170,74,164,170,164,170,170,164,170,170,74,170,170,170,170,170,218,170,173,170,186,218,171,173,171,173,93,173,93,213,221,93,213,221,189,189,213,221,189,189,202,205,189,189,109,214,220,214,221,109,205,109,205,204,214,220,205,204,204,220,204,204,204,204,204,204,28,204,204,28,204,28,193,204,28,193,204,28,28,193,193,193,193,193,207,0,0,0,0,0,0,0,0,0,0,15,74,74,74,74,74,164,164,170,74,164,170,164,170,170,74,170,170,74,170,170,170,170,170,218,170,170,173,170,170,218,186,173,171,173,93,173,93,213,218,213,221,189,93,219,219,219,219,219,219,219,220,189,205,109,214,221,109,205,109,205,109,204,214,123,204,205,204,204,205,204,204,204,204,204,204,193,204,204,28,204,193,204,193,204,28,193,193,193,193,193,193,193,207,0,0,0,0,0,0,0,0,0,0,15,244,164,164,170,74,74,164,170,74,170,74,170,164,170,170,74,170,170,170,170,170,170,170,170,170,218,170,186,218,171,173,171,173,93,173,93,173,93,93,213,219,219,213,221,189,189,189,219,220,219,219,205,189,109,214,214,220,214,220,214,220,214,220,205,103,109,204,205,108,204,204,204,204,204,204,204,193,204,204,28,204,28,193,204,28,193,204,28,193,204,28,28,255,0,0,0,0,0,0,0,0,0,0,0,244,164,170,74,74,164,170,74,164,170,164,170,170,74,170,170,170,170,170,170,170,170,170,170,218,170,170,218,171,170,173,93,170,213,218,213,213,221,93,189,93,213,221,189,189,93,202,203,219,219,219,205,109,189,109,214,214,220,214,214,220,205,109,204,205,103,188,204,204,205,204,204,204,204,204,28,204,204,28,204,28,204,193,204,193,204,28,193,204,28,28,28,240,0,0,0,0,0,0,0,0,0,0,0,244,164,170,74,74,164,170,74,170,74,170,164,170,170,164,170,170,164,170,170,170,170,170,170,170,171,170,171,170,213,218,171,173,93,93,165,221,93,93,93,213,221,189,93,189,189,189,189,189,188,219,219,214,221,109,109,205,109,109,205,109,109,204,205,109,204,204,204,214,204,204,204,204,204,204,204,204,28,204,204,193,204,193,204,193,204,28,193,204,28,28,28,240,0,0,0,0,0,0,0,0,0,0,0,255,164,164,170,74,164,170,164,170,164,170,170,164,170,170,170,170,170,170,170,170,170,170,170,171,170,173,170,186,170,213,218,93,173,93,171,213,213,221,93,213,219,219,219,219,219,219,219,219,219,220,189,109,189,109,109,109,109,205,109,109,204,214,205,108,205,108,214,124,204,204,204,204,204,204,204,204,204,193,204,204,193,204,193,204,193,204,28,193,204,28,31,240,0,0,0,0,0,0,0,0,0,0,0,15,164,164,170,74,164,170,164,170,170,74,170,170,170,69,74,170,170,170,170,170,170,170,170,170,171,170,170,186,213,218,93,173,93,93,93,93,213,213,219,213,219,213,219,219,219,219,219,219,205,189,188,189,109,109,214,220,189,109,109,204,214,214,220,204,205,108,204,204,203,204,204,204,204,204,204,193,204,204,204,193,204,204,193,204,193,204,193,204,28,28,207,0,0,0,0,0,0,0,0,0,0,0,0,15,164,170,74,164,170,164,170,164,170,170,164,170,170,170,170,170,170,170,170,170,170,170,90,171,170,173,90,213,218,171,173,93,93,93,173,93,93,93,213,219,213,219,219,219,213,219,219,205,187,219,205,189,109,188,214,214,214,220,109,109,198,220,198,220,109,204,204,188,204,204,204,204,204,204,204,204,204,204,193,97,204,193,97,204,193,204,193,204,28,193,207,0,0,0,0,0,0,0,0,0,0,0,0,15,250,74,164,170,164,170,164,84,170,164,84,170,170,170,170,170,170,170,170,170,90,170,170,170,171,170,165,218,165,218,93,93,170,93,93,93,93,186,213,219,213,219,219,213,220,189,189,189,187,220,189,109,188,189,109,109,109,109,109,198,220,109,204,109,204,109,204,198,118,204,204,198,204,204,204,204,204,204,204,204,193,97,204,193,204,193,204,28,193,204,255,0,0,0,0,0,0,0,0,0,0,0,0,0,250,74,170,74,170,74,170,164,84,170,170,170,170,170,170,170,170,170,170,170,170,165,170,171,170,165,218,165,218,93,165,213,218,93,93,93,93,189,93,189,93,189,189,189,189,187,219,189,188,189,189,109,188,189,109,109,109,109,198,220,109,198,220,109,204,109,198,118,220,204,198,124,204,204,204,204,204,204,204,28,204,204,193,97,204,193,204,193,204,28,240,0,0,0,0,0,0,0,0,0,0,0,0,0,255,164,170,164,170,170,74,170,170,170,170,69,74,170,170,170,170,170,165,170,170,170,165,170,171,170,93,165,218,93,165,213,213,218,189,93,93,93,93,189,93,189,93,189,187,219,219,189,189,188,189,109,188,189,109,109,109,109,109,109,198,214,220,109,204,109,204,198,204,204,198,204,204,108,204,204,204,204,204,204,204,193,97,204,193,97,204,193,204,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,15,164,170,164,170,170,170,74,170,170,69,74,170,170,170,170,170,165,74,165,170,165,170,171,170,93,165,218,93,93,165,213,213,213,213,213,213,219,213,219,213,219,219,189,187,219,219,189,188,189,189,109,182,214,214,214,214,214,220,109,109,198,220,109,103,108,203,204,198,220,204,198,204,204,204,204,204,204,204,204,204,193,97,204,193,97,204,193,204,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,170,74,170,164,170,170,170,170,69,69,170,170,170,170,170,90,170,165,170,170,170,90,170,93,165,218,93,165,173,90,213,213,213,213,213,213,213,219,213,219,213,219,189,189,187,219,189,188,189,187,203,214,214,214,214,214,214,214,214,214,214,205,108,205,108,204,109,198,204,198,204,204,204,108,204,204,204,204,204,204,204,204,193,97,204,193,204,204,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,164,170,170,170,74,170,170,170,170,170,170,170,170,84,170,90,170,170,90,170,90,171,170,165,173,90,171,165,213,213,213,213,213,213,213,219,93,189,93,187,219,189,92,171,219,203,219,189,109,188,189,109,182,214,214,214,214,214,214,205,108,203,198,214,204,198,204,204,198,204,204,108,204,204,204,204,204,204,204,204,22,28,204,204,193,204,204,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,170,69,74,170,170,170,170,170,170,170,170,170,170,165,170,170,165,170,170,90,170,165,170,186,93,90,165,213,213,213,165,213,213,213,213,219,93,189,93,187,213,219,189,187,219,189,188,189,187,203,189,109,109,109,109,109,108,182,214,205,108,198,214,204,198,220,108,198,204,204,108,204,204,204,108,204,204,204,204,204,204,204,204,28,204,204,28,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,170,69,74,170,170,164,84,170,170,170,170,170,165,69,170,165,170,170,90,170,90,171,165,170,93,90,213,213,165,213,213,213,213,186,181,219,93,189,93,187,213,202,189,187,219,188,189,187,203,214,214,214,219,109,109,109,109,108,214,198,214,214,204,188,198,220,108,204,198,204,204,108,204,97,108,204,204,204,204,204,204,204,204,204,193,204,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,170,69,74,170,170,170,170,170,170,170,170,90,170,170,165,170,170,90,170,90,165,170,93,90,170,93,90,93,93,90,181,213,213,213,213,219,93,187,171,213,202,189,187,219,188,189,187,189,182,219,182,219,109,109,109,109,108,109,109,108,188,109,108,198,214,204,108,198,220,108,204,198,204,204,204,204,204,204,204,204,204,204,193,97,204,204,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,170,170,170,170,170,170,170,170,170,84,90,170,165,170,170,90,170,90,165,170,90,170,93,90,93,93,90,93,93,90,93,91,165,219,93,181,219,213,219,189,187,189,187,219,187,219,203,189,109,182,219,109,109,109,108,109,109,108,109,109,108,109,108,198,220,108,198,204,198,204,198,204,198,204,204,108,204,204,204,204,204,204,204,204,193,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,170,170,170,170,170,170,170,170,170,84,90,170,170,90,170,90,170,90,165,170,165,186,90,171,93,90,93,93,90,93,93,93,93,93,93,181,219,181,219,189,92,189,187,189,187,203,189,187,203,188,189,109,109,107,109,109,108,109,109,108,109,108,198,214,204,108,198,204,198,204,198,204,204,198,204,204,204,204,204,204,204,204,204,204,204,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,170,170,69,74,170,170,170,165,170,170,170,90,170,90,170,90,165,170,90,165,170,90,186,93,90,93,90,93,91,93,93,93,91,171,181,219,93,189,93,187,189,92,186,188,187,219,187,203,189,109,109,109,107,203,109,109,109,108,109,108,109,108,108,198,204,109,108,198,204,108,204,108,198,22,204,204,198,204,204,204,204,204,204,204,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,170,170,170,170,170,170,90,170,170,165,170,170,90,170,90,165,170,90,165,170,90,186,90,93,90,93,90,93,93,91,93,91,171,93,93,189,93,187,189,93,187,189,187,189,187,188,187,214,189,109,107,188,109,109,109,102,214,109,108,109,108,109,108,109,108,108,198,204,108,198,204,108,204,198,204,204,204,204,198,22,204,204,204,204,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,170,170,170,170,84,84,90,170,165,170,165,170,165,170,165,170,90,165,165,170,90,93,90,93,90,93,91,93,93,91,93,93,93,93,93,181,219,92,187,213,203,189,187,187,219,188,187,189,107,214,189,109,107,109,102,214,198,214,109,108,108,109,108,108,198,204,108,198,204,108,204,108,204,198,204,198,204,204,204,204,204,204,204,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,170,170,170,170,84,90,170,165,170,165,69,170,90,165,170,90,165,165,170,90,93,90,90,93,85,213,93,85,213,93,93,91,93,92,93,181,219,187,171,187,219,187,189,187,188,187,189,107,214,188,182,214,188,109,102,214,214,109,108,109,108,108,109,108,108,108,198,198,204,108,198,204,108,204,198,22,204,204,108,204,204,204,204,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,170,170,165,69,170,170,165,170,170,90,165,170,90,165,170,90,90,165,165,165,165,165,186,90,91,93,90,91,93,91,93,93,91,186,181,219,187,171,189,187,187,219,187,187,219,188,187,109,182,214,214,188,182,214,214,109,102,214,109,108,108,109,108,108,108,198,198,204,108,198,204,108,204,108,198,22,204,204,204,204,198,22,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,170,165,69,170,165,69,170,90,170,90,170,90,165,170,90,90,90,165,165,171,90,90,93,90,93,85,213,93,93,91,93,93,91,213,187,213,189,187,187,213,187,219,187,203,187,189,107,214,187,109,107,214,182,214,109,102,214,108,109,102,198,198,198,198,198,204,108,108,198,204,108,204,108,204,108,204,108,204,108,204,204,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,170,165,69,170,165,69,170,165,170,90,165,170,90,90,90,165,165,165,165,165,165,213,90,93,85,213,93,91,93,91,93,91,181,219,181,219,187,93,187,187,219,187,187,188,187,188,182,219,109,107,182,214,182,214,109,102,198,214,108,109,102,198,214,198,198,198,204,108,108,108,198,204,108,204,108,204,204,97,108,204,204,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,170,165,170,170,165,170,90,165,170,165,170,90,90,165,165,165,165,165,165,165,181,165,165,181,213,93,85,213,93,91,93,91,213,187,171,181,219,187,187,219,187,187,188,187,189,107,187,109,107,188,182,214,214,109,102,214,107,108,109,102,198,214,198,198,198,198,198,198,204,108,198,204,108,204,108,204,108,204,204,198,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,170,165,69,170,90,170,90,170,90,165,170,90,90,165,165,165,165,165,165,165,165,165,181,213,93,85,181,171,91,93,91,171,93,91,187,213,187,189,91,187,187,189,187,187,187,203,187,109,182,214,182,214,182,198,214,109,102,214,108,107,198,198,108,108,108,108,108,198,198,198,204,108,198,204,198,204,198,204,198,22,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,165,170,170,90,170,90,165,170,90,90,90,165,165,165,165,165,165,165,165,181,165,213,90,91,90,93,91,93,91,93,91,181,219,91,189,91,187,187,219,187,187,187,203,187,182,219,109,107,182,214,182,214,182,214,107,108,102,214,108,102,214,108,108,108,108,108,108,108,108,198,198,204,108,198,204,198,204,198,22,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,170,90,170,90,165,170,90,165,170,90,90,90,90,90,90,90,90,85,165,165,181,165,93,85,213,91,93,91,93,91,93,91,187,93,187,187,187,213,187,187,187,203,187,188,187,109,182,187,198,214,182,214,107,108,109,102,214,108,107,108,108,108,108,108,108,108,108,108,108,198,204,108,198,204,108,204,108,204,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,165,170,90,165,170,90,165,165,170,90,90,90,90,90,90,85,165,165,90,85,213,85,213,91,93,85,213,93,91,93,181,189,91,187,93,181,203,187,187,187,187,187,187,203,182,187,203,107,182,214,182,203,109,102,182,198,109,102,198,109,102,198,108,108,108,108,108,108,108,108,198,204,108,198,204,198,204,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,165,170,165,170,90,165,165,165,165,165,165,165,165,165,90,90,85,165,91,90,85,213,91,90,91,91,93,91,93,91,181,187,181,219,181,197,187,187,187,219,187,188,187,182,219,107,182,214,182,214,182,182,109,102,198,182,108,102,214,108,102,198,198,108,108,108,108,108,108,108,198,198,204,108,198,204,198,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,165,170,90,165,165,170,90,165,165,165,165,165,165,165,90,90,85,165,90,85,181,90,91,93,85,213,91,93,91,91,186,181,219,91,187,187,187,187,187,187,187,187,182,219,107,187,109,107,182,182,214,109,102,182,198,109,102,214,108,102,198,198,108,108,102,198,198,198,198,198,198,204,108,198,204,108,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,250,90,165,170,90,90,90,90,90,90,90,90,85,165,165,90,85,165,91,90,85,181,93,85,181,181,213,91,181,213,187,91,187,181,219,187,187,187,187,187,187,188,187,187,107,187,109,107,109,107,107,108,107,102,214,102,214,102,198,108,102,198,108,102,198,198,198,198,198,198,204,108,108,198,204,108,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,165,170,90,90,165,165,165,165,165,165,90,90,85,165,90,85,165,90,85,181,165,91,90,91,85,213,181,213,181,187,93,181,187,187,91,187,187,187,187,187,187,182,187,182,214,187,107,107,109,107,107,109,102,109,102,102,198,109,102,198,108,102,198,198,108,102,198,198,198,198,204,108,108,198,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,165,165,170,90,90,90,90,90,90,90,90,85,165,90,85,165,85,165,85,165,93,85,181,93,85,181,213,181,187,93,91,187,91,187,187,187,187,187,187,187,187,188,182,187,182,187,107,203,107,107,108,107,102,182,108,102,182,108,102,108,102,198,108,102,198,198,198,198,198,198,198,198,198,204,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,165,165,165,165,165,165,165,165,90,85,165,90,85,165,85,165,85,181,90,85,181,93,85,181,213,181,181,187,91,181,187,187,91,187,187,181,187,187,187,188,187,182,187,182,187,107,107,109,102,182,182,198,182,109,102,108,102,198,108,102,198,108,102,198,108,102,198,198,198,198,198,204,108,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,165,165,165,165,165,165,165,165,90,85,165,90,85,90,85,90,85,90,85,181,93,85,181,181,181,181,181,213,187,91,187,91,187,187,91,187,187,187,187,182,187,182,187,182,187,109,107,107,107,108,107,102,214,102,108,102,182,108,102,198,108,102,198,108,102,198,198,198,198,198,198,198,207,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,165,165,165,165,165,165,90,85,165,90,85,165,85,165,85,90,85,181,91,85,181,93,85,181,181,213,181,187,91,187,91,187,187,187,187,187,187,187,187,107,187,107,182,187,107,107,107,109,102,182,107,102,182,102,214,102,108,102,108,102,108,102,108,102,198,198,108,108,108,108,108,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,90,90,90,90,85,165,90,85,165,90,85,90,85,85,165,85,85,181,85,213,91,85,181,181,213,181,181,187,91,187,91,187,91,187,187,187,187,187,107,187,187,107,182,187,107,107,109,102,182,182,107,102,198,102,102,198,102,108,102,108,102,108,102,198,108,108,108,108,108,108,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,165,90,90,85,165,90,85,165,90,85,85,165,85,85,90,85,85,181,91,85,181,181,165,181,181,187,91,181,187,181,187,187,187,187,187,187,187,187,182,187,107,182,187,107,107,107,107,102,182,109,102,107,102,102,214,102,108,102,108,102,108,102,198,108,102,198,108,108,108,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,90,90,85,165,165,90,85,165,85,90,85,85,165,85,85,91,85,90,85,181,91,91,91,91,91,91,181,187,91,187,181,187,187,91,187,187,187,107,187,107,187,107,182,182,182,182,182,182,198,107,102,107,102,102,102,198,102,108,102,108,102,102,198,108,102,198,198,108,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,90,85,165,90,85,165,85,165,85,90,85,85,85,165,85,91,85,181,91,85,181,181,181,181,181,187,91,181,187,187,91,187,187,187,187,187,187,107,187,107,182,182,187,107,107,107,102,182,107,102,107,102,108,102,102,108,102,102,108,102,108,102,108,102,198,108,108,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,85,165,90,85,165,85,165,85,90,85,85,85,165,85,85,85,181,91,85,181,181,181,181,181,187,91,181,187,181,187,187,187,187,187,187,182,187,187,107,187,107,182,182,182,182,182,182,107,102,182,102,107,102,102,102,102,108,102,102,108,102,108,102,198,108,108,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,90,85,165,85,165,85,90,85,85,85,165,85,85,85,181,85,91,85,181,91,85,181,181,181,187,91,181,187,181,187,187,187,187,187,187,187,107,187,107,182,187,107,107,107,107,102,182,107,102,107,102,102,102,108,102,102,102,198,102,108,102,108,102,198,108,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,85,165,85,165,85,90,85,85,85,165,85,85,85,85,85,181,91,85,181,91,91,91,91,181,181,187,91,187,181,187,187,187,187,187,187,107,187,182,187,182,187,107,107,107,107,102,182,107,102,102,182,102,102,102,102,102,198,102,102,108,102,108,102,108,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,85,165,85,165,85,85,90,85,85,85,85,85,85,181,85,91,85,181,91,91,91,91,91,181,187,91,181,187,187,187,187,187,187,187,187,182,187,182,187,107,107,107,107,107,102,182,107,102,102,182,102,102,102,102,102,102,102,198,102,108,102,108,102,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,85,90,85,85,90,85,85,85,85,85,85,85,85,85,181,85,181,91,91,85,181,181,181,187,91,181,187,187,181,187,187,187,187,187,107,187,182,187,107,182,187,107,107,107,102,182,102,182,102,102,102,182,102,102,102,102,198,102,102,102,198,102,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,85,85,165,85,85,85,85,85,85,85,85,85,181,85,181,85,181,91,91,91,91,91,91,181,187,181,187,187,187,187,187,187,187,187,107,187,107,182,187,107,107,107,107,102,182,107,102,107,102,102,102,102,102,102,102,102,102,108,102,102,198,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,245,85,85,85,90,85,85,85,85,85,85,85,85,181,85,181,91,91,91,91,91,91,181,187,91,187,181,187,187,187,187,187,187,107,187,182,187,182,182,187,107,107,107,102,182,107,102,102,107,102,102,102,102,102,102,102,102,102,108,102,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,85,85,165,85,85,85,85,85,85,85,85,181,85,91,85,91,91,85,181,181,181,187,91,187,91,187,187,187,187,187,187,187,187,107,187,107,182,187,107,107,107,107,102,182,107,102,107,102,102,102,102,102,102,102,102,102,108,102,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,85,85,85,85,85,85,85,85,85,85,85,91,85,91,91,85,181,181,181,187,91,181,187,181,187,187,91,187,187,187,187,101,107,187,107,182,187,107,107,107,107,102,182,107,102,102,102,102,102,102,102,102,102,102,102,102,102,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,245,85,85,85,85,85,85,85,85,85,91,85,91,85,181,91,91,91,91,91,181,187,91,187,181,187,187,187,187,187,187,107,187,107,187,107,182,182,182,182,182,182,107,102,107,102,107,102,102,102,102,102,102,102,102,102,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,85,85,85,85,85,85,85,85,85,85,181,85,181,91,91,91,91,91,91,181,187,91,187,187,187,187,187,187,187,187,187,101,107,182,187,107,182,182,182,182,107,102,182,102,182,102,102,102,102,102,102,102,102,102,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,245,85,85,85,85,85,85,85,85,181,85,181,91,85,181,91,91,91,91,181,187,181,187,91,187,181,101,187,187,107,187,101,107,182,187,107,107,107,107,107,102,182,107,102,102,182,102,102,102,102,102,102,102,102,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,245,85,85,85,85,85,85,85,85,181,85,91,85,181,181,181,181,187,91,181,187,187,91,187,187,187,187,187,187,187,107,187,107,182,187,107,107,107,107,102,182,107,102,182,102,102,102,102,102,102,102,102,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,245,85,85,85,85,85,85,85,181,91,85,181,181,181,181,181,187,91,181,187,91,187,187,86,91,187,187,107,187,187,107,182,187,107,107,182,182,182,182,107,102,182,102,102,102,182,102,102,102,102,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,85,85,85,85,85,85,181,85,91,85,181,91,85,181,181,187,91,181,187,181,187,187,187,187,187,187,187,182,187,182,187,182,187,107,107,107,102,182,182,102,182,102,107,102,102,102,102,102,111,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,85,85,85,85,85,85,181,85,181,91,91,91,91,91,91,181,187,91,187,181,187,187,187,187,187,182,86,187,187,107,182,187,107,107,107,107,102,182,107,102,107,102,102,102,102,102,111,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,85,85,85,85,181,85,181,91,85,181,91,91,91,181,181,187,91,187,181,101,187,187,187,187,187,187,107,187,107,182,187,107,107,107,107,102,182,107,102,102,102,182,102,102,111,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,85,85,85,85,181,85,91,85,181,181,181,181,181,187,91,187,91,187,187,187,187,187,187,187,101,107,187,107,182,187,107,107,107,107,102,182,107,102,182,102,102,102,111,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,85,85,85,181,91,85,181,181,181,181,181,187,91,181,187,181,187,187,91,187,187,187,187,101,107,182,187,182,182,187,107,107,107,102,182,107,102,102,182,102,111,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,85,85,91,85,91,85,181,91,91,91,91,181,187,91,187,181,187,187,187,187,187,187,101,107,187,107,182,187,107,107,107,107,102,182,107,102,102,182,111,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,245,85,91,85,181,91,91,91,91,181,181,187,181,187,187,187,187,187,187,187,187,101,107,182,187,107,182,182,182,182,182,182,107,102,182,102,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,245,85,91,91,91,91,91,91,91,181,187,91,187,91,187,181,101,187,187,101,107,187,107,187,107,182,182,182,182,182,107,102,182,102,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,85,85,181,91,91,91,91,181,187,91,187,187,91,187,187,187,187,187,107,187,182,187,107,182,182,182,182,182,182,182,111,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,245,181,91,91,91,181,187,91,187,91,187,187,187,187,187,187,187,187,107,187,107,182,187,107,182,182,182,102,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,245,181,181,181,187,91,181,187,181,187,187,187,187,187,182,187,187,107,187,107,182,182,182,182,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,245,181,187,91,181,187,187,187,181,101,187,187,187,182,187,187,107,182,182,182,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,251,187,181,187,187,187,187,187,187,187,187,187,107,182,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,}; + +const unsigned char Executor::color_wheel_bits_8[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,8,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,3,8,3,8,8,3,8,8,3,8,8,8,8,8,3,2,3,8,8,8,8,8,8,8,2,3,2,8,8,8,2,8,8,2,8,8,2,8,2,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,2,8,2,8,8,2,8,2,8,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,3,2,3,2,3,2,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,8,3,2,3,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,2,8,2,2,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,3,3,3,8,3,3,3,8,3,8,3,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,3,2,3,2,3,2,8,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,8,2,8,2,8,2,8,2,2,8,2,2,2,8,2,2,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,8,3,8,8,8,8,3,2,3,2,3,2,3,2,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,8,2,2,8,2,2,2,8,2,2,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,3,2,3,8,8,8,8,8,2,8,8,8,8,2,3,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,8,2,2,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,3,2,3,2,3,2,8,8,8,8,8,8,8,2,3,2,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,8,3,2,3,2,3,8,8,8,8,8,8,2,3,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,2,2,8,2,2,2,2,2,2,2,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,3,2,3,2,8,8,8,8,8,2,3,2,8,8,2,8,8,8,2,8,2,8,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,3,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,2,3,8,8,8,8,8,8,8,8,8,8,2,3,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,3,2,8,8,2,8,8,8,2,8,2,8,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,2,3,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,2,8,8,2,8,2,8,2,2,8,2,8,2,2,2,8,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,3,3,3,3,9,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,7,2,2,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,3,9,3,3,3,3,3,3,3,9,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,8,3,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,2,8,2,8,2,8,2,2,8,2,2,2,8,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,7,2,2,2,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,9,3,3,3,3,9,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,8,2,8,2,8,2,2,8,2,2,8,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,7,2,2,2,2,2,7,2,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,9,3,3,3,9,3,3,3,3,3,9,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,2,8,2,8,2,8,2,2,8,2,2,2,8,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,7,2,2,2,7,2,2,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,3,3,9,3,3,3,3,9,3,3,3,3,3,3,9,3,3,3,3,3,3,3,3,3,9,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,7,2,2,2,2,7,2,2,2,7,2,2,2,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,3,9,3,3,9,3,3,3,9,3,3,3,3,9,3,3,3,3,3,3,3,9,3,3,3,3,3,3,8,3,3,3,8,3,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,2,8,2,2,2,2,2,2,2,2,2,2,2,2,2,7,2,2,2,2,2,7,2,2,2,7,2,2,2,7,2,2,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,9,3,3,3,3,9,3,3,3,3,3,3,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,3,8,3,8,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,8,2,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,2,8,2,2,2,2,2,2,2,7,2,2,2,2,7,2,2,2,7,2,2,7,2,2,7,2,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,9,3,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,3,3,3,9,3,3,3,3,3,9,3,3,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,2,2,2,7,2,2,2,7,2,2,2,2,7,2,2,2,7,2,2,7,2,2,7,2,2,7,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,9,3,3,3,3,3,3,9,3,3,3,3,8,3,3,3,8,3,3,8,3,3,8,3,8,3,8,3,8,3,8,8,3,8,8,3,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,8,2,2,2,2,7,2,2,2,2,2,2,2,7,2,2,2,2,7,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,9,3,9,3,9,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,3,9,3,3,3,3,3,3,3,8,3,3,3,9,3,8,3,3,8,3,9,3,8,3,8,3,8,8,3,8,3,8,8,3,8,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,2,7,2,2,2,2,2,8,2,2,7,2,2,2,7,2,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,9,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,9,3,3,3,9,3,8,3,3,8,3,3,8,3,8,3,8,3,8,3,8,3,8,8,3,8,8,8,3,8,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,2,8,2,2,8,2,2,7,2,2,2,8,2,2,2,7,2,2,2,2,7,2,2,2,7,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,3,9,3,3,3,3,8,3,3,3,8,3,3,8,3,9,3,8,3,8,3,8,3,13,3,8,8,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,8,2,8,2,8,2,8,2,8,2,8,2,7,2,8,2,2,2,8,2,2,2,7,2,2,2,2,7,2,2,2,7,2,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,9,3,3,9,3,3,9,3,3,3,9,3,3,3,9,3,3,3,3,9,3,3,8,3,9,3,8,3,8,3,8,3,13,3,8,3,8,3,8,8,3,8,8,3,8,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,2,8,2,8,2,8,2,7,2,8,2,2,8,2,2,7,2,2,2,8,2,2,7,2,2,7,2,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,3,9,3,3,8,3,3,9,3,8,3,3,8,3,9,3,8,3,8,3,8,3,13,3,8,8,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,8,2,8,8,2,8,8,2,8,2,8,7,8,2,8,2,8,2,2,8,2,7,2,2,8,2,2,7,2,2,2,7,2,2,2,7,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,3,9,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,9,3,3,9,3,3,9,3,3,3,9,3,3,8,3,3,9,3,3,8,3,3,13,3,3,8,3,13,3,8,3,13,3,8,3,8,8,3,8,8,9,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,8,2,8,8,2,8,7,2,8,2,8,2,7,2,8,2,2,13,2,2,2,7,2,2,13,2,2,2,7,2,2,7,2,2,7,2,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,2,7,7,2,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,3,9,9,3,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,3,9,3,3,9,3,3,9,3,3,3,9,3,3,8,3,3,13,3,3,8,3,9,3,8,3,8,3,8,3,13,3,8,8,3,13,3,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,8,2,8,8,8,2,8,7,8,2,8,2,8,2,13,2,8,2,2,13,2,2,2,8,2,2,13,2,2,2,7,2,2,7,2,2,7,2,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,2,7,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,3,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,3,9,3,3,9,3,3,9,3,3,8,3,9,3,3,3,13,3,3,8,3,13,3,3,13,3,8,3,8,8,3,13,3,8,8,8,3,8,8,8,8,8,8,8,8,3,8,8,8,8,8,8,8,8,8,8,8,2,8,8,8,2,8,7,8,2,8,2,13,2,8,2,8,2,7,2,8,2,2,13,2,2,7,2,2,7,2,2,13,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,7,2,7,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,3,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,3,9,3,3,9,3,8,3,9,3,3,8,3,3,13,3,3,13,3,3,8,3,13,3,8,3,13,3,8,8,3,8,8,8,9,8,8,8,3,13,8,8,8,8,8,8,8,8,8,8,8,8,8,2,8,8,7,8,8,2,8,8,2,13,2,8,8,2,8,2,13,2,2,8,2,13,2,2,2,8,2,7,2,2,13,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,2,7,7,2,7,7,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,3,9,9,9,3,9,9,3,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,9,3,3,9,3,3,9,3,3,13,3,3,3,13,3,3,8,3,13,3,8,3,8,3,13,3,8,8,3,13,3,8,8,8,3,13,8,8,8,8,8,8,8,8,8,8,8,8,8,7,8,8,8,8,8,2,13,8,2,8,8,2,8,7,8,2,8,2,13,2,2,13,2,2,8,2,7,2,2,13,2,2,7,2,2,7,2,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,3,9,9,9,3,9,9,3,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,3,9,3,8,3,3,9,3,8,3,9,3,8,3,9,3,8,3,13,3,8,3,13,3,8,8,8,3,13,8,8,3,8,8,8,8,8,8,8,8,8,13,8,8,8,8,8,8,8,7,8,8,2,8,8,7,8,2,13,2,8,2,13,2,2,8,2,8,2,7,2,8,2,7,2,2,13,2,2,7,2,8,2,7,2,7,2,7,2,7,2,7,2,2,7,2,7,2,7,2,7,2,7,7,2,7,2,7,7,2,7,7,7,2,7,7,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,3,9,9,9,3,9,9,3,9,9,3,9,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,8,3,9,3,9,3,8,3,13,3,3,13,3,3,13,3,8,3,13,3,8,3,13,3,8,8,9,8,3,8,8,8,13,3,8,8,8,13,3,8,8,8,8,8,8,8,7,8,8,8,8,8,7,8,2,8,8,2,13,2,8,2,13,2,8,2,13,2,2,13,2,2,13,2,2,7,2,8,2,7,2,7,2,7,2,7,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,2,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,9,3,9,9,9,3,4,3,9,9,3,9,9,3,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,3,9,3,9,3,8,3,13,3,3,13,3,3,13,3,8,3,13,3,8,3,13,3,8,8,3,13,3,8,8,13,3,8,8,8,8,13,3,7,8,8,8,8,8,13,8,8,8,8,8,7,8,2,8,13,2,8,13,2,8,8,2,13,2,8,2,13,2,2,8,2,13,2,2,7,2,13,2,2,7,2,13,2,2,7,2,13,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,2,1,2,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,3,9,9,9,9,9,3,9,9,3,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,8,3,9,3,3,13,3,3,9,3,8,3,9,3,8,3,13,3,8,3,13,3,8,8,9,8,8,3,13,8,8,8,8,3,13,8,8,8,8,8,13,8,8,8,8,8,7,8,8,8,8,2,13,8,2,8,8,2,13,2,8,2,13,2,8,2,7,2,8,2,13,2,2,8,2,7,2,13,2,2,7,2,13,2,2,7,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,2,1,2,7,7,7,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,9,9,3,9,9,9,9,3,9,9,9,9,3,9,9,9,3,9,9,3,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,9,3,13,3,3,9,3,8,3,13,3,3,13,3,13,3,8,3,13,3,8,3,13,3,8,8,13,3,8,8,8,9,8,8,8,8,8,13,8,8,8,8,8,8,7,8,8,8,8,7,8,8,2,13,8,2,13,2,8,8,7,2,13,2,8,2,13,2,2,13,2,2,13,2,2,13,2,2,7,2,13,2,2,7,2,7,2,7,2,7,2,7,2,7,7,2,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,2,1,2,7,7,7,2,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,9,3,4,3,9,9,9,9,3,9,9,9,3,9,9,3,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,3,9,3,9,3,9,3,9,3,8,3,9,3,13,3,3,13,3,3,13,3,3,13,3,3,13,3,8,3,13,3,13,3,8,8,9,8,8,3,13,8,8,8,13,3,7,3,8,13,8,8,8,8,8,8,13,2,8,8,13,2,8,8,13,2,8,8,7,2,13,2,8,2,13,2,2,13,2,2,13,2,2,13,2,2,7,2,13,2,7,2,7,2,7,2,7,2,7,7,2,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,2,7,7,7,7,2,7,7,7,7,7,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,9,3,4,3,9,9,9,9,9,3,9,9,9,9,3,9,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,9,3,9,9,3,9,3,9,3,13,3,9,3,9,3,8,3,13,3,3,13,3,8,3,13,3,8,9,3,13,3,8,13,3,8,8,13,3,8,13,3,7,3,13,8,8,8,8,8,8,13,8,8,8,7,8,8,13,2,8,8,13,2,8,8,7,2,13,2,13,2,13,2,8,2,13,2,2,13,2,2,7,2,13,2,7,2,7,2,8,7,2,7,2,7,7,2,7,2,7,7,2,7,2,7,2,7,7,2,7,7,7,2,7,7,7,2,7,7,7,7,2,1,2,7,7,7,7,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,3,9,9,9,3,9,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,3,9,3,9,3,9,8,3,9,3,13,3,3,13,3,9,3,8,3,13,3,3,13,3,8,9,3,13,8,3,13,3,13,8,3,13,8,8,8,13,3,8,8,13,8,8,13,8,8,8,8,8,13,8,8,8,7,8,8,8,2,13,2,13,2,13,2,8,2,13,2,8,2,13,2,2,13,2,2,13,2,7,2,8,2,13,2,7,2,7,2,13,2,7,2,7,2,7,7,2,7,2,7,7,2,7,7,7,2,7,7,7,2,7,7,7,7,2,1,2,7,7,7,7,7,7,7,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,9,9,9,9,9,3,9,9,9,9,9,9,3,4,3,9,9,9,3,9,9,9,3,9,9,9,3,9,9,3,9,3,9,9,3,9,9,3,9,8,3,9,3,9,3,13,3,9,3,8,9,3,13,3,13,3,3,13,3,8,13,3,8,9,8,8,3,13,8,3,13,8,8,3,13,8,8,8,13,8,8,8,8,8,13,8,8,7,8,8,8,7,8,8,13,2,13,2,8,8,8,7,8,2,13,2,13,2,2,13,2,7,2,13,2,2,13,2,7,2,7,2,13,2,7,2,7,2,7,7,2,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,7,2,1,2,7,7,7,7,7,7,7,7,7,7,7,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,9,9,9,9,9,9,9,9,9,9,3,4,3,9,9,9,3,4,3,9,9,9,3,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,9,3,9,9,3,13,3,9,3,13,3,3,13,3,9,3,13,3,3,13,3,8,9,3,13,3,13,3,13,3,7,3,13,8,8,8,13,3,7,8,9,8,8,8,13,8,8,8,8,7,8,13,8,8,2,13,8,2,13,8,2,13,2,13,2,8,2,13,2,13,2,2,13,2,2,13,2,7,2,13,2,7,2,7,2,13,2,7,7,2,7,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,7,2,1,2,7,7,7,7,7,7,7,7,2,1,2,7,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,9,9,9,9,9,9,9,9,9,9,9,3,4,3,9,9,9,9,9,3,9,9,9,3,9,9,9,3,9,9,3,9,9,3,9,9,3,9,3,9,9,3,13,3,9,3,13,3,9,3,13,3,3,13,3,8,3,13,3,13,3,13,3,13,3,13,3,7,3,13,8,3,13,8,3,13,8,8,8,13,8,8,8,13,8,8,7,8,13,8,8,8,7,8,8,13,2,8,13,2,13,2,8,7,8,2,13,2,13,2,2,13,2,7,2,13,2,2,13,2,7,2,13,2,7,2,7,7,2,7,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,7,2,7,7,7,7,7,7,7,7,2,1,2,7,7,7,7,7,7,7,7,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,3,9,9,9,3,9,9,9,3,9,9,9,3,9,9,3,9,9,3,9,8,9,3,9,3,13,3,9,3,13,3,9,3,13,3,3,13,3,13,3,8,3,13,3,13,3,13,8,3,13,8,8,13,3,8,13,8,8,8,13,8,8,8,13,8,8,8,8,13,8,8,7,8,8,13,2,8,13,2,8,7,8,2,13,2,13,2,13,2,2,13,2,13,2,7,2,13,2,7,2,13,2,7,7,2,7,7,2,13,2,7,2,7,7,2,7,7,2,7,7,7,2,7,7,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,4,3,9,9,9,9,9,9,9,3,9,9,9,9,3,9,9,9,3,9,9,3,9,9,3,9,9,3,9,8,9,3,9,9,3,13,3,9,3,13,3,13,3,9,8,3,13,3,13,3,13,3,13,3,8,13,3,8,13,3,13,8,8,8,13,8,8,9,8,13,8,8,8,13,8,8,7,8,8,13,2,13,2,13,2,13,2,13,2,13,2,13,2,13,2,7,8,2,13,2,7,2,13,2,7,2,13,2,7,7,2,13,2,7,7,2,7,7,2,7,7,7,2,7,7,7,2,7,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,3,9,9,9,9,3,9,9,3,9,9,9,3,9,9,8,9,3,9,9,3,13,3,9,8,3,13,3,13,3,9,3,13,3,13,3,3,13,3,13,3,13,8,3,13,8,8,13,3,8,13,8,8,9,8,13,8,8,8,13,8,8,7,8,13,8,8,7,8,8,13,2,13,8,8,2,13,2,13,2,13,2,8,2,13,2,7,2,13,2,13,2,7,8,2,13,2,7,7,2,13,2,7,7,2,7,7,7,2,7,7,7,2,7,7,7,7,2,7,7,7,7,7,7,7,7,2,1,2,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,9,9,9,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,3,4,3,9,9,9,9,9,9,3,9,9,9,3,9,9,9,3,9,9,9,3,9,9,3,9,9,8,3,13,3,9,9,3,13,3,9,8,3,13,3,13,3,13,3,13,3,13,3,8,13,3,13,8,3,13,8,8,13,3,13,8,8,13,8,8,13,8,8,13,8,8,13,8,8,7,8,13,2,9,2,13,2,13,8,2,13,2,13,2,13,2,13,2,13,2,13,2,7,2,13,2,7,7,2,13,2,7,7,2,7,7,7,2,13,2,7,7,2,7,7,7,2,7,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,4,9,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,9,3,9,9,9,9,3,9,9,9,3,9,9,8,9,3,9,13,3,9,13,3,9,8,9,3,13,3,13,3,3,13,3,13,3,13,3,13,8,3,13,8,8,9,8,13,3,7,9,8,8,13,8,8,13,8,8,13,8,8,7,8,13,8,8,13,2,13,2,13,8,2,13,2,13,2,13,2,8,2,13,2,13,2,7,8,7,2,13,2,13,2,7,7,2,13,7,2,7,7,8,7,7,2,7,7,7,7,2,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,7,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,4,3,9,9,9,9,3,9,9,9,9,3,9,9,9,3,9,9,8,9,3,10,3,9,8,9,3,13,3,9,13,3,13,3,9,8,9,3,13,3,13,3,13,3,13,8,3,13,8,9,8,13,3,13,8,8,13,8,8,13,8,8,13,8,8,13,8,8,7,8,13,2,13,8,8,7,8,13,2,13,2,13,2,13,2,13,2,13,2,7,8,7,2,13,2,13,2,7,7,8,7,2,13,7,2,7,7,7,2,7,7,7,7,2,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,9,4,9,9,9,9,4,9,9,9,9,9,9,4,3,4,3,4,3,4,3,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,3,9,9,9,9,3,9,9,8,9,9,3,13,3,13,9,3,13,3,13,3,13,3,13,3,13,3,13,3,13,3,13,8,3,13,8,13,3,13,8,8,13,3,13,8,13,8,8,13,8,8,13,8,7,8,13,8,8,13,8,7,8,13,2,13,2,13,2,13,2,13,2,13,2,7,8,2,13,2,13,2,7,13,2,13,2,7,13,2,7,7,7,2,13,7,2,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,7,7,1,7,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,4,9,9,9,4,9,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,9,3,9,9,9,9,3,9,9,8,9,9,3,13,9,3,13,3,9,9,8,9,3,13,3,13,3,13,3,13,3,13,3,13,3,13,8,9,8,13,3,13,8,13,3,7,13,3,13,8,8,13,8,8,13,8,13,8,8,13,8,7,8,13,2,13,2,13,8,2,13,8,2,13,2,13,2,13,2,13,2,7,13,2,7,13,2,7,7,2,13,7,2,13,7,2,7,7,7,7,7,2,12,2,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,1,7,7,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,4,9,9,9,9,4,9,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,3,9,9,9,9,9,3,13,9,3,13,9,9,3,13,9,3,13,3,13,3,13,3,13,3,13,3,13,3,13,3,13,8,3,13,8,13,3,13,8,13,3,13,8,13,8,8,13,8,13,8,8,7,13,8,8,7,8,13,2,13,8,8,7,13,2,13,2,13,2,13,2,13,2,7,13,2,13,2,13,2,7,13,2,13,7,2,7,7,7,7,7,2,13,7,2,12,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,7,1,7,7,7,1,7,7,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,4,9,9,4,9,9,9,9,9,4,9,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,8,9,9,9,3,13,9,3,9,13,3,9,13,3,13,3,13,9,3,13,9,3,13,3,13,3,13,3,13,8,13,3,13,8,13,3,13,8,13,8,8,13,8,13,8,8,13,8,13,8,8,13,8,7,8,13,8,7,8,13,2,13,2,13,2,13,2,13,2,13,2,13,2,7,13,2,13,7,2,13,7,2,7,13,2,7,7,7,13,2,7,7,7,7,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,7,7,7,1,2,1,7,7,7,1,7,7,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,9,9,4,9,9,9,4,9,9,9,9,4,9,9,9,9,9,9,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,9,9,9,3,9,9,9,8,9,9,9,9,8,9,9,3,13,9,9,3,13,9,3,13,3,13,3,13,3,13,8,9,13,3,13,3,13,8,13,3,13,8,13,8,8,13,8,13,8,8,13,8,13,8,7,8,13,8,13,2,13,8,2,13,8,13,2,13,2,13,2,13,2,13,2,13,7,2,13,7,2,13,7,2,13,7,7,7,7,8,7,7,7,2,12,2,7,7,7,7,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,7,7,7,1,7,7,7,1,7,7,1,7,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,9,4,9,9,4,9,9,9,4,9,9,4,3,4,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,9,8,9,9,3,13,9,3,13,9,3,13,9,3,13,9,8,13,3,13,3,13,3,13,3,13,8,13,3,13,8,13,3,13,8,13,3,13,8,13,8,13,8,13,8,8,13,8,13,8,7,8,13,8,7,13,2,13,2,13,2,13,2,13,2,13,7,13,2,13,2,13,7,2,13,7,7,2,13,7,2,13,7,7,2,13,7,7,7,7,7,7,8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,1,7,7,7,7,1,7,7,7,1,7,7,1,7,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,9,4,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,9,9,9,9,9,9,8,9,9,9,13,3,13,9,9,9,13,3,13,9,3,13,9,3,13,3,13,9,13,3,13,3,13,3,13,13,3,13,8,13,3,13,13,8,13,8,13,8,13,8,13,8,13,8,7,8,13,8,13,8,7,8,13,2,13,8,13,2,13,2,13,13,2,13,2,13,7,2,13,7,2,13,7,7,8,7,7,7,7,2,13,7,7,7,2,13,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,7,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,7,1,7,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,4,9,9,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,8,9,9,9,9,13,3,9,13,3,13,9,3,13,13,3,13,9,13,3,13,3,13,3,13,13,3,13,3,13,8,13,3,13,8,13,8,13,3,13,8,13,8,8,13,8,13,8,13,8,7,13,8,13,2,13,8,13,2,13,2,13,2,13,2,13,7,2,13,7,13,2,13,7,2,13,7,7,13,2,13,7,7,7,2,13,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,7,7,7,1,7,7,7,7,1,7,7,7,1,7,7,7,1,7,7,1,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,4,9,9,9,9,4,9,9,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,8,9,9,9,13,3,9,13,3,13,9,9,3,13,9,13,3,13,3,13,9,3,13,13,3,13,3,13,8,13,3,13,13,3,13,13,8,13,3,13,7,8,13,8,13,8,13,8,13,8,7,13,8,13,2,13,8,13,2,13,2,13,13,2,13,7,13,2,13,7,13,2,13,2,13,7,7,13,2,7,13,2,12,2,13,7,7,7,7,7,7,7,7,7,2,12,2,7,7,7,7,7,7,7,7,7,7,1,2,1,7,7,7,1,2,1,7,7,1,7,7,7,1,7,7,1,7,7,1,7,1,7,7,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,9,4,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,4,3,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,13,3,9,13,9,9,9,9,13,3,13,9,3,13,9,13,3,13,9,13,3,13,3,13,13,3,13,13,3,13,8,13,3,13,8,13,8,13,8,13,8,13,8,13,8,13,8,13,8,7,13,8,13,2,13,13,2,13,7,8,13,2,13,2,13,7,13,2,13,2,13,7,7,13,2,13,7,7,7,8,7,7,7,7,7,13,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,2,1,7,7,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,4,9,9,9,9,4,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,8,9,9,9,9,13,3,9,13,3,13,9,9,13,3,13,9,13,3,13,3,13,9,13,3,13,3,13,3,13,13,3,13,13,8,13,3,13,13,8,13,8,13,8,13,8,13,8,13,7,8,13,8,13,8,7,13,2,13,8,13,2,13,2,13,13,2,13,7,2,13,7,13,2,13,7,7,7,13,2,13,7,7,7,13,2,12,7,7,7,7,7,13,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,7,1,7,7,7,1,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,9,4,9,4,9,9,4,9,4,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,4,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,13,9,9,9,13,3,10,9,8,9,9,13,3,13,9,13,3,13,9,13,3,13,3,13,13,3,13,13,3,13,8,13,3,13,13,8,13,8,13,8,13,8,13,8,13,8,13,13,8,13,7,8,13,2,13,13,2,13,13,2,13,7,13,2,13,7,13,2,13,7,13,2,13,7,7,2,13,7,7,13,7,2,12,7,8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,1,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,1,7,1,7,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,4,9,4,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,13,9,9,9,8,9,9,13,9,9,13,3,13,9,9,13,3,13,9,13,3,13,9,13,3,13,13,3,13,13,3,13,13,8,13,3,13,13,8,13,8,13,13,3,13,7,13,8,13,8,13,8,7,13,8,13,2,13,13,2,13,2,13,13,2,13,7,13,2,13,7,13,2,13,7,7,13,7,7,13,2,12,7,8,7,7,7,7,13,7,7,7,7,7,7,7,7,7,7,7,7,7,1,7,7,7,7,1,7,7,7,7,1,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,1,7,7,1,7,1,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,4,9,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,13,9,9,9,9,13,3,13,9,9,13,9,3,13,9,13,3,13,9,13,3,13,9,13,3,13,8,13,3,13,13,3,13,13,8,13,8,13,3,13,13,8,13,8,13,8,13,7,13,8,13,8,7,13,8,13,2,13,13,2,13,13,2,13,7,13,2,13,7,13,2,13,7,7,13,2,13,7,7,13,7,7,7,13,7,7,7,7,7,7,7,7,7,7,7,12,7,7,7,7,7,7,1,7,7,7,7,1,7,7,1,7,7,7,1,7,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,13,9,9,9,9,13,9,9,13,9,9,13,3,13,9,9,13,9,13,3,13,9,13,3,13,13,3,13,13,3,13,13,3,13,13,8,13,3,13,13,13,8,13,13,8,13,8,13,13,8,13,8,13,7,13,8,13,2,13,13,2,13,7,13,2,13,13,2,13,7,13,2,13,7,13,7,7,13,7,7,13,2,12,7,8,7,7,7,7,13,7,7,7,7,13,7,7,7,7,7,7,7,1,7,7,7,7,1,7,7,1,7,7,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,9,4,9,9,9,9,9,4,9,9,9,13,9,9,9,9,13,9,9,9,13,9,9,9,13,9,9,13,3,13,9,13,9,13,3,13,9,13,9,13,3,13,13,3,13,13,3,13,13,13,3,13,13,8,13,8,13,8,13,13,8,13,7,13,8,13,8,13,7,13,2,13,13,2,13,13,7,13,2,13,7,13,2,13,7,13,7,7,13,2,13,7,7,13,7,7,7,13,7,7,7,7,7,7,13,7,7,7,7,7,12,7,7,7,7,1,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,9,9,9,4,9,9,9,9,13,9,9,9,9,10,9,9,9,13,9,9,9,13,9,9,13,3,13,9,13,9,13,3,13,9,13,9,13,3,13,13,3,13,13,3,13,13,8,13,13,3,13,13,8,13,13,8,13,13,8,13,8,13,13,8,13,7,13,8,13,2,13,13,2,13,13,2,13,13,7,13,2,13,7,13,7,13,2,12,7,13,7,7,13,7,7,7,13,7,7,7,13,7,7,7,7,12,7,7,7,7,7,1,7,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,9,4,9,9,9,4,9,9,9,4,9,9,9,9,9,10,9,9,9,9,10,9,9,13,9,9,9,13,9,9,13,9,9,13,9,13,9,9,13,9,13,9,8,13,9,13,3,13,13,9,13,8,13,3,13,13,3,13,13,13,8,13,8,13,13,8,13,13,8,13,8,13,7,13,8,13,7,13,8,13,7,13,2,13,13,7,13,2,13,7,13,7,13,2,12,13,7,8,7,13,7,7,13,7,7,7,13,7,7,7,7,12,7,7,7,7,7,7,12,7,7,7,7,1,7,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,9,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,9,4,9,4,9,9,4,9,9,9,4,9,9,9,9,9,4,9,9,9,9,10,9,9,9,13,9,9,9,13,9,9,9,13,9,9,13,9,9,13,9,8,9,13,9,13,3,13,9,13,13,3,13,13,3,13,13,9,13,13,3,13,13,13,8,13,13,3,13,13,8,13,13,7,13,8,13,13,8,13,7,13,2,13,13,2,13,13,7,13,2,13,13,7,13,2,13,7,13,7,13,7,7,13,7,7,13,7,7,7,13,7,7,7,7,13,7,7,7,12,7,7,7,7,1,7,7,7,12,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,10,9,9,9,10,9,9,9,13,9,9,9,9,13,4,8,9,13,9,9,13,9,9,13,9,13,9,13,9,8,10,8,13,9,13,9,13,3,13,13,9,13,3,13,13,13,3,13,13,8,13,13,8,13,13,13,8,13,8,13,13,8,13,7,13,8,13,7,13,13,2,13,13,2,13,13,7,13,7,13,7,13,7,13,7,7,13,7,7,13,7,7,13,7,7,7,13,7,7,7,12,7,7,7,7,7,12,7,7,7,7,1,7,7,1,7,7,1,7,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,7,1,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,9,4,9,9,9,4,9,9,9,4,13,9,9,9,9,4,13,9,9,9,10,8,4,13,9,9,13,9,9,13,9,13,9,9,13,9,13,3,13,9,13,9,13,3,13,13,13,3,13,13,13,3,13,13,13,8,13,13,3,12,9,13,8,13,13,7,13,8,13,13,7,13,8,13,7,13,2,13,13,13,7,13,7,13,2,13,13,7,13,7,7,13,7,13,7,7,13,7,7,13,7,7,13,7,7,12,7,7,7,7,13,7,1,7,7,7,12,7,7,1,13,7,1,7,7,1,7,7,1,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,9,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,9,4,13,9,4,9,9,9,10,9,9,9,13,4,8,4,13,9,9,13,9,9,13,9,9,13,9,13,9,13,9,13,9,13,9,13,9,13,13,9,13,13,3,13,13,13,3,13,13,13,3,13,13,13,8,13,13,13,8,13,13,8,13,13,8,13,7,13,8,13,13,2,13,13,7,13,2,13,13,7,13,7,13,7,13,2,13,7,13,7,7,13,7,7,13,7,7,7,12,7,7,13,7,7,7,12,7,7,7,12,7,7,1,13,7,1,7,7,1,7,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,4,9,9,4,9,9,10,9,9,9,4,13,9,9,4,13,9,9,13,4,8,10,9,9,13,9,9,13,9,13,9,9,13,9,9,13,9,13,9,13,8,9,13,13,3,13,13,9,13,13,3,13,13,13,13,8,13,13,13,3,12,13,8,13,13,8,13,13,7,13,8,13,13,2,13,13,13,7,13,13,2,13,13,7,13,7,13,7,13,7,13,7,13,7,7,13,7,7,13,7,12,7,13,7,7,7,12,7,7,7,12,7,7,7,1,13,7,1,7,7,1,7,7,1,13,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,9,4,9,9,10,9,4,9,9,4,13,9,4,13,9,9,9,10,9,9,13,9,9,13,4,13,9,9,13,9,9,13,9,13,9,13,9,13,9,13,9,13,13,9,13,9,13,13,3,13,13,13,13,3,13,13,13,3,13,13,13,8,13,13,13,8,13,13,13,8,13,7,13,13,7,13,13,2,13,13,7,13,13,7,13,7,13,7,13,7,13,7,13,7,13,7,7,13,7,12,7,13,7,7,7,13,7,7,12,7,7,7,13,1,7,7,1,13,7,1,7,7,1,13,1,7,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,9,4,4,4,9,4,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,9,4,9,4,9,9,10,9,9,4,13,9,4,9,9,13,4,9,13,4,13,9,9,13,4,8,10,9,13,9,13,9,9,13,9,13,9,13,9,13,9,13,9,13,13,3,13,13,13,9,13,13,3,13,13,13,13,8,13,13,13,13,8,13,13,13,8,13,7,13,13,8,13,13,7,13,13,7,13,13,2,13,13,7,13,7,13,7,13,7,13,7,13,7,7,13,7,12,7,13,7,7,13,7,7,12,7,7,7,12,7,7,1,13,7,1,13,1,7,7,7,1,13,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,1,7,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,4,4,9,4,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,4,9,10,9,4,9,9,4,13,4,9,9,13,4,9,13,4,9,13,9,9,9,10,9,13,9,9,13,9,9,13,4,13,13,9,13,9,13,9,13,9,13,13,9,13,13,9,13,13,9,13,13,8,13,13,3,11,8,13,13,8,13,13,13,8,13,13,13,8,13,13,7,13,13,8,13,7,13,13,7,13,13,7,13,7,13,13,7,13,7,13,7,13,7,13,7,7,13,7,7,13,7,12,7,7,13,1,13,7,7,1,13,7,1,13,7,7,1,13,1,7,7,1,7,7,1,7,1,13,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,1,7,1,1,1,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,9,4,4,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,4,9,4,9,4,9,4,9,9,4,9,10,9,4,9,13,4,9,9,10,9,9,4,13,9,9,9,10,9,13,4,13,9,9,13,4,13,9,13,9,13,9,13,9,13,9,13,9,13,9,13,13,9,13,13,9,13,8,13,13,9,13,13,13,3,11,8,13,13,13,13,8,13,13,13,8,13,13,7,13,13,8,13,7,13,13,7,13,13,2,13,13,7,13,7,13,7,13,7,13,7,13,7,12,7,13,7,12,7,13,7,7,12,7,13,1,7,7,13,1,7,13,1,7,7,1,13,1,7,7,1,13,1,7,1,13,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,1,7,1,1,1,1,7,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,9,4,4,4,4,9,4,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,9,4,9,4,9,10,4,9,9,4,9,10,9,4,13,4,9,13,4,9,13,4,13,4,8,10,9,9,13,4,13,9,13,4,13,9,13,9,13,4,13,9,13,9,13,13,9,13,9,13,13,9,13,13,9,13,13,3,13,13,13,13,13,8,13,13,13,13,8,13,13,13,13,13,8,13,13,7,13,13,7,13,13,2,11,13,7,13,7,13,13,7,13,7,13,7,13,7,13,7,12,7,13,7,7,13,7,12,7,7,13,1,13,7,7,1,13,7,1,13,1,7,7,1,13,1,7,1,7,7,1,7,1,7,1,7,1,7,1,7,1,1,7,1,1,7,1,1,7,1,1,1,7,1,1,1,1,7,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,9,4,4,4,4,9,4,4,4,9,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,9,10,4,9,9,4,13,4,9,4,13,4,9,13,4,9,13,4,13,9,4,13,9,4,13,9,13,4,13,9,13,9,13,4,13,9,13,9,13,13,9,13,9,13,13,9,13,13,9,13,13,8,13,13,13,9,13,13,13,3,13,13,13,13,13,13,8,13,13,7,13,13,13,7,13,13,13,7,13,13,7,13,13,7,13,7,13,7,13,7,13,7,13,12,7,13,7,13,7,12,7,13,7,12,7,7,13,1,7,13,1,7,13,1,7,7,12,7,1,13,1,7,7,1,13,1,7,1,7,1,12,7,1,1,7,1,7,1,1,7,1,1,7,1,1,1,7,1,1,1,7,1,1,1,1,1,7,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,9,4,4,4,4,9,4,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,9,4,10,4,9,4,9,4,13,4,9,4,13,4,9,13,4,9,13,4,9,9,10,9,9,13,4,13,9,13,4,13,9,13,9,9,13,9,13,9,13,9,13,9,13,13,9,13,13,9,13,13,9,13,13,9,13,13,13,13,3,13,13,13,13,13,13,8,13,13,13,13,13,8,13,13,7,13,13,8,13,13,7,13,13,7,13,13,7,13,13,7,13,7,13,12,7,13,7,13,7,12,7,13,7,12,7,13,1,13,7,1,13,7,1,13,7,1,13,1,7,13,1,7,1,13,1,7,1,7,1,13,1,1,7,1,7,1,7,1,1,7,1,1,7,1,1,1,7,1,1,1,7,1,1,1,1,1,7,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,9,4,4,4,4,9,4,4,4,9,4,4,4,4,9,4,4,9,4,4,9,4,9,4,10,4,9,4,9,4,13,4,9,4,13,4,9,9,4,13,4,9,13,4,13,4,13,4,13,9,4,13,9,13,4,13,9,13,4,13,9,13,4,13,13,9,13,4,13,13,9,13,13,9,13,13,9,13,13,13,9,13,13,13,13,13,13,13,8,13,13,13,13,13,8,13,13,13,7,13,13,13,13,7,13,13,7,13,13,7,13,13,7,13,13,7,13,12,7,13,7,13,7,12,13,7,7,13,1,13,7,13,1,13,7,1,13,7,1,13,1,7,13,1,7,1,13,1,7,1,13,1,7,1,7,1,7,1,13,1,1,7,1,1,7,1,1,7,1,1,7,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,9,4,4,9,4,4,9,4,4,9,4,4,9,4,9,4,13,4,9,4,13,4,9,4,13,4,9,10,9,4,13,4,13,4,8,4,13,9,10,9,13,4,13,9,9,13,4,13,9,13,9,13,4,13,13,9,13,13,9,13,13,9,13,13,9,13,13,13,9,13,13,13,9,13,13,13,13,13,13,8,13,13,13,13,13,13,7,13,13,13,13,7,13,13,13,7,13,13,7,13,13,7,13,12,7,13,7,13,7,13,12,7,13,7,12,13,7,7,12,7,13,1,13,1,13,7,1,13,1,7,13,1,7,1,13,1,7,1,13,1,7,1,13,1,1,7,1,7,1,1,13,1,1,7,1,1,7,1,1,1,7,1,1,1,1,1,1,7,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,9,4,4,4,4,4,4,9,4,4,4,4,9,4,4,4,9,4,4,9,4,10,4,9,4,9,4,10,4,9,4,13,4,9,4,13,4,13,4,13,4,9,13,4,13,4,13,9,4,13,9,13,4,13,9,13,4,13,13,4,13,13,9,13,13,4,13,13,9,13,13,9,13,13,13,9,13,13,13,9,13,13,13,13,8,13,13,13,13,13,13,13,8,13,13,13,13,7,13,13,13,7,13,13,13,7,13,13,7,13,12,8,12,13,7,13,13,7,12,13,7,13,1,13,7,13,1,13,1,13,7,7,1,13,1,13,7,1,13,1,7,13,1,7,1,13,1,7,1,13,1,1,7,1,12,1,7,1,1,7,1,1,7,1,1,1,7,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,9,4,4,4,9,4,4,9,4,4,10,4,9,4,9,4,10,4,13,4,9,4,13,4,9,4,13,4,9,4,13,4,13,4,9,13,4,13,9,4,13,9,13,4,13,4,13,13,4,13,13,9,13,9,13,13,4,13,13,9,13,13,9,13,13,10,13,13,9,13,13,13,13,13,13,9,13,13,13,13,13,8,13,13,13,13,7,13,13,13,13,13,7,13,13,13,7,13,13,7,13,12,13,7,13,7,13,12,7,13,7,12,13,7,13,1,13,1,13,7,1,13,13,1,13,1,13,1,7,13,1,7,1,13,1,7,1,13,1,1,7,1,13,1,1,7,1,7,1,12,1,7,1,1,7,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,7,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,9,4,4,4,4,9,4,4,9,4,10,4,9,4,13,4,4,13,4,9,4,13,4,9,4,13,4,13,4,9,13,4,13,4,9,13,4,13,4,13,9,10,13,9,13,4,13,9,13,4,13,13,4,13,13,9,13,13,9,13,13,4,13,13,13,13,13,9,13,13,13,13,13,13,13,13,8,13,13,13,13,13,13,13,13,13,7,13,13,13,7,13,13,13,7,13,12,13,7,13,13,7,13,12,7,13,7,13,1,13,7,13,1,13,7,13,1,13,1,13,1,13,1,7,13,1,7,12,1,13,1,13,1,7,1,13,1,1,13,1,1,7,1,12,1,7,1,1,13,1,1,1,7,1,1,7,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,4,4,4,9,4,4,4,9,4,4,10,4,9,4,4,13,4,4,9,4,13,4,4,9,10,4,13,4,13,4,9,10,4,13,4,13,4,13,4,13,9,10,9,13,4,13,4,13,13,4,13,13,9,13,4,13,13,13,9,13,10,13,9,13,13,13,13,9,13,13,13,13,13,9,13,13,13,13,13,13,13,13,13,13,13,13,7,13,13,13,13,13,7,13,13,13,7,13,13,7,13,13,1,13,13,7,13,1,13,13,1,13,13,1,13,1,13,1,13,7,13,1,13,1,13,1,13,1,13,1,13,1,13,1,7,1,13,1,1,13,1,1,13,1,1,7,1,12,1,13,1,1,1,7,1,1,1,12,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,9,4,4,10,4,9,4,4,9,4,4,13,4,4,9,4,13,4,4,13,4,9,4,13,4,13,4,9,13,4,13,4,13,4,13,4,13,4,13,9,13,4,13,13,4,13,9,13,4,13,13,9,13,4,13,13,13,4,13,13,13,13,4,7,10,13,13,13,13,13,13,9,13,13,13,13,13,13,13,13,13,13,13,13,7,13,13,13,13,7,13,13,12,13,7,13,13,12,13,7,13,12,13,1,13,13,1,13,7,13,1,13,13,1,13,1,13,1,13,1,13,1,7,13,1,13,1,7,1,13,1,12,7,1,13,1,1,7,1,12,1,7,1,1,7,1,1,13,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,9,4,4,10,4,9,4,4,13,4,4,13,4,4,13,4,9,4,13,4,13,4,9,10,4,13,4,13,4,13,4,13,4,13,9,10,9,13,4,13,13,4,13,4,13,13,13,4,13,13,13,4,13,13,13,13,9,13,13,13,13,9,13,13,13,13,9,13,13,13,13,13,13,13,13,13,13,7,13,13,13,13,13,7,13,13,12,13,13,7,13,13,1,13,13,7,13,1,13,13,1,13,13,1,13,7,13,1,13,1,13,7,1,13,1,13,1,13,1,13,1,7,1,13,1,12,1,13,1,7,1,13,1,1,13,1,1,7,1,13,1,1,13,1,1,1,7,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,10,4,4,9,4,10,4,4,13,4,4,13,4,4,10,9,4,13,4,9,4,13,4,13,4,13,4,13,4,13,4,13,4,13,4,13,13,4,13,4,13,13,4,13,13,4,13,13,4,13,13,13,9,13,13,4,13,13,13,13,4,12,9,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,7,13,13,13,13,12,13,13,7,13,13,1,13,13,1,10,7,13,1,13,13,1,13,13,1,13,1,13,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,7,1,13,1,1,13,1,1,13,1,1,1,13,1,1,1,1,7,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,10,4,4,9,4,4,10,4,13,4,4,13,4,4,9,4,10,4,13,4,4,13,4,13,4,13,4,13,4,13,4,13,4,13,4,13,4,13,4,13,13,4,13,13,4,13,13,4,13,13,13,4,13,13,13,4,13,13,13,13,4,12,9,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,7,13,13,13,13,12,13,13,7,13,13,1,13,13,13,13,1,13,13,1,13,13,1,13,13,1,13,13,1,13,1,13,1,13,1,13,1,13,1,13,1,7,12,1,13,1,7,1,13,1,1,13,1,1,13,1,1,12,1,1,7,1,1,13,1,1,1,12,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,9,4,4,10,4,9,4,4,13,4,4,10,4,13,4,13,4,4,13,4,13,4,10,4,13,4,13,4,13,4,13,4,13,4,13,4,13,13,4,13,4,13,13,4,13,13,4,13,13,13,4,13,13,13,4,13,13,13,13,4,12,13,13,13,13,4,12,13,9,13,13,13,13,13,13,13,13,13,13,13,13,13,12,13,13,7,13,13,1,10,13,1,13,13,13,1,13,13,1,13,13,1,13,13,1,13,1,13,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,12,1,13,1,13,1,1,13,1,1,12,1,7,1,12,1,13,1,1,1,12,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,9,4,4,10,4,4,10,4,13,4,4,10,4,13,4,4,10,4,13,4,10,4,13,4,13,4,13,4,13,4,13,4,13,4,13,4,13,10,9,13,4,13,13,4,13,13,4,13,13,4,13,13,13,4,13,13,13,13,10,13,13,13,13,4,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,13,13,13,13,13,12,13,13,7,13,13,12,13,13,1,13,13,13,1,13,13,1,13,12,13,1,13,1,13,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,12,1,13,1,1,13,1,1,13,1,1,13,1,1,1,12,1,1,7,1,1,12,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,10,4,4,9,4,4,10,4,9,4,10,4,13,4,9,4,13,4,13,4,10,4,13,4,13,4,10,4,13,4,13,4,13,4,13,10,9,13,4,13,10,13,4,13,13,4,13,13,10,13,13,4,13,13,10,13,13,4,13,13,13,13,13,13,13,13,13,10,13,13,13,13,13,13,13,13,13,13,12,13,13,13,13,13,12,13,13,7,13,13,12,13,13,1,13,13,13,1,13,13,1,13,13,1,13,13,1,13,12,13,1,13,1,13,12,1,13,1,13,1,13,1,12,1,13,1,13,1,1,13,1,12,1,7,1,12,1,1,13,1,1,7,1,1,12,1,1,1,13,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,4,10,4,4,9,4,4,10,4,4,13,4,4,13,4,4,13,4,10,4,13,4,10,4,13,4,13,4,10,9,13,4,13,4,13,4,13,10,9,10,13,4,13,13,4,13,13,4,13,13,10,13,4,13,13,13,10,13,13,4,7,13,10,13,13,13,13,10,13,13,13,13,13,13,13,13,13,13,13,13,11,13,13,13,13,13,12,13,13,7,13,13,12,13,13,1,10,7,13,12,13,1,13,13,12,13,12,13,1,13,12,13,1,13,1,13,1,13,12,1,13,1,13,1,13,1,13,1,13,1,12,1,13,1,1,13,1,12,1,13,1,1,12,1,1,13,1,1,1,12,1,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,4,10,4,4,4,10,4,4,10,4,9,4,10,4,4,13,4,4,13,4,10,4,13,4,10,4,13,4,13,4,10,4,13,4,13,4,13,10,4,13,10,9,13,4,13,10,13,4,13,13,10,13,4,13,13,13,4,13,13,10,13,13,13,10,13,13,13,10,13,13,13,13,13,10,13,13,13,13,13,13,11,13,13,13,13,13,12,13,13,13,13,13,12,13,13,12,13,13,13,1,13,13,13,12,13,1,13,13,1,13,13,1,13,12,13,1,13,12,13,1,13,1,13,1,13,1,13,1,13,1,12,1,13,1,12,1,13,1,1,13,1,1,12,1,7,1,12,1,1,12,1,1,13,1,1,1,1,12,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,10,4,4,4,10,4,9,4,10,4,10,4,13,4,4,10,4,13,4,4,13,4,10,4,13,4,13,4,13,4,13,4,13,4,13,10,4,13,10,13,4,13,10,13,4,13,13,4,13,13,10,13,4,12,9,11,13,9,13,10,13,13,13,10,13,13,13,13,10,13,13,13,13,13,13,13,11,13,13,13,13,13,13,13,13,13,12,13,13,13,12,13,13,13,12,13,13,12,13,7,13,12,13,12,13,1,13,13,12,13,1,13,12,13,1,13,1,13,12,1,13,1,13,12,1,13,1,12,13,1,12,1,13,1,12,1,7,1,12,1,13,1,1,12,1,13,1,1,12,1,1,1,12,1,1,1,1,12,1,1,1,1,1,1,12,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,4,10,4,4,10,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,13,4,4,10,4,13,4,10,4,13,4,10,9,4,13,4,10,4,13,4,13,10,10,4,13,10,13,4,13,10,13,4,13,13,4,13,13,10,13,4,13,13,10,13,13,4,13,13,13,10,13,13,13,10,13,13,13,13,10,13,13,13,13,13,11,13,13,13,13,13,13,13,12,13,13,13,13,12,13,13,13,12,13,13,7,13,12,13,13,12,13,1,13,13,12,13,1,13,12,13,1,13,1,13,12,13,1,13,1,13,12,1,13,12,1,13,1,12,7,1,13,1,12,1,13,1,12,1,13,1,1,12,1,13,1,1,12,1,1,12,1,1,12,1,1,12,1,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,10,4,4,4,4,4,4,10,4,4,4,4,10,4,4,10,4,4,10,4,9,4,10,4,10,4,13,4,4,13,4,10,4,13,4,10,10,4,13,4,13,10,4,13,4,13,10,4,13,10,13,4,13,4,13,10,13,10,13,4,13,13,10,13,10,13,13,10,13,10,13,13,10,13,13,13,10,13,13,13,13,13,10,13,13,13,13,13,13,13,11,13,13,13,13,13,6,13,13,13,13,12,13,13,12,13,13,12,13,12,13,7,13,12,13,13,1,13,13,12,13,1,13,13,12,13,1,13,1,13,12,12,13,1,13,1,13,1,13,1,13,1,12,12,7,1,13,1,12,1,13,1,1,13,1,1,12,1,1,12,1,7,1,1,12,1,1,1,12,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,4,4,4,10,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,9,4,10,4,10,4,13,4,4,10,4,13,4,10,4,13,4,10,13,4,13,4,10,13,4,13,10,4,13,10,13,4,13,4,13,10,13,10,13,4,13,10,13,10,13,10,13,4,13,13,13,10,13,13,10,13,13,13,10,13,13,10,13,13,13,11,13,13,13,11,13,13,13,13,13,11,13,13,13,13,12,13,13,13,12,13,13,12,13,13,12,13,13,12,13,12,13,12,13,12,13,1,13,12,13,1,13,12,12,13,1,13,12,1,13,1,13,1,13,12,1,12,13,1,12,1,13,1,12,1,13,1,12,1,12,1,12,1,7,12,1,1,12,1,12,1,1,12,1,1,1,12,1,1,1,12,1,1,1,1,1,1,1,12,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,10,4,4,4,4,10,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,10,4,10,4,10,4,10,4,13,4,10,4,10,9,10,4,13,4,10,4,13,10,4,13,4,10,13,4,13,10,10,9,11,4,13,10,13,4,13,10,13,10,13,4,13,13,13,10,13,10,13,13,10,13,13,10,13,13,13,10,13,13,13,11,13,13,13,10,13,13,13,13,11,13,13,13,12,13,13,13,6,8,11,13,13,12,13,13,12,13,13,12,13,12,13,7,13,12,13,1,13,13,12,13,12,12,13,1,13,12,13,1,13,1,13,12,12,1,13,12,1,13,1,12,13,1,12,1,13,1,12,1,13,1,12,1,7,1,12,1,12,1,1,12,1,1,12,1,1,12,1,1,1,12,1,1,1,1,1,12,1,1,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,4,4,10,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,4,10,4,10,4,4,10,4,9,10,4,10,4,13,4,10,4,13,4,10,10,9,10,4,13,10,10,4,13,10,10,9,10,13,4,13,10,13,4,13,10,13,10,13,4,13,13,10,13,10,13,13,10,13,13,10,13,13,10,13,13,10,13,13,11,13,13,10,13,13,13,11,13,13,13,13,13,11,13,13,13,6,8,11,13,13,12,13,13,12,13,13,12,13,13,12,13,12,13,12,13,12,13,12,13,1,13,12,13,1,13,12,12,13,1,13,12,12,1,13,12,1,13,1,11,1,12,7,12,1,13,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,1,12,1,1,12,1,1,1,1,12,1,1,1,1,1,12,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,10,4,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,4,10,4,10,4,4,10,4,10,4,10,4,10,9,4,10,10,4,13,4,10,10,4,13,10,4,13,4,13,10,10,9,10,13,4,13,10,13,4,13,10,13,10,13,4,13,11,9,11,9,11,9,11,13,10,13,10,13,13,10,13,13,10,13,11,13,13,10,13,13,13,11,13,13,13,13,11,13,13,13,12,13,13,11,13,13,12,13,13,13,12,13,13,12,13,12,13,13,12,13,12,13,12,13,12,13,12,13,12,7,11,1,13,12,13,1,13,12,1,13,12,12,13,1,13,1,12,13,1,12,12,1,13,1,12,12,1,13,1,12,1,13,1,1,12,1,12,1,12,1,12,1,1,12,1,1,1,12,1,1,1,12,1,1,1,1,12,1,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,4,10,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,4,10,4,10,4,10,4,10,4,10,4,13,4,10,4,10,13,4,10,4,13,10,4,13,4,10,10,10,13,4,10,13,4,13,10,10,13,4,11,9,10,13,10,13,10,13,10,13,10,13,10,13,10,13,10,13,13,10,13,13,10,13,11,13,13,10,13,13,13,11,13,13,13,11,13,13,13,13,11,13,13,11,13,13,12,13,13,13,6,13,13,12,13,13,12,13,12,13,12,13,12,13,12,13,12,13,1,13,12,13,12,13,1,13,12,12,13,1,13,12,12,1,13,1,11,1,13,1,12,12,7,12,1,12,12,1,13,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,1,12,1,1,12,1,1,1,12,1,1,12,1,1,1,1,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,9,10,4,10,10,4,13,10,10,4,13,10,4,13,10,10,10,13,4,13,10,10,13,10,13,4,13,10,13,10,13,10,13,10,13,10,13,13,10,13,10,13,13,10,13,13,10,13,13,11,13,13,10,13,13,11,13,13,13,11,13,13,13,13,11,13,13,12,13,6,8,11,13,13,12,13,13,6,13,13,12,13,13,12,13,12,13,12,13,12,13,12,7,12,13,12,12,13,1,13,12,12,12,13,1,13,12,12,1,13,12,1,12,12,7,12,1,13,1,12,1,12,1,13,1,12,1,12,1,12,1,12,1,1,12,1,1,12,1,1,12,1,1,12,1,1,1,1,12,1,1,1,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,4,10,4,4,4,10,4,4,10,4,4,10,4,4,10,4,10,4,4,10,4,10,4,10,4,10,4,10,10,4,10,9,10,4,10,10,4,13,10,4,13,4,11,4,13,10,10,10,9,10,10,13,4,13,10,10,13,4,11,13,10,10,13,10,13,10,13,10,13,10,13,10,13,13,10,13,11,13,10,13,13,11,13,10,13,13,11,13,13,13,11,13,13,13,11,13,13,13,12,13,11,13,13,6,8,11,13,13,12,13,13,12,13,13,12,13,12,13,12,13,12,13,12,7,12,13,12,12,13,12,12,13,1,11,7,12,12,13,1,12,12,13,1,12,12,12,7,12,1,13,1,12,12,1,13,1,12,12,1,12,1,12,1,12,1,12,1,1,12,1,12,1,12,1,1,12,1,1,1,12,1,1,12,1,1,12,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,10,4,4,10,4,4,10,4,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,9,10,4,10,10,4,13,4,10,10,10,10,4,13,10,10,4,13,10,10,13,4,13,10,10,13,10,10,13,10,13,4,13,10,13,10,13,10,13,10,13,10,13,10,13,10,13,10,13,13,11,13,10,13,13,11,13,10,13,11,13,13,13,11,13,13,11,13,13,11,13,13,6,8,11,13,12,13,13,6,13,13,12,13,12,13,12,13,12,13,12,13,12,13,12,13,12,13,12,12,13,1,13,12,12,13,1,12,13,12,1,13,12,12,1,13,1,12,12,12,1,13,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,1,12,1,1,12,1,1,12,1,1,1,12,1,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,10,4,4,4,10,4,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,10,4,10,10,4,13,10,4,10,10,13,4,10,10,13,4,10,13,4,11,10,9,10,10,13,10,10,13,4,11,13,10,10,13,10,13,10,13,10,13,10,13,10,13,11,13,10,13,11,13,10,13,11,13,10,13,13,11,13,13,11,13,13,13,11,13,13,13,11,13,13,12,13,11,13,12,13,13,6,13,13,12,13,6,13,13,12,13,12,13,12,13,12,12,13,12,12,13,12,12,13,12,12,12,13,1,11,1,13,12,12,1,13,12,12,12,1,13,12,1,12,12,1,12,12,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,1,12,1,1,12,1,1,12,1,1,12,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,10,4,4,10,4,4,10,4,10,4,10,4,4,10,4,10,4,4,10,4,10,4,10,4,10,4,10,10,4,10,10,4,10,10,4,10,10,10,9,10,10,4,13,10,10,10,10,13,4,10,13,10,10,10,13,10,10,13,10,10,13,10,13,10,13,10,10,13,10,13,10,13,11,13,10,13,10,13,11,13,10,13,13,11,13,10,13,13,11,13,13,13,11,13,13,11,13,13,12,13,11,13,13,6,13,13,6,8,11,13,12,13,13,12,13,12,13,6,13,12,13,12,13,12,12,13,12,12,13,12,12,7,12,13,12,12,12,12,7,12,12,12,12,12,1,13,12,1,12,12,12,1,13,1,12,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,12,1,1,12,1,1,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,10,4,4,10,4,4,10,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,9,10,10,4,13,10,10,4,13,10,10,10,4,13,10,10,10,13,10,10,13,4,11,9,10,13,10,10,13,10,13,10,13,10,13,11,10,13,10,13,10,13,11,13,10,13,11,13,10,13,13,5,13,13,13,11,13,13,11,13,13,11,13,13,11,13,12,13,13,6,13,13,13,6,13,13,12,13,6,13,13,12,13,12,13,12,13,12,13,12,12,13,12,12,13,12,12,13,12,12,12,13,1,13,12,12,12,12,7,12,12,1,11,1,13,1,12,12,12,1,12,12,1,12,12,1,12,1,12,12,1,12,1,12,1,12,1,1,12,1,12,1,1,12,1,12,1,1,12,1,1,12,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,4,10,4,4,10,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,10,4,10,10,4,10,10,4,10,10,4,13,10,10,4,10,10,10,10,10,13,4,11,10,9,10,10,13,10,10,10,13,10,10,13,10,13,10,10,13,10,13,10,11,13,10,13,10,13,11,13,10,13,5,13,13,10,13,5,7,10,13,11,13,13,5,7,11,13,13,11,13,13,11,13,12,13,11,13,13,6,13,13,12,13,6,13,13,12,13,6,13,12,13,12,13,6,7,13,12,12,13,12,12,13,12,12,13,12,12,12,12,12,13,1,12,12,13,1,11,1,13,12,12,1,12,12,12,1,12,12,1,12,12,1,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,1,12,1,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,4,10,10,10,13,4,10,10,13,4,10,10,13,10,10,10,13,10,10,13,10,10,13,10,10,13,10,11,10,13,10,13,10,13,10,11,13,10,13,5,13,13,10,13,11,13,5,7,5,13,13,11,13,13,13,11,13,13,11,13,13,11,13,11,13,12,13,11,13,12,13,6,13,13,12,13,6,13,13,12,13,12,13,12,13,6,13,12,12,13,12,12,13,12,12,12,13,12,12,7,12,12,12,13,1,11,1,12,12,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,12,1,1,12,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,4,10,10,10,10,4,10,10,10,13,4,10,10,10,10,10,13,10,10,10,10,13,10,10,10,13,10,10,10,13,10,10,13,10,13,10,13,10,11,10,13,10,13,11,10,13,13,5,13,13,5,13,13,5,7,10,13,13,11,13,11,13,13,11,13,11,13,13,11,13,12,13,11,13,6,13,13,6,13,13,6,13,13,12,13,6,13,12,13,6,13,12,13,12,12,13,12,12,13,12,12,13,12,12,12,12,13,12,12,12,12,12,12,12,7,12,12,12,12,1,12,12,12,1,13,12,1,12,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,10,4,10,10,10,10,13,10,10,10,10,10,13,10,10,10,13,10,10,10,13,10,10,13,10,11,10,13,10,11,10,13,10,13,5,13,13,10,11,13,10,13,5,13,13,13,5,13,13,11,13,11,13,13,5,13,13,11,13,12,13,11,13,11,13,12,13,11,13,12,13,6,13,13,12,13,6,13,13,12,13,12,12,13,6,13,12,13,12,12,13,12,12,12,13,12,12,12,12,12,13,12,12,12,7,12,12,12,12,12,1,13,12,12,1,12,12,12,1,12,12,12,1,12,12,1,12,1,12,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,1,12,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,10,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,9,10,10,10,10,13,10,10,10,13,10,10,13,10,11,10,13,10,10,13,10,13,10,11,13,10,13,5,13,10,13,5,13,13,5,13,13,11,13,11,13,13,5,13,13,11,13,13,11,13,11,13,12,13,11,13,11,13,6,13,13,6,13,13,6,13,13,6,13,12,13,6,13,12,13,12,13,12,12,13,6,7,11,12,12,13,12,12,12,13,12,12,12,12,12,12,12,12,12,1,13,12,12,1,12,12,12,12,1,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,4,10,10,10,10,10,10,10,10,9,10,10,10,10,10,13,10,10,10,10,13,10,10,10,10,13,10,10,10,13,10,10,13,10,11,10,13,10,11,13,5,13,10,13,5,13,13,5,13,13,5,13,13,5,13,13,11,13,11,13,13,11,13,11,13,12,10,12,13,11,13,12,13,11,13,6,13,13,6,13,12,13,6,13,12,13,6,13,12,13,6,13,12,12,13,6,7,11,12,12,13,12,12,12,12,12,12,13,12,12,12,12,7,12,12,12,12,12,12,12,12,1,12,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,12,1,12,1,12,1,12,1,12,1,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,13,10,10,10,10,13,10,10,11,10,13,10,10,11,10,13,10,11,10,13,5,13,10,13,5,13,13,5,13,13,5,13,13,5,13,13,11,13,11,13,13,5,13,13,11,13,11,13,12,10,12,13,11,13,11,13,6,13,13,6,13,12,13,6,13,13,6,13,12,13,6,13,12,13,12,12,13,6,13,12,12,13,12,12,12,12,13,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,12,1,12,1,12,1,12,1,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,10,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,13,10,10,10,10,10,10,13,10,10,10,10,13,10,11,10,10,13,10,11,10,13,5,13,10,13,5,13,13,5,13,10,13,5,13,13,11,13,5,13,13,11,13,11,13,11,13,11,13,11,13,11,13,11,13,12,11,13,12,13,6,13,13,6,13,13,6,13,12,13,6,13,12,13,6,13,12,12,13,6,7,11,12,12,12,13,12,12,12,12,12,13,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,1,12,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,4,10,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,13,10,10,10,11,10,13,10,10,11,10,13,10,11,10,13,5,13,10,13,5,13,10,13,5,13,5,13,13,5,13,11,13,11,13,5,13,13,11,13,11,13,11,13,13,11,13,12,13,11,13,11,12,13,11,13,6,13,13,6,13,6,13,12,13,6,13,12,13,6,13,12,13,6,13,12,12,13,6,7,6,13,12,12,12,13,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,13,10,10,10,10,10,13,10,10,11,10,10,10,13,5,13,10,10,13,5,13,10,13,5,13,5,13,13,5,13,11,13,5,13,13,5,13,13,11,13,11,13,5,13,12,10,12,11,13,11,13,11,13,11,12,13,6,13,11,13,6,13,13,6,13,6,13,12,13,6,13,6,13,12,12,13,6,13,12,12,12,13,6,7,11,12,12,12,12,12,12,13,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,1,12,12,12,1,12,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,4,10,4,10,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,10,4,10,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,10,10,10,11,10,10,13,5,13,10,10,11,10,13,5,13,5,13,10,5,13,13,5,13,5,13,5,13,13,5,13,13,11,13,5,13,11,13,11,13,11,13,11,13,11,13,11,12,13,11,13,11,13,6,13,13,6,13,6,13,12,13,6,13,6,13,12,13,6,13,6,13,12,12,12,13,6,13,12,12,12,12,12,12,13,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,12,1,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,1,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,4,10,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,10,10,10,13,10,10,11,10,10,10,13,5,13,10,5,13,10,13,5,13,10,11,13,5,13,5,13,13,5,13,13,5,13,11,13,11,13,11,13,11,13,11,13,11,13,11,13,11,13,11,13,12,11,13,6,13,11,13,6,13,6,13,6,13,6,13,12,13,6,13,6,13,12,12,13,6,12,13,6,12,12,13,6,12,13,6,7,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,1,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,1,12,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,4,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,10,10,10,10,11,10,13,5,13,10,5,13,10,13,5,13,5,13,5,13,5,13,13,5,13,5,13,11,13,5,13,11,13,5,13,11,13,11,13,11,13,11,13,11,13,11,12,13,11,13,11,12,11,13,6,13,6,13,13,6,13,12,11,13,6,13,6,13,12,12,13,6,13,6,13,12,12,12,12,13,6,12,12,12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,12,12,1,12,12,12,12,12,1,12,12,12,1,12,12,12,1,12,12,1,12,1,12,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,4,10,10,4,10,10,4,10,10,10,4,10,10,10,4,10,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,11,10,10,10,13,5,10,13,5,13,10,10,11,10,13,5,13,5,13,5,13,10,13,5,13,5,13,5,13,13,5,13,11,13,5,13,11,13,11,13,11,13,5,13,11,13,11,12,13,11,11,13,11,12,13,11,13,6,13,11,12,13,6,13,6,13,6,13,12,6,13,6,13,12,6,13,12,12,6,13,12,6,13,12,12,12,12,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,1,6,1,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,4,10,10,4,10,10,10,4,10,10,10,4,5,4,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,10,10,10,10,10,10,11,10,10,10,5,13,10,10,5,13,10,5,13,5,13,10,10,5,13,5,13,5,13,5,13,11,10,13,5,13,11,13,5,13,11,13,11,13,5,13,12,11,13,11,13,11,13,11,11,13,12,11,13,6,13,11,12,11,13,6,13,6,13,6,13,6,13,6,13,12,6,13,12,6,13,12,12,6,13,12,12,6,13,12,12,12,6,7,6,12,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,1,12,12,12,1,12,12,1,12,12,1,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,4,10,10,10,4,10,10,10,4,10,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,10,11,10,10,10,5,13,10,10,5,13,10,5,13,10,5,13,5,13,10,5,13,5,13,5,13,5,13,11,13,5,13,11,13,5,13,11,13,11,13,11,13,11,13,11,11,13,11,11,13,11,12,11,13,11,13,6,13,11,12,11,13,6,13,6,13,6,13,6,13,12,6,13,12,6,13,12,6,13,12,6,13,12,12,6,13,12,6,7,6,13,12,12,12,12,6,7,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,12,1,6,1,12,12,12,1,12,12,12,1,12,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,4,10,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,10,10,10,10,10,5,10,10,10,11,10,10,5,13,10,5,13,10,5,13,10,5,13,5,13,5,13,10,11,13,5,13,5,13,5,13,5,13,11,13,5,13,11,13,5,13,11,13,11,11,13,11,13,11,11,13,11,13,11,12,11,13,6,13,11,12,11,13,6,13,6,13,6,13,6,13,6,13,6,13,12,6,13,6,13,12,6,13,12,12,6,13,12,12,12,6,12,12,12,12,12,6,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,1,6,1,12,12,12,1,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,4,10,10,10,4,10,10,10,10,10,10,4,10,10,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,5,4,10,10,5,10,10,10,5,10,10,10,11,10,10,5,13,10,5,13,10,5,13,5,13,10,5,13,5,13,5,13,5,13,5,13,5,13,5,13,11,13,5,13,11,13,5,13,11,13,11,11,13,11,11,13,11,13,11,11,13,11,12,11,13,11,13,6,13,11,6,13,6,13,6,13,6,13,6,13,6,13,12,6,13,6,13,12,6,13,12,6,13,6,7,6,12,12,11,12,12,12,6,13,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,1,6,1,12,12,12,1,12,12,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,4,10,10,10,10,4,10,10,10,10,10,10,10,10,4,5,4,5,10,10,10,10,10,10,10,10,10,10,5,10,10,10,10,5,10,10,10,10,10,10,5,10,10,10,5,13,10,5,13,10,5,13,10,5,10,13,5,10,13,5,13,5,13,5,13,5,13,5,13,5,13,5,13,11,13,5,13,11,13,5,13,11,11,13,11,13,11,11,13,11,11,13,11,12,11,13,11,11,12,11,13,6,13,6,13,6,13,6,13,6,13,6,13,6,13,6,13,6,13,6,12,13,6,12,12,13,6,12,12,12,6,13,12,6,12,12,12,6,12,12,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,1,12,12,12,12,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,4,10,10,10,10,10,10,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,4,10,10,5,10,10,10,10,10,5,10,10,10,5,10,10,11,10,10,10,5,10,13,5,10,10,11,10,5,13,5,13,5,13,5,13,5,13,5,13,5,13,5,13,11,5,13,11,13,5,13,11,11,13,11,11,13,5,12,10,11,13,11,12,11,13,11,11,13,6,13,11,12,11,13,6,13,11,6,13,6,13,6,13,6,13,6,13,6,13,6,12,13,6,12,12,11,12,6,13,6,12,12,12,6,12,12,12,12,12,6,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,12,12,12,1,12,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,10,10,10,5,10,10,10,10,5,10,10,10,10,5,10,10,11,10,5,13,5,10,10,5,13,5,13,5,13,5,10,5,13,5,13,5,13,5,13,5,13,11,5,13,11,13,5,13,11,11,13,5,13,11,11,13,11,11,13,11,11,13,11,12,11,13,11,11,12,11,11,13,6,13,6,13,6,13,6,13,6,13,6,12,11,6,13,6,12,13,6,12,12,6,13,6,12,12,12,6,13,12,6,12,12,6,12,12,12,12,6,12,12,12,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,12,12,1,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,4,5,4,10,10,10,10,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,5,4,5,10,10,10,5,10,10,10,10,5,10,10,10,5,10,10,11,10,5,10,10,5,13,5,10,13,5,13,5,10,5,13,5,13,5,13,5,13,5,11,10,11,5,13,11,5,13,11,13,5,13,11,11,13,5,12,10,11,13,11,11,13,11,11,12,11,13,11,11,12,11,13,6,13,6,13,6,13,11,6,13,6,13,6,13,6,13,6,12,13,6,12,6,13,6,13,6,12,12,11,12,12,6,13,12,6,12,12,12,12,6,12,12,12,12,6,12,12,12,6,1,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,4,5,4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,10,10,10,10,5,10,10,10,10,5,10,10,10,5,10,10,5,10,10,5,13,5,10,10,10,5,13,5,10,5,13,5,13,5,10,11,5,13,5,13,5,13,5,13,5,13,11,5,13,11,11,10,11,13,5,12,10,11,13,11,11,13,11,11,12,11,13,11,11,11,13,11,6,13,11,11,6,13,11,6,13,6,13,6,13,6,13,6,12,6,13,6,13,6,12,11,12,6,13,6,12,12,6,13,6,12,12,6,12,12,6,13,12,6,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,6,1,12,12,12,12,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,4,5,10,10,10,10,5,10,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,10,10,5,13,5,10,5,13,5,13,5,10,5,13,5,13,5,10,5,13,5,11,10,5,13,11,5,13,11,5,13,11,13,5,13,11,11,13,11,11,11,13,11,11,13,11,11,11,13,11,12,11,11,13,6,13,11,6,13,11,6,13,6,13,6,13,6,12,6,13,6,13,6,12,6,13,6,13,6,12,6,13,6,12,12,6,13,12,6,12,12,6,12,12,12,6,12,12,12,6,12,12,12,6,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5,4,5,10,10,10,10,10,5,10,10,10,5,10,10,10,5,10,10,5,10,10,10,5,11,10,5,10,10,11,5,13,5,10,5,13,5,13,5,10,5,13,5,13,5,13,5,13,5,13,5,13,11,5,13,11,11,5,13,11,11,13,5,12,11,13,11,11,11,13,11,11,12,11,11,13,11,11,12,11,11,12,11,13,6,13,6,13,6,11,6,13,6,13,6,12,6,13,6,13,6,12,6,13,6,12,12,6,13,6,12,12,6,12,12,6,12,12,12,6,12,12,12,6,12,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,10,10,4,5,4,10,10,10,10,10,10,10,10,5,10,10,10,10,10,10,5,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,10,5,10,10,5,10,11,10,5,13,5,10,5,13,5,10,5,13,5,11,5,13,5,13,5,13,5,11,10,11,11,5,13,11,5,13,11,13,5,13,11,11,11,13,5,12,11,10,11,12,11,11,13,11,11,11,12,11,11,13,6,13,6,13,6,13,6,11,12,11,6,13,6,13,6,13,6,12,6,13,6,12,6,13,6,12,6,12,12,6,12,12,6,13,6,12,12,6,12,12,6,12,12,12,6,12,12,6,1,6,12,12,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,10,10,10,10,10,10,10,10,10,10,5,10,10,10,10,10,10,5,10,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,10,5,10,10,5,10,11,10,5,10,5,13,5,10,5,13,5,10,5,13,5,13,5,11,5,13,5,11,10,11,5,13,5,13,11,13,5,13,11,11,11,13,5,13,11,11,11,13,11,11,11,13,11,11,11,12,11,11,13,6,11,13,6,13,6,11,11,12,6,13,6,13,6,13,6,6,13,6,6,13,6,12,6,13,6,12,6,13,6,12,6,13,6,12,6,12,12,6,12,12,6,12,12,6,12,12,6,12,12,12,12,6,12,12,12,12,12,12,12,12,12,6,1,6,12,12,12,12,12,12,12,12,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,10,10,10,10,10,10,10,5,4,5,4,5,10,10,10,10,5,10,10,10,5,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,5,10,10,5,10,5,13,5,10,5,13,5,10,5,13,5,11,5,13,5,13,5,11,5,13,5,13,5,13,5,13,5,13,11,5,13,11,5,12,11,11,13,5,12,11,11,13,11,11,11,11,13,11,11,12,11,11,11,13,6,11,13,6,11,13,6,13,6,11,6,13,6,6,13,6,12,6,13,6,6,13,6,12,6,12,6,13,6,12,6,12,12,6,12,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,12,6,12,12,12,6,12,12,12,12,12,12,12,12,12,12,12,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,10,10,10,10,10,10,10,5,4,5,10,10,10,10,5,10,10,10,5,4,5,10,10,5,10,10,5,10,10,5,10,10,5,10,5,10,10,5,10,5,13,5,10,5,10,5,13,5,5,13,5,5,13,5,5,13,5,5,13,5,13,5,11,5,13,5,12,5,13,11,5,13,11,11,11,10,11,11,11,13,11,11,11,11,13,11,11,11,12,11,11,11,13,6,11,13,6,11,12,11,6,13,6,11,12,6,13,6,6,13,6,13,6,6,13,6,12,6,13,6,12,6,12,6,13,6,12,6,12,6,12,12,6,12,6,12,12,6,12,12,6,12,12,6,12,12,12,12,6,1,6,12,12,12,12,6,12,12,12,12,12,12,12,12,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,10,10,10,5,4,5,10,10,10,10,10,5,10,10,10,10,5,10,10,5,10,10,5,10,10,5,10,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,11,10,5,10,5,11,5,13,5,10,5,11,5,13,5,11,5,13,5,13,5,11,11,10,11,5,13,11,11,11,10,11,11,13,11,11,11,11,13,11,11,11,11,11,13,11,11,12,11,11,6,13,11,6,13,6,13,6,11,12,11,6,13,6,13,6,6,13,6,6,13,6,6,13,6,12,6,12,6,13,6,12,6,12,6,12,12,6,12,6,12,12,6,12,12,6,12,12,6,12,12,12,6,12,12,6,1,6,12,12,12,12,12,12,12,12,12,6,1,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,10,10,5,4,5,10,10,10,5,4,5,10,10,5,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,5,10,5,10,10,5,10,5,10,11,5,10,5,10,5,13,5,10,5,13,5,5,13,5,5,13,5,13,5,11,5,13,5,13,5,11,13,5,11,11,13,5,11,13,11,11,11,11,13,5,11,11,13,11,11,11,12,11,11,11,11,13,6,11,13,6,11,11,6,13,6,11,13,6,11,6,13,6,6,13,6,6,13,6,6,12,6,13,6,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,6,12,12,12,6,12,12,12,6,12,12,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,10,10,5,4,5,10,10,10,5,4,5,10,10,10,5,10,10,5,10,10,5,10,10,5,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,13,5,5,10,5,13,5,5,13,5,5,13,5,11,5,13,5,11,5,13,5,11,11,5,13,11,11,5,13,11,11,11,5,13,11,11,11,11,13,11,11,11,11,11,11,12,11,11,11,12,11,6,13,11,6,13,6,11,11,6,13,6,11,6,13,6,6,13,6,6,12,6,13,6,6,12,6,13,6,6,12,6,13,6,12,6,12,6,12,6,12,12,6,12,6,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,12,12,6,1,6,12,12,12,12,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,10,5,10,10,10,10,10,5,10,10,5,10,10,5,10,10,10,5,10,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,11,5,10,5,10,5,11,5,13,5,5,13,5,5,13,5,5,13,5,11,5,13,5,11,13,5,11,11,10,11,11,5,13,11,11,11,11,11,13,11,11,11,11,11,11,12,11,11,11,13,6,11,11,11,6,13,6,11,11,12,11,6,13,6,13,6,6,13,6,6,13,6,6,11,6,12,6,13,6,6,12,6,13,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,6,12,12,12,12,12,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,10,5,4,5,10,10,5,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,11,5,13,5,5,13,5,5,11,5,10,11,5,11,5,13,5,11,10,11,5,13,5,11,11,11,13,5,11,11,11,13,5,11,11,11,11,11,11,13,11,11,11,11,11,11,12,11,11,11,6,13,11,6,13,6,11,6,13,6,11,6,12,6,13,6,6,13,6,6,13,6,6,12,6,11,12,6,12,6,6,12,6,12,6,12,6,12,6,12,12,6,12,6,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,6,12,12,12,6,1,6,12,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,5,10,10,10,10,5,10,10,10,5,10,10,5,10,10,5,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,11,5,10,5,13,5,5,10,5,11,5,10,5,13,5,11,5,13,5,11,5,13,5,11,11,5,13,11,5,11,11,13,5,11,11,11,11,11,13,11,11,11,11,11,11,11,12,11,11,11,11,6,13,11,6,13,6,11,11,6,13,6,11,6,13,6,11,6,13,6,6,11,6,12,6,6,13,6,6,12,6,6,13,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,6,1,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,5,10,10,10,5,10,10,5,10,10,5,10,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,10,5,11,5,10,5,5,13,5,5,13,5,5,11,5,13,5,11,5,13,5,11,5,13,5,11,11,11,5,13,11,11,11,11,11,11,13,5,11,11,11,11,11,11,12,11,11,11,11,12,11,11,6,13,11,6,11,11,12,6,13,6,11,6,13,6,6,11,6,12,6,13,6,6,13,6,6,12,6,11,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,12,6,12,12,6,12,12,6,12,12,12,6,12,12,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,10,5,10,10,5,10,10,5,10,10,5,10,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,10,5,5,10,5,5,13,5,5,5,13,5,5,11,5,13,5,5,13,5,5,13,5,11,5,13,11,5,11,13,5,11,11,11,5,13,11,5,12,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,6,11,11,12,11,6,11,11,6,13,6,11,6,12,11,6,13,6,6,11,6,12,6,6,13,6,6,12,6,6,13,6,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,12,6,12,12,6,12,12,12,6,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,10,5,10,10,10,5,10,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,10,5,5,10,5,5,11,5,10,5,5,13,5,5,11,5,10,5,11,5,11,5,13,5,11,5,13,5,11,11,5,11,11,11,5,13,11,11,5,12,5,11,11,11,11,11,11,13,11,11,11,11,12,11,11,11,6,13,11,6,11,11,6,13,6,11,6,13,6,11,6,11,6,6,13,6,6,12,6,11,6,6,12,6,6,13,6,6,12,6,6,12,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,6,12,12,6,12,12,6,12,12,12,6,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,5,10,10,5,10,10,5,10,5,10,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,10,5,5,10,5,5,10,5,5,11,5,5,10,5,11,5,13,5,5,13,5,5,11,5,13,5,11,5,11,11,10,11,5,13,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,13,11,6,11,11,11,6,13,6,11,11,6,11,6,13,6,6,13,6,6,11,6,12,6,6,13,6,6,13,6,6,12,6,6,12,6,12,6,6,12,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,12,6,12,12,6,12,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,5,10,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,10,5,5,10,5,5,10,5,5,11,5,10,5,5,11,5,5,13,5,5,11,5,11,5,13,5,5,11,11,5,13,5,11,11,5,11,11,11,11,5,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,6,11,11,11,6,13,6,11,6,13,6,11,6,11,6,12,6,11,6,6,13,6,6,6,13,6,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,6,12,12,6,12,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,5,10,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,10,5,5,11,5,10,5,5,11,5,10,5,11,5,5,13,5,11,5,13,5,11,5,11,11,5,13,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,13,6,11,11,6,11,6,11,6,13,6,11,6,11,6,13,6,6,6,13,6,6,6,6,12,6,6,13,6,6,12,6,6,12,6,6,12,6,12,6,6,12,6,6,12,6,12,6,12,6,12,6,12,12,6,12,6,12,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,10,5,10,5,10,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,10,5,5,13,5,5,11,5,5,13,5,5,11,5,13,5,11,5,11,11,5,13,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,6,11,11,11,6,11,11,6,11,12,11,6,11,6,11,6,12,6,11,6,6,11,6,6,12,6,6,11,6,6,12,6,6,6,12,6,6,12,6,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,12,6,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,11,5,5,10,5,5,11,5,5,13,5,5,11,5,13,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,5,11,11,11,11,11,11,11,12,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,13,6,6,11,6,11,6,12,6,11,6,6,13,6,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,10,5,10,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,10,5,5,5,10,5,5,11,5,5,13,5,5,11,5,11,5,11,5,11,5,11,5,13,5,11,11,5,11,11,11,5,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,11,6,11,11,6,13,6,11,6,11,6,11,6,12,6,11,6,6,13,6,6,6,6,12,6,6,11,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,10,5,10,5,10,5,10,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,5,10,5,5,11,5,5,11,5,5,11,5,5,13,5,5,11,5,11,5,13,5,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,13,6,6,11,6,6,11,6,6,11,6,6,6,13,6,6,6,6,12,6,6,6,12,6,6,6,12,6,6,6,12,6,6,12,6,12,6,6,12,6,12,6,12,6,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,10,5,10,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,5,10,5,5,5,5,5,11,5,5,5,13,5,5,11,5,5,11,5,11,5,13,5,11,5,11,5,11,11,5,11,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,11,6,11,11,6,11,11,6,11,6,11,6,13,6,6,11,6,11,6,6,11,6,6,12,6,6,6,6,6,12,6,6,6,6,12,6,6,6,12,6,6,6,12,6,6,12,6,6,12,6,12,6,12,6,12,6,12,6,12,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,10,5,5,10,5,10,5,5,10,5,5,10,5,5,10,5,5,10,5,5,5,5,10,5,5,5,5,5,5,10,5,5,5,5,11,5,5,11,5,5,11,5,11,5,10,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,13,6,6,6,11,6,6,6,6,13,6,6,6,6,12,6,6,6,12,6,6,6,12,6,6,12,6,6,12,6,6,12,6,6,12,6,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,10,5,10,5,5,10,5,10,5,5,10,5,5,10,5,5,5,5,10,5,5,5,5,10,5,5,5,5,5,5,11,5,5,5,10,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,6,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,12,6,6,11,6,6,6,11,6,6,6,6,6,6,12,6,6,6,6,12,6,6,6,12,6,6,6,6,12,6,6,12,6,6,12,6,12,6,6,12,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,10,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,5,10,5,5,5,5,5,5,10,5,5,5,5,11,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,6,11,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,11,6,6,6,12,6,6,6,6,6,12,6,6,6,6,6,12,6,6,6,12,6,6,6,12,6,6,12,6,6,12,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,10,5,5,10,5,5,10,5,5,5,10,5,5,5,5,10,5,5,5,5,5,5,10,5,5,5,5,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,11,6,6,6,6,6,6,6,6,6,12,6,6,6,6,6,12,6,6,6,12,6,6,12,6,6,12,6,12,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,10,5,5,10,5,5,5,10,5,5,5,5,10,5,5,5,5,5,5,10,5,5,5,5,5,5,5,11,5,5,5,5,11,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,11,6,6,6,6,6,6,6,12,6,6,6,6,6,6,12,6,6,6,6,12,6,6,6,12,6,6,12,6,6,12,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,10,5,5,5,10,5,5,5,5,10,5,5,5,5,5,5,10,5,5,5,5,5,5,5,5,5,5,5,11,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,11,5,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,12,6,6,6,6,6,6,12,6,6,6,12,6,6,6,12,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,10,5,5,5,10,5,5,5,5,5,5,10,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,6,6,6,6,12,6,6,6,12,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,10,5,5,5,5,5,10,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,6,11,6,6,6,11,6,6,6,6,6,6,6,11,6,6,6,6,6,6,6,6,6,12,6,6,6,6,6,6,6,12,6,6,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,5,5,10,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,6,6,6,6,12,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,10,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,11,6,11,6,11,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,5,10,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,5,11,5,5,5,11,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,6,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,6,5,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,6,11,6,6,6,11,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,5,6,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,11,5,11,11,5,11,11,11,11,5,6,5,11,11,11,11,6,11,11,11,6,5,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,5,11,5,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,11,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,5,11,11,11,11,11,5,6,5,11,11,11,11,11,6,11,11,11,11,11,6,11,11,6,11,11,6,11,6,11,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,6,6,6,11,6,6,6,6,6,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,5,11,5,5,11,5,5,11,5,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,6,11,6,11,6,6,6,11,6,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,6,5,6,11,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,11,6,6,6,6,6,6,6,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,11,5,5,5,11,5,5,11,5,5,11,5,5,11,5,11,5,11,11,5,11,5,11,11,5,11,11,11,11,5,6,5,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,6,6,11,6,6,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,5,5,11,5,5,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,5,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,11,6,6,6,6,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,6,5,6,11,11,6,11,11,11,6,11,6,11,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,11,6,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,5,11,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,6,5,6,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,6,11,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,5,5,5,5,11,5,5,11,5,5,11,5,11,5,11,5,11,11,5,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,5,6,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,5,5,5,5,11,5,11,5,11,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,5,6,5,11,11,11,11,6,5,6,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,11,6,6,11,6,6,11,6,6,6,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,5,5,5,5,11,5,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,6,11,11,6,11,6,11,6,11,6,11,6,11,6,11,6,6,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,5,11,5,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,6,11,11,6,11,11,6,11,11,6,11,6,11,6,6,6,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,5,11,5,11,5,11,5,11,11,5,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,11,6,11,11,6,11,6,11,6,11,6,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,5,11,5,11,11,5,11,11,5,11,11,11,11,11,11,11,5,6,5,11,11,11,11,11,11,11,6,11,11,11,11,6,11,11,6,11,6,11,6,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,6,11,11,6,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; diff --git a/src/commtool.c b/src/commtool.cpp similarity index 91% rename from src/commtool.c rename to src/commtool.cpp index 6e77b3ed..1067ffcc 100644 --- a/src/commtool.c +++ b/src/commtool.cpp @@ -17,8 +17,10 @@ char ROMlib_rcsid_commtool[] = #include "rsys/string.h" #include "rsys/mman.h" +using namespace Executor; + PUBLIC INTEGER -CRMGetCRMVersion (void) +Executor::CRMGetCRMVersion (void) { INTEGER retval; @@ -29,7 +31,7 @@ CRMGetCRMVersion (void) PRIVATE QHdr commtool_head; PUBLIC QHdrPtr -CRMGetHeader (void) +Executor::CRMGetHeader (void) { QHdrPtr retval; @@ -38,7 +40,7 @@ CRMGetHeader (void) } PUBLIC void -CRMInstall (QElemPtr qp) +Executor::CRMInstall (QElemPtr qp) { virtual_int_state_t block; @@ -58,7 +60,7 @@ CRMInstall (QElemPtr qp) } PUBLIC OSErr -CRMRemove (QElemPtr qp) +Executor::CRMRemove (QElemPtr qp) { OSErr retval; @@ -67,7 +69,7 @@ CRMRemove (QElemPtr qp) } PUBLIC QElemPtr -CRMSearch (QElemPtr qp) +Executor::CRMSearch (QElemPtr qp) { QElemPtr retval; virtual_int_state_t block; @@ -112,7 +114,7 @@ serial_insert (const char *input, const char *output, const char *name) p->ratedSpeed = CLC (19200); p->maxSpeed = CLC (57600); p->reserved = CLC (0); - qp->qLink = CLC (0); + qp->qLink = (QElemPtr)CLC (0); qp->qType = CWC (crmType); qp->crmVersion = CWC (crmRecVersion); qp->crmPrivate = CLC (0); @@ -130,7 +132,7 @@ serial_insert (const char *input, const char *output, const char *name) } PUBLIC CRMErr -InitCRM (void) +Executor::InitCRM (void) { static boolean_t beenhere; CRMErr retval; diff --git a/src/config/front-ends/nextstep/Executor/English.lproj.openstep/.dir3_0.wmd b/src/config/front-ends/nextstep/Executor/English.lproj.openstep/.dir3_0.wmd deleted file mode 100644 index 1375e74a..00000000 --- a/src/config/front-ends/nextstep/Executor/English.lproj.openstep/.dir3_0.wmd +++ /dev/null @@ -1,8 +0,0 @@ -BrowserHeight0 = 438; -ViewerShelf0 = "/ardi/executor/src/config/front-ends/nextstep/Executor/English.lproj"; -BrowserWidth0 = 458; -BrowserView0 = Browser; -BrowserRoot0 = "/ardi/executor/src/config/front-ends/nextstep/Executor/English.lproj"; -BrowserDir0 = "/ardi/executor/src/config/front-ends/nextstep/Executor/English.lproj"; -BrowserTop0 = "250 678"; -BrowserShelfRows0 = 1; diff --git a/src/config/front-ends/nextstep/Executor/English.lproj.openstep/Executor.nib/data.classes b/src/config/front-ends/nextstep/Executor/English.lproj.openstep/Executor.nib/data.classes deleted file mode 100644 index 5cdbc322..00000000 --- a/src/config/front-ends/nextstep/Executor/English.lproj.openstep/Executor.nib/data.classes +++ /dev/null @@ -1,102 +0,0 @@ -"QuickText" = { - ACTIONS = {}; - OUTLETS = {}; - SUPERCLASS = NSView; -}; -"SoundGenerator" = { - ACTIONS = { - "changeAttack:" = id; - "changeDecay:" = id; - "changeFreqMul:" = id; - "changeIndex:" = id; - "changeRatio:" = id; - "changeState:" = id; - "play:" = id; - "showSoundSettings:" = id; - }; - OUTLETS = { - attackInput = id; - attackOutput = id; - decayInput = id; - decayOutput = id; - freqMulInput = id; - freqMulOutput = id; - indexInput = id; - indexOutput = id; - ratioInput = id; - ratioOutput = id; - }; - SUPERCLASS = Object; -}; -"MacAppClass" = { - ACTIONS = { - "displaysettings:" = id; - "mailARDI:" = id; - "modaldone:" = id; - "myregister:" = id; - "printGame:" = id; - "readsettings:" = id; - "savesettings:" = id; - "serialEntered:" = id; - "showInfo:" = id; - }; - OUTLETS = { - commenttext = id; - d0text = id; - deathwindow = id; - debtable = id; - debtext = id; - doneButton = id; - game = id; - gameWindow = id; - myButton = id; - myForm = id; - myMenu = id; - pctext = id; - prefWindow = id; - psltext = id; - registerWindow = id; - registerWindow2 = id; - serialForm = id; - serialText = id; - serialWindow = id; - sigtext = id; - splashScreen = id; - sptext = id; - starpctext = id; - starsptext = id; - }; - SUPERCLASS = NSApplication; -}; -"MacWindow" = { - ACTIONS = {}; - OUTLETS = {}; - SUPERCLASS = NSWindow; -}; -"MacViewClass" = { - ACTIONS = { - "abort:" = id; - "go:" = id; - "gotoFirstLevel:" = id; - "mailARDI:" = id; - "pause:" = id; - "step:" = id; - "stop:" = id; - "unpause:" = id; - }; - OUTLETS = { - addressForm = id; - mailPanel = id; - noteBox = id; - reproBox = id; - ruWindow = id; - softwareForm = id; - statusView = id; - }; - SUPERCLASS = NSView; -}; -"FirstResponder" = { - ACTIONS = {}; - OUTLETS = {}; - CATEGORY = LocalActions; -}; diff --git a/src/config/front-ends/nextstep/Executor/English.lproj.openstep/Executor.nib/objects.nib b/src/config/front-ends/nextstep/Executor/English.lproj.openstep/Executor.nib/objects.nib deleted file mode 100644 index 2ec625d11d6a19a34dcc57facaacc946a96be3cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8891 zcmcgy4QyOhcD`>s6$HFa+2#BpJ^vLTTuKTF-9uu&+Yr9Vq{i{ipZjy}Ip>~p?sv{hw8e1?Mtak? zzLDQCGVY$Vn_lI4O+(4>ot1)cz(CP)?eVa2{RuD9M-wqD=@v|DOgrIe8(a3KGyVDe zKrZb#e#!SVb5LMVVko)Su!@7OF|JkL28>*;)AL$~l6Mqc*S6?=r+V+txMui{{>Gss z_3XleruiiMREsh%+J~Qa>QqzG9(5cJUn2H2bf%mOH4|VYj)X=ua z&J@QD%T1Hs{AWs~vr3}VUbEv2hO6)&u=H7pK&fFKnd8cV-p^p2FWA2@%k;`6pCh*RZMxOVcn`$SciD7T;W9!cb z(_y1V1J2=@v=oo?{TlxRNF3gSbD_3;Y)Wakjb}9eUFuZ#V7jcz_~>X~UnY}@#k{9O z6_C!FNDZBPjI?`LA2158If~tO4N`@Fz9GUOX5hV2$Hs*+8<99GfQ zdFboMj7-tB3;N--qi0PcyGhsYKWr2X-E?%z)-#9GR>sgrF`{5(?4w3u5+lB07xhfq z(jC{#<@7vU)78_ulPMU6b!)abp5Nqq-ev3Kip#yd2-&08LUzMkk*Z|hS%mCE*F<(v zZr@#)?7`k^Av>JBXAvd5S3~yY+PytEcrAqWJza|smNkTHOy=MX*FrXHj4VR-{e{V{ zciBPO0?ITF>LZ$NJ%P zx9GFi#O!0({QuM7SN-F|Sq0MRp^--T1JGA^57mW3psdV;8?VJ+l7n|GVlXeyE;lXe zj^gHi%d#gaF3%pr-m~gZq!U47kMd`rV!BqCA_bRT1PW*(6!2&j1w1#^RDaCJ_ghCS zd!pumpIPK+uAi4k7RSa6oCmeoV9}``)lY8gKWdv+fDW;itXIfmD7QdPyCIG!dOs}x**&6hw1u^AE&HRZ7 zzf69l?iG{urzr9*C7eeP8fHCbTs#~p2qGXQAo`V@ATC~q2411X!fP2Y#tASg3||=6 zo(7_})FK@n7 z@|F`SA<{2afp_VR`BWMeMlMebB>?VG2~?Q>urm-kgvR`Kjjy@7V-;gNR@I8@eR~c@ zj3*5%s}I&#_i7aq2<1QNmk6l?WZ|f+P;TYdU*#*colqsNb+pSdo>ZvB9v#jZX~)pV zZObGS>K-=qDkL4WTmVtW)yLCj4%wfcGx3rJGs@p})3SE0+?ru`J95~ z`Un(SPzrT6`TtqLPB+d*)u4@xqhbT$hMo=9Kt17eXRub;M?~32B+j$itq=*rmcHpeBRb~BK|0z5j*vv^te&kziTD14LsL93g5u;GC8w84l zD3lgpVIjLApNm9zUfT|#aShg#4T?He@(tuIgUVY5D_i^uQs21=(^o3#v;H9M&v3y; zm>+la{gm8R_gb0y+Da02L)Db{F0JVrOf*U+I_qOw7P8M8q93zsA=)@VM{I7EY|nhM zDllpMX^p=?0ZiRPH4zY~1~4sXRa)Bso$(nMe|Y~ay?t@eLee#^vTeP8#4ftZIm-G| z`f3gJ6&h><`8k4ZGJ|SDj)LKavq3Ad@Pvw?utycG26ASedV9|XyQ%jL)vIDz8$xwh zXQ4C-MHECz^>jAqoArcnnR4YIX}HKUk%H3$iZg>Cbn4W~a;C56(@5e*Y(znwNBbay{6&kzs2wU)9I%!eLVQP>N3sP z6q|}n@xRc##)r3dZ_7M#JXLT{6u<^2q1tK>}-*!)lj(E9M$u-N8 z2tMd|fuAja36gK@stv&Eh;2?zT6W$st9WA3b7B76h0cYbg#=b71OImtIIrQ3!&H^> z!l0*@kI=J0OBkJ^q<3t}u$|wZ5247a8-i3>_5Cr*NFH4tq(UMp9Rv(H^l2=r&{Ta^ z;x*=pOfS)-A||T7H3+wPbQGmKRFV2Lep7_hed<(VAK52`J%_9V1x3ZkJ-`$GjCVsd zb*eI=WTE}X4xoVJ2M4OL|2gc5Hzf8ci+c#16!R!Vg$+$ZVZ+@pZ~yxs0z)TcR1q}R z)Qg%^?~*z}YcP>2F*YX+l-W#oQXS-Bh3v?AR;_g{a}k~INN0|W6>Q+2u-x^MUoA8p ztS-ktVKJ)sT8nFTwz{o=<-Y`8<|hm5%{X17s2a-iRF$t&)tI@UCio9o(?;lG<7exl zQ6c&oMI1fPtg@tJhA_V)+I8VIXepbZ>WJ2KkTc@nLhvMZzv%+FCB>G(xt}A|6*-23=Kc|6T)dIDe8V@;)-e@QK**@y#LglOy~cs_TIJrV6_D zAFC5!ILp{@cAfw+N_&QD1c=pV?x9v_Ik4rmJH-)HsEXmYmEPcZfI4d(pD%*Xvai4i zNssv8U{BC#5FCfA)GDVbX%vo{8N>0*^nXgC@QaLZ171+VR7WhfFT;>}czzXxDY4K8 z{Wa0Pu(?V@Mc!YKd;a^7HQ?VQ$FAizdbgQ1Dx8wJ%@w_Ni|VJwhSNo-GB@!#=K>lQ z-153Dzi#eaDPb(Aw28-$i)9_6wM|@}79$4)7Yxjcb!$c3(=Nssf06O`%Goy*b}UfOSac9$)C~q4>eRI-k%n$+XX+N zR{wBX>`#h(N;rA3ah(7|*lKZZTJS$q{lAuMN%8z?aU>;B>U>hR!aBS0*cRd$AVEU=zL01O+1idx3uuARy2Xvv z9xx2K@!G6Di0ws&j+Rr@62A*MEX=_d%kZ{zeqqBGm#cJk`r;B^VoGpOP~yZwqb5zF zuL;C06>`af&=3Y4QZ8QF>O-h_8*L%;knY{;%T`~!SAE&$i*tBc;9H&;L3^!sJMbQ* z3Xd;N;<5EkGiTi7==&xtqu`78(G)JW!xyXZQmvJcx#7L++JSf153~U4LC|<^>I(#1 zmJ>oPfBePGLb(l}Miod>?O{XbiC3`!v~uh);!7_TT0C!=`jB44!G(`qm8pP`ubvEd zATbv107`!}f&T+~$Q+{7u3G+j;sXH4(p5Zm#O$1S)!1G*5weRuQ57HI7dz>myB)-b6SyO@TKYi`LaN zznKbE6qKqYVq`xp>9C-u%&5E{F><`PWxED_+pRQ~U5dzrwN~_$rVio1L74nUY@htF zPvSfIUdeyV?v*Ir9+doF*?zfyK)$?Desrtkf6wlbQ@6;sSIf3m8QUY-SL8eWaylXr zYcuk~?efY7dG0Rx`WngqgZ;L=al7Onu|u+@L#DRMH8)EB0ZU2#Q+B_E*=>>l_7BO6 zH%aidO7eGEQu52}8 zoxHqOu3ITje?g9PN&Yq)mcLvfx7;kbWDm%WW+|7-lbZbb7WsagLl*O6h2b4WJ`gEB15|b1~L@j;Hk)0`APjYESWu)&o??6J z74P^11Q{@)AZV<#P+&NMp*Tv~ss>sQ;ZmSW+dV&^TUX~DDalBXa^Ug1d-vY^-uoW4 z65DRjTF3%w)_HCZ6axUxRhMtv{hC_rvdK&Wkk1eipc;-muQWsE*T=hUP<6ajT52?0 z$1<7Ydm@@g)6~@p^_uIn-f&Gu)piSA*mj94e?vhxbi=YNfZ1EC>(%w^S1zOL{EEo} zXDbI#sQ4ZWd>7+upF4CD*SXJV*zmm?4T$ul*aS2iABAk(>=Jyn1a50a7#f0qNHE`= zV}wNTS45tqrv;;IIQU>J?Ya{(r45Rsfwu99@g?rf%6u!-brpc(a+5LNo1i62QX3;J zUE84P7!8xHdbYo~xG23|#k`3;vE|9!HR|4{3=4CP@Nd)=7CDk}pHHGz{Kj?`^<7KrZOfUPX2|IKP4B;L zT3n+pDr#ZLb>DAqPVFNhPER$Zvv$5i2+Z2HVO%Vi!_!kCy0TIP6iXec5!Od`OAtb$ z0fG6jdAE)@>r?rRV2{Mum%{4pYTf(_MTlkBdHxPccJ+38Aqf171-Rza{)g4Q zX_i@oK5b4K^lquXnOaWxY)C%8oY5GiBz{fv--!?V@qQ;h*pK01*4sH`%9R(`-|R!m z_c6AUM5t^e5A$C*Ud`W}OqbH`a`FdP8ksp1rOb651#0Bg!gqxHdjaLRvb~U9gYR+L zvd`c6oh>mUBND~Ke!SO-Pj=#?emv;M$DMf8iTej}XSY{Eed@b%L`=t%g-;IQMY0dW zWC%Yed)N&*1j&iC*v=d$NAOcJfS1WJoFpUoJ=wvZ$5qFrABPJ!Ha!~jl-5ZLIpuKx zFQo(cL3MdN__%ne7(c+tFQvO<*oK^8=p*zsa}OI;j^M99j}a9a4eE}EKbmywP+&?{ ilcivQV8%jSr|1Y#z9F@n!Xd(9nCcVdS&pKXh~5Cn91=?a diff --git a/src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/1PixelRule_Index.tiff b/src/config/front-ends/nextstep/Executor/English.lproj.openstep/Help/Index.rtfd/1PixelRule_Index.tiff deleted file mode 100644 index 1689417fa75c46d3e638697cf40523e08b2bb58f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1340 zcmebEWzb?^V4h>_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z(fGlJkAP5QIAy__GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z7IWy;+ z?_4+8A(l!s&xJ>cE!(arEu)m`oEkkdd!CwNoCt!H+86IoMI|yU*T42mTPLYR#933sbm2jO_K>E zwO`i|ieG9KU?(%2hjNmq7#G^I(wMH=&l$a$4}h4;(M2)IsFerN`^Q{Ic&>$3Yr&Uj z?TFOglG;OwRzrc&OD(8XE>&a-0gyJ9;c!X4&=N65ElX2MA29`UoyIO1t;;Hz20N6J z=x2S*EiHMhI47_%G-TlJaOuahOR3bz^!SvXil3P>6BHlsHhPUF$r$MG#qT(5o_d^# zB|K`)=X<*F>51ln5o@;mQJH%119BGQ6N5%?A8xYsHw@h0+m8na2Jnz!^y9O0u0t{C zYcTqb4`SoQ&=8&+d0*EHqBMN$82tATFVA{R*G{G8L_}OzSZEP-J@oD*_$~o3Uo8O4 zjvTWo@1AyT;&h@!RqjIwLXlv@VFnZmpTC{{?t7#(GqC~8I`E=UX~UJO`YLk1A<=EA zJt{@6e^lDx_^U{LeO;+fPBEJa5_+0r=3p_$IQFPT38%w)>a>ez+_IC`Q_(q^$1_V@ zP#X_MJV-N(=7@D6K52TaByg5Eq)0vd8tb7w7$i(Nf_hG*gIM^KYZ8ln9Bp6Muf>>t zK$Z0v&Bi~l{MbVB%3-NJJ`~}2d}ucgiLOP)bb)%4Il|?0m^gXdvJexG0tu>s?B zo?33nrjCfkJ~v{CemR*t2#9kBcjMJ_q5av=e)a7QrN@~v>RR~&twh<|sS-Vw+R<#N zB>M~{9Xpcar@aH^M=1w2J_>y!5rztu$aJ-KSyRb#1~iM++9ouG_Jq`)q9~eAQEfA9 z2ha?vRjI+U-iB0LCd1X$>uNPbmpVzUc`BGmI+6SoQhh%{)h$T)s%q#orS@l}5tf$5 zTcB*aq3lVl>D|GV=*kSW3V33%WI-`O-YpGdJX3n~S)(gwG?aXsS@(+->1 z-g#WjKuE#=35mA@y{)fY;&pCt~p0{P)$Wdm)Xs=u}A z-wXWffqx_L?*{(Ei~eTdUkdyOE0;TAuBNx4W5ZnStKU;la}xPcn-h<@n5k zL%sT?CeNtfXukHG&jj diff --git a/src/config/front-ends/nextstep/Executor/English.lproj/.dir3_0.wmd b/src/config/front-ends/nextstep/Executor/English.lproj/.dir3_0.wmd deleted file mode 100644 index 1375e74a..00000000 --- a/src/config/front-ends/nextstep/Executor/English.lproj/.dir3_0.wmd +++ /dev/null @@ -1,8 +0,0 @@ -BrowserHeight0 = 438; -ViewerShelf0 = "/ardi/executor/src/config/front-ends/nextstep/Executor/English.lproj"; -BrowserWidth0 = 458; -BrowserView0 = Browser; -BrowserRoot0 = "/ardi/executor/src/config/front-ends/nextstep/Executor/English.lproj"; -BrowserDir0 = "/ardi/executor/src/config/front-ends/nextstep/Executor/English.lproj"; -BrowserTop0 = "250 678"; -BrowserShelfRows0 = 1; diff --git a/src/config/front-ends/nextstep/Executor/English.lproj/Executor.nib/data.classes b/src/config/front-ends/nextstep/Executor/English.lproj/Executor.nib/data.classes deleted file mode 100644 index 6f4d23ab..00000000 --- a/src/config/front-ends/nextstep/Executor/English.lproj/Executor.nib/data.classes +++ /dev/null @@ -1,98 +0,0 @@ -QuickText = { - SUPERCLASS = View; -}; -FirstResponder = { - ACTIONS = { - }; - SUPERCLASS = Object; -}; -MacWindow = { - SUPERCLASS = Window; -}; -MacViewClass = { - ACTIONS = { - go:; - stop:; - abort:; - mailARDI:; - step:; - unpause:; - pause:; - gotoFirstLevel:; - }; - OUTLETS = { - statusView; - reproBox; - softwareForm; - addressForm; - mailPanel; - noteBox; - ruWindow; - }; - SUPERCLASS = View; -}; -SoundGenerator = { - ACTIONS = { - changeDecay:; - changeRatio:; - showSoundSettings:; - changeState:; - changeAttack:; - changeFreqMul:; - changeIndex:; - play:; - }; - OUTLETS = { - attackOutput; - indexOutput; - decayInput; - freqMulInput; - decayOutput; - attackInput; - freqMulOutput; - indexInput; - ratioOutput; - ratioInput; - }; - SUPERCLASS = Object; -}; -MacAppClass = { - ACTIONS = { - myregister:; - displaysettings:; - printGame:; - savesettings:; - mailARDI:; - modaldone:; - readsettings:; - serialEntered:; - showInfo:; - }; - OUTLETS = { - serialText; - serialWindow; - doneButton; - debtext; - myButton; - game; - debtable; - psltext; - d0text; - myMenu; - starpctext; - registerWindow2; - pctext; - starsptext; - myForm; - sigtext; - splashScreen; - serialForm; - deathwindow; - commenttext; - registerWindow; - sptext; - gameWindow; - prefWindow; - }; - SUPERCLASS = Application; -}; diff --git a/src/config/front-ends/nextstep/Executor/English.lproj/Executor.nib/data.nib b/src/config/front-ends/nextstep/Executor/English.lproj/Executor.nib/data.nib deleted file mode 100644 index 65f8aa635971c7ac7f979da2cd2a6583a081431a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7011 zcmcgxeQX@X6`$Rl&*#gB@g^apUs{SNiNV*i6UUBA={XJ|<|8q20x1}h_1&Jm$=&X; zyBFJ`EtzKa8md-RuZdttO-%Su2m%Tini3iXfe|7@y^Y@d2i-@{N8(Wq1paW&P;i}YZ_TP>mXASjIlYLtJe2!Gn4*m!#4vCL zVdxgi9Drxd2Gh$qcFJ_g-Xhyy449H8ER=>HMWM=rRC(e6A#zX*;B_eBdB`<%qviR^ zUZz;pEOdKI;trf!dn)Ccp4WDWhIf%d zfxZs(@|RU7+7cH0umcAbIAvqvj)x0DFg~s*z$%T08dYYoNIIQJT-Mg+?fy>v;U~re z_6SHIhv)*7{4@!EC1r-!SY{?w7V~HjP?azxsUA@aj0;Us~Yj^mH#F z!DFbQs5GO{#-kvhy4$ox&Nq>jEWU{`4VIpvOr8me*`F2Ys;v zBF!>~j(>?Ni&hG=ELvGHOG(_^3VlUlx+`NEo~dUY+wvV(_xnx#+Cej!#}A#hZ-N?q zJ!@DQ%kI-N;2*jHTQqh!R!X;QJ8!29A7AA?eZcbj^;ABW0Ymww-V5e%g*m(!d;H0# zE+Sw#Fo)3JsL(4pf|`QUlx(B41$eGmtDHfyU#M?UJy?X2kEEl)K%5C}_Z)ckQE)|7 zrAm&HKMD#Q6pw;40>vz_?lR%S(e5NfNCv}0*l{+Z;g;<1x;xV~Mg+)zb zQKTbd<#5TY{l(+x@*rmoB|j5Oa8Nuhm%vUSOi;D3=U0FdV{0nqD2vpE|aX zl0_!{mc3nvO}S>q++o;$Ec*Q@AjM)ruSX0^q`lV^x+`=o#}fUC#kT9Swa7 zL7BkttzNgeGi&sj092}1Ps2Ge1?Mudg#tQqL^>V-@dLt#R8^B6gb(3A0p$V=0@_82 z#}TC4Jh1;yl8f1#Eh(qGzKvd_!shOkn+qor3GkS=f>)wZ$^Z%;5>6eaXMdMg%AW+yH{Ta7aQY0@&38G;6wtY$xYg(?R94BFs*d&=EXvD?;P*;}Q*lR|O0O zuV0tIR-&MYZ1$4a7zt5j`(hCn+ZUH3O$6|%Qn*aKJtc!G1aY_=;*b|l14(<;&IPc1 z=YryC5lJNgeGVaWlfB(`25b;cXkr!`YtBuko!@9?a~Xgkb#E~kRj7IetFBMfCz8n| z!0vi<3yf`#9V`YQKp{IR89@>7Krn)Ac1Z$ZGnkY+P$3c6SgQmG6eEBX_VEXlFQM&d z8L!pH$xDY|?l^$jhp^RXcfPL=;1t~OJg95hZQB_#?4)@f#BxnPtK z^vd8vk$015}B>!@<9vwd`p`qoa2UGHCm5n}ZPvgUpZYS*z z0QRAlgcHACa@v#Zor;IrOK|y;8NE||6+P|4^U(I()lM>>HEmzO;>-(#rd4Iso>tQz zd?xifHbt@jnxaTb-iTa@s=RU&XGzS=n{2ekJ(d0%9XE}47e;$y<{FUh)tDp+}R!j|zdrRt~!zz|hO zi+G!BDb`BR0!VwPSch+`sgi0CZ&MA$Isqqu!;$F#1x$7pGH1n(>mb}jC52gQosl)m zRp#{MwYQkACrIyu9qI`mI>*l@#ddo3P)g zl#WuNbwZ)#I{50yv{f*IcnIs>i8!h_Qh_3ZigNe8741y$ch$j&C#X11dz`_ZC06mU?f zB^|)rA)xp!)QU;N)*+c@GEhNUHuNPr6qTlFH>C2}oai_->^LgmJYC0u04;ZVCnW(T z_ajE(e4So0)M}_l*~(iY-^p%(%Prx(j67IWuE@b^HPu ze`RLIDYN&&7%!saS*o1aB0})Qmd`tOU5As!LcnW`Hbs|3mq(jlJZI1}l%j?zkp+}I zNXae{H#qpb07`z;4ncF3KJhm?F_hE)pNVsOyhwTgb^y@x0i9Jm7CgkEL^}i^-hj{x zw*hBltABz$xJRalM#CXi$$~d2;@VAfg#q;@V$NAsK_+`WVnPL9? zFmGw*qThgAl=n=$dVy=RJ$U&d04f?(@+)>IeWebi+z4$*!I?Lt%4Oy*S+l$YRPq;_ zpeksBnjukPR};d@s!#A{?-$`;FuI*8zds4xZyDSBfeM=?$V{X#O381jdg)0Pu2i;L zurS`Tpe#~m2jo2$dFvvj#$quk1aIG_I{=-!MddkH)IN$bx@Fq3H6nHcZNWS*-wXbq zmp7CX?SVR}J(#_2vmkL@XP^)iGl=H6!AQ61?y!=kS5ZJ#p0D{Nn^QU826U7SLW3jF zkSC^7DG|FR%IF3%T{{E2Rj`SPP8=P!w<9R-EN>;W)=HT(tH_jY0p+jjmnmmYt4y(( zD%i|)s^cTWygA1IJjU0>cEjCj}F6#_VesMzA?sk4)UfrKYfZ< zDg3>6`L!|rmoa{3jNcmLYh!#{KffV%@KU(Ut-paWd57GrwUviW8eD-#ZZa$zgGOs$ zFKY&4btzH8B_~QaxJ23m7a-R`Zvbc0jzhf2`y#kI!|Oc58XKQoD!E)t+H5 zYUAt!ZDV=5Rg1Gvw42KxTeNE!s}fhs+8~>wy+_G?n#*dm5%!3-1oSEDN!VgWySBV$ znYN9EwdX1MDQt|gd0I1sJ>29rY9r)-)7KB!rmH>7nD+U5du?r* z>2hsddALHm4Nfce)Yy1X0k_yw1V_3Us^%tnWvg|rDt#LQ4;zpa?(5(i6fs-+xEK4z z`g>p>Rs9ezZFoyp2j9!&p@sA(R#EcQ(tSd`(LSkOXcP*Jl4o!_fP>*QPCU8P1!gr~ zzcYYf1q=ldYBCk~!3w1bu;6TA!2!{9lx9Ky)sWdI(V@+9kOL|U!9%KZUS`q^Xr$V+ z`XiLE{g%emxOirN$$CwS@xd6KPlh%W#Be*ZT9+Iat#j(RVOey6< zf}4i3L+GTE2Fxz03`7_~_2klL#8eG_g@8>`X)R2SfMi2{PlI0+NsYif_;I!E_$Ihc RWe!~qIfztHC=`Rje*tS1m`(ry diff --git a/src/config/front-ends/nextstep/Executor/English.lproj/Executor.project.nib/data.classes b/src/config/front-ends/nextstep/Executor/English.lproj/Executor.project.nib/data.classes deleted file mode 100644 index 6ab14d71..00000000 --- a/src/config/front-ends/nextstep/Executor/English.lproj/Executor.project.nib/data.classes +++ /dev/null @@ -1,5 +0,0 @@ -FirstResponder = { - ACTIONS = { - }; - SUPERCLASS = Object; -}; diff --git a/src/config/front-ends/nextstep/Executor/English.lproj/Executor.project.nib/data.nib b/src/config/front-ends/nextstep/Executor/English.lproj/Executor.project.nib/data.nib deleted file mode 100644 index 45525504deef2d6fc5bc52fa7d18984df96abe44..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1306 zcmZ`(F>l*O6h2b4WJ`gEB15|b1~L@j;Hk)0`APjYESWu)&o??6J z74P^11Q{@)AZV<#P+&NMp*Tv~ss>sQ;ZmSW+dV&^TUX~DDalBXa^Ug1d-vY^-uoW4 z65DRjTF3%w)_HCZ6axUxRhMtv{hC_rvdK&Wkk1eipc;-muQWsE*T=hUP<6ajT52?0 z$1<7Ydm@@g)6~@p^_uIn-f&Gu)piSA*mj94e?vhxbi=YNfZ1EC>(%w^S1zOL{EEo} zXDbI#sQ4ZWd>7+upF4CD*SXJV*zmm?4T$ul*aS2iABAk(>=Jyn1a50a7#f0qNHE`= zV}wNTS45tqrv;;IIQU>J?Ya{(r45Rsfwu99@g?rf%6u!-brpc(a+5LNo1i62QX3;J zUE84P7!8xHdbYo~xG23|#k`3;vE|9!HR|4{3=4CP@Nd)=7CDk}pHHGz{Kj?`^<7KrZOfUPX2|IKP4B;L zT3n+pDr#ZLb>DAqPVFNhPER$Zvv$5i2+Z2HVO%Vi!_!kCy0TIP6iXec5!Od`OAtb$ z0fG6jdAE)@>r?rRV2{Mum%{4pYTf(_MTlkBdHxPccJ+38Aqf171-Rza{)g4Q zX_i@oK5b4K^lquXnOaWxY)C%8oY5GiBz{fv--!?V@qQ;h*pK01*4sH`%9R(`-|R!m z_c6AUM5t^e5A$C*Ud`W}OqbH`a`FdP8ksp1rOb651#0Bg!gqxHdjaLRvb~U9gYR+L zvd`c6oh>mUBND~Ke!SO-Pj=#?emv;M$DMf8iTej}XSY{Eed@b%L`=t%g-;IQMY0dW zWC%Yed)N&*1j&iC*v=d$NAOcJfS1WJoFpUoJ=wvZ$5qFrABPJ!Ha!~jl-5ZLIpuKx zFQo(cL3MdN__%ne7(c+tFQvO<*oK^8=p*zsa}OI;j^M99j}a9a4eE}EKbmywP+&?{ ilcivQV8%jSr|1Y#z9F@n!Xd(9nCcVdS&pKXh~5Cn91=?a diff --git a/src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/1PixelRule_Index.tiff b/src/config/front-ends/nextstep/Executor/English.lproj/Help/Index.rtfd/1PixelRule_Index.tiff deleted file mode 100644 index 1689417fa75c46d3e638697cf40523e08b2bb58f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1340 zcmebEWzb?^V4h>_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z(fGlJkAP5QIAy__GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z_GGi2thQMeD44x2RVBlc{W=#eL21Z6h5CLH`00kMDz-*u#ixDF; zk~kZb%>+~<$iM>93&b3ZqEK<54n}d9IP+viDF#-E8WsyiX*k<~Q3lCO4TPCM`=&8) zfFakP1_lOo0R|`?N=4v6*yoH4ARl7$IVg1CK4z7IWy;+ z?_4+8A(l!s&xJ>cE!(arEu)m`oEkkdd!CwNoCt!H+86IoMI|yU*T42mTPLYR#933sbm2jO_K>E zwO`i|ieG9KU?(%2hjNmq7#G^I(wMH=&l$a$4}h4;(M2)IsFerN`^Q{Ic&>$3Yr&Uj z?TFOglG;OwRzrc&OD(8XE>&a-0gyJ9;c!X4&=N65ElX2MA29`UoyIO1t;;Hz20N6J z=x2S*EiHMhI47_%G-TlJaOuahOR3bz^!SvXil3P>6BHlsHhPUF$r$MG#qT(5o_d^# zB|K`)=X<*F>51ln5o@;mQJH%119BGQ6N5%?A8xYsHw@h0+m8na2Jnz!^y9O0u0t{C zYcTqb4`SoQ&=8&+d0*EHqBMN$82tATFVA{R*G{G8L_}OzSZEP-J@oD*_$~o3Uo8O4 zjvTWo@1AyT;&h@!RqjIwLXlv@VFnZmpTC{{?t7#(GqC~8I`E=UX~UJO`YLk1A<=EA zJt{@6e^lDx_^U{LeO;+fPBEJa5_+0r=3p_$IQFPT38%w)>a>ez+_IC`Q_(q^$1_V@ zP#X_MJV-N(=7@D6K52TaByg5Eq)0vd8tb7w7$i(Nf_hG*gIM^KYZ8ln9Bp6Muf>>t zK$Z0v&Bi~l{MbVB%3-NJJ`~}2d}ucgiLOP)bb)%4Il|?0m^gXdvJexG0tu>s?B zo?33nrjCfkJ~v{CemR*t2#9kBcjMJ_q5av=e)a7QrN@~v>RR~&twh<|sS-Vw+R<#N zB>M~{9Xpcar@aH^M=1w2J_>y!5rztu$aJ-KSyRb#1~iM++9ouG_Jq`)q9~eAQEfA9 z2ha?vRjI+U-iB0LCd1X$>uNPbmpVzUc`BGmI+6SoQhh%{)h$T)s%q#orS@l}5tf$5 zTcB*aq3lVl>D|GV=*kSW3V33%WI-`O-YpGdJX3n~S)(gwG?aXsS@(+->1 z-g#WjKuE#=35mA@y{)fY;&pCt~p0{P)$Wdm)Xs=u}A z-wXWffqx_L?*{(Ei~eTdUkdyOE0;TAuBNx4W5ZnStKU;la}xPcn-h<@n5k zL%sT?CeNtfXukHG&jj diff --git a/src/config/front-ends/nextstep/Executor/Executor.iconheader b/src/config/front-ends/nextstep/Executor/Executor.iconheader deleted file mode 100644 index 6c6f157f..00000000 --- a/src/config/front-ends/nextstep/Executor/Executor.iconheader +++ /dev/null @@ -1,5 +0,0 @@ -F Executor.app Executor app -F Executor Executor app -S apl Executor docAppl -S msw Executor docMSW -S mxl Executor docXL diff --git a/src/config/front-ends/nextstep/Executor/Makefile.nextstep b/src/config/front-ends/nextstep/Executor/Makefile.nextstep deleted file mode 100644 index 94d56de0..00000000 --- a/src/config/front-ends/nextstep/Executor/Makefile.nextstep +++ /dev/null @@ -1,49 +0,0 @@ -# -# Generated by the NeXT Project Builder. -# -# NOTE: Do NOT change this file -- Project Builder maintains it. -# -# Put all of your customizations in files called Makefile.preamble -# and Makefile.postamble (both optional), and Makefile will include them. -# - -NAME = Executor - -PROJECTVERSION = 1.1 -LANGUAGE = English - -APPICON = Executor.tiff -DOCICONS = docAppl.tiff docMSW.tiff docXL.tiff - -LOCAL_RESOURCES = Executor.nib Executor.project.nib Info.nib Help - -GLOBAL_RESOURCES = 8kfile - -MFILES = Executor_main.m - -OTHERSRCS = Makefile.preamble Makefile Makefile.postamble - - -MAKEFILEDIR = /NextDeveloper/Makefiles/app -MAKEFILE = app.make -INSTALLDIR = $(HOME)/Apps -INSTALLFLAGS = -c -s -m 755 -SOURCEMODE = 444 - -ICONSECTIONS = -sectcreate __ICON app Executor.tiff \ - -sectcreate __ICON docAppl docAppl.tiff \ - -sectcreate __ICON docMSW docMSW.tiff \ - -sectcreate __ICON docXL docXL.tiff - -LIBS = -lexecutor -lgccFAT -lIndexing_s -lkernload -lMedia_s -lNeXT_s -DEBUG_LIBS = $(LIBS) -PROF_LIBS = $(LIBS) - - --include Makefile.preamble - -include $(MAKEFILEDIR)/$(MAKEFILE) - --include Makefile.postamble - --include Makefile.dependencies diff --git a/src/config/front-ends/nextstep/Executor/Makefile.openstep b/src/config/front-ends/nextstep/Executor/Makefile.openstep deleted file mode 100644 index df04e086..00000000 --- a/src/config/front-ends/nextstep/Executor/Makefile.openstep +++ /dev/null @@ -1,54 +0,0 @@ -# -# Generated by the NeXT Project Builder. -# -# NOTE: Do NOT change this file -- Project Builder maintains it. -# -# Put all of your customizations in files called Makefile.preamble -# and Makefile.postamble (both optional), and Makefile will include them. -# - -NAME = Executor - -PROJECTVERSION = 2.6 -PROJECT_TYPE = Application -LANGUAGE = English - -NEXTSTEP_APPICON = Executor.tiff -NEXTSTEP_DOCICONS = docAppl.tiff docMSW.tiff docXL.tiff - -ICONSECTIONS = -sectcreate __ICON app Executor.tiff \ - -sectcreate __ICON docAppl docAppl.tiff \ - -sectcreate __ICON docMSW docMSW.tiff \ - -sectcreate __ICON docXL docXL.tiff - -LOCAL_RESOURCES = Executor.nib Executor.project.nib Info.nib Help - -GLOBAL_RESOURCES = 8kfile - -MFILES = Executor_main.m - -OTHERSRCS = Makefile.preamble Makefile Makefile.postamble - - -MAKEFILEDIR = $(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles -CODE_GEN_STYLE = DYNAMIC -MAKEFILE = app.make -NEXTSTEP_INSTALLDIR = $(HOME)/Apps -WINDOWS_INSTALLDIR = $(HOME)/Apps -PDO_UNIX_INSTALLDIR = $(HOME)/Apps -LIBS = -lexecutor -lgccFAT -lIndexing_s -lkernload -lMedia_s -lNeXT_s -DEBUG_LIBS = $(LIBS) -PROF_LIBS = $(LIBS) - - - - -include $(MAKEFILEDIR)/platform.make - --include Makefile.preamble - -include $(MAKEFILEDIR)/$(MAKEFILE) - --include Makefile.postamble - --include Makefile.dependencies diff --git a/src/config/front-ends/nextstep/Executor/Makefile.postamble b/src/config/front-ends/nextstep/Executor/Makefile.postamble deleted file mode 100644 index fd7c39c6..00000000 --- a/src/config/front-ends/nextstep/Executor/Makefile.postamble +++ /dev/null @@ -1,106 +0,0 @@ -############################################################################### -# NeXT Makefile.postamble Template -# Copyright 1993, NeXT Computer, Inc. -# -# This Makefile is used for configuring the standard app makefiles associated -# with ProjectBuilder. -# -# Use this template to set attributes for a project, sub-project, bundle, or -# palette. Each node in the project's tree of sub-projects and bundles -# should have it's own Makefile.preamble and Makefile.postamble. Additional -# rules (e.g., after_install) that are defined by the developer should be -# defined in this file. -# -############################################################################### -# -# Here are the variables exported by the common "app" makefiles that can be -# used in any customizations you make to the template below: -# -# PRODUCT_ROOT - Name of top-level app-wrapper (e.g., Webster.app) -# OFILE_DIR - Directory into which .o object files are generated. -# (Note that this name is calculated based on the target -# architectures specified in Project Builder). -# DERIVED_SRC_DIR - Directory used for all other derived files -# ALL_CFLAGS - All the flags passed to the cc(1) driver for compilations -# -# NAME - name of application, bundle, subproject, palette, etc. -# LANGUAGE - langage in which the project is written (default "English") -# ENGLISH - boolean flag set iff $(LANGUAGE) = "English" -# JAPANESE - boolean flag set iff $(LANGUAGE) = "Japanese" -# LOCAL_RESOURCES - localized resources (e.g. nib's, images) of project -# GLOBAL_RESOURCES - non-localized resources of project -# PROJECTVERSION - version of ProjectBuilder that output Makefile -# APPICON - application icon file -# DOCICONS - dock icon files -# ICONSECTIONS - Specifies icon sections when linking executable -# -# CLASSES - Class implementation files in project. -# HFILES - Header files in project. -# MFILES - Other Objective-C source files in project. -# CFILES - Other C source files in project. -# PSWFILES - .psw files in the project -# PSWMFILES - .pswm files in the project -# SUBPROJECTS - Subprojects of this project -# BUNDLES - Bundle subprojects of this project -# OTHERSRCS - Other miscellaneous sources of this project -# OTHERLINKED - Source files not matching a standard source extention -# -# LIBS - Libraries to link with when making app target -# DEBUG_LIBS - Libraries to link with when making debug target -# PROF_LIBS - Libraries to link with when making profile target -# OTHERLINKEDOFILES - Other relocatable files to (always) link in. -# -# APP_MAKEFILE_DIR - Directory in which to find generic set of Makefiles -# MAKEFILEDIR - Directory in which to find $(MAKEFILE) -# MAKEFILE - Top level mechanism Makefile (e.g., app.make, bundle.make) -# INSTALLDIR - Directory app will be installed into by 'install' target - - -# Change defaults assumed by the standard app makefiles here. Edit the -# following default values as appropriate. (Note that if no Makefile.postamble -# exists, these values will have defaults set in common.make). - -# Add Makefile.preamble, Makefile.postamble, and Makefile.dependencies here if -# you would like changes to them to invalidate previous builds. The project -# depends on $(MAKEFILES) so that changes to Makefiles will trigger a re-build. -#MAKEFILES = Makefile - -# Optimization flag passed to compiler: -#OPTIMIZATION_CFLAG = -O - -# Flags passed to compiler in normal 'app' compiles: -#NORMAL_CFLAGS = -g $(OPTIMIZATION_CFLAG) -Wall - -# Flags passed to compiler in 'debug' compiles: -#DEBUG_CFLAGS = -g -Wall -DDEBUG - -# Flags passed to compiler in 'profile' compiles -#PROFILE_CFLAGS = -g -pg $(OPTIMIZATION_CFLAG) -Wall -DPROFILE - -# Ownership and permissions of files installed by 'install' target -#INSTALL_AS_USER = root # User to chown app to -#INSTALL_AS_GROUP = wheel # Group to chgrp app to -#INSTALL_PERMISSIONS = # If set, 'install' chmod's executable to this - -# Options to strip for bundles, apps with bundles, and apps without bundles, -# respectively. -#RELOCATABLE_STRIP_OPTS = -x -u -#DYLD_APP_STRIP_OPTS = -A -n -#APP_STRIP_OPTS = -# (Note: APP_STRIP_OPTS defaults to empty, but developers doing their own -# dynamic loading should set this to $(DYLD_APP_STRIP_OPTS)). - - -######################################################################### -# Put rules to extend the behavior of the standard Makefiles here. Typical -# user-defined rules are before_install and after_install (please don't -# redefine things like install or app, as they are owned by the top-level -# Makefile API), which are rules that get invoked before and after the install -# target runs. Such rules should be specified with the '::' syntax rather than -# a single colon. - - - - - - diff --git a/src/config/front-ends/nextstep/Executor/Makefile.preamble b/src/config/front-ends/nextstep/Executor/Makefile.preamble deleted file mode 100644 index d400049b..00000000 --- a/src/config/front-ends/nextstep/Executor/Makefile.preamble +++ /dev/null @@ -1,90 +0,0 @@ -############################################################################### -# NeXT Makefile.preamble Template -# Copyright 1993, NeXT Computer, Inc. -# -# This Makefile is used for configuring the standard app makefiles associated -# with ProjectBuilder. -# -# Use this template to set attributes for a project, sub-project, bundle, or -# palette. Each node in the project's tree of sub-projects and bundles -# should have it's own Makefile.preamble and Makefile.postamble. -# -############################################################################### -## Configure the flags passed to $(CC) here. These flags will also be -## inherited by all nested sub-projects and bundles. Put your -I, -D, -U, and -## -L flags here. To change the default flags that get passed to ${CC} -## (e.g. change -O to -O2), see Makefile.postamble. - -# Flags passed to compiler (in addition to -g, -O, etc) -OTHER_CFLAGS = -# Flags passed to ld (in addition to -ObjC, etc.) -OTHER_LDFLAGS = -L/usr2 \ - lowglobals.o \ - -sectcreate hfs_xfer hfs_xfersect hfs_xfer.util.stripped - -## Configure what is linked in at each level here. Libraries are only used in -## the final 'app' linking step. Final 'app' linking is only done via the -## 'app', 'debug', and 'profile' targets when they are invoked for -## the top-level app. - -# Additional relocatables to be linked in at this level -OTHER_OFILES = - - -# Additional libs to link apps against ('app' target) -OTHER_LIBS = -# Additional libs to link apps against ('debug' target) -OTHER_DEBUG_LIBS = -# Additional libs to link apps against ('profile' target) -OTHER_PROF_LIBS = - -# More 'app' libraries when $(JAPANESE) = "YES" -OTHER_JAPANESE_LIBS = -# More 'debug' libraries when $(JAPANESE) = "YES" -OTHER_JAPANESE_DEBUG_LIBS = -# More 'profile' libs when $(JAPANESE) = "YES" -OTHER_JAPANESE_PROF_LIBS = - -## Configure how things get built here. Additional dependencies, sourcefiles, -## derived files, and build order should be specified here. - -# Other dependencies of this project -OTHER_PRODUCT_DEPENDS = -# Built *before* building subprojects/bundles -OTHER_EARLY_TARGETS = -# Other source files maintained by .pre/postamble -OTHER_SOURCEFILES = -# Additional files to be removed by `make clean' -OTHER_GARBAGE = -# Precompiled headers to be built before any compilation occurs (e.g., draw.p) -PRECOMPS = - -# Targets to be built before subprojects & bundles -OTHER_INITIAL_TARGETS = - -# A virtual root directory (other than /) to be prepended to the $(INSTALLDIR) -# passed from ProjectBuilder. -DSTROOT = - - -## Add more obscure source files here to cause them to be automatically -## processed by the appropriate tool. Note that these files should also be -## added to "Supporting Files" in ProjectBuilder. The desired .o files that -## result from these files should also be added to OTHER_OFILES above so they -## will be linked in. - -# .msg files that should have msgwrap run on them -MSGFILES = -# .defs files that should have mig run on them -DEFSFILES = -# .mig files (no .defs files) that should have mig run on them -MIGFILES = - -## Add additional Help directories here (add them to the project as "Other -## Resources" in Project Builder) so that they will be compressed into .store -## files and copied into the app wrapper. If the help directories themselves -## need to also be in the app wrapper, then a cp command will need to be added -## in an after_install target. -OTHER_HELP_DIRS = - - diff --git a/src/config/front-ends/nextstep/Executor/PB.gdbinit b/src/config/front-ends/nextstep/Executor/PB.gdbinit deleted file mode 100644 index ec04a06d..00000000 --- a/src/config/front-ends/nextstep/Executor/PB.gdbinit +++ /dev/null @@ -1,7 +0,0 @@ -# -# Generated by the NeXT Project Builder. -# -# NOTE: Do NOT change this file -- Project Builder maintains it. -# -view - diff --git a/src/config/front-ends/nextstep/Executor/PB.project b/src/config/front-ends/nextstep/Executor/PB.project deleted file mode 100644 index c3428be6..00000000 --- a/src/config/front-ends/nextstep/Executor/PB.project +++ /dev/null @@ -1,26 +0,0 @@ -INSTALLDIR = "$(HOME)/Apps"; -APPICON = Executor.tiff; -GENERATEMAIN = YES; -DOCICONFILES = (docAppl.tiff, docMSW.tiff, docXL.tiff); -FILESTABLE = { - OTHER_LIBS = (executor, gccFAT, Indexing_s, kernload, Media_s, NeXT_s); - OTHER_RESOURCES = (8kfile, Help); - OTHER_SOURCES = (Makefile.preamble, Makefile, Makefile.postamble); - INTERFACES = (Executor.nib, Executor.project.nib, Info.nib); - OTHER_LINKED = (); - M_FILES = (Executor_main.m); -}; -APPCLASS = Application; -MAINNIB = Executor; -DOCEXTENSIONS = (apl, msw, mxl); -PROJECTTYPE = Application; -PROJECTVERSION = 1.1; -LOCALIZABLE_FILES = { - Help; - Executor.project.nib; - Info.nib; - Executor.nib; -}; -PROJECTNAME = Executor; -SYSTEMEXTENSIONS = (); -LANGUAGE = English; diff --git a/src/config/front-ends/nextstep/Executor/PB.project.openstep b/src/config/front-ends/nextstep/Executor/PB.project.openstep deleted file mode 100644 index 20f84c1b..00000000 --- a/src/config/front-ends/nextstep/Executor/PB.project.openstep +++ /dev/null @@ -1,36 +0,0 @@ -{ - APPCLASS = Application; - FILESTABLE = { - INTERFACES = (Executor.nib, Executor.project.nib, Info.nib); - M_FILES = (); - OTHER_LIBS = (executor, gccFAT, Indexing_s, kernload, Media_s, NeXT_s); - OTHER_LINKED = (Executor_main.m); - OTHER_RESOURCES = (8kfile, Help); - OTHER_SOURCES = (Makefile.preamble, Makefile, Makefile.postamble); - }; - GENERATEMAIN = YES; - LANGUAGE = English; - LOCALIZABLE_FILES = { - Executor.nib = Executor.nib; - Executor.project.nib = Executor.project.nib; - Help = Help; - Info.nib = Info.nib; - }; - MAKEFILEDIR = "$(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles"; - NEXTSTEP_APPICON = Executor.tiff; - NEXTSTEP_DOCUMENTEXTENSIONS = ( - {Extension = apl; Image = docAppl.tiff; }, - {Extension = msw; Image = docMSW.tiff; }, - {Extension = mxl; Image = docXL.tiff; } - ); - NEXTSTEP_INSTALLDIR = "$(HOME)/Apps"; - NEXTSTEP_MAINNIB = Executor; - PDO_UNIX_INSTALLDIR = "$(HOME)/Apps"; - PDO_UNIX_MAINNIB = Executor; - PROJECTNAME = Executor; - PROJECTTYPE = Application; - PROJECTVERSION = 2.6; - SYSTEMEXTENSIONS = (); - WINDOWS_INSTALLDIR = "$(HOME)/Apps"; - WINDOWS_MAINNIB = Executor; -} diff --git a/src/config/front-ends/nextstep/MacAppClass.h b/src/config/front-ends/nextstep/MacAppClass.h deleted file mode 100644 index a2751b3e..00000000 --- a/src/config/front-ends/nextstep/MacAppClass.h +++ /dev/null @@ -1,56 +0,0 @@ - -/* Generated by Interface Builder */ - -#ifndef OPENSTEP -#import -#else /* OPENSTEP */ -#import -#endif /* OPENSTEP */ - -#ifndef OPENSTEP -@interface MacAppClass:Application -#else /* OPENSTEP */ -@interface MacAppClass:NSApplication -#endif /* OPENSTEP */ -{ - id gameWindow; - id game; - id infoPanel; - id myButton; - id myForm; - id serialText; - id registerWindow; - id registerWindow2; - id doneButton; - id sptext; - id starsptext; - id pctext; - id starpctext; - id d0text; - id psltext; - id sigtext; - id debtext; - id debtable; - id deathwindow; - id commenttext; - id printView; - id prefWindow; - id myMenu; - id serialForm; - id serialWindow; - id splashScreen; - id deathMenuCell; - id versionString; -} - -#ifndef OPENSTEP -- appDidInit:app; -- windowDidBecomeKey:sender; -#else /* OPENSTEP */ -- (void) windowDidBecomeKey:(NSNotification *)anotification; -- (void) windowDidResignKey:(NSNotification *)anotification; -#endif /* OPENSTEP */ -- showInfo:sender; -- printGame:sender; - -@end diff --git a/src/config/front-ends/nextstep/MacAppClass.m b/src/config/front-ends/nextstep/MacAppClass.m deleted file mode 100644 index be1f0755..00000000 --- a/src/config/front-ends/nextstep/MacAppClass.m +++ /dev/null @@ -1,616 +0,0 @@ -/* - * Here is the original comment... it's not too relevant anymore: - * - * BreakApp.m, subclass of Application for BreakApp. - * Author: Ali Ozer - * Written for 1.0 July 89. - * Modified for 2.0 Sept 90; separated the panels into their own .nib files. - * - * This class manages the windows & such for the BreakApp application. - * - * You may freely copy, distribute and reuse the code in this example. - * NeXT disclaims any warranty of any kind, expressed or implied, - * as to its fitness for any particular use. - */ - -#include "rsys/common.h" -#define Cursor NeXT_Cursor -#define Control NeXT_Control -#ifndef OPENSTEP -#import -#else /* OPENSTEP */ -#import -#endif /* OPENSTEP */ -#undef Cursor -#undef Control - -#include "QuickDraw.h" -#include "rsys/next.h" -#import "MacAppClass.h" -#import "MacViewClass.h" - -#include "SegmentLdr.h" -#include "MemoryMgr.h" -#include "rsys/soundopts.h" -#include "rsys/blockinterrupts.h" -#include "rsys/syn68k_public.h" -#include "rsys/prefs.h" -#include "rsys/hfs.h" -#include "rsys/segment.h" -#include "rsys/notmac.h" -#include -#include -#include "rsys/version.h" -#include "FileMgr.h" -#include "rsys/file.h" -#include "ourstuff.h" - -@implementation MacAppClass - -char ROMlib_started; - -#ifndef OPENSTEP -// appDidInit is called as the first thing in the run loop of the -// application. At this point, everything is created, but we haven't entered -// the event loop yet. appDidInit initializes a few things and -// calls the gotoFirstLevel: method of the BreakView instance to get -// started on a new game. - -#endif /* not OPENSTEP */ -id global_gameWindow; -id global_menu; -id global_serialText; -id global_myForm; -id global_myButton; -id global_registerDone; -id global_doneButton; -id global_sptext; -id global_starsptext; -id global_pctext; -id global_starpctext; -id global_d0text; -id global_pstext; -id global_sigtext; -id global_debtext; -id global_debtable; -id global_deathwindow; -id global_deathMenuCell; -id global_commenttext; -id global_registerWindow; -id global_registerWindow2; -id global_serialwindow; -id global_serialform; -id global_game; -id global_splashScreen; - -#ifndef OPENSTEP -/* - * Don't have to worry about interrupts in appDidInit, since it gets - * called before the mac side starts up. - */ - -- appDidInit:app -#else /* OPENSTEP */ -- (void)finishLaunching -#endif /* OPENSTEP */ -{ -#ifndef OPENSTEP - NXRect tempr; - char const *types[5] = { - NXRTFPboardType, - NXPostScriptPboardType, - NXAsciiPboardType, - NXTIFFPboardType, - 0 - }; -#else /* OPENSTEP */ -#if 0 - NSRect tempr; -#endif - - NSArray *types; - - [super finishLaunching]; - types = [NSArray arrayWithObjects:NSRTFPboardType, NSPostScriptPboardType, - NSStringPboardType, NSTIFFPboardType, nil]; -#endif /* OPENSTEP */ - - nextmain(); - [gameWindow setDelegate:self]; // We want window resized messages -#ifndef OPENSTEP - [game getBounds:&tempr]; - [gameWindow getFrame:&tempr]; -#endif /* not OPENSTEP */ - global_gameWindow = gameWindow; - global_game = game; - global_splashScreen = splashScreen; - global_menu = myMenu; - global_serialText = serialText; - global_myForm = myForm; - global_myButton = myButton; - global_doneButton = doneButton; - global_registerWindow = registerWindow; - global_registerWindow2 = registerWindow2; - global_serialwindow = serialWindow; - global_serialform = serialForm; - - global_sptext = sptext; - global_starsptext = starsptext; - global_pctext = pctext; - global_starpctext = starpctext; - global_d0text = d0text; - global_pstext = psltext; - global_sigtext = sigtext; - global_debtext = debtext; - global_debtable = debtable; - global_deathwindow = deathwindow; - global_deathMenuCell = deathMenuCell; - global_commenttext = commenttext; - -#ifndef OPENSTEP - [self registerServicesMenuSendTypes:types andReturnTypes:types]; - - return self; -#else /* OPENSTEP */ - [self registerServicesMenuSendTypes:types returnTypes:types]; -#endif /* OPENSTEP */ -} - -// Constrain window resizing. - -short ROMlib_constrained = NO; - -#ifndef OPENSTEP -- windowDidBecomeKey : sender -#else /* OPENSTEP */ -- (void) windowDidBecomeKey : (NSNotification *)anotification -#endif /* OPENSTEP */ -{ -#ifndef OPENSTEP - NXRect tempr; -#else /* OPENSTEP */ - NSRect tempr; -#endif /* OPENSTEP */ - -/* - * NOTE: we could become the key window while the mouse is outside our window - * (because some application hid, for instance). The following three - * lines will insure that we notice that we are on the outside if this - * happens. - */ - - SETUPA5; -#ifndef OPENSTEP - if (!ROMlib_pasteboard) - ROMlib_pasteboard = [Pasteboard new]; -#endif /* not OPENSTEP */ - -#ifndef OPENSTEP - [game getFrame:&tempr]; - [game convertRect:&tempr toView:nil]; - [gameWindow setTrackingRect:&tempr inside:YES owner:game tag:1 left:NO - right:NO]; -#else /* OPENSTEP */ - tempr = [game bounds]; - -/* NOTE: userData of 0 may cause trouble ... I have vague recollections - of that happening under NEXTSTEP */ - -#if 0 - [gameWindow addTrackingRect:tempr owner:game userData:0 assumeInside:YES]; -#else -#warning need to fix trackingrect stuff -#endif -#endif /* OPENSTEP */ - if (CrsrVis) - [realcursor set]; - else - [blankcursor set]; - if (ROMlib_started >= 3) -#ifndef OPENSTEP - sendresumeevent([ROMlib_pasteboard changeCount] > -#else /* OPENSTEP */ - sendresumeevent([[NSPasteboard generalPasteboard] changeCount] > -#endif /* OPENSTEP */ - ROMlib_ourchangecount); - RESTOREA5; -#ifndef OPENSTEP - return self; -#endif /* not OPENSTEP */ -} - -#ifndef OPENSTEP -- windowDidResignKey : sender -#else /* OPENSTEP */ -- (void) windowDidResignKey : (NSNotification *)anotification -#endif /* OPENSTEP */ -{ - SETUPA5; - - if (ROMlib_started >= 3) - sendsuspendevent(); - RESTOREA5; -#ifndef OPENSTEP - return self; -#endif /* not OPENSTEP */ -} - -// printGame: allows us to print the game window. We could've just connected -// the "Print..." menu item to the window's smartPrintPSCode:; however, we -// wanted to be able to change the title to reflect the status. -/* ctm NOTE: we no longer change the title */ - -- printGame:sender -{ -#ifndef OPENSTEP - [gameWindow smartPrintPSCode:sender]; -#else /* OPENSTEP */ - [gameWindow print:sender]; -#endif /* OPENSTEP */ - - return self; -} - - -// Method to load the .nib file for the info panel. - -- showInfo:sender -{ - if (!infoPanel) { -#ifndef OPENSTEP - [self loadNibSection:"Info.nib" owner:self withNames:NO]; - [versionString setStringValue:ROMlib_executor_version]; -#else /* OPENSTEP */ - [NSBundle loadNibFile:@"Info.nib" externalNameTable:nil withZone:NULL]; - [versionString setStringValue: - [NSString stringWithCString:ROMlib_executor_version]]; -#endif /* OPENSTEP */ - } - [infoPanel makeKeyAndOrderFront:sender]; - return self; -} - -- appWillTerminate:sender -{ - SETUPA5; - ROMlib_OurClose(); - RESTOREA5; - return self; -} - -#if defined(BINCOMPAT) -- (BOOL) appAcceptsAnotherFile:sender -{ - return ROMlib_acceptsanotherfile ? YES : NO; -} - -char *ROMlib_toexec = 0; -char *ROMlib_toopen = 0; - -static struct { - char *extension; - char **pathp; -} ourtable[] = { - "xl", &ROMlib_ExcelApp, - "XL", &ROMlib_ExcelApp, - "mxl", &ROMlib_ExcelApp, - "MXL", &ROMlib_ExcelApp, - "msw", &ROMlib_WordApp, - "MSW", &ROMlib_WordApp, -}; - -static char *mallocname(const char *path) -{ - char *retval; - char *slash; - char isres; - - SETUPA5; - retval = malloc(strlen(path) + 1); - strcpy(retval, path); - slash = rindex(retval, '/'); - isres = ROMlib_isresourcefork(path); - if (slash && isres) - memmove(slash+1, slash+2, strlen(slash+1)); - RESTOREA5; - return retval; -}; - -- (int) openFile:(const char *) path ok:(int *) flag -{ - const char *dot; - int i; - - dot = rindex(path, '.'); - i = NELEM(ourtable); - if (dot) { - ++dot; - for (i = 0; i < NELEM(ourtable); ++i) { - if (strcmp(ourtable[i].extension, dot) == 0) -/*-->*/ break; - } - } - if (i < NELEM(ourtable)) { - ROMlib_toexec = (char *) ourtable[i].pathp; /* ick */ - ROMlib_toopen = mallocname(path); - } else - ROMlib_toexec = mallocname(path); - - *flag = YES; /* we're lying */ - return 0; -} -#endif - -#define KEYTYPE \ -"Registration Keys are thirteen lower case letters and/or digits." - -#define FILLIN \ -"You must fill in the Owner and Registration Key fields." - -#define NOTVALID \ -"That registration key is not valid\nCall Abacus R&D Inc. at +1 505 766 9115." - -#define TOOMANYONCPU \ -"You may only run up to ten copies of this application simultaneously on one CPU." - -#ifndef OPENSTEP -#define TOOMANYONNET \ -"This program is already in use on the maximum number of CPUs that your" \ -" current license allows. Call ARDI at +1 505 766 9115 to increase your limit." -#else /* OPENSTEP */ -#define TOOMANYONNET "This program is already in use on the maximum number of CPUs that your current license allows. Call ARDI at +1 505 766 9115 to increase your limit." -#endif /* OPENSTEP */ - -#define NEGSERIALNUMBERS - -LONGINT ROMlib_whichapps; - -void toomanycopiesonnet( void ) -{ - ROMlib_started = 4; -#ifndef OPENSTEP - NXRunAlertPanel((const char *) 0, TOOMANYONNET, (const char *)0, - (const char *)0, (const char *)0); -#else /* OPENSTEP */ - NSRunAlertPanel(nil, @TOOMANYONNET, nil, nil, nil); -#endif /* OPENSTEP */ - C_ExitToShell(); -} - -void toomanycopiesonthiscpu( void ) -{ - ROMlib_started = 4; -#ifndef OPENSTEP - NXRunAlertPanel((const char *) 0, TOOMANYONCPU, (const char *)0, - (const char *)0, (const char *)0); -#else /* OPENSTEP */ - NSRunAlertPanel(nil, @TOOMANYONCPU, nil, nil, nil); -#endif /* OPENSTEP */ - C_ExitToShell(); -} - -void warnuser( const char *str ) -{ -#ifndef OPENSTEP - NXRunAlertPanel("Warning", str, (const char *)0, (const char *)0, - (const char *)0); -#else /* OPENSTEP */ - NSRunAlertPanel(@"Warning", @"%@", nil, nil, nil, str); -#endif /* OPENSTEP */ -} - -static int whichbit(unsigned long n) -{ - return n <= 1 ? 0 : whichbit(n>>1) + 1; -} - -#if defined(BINCOMPAT) -void norunthisapp( void ) -{ - char message[80]; - int apptag; - id regview, apptext; -#ifdef OPENSTEP - char buf[40]; -#endif /* OPENSTEP */ - - ROMlib_started = 4; - apptag = 10 + whichbit(ROMlib_appbit); - regview = [global_registerWindow2 contentView]; -#ifndef OPENSTEP - apptext = [regview findViewWithTag:apptag]; -#else /* OPENSTEP */ - apptext = [regview viewWithTag:apptag]; - [[apptext stringValue] getCString:buf maxLength:(sizeof (buf) - 1)]; -#endif /* OPENSTEP */ - sprintf(message, "\"%s\" is not enabled.\n" - "Call Abacus R&D at (505) 766-9115 if you would like to enable it", -#ifndef OPENSTEP - [apptext stringValue]); - NXRunAlertPanel((const char *) 0, message, (const char *)0, - (const char *)0, (const char *)0); -#else /* OPENSTEP */ - buf); - NSRunAlertPanel(nil, @"%@", nil, nil, nil, message); -#endif /* OPENSTEP */ - C_ExitToShell(); -} -#endif - -#ifndef OPENSTEP -#define WILLSETPERMS \ -"The permissions for this program are not properly set. I will reset them" \ -" for you." -#else /* OPENSTEP */ -#define WILLSETPERMS \ -"The permissions for this program are not properly set. I will reset them for you." -#endif /* OPENSTEP */ - -#ifndef OPENSTEP -#define MUSTBESETUID \ -"The permissions for this program are not set properly. You need to run" \ -" this program once as \"root\" so the permissions will be reset." -#else /* OPENSTEP */ -#define MUSTBESETUID \ -"The permissions for this program are not set properly. You need to run this program once as \"root\" so the permissions will be reset." -#endif /* OPENSTEP */ - -#define CANNOTCREATECONFIG \ -"The configuration file could not be created." - -#ifndef OPENSTEP -#define SOMEONEELSEONFLOPPY \ -"The floppy drive is already in use by a running program, so this program" \ -" will not be able to use the floppy drive." -#else /* OPENSTEP */ -#define SOMEONEELSEONFLOPPY \ -"The floppy drive is already in use by a running program, so this program will not be able to use the floppy drive." -#endif /* OPENSTEP */ - -#ifndef OPENSTEP -#define BADFILESYSTEM \ -"The filesystem that Executor is installed on does not support setuid root" \ -" programs. Contact your system administrator for more help." -#else /* OPENSTEP */ -#define BADFILESYSTEM \ -"The filesystem that Executor is installed on does not support setuid root programs. Contact your system administrator for more help." -#endif /* OPENSTEP */ - -void willsetperms( void ) -{ -#ifndef OPENSTEP - NXRunAlertPanel((const char *) 0, WILLSETPERMS, (const char *)0, - (const char *)0, (const char *)0); -#else /* OPENSTEP */ - NSRunAlertPanel(nil, @WILLSETPERMS, nil, nil, nil); -#endif /* OPENSTEP */ -} - -void cannotcreatconfig( void ) -{ -#ifndef OPENSTEP - NXRunAlertPanel((const char *) 0, CANNOTCREATECONFIG, (const char *)0, - (const char *)0, (const char *)0); -#else /* OPENSTEP */ - NSRunAlertPanel(nil, @CANNOTCREATECONFIG, nil, nil, nil); -#endif /* OPENSTEP */ -} - -void mustbesetuid( void ) -{ - ROMlib_started = 4; -#ifndef OPENSTEP - NXRunAlertPanel((const char *) 0, MUSTBESETUID, (const char *)0, - (const char *)0, (const char *)0); -#else /* OPENSTEP */ - NSRunAlertPanel(nil, @MUSTBESETUID, nil, nil, nil); -#endif /* OPENSTEP */ - C_ExitToShell(); -} - -void badfilesystem( void ) -{ - ROMlib_started = 4; -#ifndef OPENSTEP - NXRunAlertPanel((const char *) 0, BADFILESYSTEM, (const char *)0, - (const char *)0, (const char *)0); -#else /* OPENSTEP */ - NSRunAlertPanel(nil, @BADFILESYSTEM, nil, nil, nil); -#endif /* OPENSTEP */ - C_ExitToShell(); -} - -void someoneelseonfloppy( void ) -{ -#ifndef OPENSTEP - NXRunAlertPanel((const char *) 0, SOMEONEELSEONFLOPPY, (const char *)0, - (const char *)0, (const char *)0); -#else /* OPENSTEP */ - NSRunAlertPanel(nil, @SOMEONEELSEONFLOPPY, nil, nil, nil); -#endif /* OPENSTEP */ -} - -/* - * WindowName 1 - * WindowLocation x 2, y 3 - * WindowSize x 4, y 5 - * Delay 6 // No longer supported - * WriteWhen 7 - * Refresh 8 - * Noclock 9 - * PretendSound 10 - * debug 11 // No longer supported - * NewLinetoCR 15 - * PassPostscript 16 - * DirectDiskAccess 17 - * Accelerated 18 - * NoWarn32 19 - * FlushOften 20 - */ - -typedef enum { NAME = 1, DELAY = 6, WRITEWHEN, REFRESH, NOCLOCK, PRETENDSOUND, - DEBUG, NEWLINETOCR = 15, PASSPOSTSCRIPT, DIRECTDISKACCESS, - ACCELERATED, NOWARN32, FLUSHOFTEN} pref_t; - -#define ROMLIB_DEBUG_BIT (1 << 1) - -#define HASHBITS 4091 /* DON'T EVER CHANGE THIS NUMBER, OR YOU'LL */ - /* MESS UP EXISTING CONFIGURATION FILES! */ -#define NCACHEBYTES ((HASHBITS+7)/ 8) - -static void mydelay( long usec ) -{ - struct timeval now, later, timeout; - struct timezone tz; - fd_set foofds; - - gettimeofday(&now, &tz); - later.tv_usec = now.tv_usec + usec; - later.tv_sec = now.tv_sec + later.tv_usec / 1000000L; - later.tv_usec %= 1000000L; - FD_ZERO(&foofds); - while (usec > 0) { - timeout.tv_sec = usec / 1000000L; - timeout.tv_usec = usec % 1000000L; - select(0, &foofds, &foofds, &foofds, &timeout); - gettimeofday(&now, &tz); - usec = (later.tv_sec - now.tv_sec) * 1000000 + - (later.tv_usec - now.tv_usec); - } -} - -void ROMlib_updateworkspace( void ) -{ -#ifndef OPENSTEP - port_t workspaceport; - id myspeaker; - int err; -#endif /* not OPENSTEP */ - virtual_int_state_t block; - - block = block_virtual_ints (); - mydelay(1250000); -#ifndef OPENSTEP - if ( workspaceport = NXPortFromName(NX_WORKSPACEREQUEST, NULL) ) { - myspeaker = [Speaker new]; - [myspeaker setSendPort:workspaceport]; - err = [myspeaker performRemoteMethod:"update"]; - if (err) - fprintf(stderr, "performRemoteMethod returned %d\n", err); - [myspeaker free]; - } else - fprintf(stderr, "Couldn't get workspaceport\n"); -#else /* OPENSTEP */ - - [[NSWorkspace sharedWorkspace] noteFileSystemChanged]; - -#endif /* OPENSTEP */ - restore_virtual_ints (block); -} - -void ROMlib_splashscreen( void ) -{ - [global_splashScreen makeKeyAndOrderFront:0]; -} - -@end diff --git a/src/config/front-ends/nextstep/MacViewClass.m b/src/config/front-ends/nextstep/MacViewClass.m deleted file mode 100644 index 139df2bf..00000000 --- a/src/config/front-ends/nextstep/MacViewClass.m +++ /dev/null @@ -1,2903 +0,0 @@ -#if !defined (OMIT_RCSID_STRINGS) -char ROMlib_rcsid_MacViewClass[] = - "$Id: MacViewClass.m,v 2.34 1997/05/09 09:51:14 ctm Exp $"; -#endif - -#define Cursor NeXT_Cursor -#include "rsys/common.h" -#import "MacViewClass.h" -#undef Cursor -#include "ToolboxEvent.h" -#include "rsys/vdriver.h" -#include "rsys/depthconv.h" -#include "rsys/cquick.h" -#include "rsys/dirtyrect.h" -#include "rsys/next.h" -#include "rsys/nextprint.h" -#include "rsys/blockinterrupts.h" -#include "rsys/license.h" -#include "rsys/refresh.h" -#include "rsys/print.h" -#include "rsys/flags.h" -#include "rsys/PSstrings.h" -#include "ourstuff.h" -#include "OSEvent.h" -#include "rsys/osevent.h" -#include "contextswitch.h" -#include "rsys/executor.h" -#include "MemoryMgr.h" -#include "ScrapMgr.h" -#include - -#ifdef OPENSTEP -#include -#endif /* OPENSTEP */ - -@implementation MacViewClass - - -/* NOTE: This isn't a very good NEXTSTEP object, because much of its - * data is stored in static variables, instead of in instance - * variables. That means we can only have one instantiation. We do - * this because we are constrained to adhere to the C semantics of the - * vdriver interface, and because we have no interest in running two - * of these simultaneously. - */ - - -#ifndef OPENSTEP -/* NXBitmapImageReps for the screen in various formats. */ -static id rgb_screen_bitmap; -static id two_bpp_screen_bitmap; -id realcursor, blankcursor; -NXImage *blankcursorimage, *cursorimage; -NXBitmapImageRep *cursorrep, *blankcursorrep; -static void timerswitch (DPSTimedEntry notused, double timenow, void *data); -static DPSTimedEntry timer; - -#else /* OPENSTEP */ - -/* NSBitmapImageReps for the screen in various formats. */ -static NSBitmapImageRep *rgb_screen_bitmap; -static NSBitmapImageRep *two_bpp_screen_bitmap; -NSCursor *realcursor, *blankcursor; -NSImage *blankcursorimage, *cursorimage; -NSBitmapImageRep *cursorrep, *blankcursorrep; -NSTimer *our_timer = 0; - -#endif /* OPENSTEP */ - -static id current_screen_bitmap; /* An alias for one of the other three */ -static id one_bpp_screen_bitmap; - -/* Do we need to convert from internal screen to real screen? */ -static boolean_t screen_needs_conversion_p; - -/* This is here for easy access by C functions. */ -static MacViewClass *self_view; - -/* Function to convert the screen to NeXT format. */ -static depthconv_func_t conversion_func = NULL; - -/* Space for depth conversion tables. */ -static uint8 depth_table_space[DEPTHCONV_MAX_TABLE_SIZE]; - -/* Color mapping table. */ -static ColorSpec color_table[256]; - -/* Pointer to base memory for the NeXT-format frame buffer. */ -static uint32 *ns_fbuf; - -/* Pointer to base memory for the shadow screen (for refresh). */ -static uint32 *shadow_fbuf; - -/* Row bytes for the NeXT-format frame buffer. */ -static uint32 ns_fbuf_row_bytes; - -/* Size of allocated internal frame buffer. */ -static uint32 fbuf_size; - - -/* These variables are required by the vdriver interface. */ - -uint8 *vdriver_fbuf; - -int vdriver_row_bytes; - -int vdriver_width = VDRIVER_DEFAULT_SCREEN_WIDTH; - -int vdriver_height = VDRIVER_DEFAULT_SCREEN_HEIGHT; - -int vdriver_bpp, vdriver_log2_bpp; - -int vdriver_max_bpp, vdriver_log2_max_bpp; - -rgb_spec_t *vdriver_rgb_spec = NULL; - - -static rgb_spec_t ns_rgb_spec; - -vdriver_nextstep_mode_t vdriver_nextstep_modes; - -/* For now, just force black and white cursors. */ -int host_cursor_depth = 1; - -/* True iff our display is two bit grayscale. */ -static boolean_t two_bit_grayscale_display_p; - -/* True iff we should be drawing in grayscale. */ -boolean_t vdriver_grayscale_p; - -/* True iff the CLUT cannot be changed. */ -boolean_t vdriver_fixed_clut_p; - -#if defined (OPENSTEP) -static void -create_our_timer (id who) -{ - SEL temp_sel; - NSMethodSignature *temp_sig; - NSInvocation *invoke_step; - - temp_sel = @selector (step); - temp_sig = [who methodSignatureForSelector:temp_sel]; - invoke_step = [NSInvocation invocationWithMethodSignature:temp_sig]; - [invoke_step setSelector:temp_sel]; - [invoke_step setTarget:who]; - our_timer = [NSTimer scheduledTimerWithTimeInterval:.00000001 - invocation:invoke_step repeats:YES]; -} -#endif - -#if !defined (OPENSTEP) - -- initFrame:(const NXRect *)frameRect -{ - NXSize size; - char *datap; - int bytecount; - - [super initFrame:frameRect]; - - [self setClipping:NO]; /* important for printing */ - - [self setFlipped:NO]; - [self setAutodisplay:YES]; - - /* Since we will be repeatedly focused on, allocate a gstate. */ - [self allocateGState]; - - two_bit_grayscale_display_p - = ([NXApp colorScreen]->depth == NX_TwoBitGrayDepth); - - vdriver_fixed_clut_p = two_bit_grayscale_display_p; - vdriver_grayscale_p = two_bit_grayscale_display_p; - - /* Set up our max bpp appropriately. */ - if (two_bit_grayscale_display_p) - vdriver_max_bpp = 2; - else - vdriver_max_bpp = 8; - vdriver_log2_max_bpp = ROMlib_log2[vdriver_max_bpp]; - - current_screen_bitmap = nil; - self_view = self; - - vdriver_width = frameRect->size.width; - vdriver_height = frameRect->size.height; - - /* make the cursor */ - - cursorrep = [NXBitmapImageRep allocFromZone:[self zone]]; - [cursorrep initData: 0 pixelsWide: 16 pixelsHigh:16 - bitsPerSample: 1 samplesPerPixel: 2 hasAlpha: YES isPlanar:YES - colorSpace: NX_OneIsBlackColorSpace bytesPerRow:0 - bitsPerPixel:0]; - memset ([cursorrep data], 0, [cursorrep bytesPerRow] * 16 * 2); - - size.width = size.height = 16; - cursorimage = [[NXImage allocFromZone: [self zone]] initSize:&size]; - [cursorimage setDataRetained:YES]; - [cursorimage setScalable:NO]; - [cursorimage useRepresentation:cursorrep]; - realcursor = [NXCursor allocFromZone:[self zone]]; - [realcursor initFromImage:cursorimage]; - - /* make the blank cursor (for when it's hidden) */ - - blankcursorrep =[NXBitmapImageRep allocFromZone:[self zone]]; - [blankcursorrep initData: 0 pixelsWide: 16 pixelsHigh:16 - bitsPerSample: 1 samplesPerPixel: 2 hasAlpha: YES isPlanar:YES - colorSpace: NX_OneIsBlackColorSpace bytesPerRow:0 bitsPerPixel:0]; - - datap = (char *)[blankcursorrep data]; - bytecount = [blankcursorrep bytesPerRow] * 16; - memset (datap, 0, bytecount); - memset (datap + bytecount, ~0, 16 * sizeof (short)); - - size.width = size.height = 16; - blankcursorimage = [[NXImage allocFromZone: [self zone]] initSize:&size]; - [blankcursorimage setDataRetained:YES]; - [blankcursorimage setScalable:NO]; - [blankcursorimage useRepresentation:blankcursorrep]; - blankcursor = [NXCursor allocFromZone:[self zone]]; - [blankcursor initFromImage:blankcursorimage]; - - DPSSetDeadKeysEnabled (DPSGetCurrentContext (), 0); - - timer = DPSAddTimedEntry (0, &timerswitch, self, NX_BASETHRESHOLD); - - return self; -} - -#else /* OPENSTEP */ - -- (id) initWithFrame:(NSRect)frameRect -{ - NSSize size; - char *datap; - int bytecount; - - [super initWithFrame:frameRect]; - - /* Since we will be repeatedly focused on, allocate a gstate. */ - [self allocateGState]; - - two_bit_grayscale_display_p - = NSBitsPerSampleFromDepth([NSWindow defaultDepthLimit]) == 2; - - vdriver_fixed_clut_p = two_bit_grayscale_display_p; - vdriver_grayscale_p = two_bit_grayscale_display_p; - - /* Set up our max bpp appropriately. */ - if (two_bit_grayscale_display_p) - vdriver_max_bpp = 2; - else - vdriver_max_bpp = 8; - vdriver_log2_max_bpp = ROMlib_log2[vdriver_max_bpp]; - - current_screen_bitmap = nil; - self_view = self; - - vdriver_width = frameRect.size.width; - vdriver_height = frameRect.size.height; - - /* make the cursor */ - - cursorrep = [NSBitmapImageRep alloc]; - [cursorrep initWithBitmapDataPlanes:NULL pixelsWide: 16 pixelsHigh:16 - bitsPerSample: 1 samplesPerPixel: 2 hasAlpha: YES isPlanar:YES - colorSpaceName: NSDeviceBlackColorSpace bytesPerRow:0 - bitsPerPixel:0]; - memset ([cursorrep bitmapData], 0, [cursorrep bytesPerRow] * 16 * 2); - - size.width = size.height = 16; - cursorimage = [[NSImage alloc] initWithSize:size]; - [cursorimage setDataRetained:YES]; - [cursorimage addRepresentation:cursorrep]; - - realcursor = [NSCursor alloc]; - - { - NSPoint spot; - - spot.x = 1; - spot.y = 1; - [realcursor initWithImage:cursorimage hotSpot:spot]; - } - /* make the blank cursor (for when it's hidden) */ - - blankcursorrep =[NSBitmapImageRep alloc]; - [blankcursorrep initWithBitmapDataPlanes:NULL pixelsWide: 16 pixelsHigh:16 - bitsPerSample: 1 samplesPerPixel: 2 hasAlpha: YES isPlanar:YES - colorSpaceName: NSDeviceBlackColorSpace bytesPerRow:0 bitsPerPixel:0]; - - datap = (char *)[blankcursorrep bitmapData]; - bytecount = [blankcursorrep bytesPerRow] * 16; - memset (datap, 0, bytecount); - memset (datap + bytecount, ~0, 16 * sizeof (short)); - - size.width = size.height = 16; - blankcursorimage = [[NSImage alloc] initWithSize:size]; - [blankcursorimage setDataRetained:YES]; - [blankcursorimage addRepresentation:blankcursorrep]; - blankcursor = [NSCursor alloc]; - { - NSPoint spot; - - spot.x = 1; - spot.y = 1; - [blankcursor initWithImage:blankcursorimage hotSpot:spot]; - } - -#warning no longer disabling dead keys. Eventually we should rethink -#warning how Executor handles the keyboard - -/* - * see the comment around line 540 of NEXT.c -- basically we should give - * the user the option of using the keymappings that are already present - * on the underlying operating system. - */ - create_our_timer (self); - - return self; -} - -#endif - - -#ifndef OPENSTEP -- free -{ - [rgb_screen_bitmap free]; - [one_bpp_screen_bitmap free]; - [two_bpp_screen_bitmap free]; - return [super free]; -} -#endif - -#ifndef OPENSTEP -- drawSelf:(const NXRect *)rects :(int)rectCount -#else /* OPENSTEP */ -- (void) drawRect:(NSRect)rect -#endif /* OPENSTEP */ -{ - SETUPA5; - - switch (printstate) - { - case __idle: - BLOCK_REAL_INTERRUPTS_EXCURSION - ({ - if (current_screen_bitmap == nil) - { -#ifndef OPENSTEP - PSsetgray (NX_WHITE); - NXRectFill (&bounds); -#else /* OPENSTEP */ - PSsetgray (NSWhite); - NSRectFill ([self bounds]); -#endif /* OPENSTEP */ - } - else - { -#ifndef OPENSTEP - if (rectCount == 1) - NXRectClip (&rects[0]); - else - NXRectClipList (&rects[1], 2); -#else /* OPENSTEP */ - NSRectClip (rect); /* is this needed? */ -#endif /* OPENSTEP */ - [current_screen_bitmap draw]; - } - }); - break; - case seenOpenPage: - RESTOREA5; - do - contextswitch(&nextstep_sp, &romlib_sp); - while (printstate != __idle && printstate != seenClosePage); - goto avoidrestorea5; - break; - default: - /* seenClosePage may get us in here, but we can't do anything - without sploding (I think) */ - break; - } - RESTOREA5; -avoidrestorea5: -#ifndef OPENSTEP - return self; -#endif /* not OPENSTEP */ -} - - -boolean_t -vdriver_init (int _max_width, int _max_height, int _max_bpp, - boolean_t fixed_p, int *argc, char *argv[]) -{ - int width, height, i; -#ifndef OPENSTEP - NXRect my_frame, tempr; - Window *window; -#else /* OPENSTEP */ - NSWindow *view_window; -#endif /* OPENSTEP */ - - make_rgb_spec (&ns_rgb_spec, 16, FALSE, CLC (0x000F000F), -#if defined (LITTLEENDIAN) - 4, 4, 4, 0, 4, 12, -#else - 4, 12, 4, 8, 4, 4, -#endif - CL (GetCTSeed ())); - - /* Allocate the NeXT bitmap. */ - width = flag_width ? flag_width : MAX (_max_width, vdriver_width); - width = MAX (width, VDRIVER_MIN_SCREEN_WIDTH); - width = (width + 7) & ~7; /* round width up to multiple of 8. */ - height = flag_height ? flag_height : MAX (_max_height, vdriver_height); - height = MAX (height, VDRIVER_MIN_SCREEN_HEIGHT); - if (two_bit_grayscale_display_p) - ns_fbuf_row_bytes = (width / 4 + 15) & ~15; - else - ns_fbuf_row_bytes = (width * 2 + 15) & ~15; - - vdriver_width = width; - vdriver_height = height; - - /* Size the window to the appropriate size. */ -#ifndef OPENSTEP - window = [self_view window]; - [window getFrame:&my_frame]; - [window sizeWindow:width :height]; - [window moveTopLeftTo: my_frame.origin.x - :my_frame.origin.y + my_frame.size.height]; - [self_view getFrame:&tempr]; - [self_view convertRect:&tempr toView:nil]; - [window makeKeyAndOrderFront:self_view]; - [window setTrackingRect:&tempr inside:YES owner:self_view - tag:1 left:NO right:NO]; - [window useOptimizedDrawing:YES]; - [window addToEventMask:NX_MOUSEMOVEDMASK]; - [window addToEventMask:NX_MOUSEDRAGGEDMASK]; - [window addToEventMask:NX_FLAGSCHANGEDMASK]; -#else /* OPENSTEP */ - view_window = [self_view window]; - - { - NSSize temp_size; - - temp_size.width = width; - temp_size.height = height; - [view_window setContentSize:temp_size]; - } - - [view_window makeKeyAndOrderFront:self_view]; - -#warning need to set up tracking rectangle - - [view_window useOptimizedDrawing:YES]; - [view_window setAcceptsMouseMovedEvents:YES]; -#endif /* OPENSTEP */ - - ns_fbuf = valloc (((ns_fbuf_row_bytes * height) + 8191) & ~8191); - - /* Allocate the internal bitmap, enough space for max bpp. Make each - * rowbytes divisible by 16. - */ - vdriver_row_bytes = (((width << vdriver_log2_max_bpp) + 127) / 128U) * 16; - fbuf_size = vdriver_row_bytes * height; - vdriver_fbuf = valloc (fbuf_size); - memset (vdriver_fbuf, 0, fbuf_size); - - if (!two_bit_grayscale_display_p) - { - uint32 white_pixel; - - white_pixel = ns_rgb_spec.white_pixel; - for (i = ns_fbuf_row_bytes * height / sizeof (uint32) - 1; i >= 0; i--) - ns_fbuf[i] = white_pixel; - -#ifndef OPENSTEP - rgb_screen_bitmap - = [[NXBitmapImageRep alloc] initData:(void *)ns_fbuf -#else /* OPENSTEP */ - - rgb_screen_bitmap = [NSBitmapImageRep alloc]; - - [rgb_screen_bitmap initWithBitmapDataPlanes:(void *)&ns_fbuf -#endif /* OPENSTEP */ - pixelsWide:width pixelsHigh:height bitsPerSample:4 - samplesPerPixel:3 hasAlpha:NO isPlanar:NO -#ifndef OPENSTEP - colorSpace:NX_RGBColorSpace -#else /* OPENSTEP */ - colorSpaceName:NSDeviceRGBColorSpace -#endif /* OPENSTEP */ - bytesPerRow:ns_fbuf_row_bytes bitsPerPixel:16]; - - one_bpp_screen_bitmap = nil; - two_bpp_screen_bitmap = nil; - } - else - { - memset (ns_fbuf, ~0, ns_fbuf_row_bytes * height); - -#ifdef OPENSTEP - two_bpp_screen_bitmap = [NSBitmapImageRep alloc]; - -#endif /* OPENSTEP */ - two_bpp_screen_bitmap -#ifndef OPENSTEP - = [[NXBitmapImageRep alloc] initData:(void *)ns_fbuf -#else /* OPENSTEP */ - = [two_bpp_screen_bitmap initWithBitmapDataPlanes:(void *)&ns_fbuf -#endif /* OPENSTEP */ - pixelsWide:width pixelsHigh:height bitsPerSample:2 - samplesPerPixel:1 hasAlpha:NO isPlanar:NO -#ifndef OPENSTEP - colorSpace:NX_OneIsWhiteColorSpace -#else /* OPENSTEP */ - colorSpaceName:NSDeviceWhiteColorSpace -#endif /* OPENSTEP */ - bytesPerRow:(((width >> 2) + 15) & ~15) - bitsPerPixel:2]; - - /* No need for one bpp screen...we'll do the conversion ourselves. */ - one_bpp_screen_bitmap = nil; - rgb_screen_bitmap = nil; - } - - vdriver_nextstep_modes.size[1].width = width; - vdriver_nextstep_modes.size[1].height = height; - - return TRUE; -} - - -void -vdriver_shutdown (void) -{ -} - - -void -vdriver_opt_register (void) -{ -} - - -static void -flip_2bpp_pixels (const void *table, - const uint8 *src_base, int src_row_bytes, - uint8 *dst_base, int dst_row_bytes, - int top, int left, int bottom, int right) -{ - int bytes_from_left; - int num_longs, num_rows; - int src_add, dst_add; - const uint32 *s; - uint32 *d; - - bytes_from_left = ((left >> 2) & ~3); - s = (const uint32 *) (src_base + (top * src_row_bytes) + bytes_from_left); - d = (uint32 *) (dst_base + (top * dst_row_bytes) + bytes_from_left); - - num_longs = ((right + 15) >> 4) - (left >> 4); - - src_add = src_row_bytes - (num_longs * 4); - dst_add = dst_row_bytes - (num_longs * 4); - -#define FLIP_LOOP(extra) \ - do { \ - for (num_rows = bottom - top; num_rows > 0; num_rows--) \ - { \ - int n; \ - \ - for (n = num_longs; (n -= 4) >= 0; ) \ - { \ - *d++ = ~*s++; \ - *d++ = ~*s++; \ - *d++ = ~*s++; \ - *d++ = ~*s++; \ - } \ - extra; \ - \ - s = (const uint32 *) ((const uint8 *) s + src_add); \ - d = (uint32 *) ((uint8 *) d + dst_add); \ - } \ - } while (0) - - switch (num_longs & 3) - { - case 0: - FLIP_LOOP ((void) 0); - break; - case 1: - FLIP_LOOP (*d++ = ~*s++); - break; - case 2: - FLIP_LOOP (*d++ = ~*s++; *d++ = ~*s++); - break; - case 3: - FLIP_LOOP (*d++ = ~*s++; *d++ = ~*s++; *d++ = ~*s++); - break; - } -} - - -int -vdriver_update_screen_rects (int num_rects, const vdriver_rect_t *r, - boolean_t cursor_p) -{ -#ifndef OPENSTEP - NXRect *nxr; -#else /* OPENSTEP */ - NSRect *nxr; -#endif /* OPENSTEP */ - int i; - - if (num_rects == 0 || current_screen_bitmap == nil) - return 0; - -/* - * While we're printing, send no bits to the screen. This is ugly, but - * that's the way E/NS 1.3x works. - */ - - if (printstate != __idle) - return 0; - - if (screen_needs_conversion_p) - { - if (conversion_func == NULL) - { - if (current_screen_bitmap == rgb_screen_bitmap) - conversion_func = (depthconv_make_ind_to_rgb_table - (depth_table_space, vdriver_bpp, - NULL, color_table, &ns_rgb_spec)); - else if (current_screen_bitmap == two_bpp_screen_bitmap) - { - if (vdriver_bpp == 1) - { - static const uint32 one_to_two_table[2] = { 0x3, 0 }; - - conversion_func = (depthconv_make_raw_table - (depth_table_space, 1, 2, - NULL, one_to_two_table)); - } - else if (vdriver_bpp == 2) - { - conversion_func = flip_2bpp_pixels; - } - else - abort (); - } - else - abort (); - } - - /* Convert from the current format to our internal screen format. */ - for (i = 0; i < num_rects; i++) - { - int top, left, bottom, right; - - top = r[i].top; - left = r[i].left; - bottom = r[i].bottom; - right = r[i].right; - - (*conversion_func) (depth_table_space, vdriver_fbuf, - vdriver_row_bytes, (uint8 *) ns_fbuf, - ns_fbuf_row_bytes, top, left, bottom, right); - } - } - - /* Set up to transfer to the real screen. */ -#ifndef OPENSTEP - nxr = (NXRect *) alloca (num_rects * sizeof nxr[0]); -#else /* OPENSTEP */ - nxr = (NSRect *) alloca (num_rects * sizeof nxr[0]); -#endif /* OPENSTEP */ - for (i = 0; i < num_rects; i++) - { - int left, top, height; - left = r[i].left; - nxr[i].origin.x = left; - nxr[i].size.width = r[i].right - left; - top = r[i].top; - height = r[i].bottom - top; - nxr[i].size.height = height; - nxr[i].origin.y = vdriver_height - top - height; - } - - BLOCK_REAL_INTERRUPTS_EXCURSION - ({ - [self_view lockFocus]; -#ifndef OPENSTEP - NXRectClipList (nxr, num_rects); -#else /* OPENSTEP */ - - /* I'm not sure where Mat learned about this call */ - NSRectClipList (nxr, num_rects); - -#endif /* OPENSTEP */ - [current_screen_bitmap draw]; - [self_view unlockFocus]; - }); - - return 0; -} - - -int -vdriver_update_screen (int top, int left, int bottom, int right, - boolean_t cursor_p) -{ - vdriver_rect_t r; - - if (top < 0) - top = 0; - if (left < 0) - left = 0; - - if (bottom > vdriver_height) - bottom = vdriver_height; - if (right > vdriver_width) - right = vdriver_width; - - r.top = top; - r.left = left; - r.bottom = bottom; - r.right = right; - - return vdriver_update_screen_rects (1, &r, cursor_p); -} - -static void -repaint_screen (void) -{ - dirty_rect_accrue (0, 0, vdriver_height, vdriver_width); - dirty_rect_update_screen (); -} - -void -vdriver_set_colors (int first_color, int num_colors, const ColorSpec *colors) -{ - if (!vdriver_fixed_clut_p - && memcmp (&color_table[first_color], colors, - num_colors * sizeof colors[0])) - { - memcpy (&color_table[first_color], colors, - num_colors * sizeof colors[0]); - conversion_func = NULL; /* Invalidate old conversion stuff. */ - repaint_screen (); - vdriver_flush_display(); /* Make sure changed colors are visible. */ - } -} - - -boolean_t -vdriver_acceptable_mode_p (int width, int height, int bpp, - boolean_t grayscale_p, - boolean_t exact_match_p) -{ - if (exact_match_p && two_bit_grayscale_display_p && !grayscale_p) - return FALSE; - - if (width == 0) - width = vdriver_width; - if (height == 0) - height = vdriver_height; - if (bpp == 0) - { - bpp = vdriver_bpp; - if (bpp == 0) - bpp = vdriver_max_bpp; - } - - if (width < VDRIVER_MIN_SCREEN_WIDTH || width > vdriver_width - || height < VDRIVER_MIN_SCREEN_HEIGHT || height > vdriver_height - || bpp < 1 || bpp > vdriver_max_bpp - || (bpp != 1 && bpp != 2 && bpp != 4 && bpp != 8)) - return FALSE; - - return TRUE; -} - - -boolean_t -vdriver_set_mode (int width, int height, int bpp, boolean_t grayscale_p) -{ - if (!vdriver_acceptable_mode_p (width, height, bpp, grayscale_p, FALSE)) - return FALSE; - - if (width == 0) - width = vdriver_width; - if (height == 0) - height = vdriver_height; - if (bpp == 0) - { - bpp = vdriver_bpp; - if (bpp == 0) - bpp = vdriver_max_bpp; - } - - vdriver_width = width; - vdriver_height = height; - - if (bpp != vdriver_bpp) - { - static boolean_t first_mode_set_p = TRUE; - int i; - - /* Change depth. */ - vdriver_bpp = bpp; - vdriver_log2_bpp = ROMlib_log2[bpp]; - - vdriver_row_bytes = ((((width << vdriver_log2_bpp) + 127) / 128U) * 16); - - /* Invalidate the conversion function. */ - conversion_func = NULL; - - if (bpp == 1 && one_bpp_screen_bitmap != nil) - { - current_screen_bitmap = one_bpp_screen_bitmap; - vdriver_row_bytes = [one_bpp_screen_bitmap bytesPerRow]; - screen_needs_conversion_p = FALSE; - } - else if ((bpp == 1 || bpp == 2) && two_bpp_screen_bitmap != nil) - { - current_screen_bitmap = two_bpp_screen_bitmap; - screen_needs_conversion_p = TRUE; - } - else - { - /* Set CLUT to all gray; this makes depths sets look nicer. */ - for (i = 0; i < 256; i++) - color_table[i] = ROMlib_gray_cspec; - - current_screen_bitmap = rgb_screen_bitmap; - screen_needs_conversion_p = TRUE; - } - - /* Clear the screen. */ - memset (vdriver_fbuf, first_mode_set_p ? 0 : ~0, - vdriver_height * vdriver_row_bytes); - first_mode_set_p = FALSE; - - assert (current_screen_bitmap != nil); - } - - vdriver_grayscale_p = (two_bit_grayscale_display_p || grayscale_p); - - return TRUE; -} - - -void -vdriver_get_colors (int first_color, int num_colors, - struct ColorSpec *color_array) -{ - if (vdriver_fixed_clut_p) - { - static const ColorSpec one_bpp_gray_cspecs[2] = { - { CWC (0), { CWC (0xFFFF), CWC (0xFFFF), CWC (0xFFFF) } }, - { CWC (1), { CWC (0x0000), CWC (0x0000), CWC (0x0000) } }, - }; - static const ColorSpec two_bpp_gray_cspecs[4] = { - { CWC (0), { CWC (0xFFFF), CWC (0xFFFF), CWC (0xFFFF) } }, - { CWC (1), { CWC (0xAAAA), CWC (0xAAAA), CWC (0xAAAA) } }, - { CWC (2), { CWC (0x5555), CWC (0x5555), CWC (0x5555) } }, - { CWC (3), { CWC (0x0000), CWC (0x0000), CWC (0x0000) } }, - }; - - gui_assert (two_bit_grayscale_display_p); - gui_assert (first_color >= 0 && first_color + num_colors <= 4); - - memcpy (color_array, - ((vdriver_bpp == 2) - ? &two_bpp_gray_cspecs[first_color] - : &one_bpp_gray_cspecs[first_color]), - num_colors * sizeof color_array[0]); - } - else - { - gui_fatal ("should not be asking for colors! CLUT not fixed"); - } -} - - -vdriver_nextstep_mode_t vdriver_nextstep_modes = -{ - /* contiguous_range_p */ TRUE, - /* num_sizes */ 2, - { - /* min */ { VDRIVER_MIN_SCREEN_WIDTH, VDRIVER_MIN_SCREEN_HEIGHT }, - /* default maximum */ - /* max */ { VDRIVER_DEFAULT_SCREEN_WIDTH, VDRIVER_DEFAULT_SCREEN_HEIGHT }, - }, -}; - - -void -vdriver_flush_display (void) -{ - /* If you take this out, Speedometer 3.23 starts paging massively - * during the 8-bit color QuickDraw tests. It appears that tons - * of stuff starts getting queued up via the Mach message passing - * mechanisms, although that's a very rough guess. Always flushing - * makes it consistently slow but we don't get massive paging. - * And of course we only call this in animation mode. - */ - BLOCK_REAL_INTERRUPTS_EXCURSION - ({ -#ifndef OPENSTEP - DPSFlush (); -#else /* OPENSTEP */ - [[NSDPSContext currentContext] flush]; -#endif /* OPENSTEP */ - }); -} - - -void -host_beep_at_user (void) -{ -#ifndef OPENSTEP - NXBeep (); -#else /* OPENSTEP */ - NSBeep (); -#endif /* OPENSTEP */ -} - - -void -querypointerX (long *xp, long *yp, long *notused) -{ -#ifndef OPENSTEP - NXPoint p; -#else /* OPENSTEP */ - NSPoint p; -#endif /* OPENSTEP */ - - BLOCK_REAL_INTERRUPTS_EXCURSION - ({ -#ifndef OPENSTEP - [[self_view window] getMouseLocation:&p]; - [self_view convertPoint: &p fromView:nil]; -#else /* OPENSTEP */ - p = [[self_view window] mouseLocationOutsideOfEventStream]; -#endif /* OPENSTEP */ - *xp = p.x; - *yp = (vdriver_height - p.y); - }); -} - -void -showcursorX (long show) -{ - BLOCK_REAL_INTERRUPTS_EXCURSION - ({ - if (show) - [realcursor set]; - else - [blankcursor set]; - }); -} - -void -setcursorX (short *data, short *mask, long hotx, long hoty) -{ - char *datap; - short i; - short mymask[16], mydata[16], gray_bits; -#ifndef OPENSTEP - NXPoint p; -#else /* OPENSTEP */ - NSPoint p; -#endif /* OPENSTEP */ - static char beenhere = NO; - - if (hotx < 0) - hotx = 0; - else if (hotx > 16) - hotx = 16; - - if (hoty < 0) - hoty = 0; - else if (hoty > 16) - hoty = 16; - - BLOCK_REAL_INTERRUPTS_EXCURSION - ({ - if (!beenhere) - { - [[self_view window] disableCursorRects]; - beenhere = YES; - } - gray_bits = 0x5555; - for (i = 0; i < 16; ++i) - { - mymask[i] = ~(data[i] | mask[i]); - gray_bits = ~gray_bits; - mydata[i] = data[i] & ~(gray_bits & (~mask[i] & data[i])); - } - -#ifndef OPENSTEP - datap = (char *)[cursorrep data]; -#else /* OPENSTEP */ - datap = (char *)[cursorrep bitmapData]; -#endif /* OPENSTEP */ - memcpy (datap, mydata, 32); - memcpy (datap + 32, mymask, 32); - [cursorimage recache]; - if (CrsrVis) - [blankcursor set]; - -#ifndef OPENSTEP - [realcursor setImage:cursorimage]; -#endif - - p.x = hotx; - p.y = hoty; - -#ifndef OPENSTEP - [realcursor setHotSpot:&p]; -#else /* OPENSTEP */ - [realcursor initWithImage:cursorimage hotSpot:p]; -#endif /* OPENSTEP */ - - if (CrsrVis) - [realcursor set]; - }); -} - -/* - * ROMlib_printtimeout is specifically for Excel, when you try to - * print an empty page. Excel starts the printing process and then - * writes an message to the screen, informing you that you have a - * blank worksheet. This doesn't fit in with our printing paradigm, - * so ROMlib_printtimeout is a hack to solve this one instance of the - * general class of printing problems. - * - * ROMlib_printtimeout is positive when we're counting context - * switches, looking for an OpenPage. - * - * ROMlib_printtimeout is zero if we've timed out, but haven't - * yet finished printing from the NeXT's perspective. - * - * ROMlib_printtimeout is negative when we've finished printing. - * This will result in the screen being updated once we - * drop back into the Mac universe. - */ - -long ROMlib_printtimeout = 10000; /* any positive number will do */ - -- step -{ -#ifndef OPENSTEP - NXEvent dummyEvent; -#else /* OPENSTEP */ -/* NOTE: we may need to be doing SETUPA5 now as well as protect us stuff, - since timerswitch is no longer called */ -#endif /* OPENSTEP */ - - [self lockFocus]; - - do - { - contextswitch (&nextstep_sp, &romlib_sp); - } -#ifndef OPENSTEP - while (printstate != seenOpenDoc && printstate != seenPageSetUp && - [NXApp peekNextEvent: NX_ALLEVENTS into:&dummyEvent] == NULL); -#else /* OPENSTEP */ - while (printstate != seenOpenDoc && printstate != seenPageSetUp - && [NSApp nextEventMatchingMask:NSAnyEventMask - untilDate:[NSDate distantPast] - inMode:NSDefaultRunLoopMode - dequeue:NO] == nil - ); -#endif /* OPENSTEP */ - - [self unlockFocus]; - { - SETUPA5; - if (printstate == seenOpenDoc) - { -#ifndef OPENSTEP - [self printPSCode:self]; -#else /* OPENSTEP */ - [self print:self]; -#endif /* OPENSTEP */ - if (ROMlib_printtimeout == 0) - ROMlib_printtimeout = -1; - } - else if (printstate == seenPageSetUp) - { -#ifndef OPENSTEP - [NXApp runPageLayout:self]; -#else /* OPENSTEP */ - [NSApp runPageLayout:self]; -#endif /* OPENSTEP */ - printstate = __idle; - } - RESTOREA5; - } - - return self; -} - -#ifndef OPENSTEP -static void -timerswitch (DPSTimedEntry notused, double timenow, void *data) -{ - static double oldnow; - - SETUPA5; - if (oldnow == 0.0 || timenow - oldnow > 5 * 50) - { - protectus (0, 0); - oldnow = timenow; - } - /* might be useful to look at timenow and update various low memory - globals */ - [(id) data step]; - RESTOREA5; -} - - -#endif /* not OPENSTEP */ -typedef enum { MacToUNIX, UNIXToMac, MacRTFToUNIX, UNIXRTFToMac } convertdir_t; - -typedef struct { - long first; - long second; -} pair_t; - -unsigned char mactonext[] = { - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, /* NEXTCHAR_QUOTESINGLE, */ - 40, - 41, - 42, - 43, - 44, - 45, - 46, - 47, - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57, - 58, - 59, - 60, - 61, - 62, - 63, - 64, - 65, - 66, - 67, - 68, - 69, - 70, - 71, - 72, - 73, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 82, - 83, - 84, - 85, - 86, - 87, - 88, - 89, - 90, - 91, - 92, - 93, - 94, - 95, - 96, /* NEXTCHAR_GRAVE, */ - 97, - 98, - 99, - 100, - 101, - 102, - 103, - 104, - 105, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 122, - 123, - 124, - 125, - 126, - 127, - NEXTCHAR_ADIERESIS, - NEXTCHAR_ARING, - NEXTCHAR_CCEDILLA, - NEXTCHAR_EACUTE, - NEXTCHAR_NTILDE, - NEXTCHAR_ODIERESIS, - NEXTCHAR_UDIERESIS, - NEXTCHAR_aACUTE, - NEXTCHAR_aGRAVE, - NEXTCHAR_aCIRCUMFLEX, - NEXTCHAR_aDIERESIS, - NEXTCHAR_aTILDE, - NEXTCHAR_aRING, - NEXTCHAR_cCEDILLA, - NEXTCHAR_eACUTE, - NEXTCHAR_eGRAVE, - NEXTCHAR_eCIRCUMFLEX, - NEXTCHAR_eDIERESIS, - NEXTCHAR_iACUTE, - NEXTCHAR_iGRAVE, - NEXTCHAR_iCIRCUMFLEX, - NEXTCHAR_iDIERESIS, - NEXTCHAR_nTILDE, - NEXTCHAR_oACUTE, - NEXTCHAR_oGRAVE, - NEXTCHAR_oCIRCUMFLEX, - NEXTCHAR_oDIERESIS, - NEXTCHAR_oTILDE, - NEXTCHAR_uACUTE, - NEXTCHAR_uGRAVE, - NEXTCHAR_uCIRCUMFLEX, - NEXTCHAR_uDIERESIS, - NEXTCHAR_DAGGER, - NEXTCHAR_DEGREE, - NEXTCHAR_CENT, - NEXTCHAR_STERLING, - NEXTCHAR_SECTION, - NEXTCHAR_BULLET, - NEXTCHAR_PARAGRAPH, - NEXTCHAR_GERMANDBLS, - NEXTCHAR_REGISTERED, - NEXTCHAR_COPYRIGHT, - NEXTCHAR_TRADEMARK, - NEXTCHAR_ACUTE, - NEXTCHAR_DIERESIS, - NEXTCHAR_NOTEQUAL, - NEXTCHAR_AE, - NEXTCHAR_OSLASH, - NEXTCHAR_INFINITY, - NEXTCHAR_PLUSMINUS, - NEXTCHAR_LESSEQUAL, - NEXTCHAR_GREATEQUAL, - NEXTCHAR_YEN, - NEXTCHAR_MU, - NEXTCHAR_PARTIALDIFF, - NEXTCHAR_SUMMATION, - NEXTCHAR_PRODUCT, - NEXTCHAR_PI, - NEXTCHAR_INTEGRAL, - NEXTCHAR_ORDFEMININE, - NEXTCHAR_ORDMASCULINE, - NEXTCHAR_OMEGA, - NEXTCHAR_ae, - NEXTCHAR_oSLASH, - NEXTCHAR_QUESTIONDOWN, - NEXTCHAR_EXCLAMDOWN, - NEXTCHAR_LOGICALNOT, - NEXTCHAR_RADICAL, - NEXTCHAR_FLORIN, - NEXTCHAR_APPROXEQUAL, - NEXTCHAR_DELTA, - NEXTCHAR_GUILLEMOTLEFT, - NEXTCHAR_GUILLEMOTRIGHT, - NEXTCHAR_ELLIPSIS, - NEXTCHAR_FIGSP, - NEXTCHAR_AGRAVE, - NEXTCHAR_ATILDE, - NEXTCHAR_OTILDE, - NEXTCHAR_OE, - NEXTCHAR_oe, - NEXTCHAR_ENDASH, - NEXTCHAR_EMDASH, - NEXTCHAR_QUOTEDBLLEFT, - NEXTCHAR_QUOTEDBLRIGHT, - NEXTCHAR_GRAVE, /* NEXTCHAR_QUOTELEFT, */ - NEXTCHAR_QUOTESINGLE, /* NEXTCHAR_QUOTERIGHT, */ - NEXTCHAR_DIVIDE, - NEXTCHAR_LOZENGE, - NEXTCHAR_yDIERESIS, - NEXTCHAR_YDIERESIS, - NEXTCHAR_FRACTION, - NEXTCHAR_CURRENCY, - NEXTCHAR_GUILSINGLLEFT, - NEXTCHAR_GUILSINGLRIGHT, - NEXTCHAR_FI, - NEXTCHAR_FL, - NEXTCHAR_DAGGERDBL, - NEXTCHAR_PERIODCENTERED, - NEXTCHAR_QUOTESINGLBASE, - NEXTCHAR_QUOTEDBLBASE, - NEXTCHAR_PERTHOUSAND, - NEXTCHAR_ACIRCUMFLEX, - NEXTCHAR_ECIRCUMFLEX, - NEXTCHAR_AACUTE, - NEXTCHAR_EDIERESIS, - NEXTCHAR_EGRAVE, - NEXTCHAR_IACUTE, - NEXTCHAR_ICIRCUMFLEX, - NEXTCHAR_IDIERESIS, - NEXTCHAR_IGRAVE, - NEXTCHAR_OACUTE, - NEXTCHAR_OCIRCUMFLEX, - NEXTCHAR_APPLE, - NEXTCHAR_OGRAVE, - NEXTCHAR_UACUTE, - NEXTCHAR_UCIRCUMFLEX, - NEXTCHAR_UGRAVE, - NEXTCHAR_DOTLESSI, - NEXTCHAR_CIRCUMFLEX, - NEXTCHAR_TILDE, - NEXTCHAR_MACRON, - NEXTCHAR_BREVE, - NEXTCHAR_DOTACCENT, - NEXTCHAR_RING, - NEXTCHAR_CEDILLA, - NEXTCHAR_HUNGARUMLAUT, - NEXTCHAR_OGONEK, - NEXTCHAR_CARON -}; - -unsigned char nexttomac[] = { - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, /* MACCHAR_QUOTERIGHT, */ - 40, - 41, - 42, - 43, - 44, - 45, - 46, - 47, - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57, - 58, - 59, - 60, - 61, - 62, - 63, - 64, - 65, - 66, - 67, - 68, - 69, - 70, - 71, - 72, - 73, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 82, - 83, - 84, - 85, - 86, - 87, - 88, - 89, - 90, - 91, - 92, - 93, - 94, - 95, - 96, /* MACCHAR_QUOTELEFT, */ - 97, - 98, - 99, - 100, - 101, - 102, - 103, - 104, - 105, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 122, - 123, - 124, - 125, - 126, - 127, - MACCHAR_FIGSP, - MACCHAR_AGRAVE, - MACCHAR_AACUTE, - MACCHAR_ACIRCUMFLEX, - MACCHAR_ATILDE, - MACCHAR_ADIERESIS, - MACCHAR_ARING, - MACCHAR_CCEDILLA, - MACCHAR_EGRAVE, - MACCHAR_EACUTE, - MACCHAR_ECIRCUMFLEX, - MACCHAR_EDIERESIS, - MACCHAR_IGRAVE, - MACCHAR_IACUTE, - MACCHAR_ICIRCUMFLEX, - MACCHAR_IDIERESIS, - MACCHAR_ETH, - MACCHAR_NTILDE, - MACCHAR_OGRAVE, - MACCHAR_OACUTE, - MACCHAR_OCIRCUMFLEX, - MACCHAR_OTILDE, - MACCHAR_ODIERESIS, - MACCHAR_UGRAVE, - MACCHAR_UACUTE, - MACCHAR_UCIRCUMFLEX, - MACCHAR_UDIERESIS, - MACCHAR_YACUTE, - MACCHAR_THORN, - MACCHAR_MU, - MACCHAR_MULTIPLY, - MACCHAR_DIVIDE, - MACCHAR_COPYRIGHT, - MACCHAR_EXCLAMDOWN, - MACCHAR_CENT, - MACCHAR_STERLING, - MACCHAR_FRACTION, - MACCHAR_YEN, - MACCHAR_FLORIN, - MACCHAR_SECTION, - MACCHAR_CURRENCY, - MACCHAR_QUOTERIGHT, /* MACCHAR_QUOTESINGLE, */ - MACCHAR_QUOTEDBLLEFT, - MACCHAR_GUILLEMOTLEFT, - MACCHAR_GUILSINGLLEFT, - MACCHAR_GUILSINGLRIGHT, - MACCHAR_FI, - MACCHAR_FL, - MACCHAR_REGISTERED, - MACCHAR_ENDASH, - MACCHAR_DAGGER, - MACCHAR_DAGGERDBL, - MACCHAR_PERIODCENTERED, - MACCHAR_BROKENBAR, - MACCHAR_PARAGRAPH, - MACCHAR_BULLET, - MACCHAR_QUOTESINGLBASE, - MACCHAR_QUOTEDBLBASE, - MACCHAR_QUOTEDBLRIGHT, - MACCHAR_GUILLEMOTRIGHT, - MACCHAR_ELLIPSIS, - MACCHAR_PERTHOUSAND, - MACCHAR_LOGICALNOT, - MACCHAR_QUESTIONDOWN, - MACCHAR_ONESUPERIOR, - MACCHAR_QUOTELEFT, /* MACCHAR_GRAVE, */ - MACCHAR_ACUTE, - MACCHAR_CIRCUMFLEX, - MACCHAR_TILDE, - MACCHAR_MACRON, - MACCHAR_BREVE, - MACCHAR_DOTACCENT, - MACCHAR_DIERESIS, - MACCHAR_TWOSUPERIOR, - MACCHAR_RING, - MACCHAR_CEDILLA, - MACCHAR_THREESUPERIOR, - MACCHAR_HUNGARUMLAUT, - MACCHAR_OGONEK, - MACCHAR_CARON, - MACCHAR_EMDASH, - MACCHAR_PLUSMINUS, - MACCHAR_ONEQUARTER, - MACCHAR_ONEHALF, - MACCHAR_THREEQUARTERS, - MACCHAR_aGRAVE, - MACCHAR_aACUTE, - MACCHAR_aCIRCUMFLEX, - MACCHAR_aTILDE, - MACCHAR_aDIERESIS, - MACCHAR_aRING, - MACCHAR_cCEDILLA, - MACCHAR_eGRAVE, - MACCHAR_eACUTE, - MACCHAR_eCIRCUMFLEX, - MACCHAR_eDIERESIS, - MACCHAR_iGRAVE, - MACCHAR_AE, - MACCHAR_iACUTE, - MACCHAR_ORDFEMININE, - MACCHAR_iCIRCUMFLEX, - MACCHAR_iDIERESIS, - MACCHAR_eTH, - MACCHAR_nTILDE, - MACCHAR_LSLASH, - MACCHAR_OSLASH, - MACCHAR_OE, - MACCHAR_ORDMASCULINE, - MACCHAR_oGRAVE, - MACCHAR_oACUTE, - MACCHAR_oCIRCUMFLEX, - MACCHAR_oTILDE, - MACCHAR_oDIERESIS, - MACCHAR_ae, - MACCHAR_uGRAVE, - MACCHAR_uACUTE, - MACCHAR_uCIRCUMFLEX, - MACCHAR_DOTLESSI, - MACCHAR_uDIERESIS, - MACCHAR_yACUTE, - MACCHAR_lSLASH, - MACCHAR_oSLASH, - MACCHAR_oe, - MACCHAR_GERMANDBLS, - MACCHAR_tHORN, - MACCHAR_yDIERESIS, - MACCHAR_NEXT254, - MACCHAR_NEXT255 -}; - - -void converthex(char **h, unsigned char *table) -{ - unsigned int val, val2; - char *p; - - p = *h; - if (*p <= 'f' && *p >= 'a') - val = *p - 'a' + 10; - else if (*p <= 'F' && *p >= 'A') - val = *p - 'A' + 10; - else - val = *p - '0'; - - if (*(p + 1) <= 'f' && *(p + 1) >= 'a') - val = val * 16 + *(p + 1) - 'a' + 10; - else if (*(p + 1) <= 'F' && *(p + 1) >= 'A') - val = val * 16 + *(p + 1) - 'A' + 10; - else - val = val * 16 + *(p + 1) - '0'; - - val = table[val]; - val2 = val/16; - if (val2 > 9) - *p++ = val2 + 'a' - 10; - else - *p++ = val2 + '0'; - - val2 = val & 0xF; - if (val2 > 9) - *p++ = val2 + 'a' - 10; - else - *p++ = val2 + '0'; -} - -void convertchars(char *data, long length, unsigned char *table) -{ - char *ep; - int escaped; - - escaped = NO; - ep = data + length; - while (data < ep) { - if (escaped && *data == '\'') { - *data++ = '\''; - converthex(&data, table); - } - if (*data == '\\') - escaped = YES; - else - escaped = NO; - *data++ = table[*(unsigned char *)data]; - } -} - -#ifndef OPENSTEP -static int unixrtfconvert(int length, char *ip, char *op) -#else /* OPENSTEP */ -static int unixrtfconvert(int length, const char *ip, char *op) -#endif /* OPENSTEP */ -{ -#ifndef OPENSTEP - char *fromp, *ep; -#else /* OPENSTEP */ - const char *fromp, *ep; -#endif /* OPENSTEP */ - int retval; - - retval = length; - fromp = ip; - ep = ip + length; - while (fromp < ep) { - if (*fromp == '\n') { - *op++ = '\r'; - fromp++; - } else if (*fromp == '\\') { - *op++ = '\\'; - fromp++; - if (fromp < ep && *fromp == '\n') { -#if !defined (WEDONTNEEDNOSTEENINGPAR) - strcpy(op, "par \n"); - op += 5; - fromp++; - retval += 4; -#else /* WEDONTNEEDNOSTEENINGPAR */ - *op++ = '\r'; - fromp++; -#endif /* WEDONTNEEDNOSTEENINGPAR */ - } else if (fromp + 2 < ep && !strncmp(fromp, "ul0", 3)) { - strcpy(op, "ulnone"); - op += 6; - fromp += 3; - retval += 3; - } else if (fromp + 6 < ep && !strncmp(fromp, "fonttbl", 6)) { - strcpy(op, "fonttbl\\f99\\fa b;"); - op += 17; - fromp += 7; - retval += 10; - } else - *op++ = *fromp++; - } else - *op++ = *fromp++; - } - return retval; -} - -static inline void copyandtranslate( char *cp, char **ipp, char **opp) -{ - *cp = *(*ipp)++; - if (*cp == '\r') - *cp = '\n'; - *(*opp)++ = *cp; -} - -#define PREFIX "\\endnhere" -#define NCHARPREFIX (sizeof(PREFIX)-1) - -#define STICKIN \ - "{\\fonttbl" \ - "{\\f0\\fswiss Helvetica;}" \ - "{\\f3\\fmodern Courier;}" \ - "{\\f4\\fmodern Ohlfs;}" \ - "{\\f20\\froman Times;}" \ - "{\\f21\\fswiss Helvetica;}" \ - "{\\f22\\fmodern Courier;}" \ - "}\\f0" -#define NCHARSTICKIN (sizeof(STICKIN)-1) - -#ifndef OPENSTEP -static int macrtfconvert(int length, char *ip, char *op) -#else /* OPENSTEP */ -static int macrtfconvert(int length, const char *ip, char *op) -#endif /* OPENSTEP */ -{ - int retval, index; - char c; - SETUPA5; - - retval = length; - index = 0; - while (length > 0 && index < NCHARPREFIX) { - copyandtranslate(&c, &ip, &op); - if (PREFIX[index] == c) - ++index; - else if (PREFIX[0] == c) - index = 1; - else - index = 0; - --length; - } - if (length > 0) { - retval += insertfonttbl(&op, (char) -1); - } - while (--length >= 0) - copyandtranslate(&c, &ip, &op); - RESTOREA5; - return retval; -} - -#ifndef OPENSTEP -static int convertreturns(char *datain, char *dataout, int length, -#else /* OPENSTEP */ -static int convertreturns(const char *datain, char *dataout, int length, -#endif /* OPENSTEP */ - convertdir_t dir) -{ - char from, to; - - switch (dir) { - case MacToUNIX: - bcopy(datain, dataout, length); - from = '\r'; - to = '\n'; - break; - case UNIXToMac: - bcopy(datain, dataout, length); - from = '\n'; - to = '\r'; - break; - case MacRTFToUNIX: -/*-->*/ return macrtfconvert(length, datain, dataout); - break; - case UNIXRTFToMac: -/*-->*/ return unixrtfconvert(length, datain, dataout); - break; - default: - from = 0; - to = 0; - gui_abort(); - } - while (--length >= 0) - if (*dataout++ == from) - dataout[-1] = to; - return 0; -} - -/* - * NOTE: the code below should be table driven. - */ - -#ifndef OPENSTEP -static NXAtom ARDIPICTPboardType = "PICT"; -#else /* OPENSTEP */ -#define ARDIPICTPboardType @"PICT" -#endif /* OPENSTEP */ - -#define TEXT (('T'<<24)|('E'<<16)|('X'<<8)|'T') -#define EPS (('E'<<24)|('P'<<16)|('S'<<8)|' ') -#define RTF (('R'<<24)|('T'<<16)|('F'<<8)|' ') -#define TIFF (('T'<<24)|('I'<<16)|('F'<<8)|'F') -#define PICT (('P'<<24)|('I'<<16)|('C'<<8)|'T') - -id ROMlib_pasteboard = 0; -int ROMlib_ourchangecount; - -void -PutScrapX (long type, long length, char *p) -{ - static int count = 0; - static int textcount = 0, epscount = 0, rtfcount = 0, tiffcount = 0, - pictcount = 0; - static char *textdata, *epsdata, *rtfdata, *tiffdata, *pictdata; - static long textlength, epslength, rtflength, tifflength, pictlength; - char doit; -#ifndef OPENSTEP - char const *types[5]; - int i; -#else /* OPENSTEP */ - NSMutableArray *types; -#endif /* OPENSTEP */ - virtual_int_state_t block; - long fonttblextra; - - SETUPA5; -#ifdef OPENSTEP - - types = [NSMutableArray arrayWithCapacity:5]; - -#endif /* OPENSTEP */ - block = block_virtual_ints (); - if (!ROMlib_pasteboard) -#ifndef OPENSTEP - ROMlib_pasteboard =[Pasteboard new]; -#else /* OPENSTEP */ - ROMlib_pasteboard =[NSPasteboard generalPasteboard]; -#endif /* OPENSTEP */ - doit = NO; - switch (type) - { - case TEXT: - if (count == textcount) - ++count; - textcount = count; - if (textdata) - free (textdata); - textdata = malloc (length); - convertreturns (p, textdata, length, MacToUNIX); - convertchars (textdata, length, mactonext); - textlength = length; - doit = YES; - break; - case EPS: - if (count == epscount) - ++count; - epscount = count; - if (epsdata) - free (epsdata); - epsdata = malloc (length); - convertreturns (p, epsdata, length, MacToUNIX); - epslength = length; - doit = YES; - break; - case RTF: - if (count == rtfcount) - ++count; - rtfcount = count; - if (rtfdata) - free (rtfdata); - - - fonttblextra = insertfonttbl ((char **) 0, (char) 0); - - rtfdata = malloc (length + fonttblextra); - rtflength = convertreturns (p, rtfdata, length, MacRTFToUNIX); - convertchars (rtfdata, rtflength, mactonext); - doit = YES; - break; - case TIFF: - if (count == tiffcount) - ++count; - tiffcount = count; - if (tiffdata) - free (tiffdata); - tiffdata = malloc (length); - bcopy (p, tiffdata, length); - tifflength = length; - doit = YES; - break; - case PICT: - if (count == pictcount) - ++count; - pictcount = count; - if (pictdata) - free (pictdata); - pictdata = malloc (length); - bcopy (p, pictdata, length); - pictlength = length; - doit = YES; - break; - default: - ; - } - - if (doit) - { -#ifndef OPENSTEP - i = -1; - if (rtfcount == count) - types[++i] = NXRTFPboardType; - if (epscount == count) - types[++i] = NXPostScriptPboardType; - if (textcount == count) - types[++i] = NXAsciiPboardType; - if (tiffcount == count) - types[++i] = NXTIFFPboardType; - if (pictcount == count) - types[++i] = ARDIPICTPboardType; - [ROMlib_pasteboard declareTypes: types num: i + 1 owner:0]; -#endif /* not OPENSTEP */ - if (rtfcount == count) -#ifndef OPENSTEP - [ROMlib_pasteboard writeType: NXRTFPboardType data:rtfdata - length:rtflength]; -#else /* OPENSTEP */ - [types addObject:NSRTFPboardType]; -#endif /* OPENSTEP */ - if (epscount == count) -#ifndef OPENSTEP - [ROMlib_pasteboard writeType: NXPostScriptPboardType data:epsdata - length:epslength]; -#else /* OPENSTEP */ - [types addObject:NSPostScriptPboardType]; -#endif /* OPENSTEP */ - if (textcount == count) -#ifndef OPENSTEP - [ROMlib_pasteboard writeType: NXAsciiPboardType data:textdata - length:textlength]; -#else /* OPENSTEP */ - [types addObject:NSStringPboardType]; -#endif /* OPENSTEP */ - if (tiffcount == count) -#ifndef OPENSTEP - [ROMlib_pasteboard writeType: NXTIFFPboardType data:tiffdata - length:tifflength]; -#else /* OPENSTEP */ - [types addObject:NSTIFFPboardType]; -#endif /* OPENSTEP */ - if (pictcount == count) -#ifndef OPENSTEP - [ROMlib_pasteboard writeType: ARDIPICTPboardType data:pictdata - length:pictlength]; -#else /* OPENSTEP */ - [types addObject:ARDIPICTPboardType]; - [ROMlib_pasteboard declareTypes: types owner:NULL]; - if (rtfcount == count) - [ROMlib_pasteboard setData: [NSData dataWithBytesNoCopy:rtfdata length:rtflength] forType:NSRTFPboardType]; - if (epscount == count) - [ROMlib_pasteboard setData:[NSData dataWithBytesNoCopy:epsdata length:epslength] forType:NSPostScriptPboardType]; - if (textcount == count) - [ROMlib_pasteboard setData:[NSData dataWithBytesNoCopy:textdata length:textlength] forType:NSStringPboardType]; - if (tiffcount == count) - [ROMlib_pasteboard setData:[NSData dataWithBytesNoCopy:tiffdata length:tifflength] forType:NSTIFFPboardType]; - if (pictcount == count) - [ROMlib_pasteboard setData:[NSData dataWithBytesNoCopy:pictdata length:pictlength] forType:ARDIPICTPboardType]; -#endif /* OPENSTEP */ - } - ROMlib_ourchangecount =[ROMlib_pasteboard changeCount]; - restore_virtual_ints (block); - RESTOREA5; -} - -#define noErr 0 - -long -GetScrapX (long type, char **h) -{ -#ifndef OPENSTEP - const NXAtom *types; - char *data; - int length; - NXAtom tofind; -#else /* OPENSTEP */ - NSArray *types; - NSData *data; - NSString *tofind; -#endif /* OPENSTEP */ - long retval; - int temp; - virtual_int_state_t block; - - SETUPA5; - block = block_virtual_ints (); - if (!ROMlib_pasteboard) -#ifndef OPENSTEP - ROMlib_pasteboard =[Pasteboard new]; -#else /* OPENSTEP */ - ROMlib_pasteboard =[NSPasteboard generalPasteboard]; -#endif /* OPENSTEP */ - retval = -1; - switch (type) - { - case TEXT: -#ifndef OPENSTEP - tofind = NXAsciiPboardType; -#else /* OPENSTEP */ - tofind = NSStringPboardType; -#endif /* OPENSTEP */ - break; - case RTF: -#ifndef OPENSTEP - tofind = NXRTFPboardType; -#else /* OPENSTEP */ - tofind = NSRTFPboardType; -#endif /* OPENSTEP */ - break; - case EPS: -#ifndef OPENSTEP - tofind = NXPostScriptPboardType; -#else /* OPENSTEP */ - tofind = NSPostScriptPboardType; -#endif /* OPENSTEP */ - break; - case TIFF: -#ifndef OPENSTEP - tofind = NXTIFFPboardType; -#else /* OPENSTEP */ - tofind = NSTIFFPboardType; -#endif /* OPENSTEP */ - break; - case PICT: - tofind = ARDIPICTPboardType; - break; - default: - tofind = 0; - break; - } - if (tofind && - (temp = [ROMlib_pasteboard changeCount]) > ROMlib_ourchangecount) - { - types =[ROMlib_pasteboard types]; -#ifndef OPENSTEP - while (*types && strcmp (*types, tofind) != 0) - ++types; - if (*types - && [ROMlib_pasteboard readType: *types data: &data length:&length]) -#else /* OPENSTEP */ - - if ([types indexOfObject:tofind] != NSNotFound - && (data = [ROMlib_pasteboard dataForType:tofind])) -#endif /* OPENSTEP */ - { -#ifndef OPENSTEP - if (tofind == NXRTFPboardType) -#else /* OPENSTEP */ - if (tofind == NSRTFPboardType) -#endif /* OPENSTEP */ - { -#ifndef OPENSTEP - ReallocHandle ((Handle) h, length * 2); -#else /* OPENSTEP */ - ReallocHandle ((Handle) h, [data length] * 2); -#endif /* OPENSTEP */ - if (MemErr != noErr) - { - retval = -1; -/*-->*/ goto DONE; - } -#ifndef OPENSTEP - retval = convertreturns (data, MR (*h), length, UNIXRTFToMac); -#else /* OPENSTEP */ - retval = convertreturns ([data bytes], MR (*h), [data length], UNIXRTFToMac); -#endif /* OPENSTEP */ - convertchars (MR (*h), retval, nexttomac); - ReallocHandle ((Handle) h, retval); - if (MemErr != noErr) - retval = -1; -/*-->*/ goto DONE; - } - else - { -#ifndef OPENSTEP - ReallocHandle ((Handle) h, length); -#else /* OPENSTEP */ - ReallocHandle ((Handle) h, [data length]); -#endif /* OPENSTEP */ - if (MemErr != noErr) - { - retval = -1; -/*-->*/ goto DONE; - } -#ifndef OPENSTEP - if (tofind != NXTIFFPboardType && tofind != ARDIPICTPboardType) - convertreturns (data, MR (*h), length, UNIXToMac); -#else /* OPENSTEP */ - if (tofind != NSTIFFPboardType && tofind != ARDIPICTPboardType) - convertreturns ([data bytes], MR (*h), [data length], UNIXToMac); -#endif /* OPENSTEP */ - else -#ifndef OPENSTEP - bcopy (data, MR (*h), length); - if (tofind == NXAsciiPboardType) - convertchars (MR (*h), length, nexttomac); -#else /* OPENSTEP */ - bcopy ([data bytes], MR (*h), [data length]); - if (tofind == NSStringPboardType) - convertchars (MR (*h), [data length], nexttomac); -#endif /* OPENSTEP */ - } -#ifndef OPENSTEP - vm_deallocate (task_self (), (vm_address_t) data, length); - retval = length; -#else /* OPENSTEP */ - retval = [data length]; -#endif /* OPENSTEP */ - } - else - { - ROMlib_ZeroScrap (); - } - } - DONE: - restore_virtual_ints (block); - RESTOREA5; - return retval; -} - - -void -ROMlib_SetTitle (char *newtitle) -{ - BLOCK_REAL_INTERRUPTS_EXCURSION - ({ -#ifndef OPENSTEP - [[self_view window] setTitle:newtitle]; -#else /* OPENSTEP */ - [[self_view window] setTitle:[NSString stringWithCString:newtitle]]; -#endif /* OPENSTEP */ - }); -} - - -void -host_set_cursor (char *cursor_data, - unsigned short cursor_mask[16], - int hotspot_x, int hotspot_y) -{ - setcursorX ((short *)cursor_data, (short *)cursor_mask, - hotspot_x, hotspot_y); -} - - -int -host_set_cursor_visible (int show_p) -{ - static int prev_show_p = FALSE; - int retval; - - showcursorX (show_p); - retval = prev_show_p; - prev_show_p = show_p; - return retval; -} - - -void -host_flush_shadow_screen (void) -{ - int top_long, left_long, bottom_long, right_long; - - /* Lazily allocate a shadow screen. We won't be doing refresh that often, - * so don't waste the memory unless we need it. - */ - if (shadow_fbuf == NULL) - { - shadow_fbuf = malloc (fbuf_size); - memcpy (shadow_fbuf, vdriver_fbuf, vdriver_row_bytes * vdriver_height); - vdriver_update_screen (0, 0, vdriver_height, vdriver_width, FALSE); - } - else if (find_changed_rect_and_update_shadow ((uint32 *) vdriver_fbuf, - (uint32 *) shadow_fbuf, - (vdriver_row_bytes - / sizeof (uint32)), - vdriver_height, - &top_long, &left_long, - &bottom_long, &right_long)) - { - vdriver_update_screen (top_long, (left_long * 32) >> vdriver_log2_bpp, - bottom_long, - (right_long * 32) >> vdriver_log2_bpp, FALSE); - } -} - - -/* The following allows MacViewClass to grab the mousedown event that activates - * the window. By default, the View's acceptsFirstMouse returns NO. - */ -- (BOOL)acceptsFirstMouse -{ - return YES; -} - -- (BOOL) acceptsFirstResponder -{ - return YES; -} - -/* These are methods in this file and also Mac #defines. */ -#undef mouseUp -#undef mouseDown -#undef keyDown -#undef keyUp - -#ifndef OPENSTEP -- mouseDown:(NXEvent *) eventp -#else /* OPENSTEP */ -- (void)mouseDown:(NSEvent *) eventp -#endif /* OPENSTEP */ -{ - SETUPA5; -#ifndef OPENSTEP - [self convertPoint: &eventp->location fromView:nil]; -#endif /* not OPENSTEP */ - postnextevent (eventp); - RESTOREA5; -#ifndef OPENSTEP - - return self; -#endif /* not OPENSTEP */ -} - -#ifndef OPENSTEP --mouseMoved:(NXEvent *) eventp -#else /* OPENSTEP */ -- (void)mouseMoved:(NSEvent *) eventp -#endif /* OPENSTEP */ -{ - SETUPA5; -#ifndef OPENSTEP - [self convertPoint: &eventp->location fromView:nil]; -#endif /* not OPENSTEP */ - ROMlib_updatemouselocation (eventp); - RESTOREA5; -#ifndef OPENSTEP - return self; -#endif /* not OPENSTEP */ -} - -#ifndef OPENSTEP --mouseDragged:(NXEvent *) eventp -#else /* OPENSTEP */ --(void)mouseDragged:(NSEvent *) eventp -#endif /* OPENSTEP */ -{ - SETUPA5; -#ifndef OPENSTEP - [self convertPoint: &eventp->location fromView:nil]; -#endif /* not OPENSTEP */ - ROMlib_updatemouselocation (eventp); - RESTOREA5; -#ifndef OPENSTEP - return self; -#endif /* not OPENSTEP */ -} - -#ifndef OPENSTEP --mouseUp:(NXEvent *) eventp -#else /* OPENSTEP */ -- (void)mouseUp:(NSEvent *) eventp -#endif /* OPENSTEP */ -{ - SETUPA5; -#ifndef OPENSTEP - [self convertPoint: &eventp->location fromView:nil]; -#endif /* not OPENSTEP */ - postnextevent (eventp); - RESTOREA5; -#ifndef OPENSTEP - - return self; -#endif /* not OPENSTEP */ -} - -#ifndef OPENSTEP --mouseEntered:(NXEvent *) eventp -#else /* OPENSTEP */ --(void)mouseEntered:(NSEvent *) eventp -#endif /* OPENSTEP */ -{ - SETUPA5; - if (CrsrVis) - [realcursor set]; - else - [blankcursor set]; -#ifndef OPENSTEP - [self convertPoint: &eventp->location fromView:nil]; -#endif /* not OPENSTEP */ - postnextevent (eventp); - RESTOREA5; -#ifndef OPENSTEP - return self; -#endif /* not OPENSTEP */ -} - -#ifndef OPENSTEP --mouseExited:(NXEvent *) eventp -#else /* OPENSTEP */ --(void)mouseExited:(NSEvent *) eventp -#endif /* OPENSTEP */ -{ - SETUPA5; -#ifndef OPENSTEP - [NXArrow set]; - [self convertPoint: &eventp->location fromView:nil]; -#else /* OPENSTEP */ -#warning need to call setOnMouseExited when we set up the view ... -#endif /* OPENSTEP */ - postnextevent (eventp); - RESTOREA5; -#ifndef OPENSTEP - return self; -#endif /* not OPENSTEP */ -} - -#ifndef OPENSTEP --keyDown:(NXEvent *) eventp -#else /* OPENSTEP */ --(void)keyDown:(NSEvent *) eventp -#endif /* OPENSTEP */ -{ - SETUPA5; -#ifndef OPENSTEP - [self convertPoint: &eventp->location fromView:nil]; -#endif /* not OPENSTEP */ - postnextevent (eventp); - RESTOREA5; -#ifndef OPENSTEP - return self; -#endif /* not OPENSTEP */ -} - -static struct -{ - long mask; - char key; -} maskkeys[] = { -#ifndef OPENSTEP - { NX_ALPHASHIFTMASK, 0x39, }, - { NX_SHIFTMASK, 0x38, }, - { NX_CONTROLMASK, 0x3B, }, - { NX_ALTERNATEMASK, 0x3A, }, - { NX_COMMANDMASK, 0x37, }, -#else /* OPENSTEP */ - { NSAlphaShiftKeyMask, 0x39, }, - { NSShiftKeyMask, 0x38, }, - { NSControlKeyMask, 0x3B, }, - { NSAlternateKeyMask, 0x3A, }, - { NSCommandKeyMask, 0x37, }, -#endif /* OPENSTEP */ -}; - -#ifndef OPENSTEP --flagsChanged:(NXEvent *) eventp -#else /* OPENSTEP */ --(void)flagsChanged:(NSEvent *) eventp -#endif /* OPENSTEP */ -{ - int i; - - SETUPA5; - for (i = NELEM (maskkeys); --i >= 0;) - { -#ifndef OPENSTEP - ROMlib_zapmap (maskkeys[i].key, !!(eventp->flags & maskkeys[i].mask)); -#else /* OPENSTEP */ - ROMlib_zapmap (maskkeys[i].key, !!([eventp modifierFlags] & maskkeys[i].mask)); -#endif /* OPENSTEP */ - } - /* If shift is down, assume caps lock is not. The NeXT doesn't give us - * a separate bit for just caps lock, which we need for Solarian. This - * will give us a decent (but imperfect) approximation... - */ -#ifndef OPENSTEP - if (eventp->flags & NX_SHIFTMASK) -#else /* OPENSTEP */ - if ([eventp modifierFlags] & NSShiftKeyMask) -#endif /* OPENSTEP */ - ROMlib_zapmap (0x39, 0); -#ifndef OPENSTEP - ROMlib_mods = ROMlib_next_butmods_to_mac_butmods (eventp->flags); -#else /* OPENSTEP */ - ROMlib_mods = ROMlib_next_butmods_to_mac_butmods ([eventp modifierFlags]); -#endif /* OPENSTEP */ - RESTOREA5; -#ifndef OPENSTEP - return self; -#endif /* not OPENSTEP */ -} - -typedef enum { APP_NOT_STARTED, APP_IS_RUNNING, APP_DIED } app_state_t; - -static app_state_t app_state = APP_NOT_STARTED; - -void ROMlib_startapp( void ) -{ - id abort_cell; - -#ifndef OPENSTEP - abort_cell = [global_menu findCellWithTag:11]; - [abort_cell setTitleNoCopy:"Abort..."]; -#else /* OPENSTEP */ - abort_cell = [global_menu itemWithTag:11]; - [abort_cell setTitle:@"Abort..."]; -#endif /* OPENSTEP */ - app_state = APP_IS_RUNNING; -} - -#ifndef OPENSTEP --(BOOL) performKeyEquivalent:(NXEvent *) eventp -#else /* OPENSTEP */ --(BOOL) performKeyEquivalent:(NSEvent *) eventp -#endif /* OPENSTEP */ -{ - if (app_state == APP_IS_RUNNING) - { - SETUPA5; -#ifndef OPENSTEP - [self convertPoint: &eventp->location fromView:nil]; -#endif /* not OPENSTEP */ - postnextevent (eventp); - RESTOREA5; - return YES; - } - else - { - return [super performKeyEquivalent:eventp]; - } -} - -#ifndef OPENSTEP --keyUp:(NXEvent *) eventp -#else /* OPENSTEP */ --(void) keyUp:(NSEvent *) eventp -#endif /* OPENSTEP */ -{ - SETUPA5; -#ifndef OPENSTEP - [self convertPoint: &eventp->location fromView:nil]; -#endif /* not OPENSTEP */ - postnextevent (eventp); - RESTOREA5; -#ifndef OPENSTEP - return self; -#endif /* not OPENSTEP */ -} - - -#ifndef OPENSTEP -- pause:sender -#else /* OPENSTEP */ -- (void) pause:sender -#endif /* OPENSTEP */ -{ - id pause_cell; - static char oldtitle[80]; - -#ifndef OPENSTEP - pause_cell = [global_menu findCellWithTag:10]; - if ([pause_cell title][0] == 'P') -#else /* OPENSTEP */ - pause_cell = [global_menu itemWithTag:10]; - if ([[pause_cell title] characterAtIndex:0] == 'P') -#endif /* OPENSTEP */ - { -#ifndef OPENSTEP - DPSRemoveTimedEntry(timer); - strncpy(oldtitle, [[self window] title], sizeof(oldtitle)); - oldtitle[sizeof(oldtitle)-1] = 0; - [[self window] setTitle:"Executor is PAUSED"]; - [pause_cell setTitleNoCopy:"Continue"]; -#else /* OPENSTEP */ - [our_timer invalidate]; - [[[self window] title] getCString:oldtitle maxLength:sizeof(oldtitle)-1]; - [[self window] setTitle:@"Executor is PAUSED"]; - [pause_cell setTitle:@"Continue"]; -#endif /* OPENSTEP */ - } - else - { -#ifndef OPENSTEP - [[self window] setTitle:oldtitle]; - [pause_cell setTitleNoCopy:"Pause"]; - timer = DPSAddTimedEntry(0, &timerswitch, self, NX_BASETHRESHOLD); -#else /* OPENSTEP */ - [[self window] setTitle:[NSString stringWithCString:oldtitle]]; - [pause_cell setTitle:@"Pause"]; - create_our_timer (self); -#endif /* OPENSTEP */ - } -#ifndef OPENSTEP - return self; -#endif /* not OPENSTEP */ -} - -#ifndef OPENSTEP -- abort:sender -#else /* OPENSTEP */ -- (void) abort:sender -#endif /* OPENSTEP */ -{ - if (app_state != APP_IS_RUNNING -#ifndef OPENSTEP - || (NXRunAlertPanel - ("Are You Sure", - "Hitting the \"Abort Anyway\" button will cause Executor " - "to stop immediately, without giving the currently running " - "program a chance to quit gracefully. This can result in " - "corrupted files.", - "Cancel", "Abort Anyway", - (const char *) 0) - == NX_ALERTALTERNATE)) - [NXApp terminate:sender]; - return self; -#else /* OPENSTEP */ - || (NSRunAlertPanel - (@"Are You Sure", - @"Hitting the \"Abort Anyway\" button will cause Executor to stop immediately, without giving the currently running program a chance to quit gracefully. This can result in corrupted files.", - @"Cancel", @"Abort Anyway", nil) - == NSAlertAlternateReturn)) - [NSApp terminate:sender]; -#endif /* OPENSTEP */ -} - - -#ifndef OPENSTEP -- validRequestorForSendType:(NXAtom) - typeSent andReturnType:(NXAtom) typeReturned -#else /* OPENSTEP */ -- validRequestorForSendType:(NSString) - typeSent andReturnType:(NSString) typeReturned -#endif /* OPENSTEP */ -{ - return self; -} - -#ifndef OPENSTEP --readSelectionFromPasteboard:pboard -#else /* OPENSTEP */ -- (void) readSelectionFromPasteboard:pboard -#endif /* OPENSTEP */ -{ - id saveROMlib_pasteboard; - - { - SETUPA5; - sendsuspendevent (); - RESTOREA5; - } - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - saveROMlib_pasteboard = ROMlib_pasteboard; - ROMlib_pasteboard = pboard; - { - SETUPA5; - sendresumeevent (YES); - RESTOREA5; - } - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - ROMlib_pasteboard = saveROMlib_pasteboard; - { - SETUPA5; - sendpaste (); - RESTOREA5; - } - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); -#ifndef OPENSTEP - return self; -#endif /* not OPENSTEP */ -} - -#ifndef OPENSTEP --(BOOL) writeSelectionToPasteboard: pboard types:(NXAtom *) types -#else /* OPENSTEP */ -- (BOOL) writeSelectionToPasteboard:(NSPasteboard *) pboard - types:(NSArray *) types -#endif /* OPENSTEP */ -{ - id saveROMlib_pasteboard; - - { - SETUPA5; - sendcopy (); - RESTOREA5; - } - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - saveROMlib_pasteboard = ROMlib_pasteboard; - ROMlib_pasteboard = pboard; - { - SETUPA5; - sendsuspendevent (); - RESTOREA5; - } - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - ROMlib_pasteboard = saveROMlib_pasteboard; - { - SETUPA5; - sendresumeevent (NO); - RESTOREA5; - } - return YES; -} - -#ifndef OPENSTEP --(BOOL) getRect:(NXRect *) theRect forPage:(int) page -#else /* OPENSTEP */ --(NSRect) rectForPage:(int) page -#endif /* OPENSTEP */ -{ -#ifdef OPENSTEP - NSRect retval; - -#endif /* OPENSTEP */ - pagewanted = page; -#ifndef OPENSTEP - *theRect = *[[NXApp printInfo] paperRect]; -#else /* OPENSTEP */ - retval.origin.x = 0; - retval.origin.y = 0; - retval.size = [[NSPrintInfo sharedPrintInfo] paperSize]; -#endif /* OPENSTEP */ - ROMlib_printtimeout = 10000; - while (printstate != __idle && printstate != seenOpenPage && - --ROMlib_printtimeout != 0) - contextswitch (&nextstep_sp, &romlib_sp); - if (ROMlib_printtimeout == 0) - printstate = __idle; -#ifndef OPENSTEP - return printstate == __idle ? NO : YES; -#else /* OPENSTEP */ - return printstate == __idle ? NSZeroRect : retval; -#endif /* OPENSTEP */ -} - --(BOOL) knowsPagesFirst:(int *) firstPageNum last:(int *) lastPageNum -{ - return YES; -} - -char ROMlib_needtorestore; - -#ifndef OPENSTEP --beginPageSetupRect:(const NXRect *) aRect placement:(const NXPoint *) location -#else /* OPENSTEP */ -- (void) beginPageSetupRect:(NSRect) aRect placement:(NSPoint) location -#endif /* OPENSTEP */ -{ -#ifndef OPENSTEP - id retval; - - retval =[ super beginPageSetupRect: aRect placement:location]; -#else /* OPENSTEP */ - [super beginPageSetupRect: aRect placement:location]; -#endif /* OPENSTEP */ - ROMlib_needtorestore = 0; - ROMlib_suppressclip = 0; -#ifndef OPENSTEP - - return retval; -#endif /* not OPENSTEP */ -} - -#ifndef OPENSTEP --addToPageSetup -#else /* OPENSTEP */ --(void) addToPageSetup -#endif /* OPENSTEP */ -{ - float scale; -#ifndef OPENSTEP - - scale =[[NXApp printInfo] scalingFactor]; - PStranslate (0,[[NXApp printInfo] paperRect]->size.height); -#else /* OPENSTEP */ -#warning need to implement scaling factor (dictionary lookup) - scale = 1.0; - PStranslate (0,[[NSPrintInfo sharedPrintInfo] paperSize].height); -#endif /* OPENSTEP */ - PSscale (1 * scale, -1 * scale); -/* - * NOTE: we should probably check to see whether pse and psb are - * defined before blowing them away, but then again, just - * 'cause they're defined doesn't mean they're what we want. - */ - DPSPrintf (DPSGetCurrentContext (), "/pse {} def\n" - "/psb {} def\n" - "/execuserobject {\n" - " dup UserObjects length ge\n" - " { pop }\n" - " { UserObjects exch get exec }\n" - " ifelse\n" - "} def\n" - "/currentmouse { 0 0 } def\n" - "/printobject { pop pop } def\n" - ); -#ifndef OPENSTEP - return[super addToPageSetup]; -#else /* OPENSTEP */ - [super addToPageSetup]; -#endif /* OPENSTEP */ -} - -/* - * NOTE: %% is needed to get just one % - */ - -#ifndef OPENSTEP --endPageSetup -#else /* OPENSTEP */ --(void)endPageSetup -#endif /* OPENSTEP */ -{ -#ifndef OPENSTEP - id retval; - - retval = [super endPageSetup]; -#else /* OPENSTEP */ - [super endPageSetup]; -#endif /* OPENSTEP */ - - DPSPrintf (DPSGetCurrentContext (), - "%% The following is a lie that is necessary because Word 5\n" - "%% doesn't wrap EPS files properly and we can't tell where\n" - "%% the PostScript we're printing comes from.\n" - "%%%%BeginDocument: IWishWeDidntHaveToDoThis\n"); -#ifndef OPENSTEP - return retval; -#endif /* not OPENSTEP */ -} - -#ifndef OPENSTEP --endPage -#else /* OPENSTEP */ -- (void) endPage -#endif /* OPENSTEP */ -{ - if (ROMlib_needtorestore) - PSgrestore (); - DPSPrintf (DPSGetCurrentContext (), ROMlib_page_end); -#ifndef OPENSTEP - return [super endPage]; -#else /* OPENSTEP */ - [super endPage]; -#endif /* OPENSTEP */ -} - -#ifndef OPENSTEP --endPSOutput -#else /* OPENSTEP */ -- (void) endTrailer -#endif /* OPENSTEP */ -{ -#ifndef OPENSTEP - [super endPSOutput]; -#else /* OPENSTEP */ - [super endTrailer]; -#endif /* OPENSTEP */ - - pagewanted = 1024 * 1024; /* i.e. real big */ - - /* we can't repaint the screen from where we are, but we can accrue a - very large dirty rect so the next repaint will redraw everything */ - - dirty_rect_accrue (0, 0, vdriver_height, vdriver_width); -#ifndef OPENSTEP - - return self; -#endif /* not OPENSTEP */ -} - - -char * -ROMlib_GetTitle (void) -{ -#ifndef OPENSTEP - const char *t = [[self_view window] title]; - return strcpy (malloc (strlen (t) + 1), t); -#else /* OPENSTEP */ - NSString *temp_title; - char *retval; - - temp_title = [[self_view window] title]; - retval = malloc ([temp_title length] + 1); - [temp_title getCString:retval]; - return retval; -#endif /* OPENSTEP */ -} - -void -ROMlib_FreeTitle (char *title) -{ - free (title); -} - -#ifndef OPENSTEP -- endPrologue -#else /* OPENSTEP */ -- (void) endPrologue -#endif /* OPENSTEP */ -{ - extern int pageno; - - pageno = 0; - - DPSPrintf(DPSGetCurrentContext(), ROMlib_doc_prolog); - return [super endPrologue]; -} -#ifdef OPENSTEP - -#if !defined(NDEBUG) -void set_malloc_debug (int level) -{ - malloc_debug (level); -} -#endif - -@end -#endif /* OPENSTEP */ diff --git a/src/config/front-ends/nextstep/MacWinClass.h b/src/config/front-ends/nextstep/MacWinClass.h deleted file mode 100644 index 7a1b763d..00000000 --- a/src/config/front-ends/nextstep/MacWinClass.h +++ /dev/null @@ -1,24 +0,0 @@ - -/* Generated by Interface Builder */ - -#ifndef OPENSTEP -#import -#else /* OPENSTEP */ -#import -#endif /* OPENSTEP */ - -#ifndef OPENSTEP -@interface MacWindow:Window -#else /* OPENSTEP */ -@interface MacWindow:NSWindow -#endif /* OPENSTEP */ -{ -} - -#ifndef OPENSTEP -- (BOOL)commandKey:(NXEvent *)theEvent; -#else /* OPENSTEP */ -- (BOOL)commandKey:(NSEvent *)theEvent; -#endif /* OPENSTEP */ - -@end diff --git a/src/config/front-ends/nextstep/NEXTkeyboard.m b/src/config/front-ends/nextstep/NEXTkeyboard.m deleted file mode 100644 index 08bef7c9..00000000 --- a/src/config/front-ends/nextstep/NEXTkeyboard.m +++ /dev/null @@ -1,42 +0,0 @@ -#include "rsys/common.h" -#define Point NeXT_Point -#import -#undef Point -#include "rsys/keyboards.h" - -keyboard_enum_t ROMlib_get_keyboard_type( void ) -{ - NXEventHandle handle; - NXEventSystemDevice dev[NX_EVS_DEVICE_MAX]; - unsigned int cnt, i; - int interface, id, retval; - - if ( (handle = NXOpenEventStatus()) == NULL ) -/*-->*/ return NO; - cnt = NX_EVS_DEVICE_INFO_COUNT; - NXEventSystemInfo( handle, NX_EVS_DEVICE_INFO, (int *)dev, &cnt ); - NXCloseEventStatus( handle ); - interface = -1; - id = 0; - for (i = 0; i < cnt/(sizeof (NXEventSystemDevice)/sizeof (int)); ++i) - { - if ( dev[i].dev_type == NX_EVS_DEVICE_TYPE_KEYBOARD ) - { - interface = dev[i].interface; - id = dev[i].id; - break; - } - } - switch (interface) { - default: - retval = default_keyboard; - break; - case NX_EVS_DEVICE_INTERFACE_ADB: - retval = adb_keyboard; - break; - case NX_EVS_DEVICE_INTERFACE_ACE: - retval = pc_keyboard; - break; - } - return retval; -} diff --git a/src/config/front-ends/nextstep/NEXTprint.m b/src/config/front-ends/nextstep/NEXTprint.m deleted file mode 100644 index 56e6cb64..00000000 --- a/src/config/front-ends/nextstep/NEXTprint.m +++ /dev/null @@ -1,143 +0,0 @@ -#include "rsys/common.h" - -#ifndef OPENSTEP - -#import -#import -#import -#import // For NXApp -#import -#import -#import -#import - -#else /* OPENSTEP */ - -#import -#import -#import -#import // For NXApp -#import -#import -#import -#import - -#endif /* OPENSTEP */ - - -#include "rsys/mactype.h" -#include "rsys/nextprint.h" -#include "rsys/blockinterrupts.h" -#include "rsys/next.h" -#include "rsys/syn68k_public.h" - -#if !defined (OMIT_RCSID_STRINGS) -char ROMlib_rcsid_NEXTprint[] = - "$Id: NEXTprint.m,v 2.5 1997/07/19 01:17:09 ctm Exp $"; -#endif - -/* - * Copyright 1992 by Abacus Research and Development, Inc. - * All rights reserved. - * - */ - -#ifndef OPENSTEP -char **ROMlib_availableFonts(void) -{ - return [[FontManager new] availableFonts]; -} -#endif /* not OPENSTEP */ - -void ROMlib_newFont(char *font, float txSize) -{ -#ifndef OPENSTEP - [Font newFont:font size:txSize]; -#else /* OPENSTEP */ - [NSFont fontWithName:[NSString stringWithCString:font] size:txSize]; -#endif /* OPENSTEP */ -} - -void ROMlib_updatenextpagerect(comRect *rp) -{ -#ifndef OPENSTEP - NXRect tmpr; -#else /* OPENSTEP */ - NSSize new_paper_size; -#endif /* OPENSTEP */ - virtual_int_state_t block; - - block = block_virtual_ints (); -#ifndef OPENSTEP - tmpr.origin.y = CW(rp->top) ; - tmpr.size.height = CW(rp->bottom) - CW(rp->top); - tmpr.origin.x = CW(rp->left); - tmpr.size.width = CW(rp->right) - CW(rp->left); - [[NXApp printInfo] setPaperRect:&tmpr andAdjust:YES]; -#else /* OPENSTEP */ - new_paper_size.height = CW(rp->bottom) - CW(rp->top); - new_paper_size.width = CW(rp->right) - CW(rp->left); - [[NSPrintInfo sharedPrintInfo] setPaperSize:new_paper_size]; -#endif /* OPENSTEP */ - restore_virtual_ints (block); -} - -#define HALFINCH 36 - -#ifdef OPENSTEP -static float printer_scaling_factor (void) -{ - id key_val; - float retval; - - key_val = - [[[NSPrintInfo sharedPrintInfo] dictionary] objectForKey:NSPrintScalingFactor]; - - if (key_val) - retval = [key_val floatValue]; - else - retval = 1; - - return retval; -} -#endif /* OPENSTEP */ - -void ROMlib_updatemacpagerect(comRect *paperp, comRect *page1p, - comRect *page2p) -{ -#ifndef OPENSTEP - const NXRect *tmpr; -#else /* OPENSTEP */ - NSSize new_size; -#endif /* OPENSTEP */ - virtual_int_state_t block; -#ifdef OPENSTEP - float scaling_factor; -#endif /* OPENSTEP */ - - block = block_virtual_ints (); -#ifndef OPENSTEP - tmpr = [[NXApp printInfo] paperRect]; - paperp->top = CW(tmpr->origin.y - HALFINCH); - paperp->left = CW(tmpr->origin.x - HALFINCH); - - paperp->bottom = CW(tmpr->origin.y + - tmpr->size.height * (1 / [[NXApp printInfo] scalingFactor]) - HALFINCH); - paperp->right = CW(tmpr->origin.x + - tmpr->size.width * (1 / [[NXApp printInfo] scalingFactor]) - HALFINCH); -#else /* OPENSTEP */ - new_size = [[NSPrintInfo sharedPrintInfo] paperSize]; - paperp->top = CW(0 - HALFINCH); - paperp->left = CW(0 - HALFINCH); - - scaling_factor = printer_scaling_factor (); - paperp->bottom = CW(new_size.height * (1 / scaling_factor) - HALFINCH); - paperp->right = CW(new_size.width * (1 / scaling_factor) - HALFINCH); -#endif /* OPENSTEP */ - - page1p->top = page2p->top = 0; - page1p->left = page2p->left = 0; - page1p->bottom = page2p->bottom = CW(CW(paperp->bottom) - HALFINCH); - page1p->right = page2p->right = CW(CW(paperp->right) - HALFINCH); - restore_virtual_ints (block); -} diff --git a/src/config/front-ends/nextstep/NEXTsound.m b/src/config/front-ends/nextstep/NEXTsound.m deleted file mode 100644 index 3eea7491..00000000 --- a/src/config/front-ends/nextstep/NEXTsound.m +++ /dev/null @@ -1,41 +0,0 @@ -#include "rsys/common.h" - -#import - -#ifndef OPENSTEP - -#import -#import - -#else /* OPENSTEP */ - -#import -#import - -#endif /* OPENSTEP */ - -#include "rsys/soundopts.h" -#include "MemoryMgr.h" -#include "rsys/next.h" - -#if defined(mc68000) && (!defined(NX_CURRENT_COMPILER_RELEASE) || \ - (NX_CURRENT_COMPILER_RELEASE < NX_COMPILER_RELEASE_3_0)) -#include -#else -#include -#endif - -#include "rsys/syn68k_public.h" - -/* - * NOTE: this is a simplistic implementation that doesn't use double - * buffering. - */ - -void ROMlib_callcompletion( void *chanp ) -{ -} - -void ROMlib_outbuffer( char *buf, LONGINT nsamples, LONGINT rate, void *chanp) -{ -} diff --git a/src/config/front-ends/nextstep/OldMacViewClass.m b/src/config/front-ends/nextstep/OldMacViewClass.m deleted file mode 100644 index da09ad4c..00000000 --- a/src/config/front-ends/nextstep/OldMacViewClass.m +++ /dev/null @@ -1,2907 +0,0 @@ -/* - * Here is the original comment... it's not too relevant anymore: - * - * BreakView.m, view to implement the "BreakApp" game. - * Author: Ali Ozer - * Written for 0.8 October 88. - * Modified for 0.9 March 89. - * Modified for 1.0 July 89. - * Removed use of Bitmap and threw away some classes May 90. - * Final 2.0 fixes/enhancements Sept 90. - * - * BreakView implements an interactive custom view that allows the user - * to play "BreakApp," a game similar to a popular arcade classic. - * - * BreakView's main control methods are based on the target-action - * paradigm; thus you can include BreakView in an Interface-Builder based - * application. Please refer to BreakView.h for a list of "public" methods - * that you should provide links to in Interface Builder. - * - * You may freely copy, distribute and reuse the code in this example. - * NeXT disclaims any warranty of any kind, expressed or implied, - * as to its fitness for any particular use. - */ - -#if !defined (OMIT_RCSID_STRINGS) -char ROMlib_rcsid_MacViewClass[] = - "$Id: MacViewClass.m,v 2.7 1995/03/11 20:29:43 mat Exp mat $"; -#endif - -#include "rsys/common.h" - -#import "next/MacViewClass.h" -#import "next/MacAppClass.h" -#import "next/ourstuff.h" - -#import -#import // PSxxx functions -#import - -#import -#import -#import -#include - -#if defined(mc68000) && (!defined(NX_CURRENT_COMPILER_RELEASE) || \ - (NX_CURRENT_COMPILER_RELEASE < NX_COMPILER_RELEASE_3_0)) -#include -#else -#include -#endif - -#include "rsys/mactype.h" -#include -#include "rsys/nextprint.h" -#include "rsys/blockinterrupts.h" -#include "rsys/next.h" -#include "rsys/myabort.h" -#include "rsys/trapglue.h" -#include "rsys/syn68k_public.h" -#include "rsys/version.h" -#include "rsys/executor.h" - -/* - * TODO: move this into a common include file that OSUtil.h will pick up - */ - - -/* These are methods in this file and also Mac #defines. */ -#undef mouseUp -#undef mouseDown -#undef keyDown -#undef keyUp - -#define OSTrap 0 -#define ToolTrap 1 -extern long NGetTrapAddress( short n, short ttype ); - -@implementation MacViewClass - -static DPSTimedEntry timer; -static id theonlyframe, theonlyscreenimage;/* UGLY UGLY UGLY */ -static NXBitmapImageRep *theonlyscreenimagerep; -long orig_height, orig_width, curr_height, curr_width; -float mac_to_next_x = 1, mac_to_next_y = 1; -id realcursor, blankcursor, cursorimage; -NXBitmapImageRep *cursorrep; - -typedef enum { MacToUNIX, UNIXToMac, MacRTFToUNIX, UNIXRTFToMac } convertdir_t; - -typedef struct { - long first; - long second; -} pair_t; - -unsigned char mactonext[] = { - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, /* NEXTCHAR_QUOTESINGLE, */ - 40, - 41, - 42, - 43, - 44, - 45, - 46, - 47, - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57, - 58, - 59, - 60, - 61, - 62, - 63, - 64, - 65, - 66, - 67, - 68, - 69, - 70, - 71, - 72, - 73, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 82, - 83, - 84, - 85, - 86, - 87, - 88, - 89, - 90, - 91, - 92, - 93, - 94, - 95, - 96, /* NEXTCHAR_GRAVE, */ - 97, - 98, - 99, - 100, - 101, - 102, - 103, - 104, - 105, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 122, - 123, - 124, - 125, - 126, - 127, - NEXTCHAR_ADIERESIS, - NEXTCHAR_ARING, - NEXTCHAR_CCEDILLA, - NEXTCHAR_EACUTE, - NEXTCHAR_NTILDE, - NEXTCHAR_ODIERESIS, - NEXTCHAR_UDIERESIS, - NEXTCHAR_aACUTE, - NEXTCHAR_aGRAVE, - NEXTCHAR_aCIRCUMFLEX, - NEXTCHAR_aDIERESIS, - NEXTCHAR_aTILDE, - NEXTCHAR_aRING, - NEXTCHAR_cCEDILLA, - NEXTCHAR_eACUTE, - NEXTCHAR_eGRAVE, - NEXTCHAR_eCIRCUMFLEX, - NEXTCHAR_eDIERESIS, - NEXTCHAR_iACUTE, - NEXTCHAR_iGRAVE, - NEXTCHAR_iCIRCUMFLEX, - NEXTCHAR_iDIERESIS, - NEXTCHAR_nTILDE, - NEXTCHAR_oACUTE, - NEXTCHAR_oGRAVE, - NEXTCHAR_oCIRCUMFLEX, - NEXTCHAR_oDIERESIS, - NEXTCHAR_oTILDE, - NEXTCHAR_uACUTE, - NEXTCHAR_uGRAVE, - NEXTCHAR_uCIRCUMFLEX, - NEXTCHAR_uDIERESIS, - NEXTCHAR_DAGGER, - NEXTCHAR_DEGREE, - NEXTCHAR_CENT, - NEXTCHAR_STERLING, - NEXTCHAR_SECTION, - NEXTCHAR_BULLET, - NEXTCHAR_PARAGRAPH, - NEXTCHAR_GERMANDBLS, - NEXTCHAR_REGISTERED, - NEXTCHAR_COPYRIGHT, - NEXTCHAR_TRADEMARK, - NEXTCHAR_ACUTE, - NEXTCHAR_DIERESIS, - NEXTCHAR_NOTEQUAL, - NEXTCHAR_AE, - NEXTCHAR_OSLASH, - NEXTCHAR_INFINITY, - NEXTCHAR_PLUSMINUS, - NEXTCHAR_LESSEQUAL, - NEXTCHAR_GREATEQUAL, - NEXTCHAR_YEN, - NEXTCHAR_MU, - NEXTCHAR_PARTIALDIFF, - NEXTCHAR_SUMMATION, - NEXTCHAR_PRODUCT, - NEXTCHAR_PI, - NEXTCHAR_INTEGRAL, - NEXTCHAR_ORDFEMININE, - NEXTCHAR_ORDMASCULINE, - NEXTCHAR_OMEGA, - NEXTCHAR_ae, - NEXTCHAR_oSLASH, - NEXTCHAR_QUESTIONDOWN, - NEXTCHAR_EXCLAMDOWN, - NEXTCHAR_LOGICALNOT, - NEXTCHAR_RADICAL, - NEXTCHAR_FLORIN, - NEXTCHAR_APPROXEQUAL, - NEXTCHAR_DELTA, - NEXTCHAR_GUILLEMOTLEFT, - NEXTCHAR_GUILLEMOTRIGHT, - NEXTCHAR_ELLIPSIS, - NEXTCHAR_FIGSP, - NEXTCHAR_AGRAVE, - NEXTCHAR_ATILDE, - NEXTCHAR_OTILDE, - NEXTCHAR_OE, - NEXTCHAR_oe, - NEXTCHAR_ENDASH, - NEXTCHAR_EMDASH, - NEXTCHAR_QUOTEDBLLEFT, - NEXTCHAR_QUOTEDBLRIGHT, - NEXTCHAR_GRAVE, /* NEXTCHAR_QUOTELEFT, */ - NEXTCHAR_QUOTESINGLE, /* NEXTCHAR_QUOTERIGHT, */ - NEXTCHAR_DIVIDE, - NEXTCHAR_LOZENGE, - NEXTCHAR_yDIERESIS, - NEXTCHAR_YDIERESIS, - NEXTCHAR_FRACTION, - NEXTCHAR_CURRENCY, - NEXTCHAR_GUILSINGLLEFT, - NEXTCHAR_GUILSINGLRIGHT, - NEXTCHAR_FI, - NEXTCHAR_FL, - NEXTCHAR_DAGGERDBL, - NEXTCHAR_PERIODCENTERED, - NEXTCHAR_QUOTESINGLBASE, - NEXTCHAR_QUOTEDBLBASE, - NEXTCHAR_PERTHOUSAND, - NEXTCHAR_ACIRCUMFLEX, - NEXTCHAR_ECIRCUMFLEX, - NEXTCHAR_AACUTE, - NEXTCHAR_EDIERESIS, - NEXTCHAR_EGRAVE, - NEXTCHAR_IACUTE, - NEXTCHAR_ICIRCUMFLEX, - NEXTCHAR_IDIERESIS, - NEXTCHAR_IGRAVE, - NEXTCHAR_OACUTE, - NEXTCHAR_OCIRCUMFLEX, - NEXTCHAR_APPLE, - NEXTCHAR_OGRAVE, - NEXTCHAR_UACUTE, - NEXTCHAR_UCIRCUMFLEX, - NEXTCHAR_UGRAVE, - NEXTCHAR_DOTLESSI, - NEXTCHAR_CIRCUMFLEX, - NEXTCHAR_TILDE, - NEXTCHAR_MACRON, - NEXTCHAR_BREVE, - NEXTCHAR_DOTACCENT, - NEXTCHAR_RING, - NEXTCHAR_CEDILLA, - NEXTCHAR_HUNGARUMLAUT, - NEXTCHAR_OGONEK, - NEXTCHAR_CARON -}; - -unsigned char nexttomac[] = { - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, /* MACCHAR_QUOTERIGHT, */ - 40, - 41, - 42, - 43, - 44, - 45, - 46, - 47, - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57, - 58, - 59, - 60, - 61, - 62, - 63, - 64, - 65, - 66, - 67, - 68, - 69, - 70, - 71, - 72, - 73, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 82, - 83, - 84, - 85, - 86, - 87, - 88, - 89, - 90, - 91, - 92, - 93, - 94, - 95, - 96, /* MACCHAR_QUOTELEFT, */ - 97, - 98, - 99, - 100, - 101, - 102, - 103, - 104, - 105, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 122, - 123, - 124, - 125, - 126, - 127, - MACCHAR_FIGSP, - MACCHAR_AGRAVE, - MACCHAR_AACUTE, - MACCHAR_ACIRCUMFLEX, - MACCHAR_ATILDE, - MACCHAR_ADIERESIS, - MACCHAR_ARING, - MACCHAR_CCEDILLA, - MACCHAR_EGRAVE, - MACCHAR_EACUTE, - MACCHAR_ECIRCUMFLEX, - MACCHAR_EDIERESIS, - MACCHAR_IGRAVE, - MACCHAR_IACUTE, - MACCHAR_ICIRCUMFLEX, - MACCHAR_IDIERESIS, - MACCHAR_ETH, - MACCHAR_NTILDE, - MACCHAR_OGRAVE, - MACCHAR_OACUTE, - MACCHAR_OCIRCUMFLEX, - MACCHAR_OTILDE, - MACCHAR_ODIERESIS, - MACCHAR_UGRAVE, - MACCHAR_UACUTE, - MACCHAR_UCIRCUMFLEX, - MACCHAR_UDIERESIS, - MACCHAR_YACUTE, - MACCHAR_THORN, - MACCHAR_MU, - MACCHAR_MULTIPLY, - MACCHAR_DIVIDE, - MACCHAR_COPYRIGHT, - MACCHAR_EXCLAMDOWN, - MACCHAR_CENT, - MACCHAR_STERLING, - MACCHAR_FRACTION, - MACCHAR_YEN, - MACCHAR_FLORIN, - MACCHAR_SECTION, - MACCHAR_CURRENCY, - MACCHAR_QUOTERIGHT, /* MACCHAR_QUOTESINGLE, */ - MACCHAR_QUOTEDBLLEFT, - MACCHAR_GUILLEMOTLEFT, - MACCHAR_GUILSINGLLEFT, - MACCHAR_GUILSINGLRIGHT, - MACCHAR_FI, - MACCHAR_FL, - MACCHAR_REGISTERED, - MACCHAR_ENDASH, - MACCHAR_DAGGER, - MACCHAR_DAGGERDBL, - MACCHAR_PERIODCENTERED, - MACCHAR_BROKENBAR, - MACCHAR_PARAGRAPH, - MACCHAR_BULLET, - MACCHAR_QUOTESINGLBASE, - MACCHAR_QUOTEDBLBASE, - MACCHAR_QUOTEDBLRIGHT, - MACCHAR_GUILLEMOTRIGHT, - MACCHAR_ELLIPSIS, - MACCHAR_PERTHOUSAND, - MACCHAR_LOGICALNOT, - MACCHAR_QUESTIONDOWN, - MACCHAR_ONESUPERIOR, - MACCHAR_QUOTELEFT, /* MACCHAR_GRAVE, */ - MACCHAR_ACUTE, - MACCHAR_CIRCUMFLEX, - MACCHAR_TILDE, - MACCHAR_MACRON, - MACCHAR_BREVE, - MACCHAR_DOTACCENT, - MACCHAR_DIERESIS, - MACCHAR_TWOSUPERIOR, - MACCHAR_RING, - MACCHAR_CEDILLA, - MACCHAR_THREESUPERIOR, - MACCHAR_HUNGARUMLAUT, - MACCHAR_OGONEK, - MACCHAR_CARON, - MACCHAR_EMDASH, - MACCHAR_PLUSMINUS, - MACCHAR_ONEQUARTER, - MACCHAR_ONEHALF, - MACCHAR_THREEQUARTERS, - MACCHAR_aGRAVE, - MACCHAR_aACUTE, - MACCHAR_aCIRCUMFLEX, - MACCHAR_aTILDE, - MACCHAR_aDIERESIS, - MACCHAR_aRING, - MACCHAR_cCEDILLA, - MACCHAR_eGRAVE, - MACCHAR_eACUTE, - MACCHAR_eCIRCUMFLEX, - MACCHAR_eDIERESIS, - MACCHAR_iGRAVE, - MACCHAR_AE, - MACCHAR_iACUTE, - MACCHAR_ORDFEMININE, - MACCHAR_iCIRCUMFLEX, - MACCHAR_iDIERESIS, - MACCHAR_eTH, - MACCHAR_nTILDE, - MACCHAR_LSLASH, - MACCHAR_OSLASH, - MACCHAR_OE, - MACCHAR_ORDMASCULINE, - MACCHAR_oGRAVE, - MACCHAR_oACUTE, - MACCHAR_oCIRCUMFLEX, - MACCHAR_oTILDE, - MACCHAR_oDIERESIS, - MACCHAR_ae, - MACCHAR_uGRAVE, - MACCHAR_uACUTE, - MACCHAR_uCIRCUMFLEX, - MACCHAR_DOTLESSI, - MACCHAR_uDIERESIS, - MACCHAR_yACUTE, - MACCHAR_lSLASH, - MACCHAR_oSLASH, - MACCHAR_oe, - MACCHAR_GERMANDBLS, - MACCHAR_tHORN, - MACCHAR_yDIERESIS, - MACCHAR_NEXT254, - MACCHAR_NEXT255 -}; - - -void converthex(char **h, unsigned char *table) -{ - unsigned int val, val2; - char *p; - - p = *h; - if (*p <= 'f' && *p >= 'a') - val = *p - 'a' + 10; - else if (*p <= 'F' && *p >= 'A') - val = *p - 'A' + 10; - else - val = *p - '0'; - - if (*(p + 1) <= 'f' && *(p + 1) >= 'a') - val = val * 16 + *(p + 1) - 'a' + 10; - else if (*(p + 1) <= 'F' && *(p + 1) >= 'A') - val = val * 16 + *(p + 1) - 'A' + 10; - else - val = val * 16 + *(p + 1) - '0'; - - val = table[val]; - val2 = val/16; - if (val2 > 9) - *p++ = val2 + 'a' - 10; - else - *p++ = val2 + '0'; - - val2 = val & 0xF; - if (val2 > 9) - *p++ = val2 + 'a' - 10; - else - *p++ = val2 + '0'; -} - -void convertchars(char *data, long length, unsigned char *table) -{ - char *ep; - int escaped; - - escaped = NO; - ep = data + length; - while (data < ep) { - if (escaped && *data == '\'') { - *data++ = '\''; - converthex(&data, table); - } - if (*data == '\\') - escaped = YES; - else - escaped = NO; - *data++ = table[*(unsigned char *)data]; - } -} - -static int unixrtfconvert(int length, char *ip, char *op) -{ - char *fromp, *ep; - int retval; - - retval = length; - fromp = ip; - ep = ip + length; - while (fromp < ep) { - if (*fromp == '\n') { - *op++ = '\r'; - fromp++; - } else if (*fromp == '\\') { - *op++ = '\\'; - fromp++; - if (fromp < ep && *fromp == '\n') { -#if !defined (WEDONTNEEDNOSTEENINGPAR) - strcpy(op, "par \n"); - op += 5; - fromp++; - retval += 4; -#else /* WEDONTNEEDNOSTEENINGPAR */ - *op++ = '\r'; - fromp++; -#endif /* WEDONTNEEDNOSTEENINGPAR */ - } else if (fromp + 2 < ep && !strncmp(fromp, "ul0", 3)) { - strcpy(op, "ulnone"); - op += 6; - fromp += 3; - retval += 3; - } else if (fromp + 6 < ep && !strncmp(fromp, "fonttbl", 6)) { - strcpy(op, "fonttbl\\f99\\fa b;"); - op += 17; - fromp += 7; - retval += 10; - } else - *op++ = *fromp++; - } else - *op++ = *fromp++; - } - return retval; -} - -static inline void copyandtranslate( char *cp, char **ipp, char **opp) -{ - *cp = *(*ipp)++; - if (*cp == '\r') - *cp = '\n'; - *(*opp)++ = *cp; -} - -#define PREFIX "\\endnhere" -#define NCHARPREFIX (sizeof(PREFIX)-1) - -#if 1 -#define STICKIN \ - "{\\fonttbl" \ - "{\\f0\\fswiss Helvetica;}" \ - "{\\f3\\fmodern Courier;}" \ - "{\\f4\\fmodern Ohlfs;}" \ - "{\\f20\\froman Times;}" \ - "{\\f21\\fswiss Helvetica;}" \ - "{\\f22\\fmodern Courier;}" \ - "}\\f0" -#else /* 0 */ -#define STICKIN \ - "{\\fonttbl" \ - "{\\f0\\fHelvetica;}" \ - "{\\f3\\fCourier;}" \ - "{\\f4\\fOhlfs;}" \ - "{\\f20\\fTimes;}" \ - "{\\f21\\fHelvetica;}" \ - "{\\f22\\fCourier;}" \ - "}\\f0" -#endif /* 0 */ -#define NCHARSTICKIN (sizeof(STICKIN)-1) - -static int macrtfconvert(int length, char *ip, char *op) -{ - int retval, index; - char c; - SETUPA5; - - retval = length; - index = 0; - while (length > 0 && index < NCHARPREFIX) { - copyandtranslate(&c, &ip, &op); - if (PREFIX[index] == c) - ++index; - else if (PREFIX[0] == c) - index = 1; - else - index = 0; - --length; - } -#if 0 - bracecount = 1; - while (length > 0 && bracecount > 0) { - copyandtranslate(&c, &ip, &op); - switch (c) { - case '{': - ++bracecount; - break; - case '}': - --bracecount; - break; - case '\\': - if (--length >= 0) - copyandtranslate(&c, &ip, &op); - break; - } - --length; - } -#endif /* 0 */ - if (length > 0) { -#if 0 - retval += NCHARSTICKIN; - bcopy(STICKIN, op, NCHARSTICKIN); - op += NCHARSTICKIN; -#else /* 0 */ - retval += insertfonttbl(&op, (char) -1); -#endif /* 0 */ - } - while (--length >= 0) - copyandtranslate(&c, &ip, &op); - RESTOREA5; - return retval; -} - -static int convertreturns(char *datain, char *dataout, int length, - convertdir_t dir) -{ - char from, to; - - switch (dir) { - case MacToUNIX: - bcopy(datain, dataout, length); - from = '\r'; - to = '\n'; - break; - case UNIXToMac: - bcopy(datain, dataout, length); - from = '\n'; - to = '\r'; - break; - case MacRTFToUNIX: -/*-->*/ return macrtfconvert(length, datain, dataout); - break; - case UNIXRTFToMac: -/*-->*/ return unixrtfconvert(length, datain, dataout); - break; - default: - from = 0; - to = 0; - gui_abort(); - } - while (--length >= 0) - if (*dataout++ == from) - dataout[-1] = to; - return 0; -} - -short ROMlib_accelerated = 0; -extern id global_game; -extern id global_gameWindow; - -static void accelerate(long top, long left, long bottom, long right) -{ - NXRect rect; - NXPoint point; - long offsetx, offsety; - extern void ROMlib_blastframebuffer(long top, long left, long bottom, - long right, long offsetx, long offsety, long scaled_by_two); - - SETUPA5; - [global_game getFrame:&rect]; - point = rect.origin; - [global_game convertPoint:&point toView:nil]; - [global_gameWindow convertBaseToScreen:&point]; - offsetx = point.x; - offsety = (SCREEN_MONO ? VIDEO_H : C16_VIDEO_H) - point.y - curr_height; - - ROMlib_blastframebuffer(top, left, bottom, right, offsetx, offsety, - (mac_to_next_x > 1)); - RESTOREA5; -} - - - -long *ROMlib_realScreen; -long ROMlib_realScreenRowBytes; - - -static unsigned short color_map_table[256]; -static unsigned char mono_map_table[256]; -static long old_seed_x = CLC (-3); - -unsigned char map_to_mono(const ColorSpec *tablep, int i) -{ - return (CW(tablep[i].rgb.red) + - CW(tablep[i].rgb.green) + - CW(tablep[i].rgb.blue) ) / 65535; -} - -static void -init_color_map_table (const ColorSpec *table, int max_ctab_elt) -{ - int i; - unsigned char trans[4]; - - if (ROMlib_nextscreen == SCREEN_MONO) { - trans[0] = map_to_mono(table, 0); - trans[1] = map_to_mono(table, 1); - trans[2] = map_to_mono(table, 2); - trans[3] = map_to_mono(table, 3); - for (i = 0; i <= 255; i++) - { - mono_map_table[i] = (trans[(i >> 6) & 3] << 6) | - (trans[(i >> 4) & 3] << 4) | - (trans[(i >> 2) & 3] << 2) | - (trans[(i >> 0) & 3] << 0); - } - } else { - for (i = 0; i <= max_ctab_elt; i++) - { - color_map_table[i] = CW (((CW (table[i].rgb.red) >> 12) << 12) - | ((CW (table[i].rgb.green) >> 12) << 8) - | ((CW (table[i].rgb.blue) >> 12) << 4) - | 0x000F); - } - } -} - -static int drawing_invalid_p = 0; - -static void -update_screen_image_rep (int pixel_top, int pixel_left, - int pixel_width, int pixel_height) -{ - const unsigned char *in; - unsigned short *out; - unsigned char *out_bytep; - unsigned in_add, out_add, out_add_byte; - CTabHandle color_table; - PixMapHandle pmap; - - int byte_left, byte_right, byte_width; - int bpp; - - if (MainDevice == CLC (NULL) || drawing_invalid_p) - return; - - pmap = GD_PMAP (CL (MainDevice)); - color_table = PIXMAP_TABLE (pmap); - if (CTAB_SEED_X (color_table) != old_seed_x) { - init_color_map_table (CTAB_TABLE (color_table), - CTAB_SIZE (color_table)); - old_seed_x = CTAB_SEED_X(color_table); - } - bpp = PIXMAP_PIXEL_SIZE (pmap); - byte_left = (pixel_left * bpp) / 8; - byte_right = ((pixel_left + pixel_width) * bpp + 7) / 8; - byte_width = byte_right - byte_left; - - pixel_left = (byte_left * 8) / bpp; - pixel_width = (byte_width * 8) / bpp; - - /* Grab the base of input */ - in = &((char *) ROMlib_realScreen)[ROMlib_realScreenRowBytes * pixel_top - + byte_left]; - in_add = ROMlib_realScreenRowBytes - byte_width; - - /* Transfer the stuff to the screen. */ - if (ROMlib_nextscreen == SCREEN_MONO) { - /* Grab the base of output. */ - out_bytep = (unsigned char *) ((char *)[theonlyscreenimagerep data] - + ([theonlyscreenimagerep bytesPerRow] * pixel_top - + pixel_left * sizeof (unsigned short))); - out_add_byte = ([theonlyscreenimagerep bytesPerRow] - byte_width); - for (; pixel_height > 0; pixel_height--) - { - int w; - - for (w = byte_width; w > 0; w--) - { - unsigned char this_in; - - this_in = *in++; - switch (bpp) - { - case 1: - /* TODO */ - *out_bytep++ = mono_map_table[this_in]; - case 2: - *out_bytep++ = mono_map_table[this_in]; - break; - } - } - - in += in_add; - out_bytep += out_add_byte; - } - } else { - /* Grab the base of output. */ - out = (unsigned short *) ((char *)[theonlyscreenimagerep data] - + ([theonlyscreenimagerep bytesPerRow] * pixel_top - + pixel_left * sizeof (unsigned short))); - out_add = ([theonlyscreenimagerep bytesPerRow] - - byte_width * sizeof (unsigned short)); - - for (; pixel_height > 0; pixel_height--) - { - int w; - - for (w = byte_width; w > 0; w--) - { - unsigned char this_in; - - this_in = *in++; - switch (bpp) - { - case 1: - *out++ = color_map_table[(this_in >> 7) & 0x1]; - *out++ = color_map_table[(this_in >> 6) & 0x1]; - *out++ = color_map_table[(this_in >> 5) & 0x1]; - *out++ = color_map_table[(this_in >> 4) & 0x1]; - *out++ = color_map_table[(this_in >> 3) & 0x1]; - *out++ = color_map_table[(this_in >> 2) & 0x1]; - *out++ = color_map_table[(this_in >> 1) & 0x1]; - *out++ = color_map_table[this_in & 0x1]; - break; - case 2: - *out++ = color_map_table[(this_in >> 6) & 0x3]; - *out++ = color_map_table[(this_in >> 4) & 0x3]; - *out++ = color_map_table[(this_in >> 2) & 0x3]; - *out++ = color_map_table[this_in & 0x3]; - break; - case 4: - *out++ = color_map_table[(this_in >> 4) & 0xF]; - *out++ = color_map_table[this_in & 0xF]; - break; - case 8: - *out++ = color_map_table[this_in]; - break; - } - } - - in += in_add; - out = (unsigned short *) ((char *) out + out_add); - } - } -} - -void putimageX(long top, long left, long bottom, long right) -{ - NXRect rect; - NXPoint point; - virtual_int_state_t block; - - point.x = left * mac_to_next_x; - point.y = (orig_height - bottom) * mac_to_next_y; - - rect.origin = point; - rect.size.width = (right - left) * mac_to_next_x; - rect.size.height = (bottom - top) * mac_to_next_y; - - block = block_virtual_ints (); -#if 0 - [theonlyscreenimage recache]; - [theonlyscreenimage composite:NX_COPY fromRect:&rect toPoint:&point]; - - /* WOULD BE NICE: NXCopyBits(NXNullObject, &rect, &point); */ -#else /* 0 */ - if (0 && ROMlib_accstate == acc_accelerated) - accelerate(top, left, bottom, right); - else - { - update_screen_image_rep (top, left, right - left, bottom - top); - [theonlyframe display:&rect: 1: YES]; - } -#endif /* 0 */ - restore_virtual_ints (block); -} - -/* - * NOTE: the code below should be table driven. - */ - -static NXAtom ARDIPICTPboardType = "PICT"; - -#define TEXT (('T'<<24)|('E'<<16)|('X'<<8)|'T') -#define EPS (('E'<<24)|('P'<<16)|('S'<<8)|' ') -#define RTF (('R'<<24)|('T'<<16)|('F'<<8)|' ') -#define TIFF (('T'<<24)|('I'<<16)|('F'<<8)|'F') -#define PICT (('P'<<24)|('I'<<16)|('C'<<8)|'T') - -id ROMlib_pasteboard = 0; -int ROMlib_ourchangecount; - -void PutScrapX(long type, long length, char *p) -{ - static int count = 0; - static int textcount = 0, epscount = 0, rtfcount = 0, tiffcount = 0, - pictcount = 0; - static char *textdata, *epsdata, *rtfdata, *tiffdata, *pictdata; - static long textlength, epslength, rtflength, tifflength, pictlength; - char doit; - char const *types[5]; - int i; - virtual_int_state_t block; - long fonttblextra; - - SETUPA5; - block = block_virtual_ints (); - if (!ROMlib_pasteboard) - ROMlib_pasteboard = [Pasteboard new]; - doit = NO; - switch (type) { - case TEXT: - if (count == textcount) - ++count; - textcount = count; - if (textdata) - free(textdata); - textdata = malloc(length); - convertreturns(p, textdata, length, MacToUNIX); - convertchars(textdata, length, mactonext); - textlength = length; - doit = YES; - break; - case EPS: - if (count == epscount) - ++count; - epscount = count; - if (epsdata) - free(epsdata); - epsdata = malloc(length); - convertreturns(p, epsdata, length, MacToUNIX); - epslength = length; - doit = YES; - break; - case RTF: - if (count == rtfcount) - ++count; - rtfcount = count; - if (rtfdata) - free(rtfdata); - - - fonttblextra = insertfonttbl((char **) 0, (char) 0); - - rtfdata = malloc(length + fonttblextra); - rtflength = convertreturns(p, rtfdata, length, MacRTFToUNIX); - convertchars(rtfdata, rtflength, mactonext); - doit = YES; - break; - case TIFF: - if (count == tiffcount) - ++count; - tiffcount = count; - if (tiffdata) - free(tiffdata); - tiffdata = malloc(length); - bcopy(p, tiffdata, length); - tifflength = length; - doit = YES; - break; - case PICT: - if (count == pictcount) - ++count; - pictcount = count; - if (pictdata) - free(pictdata); - pictdata = malloc(length); - bcopy(p, pictdata, length); - pictlength = length; - doit = YES; - break; - default: - ; - } - - if (doit) { - i = -1; - if (rtfcount == count) - types[++i] = NXRTFPboardType; - if (epscount == count) - types[++i] = NXPostScriptPboardType; - if (textcount == count) - types[++i] = NXAsciiPboardType; - if (tiffcount == count) - types[++i] = NXTIFFPboardType; - if (pictcount == count) - types[++i] = ARDIPICTPboardType; - [ROMlib_pasteboard declareTypes:types num:i+1 owner:0]; - if (rtfcount == count) - [ROMlib_pasteboard writeType:NXRTFPboardType data:rtfdata - length:rtflength]; - if (epscount == count) - [ROMlib_pasteboard writeType:NXPostScriptPboardType data:epsdata - length:epslength]; - if (textcount == count) - [ROMlib_pasteboard writeType:NXAsciiPboardType data:textdata - length:textlength]; - if (tiffcount == count) - [ROMlib_pasteboard writeType:NXTIFFPboardType data:tiffdata - length:tifflength]; - if (pictcount == count) - [ROMlib_pasteboard writeType:ARDIPICTPboardType data:pictdata - length:pictlength]; - } - ROMlib_ourchangecount = [ROMlib_pasteboard changeCount]; - restore_virtual_ints (block); - RESTOREA5; -} - -/* - * NOTE: ROMlib_ReallocHandle is just calls ReallocHandle - * but ROMlib_ReallocHandle has normal calling conventions. - * ReallocHandle is really a macro that we can't include in - * this pristine, ROMlib ignorant, file. - */ - -extern short MemErr; -#define noErr 0 - -long GetScrapX(long type, char **h) -{ - const NXAtom *types; - char *data; - int length; - NXAtom tofind; - long retval; - int temp; - extern long ROMlib_ZeroScrap( void ); - virtual_int_state_t block; - - SETUPA5; - block = block_virtual_ints (); - if (!ROMlib_pasteboard) - ROMlib_pasteboard = [Pasteboard new]; - retval = -1; - switch (type) { - case TEXT: - tofind = NXAsciiPboardType; - break; - case RTF: - tofind = NXRTFPboardType; - break; - case EPS: - tofind = NXPostScriptPboardType; - break; - case TIFF: - tofind = NXTIFFPboardType; - break; - case PICT: - tofind = ARDIPICTPboardType; - break; - default: - tofind = 0; - break; - } - if (tofind && - (temp = [ROMlib_pasteboard changeCount]) > ROMlib_ourchangecount) { - types = [ROMlib_pasteboard types]; - while (*types && strcmp(*types, tofind) != 0) - ++types; - if (*types && - [ROMlib_pasteboard readType:*types data:&data length:&length]) { - if (tofind == NXRTFPboardType) { - ROMlib_ReallocHandle(h, length * 2); - if (MemErr != noErr) { - retval = -1; -/*-->*/ goto DONE; - } - retval = convertreturns(data, CL(*h), length, UNIXRTFToMac); - convertchars(CL(*h), retval, nexttomac); - ROMlib_ReallocHandle(h, retval); - if (MemErr != noErr) - retval = -1; -/*-->*/ goto DONE; - } else { - ROMlib_ReallocHandle(h, length); - if (MemErr != noErr) { - retval = -1; -/*-->*/ goto DONE; - } - if (tofind != NXTIFFPboardType && tofind != ARDIPICTPboardType) - convertreturns(data, CL(*h), length, UNIXToMac); - else - bcopy(data, CL(*h), length); - if (tofind == NXAsciiPboardType) - convertchars(CL(*h), length, nexttomac); - } - vm_deallocate(task_self(), (vm_address_t) data, length); - retval = length; - } else { - ROMlib_ZeroScrap(); - } - } -DONE: - restore_virtual_ints (block); - RESTOREA5; - return retval; -} - -long *ROMlib_shadowScreen; -long ROMlib_width_slop; - - -- (void) resetscreensize -{ - extern short ROMlib_constrained; - long nbytes; - int fwidth; - NXSize size; - - ROMlib_constrained = YES; - [screenimage removeRepresentation:screenimagerep]; - mac_to_next_x = curr_width / orig_width; - mac_to_next_y = curr_height / orig_height; - theonlyscreenimagerep = - screenimagerep = [NXBitmapImageRep allocFromZone:[self zone]]; - -#if 0 - if ((orig_width % 16) && ((orig_width % 16) < 9)) { /* need padding } */ - fwidth = (orig_width+15) / 16 * 16; -#else - if (orig_width % 2) { - fwidth = orig_width + 1; -#endif - ROMlib_width_slop = fwidth - orig_width; - [screenimage getSize:&size]; - size.width += ROMlib_width_slop * size.width / orig_width; - [screenimage setSize:&size]; - } else - fwidth = orig_width; - - ROMlib_checkscreen(); - if (ROMlib_nextscreen == SCREEN_MONO) { - [screenimagerep initData:0 pixelsWide:fwidth pixelsHigh:orig_height - bitsPerSample:2 samplesPerPixel:1 hasAlpha:NO isPlanar:NO - colorSpace:NX_OneIsWhiteColorSpace bytesPerRow:0 - bitsPerPixel:2]; - ROMlib_realScreenRowBytes = (fwidth+7) / 8 * 2; - } else { - [screenimagerep initData:0 pixelsWide:fwidth pixelsHigh:orig_height - bitsPerSample:4 samplesPerPixel:3 hasAlpha:NO isPlanar:NO - colorSpace:NX_RGBColorSpace bytesPerRow:0 - bitsPerPixel:16]; - ROMlib_realScreenRowBytes = fwidth; /* 1 byte per pixel */ - } - - nbytes = [screenimagerep bytesPerRow] * orig_height; - memset ([screenimagerep data], ~0, nbytes); - free(ROMlib_shadowScreen); - free(ROMlib_realScreen); - ROMlib_shadowScreen = (long *) malloc(ROMlib_realScreenRowBytes * orig_height); - ROMlib_realScreen = (long *) malloc(ROMlib_realScreenRowBytes * orig_height); - memset (ROMlib_realScreen, 0, ROMlib_realScreenRowBytes * orig_height); - drawing_invalid_p = 0; - - [screenimage useRepresentation:screenimagerep]; - host_reset_graphics(); -} - -void ROMlib_resetscreensize( void ) -{ - virtual_int_state_t block; - - block = block_virtual_ints (); - [theonlyframe resetscreensize]; - restore_virtual_ints (block); -} - -extern id global_menu; - -extern id global_sptext; -extern id global_starsptext; -extern id global_pctext; -extern id global_starpctext; -extern id global_d0text; -extern id global_pstext; -extern id global_sigtext; -extern id global_debtext; -extern id global_debtable; -extern id global_deathwindow; -extern id global_commenttext; -extern id global_deathMenuCell; - -void querypointerX(long *xp, long *yp, long *notused) -{ - NXPoint p; - virtual_int_state_t block; - - block = block_virtual_ints (); - [global_gameWindow getMouseLocation:&p]; - [theonlyframe convertPoint:&p fromView:nil]; - *xp = p.x * (1 / mac_to_next_x); - *yp = (curr_height - p.y) * (1 / mac_to_next_y); - restore_virtual_ints (block); -} - -void showcursorX(long show) -{ - virtual_int_state_t block; - - block = block_virtual_ints (); - if (show) - [realcursor set]; - else - [blankcursor set]; - restore_virtual_ints (block); -} - -#undef gray /* hack! */ -void setcursorX(short *data, short *mask, long hotx, long hoty) -{ - extern char CrsrVis; - char *datap; - short i; - short mymask[16], mydata[16], gray; - NXPoint p; - static beenhere = NO; - virtual_int_state_t block; - - block = block_virtual_ints (); - if (!beenhere) { - [global_gameWindow disableCursorRects]; - beenhere = YES; - } - gray = 0x5555; - for (i = 0; i < 16; ++i) { - mymask[i] = ~(data[i] | mask[i]); - gray = ~gray; - mydata[i] = data[i] & ~(gray & (~mask[i] & data[i])); - } - - datap = (char *) [cursorrep data]; - bcopy(mydata, datap , 32); - bcopy(mymask, datap+32, 32); - [cursorimage recache]; - if (CrsrVis) - [blankcursor set]; - - [realcursor setImage:cursorimage]; - p.x = hotx; - p.y = hoty; - [realcursor setHotSpot:&p]; - - if (CrsrVis) - [realcursor set]; - restore_virtual_ints (block); -} - -/* - * ROMlib_printtimeout is specifically for Excel, when you try to - * print an empty page. Excel starts the printing process and then - * writes an message to the screen, informing you that you have a - * blank worksheet. This doesn't in with our printing paradigm, so - * ROMlib_printtimeout is a hack to solve this one instance of the - * general class of printing problems. - * - * ROMlib_printtimeout is positive when we're counting context - * switches, looking for an OpenPage. - * - * ROMlib_printtimeout is zero if we've timed out, but haven't - * yet finished printing from the NeXT's perspective. - * - * ROMlib_printtimeout is negative when we've finished printing. - * This will result in the screen being updated once we - * drop back into the Mac universe. - */ - -long ROMlib_printtimeout = 10000; /* any positive number will do */ - -- step -{ - extern char *nextstep_sp, *romlib_sp; - NXEvent dummyEvent; - - [self lockFocus]; - - do { - contextswitch(&nextstep_sp, &romlib_sp); - } while (printstate != seenOpenDoc && printstate != seenPageSetUp && - [NXApp peekNextEvent:NX_ALLEVENTS into:&dummyEvent] == NULL); - - [self unlockFocus]; - { - SETUPA5; - if (printstate == seenOpenDoc) { - [self printPSCode:self]; - if (ROMlib_printtimeout == 0) - ROMlib_printtimeout = -1; - } else if (printstate == seenPageSetUp) { - [NXApp runPageLayout:self]; - printstate = __idle; - } - RESTOREA5; - } - - return self; -} - -static void timerswitch(DPSTimedEntry notused, double timenow, void *data) -{ - static double oldnow; - - SETUPA5; - if (oldnow == 0.0 || timenow - oldnow > 5*50) { - protectus(0, 0); - oldnow = timenow; - } - /* might be useful to look at timenow and update various low memory - globals */ - [(id)data step]; - RESTOREA5; -} - -- initFrame:(const NXRect *)frm -{ - NXSize size; - short *maskp; - char *datap; - int bytecount; - short i; - long nbytes; - - orig_height = frm->size.height; - orig_width = frm->size.width; - curr_height = orig_height; - curr_width = orig_width; - - [super initFrame:frm]; - - - [self setClipping:NO]; - [self setOpaque:YES]; - [self allocateGState]; // For faster lock/unlockFocus - -/* make the screen */ - - theonlyscreenimagerep = - screenimagerep = [NXBitmapImageRep allocFromZone:[self zone]]; - - ROMlib_checkscreen(); - if (ROMlib_nextscreen == SCREEN_MONO) { - [screenimagerep initData:0 pixelsWide:orig_width pixelsHigh:orig_height - bitsPerSample:2 samplesPerPixel:1 hasAlpha:NO isPlanar:NO - colorSpace:NX_OneIsWhiteColorSpace bytesPerRow:0 - bitsPerPixel:2]; - ROMlib_realScreenRowBytes = (orig_width + 7) / 8 * 2; - } else { - [screenimagerep initData:0 pixelsWide:orig_width pixelsHigh:orig_height - bitsPerSample:4 samplesPerPixel:3 hasAlpha:NO isPlanar:NO - colorSpace:NX_RGBColorSpace bytesPerRow:0 - bitsPerPixel:16]; - ROMlib_realScreenRowBytes = (orig_width + 1) & ~1; /* 1 byte per pixel */ - } - nbytes = [screenimagerep bytesPerRow] * orig_height; - memset ([screenimagerep data], ~0, nbytes); - - theonlyscreenimage = - screenimage = [[NXImage allocFromZone:[self zone]] initSize:&frm->size]; - [screenimage setDataRetained:YES]; - [screenimage setScalable:YES]; /* may be faster to set NO until - someone resizes */ - [screenimage useRepresentation:screenimagerep]; - - ROMlib_shadowScreen = (long *) malloc(ROMlib_realScreenRowBytes * orig_height); - ROMlib_realScreen = (long *) malloc(ROMlib_realScreenRowBytes * orig_height); - memset (ROMlib_realScreen, 0, ROMlib_realScreenRowBytes * orig_height); - - drawing_invalid_p = 0; - -/* make the cursor */ - - cursorrep = [NXBitmapImageRep allocFromZone:[self zone]]; - [cursorrep initData:0 pixelsWide:16 pixelsHigh:16 - bitsPerSample:1 samplesPerPixel:2 hasAlpha:YES isPlanar:YES - colorSpace:NX_OneIsBlackColorSpace bytesPerRow:0 - bitsPerPixel:0]; - bzero([cursorrep data], [cursorrep bytesPerRow] * 16 * 2); - - size.width = size.height = 16; - cursorimage = [[NXImage allocFromZone:[self zone]] initSize:&size]; - [cursorimage setDataRetained:YES]; - [cursorimage setScalable:YES]; /* may be faster to set NO until - someone resizes */ - [cursorimage useRepresentation:cursorrep]; - realcursor = [NXCursor allocFromZone:[self zone]]; - [realcursor initFromImage:cursorimage]; - -/* make the blank cursor (for when it's hidden) */ - - blankcursorrep = [NXBitmapImageRep allocFromZone:[self zone]]; - [blankcursorrep initData:0 pixelsWide:16 pixelsHigh:16 - bitsPerSample:1 samplesPerPixel:2 hasAlpha:YES isPlanar:YES - colorSpace:NX_OneIsBlackColorSpace bytesPerRow:0 - bitsPerPixel:0]; - - bzero(datap = (char *) [blankcursorrep data], - bytecount = [blankcursorrep bytesPerRow] * 16); - maskp = (short *) (datap + bytecount); - for (i = 16; --i >= 0;) - *maskp++ = 0xFFFF; - - size.width = size.height = 16; - blankcursorimage = [[NXImage allocFromZone:[self zone]] initSize:&size]; - [blankcursorimage setDataRetained:YES]; - [blankcursorimage setScalable:YES]; /* may be faster to set NO until - someone resizes */ - [blankcursorimage useRepresentation:blankcursorrep]; - blankcursor = [NXCursor allocFromZone:[self zone]]; - [blankcursor initFromImage:blankcursorimage]; - - timer = DPSAddTimedEntry(0, &timerswitch, self, NX_BASETHRESHOLD); - - return theonlyframe = self; -} - -void ROMlib_nextscreeninfo(short *rowbytep, short *bottomp, short *rightp, - char **addrp) -{ - virtual_int_state_t block; - - block = block_virtual_ints (); - *rowbytep = ROMlib_realScreenRowBytes; - *bottomp = [theonlyscreenimagerep pixelsHigh]; - *rightp = orig_width; - *addrp = (char *) ROMlib_realScreen /*[theonlyscreenimagerep data]*/; - restore_virtual_ints (block); -} - -void ROMlib_SetTitle(char *newtitle) -{ - virtual_int_state_t block; - - block = block_virtual_ints (); - [global_gameWindow setTitle:newtitle]; - restore_virtual_ints (block); -} - -/* - * NOTE: ROMlib_SetSize should only be called before the application is - * truly initialized (i.e. before *it* calls InitGraf). - * - * Right now ParseConfigFile() is the only thing that calls - * ROMlib_SetSize. - */ - -void ROMlib_SetSize(pair_t *pairp, pair_t *p2) -{ - virtual_int_state_t block; - - block = block_virtual_ints (); - curr_width = pairp->first; - curr_height = pairp->second; - orig_width = p2->first; - orig_height = p2->second; - ROMlib_resetscreensize(); - [global_gameWindow sizeWindow: curr_width : curr_height]; - restore_virtual_ints (block); -} - -void ROMlib_SetLocation(pair_t *pairp) -{ - NXSize size; - virtual_int_state_t block; - - block = block_virtual_ints (); - [NXApp getScreenSize:&size]; - [global_gameWindow moveTopLeftTo:pairp->first:size.height - pairp->second]; - restore_virtual_ints (block); -} - -void ROMlib_HideScreen(void) -{ - virtual_int_state_t block; - - block = block_virtual_ints (); - [global_gameWindow orderOut:0]; - restore_virtual_ints (block); -} - -void ROMlib_ShowScreen(void) -{ - virtual_int_state_t block; - - block = block_virtual_ints (); - [global_gameWindow makeKeyAndOrderFront:0]; - restore_virtual_ints (block); -} - -typedef enum { hexfield, unknownfield, signalfield, decimalfield} field_t; - -static void deathfield(id theid, field_t fieldtype, long value, const char *pre) -{ - char buf[80], *next; - char *signames[] = { - "HUP", "INT", "QUIT", "ILL", "TRAP", "IOT", "EMT", "FPE", - "KILL", "BUS", "SEGV", "SYS", "PIPE", "ALRM", "TERM", "URG", - "STOP", "TSTP", "CONT", "CHLD", "TTIN", "TTOU", "IO", "XCPU", - "XFSZ", "VTALRM", "PROF", "WINCH", "LOST", "USR1", "USR2", - }; - - sprintf(buf, "%s = ", pre); - next = buf + strlen(buf); - switch (fieldtype) { - case hexfield: - sprintf(next, "0x%08lX", value); - break; - case signalfield: - if (value >= 1 && value <= 31) { - sprintf(next, "SIG%s", signames[value-1]); - break; - } - /* else FALL THROUGH */ - case unknownfield: - sprintf(next, "**********"); - break; - case decimalfield: - sprintf(next, "%ld", value); - break; - } - [theid setStringValue:buf]; -} - -static jmp_buf jbuf; - -static void badaddr( void ) -{ - longjmp(jbuf, 1); -} - -/* - * fetchlongat has the nasty side effect of clobbering signal vectors, - * but since it's only called as part of the deathwish, it doesn't matter. - */ - -static int fetchlongat(long pc, long *contentsp) -{ - int retval; - - signal(SIGBUS, (void *) badaddr); - signal(SIGSEGV, (void *) badaddr); - sigsetmask(sigsetmask(-1L) & ~(sigmask(SIGBUS)|sigmask(SIGSEGV))); - if (setjmp(jbuf)) { - retval = 0; /* will only get here via longjmp */ - } else { - *contentsp = *(long *)pc; /* could cause buserror or segv */ - retval = 1; - } - return retval; -} - -typedef struct { - long when; - unsigned short trapn; - short filler; -} trapsortentry_t; - -#if !defined(NITEMS) -#define NITEMS(x) (sizeof((x)) / sizeof((x)[0])) -#endif - -#if defined(BINCOMPAT) -static void deathtraps( void ) -{ - trapsortentry_t lasttraps[24]; - char buf[512]; /* more than necessary */ - short i, j, ninthere, ntomove; - extern long debugtable[1<<12]; - long newwhen; - - ninthere = 0; - for (i = 0; i < NITEMS(lasttraps); ++i) { - lasttraps[i].when = -1; - lasttraps[i].trapn = 0; - } - for (i = 0; i < NITEMS(debugtable); ++i) { - newwhen = debugtable[i]; - for (j = 0; j < ninthere; ++j) - if (newwhen > lasttraps[j].when) -/*-->*/ break; - ntomove = ninthere - j - 1; - if (ntomove > 0) - bcopy((char *) &lasttraps[j], (char *) &lasttraps[j+1], - sizeof(lasttraps[0]) * ntomove); - if (j < NITEMS(lasttraps)) { - lasttraps[j].when = newwhen; - lasttraps[j].trapn = 0xA000 + i; - if (ninthere < NITEMS(lasttraps)) - ++ninthere; - } - } - sprintf(buf, "%04X, %04X, %04X\n" - "%04X, %04X, %04X\n" - "%04X, %04X, %04X\n" - "%04X, %04X, %04X\n" - "%04X, %04X, %04X\n" - "%04X, %04X, %04X\n" - "%04X, %04X, %04X\n" - "%04X, %04X, %04X", - lasttraps[ 0].trapn, lasttraps[ 1].trapn, lasttraps[ 2].trapn, - lasttraps[ 3].trapn, lasttraps[ 4].trapn, lasttraps[ 5].trapn, - lasttraps[ 6].trapn, lasttraps[ 7].trapn, lasttraps[ 8].trapn, - lasttraps[ 9].trapn, lasttraps[10].trapn, lasttraps[11].trapn, - lasttraps[12].trapn, lasttraps[13].trapn, lasttraps[14].trapn, - lasttraps[15].trapn, lasttraps[16].trapn, lasttraps[17].trapn, - lasttraps[18].trapn, lasttraps[19].trapn, lasttraps[20].trapn, - lasttraps[21].trapn, lasttraps[22].trapn, lasttraps[23].trapn); - [global_debtable setStringValue:buf]; -} -#endif defined(BINCOMPAT) - -#if !defined(NELEM) -#define NELEM(x) (sizeof((x)) / sizeof((x)[0])) -#endif - -typedef enum { appnotstarted, appisrunning, appdied } appstate_t; - -static appstate_t appstate = appnotstarted; - -void ROMlib_startapp( void ) -{ - id abortcell; - - abortcell = [global_menu findCellWithTag:11]; - [abortcell setTitleNoCopy:"Abort..."]; - appstate = appisrunning; -} - -#if defined(BINCOMPAT) -static long addrof( unsigned short trapno ) -{ - return NGetTrapAddress(mostrecenttrap, - mostrecenttrap & TOOLBIT ? ToolTrap : OSTrap); -} -#endif - -/* - * TODO: probably it make sense to context switch before doing any - * NeXT stuff... we could set a flag and then context switch and then - * look at the flag... - */ - -static long sp, pc, starsp, starpc, d0, psl, sig; -static field_t starspfield, starpcfield; - -void ROMlib_death_by_signal( long wsignal, long code, struct sigcontext *scp ) -{ - extern char *nextstep_sp, *romlib_sp; - char buf[512]; -#if defined(BINCOMPAT) - extern unsigned short mostrecenttrap; - extern char _UNKNOWN; -#endif - struct itimerval toset; - id abortcell; - - SETUPA5; - toset.it_value.tv_sec = 0; - toset.it_value.tv_usec = 0; - toset.it_interval.tv_sec = 0; - toset.it_interval.tv_usec = 0; - setitimer(ITIMER_REAL, &toset, (struct itimerval *) 0); - - DPSRemoveTimedEntry(timer); - - -#if defined(mc68000) - if (fetchlongat(scp->sc_sp, &starsp)) - starspfield = hexfield; - else - starspfield = unknownfield; - - if (fetchlongat(scp->sc_pc, &starpc)) - starpcfield = hexfield; - else - starpcfield = unknownfield; - - sp = scp->sc_sp; - pc = scp->sc_pc; - d0 = scp->sc_d0; - psl = scp->sc_ps; -#elif defined(i386) || defined(i486) - if (fetchlongat(scp->sc_esp, &starsp)) - starspfield = hexfield; - else - starspfield = unknownfield; - - if (fetchlongat(scp->sc_eip, &starpc)) - starpcfield = hexfield; - else - starpcfield = unknownfield; - - sp = scp->sc_esp; - pc = scp->sc_eip; - d0 = scp->sc_eax; - psl = scp->sc_eflags; -#else - This will not compile -#endif - sig = wsignal; - - deathfield(global_sptext, hexfield, sp, " SP"); - deathfield(global_starsptext, starspfield, starsp, "*SP"); - deathfield(global_pctext, hexfield, pc, " PC"); - deathfield(global_starpctext, starpcfield, starpc, "*PC"); - deathfield(global_d0text, hexfield, d0, " D0"); - deathfield(global_pstext, hexfield, psl, "PSL"); - deathfield(global_sigtext, signalfield, wsignal, "SIG"); -#if defined(BINCOMPAT) - deathfield(global_debtext, decimalfield, debugnumber, "deb"); - deathtraps(); -#endif - switch (wsignal) { - case SIGHUP: - case SIGINT: - case SIGQUIT: - case SIGKILL: - case SIGTERM: - case SIGSTOP: - case SIGTSTP: - case SIGCONT: - case SIGCHLD: - strcpy(buf, - "The death was generated externally from Executor." - " Either" - " you killed Executor, or someone using your account or root" - " did so."); - break; - - case SIGILL: -#if defined(BINCOMPAT) && defined(mc68000) - if (*(short *) scp->sc_pc == 0x4AFC) { - if (scp->sc_pc == (long) &_UNKNOWN) { - sprintf(buf, "The program running attempted to execute an" - " A-line [0x%x] trap for which ARDI does not" - " have documentation.", mostrecenttrap); - } else { - if (addrof(mostrecenttrap) == addrof(0xA89F)) - sprintf(buf, "The program running attempted to execute" - " an A-line trap [0x%x] that we do not currently" - " support" - ".", mostrecenttrap); - else - sprintf(buf, "An internal error has been detected."); - } - break; - } /* else FALL THROUGH */ -#endif - - case SIGTRAP: - case SIGIOT: - case SIGEMT: - case SIGFPE: - strcpy(buf, - "This death is surprising. The fault was not caused" - " by a non-32 bit clean program, but it may have been caused" - " by MC68040 cache problems." - ); - break; - - case SIGBUS: - case SIGSEGV: - strcpy(buf, - "Several things could have caused this death. Non-32 bit" - " clean applications are the most common cause of this." - ); - break; - - case SIGSYS: - case SIGPIPE: - case SIGALRM: - case SIGURG : - case SIGTTIN: - case SIGTTOU: - case SIGIO: - case SIGVTALRM: - case SIGPROF: - case SIGWINCH: - case SIGLOST: - default: - strcpy(buf, - "Executor received a very surprising signal. If this death" - " is reproducible, you should notify ARDI so it can be fixed."); - break; - - case SIGXCPU: - strcpy(buf, "You have a CPU limit, and Executor exceeded it."); - break; - - case SIGXFSZ: - strcpy(buf, - "You have a File size limit, and Executor exceeded it."); - break; - } - [global_commenttext setStringValue:buf]; - [global_deathwindow orderFront:0]; - abortcell = [global_menu findCellWithTag:11]; - [abortcell setTitleNoCopy:"Abort"]; - [global_deathMenuCell setEnabled:YES]; - appstate = appdied; - RESTOREA5; -#if defined(mc68000) - if (((unsigned long )scp->sc_sp & 0xFFFF0000) == /* not the best test */ - ((unsigned long) romlib_sp & 0xFFFF0000)) -#endif - contextswitch(&romlib_sp, &nextstep_sp); -} - -// The following allows MacViewClass to grab the mousedown event that activates -// the window. By default, the View's acceptsFirstMouse returns NO. - -- (BOOL)acceptsFirstMouse -{ -#if 1 - return YES; -#else - return NO; -#endif -} - -- (BOOL) acceptsFirstResponder -{ - return YES; -} - -- sizeTo:(NXCoord) width :(NXCoord)height -{ - NXRect trackrect; - NXSize size; - - size.width = width; - size.height = height; - curr_height = height; - curr_width = width; - mac_to_next_x = width / orig_width; - mac_to_next_y = height / orig_height; - [super sizeTo:width :height]; - size.width += ROMlib_width_slop * size.width / orig_width; - [screenimage setSize:&size]; - trackrect.origin.x = 0; - trackrect.origin.y = 0; - trackrect.size = size; - [self convertRect:&trackrect toView:nil]; - [[self window] setTrackingRect:&trackrect inside:YES owner:self tag:1 - left:NO right:NO]; - - /* HACK! */ - drawing_invalid_p = 1; - - return self; -} - -- mouseDown:(NXEvent *)eventp -{ - SETUPA5; - [self convertPoint:&eventp->location fromView:nil]; - postnextevent(eventp); - RESTOREA5; - - return self; -} - -- mouseMoved:(NXEvent *)eventp -{ - SETUPA5; - [self convertPoint:&eventp->location fromView:nil]; - ROMlib_updatemouselocation(eventp); - RESTOREA5; - return self; -} - -- mouseDragged:(NXEvent *)eventp -{ - SETUPA5; - [self convertPoint:&eventp->location fromView:nil]; - ROMlib_updatemouselocation(eventp); - RESTOREA5; - return self; -} - -- mouseUp:(NXEvent *)eventp -{ - SETUPA5; - [self convertPoint:&eventp->location fromView:nil]; - postnextevent(eventp); - RESTOREA5; - - return self; -} - -- mouseEntered:(NXEvent *)eventp -{ - extern char CrsrVis; - - SETUPA5; - if (CrsrVis) - [realcursor set]; - else - [blankcursor set]; - [self convertPoint:&eventp->location fromView:nil]; - postnextevent(eventp); - RESTOREA5; - return self; -} - -- mouseExited:(NXEvent *)eventp -{ - SETUPA5; - [NXArrow set]; - [self convertPoint:&eventp->location fromView:nil]; - postnextevent(eventp); - RESTOREA5; - return self; -} - -- keyDown:(NXEvent *)eventp -{ - SETUPA5; - [self convertPoint:&eventp->location fromView:nil]; - postnextevent(eventp); - RESTOREA5; - return self; -} - -static struct { - long mask; char key; -} maskkeys[] = { - { NX_ALPHASHIFTMASK, 0x39, }, - { NX_SHIFTMASK, 0x38, }, - { NX_CONTROLMASK, 0x3B, }, - { NX_ALTERNATEMASK, 0x3A, }, - { NX_COMMANDMASK, 0x37, }, -}; - -- flagsChanged:(NXEvent *)eventp -{ - int i; - extern void ROMlib_zapmap( long key, long value ); - extern short ROMlib_mods; - extern short ROMlib_next_butmods_to_mac_butmods(long flags); - - SETUPA5; - for (i = NELEM(maskkeys); --i >= 0;) { - ROMlib_zapmap(maskkeys[i].key, !!(eventp->flags & maskkeys[i].mask)); - } - /* If shift is down, assume caps lock is not. The NeXT doesn't give us - * a separate bit for just caps lock, which we need for Solarian. This - * will give us a decent (but imperfect) approximation... - */ - if (eventp->flags & NX_SHIFTMASK) - ROMlib_zapmap(0x39, 0); - ROMlib_mods = ROMlib_next_butmods_to_mac_butmods(eventp->flags); - RESTOREA5; - return self; -} - -- (BOOL) performKeyEquivalent:(NXEvent *)eventp -{ - if (appstate == appisrunning) { - SETUPA5; - [self convertPoint:&eventp->location fromView:nil]; - postnextevent(eventp); - RESTOREA5; - return YES; - } else { - if (debugnumber && (eventp->data.key.charCode == 'M')) { - [mailPanel makeKeyAndOrderFront:0]; - return YES; - } else - return [super performKeyEquivalent:eventp]; - } -} - -- keyUp:(NXEvent *)eventp -{ - SETUPA5; - [self convertPoint:&eventp->location fromView:nil]; - postnextevent(eventp); - RESTOREA5; - return self; -} - -- drawSelf:(NXRect *)rects :(int)rectCount -{ - NXRect r, *rp; - extern char *nextstep_sp, *romlib_sp; - int i; - long top, left, bottom, right; - SETUPA5; - - switch (printstate) { - case __idle: - if (0 && ROMlib_accstate == acc_accelerated) { - i = rectCount; - rp = rects; - if (i > 1) { - --i; /* skip first rectangle, since it's the bounding */ - ++rp; /* rectangle */ - } - while (--i >= 0) { - top = rp->origin.y; - left = rp->origin.x; - bottom = top + rp->size.height; - right = left + rp->size.width; - accelerate(top, left, bottom, right); - } - } else { - r.origin.x = 0; - r.origin.y = 0; - r.size.width = curr_width + - ROMlib_width_slop * curr_width / orig_width; - r.size.height = curr_height; - - update_screen_image_rep (0, 0, curr_width, curr_height); - - [theonlyscreenimagerep drawIn:&r]; - } - break; - case seenOpenPage: - RESTOREA5; - do - contextswitch(&nextstep_sp, &romlib_sp); - while (printstate != __idle && printstate != seenClosePage); - goto avoidrestorea5; - break; - default: - /* seenClosePage may get us in here, but we can't do anything - without sploding (I think) */ - break; - } - - RESTOREA5; -avoidrestorea5: - return self; -} - -- validRequestorForSendType:(NXAtom)typeSent andReturnType:(NXAtom)typeReturned -{ - return self; -} - -- readSelectionFromPasteboard:pboard -{ - extern char *nextstep_sp, *romlib_sp; - id saveROMlib_pasteboard; - - { - SETUPA5; - sendsuspendevent(); - RESTOREA5; - } - contextswitch(&nextstep_sp, &romlib_sp); - contextswitch(&nextstep_sp, &romlib_sp); - contextswitch(&nextstep_sp, &romlib_sp); - saveROMlib_pasteboard = ROMlib_pasteboard; - ROMlib_pasteboard = pboard; - { - SETUPA5; - sendresumeevent(YES); - RESTOREA5; - } - contextswitch(&nextstep_sp, &romlib_sp); - contextswitch(&nextstep_sp, &romlib_sp); - contextswitch(&nextstep_sp, &romlib_sp); - ROMlib_pasteboard = saveROMlib_pasteboard; - { - SETUPA5; - sendpaste(); - RESTOREA5; - } - contextswitch(&nextstep_sp, &romlib_sp); - contextswitch(&nextstep_sp, &romlib_sp); - contextswitch(&nextstep_sp, &romlib_sp); - return self; -} - -- (BOOL)writeSelectionToPasteboard:pboard types:(NXAtom *)types -{ - extern char *nextstep_sp, *romlib_sp; - id saveROMlib_pasteboard; - - { - SETUPA5; - sendcopy(); - RESTOREA5; - } - contextswitch(&nextstep_sp, &romlib_sp); - contextswitch(&nextstep_sp, &romlib_sp); - contextswitch(&nextstep_sp, &romlib_sp); - saveROMlib_pasteboard = ROMlib_pasteboard; - ROMlib_pasteboard = pboard; - { - SETUPA5; - sendsuspendevent(); - RESTOREA5; - } - contextswitch(&nextstep_sp, &romlib_sp); - contextswitch(&nextstep_sp, &romlib_sp); - contextswitch(&nextstep_sp, &romlib_sp); - ROMlib_pasteboard = saveROMlib_pasteboard; - { - SETUPA5; - sendresumeevent(NO); - RESTOREA5; - } - return YES; -} - -- (BOOL)getRect:(NXRect *)theRect forPage:(int)page -{ - extern char *nextstep_sp, *romlib_sp; - extern long pagewanted; - - pagewanted = page; - *theRect = *[[NXApp printInfo] paperRect]; - ROMlib_printtimeout = 10000; - while (printstate != __idle && printstate != seenOpenPage && - --ROMlib_printtimeout != 0) - contextswitch(&nextstep_sp, &romlib_sp); - if (ROMlib_printtimeout == 0) - printstate = __idle; - return printstate == __idle ? NO : YES; -} - -- (BOOL)knowsPagesFirst:(int *)firstPageNum last:(int *)lastPageNum -{ - return YES; -} - -char ROMlib_needtorestore; -extern char ROMlib_suppressclip; - -- beginPageSetupRect:(const NXRect * )aRect - placement:(const NXPoint *) location -{ - id retval; - - retval = [super beginPageSetupRect:aRect placement:location]; - ROMlib_needtorestore = 0; - ROMlib_suppressclip = 0; - - return retval; -} - -- addToPageSetup -{ - float scale; - - scale = [[NXApp printInfo] scalingFactor]; - PStranslate(0, [[NXApp printInfo] paperRect]->size.height); - PSscale(1 * scale, -1 * scale); -/* - * NOTE: we should probably check to see whether pse and psb are - * defined before blowing them away, but then again, just - * 'cause they're defined doesn't mean they're what we want. - */ - DPSPrintf(DPSGetCurrentContext(), "/pse {} def\n" - "/psb {} def\n" - "/execuserobject {\n" - " dup UserObjects length ge\n" - " { pop }\n" - " { UserObjects exch get exec }\n" - " ifelse\n" - "} def\n" - "/currentmouse { 0 0 } def\n" - "/printobject { pop pop } def\n" - ); - return [super addToPageSetup]; -} - -/* - * NOTE: %% is needed to get just one % - */ - -- endPageSetup -{ - id retval; - - retval = [super endPageSetup]; - - DPSPrintf(DPSGetCurrentContext(), - "%% The following is a lie that is necessary because Word 5\n" - "%% doesn't wrap EPS files properly and we can't tell where\n" - "%% the PostScript we're printing comes from.\n" - "%%%%BeginDocument: IWishWeDidntHaveToDoThis\n"); - return retval; -} - -- endPage -{ - if (ROMlib_needtorestore) - PSgrestore(); - DPSPrintf(DPSGetCurrentContext(), - "%%%%EndDocument\n" - "/showpage systemdict begin { showpage } bind end def\n"); - return [super endPage]; -} - -- endPSOutput -{ - extern long pagewanted; - - [super endPSOutput]; - pagewanted = 1024 * 1024; /* i.e. real big */ - return self; -} - - -- pause:sender -{ - id pausecell; - static char oldtitle[80]; - - pausecell = [global_menu findCellWithTag:10]; - if ([pausecell title][0] == 'P') { - DPSRemoveTimedEntry(timer); - strncpy(oldtitle, [global_gameWindow title], sizeof(oldtitle)); - oldtitle[sizeof(oldtitle)-1] = 0; - [global_gameWindow setTitle:"Executor is PAUSED"]; - [pausecell setTitleNoCopy:"Continue"]; - } else { - [global_gameWindow setTitle:oldtitle]; - [pausecell setTitleNoCopy:"Pause"]; - timer = DPSAddTimedEntry(0, &timerswitch, self, NX_BASETHRESHOLD); - } - return self; -} - -- abort:sender -{ - if (appstate != appisrunning || - NXRunAlertPanel("Are You Sure", - "Hitting the \"Abort Anyway\" button will cause Executor " - "to stop immediately, without giving the currently running " - "program a chance to quit gracefully. This can result in " - "corrupted files.", "Cancel", "Abort Anyway", (const char *) 0) == - NX_ALERTALTERNATE) - [NXApp terminate:sender]; - return self; -} - -- endPrologue -{ - extern int pageno; - - pageno = 0; - DPSPrintf(DPSGetCurrentContext(), -"/MacEncoding StandardEncoding 256 array copy def\n" -"\n" -"128\n" -"[\n" -" /Adieresis /Aring /Ccedilla /Eacute\n" -" /Ntilde /Odieresis /Udieresis /aacute\n" -" /agrave /acircumflex /adieresis /atilde\n" -" /aring /ccedilla /eacute /egrave\n" -" /ecircumflex /edieresis /iacute /igrave\n" -" /icircumflex /idieresis /ntilde /oacute\n" -" /ograve /ocircumflex /odieresis /otilde\n" -" /uacute /ugrave /ucircumflex /udieresis\n" -" /dagger /degree /cent /sterling\n" -" /section /bullet /paragraph /germandbls\n" -" /registered /copyright /trademark /acute\n" -" /dieresis /notequal /AE /Oslash\n" -" /infinity /plusminus /lessequal /greaterequal\n" -" /yen /mu /partialdiff /summation\n" -" /product /pi /integral /ordfeminine\n" -" /ordmasculine /Omega /ae /oslash\n" -" /questiondown /exclamdown /logicalnot /radical\n" -" /florin /approxequal /Delta /guillemotleft\n" -" /guillemotright /ellipsis /space /Agrave\n" -" /Atilde /Otilde /OE /oe\n" -" /endash /emdash /quotedblleft /quotedblright\n" -" /quoteleft /quoteright /divide /lozenge\n" -" /ydieresis /Ydieresis /fraction /currency\n" -" /guilsinglleft /guilsinglright /fi /fl\n" -" /daggerdbl /periodcentered /quotesinglbase /quotedblbase\n" -" /perthousand /Acircumflex /Ecircumflex /Aacute\n" -" /Edieresis /Egrave /Iacute /Icircumflex\n" -" /Idieresis /Igrave /Oacute /Ocircumflex\n" -" /apple /Ograve /Uacute /Ucircumflex\n" -" /Ugrave /dotlessi /circumflex /tilde\n" -" /macron /breve /dotaccent /ring\n" -" /cedilla /hungarumlaut /oganek /caron\n" -"]\n" -" { MacEncoding 2 index 2 index put pop 1 add }\n" -"forall\n" -"pop\n" -"\n" -"/MacEncoding MacEncoding readonly def\n" -"\n" -"/_MACfstr 128 string dup 0 (_MAC) putinterval def \n" -"\n" -"/findfont\n" -"{\n" -" /currentshared where\n" -" {pop currentshared}\n" -" {FALSE}\n" -" ifelse\n" -" {//findfont exec}\n" -" {\n" -" dup _MACfstr 4 124 getinterval cvs length 4 add _MACfstr 0 3 -1 roll\n" -" getinterval cvn exch FontDirectory 2 index known \n" -" {pop FontDirectory exch get}\n" -" {\n" -" //findfont exec dup /Encoding get\n" -" dup\n" -" StandardEncoding eq\n" -" exch\n" -" /NextStepEncoding where\n" -" { /NextStepEncoding get eq }\n" -" { FALSE }\n" -" ifelse\n" -" or\n" -" {\n" -" dup length dict exch\n" -" {\n" -" 1 index /FID ne\n" -" {2 index 3 1 roll put}\n" -" {pop pop}\n" -" ifelse\n" -" } forall\n" -" dup /Encoding MacEncoding put definefont\n" -" }\n" -" {exch pop}\n" -" ifelse\n" -" }\n" -" ifelse\n" -" }\n" -" ifelse\n" -"} bind def\n" -"\n" -"/selectfont {\n" -" exch findfont\n" -" exch dup type /arraytype eq\n" -" {makefont}\n" -" {scalefont}\n" -" ifelse\n" -" setfont\n" -"} bind def\n" -"\n" -"%% Dilemma: If we don't undef NextStepEncoding then NeXT generated EPS\n" -"%% files will not have the correct encoding vector when printed\n" -"%% under Executor. BUT if we undef NextStepEncoding then we\n" -"%% can't use their implementation of findfont. Foo.\n" -"%% /languagelevel where\n" -"%% {\n" -"%% pop\n" -"%% languagelevel 2 ge\n" -"%% {\n" -"%% currentdict /NextStepEncoding undef\n" -"%% } if\n" -"%% } if\n"); - return [super endPrologue]; -} - -/* Beginning of stuff that should probably be in its own file */ - -#include - -typedef struct { - const char *name; - int subtype; -} subtype_entry_t; - -static subtype_entry_t vax_cpu[] = { - "VAX780", 1, - "VAX785", 2, - "VAX750", 3, - "VAX730", 4, - "UVAXI", 5, - "UVAXII", 6, - "VAX8200", 7, - "VAX8500", 8, - "VAX8600", 9, - "VAX8650", 10, - "VAX8800", 11, - "UVAXIII", 12, - (const char *) 0, 0, -}; - - -static subtype_entry_t romp_cpu[] = { - "RT_PC", 1, - "RT_APC", 2, - "RT_135", 3, - (const char *) 0, 0, -}; - -static subtype_entry_t ns32032_cpu[] = { - "MMAX_DPC", 1, - "SQT ", 2, - "MMAX_APC_FPU", 3, - "MMAX_APC_FPA", 4, - "MMAX_XPC", 5, - (const char *) 0, 0, -}; - -static subtype_entry_t i386_cpu[] = { - "386", 3, - "486", 4, - "486SX", 4 + 128, - "586", 5, - "586SX", 5 + 128, - (const char *) 0, 0, -}; - -static subtype_entry_t mips_cpu[] = { - "MIPS_R2300", 1, - "MIPS_R2600", 2, - "MIPS_R2800", 3, - "MIPS_R2000a", 4, - (const char *) 0, 0, -}; - -static subtype_entry_t mc680x0_cpu[] = { - "MC68030", 1, - "MC68040", 2, - "MC68030_ONLY", 3, - (const char *) 0, 0, -}; - -static subtype_entry_t hppa_cpu[] = { - "HPPA_825", 1, - "HPPA_835", 2, - "HPPA_840", 3, - "HPPA_850", 4, - "HPPA_855", 5, - (const char *) 0, 0, -}; - -static subtype_entry_t arm_cpu[] = { - "ARM_A500_ARCH", 1, - "ARM_A500", 2, - "ARM_A440", 3, - "ARM_M4", 4, - "ARM_A680", 5, - (const char *) 0, 0, -}; - -static subtype_entry_t mc88000_cpu[] = { - "MMAX_JPC", 1, - "MC88100", 1, - "MC88110", 2, - (const char *) 0, 0, -}; - -static subtype_entry_t mc98000_cpu[] = { - "MC98601", 1, - (const char *) 0, 0, -}; - -static subtype_entry_t i860_cpu[] = { - "I860_860", 1, - (const char *) 0, 0, -}; - -static subtype_entry_t i860_little_cpu[] = { - "I860_LITTLE", 1, - (const char *) 0, 0, -}; - - -static subtype_entry_t rs6000_cpu[] = { - "RS6000", 1, - (const char *) 0, 0, -}; - -static subtype_entry_t sparc_cpu[] = { - "SUN4_260", 1, - "SUN4_110", 2, - (const char *) 0, 0, -}; - -static subtype_entry_t unknown_cpu[] = { - (const char *) 0, 0, -}; - -#define SUBTABLE(name, table) \ - #name, table ## _cpu - -typedef struct { - const char *name; - const subtype_entry_t *subtable; -} cpu_entry_t; - -static cpu_entry_t cpu_info[] = { - SUBTABLE(unknown, unknown), /* ((cpu_type_t) 0) */ - SUBTABLE(VAX, vax), /* ((cpu_type_t) 1) */ - SUBTABLE(RT, romp), /* ((cpu_type_t) 2) */ - SUBTABLE(unknown, unknown), /* ((cpu_type_t) 3) */ - SUBTABLE(NS32032, ns32032), /* ((cpu_type_t) 4) */ - SUBTABLE(NS32332, ns32032), /* ((cpu_type_t) 5) */ - SUBTABLE(M68K, mc680x0), /* ((cpu_type_t) 6) */ - SUBTABLE(PC, i386), /* ((cpu_type_t) 7) */ - SUBTABLE(MIPS, mips), /* ((cpu_type_t) 8) */ - SUBTABLE(NS32532, ns32032), /* ((cpu_type_t) 9) */ - SUBTABLE(unknown, unknown), /* ((cpu_type_t) 10) */ - SUBTABLE(SNAKE, hppa), /* ((cpu_type_t) 11) */ - SUBTABLE(ARM, arm), /* ((cpu_type_t) 12) */ - SUBTABLE(M88K, mc88000), /* ((cpu_type_t) 13) */ - SUBTABLE(SPARC, sparc), /* ((cpu_type_t) 14) */ - SUBTABLE(I860, i860), /* ((cpu_type_t) 15) big-endian */ - SUBTABLE(I860_LITTLE, i860_little), /* ((cpu_type_t) 16) little-endian */ - SUBTABLE(RS6000, rs6000), /* ((cpu_type_t) 17) */ - SUBTABLE(POWERPC, mc98000), /* ((cpu_type_t) 18) */ -}; - -#if !defined(NELEM) -#define NELEM(x) (sizeof((x)) / sizeof((x)[0])) -#endif /* !defined(NELEM) */ - -void getinfo(char const **cpupp, char const **subpp, char const **ospp) -{ - struct host_basic_info basic_info; - unsigned int count; - const subtype_entry_t *subp; - static kernel_version_t kvers; - - count = HOST_BASIC_INFO_COUNT; - if (host_info(host_self(), HOST_BASIC_INFO, (host_info_t) &basic_info, - &count) == KERN_SUCCESS && - basic_info.cpu_type < NELEM(cpu_info)) { - *cpupp = cpu_info[basic_info.cpu_type].name; - for (subp = cpu_info[basic_info.cpu_type].subtable; subp->name && - subp->subtype != basic_info.cpu_subtype; ++subp) - ; - if (subp->name) - *subpp = subp->name; - else - *subpp = "unknown"; - } else { - *cpupp = "unknown"; - *subpp = "unknown"; - } - if (host_kernel_version(host_self(), kvers) == KERN_SUCCESS) - *ospp = kvers; - else - *ospp = "unknown"; -} - -/* End of stuff that should probably be in its own file */ - -#define T(a, b, c, d) ((a << 24) | \ - (b << 16) | \ - (c << 8) | \ - (d << 0)) - -const char *getcategory(const char *severity, const char *class, - const char *synopsis) -{ - const char *retval; - - switch (ROMlib_creator) { - case T('A', 'T', 'r', 'n'): - retval = "atrain"; - break; - case T('C', 'T', 'I', 'M'): - retval = "carmen"; - break; - case T('C', 'Y', 'Q', 'S'): - retval = "crystal-quest"; - break; - case T('X', 'C', 'E', 'L'): - retval = "excel"; - break; - case T('P', 's', 'y', 'g'): - retval = "lemmings"; - break; - case T('M', 'I', 'T', '1'): - retval = "macintax"; - break; - case T('S', 'S', 'L', 'A'): - retval = "macmoney"; - break; - case T('M', 'Y', 'M', 'C'): - retval = "mym"; - break; - case T('P', 'O', '\xC4', 'P'): - retval = "pop"; - break; - case T('I', 'N', 'T', 'U'): - retval = "quicken"; - break; - case T('R', 'I', 'S', 'K'): - retval = "risk"; - break; - case T('S', 'A', 'N', 'T'): - retval = "simant"; - break; - case T('S', 'I', 'T', '!'): - retval = "stuffit-lite"; - break; - case T('M', 'S', 'W', 'D'): - retval = "word"; - break; - } - if (!retval) { - if (strcmp(severity, "System Crash/Hang") == 0) - return "yipes"; - else if (debugnumber < 10000) - return "red"; - else if (strcmp(class, "Documentation") == 0) - return "docs"; - else if (recmp(".*[Pp][Rr][Ii][Nn][Tt].*", (char *) synopsis) == 0) - return "printing"; - else if (recmp(".*[Xx][Ff][Ee][Rr].*", (char *) synopsis) == 0) - return "hfs_xfer"; - else - retval = "executor"; - } - return retval; -} - -#define OPENCMD "/usr/ucb/Mail -s BugReport %s" -#define FIELDCHARS "**********" - /* 0x12345678 */ - -- mailARDI: sender -{ - FILE *mailfp; - char *opencmd, *notetext; - const char *cputype, *cpusubtype, *osversion; - char starspchars[sizeof(FIELDCHARS)], starpcchars[sizeof(FIELDCHARS)]; - extern long debugtable[1L << 12]; - int i; - id textid; - const char *severity, *class, *synopsis, *category; - int closeretval; - - opencmd = alloca(strlen(OPENCMD) + - strlen([addressForm stringValueAt:0])); - sprintf(opencmd, OPENCMD, [addressForm stringValueAt:0]); - mailfp = popen(opencmd, "w"); - if (!mailfp) - NXRunAlertPanel("No Mail?", "Could not open mail connection.", - (const char *) 0, (const char *) 0, (const char *) 0); - else { - textid = [noteBox docView]; - notetext = alloca([textid textLength]); - [textid getSubstring:notetext start:0 length:[textid textLength]+1]; - getinfo(&cputype, &cpusubtype, &osversion); - severity = [[[severityPopUp itemList] selectedCell] title]; - if (!severity) - severity = [[[severityPopUp itemList] cellAt:0 :0] title]; - class = [[[classPopUp itemList] selectedCell] title]; - if (!class) - class = [[[classPopUp itemList] cellAt:0 :0] title]; - synopsis = [synopsisForm stringValueAt:0]; - category = getcategory(severity, class, synopsis); - fprintf(mailfp, - ">Release: Executor %s %s\n" - ">Software: %s\n" - ">Version: %s\n" - ">Synopsis: %s\n" - ">Severity: %s\n" - ">Class: %s\n" - ">Category: %s\n" - ">Environment:\n" - " CPU_TYPE: %s\n" - " CPU_SUB_TYPE: %s\n" - " OS: %s\n" - ">Description:\n" - " %s\n", - ROMlib_executor_version, - ROMlib_executor_build_time, - [softwareForm stringValueAt:0], - [softwareForm stringValueAt:1], - synopsis, - severity, - class, - category, - cputype, - cpusubtype, - osversion, - notetext); - - if (appstate == appdied) { - if (starpcfield == hexfield) - sprintf(starpcchars, "0x%08lx", starpc); - else - sprintf(starpcchars, FIELDCHARS); - if (starspfield == hexfield) - sprintf(starspchars, "0x%08lx", starsp); - else - sprintf(starspchars, FIELDCHARS); - fprintf(mailfp, ">Death Certificate:\n" - " SP 0x%08lx\n" - " *SP %s\n" - " PC 0x%08lx\n" - " *PC %s\n" - " D0 0x%08lx\n" - " PSL 0x%08lx\n" - " SIG %d\n" - " DEB %d\n", - sp, - starspchars, - pc, - starpcchars, - d0, - psl, - sig, - debugnumber); - for (i = 0; i < NELEM(debugtable); i++) - if (debugtable[i]) - fprintf(mailfp, " 0xA%03X: %d\n", i, debugtable[i]); - } - if ((closeretval = pclose(mailfp)) != 0) { - NXRunAlertPanel("Problem Report NOT Sent", - "%s exited with an error return of %d.", - (const char *) 0, (const char *) 0, (const char *) 0, - opencmd, closeretval); - } else - NXRunAlertPanel("Sent", "Your Problem Report has been sent.", - (const char *) 0, (const char *) 0, (const char *) 0); - [textid selectAll:sender]; - [textid replaceSel:""]; - [synopsisForm setStringValue:"" at:0]; - } - [mailPanel orderOut:sender]; - return sender; -} - -- (void) installinfo:(const char *)name :(const char *) version -{ - [softwareForm setStringValue:name at:0]; - [softwareForm setStringValue:version at:1]; -} - -void ROMlib_installinfo(const char *name, const char *version) -{ - [global_game installinfo:name :version]; -} - -@end diff --git a/src/config/front-ends/nextstep/nextstep.h b/src/config/front-ends/nextstep/nextstep.h deleted file mode 100644 index 0cb3850e..00000000 --- a/src/config/front-ends/nextstep/nextstep.h +++ /dev/null @@ -1,3 +0,0 @@ -#if !defined (NEXTSTEP) -# define NEXTSTEP -#endif diff --git a/src/config/front-ends/nextstep/nextstep.make.nextstep b/src/config/front-ends/nextstep/nextstep.make.nextstep deleted file mode 100644 index 77d405a6..00000000 --- a/src/config/front-ends/nextstep/nextstep.make.nextstep +++ /dev/null @@ -1,42 +0,0 @@ - -FRONT_END_DEFINES = - -HFS_XFer = $(FRONT_END_DIR)/HFS_XFer - -FRONT_END_LIBS = \ - -sectcreate __ICON __header $(FRONT_END_DIR)/Executor.iconheader \ - -segprot __ICON r r \ - -sectcreate __ICON app $(FRONT_END_DIR)/Executor.tiff \ - -sectcreate __ICON appl $(FRONT_END_DIR)/docAppl.tiff \ - -sectcreate __ICON msw $(FRONT_END_DIR)/docMSW.tiff \ - -sectcreate __ICON xl $(FRONT_END_DIR)/docXL.tiff \ - -sectcreate hfs_xfer hfs_xfersect $(HFS_XFer)/HFS_XFer.util.stripped \ - -sectcreate lowseg lowsect $(FRONT_END_DIR)/1kfile \ - -segaddr __TEXT 200000 \ - -segaddr __DATA 1000000 \ - -segaddr hfs_xfer 1700000 \ - -segaddr __LINKEDIT 1800000 \ - -lNeXT_s -lsys_s - -psfns.c psfns.h: psfns.psw - rm -f $*.h $*.c - pswrap -a -h $*.h -o $*.c $< - chmod -w $*.h $*.c - -# add the Executor.app directory to the VPATH so Executor_main.m -# will be found -NS_EXECUTOR_DIR = $(FRONT_END_DIR)/Executor - -VPATH += :$(NS_EXECUTOR_DIR) - -NEXT_SRC = MacWinClass.m NEXTkeyboard.m NEXTprint.m \ - MacAppClass.m MacViewClass.m NEXT.c NEXTmain.m NEXTsound.m \ - Executor_main.m - -FRONT_END_SRC = $(NEXT_SRC) -FRONT_END_OBJ = $(strip $(addsuffix .o,$(basename $(FRONT_END_SRC)))) - -MacAppClass.o: - -clean:: - rm -f $(FRONT_END_OBJ) diff --git a/src/config/front-ends/nextstep/nextstep.make.openstep b/src/config/front-ends/nextstep/nextstep.make.openstep deleted file mode 100644 index a9e73416..00000000 --- a/src/config/front-ends/nextstep/nextstep.make.openstep +++ /dev/null @@ -1,44 +0,0 @@ - -FRONT_END_DEFINES = - -HFS_XFer = $(FRONT_END_DIR)/HFS_XFer - -FRONT_END_LIBS = \ - -sectcreate __ICON __header $(FRONT_END_DIR)/Executor.iconheader \ - -segprot __ICON r r \ - -sectcreate __ICON app $(FRONT_END_DIR)/Executor.tiff \ - -sectcreate __ICON appl $(FRONT_END_DIR)/docAppl.tiff \ - -sectcreate __ICON msw $(FRONT_END_DIR)/docMSW.tiff \ - -sectcreate __ICON xl $(FRONT_END_DIR)/docXL.tiff \ - -sectcreate hfs_xfer hfs_xfersect $(HFS_XFer)/HFS_XFer.util.stripped \ - -sectcreate lowseg lowsect $(FRONT_END_DIR)/1kfile \ - -segaddr __TEXT 200000 \ - -segaddr __DATA 1000000 \ - -segaddr hfs_xfer 1700000 \ - -segaddr __LINKEDIT 1800000 - -# these go away -# -lNeXT_s -lsys_s - -psfns.c psfns.h: psfns.psw - rm -f $*.h $*.c - pswrap -a -h $*.h -o $*.c $< - chmod -w $*.h $*.c - -# add the Executor.app directory to the VPATH so Executor_main.m -# will be found -NS_EXECUTOR_DIR = $(FRONT_END_DIR)/Executor - -VPATH += :$(NS_EXECUTOR_DIR) - -NEXT_SRC = MacWinClass.m NEXTkeyboard.m NEXTprint.m \ - MacAppClass.m MacViewClass.m NEXT.c NEXTmain.m NEXTsound.m \ - Executor_main.m - -FRONT_END_SRC = $(NEXT_SRC) -FRONT_END_OBJ = $(strip $(addsuffix .o,$(basename $(FRONT_END_SRC)))) - -MacAppClass.o: - -clean:: - rm -f $(FRONT_END_OBJ) diff --git a/src/config/front-ends/nextstep/ourstuff.h b/src/config/front-ends/nextstep/ourstuff.h deleted file mode 100644 index ae88cee5..00000000 --- a/src/config/front-ends/nextstep/ourstuff.h +++ /dev/null @@ -1,41 +0,0 @@ -#if !defined (_OURSTUFF_H_) - -#ifndef OPENSTEP -#include -#endif /* not OPENSTEP */ - -extern void sendresumeevent(LONGINT cvtclip); -extern void sendsuspendevent(void); -extern void ROMlib_writenameorgkey(char *name, char *org, char *key); -extern void contextswitch(char **from_spp, char **to_spp); -extern LONGINT insertfonttbl(char **op, char doit); - -#ifndef OPENSTEP - -extern INTEGER ROMlib_next_butmods_to_mac_butmods (LONGINT nextflags); -extern void postnextevent(NXEvent * neventp); -extern void ROMlib_updatemouselocation(NXEvent * neventp); - -#else /* OPENSTEP */ - -extern INTEGER ROMlib_next_butmods_to_mac_butmods (unsigned int nextflags); -extern void postnextevent(NSEvent * neventp); -extern void ROMlib_updatemouselocation(NSEvent * neventp); - -#endif /* OPENSTEP */ - -extern void sendpaste(void); -extern void sendcopy(void); -extern void oldmain(long argc, char **argv); -extern void convertchars(char *data, long length, unsigned char *table); -extern void nextmain(void); - -#if defined (__OBJC__) -extern id global_menu; -extern id realcursor, blankcursor; -extern id ROMlib_pasteboard; -#endif - -extern int ROMlib_ourchangecount; - -#endif /* _OURSTUFF_H_ */ diff --git a/src/crc.c b/src/crc.cpp similarity index 90% rename from src/crc.c rename to src/crc.cpp index 1ffdcedd..298b31a7 100644 --- a/src/crc.c +++ b/src/crc.cpp @@ -26,6 +26,7 @@ char ROMlib_rcsid_crc[] = #define GEN6 (GEN >> 6) #define GEN7 (GEN >> 7) +using namespace Executor; long polydivide(long l) { @@ -48,7 +49,7 @@ long polydivide(long l) return l; } -PUBLIC unsigned short ROMlib_crcccitt(unsigned char *data, long length) +PUBLIC unsigned short Executor::ROMlib_crcccitt(unsigned char *data, long length) { unsigned long l; @@ -76,7 +77,7 @@ PUBLIC unsigned short ROMlib_crcccitt(unsigned char *data, long length) return l >> 8; } -short getthecrc(ResType typ, long id) +short Executor::getthecrc(ResType typ, long id) { Handle h; diff --git a/src/ctlArrows.c b/src/ctlArrows.cpp similarity index 98% rename from src/ctlArrows.c rename to src/ctlArrows.cpp index c17fbe69..ece79c1c 100644 --- a/src/ctlArrows.c +++ b/src/ctlArrows.cpp @@ -22,20 +22,24 @@ char ROMlib_rcsid_ctlArrows[] = #include "rsys/host.h" #include "rsys/wind.h" -#include "arrow_up_active.c" -#include "arrow_up_inactive.c" -#include "arrow_down_active.c" -#include "arrow_down_inactive.c" -#include "arrow_right_active.c" -#include "arrow_right_inactive.c" -#include "arrow_left_active.c" -#include "arrow_left_inactive.c" - -#include "thumb_horiz.c" -#include "thumb_vert.c" - +using namespace Executor; + +namespace Executor { +#include "arrow_up_active.cmap" +#include "arrow_up_inactive.cmap" +#include "arrow_down_active.cmap" +#include "arrow_down_inactive.cmap" +#include "arrow_right_active.cmap" +#include "arrow_right_inactive.cmap" +#include "arrow_left_active.cmap" +#include "arrow_left_inactive.cmap" + +#include "thumb_horiz.cmap" +#include "thumb_vert.cmap" +} #define SB_VERT_P(h, w) ((h) > (w)) + /* one if the control (scrollbar) currently being drawn is color. this is set by `validate_colors_for_ctl ()' called from `cdef16 ()', the single entry point to this function if drawing may ensue */ @@ -84,7 +88,7 @@ pixel_image_t *sb_thumb_images[2]; : sb_thumb_images[vert_p] /* active_p unused */) void -sb_ctl_init () +Executor::sb_ctl_init () { #define VERT 1 #define HORIZ 0 diff --git a/src/ctlDisplay.c b/src/ctlDisplay.cpp similarity index 99% rename from src/ctlDisplay.c rename to src/ctlDisplay.cpp index 56d9fe5e..64e74294 100644 --- a/src/ctlDisplay.c +++ b/src/ctlDisplay.cpp @@ -16,6 +16,8 @@ char ROMlib_rcsid_ctlDisplay[] = #include "rsys/ctl.h" #include "rsys/wind.h" +using namespace Executor; + P2(PUBLIC pascal trap, void, SetCTitle, ControlHandle, c, /* IMI-321 */ StringPtr, t) { diff --git a/src/ctlIMIV.c b/src/ctlIMIV.cpp similarity index 96% rename from src/ctlIMIV.c rename to src/ctlIMIV.cpp index 7fe5ab1f..abe65c36 100644 --- a/src/ctlIMIV.c +++ b/src/ctlIMIV.cpp @@ -16,6 +16,8 @@ char ROMlib_rcsid_ctlIMIV[] = #include "rsys/ctl.h" #include "rsys/wind.h" +using namespace Executor; + P1(PUBLIC pascal trap, void, Draw1Control, ControlHandle, c) /* IMIV-53 */ { if (CTL_VIS_X (c)) diff --git a/src/ctlInit.c b/src/ctlInit.cpp similarity index 98% rename from src/ctlInit.c rename to src/ctlInit.cpp index 13a49d59..82a3af84 100644 --- a/src/ctlInit.c +++ b/src/ctlInit.cpp @@ -23,7 +23,9 @@ char ROMlib_rcsid_ctlInit[] = #include "rsys/cquick.h" #include "rsys/resource.h" -PUBLIC BOOLEAN ROMlib_cdef0_is_rectangular = FALSE; +using namespace Executor; + +PUBLIC BOOLEAN Executor::ROMlib_cdef0_is_rectangular = FALSE; P9(PUBLIC pascal trap, ControlHandle, NewControl, WindowPtr, wst, Rect *, r, StringPtr, title, BOOLEAN, vis, INTEGER, value, INTEGER, min, diff --git a/src/ctlMisc.c b/src/ctlMisc.cpp similarity index 87% rename from src/ctlMisc.c rename to src/ctlMisc.cpp index dbbd4645..fce0427a 100644 --- a/src/ctlMisc.c +++ b/src/ctlMisc.cpp @@ -22,17 +22,20 @@ char ROMlib_rcsid_ctlMisc[] = /* cheat, and make this a plain ctab, so we can use our old accessor macros */ -AuxCtlHandle default_aux_ctl; + +using namespace Executor; + +AuxCtlHandle Executor::default_aux_ctl; #define BLACK_RGB { CWC (0), CWC (0), CWC (0), } -#define WHITE_RGB { CWC (0xFFFF), CWC (0xFFFF), CWC (0xFFFF), } +#define WHITE_RGB { CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF), } -#define LT_BLUISH_RGB { CWC (0xCCCC), CWC (0xCCCC), CWC (0xFFFF) } +#define LT_BLUISH_RGB { CWC ((unsigned short)0xCCCC), CWC ((unsigned short)0xCCCC), CWC ((unsigned short)0xFFFF) } #define DK_BLUISH_RGB { CWC (0x3333), CWC (0x3333), CWC (0x6666) } -#define DK_GRAY { CWC (0x5555), CWC (0x5555), CWC (0x5555) } +#define DK_GRAY { CWC ((unsigned short)0x5555), CWC ((unsigned short)0x5555), CWC ((unsigned short)0x5555) } -const ColorSpec default_ctl_colors[] = +const ColorSpec Executor::default_ctl_colors[] = { { CWC (cFrameColor), BLACK_RGB }, { CWC (cBodyColor), WHITE_RGB }, @@ -55,11 +58,11 @@ const ColorSpec default_ctl_colors[] = #define KEEP_DEFAULT_CTL_CTAB_AROUND_FOR_OLD_SYSTEM_FILE_USERS #if defined (KEEP_DEFAULT_CTL_CTAB_AROUND_FOR_OLD_SYSTEM_FILE_USERS) -PUBLIC CTabHandle default_ctl_ctab; +PUBLIC CTabHandle Executor::default_ctl_ctab; #endif void -ctl_color_init (void) +Executor::ctl_color_init (void) { default_aux_ctl = (AuxCtlHandle) NewHandle (sizeof (AuxCtlRec)); @@ -88,7 +91,7 @@ ctl_color_init (void) } AuxCtlHandle * -lookup_aux_ctl (ControlHandle ctl) +Executor::lookup_aux_ctl (ControlHandle ctl) { AuxCtlHandle *t; @@ -169,7 +172,7 @@ P2 (PUBLIC pascal trap, BOOLEAN, GetAuxCtl, ControlHandle, ctl, /* IMV-222 */ } int32 -ROMlib_ctlcall (ControlHandle c, int16 i, int32 l) +Executor::ROMlib_ctlcall (ControlHandle c, int16 i, int32 l) { Handle defproc; int32 retval; @@ -206,7 +209,7 @@ ROMlib_ctlcall (ControlHandle c, int16 i, int32 l) LOCK_HANDLE_EXCURSION_1 (defproc, { - retval = CToPascalCall ((ctlfuncp) STARH (defproc), + retval = CToPascalCall ((void*)(ctlfuncp) STARH (defproc), CTOP_cdef0, VAR (c), c, i, l); }); } diff --git a/src/ctlMouse.c b/src/ctlMouse.cpp similarity index 97% rename from src/ctlMouse.c rename to src/ctlMouse.cpp index 6bd6cd17..ca26b1ca 100644 --- a/src/ctlMouse.c +++ b/src/ctlMouse.cpp @@ -33,6 +33,8 @@ char ROMlib_rcsid_ctlMouse[] = * return. Recursion is you friend. */ +using namespace Executor; + INTEGER find_control_helper (Point p, ControlHandle c, HIDDEN_ControlHandle *cp) @@ -71,6 +73,11 @@ P3(PUBLIC pascal trap, INTEGER, FindControl, Point, p, /* IMI-323 */ typedef pascal void (*actionp)(ControlHandle c, INTEGER part); +namespace Executor { + PRIVATE inline void CALLACTION(ControlHandle, INTEGER, + ProcPtr); +} + A3(PRIVATE inline, void, CALLACTION, ControlHandle, ch, INTEGER, inpart, ProcPtr, a) { @@ -81,7 +88,7 @@ A3(PRIVATE inline, void, CALLACTION, ControlHandle, ch, INTEGER, inpart, else if (a == (ProcPtr) P_ROMlib_stdftrack) C_ROMlib_stdftrack(ch, inpart); else - CToPascalCall(a, CTOP_ROMlib_mytrack, ch, inpart); + CToPascalCall(&a, CTOP_ROMlib_mytrack, ch, inpart); HOOKRESTOREREGS(); } diff --git a/src/ctlPopup.c b/src/ctlPopup.cpp similarity index 99% rename from src/ctlPopup.c rename to src/ctlPopup.cpp index 26b9beed..c7540210 100644 --- a/src/ctlPopup.c +++ b/src/ctlPopup.cpp @@ -22,6 +22,8 @@ char ROMlib_rcsid_ctlPopup[] = #include "rsys/ctl.h" #include "rsys/menu.h" +using namespace Executor; + #if 0 /* It's not clear why Cotton had all these global variables, but it is clear that in at least one case he was using one before setting it. Use RCS to see what used to be done. */ @@ -162,7 +164,7 @@ draw (ControlHandle ctl, draw_state_t draw_state, { item_title = (StringPtr) ""; - item_info = alloca (sizeof *item_info); + item_info = (mextp)alloca (sizeof *item_info); memset (item_info, '\000', sizeof *item_info); draw_pulldown_arrow_p = FALSE; @@ -392,8 +394,7 @@ draw (ControlHandle ctl, draw_state_t draw_state, { BitMap arrow_bitmap; Rect dst_rect; - char down_arrow_bits[] = - { + const unsigned char down_arrow_bits[] = { image_bits (11111111), image_bits (11100000), image_bits (01111111), image_bits (11000000), image_bits (00111111), image_bits (10000000), diff --git a/src/ctlSet.c b/src/ctlSet.cpp similarity index 98% rename from src/ctlSet.c rename to src/ctlSet.cpp index 8d5151b4..da40b8d8 100644 --- a/src/ctlSet.c +++ b/src/ctlSet.cpp @@ -16,6 +16,8 @@ char ROMlib_rcsid_ctlSet[] = #include "rsys/ctl.h" +using namespace Executor; + P2(PUBLIC pascal trap, void, SetCtlValue, ControlHandle, c, /* IMI-326 */ INTEGER, v) { diff --git a/src/ctlSize.c b/src/ctlSize.cpp similarity index 98% rename from src/ctlSize.c rename to src/ctlSize.cpp index 5f132207..89507e04 100644 --- a/src/ctlSize.c +++ b/src/ctlSize.cpp @@ -18,6 +18,8 @@ char ROMlib_rcsid_ctlSize[] = #include "rsys/ctl.h" +using namespace Executor; + P3(PUBLIC pascal trap, void, MoveControl, ControlHandle, c, /* IMI-325 */ INTEGER, h, INTEGER, v) { diff --git a/src/ctlStddef.c b/src/ctlStddef.cpp similarity index 99% rename from src/ctlStddef.c rename to src/ctlStddef.cpp index b5c29a31..3125775b 100644 --- a/src/ctlStddef.c +++ b/src/ctlStddef.cpp @@ -20,6 +20,7 @@ char ROMlib_rcsid_ctlStddef[] = #include "rsys/ctl.h" #include "rsys/cquick.h" +using namespace Executor; enum { diff --git a/src/custom.c b/src/custom.cpp similarity index 62% rename from src/custom.c rename to src/custom.cpp index 7f9e2743..d93534e5 100644 --- a/src/custom.c +++ b/src/custom.cpp @@ -12,6 +12,8 @@ char ROMlib_rcsid_custom[] = #include "rsys/version.h" #include "rsys/aboutbox.h" +using namespace Executor; + PRIVATE custom_block_t custom = { CUSTOM_MAGIC, @@ -88,7 +90,7 @@ executor_full_name_from_prefix (const char *str) int len; len = strlen (str) + 1 + strlen (EXECUTOR_VERSION) + 1; - retval = malloc (len); + retval = (char*)malloc (len); if (retval) sprintf (retval, "%s %s", str, EXECUTOR_VERSION); @@ -98,36 +100,35 @@ executor_full_name_from_prefix (const char *str) PUBLIC void ROMlib_do_custom (void) { - ROMlib_checksump = find_custom_string (CUSTOM_CHECKSUM); - ROMlib_creatorsp = find_custom_string (CUSTOM_CREATORS); - ROMlib_licensep = find_custom_string (CUSTOM_LICENSE); - ROMlib_first_snp = find_custom_string (CUSTOM_FIRST_SN); - ROMlib_last_snp = find_custom_string (CUSTOM_LAST_SN); - ROMlib_splashp = find_custom_string (CUSTOM_SPLASH); - ROMlib_about_boxp = find_custom_string (CUSTOM_ABOUT_BOX); - ROMlib_copyright_infop = find_custom_string (CUSTOM_COPYRIGHT_INFO); - ROMlib_thank_you_infop = find_custom_string (CUSTOM_THANK_YOU_INFO); + ROMlib_checksump = (custom_val_t*)find_custom_string (CUSTOM_CHECKSUM); + ROMlib_creatorsp = (custom_vals_t*)find_custom_string (CUSTOM_CREATORS); + ROMlib_licensep = (custom_chars_t*)find_custom_string (CUSTOM_LICENSE); + ROMlib_first_snp = (custom_val_t*)find_custom_string (CUSTOM_FIRST_SN); + ROMlib_last_snp = (custom_val_t*)find_custom_string (CUSTOM_LAST_SN); + ROMlib_splashp = (custom_chars_t*)find_custom_string (CUSTOM_SPLASH); + ROMlib_about_boxp = (custom_val_t*)find_custom_string (CUSTOM_ABOUT_BOX); + ROMlib_copyright_infop = (custom_chars_t*)find_custom_string (CUSTOM_COPYRIGHT_INFO); + ROMlib_thank_you_infop = (custom_chars_t*)find_custom_string (CUSTOM_THANK_YOU_INFO); ROMlib_registration_instructionsp = - find_custom_string (CUSTOM_REGISTRATION_INSTRUCTIONS); - ROMlib_magic_volumesp = find_custom_string (CUSTOM_MAGIC_VOLUMES); - ROMlib_suffix_mapsp = find_custom_string (CUSTOM_SUFFIX_MAPS); - ROMlib_default_appp = find_custom_string (CUSTOM_DEFAULT_APP); - ROMlib_must_registerp = find_custom_string (CUSTOM_MUST_REGISTER); - ROMlib_mac_cdromp = find_custom_string (CUSTOM_MAC_CDROM); - ROMlib_mac_demo_idp = find_custom_string (CUSTOM_DEMO_IDENTIFIER); + (custom_chars_t*)find_custom_string (CUSTOM_REGISTRATION_INSTRUCTIONS); + ROMlib_magic_volumesp = (custom_chars_t*)find_custom_string (CUSTOM_MAGIC_VOLUMES); + ROMlib_suffix_mapsp = (custom_chars_t*)find_custom_string (CUSTOM_SUFFIX_MAPS); + ROMlib_default_appp = (custom_chars_t*)find_custom_string (CUSTOM_DEFAULT_APP); + ROMlib_must_registerp = (custom_val_t*)find_custom_string (CUSTOM_MUST_REGISTER); + ROMlib_mac_cdromp = (custom_chars_t*)find_custom_string (CUSTOM_MAC_CDROM); + ROMlib_mac_demo_idp = (custom_chars_t*)find_custom_string (CUSTOM_DEMO_IDENTIFIER); ROMlib_disable_command_key_equivsp - = find_custom_string (CUSTOM_DISABLE_COMMAND_KEYS); - ROMlib_restart_stringp = find_custom_string (CUSTOM_RESTART_STRING); + = (custom_val_t*)find_custom_string (CUSTOM_DISABLE_COMMAND_KEYS); + ROMlib_restart_stringp = (custom_chars_t*)find_custom_string (CUSTOM_RESTART_STRING); - ROMlib_menu_about_stringp = find_custom_string (CUSTOM_MENU_ABOUT_STRING); + ROMlib_menu_about_stringp = (custom_chars_t*)find_custom_string (CUSTOM_MENU_ABOUT_STRING); if (ROMlib_menu_about_stringp) about_box_menu_name_pstr = about_box_string_from_c_string ((char *) ROMlib_menu_about_stringp->chars); - version_stringp = find_custom_string (CUSTOM_VERSION_STRING); + version_stringp = (custom_chars_t*)find_custom_string (CUSTOM_VERSION_STRING); if (version_stringp) ROMlib_executor_full_name = executor_full_name_from_prefix ((char *) version_stringp->chars); - ROMlib_days_of_demop = find_custom_string (CUSTOM_DEMO_DAYS); } diff --git a/src/dcache.c b/src/dcache.cpp similarity index 96% rename from src/dcache.c rename to src/dcache.cpp index a654a081..a6dec353 100644 --- a/src/dcache.c +++ b/src/dcache.cpp @@ -11,6 +11,7 @@ char ROMlib_rcsid_dcache[] = #include "rsys/common.h" #include "rsys/dcache.h" +using namespace Executor; #define DCACHE_BLOCK_SIZE 512 @@ -66,7 +67,7 @@ dcache_entry_lookup (uint32 fd, uint32 offset) /* Sets whether or not the dcache is enabled and returns the old state. */ boolean_t -dcache_set_enabled (boolean_t enabled_p) +Executor::dcache_set_enabled (boolean_t enabled_p) { boolean_t old_enabled_p; old_enabled_p = dcache_enabled_p; @@ -160,7 +161,7 @@ coalesce_writes (uint32 fd, uint8 **bufpp, uint32 *lengthp, uint32 *offsetp) /* allocate space for run */ length = n_bufs * DCACHE_BLOCK_SIZE; - bufp = malloc (length); + bufp = (uint8 *)malloc (length); outbufp = bufp; for (i = backwards_index - 1; i >= 0; --i) @@ -309,7 +310,7 @@ read_cylinder (uint32 fd, uint32 offset, read_callback_funcp_t read_callback) * were read. */ uint32 -dcache_read (uint32 fd, void *buf, uint32 offset, uint32 count, +Executor::dcache_read (uint32 fd, void *buf, uint32 offset, uint32 count, read_callback_funcp_t read_callback) { uint32 n; @@ -373,7 +374,7 @@ dcache_read (uint32 fd, void *buf, uint32 offset, uint32 count, /* Caches the specified bytes for possible later use. */ uint32 -dcache_write (uint32 fd, const void *buf, uint32 offset, uint32 count, +Executor::dcache_write (uint32 fd, const void *buf, uint32 offset, uint32 count, write_callback_funcp_t dirty_callback) { uint32 retval; @@ -413,7 +414,7 @@ dcache_write (uint32 fd, const void *buf, uint32 offset, uint32 count, /* Throws away all cached information associated with FD. */ boolean_t -dcache_invalidate (uint32 fd, boolean_t flush_p) +Executor::dcache_invalidate (uint32 fd, boolean_t flush_p) { boolean_t retval; @@ -431,7 +432,7 @@ dcache_invalidate (uint32 fd, boolean_t flush_p) } boolean_t -dcache_flush (uint32 fd) +Executor::dcache_flush (uint32 fd) { boolean_t retval; @@ -451,7 +452,7 @@ dcache_flush (uint32 fd) /* Throws away all cached information. */ boolean_t -dcache_invalidate_all (boolean_t flush_p) +Executor::dcache_invalidate_all (boolean_t flush_p) { boolean_t retval; diff --git a/src/dcconvert.c b/src/dcconvert.cpp similarity index 99% rename from src/dcconvert.c rename to src/dcconvert.cpp index d66ae4c3..1d6736da 100644 --- a/src/dcconvert.c +++ b/src/dcconvert.cpp @@ -11,6 +11,7 @@ char ROMlib_rcsid_dcconvert[] = #include "rsys/depthconv.h" #include "rsys/cquick.h" +namespace Executor { /* This file contains all of the low-level depth conversion routines, * and works hand in hand with dcmaketables.c. The routines in this @@ -872,3 +873,5 @@ CONVERT_FUNC (depthconv_32_4, CONVERT_32_4, -3, 3, COMPUTE_ADD_32_4, depthconv_rgb_to_ind_data_t) CONVERT_FUNC (depthconv_32_8, CONVERT_32_8, -2, 2, COMPUTE_ADD_32_8, depthconv_rgb_to_ind_data_t) + +} diff --git a/src/dcmaketables.c b/src/dcmaketables.cpp similarity index 94% rename from src/dcmaketables.c rename to src/dcmaketables.cpp index 2383d55a..399a4646 100644 --- a/src/dcmaketables.c +++ b/src/dcmaketables.cpp @@ -11,6 +11,7 @@ char ROMlib_rcsid_dcmaketables[] = #include "rsys/depthconv.h" #include "rsys/cquick.h" +namespace Executor { /* This file contains routines to construct lookup tables used for * depth conversion, and works hand in hand with dcconvert.c. The @@ -139,24 +140,24 @@ maketable_ ## bpp1 ## _ ## bpp2 (void *d, const uint32 *map) \ \ for (c = 0, dst = (uint16 *) d; c < 256; c++) \ { \ - uint16 new; \ + uint16 new1; \ int r, l; \ \ /* Compute initial left shift count. */ \ l = 16 - bpp2; \ \ /* Loop over all input pixels and create the lookup table entry. */ \ - for (new = 0, r = 8 - bpp1; r >= 0; r -= bpp1) \ + for (new1 = 0, r = 8 - bpp1; r >= 0; r -= bpp1) \ { \ uint32 v = map[(c >> r) & ((1UL << bpp1) - 1)]; \ - new |= (v & ((1UL << bpp2) - 1)) << l; \ + new1 |= (v & ((1UL << bpp2) - 1)) << l; \ if (l == 0) \ { \ - dst[0] = dst[3] = CW (new); \ + dst[0] = dst[3] = CW (new1); \ dst[1] = dst[2] = CWC (0); \ dst += 4; \ l = 16 - bpp2; \ - new = 0; \ + new1 = 0; \ } \ else \ l -= bpp2; \ @@ -181,22 +182,22 @@ maketable_ ## bpp1 ## _ ## bpp2 (void *d, const uint32 *map) \ \ for (c = 0, dst = (new_type *) d; c < 256; c++) \ { \ - new_type new; \ + new_type new1; \ int r, l; \ \ /* Compute initial left shift count. */ \ - l = (8 * sizeof new) - bpp2; \ + l = (8 * sizeof new1) - bpp2; \ \ /* Loop over all input pixels and create the lookup table entry. */ \ - for (new = 0, r = 8 - bpp1; r >= 0; r -= bpp1) \ + for (new1 = 0, r = 8 - bpp1; r >= 0; r -= bpp1) \ { \ uint32 v = map[(c >> r) & ((1UL << bpp1) - 1)]; \ - new |= (v & (0xFFFFFFFFUL >> (32 - bpp2))) << l; \ + new1 |= (v & (0xFFFFFFFFUL >> (32 - bpp2))) << l; \ if (l == 0) \ { \ - *dst++ = Cx (new); \ - l = (8 * sizeof new) - bpp2; \ - new = 0; \ + *dst++ = Cx (new1); \ + l = (8 * sizeof new1) - bpp2; \ + new1 = 0; \ } \ else \ l -= bpp2; \ @@ -240,22 +241,22 @@ maketable_ ## bpp1 ## _ ## bpp2 (void *d, const uint32 *map) \ { \ long offset; \ int r, l; \ - uint8 new; \ + uint8 new1; \ \ /* Loop over all input pixels and create the lookup table entry. */\ - for (r = 8 - bpp1, l = (8 * bpp2 / bpp1) - bpp2, new = 0; \ + for (r = 8 - bpp1, l = (8 * bpp2 / bpp1) - bpp2, new1 = 0; \ r >= 0; \ r -= bpp1, l -= bpp2) \ { \ - new |= ((map[(c >> r) & ((1UL << bpp1) - 1)] \ + new1 |= ((map[(c >> r) & ((1UL << bpp1) - 1)] \ & ((1UL << bpp2) - 1)) \ << l); \ } \ \ for (offset = 256 * (bpp1 / bpp2 - 1); offset >= 0; offset -= 256) \ { \ - dst[offset] = new; \ - new <<= (8 * bpp2 / bpp1); \ + dst[offset] = new1; \ + new1 <<= (8 * bpp2 / bpp1); \ } \ ++dst; \ } \ @@ -557,3 +558,5 @@ depthconv_make_rgb_to_rgb_table (void *table_space, uint32 *table_size, return depthconv_32_32; } } + +} diff --git a/src/default_ctab_values.c b/src/default_ctab_values.c deleted file mode 100644 index c843f38e..00000000 --- a/src/default_ctab_values.c +++ /dev/null @@ -1,305 +0,0 @@ -/* Copyright 1994 by Abacus Research and - * Development, Inc. All rights reserved. - */ - -#if !defined (OMIT_RCSID_STRINGS) -char ROMlib_rcsid_default_ctab_values[] = - "$Id: default_ctab_values.c 63 2004-12-24 18:19:43Z ctm $"; -#endif - -#include "rsys/common.h" -#include "QuickDraw.h" - -ColorSpec ctab_1bpp_values[] = -{ - { CWC (0), { CWC (65535), CWC (65535), CWC (65535) } }, - { CWC (0), { CWC (0), CWC (0), CWC (0) } }, -}; - -ColorSpec ctab_2bpp_values[] = -{ - { CWC (0), { CWC (65535), CWC (65535), CWC (65535) } }, - { CWC (0), { CWC (44204), CWC (44204), CWC (44204) } }, - { CWC (0), { CWC (21845), CWC (21845), CWC (21845) } }, - { CWC (0), { CWC (0), CWC (0), CWC (0) } }, -}; - -ColorSpec ctab_4bpp_values[] = -{ - { CWC (0), { CWC (65535), CWC (65535), CWC (65535) } }, - { CWC (0), { CWC (64512), CWC (62333), CWC (1327) } }, - { CWC (0), { CWC (65535), CWC (25738), CWC (652) } }, - { CWC (0), { CWC (56683), CWC (2242), CWC (1698) } }, - { CWC (0), { CWC (62167), CWC (2134), CWC (34028) } }, - { CWC (0), { CWC (18147), CWC (0), CWC (42302) } }, - { CWC (0), { CWC (0), CWC (0), CWC (54272) } }, - { CWC (0), { CWC (577), CWC (43860), CWC (60159) } }, - { CWC (0), { CWC (7969), CWC (46995), CWC (5169) } }, - { CWC (0), { CWC (0), CWC (25775), CWC (4528) } }, - { CWC (0), { CWC (22016), CWC (11421), CWC (1316) } }, - { CWC (0), { CWC (37079), CWC (29024), CWC (14900) } }, - { CWC (0), { CWC (49152), CWC (49152), CWC (49152) } }, - { CWC (0), { CWC (32768), CWC (32768), CWC (32768) } }, - { CWC (0), { CWC (16384), CWC (16384), CWC (16384) } }, - { CWC (0), { CWC (0), CWC (0), CWC (0) } }, -}; - -ColorSpec ctab_8bpp_values[] = -{ - { CWC (0), { CWC (65535), CWC (65535), CWC (65535) } }, - { CWC (0), { CWC (65535), CWC (65535), CWC (52428) } }, - { CWC (0), { CWC (65535), CWC (65535), CWC (39321) } }, - { CWC (0), { CWC (65535), CWC (65535), CWC (26214) } }, - { CWC (0), { CWC (65535), CWC (65535), CWC (13107) } }, - { CWC (0), { CWC (65535), CWC (65535), CWC (0) } }, - { CWC (0), { CWC (65535), CWC (52428), CWC (65535) } }, - { CWC (0), { CWC (65535), CWC (52428), CWC (52428) } }, - { CWC (0), { CWC (65535), CWC (52428), CWC (39321) } }, - { CWC (0), { CWC (65535), CWC (52428), CWC (26214) } }, - { CWC (0), { CWC (65535), CWC (52428), CWC (13107) } }, - { CWC (0), { CWC (65535), CWC (52428), CWC (0) } }, - { CWC (0), { CWC (65535), CWC (39321), CWC (65535) } }, - { CWC (0), { CWC (65535), CWC (39321), CWC (52428) } }, - { CWC (0), { CWC (65535), CWC (39321), CWC (39321) } }, - { CWC (0), { CWC (65535), CWC (39321), CWC (26214) } }, - { CWC (0), { CWC (65535), CWC (39321), CWC (13107) } }, - { CWC (0), { CWC (65535), CWC (39321), CWC (0) } }, - { CWC (0), { CWC (65535), CWC (26214), CWC (65535) } }, - { CWC (0), { CWC (65535), CWC (26214), CWC (52428) } }, - { CWC (0), { CWC (65535), CWC (26214), CWC (39321) } }, - { CWC (0), { CWC (65535), CWC (26214), CWC (26214) } }, - { CWC (0), { CWC (65535), CWC (26214), CWC (13107) } }, - { CWC (0), { CWC (65535), CWC (26214), CWC (0) } }, - { CWC (0), { CWC (65535), CWC (13107), CWC (65535) } }, - { CWC (0), { CWC (65535), CWC (13107), CWC (52428) } }, - { CWC (0), { CWC (65535), CWC (13107), CWC (39321) } }, - { CWC (0), { CWC (65535), CWC (13107), CWC (26214) } }, - { CWC (0), { CWC (65535), CWC (13107), CWC (13107) } }, - { CWC (0), { CWC (65535), CWC (13107), CWC (0) } }, - { CWC (0), { CWC (65535), CWC (0), CWC (65535) } }, - { CWC (0), { CWC (65535), CWC (0), CWC (52428) } }, - { CWC (0), { CWC (65535), CWC (0), CWC (39321) } }, - { CWC (0), { CWC (65535), CWC (0), CWC (26214) } }, - { CWC (0), { CWC (65535), CWC (0), CWC (13107) } }, - { CWC (0), { CWC (65535), CWC (0), CWC (0) } }, - { CWC (0), { CWC (52428), CWC (65535), CWC (65535) } }, - { CWC (0), { CWC (52428), CWC (65535), CWC (52428) } }, - { CWC (0), { CWC (52428), CWC (65535), CWC (39321) } }, - { CWC (0), { CWC (52428), CWC (65535), CWC (26214) } }, - { CWC (0), { CWC (52428), CWC (65535), CWC (13107) } }, - { CWC (0), { CWC (52428), CWC (65535), CWC (0) } }, - { CWC (0), { CWC (52428), CWC (52428), CWC (65535) } }, - { CWC (0), { CWC (52428), CWC (52428), CWC (52428) } }, - { CWC (0), { CWC (52428), CWC (52428), CWC (39321) } }, - { CWC (0), { CWC (52428), CWC (52428), CWC (26214) } }, - { CWC (0), { CWC (52428), CWC (52428), CWC (13107) } }, - { CWC (0), { CWC (52428), CWC (52428), CWC (0) } }, - { CWC (0), { CWC (52428), CWC (39321), CWC (65535) } }, - { CWC (0), { CWC (52428), CWC (39321), CWC (52428) } }, - { CWC (0), { CWC (52428), CWC (39321), CWC (39321) } }, - { CWC (0), { CWC (52428), CWC (39321), CWC (26214) } }, - { CWC (0), { CWC (52428), CWC (39321), CWC (13107) } }, - { CWC (0), { CWC (52428), CWC (39321), CWC (0) } }, - { CWC (0), { CWC (52428), CWC (26214), CWC (65535) } }, - { CWC (0), { CWC (52428), CWC (26214), CWC (52428) } }, - { CWC (0), { CWC (52428), CWC (26214), CWC (39321) } }, - { CWC (0), { CWC (52428), CWC (26214), CWC (26214) } }, - { CWC (0), { CWC (52428), CWC (26214), CWC (13107) } }, - { CWC (0), { CWC (52428), CWC (26214), CWC (0) } }, - { CWC (0), { CWC (52428), CWC (13107), CWC (65535) } }, - { CWC (0), { CWC (52428), CWC (13107), CWC (52428) } }, - { CWC (0), { CWC (52428), CWC (13107), CWC (39321) } }, - { CWC (0), { CWC (52428), CWC (13107), CWC (26214) } }, - { CWC (0), { CWC (52428), CWC (13107), CWC (13107) } }, - { CWC (0), { CWC (52428), CWC (13107), CWC (0) } }, - { CWC (0), { CWC (52428), CWC (0), CWC (65535) } }, - { CWC (0), { CWC (52428), CWC (0), CWC (52428) } }, - { CWC (0), { CWC (52428), CWC (0), CWC (39321) } }, - { CWC (0), { CWC (52428), CWC (0), CWC (26214) } }, - { CWC (0), { CWC (52428), CWC (0), CWC (13107) } }, - { CWC (0), { CWC (52428), CWC (0), CWC (0) } }, - { CWC (0), { CWC (39321), CWC (65535), CWC (65535) } }, - { CWC (0), { CWC (39321), CWC (65535), CWC (52428) } }, - { CWC (0), { CWC (39321), CWC (65535), CWC (39321) } }, - { CWC (0), { CWC (39321), CWC (65535), CWC (26214) } }, - { CWC (0), { CWC (39321), CWC (65535), CWC (13107) } }, - { CWC (0), { CWC (39321), CWC (65535), CWC (0) } }, - { CWC (0), { CWC (39321), CWC (52428), CWC (65535) } }, - { CWC (0), { CWC (39321), CWC (52428), CWC (52428) } }, - { CWC (0), { CWC (39321), CWC (52428), CWC (39321) } }, - { CWC (0), { CWC (39321), CWC (52428), CWC (26214) } }, - { CWC (0), { CWC (39321), CWC (52428), CWC (13107) } }, - { CWC (0), { CWC (39321), CWC (52428), CWC (0) } }, - { CWC (0), { CWC (39321), CWC (39321), CWC (65535) } }, - { CWC (0), { CWC (39321), CWC (39321), CWC (52428) } }, - { CWC (0), { CWC (39321), CWC (39321), CWC (39321) } }, - { CWC (0), { CWC (39321), CWC (39321), CWC (26214) } }, - { CWC (0), { CWC (39321), CWC (39321), CWC (13107) } }, - { CWC (0), { CWC (39321), CWC (39321), CWC (0) } }, - { CWC (0), { CWC (39321), CWC (26214), CWC (65535) } }, - { CWC (0), { CWC (39321), CWC (26214), CWC (52428) } }, - { CWC (0), { CWC (39321), CWC (26214), CWC (39321) } }, - { CWC (0), { CWC (39321), CWC (26214), CWC (26214) } }, - { CWC (0), { CWC (39321), CWC (26214), CWC (13107) } }, - { CWC (0), { CWC (39321), CWC (26214), CWC (0) } }, - { CWC (0), { CWC (39321), CWC (13107), CWC (65535) } }, - { CWC (0), { CWC (39321), CWC (13107), CWC (52428) } }, - { CWC (0), { CWC (39321), CWC (13107), CWC (39321) } }, - { CWC (0), { CWC (39321), CWC (13107), CWC (26214) } }, - { CWC (0), { CWC (39321), CWC (13107), CWC (13107) } }, - { CWC (0), { CWC (39321), CWC (13107), CWC (0) } }, - { CWC (0), { CWC (39321), CWC (0), CWC (65535) } }, - { CWC (0), { CWC (39321), CWC (0), CWC (52428) } }, - { CWC (0), { CWC (39321), CWC (0), CWC (39321) } }, - { CWC (0), { CWC (39321), CWC (0), CWC (26214) } }, - { CWC (0), { CWC (39321), CWC (0), CWC (13107) } }, - { CWC (0), { CWC (39321), CWC (0), CWC (0) } }, - { CWC (0), { CWC (26214), CWC (65535), CWC (65535) } }, - { CWC (0), { CWC (26214), CWC (65535), CWC (52428) } }, - { CWC (0), { CWC (26214), CWC (65535), CWC (39321) } }, - { CWC (0), { CWC (26214), CWC (65535), CWC (26214) } }, - { CWC (0), { CWC (26214), CWC (65535), CWC (13107) } }, - { CWC (0), { CWC (26214), CWC (65535), CWC (0) } }, - { CWC (0), { CWC (26214), CWC (52428), CWC (65535) } }, - { CWC (0), { CWC (26214), CWC (52428), CWC (52428) } }, - { CWC (0), { CWC (26214), CWC (52428), CWC (39321) } }, - { CWC (0), { CWC (26214), CWC (52428), CWC (26214) } }, - { CWC (0), { CWC (26214), CWC (52428), CWC (13107) } }, - { CWC (0), { CWC (26214), CWC (52428), CWC (0) } }, - { CWC (0), { CWC (26214), CWC (39321), CWC (65535) } }, - { CWC (0), { CWC (26214), CWC (39321), CWC (52428) } }, - { CWC (0), { CWC (26214), CWC (39321), CWC (39321) } }, - { CWC (0), { CWC (26214), CWC (39321), CWC (26214) } }, - { CWC (0), { CWC (26214), CWC (39321), CWC (13107) } }, - { CWC (0), { CWC (26214), CWC (39321), CWC (0) } }, - { CWC (0), { CWC (26214), CWC (26214), CWC (65535) } }, - { CWC (0), { CWC (26214), CWC (26214), CWC (52428) } }, - { CWC (0), { CWC (26214), CWC (26214), CWC (39321) } }, - { CWC (0), { CWC (26214), CWC (26214), CWC (26214) } }, - { CWC (0), { CWC (26214), CWC (26214), CWC (13107) } }, - { CWC (0), { CWC (26214), CWC (26214), CWC (0) } }, - { CWC (0), { CWC (26214), CWC (13107), CWC (65535) } }, - { CWC (0), { CWC (26214), CWC (13107), CWC (52428) } }, - { CWC (0), { CWC (26214), CWC (13107), CWC (39321) } }, - { CWC (0), { CWC (26214), CWC (13107), CWC (26214) } }, - { CWC (0), { CWC (26214), CWC (13107), CWC (13107) } }, - { CWC (0), { CWC (26214), CWC (13107), CWC (0) } }, - { CWC (0), { CWC (26214), CWC (0), CWC (65535) } }, - { CWC (0), { CWC (26214), CWC (0), CWC (52428) } }, - { CWC (0), { CWC (26214), CWC (0), CWC (39321) } }, - { CWC (0), { CWC (26214), CWC (0), CWC (26214) } }, - { CWC (0), { CWC (26214), CWC (0), CWC (13107) } }, - { CWC (0), { CWC (26214), CWC (0), CWC (0) } }, - { CWC (0), { CWC (13107), CWC (65535), CWC (65535) } }, - { CWC (0), { CWC (13107), CWC (65535), CWC (52428) } }, - { CWC (0), { CWC (13107), CWC (65535), CWC (39321) } }, - { CWC (0), { CWC (13107), CWC (65535), CWC (26214) } }, - { CWC (0), { CWC (13107), CWC (65535), CWC (13107) } }, - { CWC (0), { CWC (13107), CWC (65535), CWC (0) } }, - { CWC (0), { CWC (13107), CWC (52428), CWC (65535) } }, - { CWC (0), { CWC (13107), CWC (52428), CWC (52428) } }, - { CWC (0), { CWC (13107), CWC (52428), CWC (39321) } }, - { CWC (0), { CWC (13107), CWC (52428), CWC (26214) } }, - { CWC (0), { CWC (13107), CWC (52428), CWC (13107) } }, - { CWC (0), { CWC (13107), CWC (52428), CWC (0) } }, - { CWC (0), { CWC (13107), CWC (39321), CWC (65535) } }, - { CWC (0), { CWC (13107), CWC (39321), CWC (52428) } }, - { CWC (0), { CWC (13107), CWC (39321), CWC (39321) } }, - { CWC (0), { CWC (13107), CWC (39321), CWC (26214) } }, - { CWC (0), { CWC (13107), CWC (39321), CWC (13107) } }, - { CWC (0), { CWC (13107), CWC (39321), CWC (0) } }, - { CWC (0), { CWC (13107), CWC (26214), CWC (65535) } }, - { CWC (0), { CWC (13107), CWC (26214), CWC (52428) } }, - { CWC (0), { CWC (13107), CWC (26214), CWC (39321) } }, - { CWC (0), { CWC (13107), CWC (26214), CWC (26214) } }, - { CWC (0), { CWC (13107), CWC (26214), CWC (13107) } }, - { CWC (0), { CWC (13107), CWC (26214), CWC (0) } }, - { CWC (0), { CWC (13107), CWC (13107), CWC (65535) } }, - { CWC (0), { CWC (13107), CWC (13107), CWC (52428) } }, - { CWC (0), { CWC (13107), CWC (13107), CWC (39321) } }, - { CWC (0), { CWC (13107), CWC (13107), CWC (26214) } }, - { CWC (0), { CWC (13107), CWC (13107), CWC (13107) } }, - { CWC (0), { CWC (13107), CWC (13107), CWC (0) } }, - { CWC (0), { CWC (13107), CWC (0), CWC (65535) } }, - { CWC (0), { CWC (13107), CWC (0), CWC (52428) } }, - { CWC (0), { CWC (13107), CWC (0), CWC (39321) } }, - { CWC (0), { CWC (13107), CWC (0), CWC (26214) } }, - { CWC (0), { CWC (13107), CWC (0), CWC (13107) } }, - { CWC (0), { CWC (13107), CWC (0), CWC (0) } }, - { CWC (0), { CWC (0), CWC (65535), CWC (65535) } }, - { CWC (0), { CWC (0), CWC (65535), CWC (52428) } }, - { CWC (0), { CWC (0), CWC (65535), CWC (39321) } }, - { CWC (0), { CWC (0), CWC (65535), CWC (26214) } }, - { CWC (0), { CWC (0), CWC (65535), CWC (13107) } }, - { CWC (0), { CWC (0), CWC (65535), CWC (0) } }, - { CWC (0), { CWC (0), CWC (52428), CWC (65535) } }, - { CWC (0), { CWC (0), CWC (52428), CWC (52428) } }, - { CWC (0), { CWC (0), CWC (52428), CWC (39321) } }, - { CWC (0), { CWC (0), CWC (52428), CWC (26214) } }, - { CWC (0), { CWC (0), CWC (52428), CWC (13107) } }, - { CWC (0), { CWC (0), CWC (52428), CWC (0) } }, - { CWC (0), { CWC (0), CWC (39321), CWC (65535) } }, - { CWC (0), { CWC (0), CWC (39321), CWC (52428) } }, - { CWC (0), { CWC (0), CWC (39321), CWC (39321) } }, - { CWC (0), { CWC (0), CWC (39321), CWC (26214) } }, - { CWC (0), { CWC (0), CWC (39321), CWC (13107) } }, - { CWC (0), { CWC (0), CWC (39321), CWC (0) } }, - { CWC (0), { CWC (0), CWC (26214), CWC (65535) } }, - { CWC (0), { CWC (0), CWC (26214), CWC (52428) } }, - { CWC (0), { CWC (0), CWC (26214), CWC (39321) } }, - { CWC (0), { CWC (0), CWC (26214), CWC (26214) } }, - { CWC (0), { CWC (0), CWC (26214), CWC (13107) } }, - { CWC (0), { CWC (0), CWC (26214), CWC (0) } }, - { CWC (0), { CWC (0), CWC (13107), CWC (65535) } }, - { CWC (0), { CWC (0), CWC (13107), CWC (52428) } }, - { CWC (0), { CWC (0), CWC (13107), CWC (39321) } }, - { CWC (0), { CWC (0), CWC (13107), CWC (26214) } }, - { CWC (0), { CWC (0), CWC (13107), CWC (13107) } }, - { CWC (0), { CWC (0), CWC (13107), CWC (0) } }, - { CWC (0), { CWC (0), CWC (0), CWC (65535) } }, - { CWC (0), { CWC (0), CWC (0), CWC (52428) } }, - { CWC (0), { CWC (0), CWC (0), CWC (39321) } }, - { CWC (0), { CWC (0), CWC (0), CWC (26214) } }, - { CWC (0), { CWC (0), CWC (0), CWC (13107) } }, - { CWC (0), { CWC (61166), CWC (0), CWC (0) } }, - { CWC (0), { CWC (56797), CWC (0), CWC (0) } }, - { CWC (0), { CWC (48059), CWC (0), CWC (0) } }, - { CWC (0), { CWC (43690), CWC (0), CWC (0) } }, - { CWC (0), { CWC (34952), CWC (0), CWC (0) } }, - { CWC (0), { CWC (30583), CWC (0), CWC (0) } }, - { CWC (0), { CWC (21845), CWC (0), CWC (0) } }, - { CWC (0), { CWC (17476), CWC (0), CWC (0) } }, - { CWC (0), { CWC (8738), CWC (0), CWC (0) } }, - { CWC (0), { CWC (4369), CWC (0), CWC (0) } }, - { CWC (0), { CWC (0), CWC (61166), CWC (0) } }, - { CWC (0), { CWC (0), CWC (56797), CWC (0) } }, - { CWC (0), { CWC (0), CWC (48059), CWC (0) } }, - { CWC (0), { CWC (0), CWC (43690), CWC (0) } }, - { CWC (0), { CWC (0), CWC (34952), CWC (0) } }, - { CWC (0), { CWC (0), CWC (30583), CWC (0) } }, - { CWC (0), { CWC (0), CWC (21845), CWC (0) } }, - { CWC (0), { CWC (0), CWC (17476), CWC (0) } }, - { CWC (0), { CWC (0), CWC (8738), CWC (0) } }, - { CWC (0), { CWC (0), CWC (4369), CWC (0) } }, - { CWC (0), { CWC (0), CWC (0), CWC (61166) } }, - { CWC (0), { CWC (0), CWC (0), CWC (56797) } }, - { CWC (0), { CWC (0), CWC (0), CWC (48059) } }, - { CWC (0), { CWC (0), CWC (0), CWC (43690) } }, - { CWC (0), { CWC (0), CWC (0), CWC (34952) } }, - { CWC (0), { CWC (0), CWC (0), CWC (30583) } }, - { CWC (0), { CWC (0), CWC (0), CWC (21845) } }, - { CWC (0), { CWC (0), CWC (0), CWC (17476) } }, - { CWC (0), { CWC (0), CWC (0), CWC (8738) } }, - { CWC (0), { CWC (0), CWC (0), CWC (4369) } }, - { CWC (0), { CWC (61166), CWC (61166), CWC (61166) } }, - { CWC (0), { CWC (56797), CWC (56797), CWC (56797) } }, - { CWC (0), { CWC (48059), CWC (48059), CWC (48059) } }, - { CWC (0), { CWC (43690), CWC (43690), CWC (43690) } }, - { CWC (0), { CWC (34952), CWC (34952), CWC (34952) } }, - { CWC (0), { CWC (30583), CWC (30583), CWC (30583) } }, - { CWC (0), { CWC (21845), CWC (21845), CWC (21845) } }, - { CWC (0), { CWC (17476), CWC (17476), CWC (17476) } }, - { CWC (0), { CWC (8738), CWC (8738), CWC (8738) } }, - { CWC (0), { CWC (4369), CWC (4369), CWC (4369) } }, - { CWC (0), { CWC (0), CWC (0), CWC (0) } }, -}; diff --git a/src/default_ctab_values.cpp b/src/default_ctab_values.cpp new file mode 100644 index 00000000..53613d94 --- /dev/null +++ b/src/default_ctab_values.cpp @@ -0,0 +1,310 @@ +/* Copyright 1994 by Abacus Research and + * Development, Inc. All rights reserved. + */ + +#if !defined (OMIT_RCSID_STRINGS) +char ROMlib_rcsid_default_ctab_values[] = + "$Id: default_ctab_values.c 63 2004-12-24 18:19:43Z ctm $"; +#endif + +#include "rsys/common.h" +#include "rsys/cquick.h" +#include "QuickDraw.h" + +using namespace Executor; + +#define COLORWC(cwc) CWC((unsigned short)cwc) + +ColorSpec Executor::ctab_1bpp_values[] = +{ + { COLORWC (0), { COLORWC (65535), COLORWC (65535), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (0) } }, +}; + +ColorSpec Executor::ctab_2bpp_values[] = +{ + { COLORWC (0), { COLORWC (65535), COLORWC (65535), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (44204), COLORWC (44204), COLORWC (44204) } }, + { COLORWC (0), { COLORWC (21845), COLORWC (21845), COLORWC (21845) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (0) } }, +}; + +ColorSpec Executor::ctab_4bpp_values[] = +{ + { COLORWC (0), { COLORWC (65535), COLORWC (65535), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (64512), COLORWC (62333), COLORWC (1327) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (25738), COLORWC (652) } }, + { COLORWC (0), { COLORWC (56683), COLORWC (2242), COLORWC (1698) } }, + { COLORWC (0), { COLORWC (62167), COLORWC (2134), COLORWC (34028) } }, + { COLORWC (0), { COLORWC (18147), COLORWC (0), COLORWC (42302) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (54272) } }, + { COLORWC (0), { COLORWC (577), COLORWC (43860), COLORWC (60159) } }, + { COLORWC (0), { COLORWC (7969), COLORWC (46995), COLORWC (5169) } }, + { COLORWC (0), { COLORWC (0), COLORWC (25775), COLORWC (4528) } }, + { COLORWC (0), { COLORWC (22016), COLORWC (11421), COLORWC (1316) } }, + { COLORWC (0), { COLORWC (37079), COLORWC (29024), COLORWC (14900) } }, + { COLORWC (0), { COLORWC (49152), COLORWC (49152), COLORWC (49152) } }, + { COLORWC (0), { COLORWC (32768), COLORWC (32768), COLORWC (32768) } }, + { COLORWC (0), { COLORWC (16384), COLORWC (16384), COLORWC (16384) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (0) } }, +}; + +ColorSpec Executor::ctab_8bpp_values[] = +{ + { COLORWC (0), { COLORWC (65535), COLORWC (65535), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (65535), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (65535), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (65535), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (65535), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (65535), COLORWC (0) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (52428), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (52428), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (52428), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (52428), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (52428), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (52428), COLORWC (0) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (39321), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (39321), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (39321), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (39321), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (39321), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (39321), COLORWC (0) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (26214), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (26214), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (26214), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (26214), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (26214), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (26214), COLORWC (0) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (13107), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (13107), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (13107), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (13107), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (13107), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (13107), COLORWC (0) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (0), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (0), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (0), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (0), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (0), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (65535), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (65535), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (65535), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (65535), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (65535), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (65535), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (65535), COLORWC (0) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (52428), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (52428), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (52428), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (52428), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (52428), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (52428), COLORWC (0) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (39321), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (39321), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (39321), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (39321), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (39321), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (39321), COLORWC (0) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (26214), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (26214), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (26214), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (26214), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (26214), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (26214), COLORWC (0) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (13107), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (13107), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (13107), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (13107), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (13107), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (13107), COLORWC (0) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (0), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (0), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (0), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (0), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (0), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (52428), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (65535), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (65535), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (65535), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (65535), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (65535), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (65535), COLORWC (0) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (52428), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (52428), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (52428), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (52428), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (52428), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (52428), COLORWC (0) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (39321), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (39321), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (39321), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (39321), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (39321), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (39321), COLORWC (0) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (26214), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (26214), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (26214), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (26214), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (26214), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (26214), COLORWC (0) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (13107), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (13107), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (13107), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (13107), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (13107), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (13107), COLORWC (0) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (0), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (0), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (0), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (0), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (0), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (39321), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (65535), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (65535), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (65535), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (65535), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (65535), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (65535), COLORWC (0) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (52428), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (52428), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (52428), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (52428), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (52428), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (52428), COLORWC (0) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (39321), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (39321), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (39321), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (39321), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (39321), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (39321), COLORWC (0) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (26214), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (26214), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (26214), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (26214), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (26214), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (26214), COLORWC (0) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (13107), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (13107), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (13107), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (13107), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (13107), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (13107), COLORWC (0) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (0), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (0), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (0), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (0), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (0), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (26214), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (65535), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (65535), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (65535), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (65535), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (65535), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (65535), COLORWC (0) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (52428), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (52428), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (52428), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (52428), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (52428), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (52428), COLORWC (0) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (39321), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (39321), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (39321), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (39321), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (39321), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (39321), COLORWC (0) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (26214), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (26214), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (26214), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (26214), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (26214), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (26214), COLORWC (0) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (13107), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (13107), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (13107), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (13107), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (13107), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (13107), COLORWC (0) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (0), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (0), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (0), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (0), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (0), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (13107), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (65535), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (0), COLORWC (65535), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (0), COLORWC (65535), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (0), COLORWC (65535), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (0), COLORWC (65535), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (0), COLORWC (65535), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (52428), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (0), COLORWC (52428), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (0), COLORWC (52428), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (0), COLORWC (52428), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (0), COLORWC (52428), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (0), COLORWC (52428), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (39321), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (0), COLORWC (39321), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (0), COLORWC (39321), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (0), COLORWC (39321), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (0), COLORWC (39321), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (0), COLORWC (39321), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (26214), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (0), COLORWC (26214), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (0), COLORWC (26214), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (0), COLORWC (26214), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (0), COLORWC (26214), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (0), COLORWC (26214), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (13107), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (0), COLORWC (13107), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (0), COLORWC (13107), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (0), COLORWC (13107), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (0), COLORWC (13107), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (0), COLORWC (13107), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (65535) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (52428) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (39321) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (26214) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (13107) } }, + { COLORWC (0), { COLORWC (61166), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (56797), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (48059), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (43690), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (34952), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (30583), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (21845), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (17476), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (8738), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (4369), COLORWC (0), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (61166), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (56797), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (48059), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (43690), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (34952), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (30583), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (21845), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (17476), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (8738), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (4369), COLORWC (0) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (61166) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (56797) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (48059) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (43690) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (34952) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (30583) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (21845) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (17476) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (8738) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (4369) } }, + { COLORWC (0), { COLORWC (61166), COLORWC (61166), COLORWC (61166) } }, + { COLORWC (0), { COLORWC (56797), COLORWC (56797), COLORWC (56797) } }, + { COLORWC (0), { COLORWC (48059), COLORWC (48059), COLORWC (48059) } }, + { COLORWC (0), { COLORWC (43690), COLORWC (43690), COLORWC (43690) } }, + { COLORWC (0), { COLORWC (34952), COLORWC (34952), COLORWC (34952) } }, + { COLORWC (0), { COLORWC (30583), COLORWC (30583), COLORWC (30583) } }, + { COLORWC (0), { COLORWC (21845), COLORWC (21845), COLORWC (21845) } }, + { COLORWC (0), { COLORWC (17476), COLORWC (17476), COLORWC (17476) } }, + { COLORWC (0), { COLORWC (8738), COLORWC (8738), COLORWC (8738) } }, + { COLORWC (0), { COLORWC (4369), COLORWC (4369), COLORWC (4369) } }, + { COLORWC (0), { COLORWC (0), COLORWC (0), COLORWC (0) } }, +}; diff --git a/src/desk.c b/src/desk.cpp similarity index 99% rename from src/desk.c rename to src/desk.cpp index 9ec7199c..89f49573 100644 --- a/src/desk.c +++ b/src/desk.cpp @@ -27,6 +27,8 @@ char ROMlib_rcsid_desk[] = #include "rsys/hook.h" #include "rsys/aboutbox.h" +using namespace Executor; + P1(PUBLIC pascal trap, INTEGER, OpenDeskAcc, Str255, acc) /* IMI-440 */ { INTEGER retval; diff --git a/src/desperate.c b/src/desperate.cpp similarity index 94% rename from src/desperate.c rename to src/desperate.cpp index 2daaa1f7..d0cfda7f 100644 --- a/src/desperate.c +++ b/src/desperate.cpp @@ -12,6 +12,7 @@ char ROMlib_rcsid_desperate[] = #include "rsys/desperate.h" #include "OSUtil.h" +using namespace Executor; static int desperate_switch_index (int argc, char **argv) @@ -29,7 +30,7 @@ print_cmd_line_arg (const char *str) { char *c; - c = alloca (strlen (str) + 1); + c = (char*)alloca (strlen (str) + 1); strcpy (c, str); #if defined (MSDOS) convert_slashs_to_backslashs (c); @@ -86,7 +87,7 @@ static const char *desperate_switches[] = { * can only happen with duplicate "-desperate" switches). */ boolean_t -handle_desperate_switch (int *argcp, char ***argvp) +Executor::handle_desperate_switch (int *argcp, char ***argvp) { boolean_t success_p; char **argv, **new_argv; @@ -116,7 +117,7 @@ handle_desperate_switch (int *argcp, char ***argvp) * leak here since we'll never reclaim this memory. */ new_argc = argc + NELEM (desperate_switches) - 1; - new_argv = malloc ((new_argc + 1) * sizeof new_argv[0]); + new_argv = (char**)malloc ((new_argc + 1) * sizeof new_argv[0]); memcpy (new_argv, argv, s * sizeof new_argv[0]); memcpy (new_argv + s, desperate_switches, sizeof desperate_switches); memcpy (new_argv + s + NELEM (desperate_switches), diff --git a/src/device.c b/src/device.cpp similarity index 64% rename from src/device.c rename to src/device.cpp index 0a946dd1..dc1b798a 100644 --- a/src/device.c +++ b/src/device.cpp @@ -23,6 +23,8 @@ char ROMlib_rcsid_device[] = #include "rsys/file.h" #include "rsys/serial.h" +using namespace Executor; + /* * NOTE: The device manager now executes "native code" and code read * in from resources. The latter is "RAM" based, the former is @@ -36,130 +38,130 @@ char ROMlib_rcsid_device[] = A4(PUBLIC, OSErr, ROMlib_dispatch, ParmBlkPtr, p, /* INTERNAL */ BOOLEAN, async, DriverRoutineType, routine, INTEGER, trapn) { - int devicen; - ramdriverhand ramdh; - DCtlHandle h; - OSErr retval; - typedef OSErr (*devfp_t)(ParmBlkPtr, DCtlPtr); - devfp_t procp; - - devicen = -CW(p->cntrlParam.ioCRefNum) - 1; - if (devicen < 0 || devicen >= NDEVICES) - retval = badUnitErr; - else if (UTableBase == (DCtlHandlePtr) (long) CLC(0xFFFFFFFF) || - (h = MR(MR(UTableBase)[devicen].p)) == 0 || (*h).p == 0) - retval = unitEmptyErr; - else { - HLock((Handle) h); - p->ioParam.ioTrap = CW(trapn); - if (async) - p->ioParam.ioTrap |= CWC(asyncTrpBit); - else - p->ioParam.ioTrap |= CWC(noQueueBit); - if (!(HxX(h, dCtlFlags) & CWC(RAMBASEDBIT))) { - switch (routine) { - case Open: - retval = (* (devfp_t) MR(HxP(h, dCtlDriver)->udrvrOpen)) - (p, STARH(h)); - break; - case Prime: - retval = (* (devfp_t) MR(HxP(h, dCtlDriver)->udrvrPrime)) - (p, STARH(h)); - break; - case Ctl: - retval = (* (devfp_t) MR(HxP(h, dCtlDriver)->udrvrCtl)) - (p, STARH(h)); - break; - case Stat: - retval = (* (devfp_t) MR(HxP(h, dCtlDriver)->udrvrStatus)) - (p, STARH(h)); - break; - case Close: - retval = (* (devfp_t) MR(HxP(h, dCtlDriver)->udrvrClose)) - (p, STARH(h)); - break; - default: - retval = fsDSIntErr; - break; - } - } else { - ramdh = (ramdriverhand) HxP(h, dCtlDriver); - LoadResource((Handle) ramdh); - HLock((Handle) ramdh); - switch (routine) { - case Open: - procp = (devfp_t) STARH(ramdh) + Hx(ramdh, drvrOpen); - break; - case Prime: - procp = (devfp_t) STARH(ramdh) + Hx(ramdh, drvrPrime); - break; - case Ctl: - procp = (devfp_t) STARH(ramdh) + Hx(ramdh, drvrCtl); - break; - case Stat: - procp = (devfp_t) STARH(ramdh) + Hx(ramdh, drvrStatus); - break; - case Close: - procp = (devfp_t) STARH(ramdh) + Hx(ramdh, drvrClose); - break; - default: - procp = 0; - break; - } - if (procp) { - LONGINT saved1, saved2, saved3, saved4, saved5, saved6, saved7, - savea2, savea3, savea4, savea5, savea6; - - savea2 = EM_A2; - EM_A0 = (LONGINT) (long) US_TO_SYN68K(p); - EM_A1 = (LONGINT) (long) US_TO_SYN68K(STARH(h)); - EM_A2 = (LONGINT) (long) US_TO_SYN68K(procp); /* for compatibility with above */ - saved1 = EM_D1; - saved2 = EM_D2; - saved3 = EM_D3; - saved4 = EM_D4; - saved5 = EM_D5; - saved6 = EM_D6; - saved7 = EM_D7; - savea3 = EM_A3; - savea4 = EM_A4; - savea5 = EM_A5; - savea6 = EM_A6; - CALL_EMULATOR((syn68k_addr_t) (long) US_TO_SYN68K (procp)); - EM_D1 = saved1; - EM_D2 = saved2; - EM_D3 = saved3; - EM_D4 = saved4; - EM_D5 = saved5; - EM_D6 = saved6; - EM_D7 = saved7; - EM_A3 = savea3; - EM_A4 = savea4; - EM_A5 = savea5; - EM_A6 = savea6; - retval = EM_D0; - EM_A2 = savea2; - } else - retval = fsDSIntErr; - if (routine == Open) - HxX(h, dCtlFlags) |= CWC(DRIVEROPENBIT); - else if (routine == Close) { - HxX(h, dCtlFlags) &= ~CWC(DRIVEROPENBIT); - HUnlock((Handle) h); - HUnlock((Handle) ramdh); - MBarEnable = 0; - /* NOTE: It's not clear whether we should zero out this + int devicen; + ramdriverhand ramdh; + DCtlHandle h; + OSErr retval; + typedef OSErr (*devfp_t)(ParmBlkPtr, DCtlPtr); + devfp_t procp; + + devicen = -CW(p->cntrlParam.ioCRefNum) - 1; + if (devicen < 0 || devicen >= NDEVICES) + retval = badUnitErr; + else if (UTableBase == (DCtlHandlePtr) (long) CLC(0xFFFFFFFF) || + (h = MR(MR(UTableBase)[devicen].p)) == 0 || (*h).p == 0) + retval = unitEmptyErr; + else { + HLock((Handle) h); + p->ioParam.ioTrap = CW(trapn); + if (async) + p->ioParam.ioTrap |= CWC(asyncTrpBit); + else + p->ioParam.ioTrap |= CWC(noQueueBit); + if (!(HxX(h, dCtlFlags) & CWC(RAMBASEDBIT))) { + switch (routine) { + case Open: + retval = (* (devfp_t) MR(HxP(h, dCtlDriver)->udrvrOpen)) + (p, STARH(h)); + break; + case Prime: + retval = (* (devfp_t) MR(HxP(h, dCtlDriver)->udrvrPrime)) + (p, STARH(h)); + break; + case Ctl: + retval = (* (devfp_t) MR(HxP(h, dCtlDriver)->udrvrCtl)) + (p, STARH(h)); + break; + case Stat: + retval = (* (devfp_t) MR(HxP(h, dCtlDriver)->udrvrStatus)) + (p, STARH(h)); + break; + case Close: + retval = (* (devfp_t) MR(HxP(h, dCtlDriver)->udrvrClose)) + (p, STARH(h)); + break; + default: + retval = fsDSIntErr; + break; + } + } else { + ramdh = (ramdriverhand) HxP(h, dCtlDriver); + LoadResource((Handle) ramdh); + HLock((Handle) ramdh); + switch (routine) { + case Open: + procp = (devfp_t)(STARH(ramdh) + Hx(ramdh, drvrOpen)); + break; + case Prime: + procp = (devfp_t)(STARH(ramdh) + Hx(ramdh, drvrPrime)); + break; + case Ctl: + procp = (devfp_t)(STARH(ramdh) + Hx(ramdh, drvrCtl)); + break; + case Stat: + procp = (devfp_t)(STARH(ramdh) + Hx(ramdh, drvrStatus)); + break; + case Close: + procp = (devfp_t)(STARH(ramdh) + Hx(ramdh, drvrClose)); + break; + default: + procp = 0; + break; + } + if (procp) { + LONGINT saved1, saved2, saved3, saved4, saved5, saved6, saved7, + savea2, savea3, savea4, savea5, savea6; + + savea2 = EM_A2; + EM_A0 = (LONGINT) (long) US_TO_SYN68K(p); + EM_A1 = (LONGINT) (long) US_TO_SYN68K(STARH(h)); + EM_A2 = (LONGINT) (long) US_TO_SYN68K(procp); /* for compatibility with above */ + saved1 = EM_D1; + saved2 = EM_D2; + saved3 = EM_D3; + saved4 = EM_D4; + saved5 = EM_D5; + saved6 = EM_D6; + saved7 = EM_D7; + savea3 = EM_A3; + savea4 = EM_A4; + savea5 = EM_A5; + savea6 = EM_A6; + CALL_EMULATOR((syn68k_addr_t) (long) US_TO_SYN68K (procp)); + EM_D1 = saved1; + EM_D2 = saved2; + EM_D3 = saved3; + EM_D4 = saved4; + EM_D5 = saved5; + EM_D6 = saved6; + EM_D7 = saved7; + EM_A3 = savea3; + EM_A4 = savea4; + EM_A5 = savea5; + EM_A6 = savea6; + retval = EM_D0; + EM_A2 = savea2; + } else + retval = fsDSIntErr; + if (routine == Open) + HxX(h, dCtlFlags) |= CWC(DRIVEROPENBIT); + else if (routine == Close) { + HxX(h, dCtlFlags) &= ~CWC(DRIVEROPENBIT); + HUnlock((Handle) h); + HUnlock((Handle) ramdh); + MBarEnable = 0; + /* NOTE: It's not clear whether we should zero out this field or just check for DRIVEROPEN bit up above and never send messages except open to non-open drivers. */ - MR(UTableBase)[devicen].p = CLC(0); - } - - if (routine < Close) - retval = CW(p->ioParam.ioResult); /* see II-193 */ + MR(UTableBase)[devicen].p = (DCtlHandle)CLC(0); + } + + if (routine < Close) + retval = CW(p->ioParam.ioResult); /* see II-193 */ + } } - } - fs_err_hook (retval); - return retval; + fs_err_hook (retval); + return retval; } /* PBOpen, PBClose, PBRead and PBWrite are part of the file manager */ @@ -262,18 +264,18 @@ A1(PUBLIC, DCtlHandle, GetDCtlEntry, INTEGER, rn) PUBLIC driverinfo *ROMlib_otherdrivers = 0; /* for extensibility */ PRIVATE driverinfo knowndrivers[] = { -#if defined (LINUX) || defined (NEXTSTEP) || defined (MSDOS) || defined (CYGWIN32) - { ROMlib_serialopen, ROMlib_serialprime, ROMlib_serialctl, - ROMlib_serialstatus, ROMlib_serialclose, (StringPtr) "\004.AIn", -6, }, +#if defined (LINUX) || defined (MACOSX_) || defined (MSDOS) || defined (CYGWIN32) + { (OSErr(*)())ROMlib_serialopen, (OSErr(*)())ROMlib_serialprime, (OSErr(*)())ROMlib_serialctl, + (OSErr(*)())ROMlib_serialstatus, (OSErr(*)())ROMlib_serialclose, (StringPtr) "\p.AIn", -6, }, - { ROMlib_serialopen, ROMlib_serialprime, ROMlib_serialctl, - ROMlib_serialstatus, ROMlib_serialclose, (StringPtr) "\005.AOut", -7, }, + { (OSErr(*)())ROMlib_serialopen, (OSErr(*)())ROMlib_serialprime, (OSErr(*)())ROMlib_serialctl, + (OSErr(*)())ROMlib_serialstatus, (OSErr(*)())ROMlib_serialclose, (StringPtr) "\p.AOut", -7, }, - { ROMlib_serialopen, ROMlib_serialprime, ROMlib_serialctl, - ROMlib_serialstatus, ROMlib_serialclose, (StringPtr) "\004.BIn", -8, }, + { (OSErr(*)())ROMlib_serialopen, (OSErr(*)())ROMlib_serialprime, (OSErr(*)())ROMlib_serialctl, + (OSErr(*)())ROMlib_serialstatus, (OSErr(*)())ROMlib_serialclose, (StringPtr) "\p.BIn", -8, }, - { ROMlib_serialopen, ROMlib_serialprime, ROMlib_serialctl, - ROMlib_serialstatus, ROMlib_serialclose, (StringPtr) "\005.BOut", -9, }, + { (OSErr(*)())ROMlib_serialopen, (OSErr(*)())ROMlib_serialprime, (OSErr(*)())ROMlib_serialctl, + (OSErr(*)())ROMlib_serialstatus, (OSErr(*)())ROMlib_serialclose, (StringPtr) "\p.BOut", -9, }, #endif }; diff --git a/src/dialAlert.c b/src/dialAlert.cpp similarity index 95% rename from src/dialAlert.c rename to src/dialAlert.cpp index 6bd980f5..5677309c 100644 --- a/src/dialAlert.c +++ b/src/dialAlert.cpp @@ -24,6 +24,8 @@ char ROMlib_rcsid_dialAlert[] = #include "rsys/options.h" #include "rsys/dial.h" +using namespace Executor; + int16 alert_extra_icon_id = -32768; static icon_item_template_t icon_item_template = @@ -35,7 +37,7 @@ static icon_item_template_t icon_item_template = CBC ((1 << 7) | (iconItem)), CBC (2), - /* to be filled in later */ CWC (-1), + /* to be filled in later */ CWC ((short)-1), }; P2 (PUBLIC pascal trap, INTEGER, Alert, INTEGER, id, /* IMI-418 */ @@ -196,6 +198,13 @@ P2(PUBLIC pascal trap, INTEGER, CautionAlert, INTEGER, id, /* IMI-420 */ return Alert (id, fp); } +namespace Executor { + PRIVATE Handle lockres(ResType, INTEGER, BOOLEAN); + PRIVATE void lockditl(INTEGER, BOOLEAN); + PRIVATE void lockalert(INTEGER, BOOLEAN); + PRIVATE void lockdialog(INTEGER, BOOLEAN); +} + A3(PRIVATE, Handle, lockres, ResType, rt, INTEGER, id, BOOLEAN, flag) { Handle retval; diff --git a/src/dialCreate.c b/src/dialCreate.cpp similarity index 98% rename from src/dialCreate.c rename to src/dialCreate.cpp index 2d121331..baae3fa4 100644 --- a/src/dialCreate.c +++ b/src/dialCreate.cpp @@ -30,6 +30,8 @@ char ROMlib_rcsid_dialCreate[] = #include "rsys/resource.h" #include "rsys/host.h" +using namespace Executor; + #define _PtrToHand(ptr, hand, len) \ ((void) \ ({ \ @@ -40,7 +42,7 @@ char ROMlib_rcsid_dialCreate[] = })) void -dialog_create_item (DialogPeek dp, itmp dst, itmp src, +Executor::dialog_create_item (DialogPeek dp, itmp dst, itmp src, int item_no, Point base_pt) { int16 *data; @@ -317,7 +319,7 @@ P9 (PUBLIC pascal trap, DialogPtr, NewDialog, Ptr, storage, /* IMI-412 */ } void -dialog_compute_rect (Rect *dialog_rect, Rect *dst_rect, +Executor::dialog_compute_rect (Rect *dialog_rect, Rect *dst_rect, int position) { Rect *screen_rect; diff --git a/src/dialDispatch.c b/src/dialDispatch.cpp similarity index 95% rename from src/dialDispatch.c rename to src/dialDispatch.cpp index ed6db35b..04b6430b 100644 --- a/src/dialDispatch.c +++ b/src/dialDispatch.cpp @@ -13,11 +13,13 @@ char ROMlib_rcsid_dialDispatch[] = #include "DialogMgr.h" +using namespace Executor; + /* traps from the DialogDispatch trap */ P1 (PUBLIC pascal trap, OSErr, GetStdFilterProc, ProcPtr *, proc) { - *proc = RM (P_ROMlib_myfilt); + *proc = (ProcPtr)RM (&P_ROMlib_myfilt); warning_unimplemented ("no specs"); /* i.e. no documentation on how this routine is *supposed* to work, so we may be blowing off something diff --git a/src/dialHandle.c b/src/dialHandle.cpp similarity index 97% rename from src/dialHandle.c rename to src/dialHandle.cpp index f5c727c5..bfce4697 100644 --- a/src/dialHandle.c +++ b/src/dialHandle.cpp @@ -16,6 +16,7 @@ char ROMlib_rcsid_dialHandle[] = #include "DialogMgr.h" #include "ControlMgr.h" #include "MemoryMgr.h" +#include "rsys/osutil.h" #include "OSUtil.h" #include "ToolboxUtil.h" #include "ToolboxEvent.h" @@ -36,6 +37,8 @@ char ROMlib_rcsid_dialHandle[] = #include "rsys/executor.h" #include "rsys/osevent.h" +using namespace Executor; + P3(PUBLIC pascal, BOOLEAN, ROMlib_myfilt, DialogPeek, dp, EventRecord *, evt, INTEGER *, ith) /* IMI-415 */ { @@ -53,11 +56,9 @@ P3(PUBLIC pascal, BOOLEAN, ROMlib_myfilt, DialogPeek, dp, EventRecord *, evt, if (Hx(c, contrlVis) && U(Hx(c, contrlHilite)) != INACTIVE) { if ((when = ROMlib_when) != WriteNever) ROMlib_WriteWhen(WriteInBltrgn); -#if !defined(NEXTSTEP) HiliteControl(c, inButton); Delay((LONGINT)5, (LONGINT *) 0); HiliteControl(c, 0); -#endif HSetState(MR(((DialogPeek) dp)->items), flags); ROMlib_WriteWhen(when); /*-->*/ return -1; @@ -95,7 +96,7 @@ ROMlib_CALLMODALPROC (DialogPtr dp, { ROMlib_hook(dial_modalnumber); HOOKSAVEREGS(); - retval = CToPascalCall(fp, CTOP_ROMlib_myfilt, dp, evtp, ip); + retval = CToPascalCall(&fp, CTOP_ROMlib_myfilt, dp, evtp, ip); HOOKRESTOREREGS(); } return retval; @@ -119,7 +120,7 @@ ROMlib_CALLUSERITEM (DialogPtr dp, else { ROMlib_hook(dial_usernumber); - CToPascalCall(temph, CTOP_ROMlib_filebox, dp, inum); + CToPascalCall(&temph, CTOP_ROMlib_filebox, dp, inum); } } @@ -144,7 +145,7 @@ ROMlib_CALLUSERITEM (DialogPtr dp, small, but THEGDEVICE_SAVE_EXCURSION prevents us from using #if, so we have a lot of replicated code. This is scary and should be fixed. */ -P 2 (PUBLIC pascal trap, void, ModalDialog, ProcPtr, fp, /* IMI-415 */ +P2 (PUBLIC pascal trap, void, ModalDialog, ProcPtr, fp, /* IMI-415 */ INTEGER *, item) { /* @@ -322,7 +323,7 @@ P1(PUBLIC pascal trap, BOOLEAN, IsDialogEvent, /* IMI-416 */ } boolean_t -get_item_style_info (DialogPtr dp, int item_no, +Executor::get_item_style_info (DialogPtr dp, int item_no, uint16 *flags_return, item_style_info_t *style_info) { AuxWinHandle aux_win_h; @@ -363,7 +364,7 @@ get_item_style_info (DialogPtr dp, int item_no, } void -ROMlib_drawiptext (DialogPtr dp, itmp ip, int item_no) +Executor::ROMlib_drawiptext (DialogPtr dp, itmp ip, int item_no) { boolean_t restore_draw_state_p = FALSE; draw_state_t draw_state; @@ -449,7 +450,7 @@ ROMlib_drawiptext (DialogPtr dp, itmp ip, int item_no) } void -dialog_draw_item (DialogPtr dp, itmp itemp, int itemno) +Executor::dialog_draw_item (DialogPtr dp, itmp itemp, int itemno) { if (itemp->itmtype & ctrlItem) { @@ -700,7 +701,7 @@ A1(PUBLIC, void, DlgDelete, DialogPtr, dp) /* IMI-418 */ void -BEEPER (INTEGER n) +Executor::BEEPER (INTEGER n) { if (DABeeper) { if ((pascal void (*)(INTEGER))MR(DABeeper) == P_ROMlib_mysound) @@ -708,7 +709,7 @@ BEEPER (INTEGER n) else { HOOKSAVEREGS(); ROMlib_hook(dial_soundprocnumber); - CToPascalCall((soundprocp)MR(DABeeper), CTOP_ROMlib_mysound, n); + Executor::CToPascalCall((void*)(soundprocp)MR(DABeeper), CTOP_ROMlib_mysound, n); HOOKRESTOREREGS(); } } diff --git a/src/dialInit.c b/src/dialInit.cpp similarity index 80% rename from src/dialInit.c rename to src/dialInit.cpp index 36c47ebd..c4556b3f 100644 --- a/src/dialInit.c +++ b/src/dialInit.cpp @@ -19,6 +19,8 @@ char ROMlib_rcsid_dialInit[] = #include "rsys/itm.h" #include "rsys/mman.h" +using namespace Executor; + P1(PUBLIC, pascal void, ROMlib_mysound, INTEGER, i) { while (i--) @@ -40,14 +42,20 @@ P1 (PUBLIC pascal trap, void, InitDialogs, ProcPtr, rp) /* IMI-411 */ DlgFont = CWC (systemFont); ResumeProc = RM (rp); ErrorSound ((ProcPtr) P_ROMlib_mysound); + + PtrToHand (nothing, &DAStrings_H[0], (LONGINT) 1); - DAStrings_H[0].p = RM (DAStrings_H[0].p); + HIDDEN_Ptr *afg = DAStrings_H[0].p; + DAStrings_H[0].p = RM (afg); PtrToHand (nothing, &DAStrings_H[1], (LONGINT) 1); - DAStrings_H[1].p = RM (DAStrings_H[1].p); + afg = DAStrings_H[1].p; + DAStrings_H[1].p = RM (afg); PtrToHand (nothing, &DAStrings_H[2], (LONGINT) 1); - DAStrings_H[2].p = RM (DAStrings_H[2].p); + afg = DAStrings_H[2].p; + DAStrings_H[2].p = RM (afg); PtrToHand (nothing, &DAStrings_H[3], (LONGINT) 1); - DAStrings_H[3].p = RM (DAStrings_H[3].p); + afg = DAStrings_H[2].p; + DAStrings_H[3].p = RM (afg); }); } diff --git a/src/dialItem.c b/src/dialItem.cpp similarity index 97% rename from src/dialItem.c rename to src/dialItem.cpp index 86a440c0..22aa0fd9 100644 --- a/src/dialItem.c +++ b/src/dialItem.cpp @@ -17,6 +17,8 @@ char ROMlib_rcsid_dialItem[] = #include "rsys/cquick.h" #include "rsys/mman.h" +using namespace Executor; + #define _GetDItem(dp, item_no, item_type, item_h, item_rect) \ ({ \ HIDDEN_Handle __item_handle; \ @@ -27,7 +29,7 @@ char ROMlib_rcsid_dialItem[] = void -AppendDITL (DialogPtr dp, Handle new_items_h, DITLMethod method) +Executor::AppendDITL (DialogPtr dp, Handle new_items_h, DITLMethod method) { Handle items_h; int items_h_size, new_items_h_size; @@ -164,7 +166,7 @@ AppendDITL (DialogPtr dp, Handle new_items_h, DITLMethod method) } void -ShortenDITL (DialogPtr dp, int16 n_items) +Executor::ShortenDITL (DialogPtr dp, int16 n_items) { Handle item_h; char *base_itemp; @@ -266,7 +268,7 @@ ShortenDITL (DialogPtr dp, int16 n_items) } int16 -CountDITL (DialogPtr dp) +Executor::CountDITL (DialogPtr dp) { Handle items; int16 count; diff --git a/src/dialManip.c b/src/dialManip.cpp similarity index 95% rename from src/dialManip.c rename to src/dialManip.cpp index 0974d38c..409dbd1a 100644 --- a/src/dialManip.c +++ b/src/dialManip.cpp @@ -22,17 +22,33 @@ char ROMlib_rcsid_dialManip[] = #include "rsys/cquick.h" #include "rsys/mman.h" +using namespace Executor; + +namespace Executor { + PRIVATE itmp htoip(Handle h, + WindowPeek *wp_return, int16 *nop_return, + SignedByte *flags_return); +} + P4(PUBLIC pascal trap, void, ParamText, StringPtr, p0, /* IMI-421 */ StringPtr, p1, StringPtr, p2, StringPtr, p3) { - if (p0) - PtrToXHand((Ptr) p0, MR(DAStrings_H[0].p), (LONGINT)U(p0[0])+1); - if (p1) - PtrToXHand((Ptr) p1, MR(DAStrings_H[1].p), (LONGINT)U(p1[0])+1); - if (p2) - PtrToXHand((Ptr) p2, MR(DAStrings_H[2].p), (LONGINT)U(p2[0])+1); - if (p3) - PtrToXHand((Ptr) p3, MR(DAStrings_H[3].p), (LONGINT)U(p3[0])+1); + if (p0) { + Handle aType = (DAStrings_H[0].p); + PtrToXHand((Ptr) p0, aType, (LONGINT)U(p0[0])+1); + } + if (p1) { + Handle aType = (DAStrings_H[1].p); + PtrToXHand((Ptr) p1, aType, (LONGINT)U(p1[0])+1); + } + if (p2){ + Handle aType = (DAStrings_H[2].p); + PtrToXHand((Ptr) p2, aType, (LONGINT)U(p2[0])+1); + } + if (p3) { + Handle aType = (DAStrings_H[3].p); + PtrToXHand((Ptr) p3, aType, (LONGINT)U(p3[0])+1); + } } A3 (PUBLIC, itmp, ROMlib_dpnotoip, DialogPeek, dp, /* INTERNAL */ diff --git a/src/dirtyrect.c b/src/dirtyrect.cpp similarity index 96% rename from src/dirtyrect.c rename to src/dirtyrect.cpp index 989810f0..6e763f0b 100644 --- a/src/dirtyrect.c +++ b/src/dirtyrect.cpp @@ -20,8 +20,9 @@ char ROMlib_rcsid_dirtyrect[] = "$Id: dirtyrect.c 63 2004-12-24 18:19:43Z ctm $" # define MAX_DIRTY_RECTS 5 #endif +using namespace Executor; -int num_dirty_rects = 0; +int Executor::num_dirty_rects = 0; static vdriver_rect_t dirty_rect[MAX_DIRTY_RECTS]; @@ -86,7 +87,7 @@ union_rect (int top, int left, int bottom, int right, vdriver_rect_t *r) * list, that glommed rectangle must get reinserted. */ void -dirty_rect_accrue (int top, int left, int bottom, int right) +Executor::dirty_rect_accrue (int top, int left, int bottom, int right) { unsigned long best_area_added; int ndr, i, best; @@ -226,7 +227,7 @@ dirty_rect_accrue (int top, int left, int bottom, int right) * the dirty rect list. */ boolean_t -dirty_rect_subsumed_p (int top, int left, int bottom, int right) +Executor::dirty_rect_subsumed_p (int top, int left, int bottom, int right) { int i; @@ -322,7 +323,7 @@ sort_dirty_rects_by_top (void) void -dirty_rect_update_screen (void) +Executor::dirty_rect_update_screen (void) { if (num_dirty_rects) { diff --git a/src/disk.c b/src/disk.cpp similarity index 95% rename from src/disk.c rename to src/disk.cpp index d154be75..0b3841f2 100644 --- a/src/disk.c +++ b/src/disk.cpp @@ -12,6 +12,8 @@ char ROMlib_rcsid_disk[] = #include "rsys/common.h" #include "Disk.h" +using namespace Executor; + A1(PUBLIC, OSErr, DiskEject, INTEGER, rn) { return paramErr; diff --git a/src/diskinit.c b/src/diskinit.cpp similarity index 96% rename from src/diskinit.c rename to src/diskinit.cpp index 857cdeca..41c7fce1 100644 --- a/src/diskinit.c +++ b/src/diskinit.cpp @@ -16,10 +16,12 @@ char ROMlib_rcsid_diskinit[] = #include "rsys/common.h" #include "DiskInit.h" #include "rsys/glue.h" -#include "mkvol/mkvol.h" +#include "mkvol.h" #include "rsys/hfs.h" #include "rsys/blockinterrupts.h" +using namespace Executor; + P0(PUBLIC pascal trap, void, DILoad) { } @@ -175,9 +177,9 @@ flush_buffer (our_file_info_t *ofitp) } PRIVATE size_t -writefunc (int magic, void *buf, size_t buf_len) +writefunc (int magic, const void *buf, size_t buf_len) { - OSErr err; + OSErr err = noErr; our_file_info_t *ofip; char *bufp; size_t buf_len_remaining; @@ -187,8 +189,7 @@ writefunc (int magic, void *buf, size_t buf_len) if (ofip->pos != offset) warning_unexpected ("ofip->pos = %d, offset = %ld\n", ofip->pos, offset); - bufp = buf; - err = noErr; + bufp = (char*)buf; while (err == noErr && buf_len_remaining > 0) { uint32 n_bytes_left, n_to_copy; @@ -231,7 +232,7 @@ P2(PUBLIC pascal trap, OSErr, DIZero, INTEGER, dn, StringPtr, vname) our_file_info_t oi; name_len = vname[0]; - name = alloca(name_len + 1); + name = (char*)alloca(name_len + 1); memcpy(name, vname+1, name_len); name[name_len] = 0; GetDateTime(&time); diff --git a/src/dump.c b/src/dump.cpp similarity index 90% rename from src/dump.c rename to src/dump.cpp index 4e3eed3c..0f3ea193 100644 --- a/src/dump.c +++ b/src/dump.cpp @@ -139,7 +139,9 @@ enum pixpat_pattern_types #include -FILE *o_fp = NULL; +using namespace Executor; + +FILE *Executor::o_fp = NULL; #ifdef MSDOS /* useful for overriding when under dos */ @@ -149,7 +151,7 @@ FILE *stdout_fp = stdout; static int indent = 0; -static char *field_name = ""; +std::string field_name = ""; /* dump everything recursively; but no ctab tables... */ enum dump_flags @@ -161,7 +163,7 @@ enum dump_flags dump_pixpat_fields_flag = 16 }; -int dump_verbosity = 1; +int Executor::dump_verbosity = 1; void @@ -191,10 +193,10 @@ dump_clear_field (int field) fprintf args; \ } while (0) -Rect big_rect = { CWC (-32767), CWC (-32767), CWC (32767), CWC (32767) }; +Rect big_rect = { CWC ((INTEGER)-32767), CWC ((INTEGER)-32767), CWC (32767), CWC (32767) }; void -dump_init (char *dst) +Executor::dump_init (char *dst) { if (dst) { @@ -210,7 +212,7 @@ void dump_finish (void) { fflush (o_fp); - if (o_fp != stderr) + if (!(o_fp == stderr)) fclose (o_fp); } @@ -223,31 +225,31 @@ dump_spaces (int nspaces) } void -dump_ptr_real (Ptr x) +Executor::dump_ptr_real (Ptr x) { if (x) - iprintf ((o_fp, "%s%p[0x%lx]\n", field_name, x, + iprintf ((o_fp, "%s%p[0x%lx]\n", field_name.c_str(), x, (long) GetPtrSize (x))); else - iprintf ((o_fp, "%s%p\n", field_name, x)); + iprintf ((o_fp, "%s%p\n", field_name.c_str(), x)); fflush (o_fp); } void -dump_handle_real (Handle x) +Executor::dump_handle_real (Handle x) { if (x) - iprintf ((o_fp, "%s%p[0x%x] (%p)\n", field_name, x, + iprintf ((o_fp, "%s%p[0x%x] (%p)\n", field_name.c_str(), x, GetHandleSize (x), deref (x))); else - iprintf ((o_fp, "%s%p\n", field_name, x)); + iprintf ((o_fp, "%s%p\n", field_name.c_str(), x)); fflush (o_fp); } void -dump_rect (Rect *r) +Executor::dump_rect (Rect *r) { - iprintf ((o_fp, "%s(Rect *%p) {\n", field_name, r)); indent += 2; + iprintf ((o_fp, "%s(Rect *%p) {\n", field_name.c_str(), r)); indent += 2; iprintf ((o_fp, "top 0x%x; left 0x%x;\n", CW (r->top), CW (r->left))); iprintf ((o_fp, "bottom 0x%x; right 0x%x; }\n", CW (r->bottom), CW (r->right))); indent -= 2; @@ -255,31 +257,31 @@ dump_rect (Rect *r) } void -dump_pattern (Pattern x) +Executor::dump_pattern (Pattern x) { - iprintf ((o_fp, "%s0x%02x%02x%02x%02x%02x%02x%02x%02x;\n", field_name, + iprintf ((o_fp, "%s0x%02x%02x%02x%02x%02x%02x%02x%02x;\n", field_name.c_str(), x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7])); fflush (o_fp); } void -dump_point (Point x) +Executor::dump_point (Point x) { iprintf ((o_fp, "%s(Point) { v 0x%x; h 0x%x; }\n", - field_name, CW (x.v), CW (x.h))); + field_name.c_str(), CW (x.v), CW (x.h))); fflush (o_fp); } void -dump_bitmap_data (BitMap *x, int depth, Rect *rect) +Executor::dump_bitmap_data (BitMap *x, int depth, Rect *rect) { int rows, bytes_per_row; int row_bytes; int r, rb; char *addr; - iprintf ((o_fp, "...%s data\n", field_name)); indent += 2; + iprintf ((o_fp, "...%s data\n", field_name.c_str())); indent += 2; if (!rect) rect = &x->bounds; @@ -316,7 +318,7 @@ dump_bitmap_data (BitMap *x, int depth, Rect *rect) } void -dump_bits16 (Bits16 data) +Executor::dump_bits16 (Bits16 data) { if (dump_verbosity >= 3) { @@ -331,14 +333,14 @@ dump_bits16 (Bits16 data) dump_bitmap_data (&x, 1, NULL); } else - iprintf ((o_fp, "[%s field omitted]\n", field_name)); + iprintf ((o_fp, "[%s field omitted]\n", field_name.c_str())); fflush (o_fp); } void -dump_bitmap (BitMap *x, Rect *rect) +Executor::dump_bitmap (BitMap *x, Rect *rect) { - iprintf ((o_fp, "%s(BitMap *%p) {\n", field_name, x)); indent += 2; + iprintf ((o_fp, "%s(BitMap *%p) {\n", field_name.c_str(), x)); indent += 2; iprintf ((o_fp, "baseAddr %p;\n", MR (x->baseAddr))); if (dump_verbosity >= 3) dump_bitmap_data (x, 1, rect); @@ -349,13 +351,13 @@ dump_bitmap (BitMap *x, Rect *rect) } void -dump_bitmap_null_rect (BitMap *x) +Executor::dump_bitmap_null_rect (BitMap *x) { dump_bitmap (x, NULL); } void -dump_grafport (GrafPtr x) +Executor::dump_grafport (GrafPtr x) { if (CGrafPort_p (x)) dump_cgrafport_real ((CGrafPtr) x); @@ -365,9 +367,9 @@ dump_grafport (GrafPtr x) } void -dump_qdprocs (QDProcsPtr x) +Executor::dump_qdprocs (QDProcsPtr x) { - iprintf ((o_fp, "%s(QDProcsPtr *%p) {\n", field_name, x)); indent += 2; + iprintf ((o_fp, "%s(QDProcsPtr *%p) {\n", field_name.c_str(), x)); indent += 2; if (x != NULL) { iprintf ((o_fp, "textProc %p;\n", MR (x->textProc))); @@ -391,9 +393,9 @@ dump_qdprocs (QDProcsPtr x) } void -dump_grafport_real (GrafPtr x) +Executor::dump_grafport_real (GrafPtr x) { - iprintf ((o_fp, "%s(GrafPort *%p) {\n", field_name, x)); indent += 2; + iprintf ((o_fp, "%s(GrafPort *%p) {\n", field_name.c_str(), x)); indent += 2; iprintf ((o_fp, "device %d;\n", CW (x->device))); dump_field (dump_bitmap_null_rect, &x->portBits, "portBits"); dump_field (dump_rect, &x->portRect, "portRect"); @@ -430,16 +432,16 @@ theport (void) } void -dump_theport (void) +Executor::dump_theport (void) { dump_grafport (thePort); } void -dump_rgb_color (RGBColor *x) +Executor::dump_rgb_color (RGBColor *x) { iprintf ((o_fp, "%s(RGBColor) { red 0x%lx; green 0x%lx, blue 0x%lx; }\n", - field_name, + field_name.c_str(), (long) CW (x->red), (long) CW (x->green), (long) CW (x->blue))); @@ -447,11 +449,11 @@ dump_rgb_color (RGBColor *x) } void -dump_ctab (CTabHandle ctab) +Executor::dump_ctab (CTabHandle ctab) { CTabPtr x = deref (ctab); - iprintf ((o_fp, "%s(ColorTable **%p) {\n", field_name, ctab)); indent += 2; + iprintf ((o_fp, "%s(ColorTable **%p) {\n", field_name.c_str(), ctab)); indent += 2; iprintf ((o_fp, "ctSeed 0x%x;\n", CL (x->ctSeed))); iprintf ((o_fp, "ctFlags 0x%x;\n", CW (x->ctFlags))); iprintf ((o_fp, "ctSize %d;\n", CW (x->ctSize))); @@ -478,11 +480,11 @@ dump_ctab (CTabHandle ctab) } void -dump_itab (ITabHandle itab) +Executor::dump_itab (ITabHandle itab) { ITabPtr x = deref (itab); - iprintf ((o_fp, "%s(ITab **%p) {\n", field_name, itab)); indent += 2; + iprintf ((o_fp, "%s(ITab **%p) {\n", field_name.c_str(), itab)); indent += 2; iprintf ((o_fp, "iTabSeed 0x%x;\n", CL (x->iTabSeed))); iprintf ((o_fp, "iTabRes %d;\n", CW (x->iTabRes))); @@ -492,11 +494,11 @@ dump_itab (ITabHandle itab) } void -dump_pixpat (PixPatHandle pixpat) +Executor::dump_pixpat (PixPatHandle pixpat) { PixPatPtr x = deref (pixpat); - iprintf ((o_fp, "%s(PixPat **%p) {\n", field_name, pixpat)); indent += 2; + iprintf ((o_fp, "%s(PixPat **%p) {\n", field_name.c_str(), pixpat)); indent += 2; iprintf ((o_fp, "patType %s;\n", x->patType == CWC (pixpat_old_style_pattern) ? "old_style_pattern" @@ -536,7 +538,7 @@ dump_pixpat (PixPatHandle pixpat) void dump_pixmap_ptr (PixMapPtr x, Rect *rect) { - iprintf ((o_fp, "%s(PixMap *%p) {\n", field_name, x)); indent += 2; + iprintf ((o_fp, "%s(PixMap *%p) {\n", field_name.c_str(), x)); indent += 2; iprintf ((o_fp, "baseAddr %p;\n", MR (x->baseAddr))); if (dump_verbosity >= 3 && x->baseAddr) @@ -567,17 +569,17 @@ dump_pixmap_ptr (PixMapPtr x, Rect *rect) } void -dump_pixmap_null_rect (PixMapHandle pixmap) +Executor::dump_pixmap_null_rect (PixMapHandle pixmap) { dump_pixmap (pixmap, NULL); } void -dump_pixmap (PixMapHandle pixmap, Rect *rect) +Executor::dump_pixmap (PixMapHandle pixmap, Rect *rect) { PixMapPtr x = deref (pixmap); - iprintf ((o_fp, "%s(PixMap **%p) {\n", field_name, pixmap)); indent += 2; + iprintf ((o_fp, "%s(PixMap **%p) {\n", field_name.c_str(), pixmap)); indent += 2; iprintf ((o_fp, "baseAddr %p;\n", MR (x->baseAddr))); if (dump_verbosity >= 3 && x->baseAddr) @@ -608,9 +610,9 @@ dump_pixmap (PixMapHandle pixmap, Rect *rect) } void -dump_cqdprocs (CQDProcsPtr x) +Executor::dump_cqdprocs (CQDProcsPtr x) { - iprintf ((o_fp, "%s(CQDProcsPtr *%p) {\n", field_name, x)); indent += 2; + iprintf ((o_fp, "%s(CQDProcsPtr *%p) {\n", field_name.c_str(), x)); indent += 2; if (x != NULL) { iprintf ((o_fp, "textProc %p;\n", MR (x->textProc))); @@ -640,9 +642,9 @@ dump_cqdprocs (CQDProcsPtr x) } void -dump_cgrafport_real (CGrafPtr x) +Executor::dump_cgrafport_real (CGrafPtr x) { - iprintf ((o_fp, "%s(CGrafPort *%p) {\n", field_name, x)); indent += 2; + iprintf ((o_fp, "%s(CGrafPort *%p) {\n", field_name.c_str(), x)); indent += 2; iprintf ((o_fp, "device 0x%x;\n", CW (x->device))); if (dump_verbosity && x->portPixMap) @@ -695,12 +697,12 @@ dump_cgrafport_real (CGrafPtr x) } void -dump_gdevice (GDHandle gdev) +Executor::dump_gdevice (GDHandle gdev) { GDPtr x = deref (gdev); SProcHndl proc; - iprintf ((o_fp, "%s(GDevice **%p) {\n", field_name, gdev)); indent += 2; + iprintf ((o_fp, "%s(GDevice **%p) {\n", field_name.c_str(), gdev)); indent += 2; iprintf ((o_fp, "gdID 0x%x;\n", CW (x->gdID))); iprintf ((o_fp, "gdType 0x%x;\n", CW (x->gdType))); if (dump_verbosity @@ -737,19 +739,19 @@ dump_gdevice (GDHandle gdev) } void -dump_thegdevice (void) +Executor::dump_thegdevice (void) { dump_gdevice (MR (TheGDevice)); } void -dump_maindevice (void) +Executor::dump_maindevice (void) { dump_gdevice (MR (MainDevice)); } void -dump_string (unsigned char *s) +Executor::dump_string (unsigned char *s) { /* pascal string */ unsigned char t[256]; @@ -759,15 +761,15 @@ dump_string (unsigned char *s) strncpy ((char *) t, (char *) &s[1], len); t[len] = '\0'; iprintf ((o_fp, "%s %p \"%s\";\n", - field_name, s, t)); + field_name.c_str(), s, t)); } void -dump_palette (PaletteHandle palette) +Executor::dump_palette (PaletteHandle palette) { PalettePtr x = deref (palette); - iprintf ((o_fp, "%s(PaletteHandle **%p) {\n", field_name, palette)); + iprintf ((o_fp, "%s(PaletteHandle **%p) {\n", field_name.c_str(), palette)); indent += 2; iprintf ((o_fp, "pmEntries 0x%x;\n", CW (x->pmEntries))); if (pmWindow (x) @@ -808,11 +810,11 @@ dump_palette (PaletteHandle palette) } void -dump_ccrsr (CCrsrHandle ccrsr) +Executor::dump_ccrsr (CCrsrHandle ccrsr) { CCrsrPtr x = deref (ccrsr); - iprintf ((o_fp, "%s(CCrsrHandle **%p) {\n", field_name, ccrsr)); + iprintf ((o_fp, "%s(CCrsrHandle **%p) {\n", field_name.c_str(), ccrsr)); indent += 2; iprintf ((o_fp, "crsrType 0x%hx;\n", CW (x->crsrType))); if (x->crsrMap @@ -854,19 +856,19 @@ dump_ccrsr (CCrsrHandle ccrsr) } void -dump_wmgrport (void) +Executor::dump_wmgrport (void) { dump_grafport (MR (WMgrPort)); } void -dump_wmgrcport (void) +Executor::dump_wmgrcport (void) { dump_grafport ((GrafPtr) MR (WMgrCPort)); } void -dump_string_handle (StringHandle sh) +Executor::dump_string_handle (StringHandle sh) { /* pascal string */ unsigned char *s, t[256]; @@ -878,13 +880,13 @@ dump_string_handle (StringHandle sh) strncpy ((char *) t, (char *) &s[1], len); t[len] = '\0'; iprintf ((o_fp, "%s %p[%d] \"%s\";\n", - field_name, sh, size, t)); + field_name.c_str(), sh, size, t)); } void -dump_window_peek (WindowPeek w) +Executor::dump_window_peek (WindowPeek w) { - iprintf ((o_fp, "%s(WindowPeek %p) {\n", field_name, w)); + iprintf ((o_fp, "%s(WindowPeek %p) {\n", field_name.c_str(), w)); indent += 2; dump_field (dump_grafport, WINDOW_PORT (w), "port"); @@ -915,9 +917,9 @@ dump_window_peek (WindowPeek w) } void -dump_dialog_peek (DialogPeek d) +Executor::dump_dialog_peek (DialogPeek d) { - iprintf ((o_fp, "%s(DialogPeek %p) {\n", field_name, d)); + iprintf ((o_fp, "%s(DialogPeek %p) {\n", field_name.c_str(), d)); indent += 2; dump_field (dump_window_peek, (WindowPeek) DIALOG_WINDOW (d), "window"); @@ -958,7 +960,7 @@ dump_dialog_items (DialogPeek dp) } void -dump_aux_win_list (void) +Executor::dump_aux_win_list (void) { AuxWinHandle t; @@ -969,11 +971,11 @@ dump_aux_win_list (void) } void -dump_aux_win (AuxWinHandle awh) +Executor::dump_aux_win (AuxWinHandle awh) { AuxWinPtr aw = deref (awh); - iprintf ((o_fp, "%s(AuxWinHandle **%p) {\n", field_name, awh)); + iprintf ((o_fp, "%s(AuxWinHandle **%p) {\n", field_name.c_str(), awh)); indent += 2; iprintf ((o_fp, "awNext %p;\n", MR (aw->awNext))); iprintf ((o_fp, "awOwner %p;\n", MR (aw->awOwner))); @@ -988,7 +990,7 @@ dump_aux_win (AuxWinHandle awh) } void -dump_window_list (WindowPeek w) +Executor::dump_window_list (WindowPeek w) { WindowPeek t_w; WindowPeek front_w; @@ -1010,11 +1012,11 @@ dump_window_list (WindowPeek w) } void -dump_rgn (RgnHandle rgn) +Executor::dump_rgn (RgnHandle rgn) { RgnPtr x; - iprintf ((o_fp, "%s(RgnHandle **%p) {\n", field_name, rgn)); indent += 2; + iprintf ((o_fp, "%s(RgnHandle **%p) {\n", field_name.c_str(), rgn)); indent += 2; x = deref (rgn); iprintf ((o_fp, "rgnSize %d\n", CW (x->rgnSize))); dump_field (dump_rect, &x->rgnBBox, "rgnBBox"); @@ -1026,7 +1028,7 @@ void dump_menu_info (MenuHandle x) { dump_field (dump_handle, x, "MenuHandle"); - iprintf ((o_fp, "%s(MenuHandle **%p) {\n", field_name, x)); + iprintf ((o_fp, "%s(MenuHandle **%p) {\n", field_name.c_str(), x)); indent += 2; iprintf ((o_fp, "menuID %d\n", MI_ID (x))); iprintf ((o_fp, "menuWidth %d\n", MI_WIDTH (x))); @@ -1075,7 +1077,7 @@ dump_control_list (WindowPeek w) void dump_control (ControlHandle x) { - iprintf ((o_fp, "%s(ControlHandle **%p) {\n", field_name, x)); + iprintf ((o_fp, "%s(ControlHandle **%p) {\n", field_name.c_str(), x)); indent += 2; dump_field (dump_handle, CTL_NEXT_CONTROL (x), "nextControl"); @@ -1111,17 +1113,17 @@ dump_memlocs( uint32 to_look_for, int size, const void *start_addr, switch (size) { case 1: - for (ucp = start_addr; ucp < (uint8 *) end_addr; ++ucp) + for (ucp = (const uint8*)start_addr; ucp < (uint8 *) end_addr; ++ucp) if (*ucp == (uint8) to_look_for) iprintf ((o_fp, "%p\n", ucp)); break; case 2: - for (usp = start_addr; usp < (uint16 *) end_addr; ++usp) + for (usp = (const uint16*)start_addr; usp < (uint16 *) end_addr; ++usp) if (*usp == (uint16) to_look_for) iprintf ((o_fp, "%p\n", usp)); break; case 4: - for (ulp = start_addr; ulp < (uint32 *) end_addr; + for (ulp = (const uint32*)start_addr; ulp < (uint32 *) end_addr; ulp = (const uint32 *) ((char *)ulp + 2)) if (*ulp == to_look_for) iprintf ((o_fp, "%p\n", ulp)); @@ -1137,7 +1139,7 @@ dump_te (TEHandle te) { int i; - iprintf ((o_fp, "%s(TEHandle **%p) {\n", field_name, te)); + iprintf ((o_fp, "%s(TEHandle **%p) {\n", field_name.c_str(), te)); indent += 2; dump_field (dump_rect, &TE_DEST_RECT (te), "destRect"); diff --git a/src/edition.c b/src/edition.cpp similarity index 99% rename from src/edition.c rename to src/edition.cpp index 6d34776e..adf15bcc 100644 --- a/src/edition.c +++ b/src/edition.cpp @@ -11,6 +11,8 @@ char ROMlib_rcsid_edition[] = #include "EditionMgr.h" +using namespace Executor; + P1 (PUBLIC pascal trap, OSErr, InitEditionPack, INTEGER, unused) { warning_unimplemented ("someone is calling the edition manager"); diff --git a/src/emustubs.c b/src/emustubs.cpp similarity index 99% rename from src/emustubs.c rename to src/emustubs.cpp index e7586ebc..cf7200e1 100644 --- a/src/emustubs.c +++ b/src/emustubs.cpp @@ -66,6 +66,8 @@ char ROMlib_rcsid_emustubs[] = #include "rsys/cfm.h" #include "rsys/mixed_mode.h" +namespace Executor { + #define PUBLIC #undef PRIVATE #define PRIVATE static @@ -333,12 +335,14 @@ typedef struct } selectorblock_t; #define do_selector_block(sbp, sel, trap) \ - ({ _do_selector_block (sbp, sel, # trap, _ ## trap); }) + ({ _do_selector_block (sbp, sel, (char*) # trap, _ ## trap); }) + +typedef syn68k_addr_t (*trap_stuff) (syn68k_addr_t, void **); PRIVATE syn68k_addr_t _do_selector_block (const selectorblock_t *sbp, unsigned long sel, char *trap_name, - syn68k_addr_t (*trap_fp) (syn68k_addr_t, void **)) + trap_stuff trap_fp) { char done; ptocblock_t *ptocp; @@ -400,9 +404,9 @@ _do_selector_table (uint32 selector, abort (); } -#define PTOCBLOCK(name) { C_ ## name, PTOC_ ##name } +#define PTOCBLOCK(name) { (void*)C_ ## name, PTOC_ ##name } -#define C_ZERO ((void *) 0) +#define C_ZERO (nullptr) #define PTOC_ZERO (0) PRIVATE ptocblock_t scriptptoc0[] = @@ -549,7 +553,7 @@ STUB (ScriptUtil) sel2 = POPUW(); PUSHADDR(retaddr); - retval = do_selector_block (textutils_block, sel2, ScriptUtil); + retval = do_selector_block(textutils_block, sel2, ScriptUtil); } else { @@ -559,7 +563,7 @@ STUB (ScriptUtil) low_selector_byte = selector & 0xFF; - retval = do_selector_block ((use_high_table_p + retval = do_selector_block((use_high_table_p ? high_scriptutil_block : scriptutil_block), low_selector_byte, @@ -858,9 +862,12 @@ STUB(Dequeue) \ uw = EM_D1 << 8; \ uw |= cpu_state.regs[2].uw.n; \ - EM_D0 = (KeyTrans((void *) 0, uw, (LONGINT *) 0) >> 16) & 0xFF; \ + EM_D0 = (KeyTrans(NULL, uw, (LONGINT *) 0) >> 16) & 0xFF; \ RTS(); +STUB(Key1Trans); +STUB(Key2Trans); + STUB(Key1Trans) { KEYTRANSMACRO(); @@ -1219,12 +1226,15 @@ STUB (Pack8) pack8_fail_fn, Pack8); } +} P0 (PUBLIC pascal, void, pack8_unknown_selector) { do_selector_error (EM_D0 & 0xFFFF, "Pack8", _Pack8); } +namespace Executor { + PRIVATE ptocblock_t pack12ptoc[] = { PTOCBLOCK (Fix2SmallFract), /* 1 */ @@ -2570,8 +2580,8 @@ STUB (InitZone) initzonehiddenargs_t *ip; ip = (initzonehiddenargs_t *) SYN68K_TO_US(EM_A0); - InitZone (MR (ip->pGrowZone), CW (ip->cMoreMasters), - MR (ip->limitPtr), MR (ip->startPtr)); + InitZone ((ProcPtr)MR (ip->pGrowZone), CW (ip->cMoreMasters), + (Ptr)MR (ip->limitPtr), (THz)MR (ip->startPtr)); EM_D0 = CW (MemErr); RTS (); } @@ -3197,4 +3207,6 @@ STUB (MixedMode) return do_selector_block (mixed_modedispatch_block, EM_D0 & 0xF, MixedMode); } + #endif +} \ No newline at end of file diff --git a/src/emutrap.c b/src/emutrap.cpp similarity index 98% rename from src/emutrap.c rename to src/emutrap.cpp index ef089494..e4762ca7 100644 --- a/src/emutrap.c +++ b/src/emutrap.cpp @@ -13,6 +13,8 @@ char ROMlib_rcsid_emutrap[] = #include "rsys/trapglue.h" #include "rsys/mixed_mode.h" +using namespace Executor; + /* * NOTE: the code below is "mostly" portable. It relies on all arguments * being passed in the same size (we don't ever pass doubles or @@ -61,7 +63,7 @@ char ROMlib_rcsid_emutrap[] = ((long) __t == -1) ? (int32) -1 : US_TO_SYN68K_CHECK0(__t); \ }) -PUBLIC syn68k_addr_t PascalToCCall(syn68k_addr_t ignoreme, ptocblock_t *infop) +PUBLIC syn68k_addr_t Executor::PascalToCCall(syn68k_addr_t ignoreme, ptocblock_t *infop) { unsigned short pth, ptv; LONGINT args[11], retval; @@ -486,7 +488,7 @@ is_routine_descriptor_ptr (uint16 *addr) } #endif -PUBLIC long CToPascalCall(void *wheretogo, unsigned long magic_in, ...) +PUBLIC long Executor::CToPascalCall(void *wheretogo, unsigned long magic_in, ...) { va_list ap; LONGINT retval; diff --git a/src/emutraptables.c b/src/emutraptables.c deleted file mode 100644 index 06b2a813..00000000 --- a/src/emutraptables.c +++ /dev/null @@ -1,1746 +0,0 @@ -/* Copyright 1994, 1995, 1996 by Abacus Research and - * Development, Inc. All rights reserved. - */ - -#if !defined (OMIT_RCSID_STRINGS) -char ROMlib_rcsid_emutraptables[] = - "$Id: emutraptables.c 63 2004-12-24 18:19:43Z ctm $"; -#endif - -#include "rsys/common.h" -#include "rsys/everything.h" - -#include "OSUtil.h" -#include "Gestalt.h" -#include "SysErr.h" - -#include "rsys/trapglue.h" -#include "rsys/ptocflags.h" -#include "rsys/stdfile.h" -#include "rsys/tesave.h" -#include "rsys/resource.h" -#include "rsys/ctl.h" -#include "rsys/list.h" -#include "rsys/menu.h" -#include "rsys/wind.h" -#include "rsys/print.h" -#include "rsys/osutil.h" -#include "rsys/vbl.h" -#include "rsys/soundopts.h" -#include "rsys/refresh.h" -#include "rsys/gestalt.h" -#include "rsys/emustubs.h" - -void *tooltraptable[0x400]; /* Gets filled in at run time */ -void *ostraptable[0x100]; /* Gets filled in at run time */ - -#define C_Pack9 (void *) _Unimplemented /* PPCBrowser */ -#define PTOC_Pack9 -1 -#define C_Pack10 (void *) _Unimplemented -#define PTOC_Pack10 -1 - -#define C_Pack13 (void *) _Unimplemented /* DB stuff */ -#define PTOC_Pack13 -1 -#define C_Pack1 (void *) _Unimplemented -#define PTOC_Pack1 -1 -#define C_Chain (void *) _Unimplemented -#define PTOC_Chain -1 - -#define _AddDrive _Unimplemented -#define _RDrvrInstall _Unimplemented -/* #define _IMVI_ReadXPRam _Unimplemented */ -#define _IMVI_WriteXPRam _Unimplemented -#define _IMVI_MemoryDispatch _Unimplemented -/* #define _SlotManager _Unimplemented */ -/* #define _SlotVInstall _Unimplemented */ -/* #define _SlotVRemove _Unimplemented */ -#define _AttachVBL _Unimplemented -#define _DoVBLTask _Unimplemented -#define _DTInstall _Unimplemented -#define _SIntRemove _Unimplemented -#define _InternalWait _Unimplemented -#define _SIntInstall _Unimplemented -#define _IMVI_IdleUpdate _Unimplemented -#define _IMVI_SlpQInstall _Unimplemented -#define _IMVI_DebugUtil _Unimplemented -#define _IMVI_DeferUserFn _Unimplemented -#define _IMVI_Translate24To32 _Unimplemented - -#define _GetMaskTable _Unimplemented -#define _Debugger _Unimplemented -#define _DebugStr _Unimplemented - - -void C_unknown574 (void) -{ -} - -toolstuff_t toolstuff[0x400] = { - { { _SoundDispatch, -1 }, (void *) 0 }, - { { C_SndDisposeChannel, PTOC_SndDisposeChannel }, (void *) 0 }, - { { C_SndAddModifier, PTOC_SndAddModifier }, (void *) 0 }, - { { C_SndDoCommand, PTOC_SndDoCommand }, (void *) 0 }, - { { C_SndDoImmediate, PTOC_SndDoImmediate }, (void *) 0 }, - { { C_SndPlay, PTOC_SndPlay }, (void *) 0 }, - { { C_SndControl, PTOC_SndControl }, (void *) 0 }, - { { C_SndNewChannel, PTOC_SndNewChannel }, (void *) 0 }, - { { C_InitProcMenu, PTOC_InitProcMenu }, (void *) 0 }, - { { C_GetCVariant, PTOC_GetCVariant }, (void *) 0 }, - { { C_GetWVariant, PTOC_GetWVariant }, (void *) 0 }, - { { C_PopUpMenuSelect, PTOC_PopUpMenuSelect }, (void *) 0 }, - { { C_RGetResource, PTOC_RGetResource }, (void *) 0 }, - { { C_Count1Resources, PTOC_Count1Resources }, (void *) 0 }, - { { C_Get1IndResource, PTOC_Get1IndResource }, (void *) 0 }, - { { C_Get1IndType, PTOC_Get1IndType }, (void *) 0 }, - { { C_Unique1ID, PTOC_Unique1ID }, (void *) 0 }, - { { C_TESelView, PTOC_TESelView }, (void *) 0 }, - { { C_TEPinScroll, PTOC_TEPinScroll }, (void *) 0 }, - { { C_TEAutoView, PTOC_TEAutoView }, (void *) 0 }, - { { C_SetFractEnable, PTOC_SetFractEnable }, (void *) 0 }, - { { _SCSIDispatch, -1 }, (void *) 0 }, - { { _Pack8, -1 }, (void *) 0 }, - { { C_CopyMask, PTOC_CopyMask }, (void *) 0 }, - { { C_FixAtan2, PTOC_FixAtan2 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_HOpenResFile, PTOC_HOpenResFile }, (void *) 0 }, - { { C_HCreateResFile, PTOC_HCreateResFile }, (void *) 0 }, - { { C_Count1Types, PTOC_Count1Types }, (void *) 0 }, - { { C_InvalMenuBar, PTOC_InvalMenuBar }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_Get1Resource, PTOC_Get1Resource }, (void *) 0 }, - { { C_Get1NamedResource, PTOC_Get1NamedResource }, (void *) 0 }, - { { C_MaxSizeRsrc, PTOC_MaxSizeRsrc }, (void *) 0 }, - { { _ResourceDispatch, -1 }, (void *) 0 }, - { { _AliasDispatch, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_InsMenuItem, PTOC_InsMenuItem }, (void *) 0 }, - { { C_HideDItem, PTOC_HideDItem }, (void *) 0 }, - { { C_ShowDItem, PTOC_ShowDItem }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_Pack9, PTOC_Pack9 }, (void *) 0 }, - { { C_Pack10, PTOC_Pack10 }, (void *) 0 }, - { { _Pack11, -1 }, (void *) 0 }, - { { _Pack12, -1 }, (void *) 0 }, - { { C_Pack13, PTOC_Pack13 }, (void *) 0 }, - { { _Pack14, -1 }, (void *) 0 }, - { { _Pack15, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_SetFScaleDisable, PTOC_SetFScaleDisable }, (void *) 0 }, - { { C_FontMetrics, PTOC_FontMetrics }, (void *) 0 }, - { { _GetMaskTable, -1 }, (void *) 0 }, - { { C_MeasureText, PTOC_MeasureText }, (void *) 0 }, - { { C_CalcMask, PTOC_CalcMask }, (void *) 0 }, - { { C_SeedFill, PTOC_SeedFill }, (void *) 0 }, - { { C_ZoomWindow, PTOC_ZoomWindow }, (void *) 0 }, - { { C_TrackBox, PTOC_TrackBox }, (void *) 0 }, - { { C_TEGetOffset, PTOC_TEGetOffset }, (void *) 0 }, - { { _TEDispatch, -1 }, (void *) 0 }, - { { C_TEStylNew, PTOC_TEStylNew }, (void *) 0 }, - { { C_Long2Fix, PTOC_Long2Fix }, (void *) 0 }, - { { C_Fix2Long, PTOC_Fix2Long }, (void *) 0 }, - { { C_Fix2Frac, PTOC_Fix2Frac }, (void *) 0 }, - { { C_Frac2Fix, PTOC_Frac2Fix }, (void *) 0 }, - { { _Fix2X, -1 }, (void *) 0 }, - { { C_R_X2Fix, PTOC_R_X2Fix }, (void *) 0 }, - { { _Frac2X, -1 }, (void *) 0 }, - { { C_R_X2Frac, PTOC_R_X2Frac }, (void *) 0 }, - { { C_FracCos, PTOC_FracCos }, (void *) 0 }, - { { C_FracSin, PTOC_FracSin }, (void *) 0 }, - { { C_FracSqrt, PTOC_FracSqrt }, (void *) 0 }, - { { C_FracMul, PTOC_FracMul }, (void *) 0 }, - { { C_FracDiv, PTOC_FracDiv }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_FixDiv, PTOC_FixDiv }, (void *) 0 }, - { { C_GetItemCmd, PTOC_GetItemCmd }, (void *) 0 }, - { { C_SetItemCmd, PTOC_SetItemCmd }, (void *) 0 }, - { { C_InitCursor, PTOC_InitCursor }, (void *) 0 }, - { { C_SetCursor, PTOC_SetCursor }, (void *) 0 }, - { { C_HideCursor, PTOC_HideCursor }, (void *) 0 }, - { { C_ShowCursor, PTOC_ShowCursor }, (void *) 0 }, - { { _FontDispatch, -1 }, (void *) 0 }, - { { C_ShieldCursor, PTOC_ShieldCursor }, (void *) 0 }, - { { C_ObscureCursor, PTOC_ObscureCursor }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_BitAnd, PTOC_BitAnd }, (void *) 0 }, - { { C_BitXor, PTOC_BitXor }, (void *) 0 }, - { { C_BitNot, PTOC_BitNot }, (void *) 0 }, - { { C_BitOr, PTOC_BitOr }, (void *) 0 }, - { { C_BitShift, PTOC_BitShift }, (void *) 0 }, - { { C_BitTst, PTOC_BitTst }, (void *) 0 }, - { { C_BitSet, PTOC_BitSet }, (void *) 0 }, - { { C_BitClr, PTOC_BitClr }, (void *) 0 }, - { { C_WaitNextEvent, PTOC_WaitNextEvent }, (void *) 0 }, - { { C_Random, PTOC_Random }, (void *) 0 }, - { { C_ForeColor, PTOC_ForeColor }, (void *) 0 }, - { { C_BackColor, PTOC_BackColor }, (void *) 0 }, - { { C_ColorBit, PTOC_ColorBit }, (void *) 0 }, - { { C_GetPixel, PTOC_GetPixel }, (void *) 0 }, - { { C_StuffHex, PTOC_StuffHex }, (void *) 0 }, - { { C_LongMul, PTOC_LongMul }, (void *) 0 }, - { { C_FixMul, PTOC_FixMul }, (void *) 0 }, - { { C_FixRatio, PTOC_FixRatio }, (void *) 0 }, - { { C_HiWord, PTOC_HiWord }, (void *) 0 }, - { { C_LoWord, PTOC_LoWord }, (void *) 0 }, - { { C_FixRound, PTOC_FixRound }, (void *) 0 }, - { { C_InitPort, PTOC_InitPort }, (void *) 0 }, - { { C_InitGraf, PTOC_InitGraf }, (void *) 0 }, - { { C_OpenPort, PTOC_OpenPort }, (void *) 0 }, - { { C_LocalToGlobal, PTOC_LocalToGlobal }, (void *) 0 }, - { { C_GlobalToLocal, PTOC_GlobalToLocal }, (void *) 0 }, - { { C_GrafDevice, PTOC_GrafDevice }, (void *) 0 }, - { { C_SetPort, PTOC_SetPort }, (void *) 0 }, - { { C_GetPort, PTOC_GetPort }, (void *) 0 }, - { { C_SetPortBits, PTOC_SetPortBits }, (void *) 0 }, - { { C_PortSize, PTOC_PortSize }, (void *) 0 }, - { { C_MovePortTo, PTOC_MovePortTo }, (void *) 0 }, - { { C_SetOrigin, PTOC_SetOrigin }, (void *) 0 }, - { { C_SetClip, PTOC_SetClip }, (void *) 0 }, - { { C_GetClip, PTOC_GetClip }, (void *) 0 }, - { { C_ClipRect, PTOC_ClipRect }, (void *) 0 }, - { { C_BackPat, PTOC_BackPat }, (void *) 0 }, - { { C_ClosePort, PTOC_ClosePort }, (void *) 0 }, - { { C_AddPt, PTOC_AddPt }, (void *) 0 }, - { { C_SubPt, PTOC_SubPt }, (void *) 0 }, - { { C_SetPt, PTOC_SetPt }, (void *) 0 }, - { { C_EqualPt, PTOC_EqualPt }, (void *) 0 }, - { { C_StdText, PTOC_StdText }, (void *) 0 }, - { { C_DrawChar, PTOC_DrawChar }, (void *) 0 }, - { { C_DrawString, PTOC_DrawString }, (void *) 0 }, - { { C_DrawText, PTOC_DrawText }, (void *) 0 }, - { { C_TextWidth, PTOC_TextWidth }, (void *) 0 }, - { { C_TextFont, PTOC_TextFont }, (void *) 0 }, - { { C_TextFace, PTOC_TextFace }, (void *) 0 }, - { { C_TextMode, PTOC_TextMode }, (void *) 0 }, - { { C_TextSize, PTOC_TextSize }, (void *) 0 }, - { { C_GetFontInfo, PTOC_GetFontInfo }, (void *) 0 }, - { { C_StringWidth, PTOC_StringWidth }, (void *) 0 }, - { { C_CharWidth, PTOC_CharWidth }, (void *) 0 }, - { { C_SpaceExtra, PTOC_SpaceExtra }, (void *) 0 }, - { { _OSDispatch, -1 }, (void *) 0 }, - { { C_StdLine, PTOC_StdLine }, (void *) 0 }, - { { C_LineTo, PTOC_LineTo }, (void *) 0 }, - { { C_Line, PTOC_Line }, (void *) 0 }, - { { C_MoveTo, PTOC_MoveTo }, (void *) 0 }, - { { C_Move, PTOC_Move }, (void *) 0 }, - { { _ShutDown, -1 }, (void *) 0 }, - { { C_HidePen, PTOC_HidePen }, (void *) 0 }, - { { C_ShowPen, PTOC_ShowPen }, (void *) 0 }, - { { C_GetPenState, PTOC_GetPenState }, (void *) 0 }, - { { C_SetPenState, PTOC_SetPenState }, (void *) 0 }, - { { C_GetPen, PTOC_GetPen }, (void *) 0 }, - { { C_PenSize, PTOC_PenSize }, (void *) 0 }, - { { C_PenMode, PTOC_PenMode }, (void *) 0 }, - { { C_PenPat, PTOC_PenPat }, (void *) 0 }, - { { C_PenNormal, PTOC_PenNormal }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_StdRect, PTOC_StdRect }, (void *) 0 }, - { { C_FrameRect, PTOC_FrameRect }, (void *) 0 }, - { { C_PaintRect, PTOC_PaintRect }, (void *) 0 }, - { { C_EraseRect, PTOC_EraseRect }, (void *) 0 }, - { { C_InvertRect, PTOC_InvertRect }, (void *) 0 }, - { { C_FillRect, PTOC_FillRect }, (void *) 0 }, - { { C_EqualRect, PTOC_EqualRect }, (void *) 0 }, - { { C_SetRect, PTOC_SetRect }, (void *) 0 }, - { { C_OffsetRect, PTOC_OffsetRect }, (void *) 0 }, - { { C_InsetRect, PTOC_InsetRect }, (void *) 0 }, - { { C_SectRect, PTOC_SectRect }, (void *) 0 }, - { { C_UnionRect, PTOC_UnionRect }, (void *) 0 }, - { { C_Pt2Rect, PTOC_Pt2Rect }, (void *) 0 }, - { { C_PtInRect, PTOC_PtInRect }, (void *) 0 }, - { { C_EmptyRect, PTOC_EmptyRect }, (void *) 0 }, - { { C_StdRRect, PTOC_StdRRect }, (void *) 0 }, - { { C_FrameRoundRect, PTOC_FrameRoundRect }, (void *) 0 }, - { { C_PaintRoundRect, PTOC_PaintRoundRect }, (void *) 0 }, - { { C_EraseRoundRect, PTOC_EraseRoundRect }, (void *) 0 }, - { { C_InvertRoundRect, PTOC_InvertRoundRect }, (void *) 0 }, - { { C_FillRoundRect, PTOC_FillRoundRect }, (void *) 0 }, - { { _ScriptUtil, -1 }, (void *) 0 }, - { { C_StdOval, PTOC_StdOval }, (void *) 0 }, - { { C_FrameOval, PTOC_FrameOval }, (void *) 0 }, - { { C_PaintOval, PTOC_PaintOval }, (void *) 0 }, - { { C_EraseOval, PTOC_EraseOval }, (void *) 0 }, - { { C_InvertOval, PTOC_InvertOval }, (void *) 0 }, - { { C_FillOval, PTOC_FillOval }, (void *) 0 }, - { { C_SlopeFromAngle, PTOC_SlopeFromAngle }, (void *) 0 }, - { { C_StdArc, PTOC_StdArc }, (void *) 0 }, - { { C_FrameArc, PTOC_FrameArc }, (void *) 0 }, - { { C_PaintArc, PTOC_PaintArc }, (void *) 0 }, - { { C_EraseArc, PTOC_EraseArc }, (void *) 0 }, - { { C_InvertArc, PTOC_InvertArc }, (void *) 0 }, - { { C_FillArc, PTOC_FillArc }, (void *) 0 }, - { { C_PtToAngle, PTOC_PtToAngle }, (void *) 0 }, - { { C_AngleFromSlope, PTOC_AngleFromSlope }, (void *) 0 }, - { { C_StdPoly, PTOC_StdPoly }, (void *) 0 }, - { { C_FramePoly, PTOC_FramePoly }, (void *) 0 }, - { { C_PaintPoly, PTOC_PaintPoly }, (void *) 0 }, - { { C_ErasePoly, PTOC_ErasePoly }, (void *) 0 }, - { { C_InvertPoly, PTOC_InvertPoly }, (void *) 0 }, - { { C_FillPoly, PTOC_FillPoly }, (void *) 0 }, - { { C_OpenPoly, PTOC_OpenPoly }, (void *) 0 }, - { { C_ClosePoly, PTOC_ClosePoly }, (void *) 0 }, - { { C_KillPoly, PTOC_KillPoly }, (void *) 0 }, - { { C_OffsetPoly, PTOC_OffsetPoly }, (void *) 0 }, - { { C_PackBits, PTOC_PackBits }, (void *) 0 }, - { { C_UnpackBits, PTOC_UnpackBits }, (void *) 0 }, - { { C_StdRgn, PTOC_StdRgn }, (void *) 0 }, - { { C_FrameRgn, PTOC_FrameRgn }, (void *) 0 }, - { { C_PaintRgn, PTOC_PaintRgn }, (void *) 0 }, - { { C_EraseRgn, PTOC_EraseRgn }, (void *) 0 }, - { { C_InvertRgn, PTOC_InvertRgn }, (void *) 0 }, - { { C_FillRgn, PTOC_FillRgn }, (void *) 0 }, - { { C_BitMapToRegion, PTOC_BitMapToRegion }, (void *) 0 }, - { { C_NewRgn, PTOC_NewRgn }, (void *) 0 }, - { { C_DisposeRgn, PTOC_DisposeRgn }, (void *) 0 }, - { { C_OpenRgn, PTOC_OpenRgn }, (void *) 0 }, - { { C_CloseRgn, PTOC_CloseRgn }, (void *) 0 }, - { { C_CopyRgn, PTOC_CopyRgn }, (void *) 0 }, - { { C_SetEmptyRgn, PTOC_SetEmptyRgn }, (void *) 0 }, - { { C_SetRectRgn, PTOC_SetRectRgn }, (void *) 0 }, - { { C_RectRgn, PTOC_RectRgn }, (void *) 0 }, - { { C_OffsetRgn, PTOC_OffsetRgn }, (void *) 0 }, - { { C_InsetRgn, PTOC_InsetRgn }, (void *) 0 }, - { { C_EmptyRgn, PTOC_EmptyRgn }, (void *) 0 }, - { { C_EqualRgn, PTOC_EqualRgn }, (void *) 0 }, - { { C_SectRgn, PTOC_SectRgn }, (void *) 0 }, - { { C_UnionRgn, PTOC_UnionRgn }, (void *) 0 }, - { { C_DiffRgn, PTOC_DiffRgn }, (void *) 0 }, - { { C_XorRgn, PTOC_XorRgn }, (void *) 0 }, - { { C_PtInRgn, PTOC_PtInRgn }, (void *) 0 }, - { { C_RectInRgn, PTOC_RectInRgn }, (void *) 0 }, - { { C_SetStdProcs, PTOC_SetStdProcs }, (void *) 0 }, - { { C_StdBits, PTOC_StdBits }, (void *) 0 }, - { { C_CopyBits, PTOC_CopyBits }, (void *) 0 }, - { { C_StdTxMeas, PTOC_StdTxMeas }, (void *) 0 }, - { { C_StdGetPic, PTOC_StdGetPic }, (void *) 0 }, - { { C_ScrollRect, PTOC_ScrollRect }, (void *) 0 }, - { { C_StdPutPic, PTOC_StdPutPic }, (void *) 0 }, - { { C_StdComment, PTOC_StdComment }, (void *) 0 }, - { { C_PicComment, PTOC_PicComment }, (void *) 0 }, - { { C_OpenPicture, PTOC_OpenPicture }, (void *) 0 }, - { { C_ClosePicture, PTOC_ClosePicture }, (void *) 0 }, - { { C_KillPicture, PTOC_KillPicture }, (void *) 0 }, - { { C_DrawPicture, PTOC_DrawPicture }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_ScalePt, PTOC_ScalePt }, (void *) 0 }, - { { C_MapPt, PTOC_MapPt }, (void *) 0 }, - { { C_MapRect, PTOC_MapRect }, (void *) 0 }, - { { C_MapRgn, PTOC_MapRgn }, (void *) 0 }, - { { C_MapPoly, PTOC_MapPoly }, (void *) 0 }, - { { _PrGlue, -1 }, (void *) 0 }, - { { C_InitFonts, PTOC_InitFonts }, (void *) 0 }, - { { C_GetFontName, PTOC_GetFontName }, (void *) 0 }, - { { C_GetFNum, PTOC_GetFNum }, (void *) 0 }, - { { C_FMSwapFont, PTOC_FMSwapFont }, (void *) 0 }, - { { C_RealFont, PTOC_RealFont }, (void *) 0 }, - { { C_SetFontLock, PTOC_SetFontLock }, (void *) 0 }, - { { C_DrawGrowIcon, PTOC_DrawGrowIcon }, (void *) 0 }, - { { C_DragGrayRgn, PTOC_DragGrayRgn }, (void *) 0 }, - { { C_NewString, PTOC_NewString }, (void *) 0 }, - { { C_SetString, PTOC_SetString }, (void *) 0 }, - { { C_ShowHide, PTOC_ShowHide }, (void *) 0 }, - { { C_CalcVis, PTOC_CalcVis }, (void *) 0 }, - { { C_CalcVisBehind, PTOC_CalcVisBehind }, (void *) 0 }, - { { C_ClipAbove, PTOC_ClipAbove }, (void *) 0 }, - { { C_PaintOne, PTOC_PaintOne }, (void *) 0 }, - { { C_PaintBehind, PTOC_PaintBehind }, (void *) 0 }, - { { C_SaveOld, PTOC_SaveOld }, (void *) 0 }, - { { C_DrawNew, PTOC_DrawNew }, (void *) 0 }, - { { C_GetWMgrPort, PTOC_GetWMgrPort }, (void *) 0 }, - { { C_CheckUpdate, PTOC_CheckUpdate }, (void *) 0 }, - { { C_InitWindows, PTOC_InitWindows }, (void *) 0 }, - { { C_NewWindow, PTOC_NewWindow }, (void *) 0 }, - { { C_DisposeWindow, PTOC_DisposeWindow }, (void *) 0 }, - { { C_ShowWindow, PTOC_ShowWindow }, (void *) 0 }, - { { C_HideWindow, PTOC_HideWindow }, (void *) 0 }, - { { C_GetWRefCon, PTOC_GetWRefCon }, (void *) 0 }, - { { C_SetWRefCon, PTOC_SetWRefCon }, (void *) 0 }, - { { C_GetWTitle, PTOC_GetWTitle }, (void *) 0 }, - { { C_SetWTitle, PTOC_SetWTitle }, (void *) 0 }, - { { C_MoveWindow, PTOC_MoveWindow }, (void *) 0 }, - { { C_HiliteWindow, PTOC_HiliteWindow }, (void *) 0 }, - { { C_SizeWindow, PTOC_SizeWindow }, (void *) 0 }, - { { C_TrackGoAway, PTOC_TrackGoAway }, (void *) 0 }, - { { C_SelectWindow, PTOC_SelectWindow }, (void *) 0 }, - { { C_BringToFront, PTOC_BringToFront }, (void *) 0 }, - { { C_SendBehind, PTOC_SendBehind }, (void *) 0 }, - { { C_BeginUpdate, PTOC_BeginUpdate }, (void *) 0 }, - { { C_EndUpdate, PTOC_EndUpdate }, (void *) 0 }, - { { C_FrontWindow, PTOC_FrontWindow }, (void *) 0 }, - { { C_DragWindow, PTOC_DragWindow }, (void *) 0 }, - { { C_DragTheRgn, PTOC_DragTheRgn }, (void *) 0 }, - { { C_InvalRgn, PTOC_InvalRgn }, (void *) 0 }, - { { C_InvalRect, PTOC_InvalRect }, (void *) 0 }, - { { C_ValidRgn, PTOC_ValidRgn }, (void *) 0 }, - { { C_ValidRect, PTOC_ValidRect }, (void *) 0 }, - { { C_GrowWindow, PTOC_GrowWindow }, (void *) 0 }, - { { C_FindWindow, PTOC_FindWindow }, (void *) 0 }, - { { C_CloseWindow, PTOC_CloseWindow }, (void *) 0 }, - { { C_SetWindowPic, PTOC_SetWindowPic }, (void *) 0 }, - { { C_GetWindowPic, PTOC_GetWindowPic }, (void *) 0 }, - { { C_InitMenus, PTOC_InitMenus }, (void *) 0 }, - { { C_NewMenu, PTOC_NewMenu }, (void *) 0 }, - { { C_DisposeMenu, PTOC_DisposeMenu }, (void *) 0 }, - { { C_AppendMenu, PTOC_AppendMenu }, (void *) 0 }, - { { C_ClearMenuBar, PTOC_ClearMenuBar }, (void *) 0 }, - { { C_InsertMenu, PTOC_InsertMenu }, (void *) 0 }, - { { C_DeleteMenu, PTOC_DeleteMenu }, (void *) 0 }, - { { C_DrawMenuBar, PTOC_DrawMenuBar }, (void *) 0 }, - { { C_HiliteMenu, PTOC_HiliteMenu }, (void *) 0 }, - { { C_EnableItem, PTOC_EnableItem }, (void *) 0 }, - { { C_DisableItem, PTOC_DisableItem }, (void *) 0 }, - { { C_GetMenuBar, PTOC_GetMenuBar }, (void *) 0 }, - { { C_SetMenuBar, PTOC_SetMenuBar }, (void *) 0 }, - { { C_MenuSelect, PTOC_MenuSelect }, (void *) 0 }, - { { C_MenuKey, PTOC_MenuKey }, (void *) 0 }, - { { C_GetItemIcon, PTOC_GetItemIcon }, (void *) 0 }, - { { C_SetItemIcon, PTOC_SetItemIcon }, (void *) 0 }, - { { C_GetItemStyle, PTOC_GetItemStyle }, (void *) 0 }, - { { C_SetItemStyle, PTOC_SetItemStyle }, (void *) 0 }, - { { C_GetItemMark, PTOC_GetItemMark }, (void *) 0 }, - { { C_SetItemMark, PTOC_SetItemMark }, (void *) 0 }, - { { C_CheckItem, PTOC_CheckItem }, (void *) 0 }, - { { C_GetItem, PTOC_GetItem }, (void *) 0 }, - { { C_SetItem, PTOC_SetItem }, (void *) 0 }, - { { C_CalcMenuSize, PTOC_CalcMenuSize }, (void *) 0 }, - { { C_GetMHandle, PTOC_GetMHandle }, (void *) 0 }, - { { C_SetMenuFlash, PTOC_SetMenuFlash }, (void *) 0 }, - { { C_PlotIcon, PTOC_PlotIcon }, (void *) 0 }, - { { C_FlashMenuBar, PTOC_FlashMenuBar }, (void *) 0 }, - { { C_AddResMenu, PTOC_AddResMenu }, (void *) 0 }, - { { C_PinRect, PTOC_PinRect }, (void *) 0 }, - { { C_DeltaPoint, PTOC_DeltaPoint }, (void *) 0 }, - { { C_CountMItems, PTOC_CountMItems }, (void *) 0 }, - { { C_InsertResMenu, PTOC_InsertResMenu }, (void *) 0 }, - { { C_DelMenuItem, PTOC_DelMenuItem }, (void *) 0 }, - { { C_UpdtControl, PTOC_UpdtControl }, (void *) 0 }, - { { C_NewControl, PTOC_NewControl }, (void *) 0 }, - { { C_DisposeControl, PTOC_DisposeControl }, (void *) 0 }, - { { C_KillControls, PTOC_KillControls }, (void *) 0 }, - { { C_ShowControl, PTOC_ShowControl }, (void *) 0 }, - { { C_HideControl, PTOC_HideControl }, (void *) 0 }, - { { C_MoveControl, PTOC_MoveControl }, (void *) 0 }, - { { C_GetCRefCon, PTOC_GetCRefCon }, (void *) 0 }, - { { C_SetCRefCon, PTOC_SetCRefCon }, (void *) 0 }, - { { C_SizeControl, PTOC_SizeControl }, (void *) 0 }, - { { C_HiliteControl, PTOC_HiliteControl }, (void *) 0 }, - { { C_GetCTitle, PTOC_GetCTitle }, (void *) 0 }, - { { C_SetCTitle, PTOC_SetCTitle }, (void *) 0 }, - { { C_GetCtlValue, PTOC_GetCtlValue }, (void *) 0 }, - { { C_GetCtlMin, PTOC_GetCtlMin }, (void *) 0 }, - { { C_GetCtlMax, PTOC_GetCtlMax }, (void *) 0 }, - { { C_SetCtlValue, PTOC_SetCtlValue }, (void *) 0 }, - { { C_SetCtlMin, PTOC_SetCtlMin }, (void *) 0 }, - { { C_SetCtlMax, PTOC_SetCtlMax }, (void *) 0 }, - { { C_TestControl, PTOC_TestControl }, (void *) 0 }, - { { C_DragControl, PTOC_DragControl }, (void *) 0 }, - { { C_TrackControl, PTOC_TrackControl }, (void *) 0 }, - { { C_DrawControls, PTOC_DrawControls }, (void *) 0 }, - { { C_GetCtlAction, PTOC_GetCtlAction }, (void *) 0 }, - { { C_SetCtlAction, PTOC_SetCtlAction }, (void *) 0 }, - { { C_FindControl, PTOC_FindControl }, (void *) 0 }, - { { C_Draw1Control, PTOC_Draw1Control }, (void *) 0 }, - { { _Dequeue, -1 }, (void *) 0 }, - { { _Enqueue, -1 }, (void *) 0 }, - { { C_GetNextEvent, PTOC_GetNextEvent }, (void *) 0 }, - { { C_EventAvail, PTOC_EventAvail }, (void *) 0 }, - { { C_GetMouse, PTOC_GetMouse }, (void *) 0 }, - { { C_StillDown, PTOC_StillDown }, (void *) 0 }, - { { C_Button, PTOC_Button }, (void *) 0 }, - { { C_TickCount, PTOC_TickCount }, (void *) 0 }, - { { C_GetKeys, PTOC_GetKeys }, (void *) 0 }, - { { C_WaitMouseUp, PTOC_WaitMouseUp }, (void *) 0 }, - { { C_UpdtDialog, PTOC_UpdtDialog }, (void *) 0 }, - { { C_CouldDialog, PTOC_CouldDialog }, (void *) 0 }, - { { C_FreeDialog, PTOC_FreeDialog }, (void *) 0 }, - { { C_InitDialogs, PTOC_InitDialogs }, (void *) 0 }, - { { C_GetNewDialog, PTOC_GetNewDialog }, (void *) 0 }, - { { C_NewDialog, PTOC_NewDialog }, (void *) 0 }, - { { C_SelIText, PTOC_SelIText }, (void *) 0 }, - { { C_IsDialogEvent, PTOC_IsDialogEvent }, (void *) 0 }, - { { C_DialogSelect, PTOC_DialogSelect }, (void *) 0 }, - { { C_DrawDialog, PTOC_DrawDialog }, (void *) 0 }, - { { C_CloseDialog, PTOC_CloseDialog }, (void *) 0 }, - { { C_DisposDialog, PTOC_DisposDialog }, (void *) 0 }, - { { C_FindDItem, PTOC_FindDItem }, (void *) 0 }, - { { C_Alert, PTOC_Alert }, (void *) 0 }, - { { C_StopAlert, PTOC_StopAlert }, (void *) 0 }, - { { C_NoteAlert, PTOC_NoteAlert }, (void *) 0 }, - { { C_CautionAlert, PTOC_CautionAlert }, (void *) 0 }, - { { C_CouldAlert, PTOC_CouldAlert }, (void *) 0 }, - { { C_FreeAlert, PTOC_FreeAlert }, (void *) 0 }, - { { C_ParamText, PTOC_ParamText }, (void *) 0 }, - { { C_ErrorSound, PTOC_ErrorSound }, (void *) 0 }, - { { C_GetDItem, PTOC_GetDItem }, (void *) 0 }, - { { C_SetDItem, PTOC_SetDItem }, (void *) 0 }, - { { C_SetIText, PTOC_SetIText }, (void *) 0 }, - { { C_GetIText, PTOC_GetIText }, (void *) 0 }, - { { C_ModalDialog, PTOC_ModalDialog }, (void *) 0 }, - { { C_DetachResource, PTOC_DetachResource }, (void *) 0 }, - { { C_SetResPurge, PTOC_SetResPurge }, (void *) 0 }, - { { C_CurResFile, PTOC_CurResFile }, (void *) 0 }, - { { C_InitResources, PTOC_InitResources }, (void *) 0 }, - { { C_RsrcZoneInit, PTOC_RsrcZoneInit }, (void *) 0 }, - { { C_OpenResFile, PTOC_OpenResFile }, (void *) 0 }, - { { C_UseResFile, PTOC_UseResFile }, (void *) 0 }, - { { C_UpdateResFile, PTOC_UpdateResFile }, (void *) 0 }, - { { C_CloseResFile, PTOC_CloseResFile }, (void *) 0 }, - { { C_SetResLoad, PTOC_SetResLoad }, (void *) 0 }, - { { C_CountResources, PTOC_CountResources }, (void *) 0 }, - { { C_GetIndResource, PTOC_GetIndResource }, (void *) 0 }, - { { C_CountTypes, PTOC_CountTypes }, (void *) 0 }, - { { C_GetIndType, PTOC_GetIndType }, (void *) 0 }, - { { __GetResource, -1 }, (void *) 0 }, - { { C_GetNamedResource, PTOC_GetNamedResource }, (void *) 0 }, - { { C_LoadResource, PTOC_LoadResource }, (void *) 0 }, - { { C_ReleaseResource, PTOC_ReleaseResource }, (void *) 0 }, - { { C_HomeResFile, PTOC_HomeResFile }, (void *) 0 }, - { { C_SizeResource, PTOC_SizeResource }, (void *) 0 }, - { { C_GetResAttrs, PTOC_GetResAttrs }, (void *) 0 }, - { { C_SetResAttrs, PTOC_SetResAttrs }, (void *) 0 }, - { { C_GetResInfo, PTOC_GetResInfo }, (void *) 0 }, - { { C_SetResInfo, PTOC_SetResInfo }, (void *) 0 }, - { { C_ChangedResource, PTOC_ChangedResource }, (void *) 0 }, - { { C_AddResource, PTOC_AddResource }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_RmveResource, PTOC_RmveResource }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_ResError, PTOC_ResError }, (void *) 0 }, - { { C_WriteResource, PTOC_WriteResource }, (void *) 0 }, - { { C_CreateResFile, PTOC_CreateResFile }, (void *) 0 }, - { { C_SystemEvent, PTOC_SystemEvent }, (void *) 0 }, - { { C_SystemClick, PTOC_SystemClick }, (void *) 0 }, - { { C_SystemTask, PTOC_SystemTask }, (void *) 0 }, - { { C_SystemMenu, PTOC_SystemMenu }, (void *) 0 }, - { { C_OpenDeskAcc, PTOC_OpenDeskAcc }, (void *) 0 }, - { { C_CloseDeskAcc, PTOC_CloseDeskAcc }, (void *) 0 }, - { { C_GetPattern, PTOC_GetPattern }, (void *) 0 }, - { { C_GetCursor, PTOC_GetCursor }, (void *) 0 }, - { { C_GetString, PTOC_GetString }, (void *) 0 }, - { { C_GetIcon, PTOC_GetIcon }, (void *) 0 }, - { { C_GetPicture, PTOC_GetPicture }, (void *) 0 }, - { { C_GetNewWindow, PTOC_GetNewWindow }, (void *) 0 }, - { { C_GetNewControl, PTOC_GetNewControl }, (void *) 0 }, - { { C_GetMenu, PTOC_GetMenu }, (void *) 0 }, - { { C_GetNewMBar, PTOC_GetNewMBar }, (void *) 0 }, - { { C_UniqueID, PTOC_UniqueID }, (void *) 0 }, - { { C_SystemEdit, PTOC_SystemEdit }, (void *) 0 }, - { { C_KeyTrans, PTOC_KeyTrans }, (void *) 0 }, - { { C_OpenRFPerm, PTOC_OpenRFPerm }, (void *) 0 }, - { { C_RsrcMapEntry, PTOC_RsrcMapEntry }, (void *) 0 }, - { { _Secs2Date, -1 }, (void *) 0 }, - { { _Date2Secs, -1 }, (void *) 0 }, - { { C_SysBeep, PTOC_SysBeep }, (void *) 0 }, - { { C_SysError, PTOC_SysError }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_TEGetText, PTOC_TEGetText }, (void *) 0 }, - { { C_TEInit, PTOC_TEInit }, (void *) 0 }, - { { C_TEDispose, PTOC_TEDispose }, (void *) 0 }, - { { C_TextBox, PTOC_TextBox }, (void *) 0 }, - { { C_TESetText, PTOC_TESetText }, (void *) 0 }, - { { C_TECalText, PTOC_TECalText }, (void *) 0 }, - { { C_TESetSelect, PTOC_TESetSelect }, (void *) 0 }, - { { C_TENew, PTOC_TENew }, (void *) 0 }, - { { C_TEUpdate, PTOC_TEUpdate }, (void *) 0 }, - { { C_TEClick, PTOC_TEClick }, (void *) 0 }, - { { C_TECopy, PTOC_TECopy }, (void *) 0 }, - { { C_TECut, PTOC_TECut }, (void *) 0 }, - { { C_TEDelete, PTOC_TEDelete }, (void *) 0 }, - { { C_TEActivate, PTOC_TEActivate }, (void *) 0 }, - { { C_TEDeactivate, PTOC_TEDeactivate }, (void *) 0 }, - { { C_TEIdle, PTOC_TEIdle }, (void *) 0 }, - { { C_TEPaste, PTOC_TEPaste }, (void *) 0 }, - { { C_TEKey, PTOC_TEKey }, (void *) 0 }, - { { C_TEScroll, PTOC_TEScroll }, (void *) 0 }, - { { C_TEInsert, PTOC_TEInsert }, (void *) 0 }, - { { C_TESetJust, PTOC_TESetJust }, (void *) 0 }, - { { C_Munger, PTOC_Munger }, (void *) 0 }, - { { _HandToHand, -1 }, (void *) 0 }, - { { _PtrToXHand, -1 }, (void *) 0 }, - { { _PtrToHand, -1 }, (void *) 0 }, - { { _HandAndHand, -1 }, (void *) 0 }, - { { C_InitPack, PTOC_InitPack }, (void *) 0 }, - { { C_InitAllPacks, PTOC_InitAllPacks }, (void *) 0 }, - { { _Pack0, -1 }, (void *) 0 }, - { { C_Pack1, PTOC_Pack1 }, (void *) 0 }, - { { _Pack2, -1 }, (void *) 0 }, - { { _Pack3, -1 }, (void *) 0 }, - { { _Pack4, -1 }, (void *) 0 }, - { { _Pack5, -1 }, (void *) 0 }, - { { _Pack6, -1 }, (void *) 0 }, - { { _Pack7, -1 }, (void *) 0 }, - { { _PtrAndHand, -1 }, (void *) 0 }, - { { _LoadSeg, -1 }, (void *) 0 }, - { { C_UnloadSeg, PTOC_UnloadSeg }, (void *) 0 }, - { { _Launch, -1 }, (void *) 0 }, - { { _Chain, -1 }, (void *) 0 }, - { { C_ExitToShell, PTOC_ExitToShell }, (void *) 0 }, - { { C_GetAppParms, PTOC_GetAppParms }, (void *) 0 }, - { { C_GetResFileAttrs, PTOC_GetResFileAttrs }, (void *) 0 }, - { { C_SetResFileAttrs, PTOC_SetResFileAttrs }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_InfoScrap, PTOC_InfoScrap }, (void *) 0 }, - { { C_UnloadScrap, PTOC_UnloadScrap }, (void *) 0 }, - { { C_LoadScrap, PTOC_LoadScrap }, (void *) 0 }, - { { C_ZeroScrap, PTOC_ZeroScrap }, (void *) 0 }, - { { C_GetScrap, PTOC_GetScrap }, (void *) 0 }, - { { C_PutScrap, PTOC_PutScrap }, (void *) 0 }, - { { _Debugger, -1 }, (void *) 0 }, - { { C_OpenCPort, PTOC_OpenCPort }, (void *) 0 }, - { { C_InitCPort, PTOC_InitCPort }, (void *) 0 }, - { { C_CloseCPort, PTOC_CloseCPort }, (void *) 0 }, - { { C_NewPixMap, PTOC_NewPixMap }, (void *) 0 }, - { { C_DisposPixMap, PTOC_DisposPixMap }, (void *) 0 }, - { { C_CopyPixMap, PTOC_CopyPixMap }, (void *) 0 }, - { { C_SetPortPix, PTOC_SetPortPix }, (void *) 0 }, - { { C_NewPixPat, PTOC_NewPixPat }, (void *) 0 }, - { { C_DisposPixPat, PTOC_DisposPixPat }, (void *) 0 }, - { { C_CopyPixPat, PTOC_CopyPixPat }, (void *) 0 }, - { { C_PenPixPat, PTOC_PenPixPat }, (void *) 0 }, - { { C_BackPixPat, PTOC_BackPixPat }, (void *) 0 }, - { { C_GetPixPat, PTOC_GetPixPat }, (void *) 0 }, - { { C_MakeRGBPat, PTOC_MakeRGBPat }, (void *) 0 }, - { { C_FillCRect, PTOC_FillCRect }, (void *) 0 }, - { { C_FillCOval, PTOC_FillCOval }, (void *) 0 }, - { { C_FillCRoundRect, PTOC_FillCRoundRect }, (void *) 0 }, - { { C_FillCArc, PTOC_FillCArc }, (void *) 0 }, - { { C_FillCRgn, PTOC_FillCRgn }, (void *) 0 }, - { { C_FillCPoly, PTOC_FillCPoly }, (void *) 0 }, - { { C_RGBForeColor, PTOC_RGBForeColor }, (void *) 0 }, - { { C_RGBBackColor, PTOC_RGBBackColor }, (void *) 0 }, - { { C_SetCPixel, PTOC_SetCPixel }, (void *) 0 }, - { { C_GetCPixel, PTOC_GetCPixel }, (void *) 0 }, - { { C_GetCTable, PTOC_GetCTable }, (void *) 0 }, - { { C_GetForeColor, PTOC_GetForeColor }, (void *) 0 }, - { { C_GetBackColor, PTOC_GetBackColor }, (void *) 0 }, - { { C_GetCCursor, PTOC_GetCCursor }, (void *) 0 }, - { { C_SetCCursor, PTOC_SetCCursor }, (void *) 0 }, - { { C_AllocCursor, PTOC_AllocCursor }, (void *) 0 }, - { { C_GetCIcon, PTOC_GetCIcon }, (void *) 0 }, - { { C_PlotCIcon, PTOC_PlotCIcon }, (void *) 0 }, - { { C_OpenCPicture, PTOC_OpenCPicture }, (void *) 0 }, - { { C_OpColor, PTOC_OpColor }, (void *) 0 }, - { { C_HiliteColor, PTOC_HiliteColor }, (void *) 0 }, - { { C_CharExtra, PTOC_CharExtra }, (void *) 0 }, - { { C_DisposCTable, PTOC_DisposCTable }, (void *) 0 }, - { { C_DisposeCIcon, PTOC_DisposeCIcon }, (void *) 0 }, - { { C_DisposCCursor, PTOC_DisposCCursor }, (void *) 0 }, - { { C_GetMaxDevice, PTOC_GetMaxDevice }, (void *) 0 }, - { { C_GetCTSeed, PTOC_GetCTSeed }, (void *) 0 }, - { { C_GetDeviceList, PTOC_GetDeviceList }, (void *) 0 }, - { { C_GetMainDevice, PTOC_GetMainDevice }, (void *) 0 }, - { { C_GetNextDevice, PTOC_GetNextDevice }, (void *) 0 }, - { { C_TestDeviceAttribute, PTOC_TestDeviceAttribute }, (void *) 0 }, - { { C_SetDeviceAttribute, PTOC_SetDeviceAttribute }, (void *) 0 }, - { { C_InitGDevice, PTOC_InitGDevice }, (void *) 0 }, - { { C_NewGDevice, PTOC_NewGDevice }, (void *) 0 }, - { { C_DisposGDevice, PTOC_DisposGDevice }, (void *) 0 }, - { { C_SetGDevice, PTOC_SetGDevice }, (void *) 0 }, - { { C_GetGDevice, PTOC_GetGDevice }, (void *) 0 }, - { { C_Color2Index, PTOC_Color2Index }, (void *) 0 }, - { { C_Index2Color, PTOC_Index2Color }, (void *) 0 }, - { { C_InvertColor, PTOC_InvertColor }, (void *) 0 }, - { { C_RealColor, PTOC_RealColor }, (void *) 0 }, - { { C_GetSubTable, PTOC_GetSubTable }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_MakeITable, PTOC_MakeITable }, (void *) 0 }, - { { C_AddSearch, PTOC_AddSearch }, (void *) 0 }, - { { C_AddComp, PTOC_AddComp }, (void *) 0 }, - { { C_SetClientID, PTOC_SetClientID }, (void *) 0 }, - { { C_ProtectEntry, PTOC_ProtectEntry }, (void *) 0 }, - { { C_ReserveEntry, PTOC_ReserveEntry }, (void *) 0 }, - { { C_SetEntries, PTOC_SetEntries }, (void *) 0 }, - { { C_QDError, PTOC_QDError }, (void *) 0 }, - { { C_SetWinColor, PTOC_SetWinColor }, (void *) 0 }, - { { C_GetAuxWin, PTOC_GetAuxWin }, (void *) 0 }, - { { C_SetCtlColor, PTOC_SetCtlColor }, (void *) 0 }, - { { C_GetAuxCtl, PTOC_GetAuxCtl }, (void *) 0 }, - { { C_NewCWindow, PTOC_NewCWindow }, (void *) 0 }, - { { C_GetNewCWindow, PTOC_GetNewCWindow }, (void *) 0 }, - { { C_SetDeskCPat, PTOC_SetDeskCPat }, (void *) 0 }, - { { C_GetCWMgrPort, PTOC_GetCWMgrPort }, (void *) 0 }, - { { C_SaveEntries, PTOC_SaveEntries }, (void *) 0 }, - { { C_RestoreEntries, PTOC_RestoreEntries }, (void *) 0 }, - { { C_NewCDialog, PTOC_NewCDialog }, (void *) 0 }, - { { C_DelSearch, PTOC_DelSearch }, (void *) 0 }, - { { C_DelComp, PTOC_DelComp }, (void *) 0 }, - { { C_SetStdCProcs, PTOC_SetStdCProcs }, (void *) 0 }, - { { C_CalcCMask, PTOC_CalcCMask }, (void *) 0 }, - { { C_SeedCFill, PTOC_SeedCFill }, (void *) 0 }, - { { C_IMVI_CopyDeepMask, PTOC_IMVI_CopyDeepMask }, (void *) 0 }, - { { _HighLevelFSDispatch, -1 }, (void *) 0 }, /* AA52 */ - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, -#if (!defined (powerpc) && !defined (__ppc__)) || defined (CFM_PROBLEMS) - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, /* AA5A */ -#else - { { _MixedMode, -1 }, (void *) 0 }, - { { _CodeFragment, -1 }, (void *) 0 }, /* AA5A */ -#endif - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_DelMCEntries, PTOC_DelMCEntries }, (void *) 0 }, - { { C_GetMCInfo, PTOC_GetMCInfo }, (void *) 0 }, - { { C_SetMCInfo, PTOC_SetMCInfo }, (void *) 0 }, - { { C_DispMCInfo, PTOC_DispMCInfo }, (void *) 0 }, - { { C_GetMCEntry, PTOC_GetMCEntry }, (void *) 0 }, - { { C_SetMCEntries, PTOC_SetMCEntries }, (void *) 0 }, - { { C_MenuChoice, PTOC_MenuChoice }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _DialogDispatch, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { C_InitPalettes, PTOC_InitPalettes }, (void *) 0 }, - { { C_NewPalette, PTOC_NewPalette }, (void *) 0 }, - { { C_GetNewPalette, PTOC_GetNewPalette }, (void *) 0 }, - { { C_DisposePalette, PTOC_DisposePalette }, (void *) 0 }, - { { C_ActivatePalette, PTOC_ActivatePalette }, (void *) 0 }, - { { C_NSetPalette, PTOC_NSetPalette }, (void *) 0 }, - { { C_GetPalette, PTOC_GetPalette }, (void *) 0 }, - { { C_PmForeColor, PTOC_PmForeColor }, (void *) 0 }, - { { C_PmBackColor, PTOC_PmBackColor }, (void *) 0 }, - { { C_AnimateEntry, PTOC_AnimateEntry }, (void *) 0 }, - { { C_AnimatePalette, PTOC_AnimatePalette }, (void *) 0 }, - { { C_GetEntryColor, PTOC_GetEntryColor }, (void *) 0 }, - { { C_SetEntryColor, PTOC_SetEntryColor }, (void *) 0 }, - { { C_GetEntryUsage, PTOC_GetEntryUsage }, (void *) 0 }, - { { C_SetEntryUsage, PTOC_SetEntryUsage }, (void *) 0 }, - { { C_CTab2Palette, PTOC_CTab2Palette }, (void *) 0 }, - { { C_Palette2CTab, PTOC_Palette2CTab }, (void *) 0 }, - { { C_CopyPalette, PTOC_CopyPalette }, (void *) 0 }, - { { _PaletteDispatch, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _QuickTime, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, -#if defined (powerpc) && !defined (__ppc__) - { { _modeswitch, -1 }, (void *) 0 }, -#else - { { _Unimplemented, -1 }, (void *) 0 }, -#endif - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _WackyQD32Trap, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _QDExtensions, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _IconDispatch, -1 }, (void *) 0 }, - { { C_DeviceLoop, PTOC_DeviceLoop }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _Unimplemented, -1 }, (void *) 0 }, - { { _DebugStr, -1 }, (void *) 0 }, -}; - -toolstuff_t pstuff[] = { - { { C_ROMlib_mytrack, PTOC_ROMlib_mytrack }, (void *) 0 }, - { { C_ROMlib_stdftrack, PTOC_ROMlib_stdftrack }, (void *) 0 }, - { { C_ROMlib_myfilt, PTOC_ROMlib_myfilt }, (void *) 0 }, - { { C_ROMlib_stdffilt, PTOC_ROMlib_stdffilt }, (void *) 0 }, - { { C_ROMlib_numsonlyfilterproc, - PTOC_ROMlib_numsonlyfilterproc }, (void *) 0 }, - { { C_ROMlib_stlfilterproc, PTOC_ROMlib_stlfilterproc }, (void *) 0 }, - -/* NOTE: the following four routines don't really use pascal calling - conventions, but we do need pstuff entries for them so we can - look for their addresses and short circuit calls to them. The - zero is correct because they take no args and return no value */ - - { { C_ROMlib_wakeup, 0 }, (void *) 0 }, - { { C_ROMlib_vcatch, 0 }, (void *) 0 }, - { { C_ROMlib_dotext, 0 }, (void *) 0 }, - { { C_handle_refresh, 0 }, (void *) 0 }, - - { { C_ROMlib_mysound, PTOC_ROMlib_mysound }, (void *) 0 }, - { { C_ROMlib_myjobproc, PTOC_ROMlib_myjobproc }, (void *) 0 }, - { { C_ROMlib_mystlproc, PTOC_ROMlib_mystlproc }, (void *) 0 }, - - { { C_cdef0, PTOC_cdef0 }, (void *) 0 }, - { { C_cdef16, PTOC_cdef16 }, (void *) 0 }, - { { C_ldef0, PTOC_ldef0 }, (void *) 0 }, - { { C_mdef0, PTOC_mdef0 }, (void *) 0 }, - { { C_mbdf0, PTOC_mbdf0 }, (void *) 0 }, - { { C_wdef0, PTOC_wdef0 }, (void *) 0 }, - { { C_wdef16, PTOC_wdef16 }, (void *) 0 }, - { { C_snth5, PTOC_snth5 }, (void *) 0 }, - - { { C_IUMagString, PTOC_IUMagString }, (void *) 0 }, - { { C_PrStlInit, PTOC_PrStlInit }, (void *) 0 }, - { { C_PrJobInit, PTOC_PrJobInit }, (void *) 0 }, - - { { C_StdText, PTOC_StdText }, (void *) 0 }, - { { C_StdLine, PTOC_StdLine }, (void *) 0 }, - { { C_StdRect, PTOC_StdRect }, (void *) 0 }, - { { C_StdOval, PTOC_StdOval }, (void *) 0 }, - { { C_StdRRect, PTOC_StdRRect }, (void *) 0 }, - { { C_StdArc, PTOC_StdArc }, (void *) 0 }, - { { C_StdRgn, PTOC_StdRgn }, (void *) 0 }, - { { C_StdPoly, PTOC_StdPoly }, (void *) 0 }, - { { C_StdBits, PTOC_StdBits }, (void *) 0 }, - { { C_StdComment, PTOC_StdComment }, (void *) 0 }, - { { C_StdTxMeas, PTOC_StdTxMeas }, (void *) 0 }, - { { C_StdPutPic, PTOC_StdPutPic }, (void *) 0 }, - - { { C_FMSwapFont, PTOC_FMSwapFont }, (void *) 0}, - { { C_InitCursor, PTOC_InitCursor }, (void *) 0}, - - { { C_textasPS, PTOC_textasPS }, (void *) 0}, - { { C_PrText, PTOC_PrText }, (void *) 0}, - { { C_PrLine, PTOC_PrLine }, (void *) 0}, - { { C_PrRect, PTOC_PrRect }, (void *) 0}, - { { C_PrRRect, PTOC_PrRRect }, (void *) 0}, - { { C_PrOval, PTOC_PrOval }, (void *) 0}, - { { C_PrArc, PTOC_PrArc }, (void *) 0}, - { { C_PrPoly, PTOC_PrPoly }, (void *) 0}, - { { C_PrRgn, PTOC_PrRgn }, (void *) 0}, - { { C_PrBits, PTOC_PrBits }, (void *) 0}, - { { C_PrComment, PTOC_PrComment }, (void *) 0}, - { { C_PrTxMeas, PTOC_PrTxMeas }, (void *) 0}, - { { C_PrGetPic, PTOC_PrGetPic }, (void *) 0}, - { { C_PrPutPic, PTOC_PrPutPic }, (void *) 0}, - { { C_donotPrText, PTOC_donotPrText }, (void *) 0}, - { { C_donotPrLine, PTOC_donotPrLine }, (void *) 0}, - { { C_donotPrRect, PTOC_donotPrRect }, (void *) 0}, - { { C_donotPrRRect, PTOC_donotPrRRect }, (void *) 0}, - { { C_donotPrOval, PTOC_donotPrOval }, (void *) 0}, - { { C_donotPrArc, PTOC_donotPrArc }, (void *) 0}, - { { C_donotPrPoly, PTOC_donotPrPoly }, (void *) 0}, - { { C_donotPrRgn, PTOC_donotPrRgn }, (void *) 0}, - { { C_donotPrBits, PTOC_donotPrBits }, (void *) 0}, - { { C_donotPrGetPic, PTOC_donotPrGetPic }, (void *) 0}, - { { C_donotPrPutPic, PTOC_donotPrPutPic }, (void *) 0}, - { { C_ROMlib_filebox, PTOC_ROMlib_filebox }, (void *) 0}, - { { C_StdGetPic, PTOC_StdGetPic }, (void *) 0}, - - { { _flushcache, -1 }, (void *) 0}, - { { _Key1Trans, -1 }, (void *) 0}, - { { _Key2Trans, -1 }, (void *) 0}, - - { { NULL /* was C_ROMlib_licensefilt */, 0 /* was PTOC_ROMlib_licensefilt */ }, (void *) 0 }, - { { C_unixmount, PTOC_unixmount }, (void *) 0 }, - { { C_GestaltTablesOnly, PTOC_GestaltTablesOnly }, (void *) 0 }, - { { C_sound_timer_handler, 0 }, (void *) 0 }, - { { C_adb_service_stub, 0 }, (void *) 0 }, - { { C_cdef1008, PTOC_cdef1008 }, (void *) 0 }, - { { _bad_trap_unimplemented, -1 }, (void *) 0 }, - { { C_pack8_unknown_selector, PTOC_pack8_unknown_selector }, (void *) 0 }, - { { C_PhysicalGestalt, PTOC_PhysicalGestalt }, (void *) 0 }, - - { { C_HideCursor, PTOC_HideCursor }, (void *) 0 }, - { { C_ShowCursor, PTOC_ShowCursor }, (void *) 0 }, - { { C_ShieldCursor, PTOC_ShieldCursor }, (void *) 0 }, - { { C_SetCursor, PTOC_SetCursor }, (void *) 0 }, - { { C_ObscureCursor, PTOC_ObscureCursor }, (void *) 0 }, - { { C_unknown574, PTOC_ShowCursor }, (void *) 0 }, - - { { C_ROMlib_circle_ok, PTOC_ROMlib_circle_ok }, (void *) 0}, - { { C_ROMlib_orientation, PTOC_ROMlib_orientation }, (void *) 0}, - - { { C_new_draw_scroll, PTOC_DeviceLoopDrawingProcTemplate }, (void *) 0}, - { { C_new_pos_ctl, PTOC_DeviceLoopDrawingProcTemplate }, (void *) 0}, -}; - -void *fsroutines[][2] = { - { /* 0xA000 */ PBOpen, PBHOpen /* 0 */ }, -#define OPENTRAP 0 -#define OPENINDEX 0 - - { /* 0xA001 */ PBClose, PBClose /* 1 */ }, -#define CLOSETRAP 1 -#define CLOSEINDEX 1 - - { /* 0xA002 */ PBRead, PBRead /* 2 */ }, -#define READTRAP 2 -#define READINDEX 2 - - { /* 0xA003 */ PBWrite, PBWrite /* 3 */ }, -#define WRITETRAP 3 -#define WRITEINDEX 3 - - { /* 0xA004 */ PBControl, PBControl /* 4 */ }, -#define CONTROLTRAP 4 -#define CONTROLINDEX 4 - - { /* 0xA005 */ PBStatus, PBStatus /* 5 */ }, -#define STATUSTRAP 5 -#define STATUSINDEX 5 - - { /* 0xA006 */ PBKillIO, PBKillIO /* 6 */ }, -#define KILLIOTRAP 6 -#define KILLIOINDEX 6 - - { /* 0xA007 */ PBGetVInfo, PBHGetVInfo /* 7 */ }, -#define GETVINFOTRAP 7 -#define GETVINFOINDEX 7 - - { /* 0xA008 */ PBCreate, PBHCreate /* 8 */ }, -#define CREATETRAP 8 -#define CREATEINDEX 8 - - { /* 0xA009 */ PBDelete, PBHDelete /* 9 */ }, -#define DELETETRAP 9 -#define DELETEINDEX 9 - - { /* 0xA00A */ PBOpenRF, PBHOpenRF /* 10 */ }, -#define OPENRFTRAP 0xA -#define OPENRFINDEX 10 - - { /* 0xA00B */ PBRename, PBHRename /* 11 */ }, -#define RENAMETRAP 0xB -#define RENAMEINDEX 11 - - { /* 0xA00C */ PBGetFInfo, PBHGetFInfo /* 12 */ }, -#define GETFINFOTRAP 0xC -#define GETFINFOINDEX 12 - - { /* 0xA00D */ PBSetFInfo, PBHSetFInfo /* 13 */ }, -#define SETFINFOTRAP 0xD -#define SETFINFOINDEX 13 - - { /* 0xA00E */ PBUnmountVol, PBUnmountVol /* 14 */ }, -#define UNMOUNTVOLTRAP 0xE -#define UNMOUNTVOLINDEX 14 - - { /* 0xA00F */ PBMountVol, PBMountVol /* 15 */ }, -#define MOUNTVOLTRAP 0xF -#define MOUNTVOLINDEX 15 - - { /* 0xA010 */ PBAllocate, PBAllocate /* 16 */ }, -#define ALLOCATETRAP 0x10 -#define ALLOCATEINDEX 16 - - { /* 0xA011 */ PBGetEOF, PBGetEOF /* 17 */ }, -#define GETEOFTRAP 0x11 -#define GETEOFINDEX 17 - - { /* 0xA012 */ PBSetEOF, PBSetEOF /* 18 */ }, -#define SETEOFTRAP 0x12 -#define SETEOFINDEX 18 - - { /* 0xA013 */ PBFlushVol, PBFlushVol /* 19 */ }, -#define FLUSHVOLTRAP 0x13 -#define FLUSHVOLINDEX 19 - - { /* 0xA014 */ PBGetVol, PBHGetVol /* 20 */ }, -#define GETVOLTRAP 0x14 -#define GETVOLINDEX 20 - - { /* 0xA015 */ PBSetVol, PBHSetVol /* 21 */ }, -#define SETVOLTRAP 0x15 -#define SETVOLINDEX 21 - - { /* 0xA017 */ PBEject, PBEject /* 22 */ }, -#define EJECTTRAP 0x17 -#define EJECTINDEX 22 - - { /* 0xA018 */ PBGetFPos, PBGetFPos /* 23 */ }, -#define GETFPOSTRAP 0x18 -#define GETFPOSINDEX 23 - - { /* 0xA035 */ PBOffLine, PBOffLine /* 24 */ }, -#define OFFLINETRAP 0x35 -#define OFFLINEINDEX 24 - - { /* 0xA041 */ PBSetFLock, PBHSetFLock /* 25 */ }, -#define SETFLOCKTRAP 0x41 -#define SETFLOCKINDEX 25 - - { /* 0xA042 */ PBRstFLock, PBHRstFLock /* 26 */ }, -#define RSTFLOCKTRAP 0x42 -#define RSTFLOCKINDEX 26 - - { /* 0xA043 */ PBSetFVers, PBSetFVers /* 27 */ }, -#define SETFVERSTRAP 0x43 -#define SETFVERSINDEX 27 - - { /* 0xA044 */ PBSetFPos, PBSetFPos /* 28 */ }, -#define SETFPOSTRAP 0x44 -#define SETFPOSINDEX 28 - - { /* 0xA045 */ PBFlushFile, PBFlushFile /* 29 */ }, -#define FLUSHFILETRAP 0x45 -#define FLUSHFILEINDEX 29 - -}; - -osstuff_t osstuff[0x100] = { - { (void *) 0, PBOpen }, - { (void *) 0, PBClose }, - { (void *) 0, PBRead }, - { (void *) 0, PBWrite }, - { (void *) 0, PBControl }, - { (void *) 0, PBStatus }, - { (void *) 0, PBKillIO }, - { (void *) 0, PBGetVInfo }, - { (void *) 0, PBCreate }, - { (void *) 0, PBDelete }, - { (void *) 0, PBOpenRF }, - { (void *) 0, PBRename }, - { (void *) 0, PBGetFInfo }, - { (void *) 0, PBSetFInfo }, - { (void *) 0, PBUnmountVol }, - { (void *) 0, PBMountVol }, - { (void *) 0, PBAllocate }, - { (void *) 0, PBGetEOF }, - { (void *) 0, PBSetEOF }, - { (void *) 0, PBFlushVol }, - { (void *) 0, PBGetVol }, - { (void *) 0, PBSetVol }, - { (void *) 0, _FInitQueue }, - { (void *) 0, PBEject }, - { (void *) 0, PBGetFPos }, - { (void *) 0, _InitZone }, - { (void *) 0, _GetZone }, - { (void *) 0, _SetZone }, - { (void *) 0, _FreeMem }, - { (void *) 0, _MaxMem }, - { (void *) 0, _NewPtr }, - { (void *) 0, _DisposPtr }, - { (void *) 0, _SetPtrSize }, - { (void *) 0, _GetPtrSize }, - { (void *) 0, _NewHandle }, - { (void *) 0, _DisposHandle }, - { (void *) 0, _SetHandleSize }, - { (void *) 0, _GetHandleSize }, - { (void *) 0, _HandleZone }, - { (void *) 0, _ReallocHandle }, - { (void *) 0, _RecoverHandle }, - { (void *) 0, _HLock }, - { (void *) 0, _HUnlock }, - { (void *) 0, _EmptyHandle }, - { (void *) 0, _InitApplZone }, - { (void *) 0, _SetApplLimit }, - { (void *) 0, _BlockMove }, - { (void *) 0, _PostEvent }, - { (void *) 0, _OSEventAvail }, - { (void *) 0, _GetOSEvent }, - { (void *) 0, _FlushEvents }, - { (void *) 0, _VInstall }, - { (void *) 0, _VRemove }, - { (void *) 0, PBOffLine }, - { (void *) 0, _MoreMasters }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _WriteParam }, - { (void *) 0, _ReadDateTime }, - { (void *) 0, _SetDateTime }, - { (void *) 0, _Delay }, - { (void *) 0, _EqualString }, - { (void *) 0, _DrvrInstall }, - { (void *) 0, _DrvrRemove }, - { (void *) 0, _InitUtil }, - { (void *) 0, _ResrvMem }, - { (void *) 0, PBSetFLock }, - { (void *) 0, PBRstFLock }, - { (void *) 0, PBSetFVers }, - { (void *) 0, PBSetFPos }, - { (void *) 0, PBFlushFile }, - { (void *) 0, _GetTrapAddress }, - { (void *) 0, _SetTrapAddress }, - { (void *) 0, _PtrZone }, - { (void *) 0, _HPurge }, - { (void *) 0, _HNoPurge }, - { (void *) 0, _SetGrowZone }, - { (void *) 0, _CompactMem }, - { (void *) 0, _PurgeMem }, - { (void *) 0, _AddDrive }, - { (void *) 0, _RDrvrInstall }, - { (void *) 0, _RelString }, - { (void *) 0, _IMVI_ReadXPRam }, - { (void *) 0, _IMVI_WriteXPRam }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _UprString }, - { (void *) 0, _StripAddress }, - { (void *) 0, _IMVI_LowerText }, - { (void *) 0, _SetApplBase }, - { (void *) 0, _InsTime }, - { (void *) 0, _RmvTime }, - { (void *) 0, _PrimeTime }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _IMVI_MemoryDispatch }, - { (void *) 0, _SwapMMUMode }, - { (void *) 0, _NMInstall }, - { (void *) 0, _NMRemove }, - { (void *) 0, _HFSDispatch }, - { (void *) 0, _MaxBlock }, - { (void *) 0, _PurgeSpace }, - { (void *) 0, _MaxApplZone }, - { (void *) 0, _MoveHHi }, - { (void *) 0, _StackSpace }, - { (void *) 0, _NewEmptyHandle }, - { (void *) 0, _HSetRBit }, - { (void *) 0, _HClrRBit }, - { (void *) 0, _HGetState }, - { (void *) 0, _HSetState }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _SlotManager }, - { (void *) 0, _SlotVInstall }, - { (void *) 0, _SlotVRemove }, - { (void *) 0, _AttachVBL }, - { (void *) 0, _DoVBLTask }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _DTInstall }, - { (void *) 0, _SIntRemove }, - { (void *) 0, _CountADBs }, - { (void *) 0, _GetIndADB }, - { (void *) 0, _GetADBInfo }, - { (void *) 0, _SetADBInfo }, - { (void *) 0, _ADBReInit }, - { (void *) 0, _ADBOp }, - { (void *) 0, _GetDefaultStartup }, - { (void *) 0, _SetDefaultStartup }, - { (void *) 0, _InternalWait }, - { (void *) 0, _GetVideoDefault }, - { (void *) 0, _SetVideoDefault }, - { (void *) 0, _SIntInstall }, - { (void *) 0, _SetOSDefault }, - { (void *) 0, _GetOSDefault }, - { (void *) 0, _IMVI_IdleUpdate }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _IMVI_SlpQInstall }, - { (void *) 0, _CommToolboxDispatch }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _IMVI_DebugUtil }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _IMVI_DeferUserFn }, - { (void *) 0, _SysEnvirons }, - { (void *) 0, _IMVI_Translate24To32 }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Microseconds }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _HWPriv }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Gestalt }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _flushcache }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _IMVI_PPC }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _ResourceStub }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, - { (void *) 0, _Unimplemented }, -}; - -PUBLIC void filltables( void ) -{ - int i, fsindex; - syn68k_addr_t unimpl = 0; - - unimpl = callback_install( (callback_handler_t) _Unimplemented, - (void *) 0); - - for (i = 0; i < (int) NELEM(tooltraptable); ++i) - tooltraptable[i] = toolstuff[i].orig = (void *) - ((toolstuff[i].ptoc.wheretogo == _Unimplemented) ? - unimpl - : - callback_install( (callback_handler_t) - (toolstuff[i].ptoc.magic != (ULONGINT) -1 ? - PascalToCCall - : - toolstuff[i].ptoc.wheretogo), - &toolstuff[i].ptoc )); - - for (i = 0; i < (int) NELEM(pstuff); ++i) - pstuff[i].orig = ((void *) - ((pstuff[i].ptoc.wheretogo == _Unimplemented) - ? SYN68K_TO_US (unimpl) - : SYN68K_TO_US (callback_install((callback_handler_t) - ((pstuff[i].ptoc.magic - != (ULONGINT) -1) - ? PascalToCCall - : pstuff[i].ptoc.wheretogo), - &pstuff[i].ptoc )))); - - for (i = 0; i < (int) NELEM(ostraptable); ++i) { - switch (i) { - case OPENTRAP: - fsindex = OPENINDEX; - break; - case CLOSETRAP: - fsindex = CLOSEINDEX; - break; - case READTRAP: - fsindex = READINDEX; - break; - case WRITETRAP: - fsindex = WRITEINDEX; - break; - case CONTROLTRAP: - fsindex = CONTROLINDEX; - break; - case STATUSTRAP: - fsindex = STATUSINDEX; - break; - case KILLIOTRAP: - fsindex = KILLIOINDEX; - break; - case GETVINFOTRAP: - fsindex = GETVINFOINDEX; - break; - case CREATETRAP: - fsindex = CREATEINDEX; - break; - case DELETETRAP: - fsindex = DELETEINDEX; - break; - case OPENRFTRAP: - fsindex = OPENRFINDEX; - break; - case RENAMETRAP: - fsindex = RENAMEINDEX; - break; - case GETFINFOTRAP: - fsindex = GETFINFOINDEX; - break; - case SETFINFOTRAP: - fsindex = SETFINFOINDEX; - break; - case UNMOUNTVOLTRAP: - fsindex = UNMOUNTVOLINDEX; - break; - case MOUNTVOLTRAP: - fsindex = MOUNTVOLINDEX; - break; - case ALLOCATETRAP: - fsindex = ALLOCATEINDEX; - break; - case GETEOFTRAP: - fsindex = GETEOFINDEX; - break; - case SETEOFTRAP: - fsindex = SETEOFINDEX; - break; - case FLUSHVOLTRAP: - fsindex = FLUSHVOLINDEX; - break; - case GETVOLTRAP: - fsindex = GETVOLINDEX; - break; - case SETVOLTRAP: - fsindex = SETVOLINDEX; - break; - case EJECTTRAP: - fsindex = EJECTINDEX; - break; - case GETFPOSTRAP: - fsindex = GETFPOSINDEX; - break; - case OFFLINETRAP: - fsindex = OFFLINEINDEX; - break; - case SETFLOCKTRAP: - fsindex = SETFLOCKINDEX; - break; - case RSTFLOCKTRAP: - fsindex = RSTFLOCKINDEX; - break; - case SETFVERSTRAP: - fsindex = SETFVERSINDEX; - break; - case SETFPOSTRAP: - fsindex = SETFPOSINDEX; - break; - case FLUSHFILETRAP: - fsindex = FLUSHFILEINDEX; - break; - default: - fsindex = -1; - break; - }; - - if (fsindex == -1) - ostraptable[i] = osstuff[i].orig = (void *) - ((osstuff[i].func == _Unimplemented) ? - unimpl - : - callback_install( osstuff[i].func, - osstuff[i].func)); - else { - osstuff[i].func = (void *) _HFSRoutines; - ostraptable[i] = osstuff[i].orig = (void *) - callback_install( (void *) _HFSRoutines, - fsroutines[fsindex] ); - } - } -} diff --git a/src/emutraptables.cpp b/src/emutraptables.cpp new file mode 100644 index 00000000..dc3e700d --- /dev/null +++ b/src/emutraptables.cpp @@ -0,0 +1,1752 @@ +/* Copyright 1994, 1995, 1996 by Abacus Research and + * Development, Inc. All rights reserved. + */ + +#if !defined (OMIT_RCSID_STRINGS) +char ROMlib_rcsid_emutraptables[] = + "$Id: emutraptables.c 63 2004-12-24 18:19:43Z ctm $"; +#endif + +#include "rsys/common.h" +#include "rsys/everything.h" + +#include "OSUtil.h" +#include "Gestalt.h" +#include "SysErr.h" + +#include "rsys/trapglue.h" +#include "rsys/ptocflags.h" +#include "rsys/stdfile.h" +#include "rsys/tesave.h" +#include "rsys/resource.h" +#include "rsys/ctl.h" +#include "rsys/list.h" +#include "rsys/menu.h" +#include "rsys/wind.h" +#include "rsys/print.h" +#include "rsys/osutil.h" +#include "rsys/vbl.h" +#include "rsys/soundopts.h" +#include "rsys/refresh.h" +#include "rsys/gestalt.h" +#include "rsys/emustubs.h" +#include "rsys/executor.h" + +using namespace Executor; + +void *Executor::tooltraptable[0x400]; /* Gets filled in at run time */ +void *Executor::ostraptable[0x100]; /* Gets filled in at run time */ + +#define C_Pack9 _Unimplemented /* PPCBrowser */ +#define PTOC_Pack9 static_cast(-1) +#define C_Pack10 _Unimplemented +#define PTOC_Pack10 static_cast(-1) + +#define C_Pack13 _Unimplemented /* DB stuff */ +#define PTOC_Pack13 static_cast(-1) +#define C_Pack1 _Unimplemented +#define PTOC_Pack1 static_cast(-1) +#define C_Chain _Unimplemented +#define PTOC_Chain static_cast(-1) + +#define _AddDrive _Unimplemented +#define _RDrvrInstall _Unimplemented +/* #define (void*)_IMVI_ReadXPRam (void*)_Unimplemented */ +#define _IMVI_WriteXPRam _Unimplemented +#define _IMVI_MemoryDispatch _Unimplemented +/* #define (void*)_SlotManager (void*)_Unimplemented */ +/* #define (void*)_SlotVInstall (void*)_Unimplemented */ +/* #define (void*)_SlotVRemove (void*)_Unimplemented */ +#define _AttachVBL _Unimplemented +#define _DoVBLTask _Unimplemented +#define _DTInstall _Unimplemented +#define _SIntRemove _Unimplemented +#define _InternalWait _Unimplemented +#define _SIntInstall _Unimplemented +#define _IMVI_IdleUpdate _Unimplemented +#define _IMVI_SlpQInstall _Unimplemented +#define _IMVI_DebugUtil _Unimplemented +#define _IMVI_DeferUserFn _Unimplemented +#define _IMVI_Translate24To32 _Unimplemented + +#define _GetMaskTable _Unimplemented +#define _Debugger _Unimplemented +#define _DebugStr _Unimplemented + + +void C_unknown574 (void) +{ +} + +static const toolstuff_t unimplemented_toolstuff = +{{ (void*)&_Unimplemented, static_cast(-1) }, nullptr }; + +toolstuff_t Executor::toolstuff[0x400] = { + { { (void*)&_SoundDispatch, static_cast(-1) }, nullptr }, + { { (void*)&C_SndDisposeChannel, PTOC_SndDisposeChannel }, nullptr }, + { { (void*)&C_SndAddModifier, PTOC_SndAddModifier }, nullptr }, + { { (void*)&C_SndDoCommand, PTOC_SndDoCommand }, nullptr }, + { { (void*)&C_SndDoImmediate, PTOC_SndDoImmediate }, nullptr }, + { { (void*)&C_SndPlay, PTOC_SndPlay }, nullptr }, + { { (void*)&C_SndControl, PTOC_SndControl }, nullptr }, + { { (void*)&C_SndNewChannel, PTOC_SndNewChannel }, nullptr }, + { { (void*)&C_InitProcMenu, PTOC_InitProcMenu }, nullptr }, + { { (void*)&C_GetCVariant, PTOC_GetCVariant }, nullptr }, + { { (void*)&C_GetWVariant, PTOC_GetWVariant }, nullptr }, + { { (void*)&C_PopUpMenuSelect, PTOC_PopUpMenuSelect }, nullptr }, + { { (void*)&C_RGetResource, PTOC_RGetResource }, nullptr }, + { { (void*)&C_Count1Resources, PTOC_Count1Resources }, nullptr }, + { { (void*)&C_Get1IndResource, PTOC_Get1IndResource }, nullptr }, + { { (void*)&C_Get1IndType, PTOC_Get1IndType }, nullptr }, + { { (void*)&C_Unique1ID, PTOC_Unique1ID }, nullptr }, + { { (void*)&C_TESelView, PTOC_TESelView }, nullptr }, + { { (void*)&C_TEPinScroll, PTOC_TEPinScroll }, nullptr }, + { { (void*)&C_TEAutoView, PTOC_TEAutoView }, nullptr }, + { { (void*)&C_SetFractEnable, PTOC_SetFractEnable }, nullptr }, + { { (void*)&_SCSIDispatch, static_cast(-1) }, nullptr }, + { { (void*)&_Pack8, static_cast(-1) }, nullptr }, + { { (void*)&C_CopyMask, PTOC_CopyMask }, nullptr }, + { { (void*)&C_FixAtan2, PTOC_FixAtan2 }, nullptr }, + { { (void*)&_Unimplemented, static_cast(-1) }, nullptr }, + { { (void*)&C_HOpenResFile, PTOC_HOpenResFile }, nullptr }, + { { (void*)&C_HCreateResFile, PTOC_HCreateResFile }, nullptr }, + { { (void*)&C_Count1Types, PTOC_Count1Types }, nullptr }, + { { (void*)&C_InvalMenuBar, PTOC_InvalMenuBar }, nullptr }, + unimplemented_toolstuff, + { { (void*)&C_Get1Resource, PTOC_Get1Resource }, nullptr }, + { { (void*)&C_Get1NamedResource, PTOC_Get1NamedResource }, nullptr }, + { { (void*)&C_MaxSizeRsrc, PTOC_MaxSizeRsrc }, nullptr }, + { { (void*)&_ResourceDispatch, static_cast(-1) }, nullptr }, + { { (void*)&_AliasDispatch, static_cast(-1) }, nullptr }, + unimplemented_toolstuff, + unimplemented_toolstuff, + { { (void*)&C_InsMenuItem, PTOC_InsMenuItem }, nullptr }, + { { (void*)&C_HideDItem, PTOC_HideDItem }, nullptr }, + { { (void*)&C_ShowDItem, PTOC_ShowDItem }, nullptr }, + unimplemented_toolstuff, + unimplemented_toolstuff, + { { (void*)&C_Pack9, static_cast(PTOC_Pack9) }, nullptr }, + { { (void*)&C_Pack10, static_cast(PTOC_Pack10) }, nullptr }, + { { (void*)&_Pack11, static_cast(-1) }, nullptr }, + { { (void*)&_Pack12, static_cast(-1) }, nullptr }, + { { (void*)&C_Pack13, static_cast(PTOC_Pack13) }, nullptr }, + { { (void*)&_Pack14, static_cast(-1) }, nullptr }, + { { (void*)&_Pack15, static_cast(-1) }, nullptr }, + unimplemented_toolstuff, + unimplemented_toolstuff, + { { (void*)&C_SetFScaleDisable, PTOC_SetFScaleDisable }, nullptr }, + { { (void*)&C_FontMetrics, PTOC_FontMetrics }, nullptr }, + { { (void*)&_GetMaskTable, static_cast(-1) }, nullptr }, + { { (void*)&C_MeasureText, PTOC_MeasureText }, nullptr }, + { { (void*)&C_CalcMask, PTOC_CalcMask }, nullptr }, + { { (void*)&C_SeedFill, PTOC_SeedFill }, nullptr }, + { { (void*)&C_ZoomWindow, PTOC_ZoomWindow }, nullptr }, + { { (void*)&C_TrackBox, PTOC_TrackBox }, nullptr }, + { { (void*)&C_TEGetOffset, PTOC_TEGetOffset }, nullptr }, + { { (void*)&_TEDispatch, static_cast(-1) }, nullptr }, + { { (void*)&C_TEStylNew, PTOC_TEStylNew }, nullptr }, + { { (void*)&C_Long2Fix, PTOC_Long2Fix }, nullptr }, + { { (void*)&C_Fix2Long, PTOC_Fix2Long }, nullptr }, + { { (void*)&C_Fix2Frac, PTOC_Fix2Frac }, nullptr }, + { { (void*)&C_Frac2Fix, PTOC_Frac2Fix }, nullptr }, + { { (void*)&_Fix2X, static_cast(-1) }, nullptr }, + { { (void*)&C_R_X2Fix, PTOC_R_X2Fix }, nullptr }, + { { (void*)&_Frac2X, static_cast(-1) }, nullptr }, + { { (void*)&C_R_X2Frac, PTOC_R_X2Frac }, nullptr }, + { { (void*)&C_FracCos, PTOC_FracCos }, nullptr }, + { { (void*)&C_FracSin, PTOC_FracSin }, nullptr }, + { { (void*)&C_FracSqrt, PTOC_FracSqrt }, nullptr }, + { { (void*)&C_FracMul, PTOC_FracMul }, nullptr }, + { { (void*)&C_FracDiv, PTOC_FracDiv }, nullptr }, + unimplemented_toolstuff, + { { (void*)&C_FixDiv, PTOC_FixDiv }, nullptr }, + { { (void*)&C_GetItemCmd, PTOC_GetItemCmd }, nullptr }, + { { (void*)&C_SetItemCmd, PTOC_SetItemCmd }, nullptr }, + { { (void*)&C_InitCursor, PTOC_InitCursor }, nullptr }, + { { (void*)&C_SetCursor, PTOC_SetCursor }, nullptr }, + { { (void*)&C_HideCursor, PTOC_HideCursor }, nullptr }, + { { (void*)&C_ShowCursor, PTOC_ShowCursor }, nullptr }, + { { (void*)&_FontDispatch, static_cast(-1) }, nullptr }, + { { (void*)&C_ShieldCursor, PTOC_ShieldCursor }, nullptr }, + { { (void*)&C_ObscureCursor, PTOC_ObscureCursor }, nullptr }, + unimplemented_toolstuff, + { { (void*)&C_BitAnd, PTOC_BitAnd }, nullptr }, + { { (void*)&C_BitXor, PTOC_BitXor }, nullptr }, + { { (void*)&C_BitNot, PTOC_BitNot }, nullptr }, + { { (void*)&C_BitOr, PTOC_BitOr }, nullptr }, + { { (void*)&C_BitShift, PTOC_BitShift }, nullptr }, + { { (void*)&C_BitTst, PTOC_BitTst }, nullptr }, + { { (void*)&C_BitSet, PTOC_BitSet }, nullptr }, + { { (void*)&C_BitClr, PTOC_BitClr }, nullptr }, + { { (void*)&C_WaitNextEvent, PTOC_WaitNextEvent }, nullptr }, + { { (void*)&C_Random, PTOC_Random }, nullptr }, + { { (void*)&C_ForeColor, PTOC_ForeColor }, nullptr }, + { { (void*)&C_BackColor, PTOC_BackColor }, nullptr }, + { { (void*)&C_ColorBit, PTOC_ColorBit }, nullptr }, + { { (void*)&C_GetPixel, PTOC_GetPixel }, nullptr }, + { { (void*)&C_StuffHex, PTOC_StuffHex }, nullptr }, + { { (void*)&C_LongMul, PTOC_LongMul }, nullptr }, + { { (void*)&C_FixMul, PTOC_FixMul }, nullptr }, + { { (void*)&C_FixRatio, PTOC_FixRatio }, nullptr }, + { { (void*)&C_HiWord, PTOC_HiWord }, nullptr }, + { { (void*)&C_LoWord, PTOC_LoWord }, nullptr }, + { { (void*)&C_FixRound, PTOC_FixRound }, nullptr }, + { { (void*)&C_InitPort, PTOC_InitPort }, nullptr }, + { { (void*)&C_InitGraf, PTOC_InitGraf }, nullptr }, + { { (void*)&C_OpenPort, PTOC_OpenPort }, nullptr }, + { { (void*)&C_LocalToGlobal, PTOC_LocalToGlobal }, nullptr }, + { { (void*)&C_GlobalToLocal, PTOC_GlobalToLocal }, nullptr }, + { { (void*)&C_GrafDevice, PTOC_GrafDevice }, nullptr }, + { { (void*)&C_SetPort, PTOC_SetPort }, nullptr }, + { { (void*)&C_GetPort, PTOC_GetPort }, nullptr }, + { { (void*)&C_SetPortBits, PTOC_SetPortBits }, nullptr }, + { { (void*)&C_PortSize, PTOC_PortSize }, nullptr }, + { { (void*)&C_MovePortTo, PTOC_MovePortTo }, nullptr }, + { { (void*)&C_SetOrigin, PTOC_SetOrigin }, nullptr }, + { { (void*)&C_SetClip, PTOC_SetClip }, nullptr }, + { { (void*)&C_GetClip, PTOC_GetClip }, nullptr }, + { { (void*)&C_ClipRect, PTOC_ClipRect }, nullptr }, + { { (void*)&C_BackPat, PTOC_BackPat }, nullptr }, + { { (void*)&C_ClosePort, PTOC_ClosePort }, nullptr }, + { { (void*)&C_AddPt, PTOC_AddPt }, nullptr }, + { { (void*)&C_SubPt, PTOC_SubPt }, nullptr }, + { { (void*)&C_SetPt, PTOC_SetPt }, nullptr }, + { { (void*)&C_EqualPt, PTOC_EqualPt }, nullptr }, + { { (void*)&C_StdText, PTOC_StdText }, nullptr }, + { { (void*)&C_DrawChar, PTOC_DrawChar }, nullptr }, + { { (void*)&C_DrawString, PTOC_DrawString }, nullptr }, + { { (void*)&C_DrawText, PTOC_DrawText }, nullptr }, + { { (void*)&C_TextWidth, PTOC_TextWidth }, nullptr }, + { { (void*)&C_TextFont, PTOC_TextFont }, nullptr }, + { { (void*)&C_TextFace, PTOC_TextFace }, nullptr }, + { { (void*)&C_TextMode, PTOC_TextMode }, nullptr }, + { { (void*)&C_TextSize, PTOC_TextSize }, nullptr }, + { { (void*)&C_GetFontInfo, PTOC_GetFontInfo }, nullptr }, + { { (void*)&C_StringWidth, PTOC_StringWidth }, nullptr }, + { { (void*)&C_CharWidth, PTOC_CharWidth }, nullptr }, + { { (void*)&C_SpaceExtra, PTOC_SpaceExtra }, nullptr }, + { { (void*)&_OSDispatch, static_cast(-1) }, nullptr }, + { { (void*)&C_StdLine, PTOC_StdLine }, nullptr }, + { { (void*)&C_LineTo, PTOC_LineTo }, nullptr }, + { { (void*)&C_Line, PTOC_Line }, nullptr }, + { { (void*)&C_MoveTo, PTOC_MoveTo }, nullptr }, + { { (void*)&C_Move, PTOC_Move }, nullptr }, + { { (void*)&_ShutDown, static_cast(-1) }, nullptr }, + { { (void*)&C_HidePen, PTOC_HidePen }, nullptr }, + { { (void*)&C_ShowPen, PTOC_ShowPen }, nullptr }, + { { (void*)&C_GetPenState, PTOC_GetPenState }, nullptr }, + { { (void*)&C_SetPenState, PTOC_SetPenState }, nullptr }, + { { (void*)&C_GetPen, PTOC_GetPen }, nullptr }, + { { (void*)&C_PenSize, PTOC_PenSize }, nullptr }, + { { (void*)&C_PenMode, PTOC_PenMode }, nullptr }, + { { (void*)&C_PenPat, PTOC_PenPat }, nullptr }, + { { (void*)&C_PenNormal, PTOC_PenNormal }, nullptr }, + unimplemented_toolstuff, + { { (void*)&C_StdRect, PTOC_StdRect }, nullptr }, + { { (void*)&C_FrameRect, PTOC_FrameRect }, nullptr }, + { { (void*)&C_PaintRect, PTOC_PaintRect }, nullptr }, + { { (void*)&C_EraseRect, PTOC_EraseRect }, nullptr }, + { { (void*)&C_InvertRect, PTOC_InvertRect }, nullptr }, + { { (void*)&C_FillRect, PTOC_FillRect }, nullptr }, + { { (void*)&C_EqualRect, PTOC_EqualRect }, nullptr }, + { { (void*)&C_SetRect, PTOC_SetRect }, nullptr }, + { { (void*)&C_OffsetRect, PTOC_OffsetRect }, nullptr }, + { { (void*)&C_InsetRect, PTOC_InsetRect }, nullptr }, + { { (void*)&C_SectRect, PTOC_SectRect }, nullptr }, + { { (void*)&C_UnionRect, PTOC_UnionRect }, nullptr }, + { { (void*)&C_Pt2Rect, PTOC_Pt2Rect }, nullptr }, + { { (void*)&C_PtInRect, PTOC_PtInRect }, nullptr }, + { { (void*)&C_EmptyRect, PTOC_EmptyRect }, nullptr }, + { { (void*)&C_StdRRect, PTOC_StdRRect }, nullptr }, + { { (void*)&C_FrameRoundRect, PTOC_FrameRoundRect }, nullptr }, + { { (void*)&C_PaintRoundRect, PTOC_PaintRoundRect }, nullptr }, + { { (void*)&C_EraseRoundRect, PTOC_EraseRoundRect }, nullptr }, + { { (void*)&C_InvertRoundRect, PTOC_InvertRoundRect }, nullptr }, + { { (void*)&C_FillRoundRect, PTOC_FillRoundRect }, nullptr }, + { { (void*)&_ScriptUtil, static_cast(-1) }, nullptr }, + { { (void*)&C_StdOval, PTOC_StdOval }, nullptr }, + { { (void*)&C_FrameOval, PTOC_FrameOval }, nullptr }, + { { (void*)&C_PaintOval, PTOC_PaintOval }, nullptr }, + { { (void*)&C_EraseOval, PTOC_EraseOval }, nullptr }, + { { (void*)&C_InvertOval, PTOC_InvertOval }, nullptr }, + { { (void*)&C_FillOval, PTOC_FillOval }, nullptr }, + { { (void*)&C_SlopeFromAngle, PTOC_SlopeFromAngle }, nullptr }, + { { (void*)&C_StdArc, PTOC_StdArc }, nullptr }, + { { (void*)&C_FrameArc, PTOC_FrameArc }, nullptr }, + { { (void*)&C_PaintArc, PTOC_PaintArc }, nullptr }, + { { (void*)&C_EraseArc, PTOC_EraseArc }, nullptr }, + { { (void*)&C_InvertArc, PTOC_InvertArc }, nullptr }, + { { (void*)&C_FillArc, PTOC_FillArc }, nullptr }, + { { (void*)&C_PtToAngle, PTOC_PtToAngle }, nullptr }, + { { (void*)&C_AngleFromSlope, PTOC_AngleFromSlope }, nullptr }, + { { (void*)&C_StdPoly, PTOC_StdPoly }, nullptr }, + { { (void*)&C_FramePoly, PTOC_FramePoly }, nullptr }, + { { (void*)&C_PaintPoly, PTOC_PaintPoly }, nullptr }, + { { (void*)&C_ErasePoly, PTOC_ErasePoly }, nullptr }, + { { (void*)&C_InvertPoly, PTOC_InvertPoly }, nullptr }, + { { (void*)&C_FillPoly, PTOC_FillPoly }, nullptr }, + { { (void*)&C_OpenPoly, PTOC_OpenPoly }, nullptr }, + { { (void*)&C_ClosePoly, PTOC_ClosePoly }, nullptr }, + { { (void*)&C_KillPoly, PTOC_KillPoly }, nullptr }, + { { (void*)&C_OffsetPoly, PTOC_OffsetPoly }, nullptr }, + { { (void*)&C_PackBits, PTOC_PackBits }, nullptr }, + { { (void*)&C_UnpackBits, PTOC_UnpackBits }, nullptr }, + { { (void*)&C_StdRgn, PTOC_StdRgn }, nullptr }, + { { (void*)&C_FrameRgn, PTOC_FrameRgn }, nullptr }, + { { (void*)&C_PaintRgn, PTOC_PaintRgn }, nullptr }, + { { (void*)&C_EraseRgn, PTOC_EraseRgn }, nullptr }, + { { (void*)&C_InvertRgn, PTOC_InvertRgn }, nullptr }, + { { (void*)&C_FillRgn, PTOC_FillRgn }, nullptr }, + { { (void*)&C_BitMapToRegion, PTOC_BitMapToRegion }, nullptr }, + { { (void*)&C_NewRgn, PTOC_NewRgn }, nullptr }, + { { (void*)&C_DisposeRgn, PTOC_DisposeRgn }, nullptr }, + { { (void*)&C_OpenRgn, PTOC_OpenRgn }, nullptr }, + { { (void*)&C_CloseRgn, PTOC_CloseRgn }, nullptr }, + { { (void*)&C_CopyRgn, PTOC_CopyRgn }, nullptr }, + { { (void*)&C_SetEmptyRgn, PTOC_SetEmptyRgn }, nullptr }, + { { (void*)&C_SetRectRgn, PTOC_SetRectRgn }, nullptr }, + { { (void*)&C_RectRgn, PTOC_RectRgn }, nullptr }, + { { (void*)&C_OffsetRgn, PTOC_OffsetRgn }, nullptr }, + { { (void*)&C_InsetRgn, PTOC_InsetRgn }, nullptr }, + { { (void*)&C_EmptyRgn, PTOC_EmptyRgn }, nullptr }, + { { (void*)&C_EqualRgn, PTOC_EqualRgn }, nullptr }, + { { (void*)&C_SectRgn, PTOC_SectRgn }, nullptr }, + { { (void*)&C_UnionRgn, PTOC_UnionRgn }, nullptr }, + { { (void*)&C_DiffRgn, PTOC_DiffRgn }, nullptr }, + { { (void*)&C_XorRgn, PTOC_XorRgn }, nullptr }, + { { (void*)&C_PtInRgn, PTOC_PtInRgn }, nullptr }, + { { (void*)&C_RectInRgn, PTOC_RectInRgn }, nullptr }, + { { (void*)&C_SetStdProcs, PTOC_SetStdProcs }, nullptr }, + { { (void*)&C_StdBits, PTOC_StdBits }, nullptr }, + { { (void*)&C_CopyBits, PTOC_CopyBits }, nullptr }, + { { (void*)&C_StdTxMeas, PTOC_StdTxMeas }, nullptr }, + { { (void*)&C_StdGetPic, PTOC_StdGetPic }, nullptr }, + { { (void*)&C_ScrollRect, PTOC_ScrollRect }, nullptr }, + { { (void*)&C_StdPutPic, PTOC_StdPutPic }, nullptr }, + { { (void*)&C_StdComment, PTOC_StdComment }, nullptr }, + { { (void*)&C_PicComment, PTOC_PicComment }, nullptr }, + { { (void*)&C_OpenPicture, PTOC_OpenPicture }, nullptr }, + { { (void*)&C_ClosePicture, PTOC_ClosePicture }, nullptr }, + { { (void*)&C_KillPicture, PTOC_KillPicture }, nullptr }, + { { (void*)&C_DrawPicture, PTOC_DrawPicture }, nullptr }, + unimplemented_toolstuff, + { { (void*)&C_ScalePt, PTOC_ScalePt }, nullptr }, + { { (void*)&C_MapPt, PTOC_MapPt }, nullptr }, + { { (void*)&C_MapRect, PTOC_MapRect }, nullptr }, + { { (void*)&C_MapRgn, PTOC_MapRgn }, nullptr }, + { { (void*)&C_MapPoly, PTOC_MapPoly }, nullptr }, + { { (void*)&_PrGlue, static_cast(-1) }, nullptr }, + { { (void*)&C_InitFonts, PTOC_InitFonts }, nullptr }, + { { (void*)&C_GetFontName, PTOC_GetFontName }, nullptr }, + { { (void*)&C_GetFNum, PTOC_GetFNum }, nullptr }, + { { (void*)&C_FMSwapFont, PTOC_FMSwapFont }, nullptr }, + { { (void*)&C_RealFont, PTOC_RealFont }, nullptr }, + { { (void*)&C_SetFontLock, PTOC_SetFontLock }, nullptr }, + { { (void*)&C_DrawGrowIcon, PTOC_DrawGrowIcon }, nullptr }, + { { (void*)&C_DragGrayRgn, PTOC_DragGrayRgn }, nullptr }, + { { (void*)&C_NewString, PTOC_NewString }, nullptr }, + { { (void*)&C_SetString, PTOC_SetString }, nullptr }, + { { (void*)&C_ShowHide, PTOC_ShowHide }, nullptr }, + { { (void*)&C_CalcVis, PTOC_CalcVis }, nullptr }, + { { (void*)&C_CalcVisBehind, PTOC_CalcVisBehind }, nullptr }, + { { (void*)&C_ClipAbove, PTOC_ClipAbove }, nullptr }, + { { (void*)&C_PaintOne, PTOC_PaintOne }, nullptr }, + { { (void*)&C_PaintBehind, PTOC_PaintBehind }, nullptr }, + { { (void*)&C_SaveOld, PTOC_SaveOld }, nullptr }, + { { (void*)&C_DrawNew, PTOC_DrawNew }, nullptr }, + { { (void*)&C_GetWMgrPort, PTOC_GetWMgrPort }, nullptr }, + { { (void*)&C_CheckUpdate, PTOC_CheckUpdate }, nullptr }, + { { (void*)&C_InitWindows, PTOC_InitWindows }, nullptr }, + { { (void*)&C_NewWindow, PTOC_NewWindow }, nullptr }, + { { (void*)&C_DisposeWindow, PTOC_DisposeWindow }, nullptr }, + { { (void*)&C_ShowWindow, PTOC_ShowWindow }, nullptr }, + { { (void*)&C_HideWindow, PTOC_HideWindow }, nullptr }, + { { (void*)&C_GetWRefCon, PTOC_GetWRefCon }, nullptr }, + { { (void*)&C_SetWRefCon, PTOC_SetWRefCon }, nullptr }, + { { (void*)&C_GetWTitle, PTOC_GetWTitle }, nullptr }, + { { (void*)&C_SetWTitle, PTOC_SetWTitle }, nullptr }, + { { (void*)&C_MoveWindow, PTOC_MoveWindow }, nullptr }, + { { (void*)&C_HiliteWindow, PTOC_HiliteWindow }, nullptr }, + { { (void*)&C_SizeWindow, PTOC_SizeWindow }, nullptr }, + { { (void*)&C_TrackGoAway, PTOC_TrackGoAway }, nullptr }, + { { (void*)&C_SelectWindow, PTOC_SelectWindow }, nullptr }, + { { (void*)&C_BringToFront, PTOC_BringToFront }, nullptr }, + { { (void*)&C_SendBehind, PTOC_SendBehind }, nullptr }, + { { (void*)&C_BeginUpdate, PTOC_BeginUpdate }, nullptr }, + { { (void*)&C_EndUpdate, PTOC_EndUpdate }, nullptr }, + { { (void*)&C_FrontWindow, PTOC_FrontWindow }, nullptr }, + { { (void*)&C_DragWindow, PTOC_DragWindow }, nullptr }, + { { (void*)&C_DragTheRgn, PTOC_DragTheRgn }, nullptr }, + { { (void*)&C_InvalRgn, PTOC_InvalRgn }, nullptr }, + { { (void*)&C_InvalRect, PTOC_InvalRect }, nullptr }, + { { (void*)&C_ValidRgn, PTOC_ValidRgn }, nullptr }, + { { (void*)&C_ValidRect, PTOC_ValidRect }, nullptr }, + { { (void*)&C_GrowWindow, PTOC_GrowWindow }, nullptr }, + { { (void*)&C_FindWindow, PTOC_FindWindow }, nullptr }, + { { (void*)&C_CloseWindow, PTOC_CloseWindow }, nullptr }, + { { (void*)&C_SetWindowPic, PTOC_SetWindowPic }, nullptr }, + { { (void*)&C_GetWindowPic, PTOC_GetWindowPic }, nullptr }, + { { (void*)&C_InitMenus, PTOC_InitMenus }, nullptr }, + { { (void*)&C_NewMenu, PTOC_NewMenu }, nullptr }, + { { (void*)&C_DisposeMenu, PTOC_DisposeMenu }, nullptr }, + { { (void*)&C_AppendMenu, PTOC_AppendMenu }, nullptr }, + { { (void*)&C_ClearMenuBar, PTOC_ClearMenuBar }, nullptr }, + { { (void*)&C_InsertMenu, PTOC_InsertMenu }, nullptr }, + { { (void*)&C_DeleteMenu, PTOC_DeleteMenu }, nullptr }, + { { (void*)&C_DrawMenuBar, PTOC_DrawMenuBar }, nullptr }, + { { (void*)&C_HiliteMenu, PTOC_HiliteMenu }, nullptr }, + { { (void*)&C_EnableItem, PTOC_EnableItem }, nullptr }, + { { (void*)&C_DisableItem, PTOC_DisableItem }, nullptr }, + { { (void*)&C_GetMenuBar, PTOC_GetMenuBar }, nullptr }, + { { (void*)&C_SetMenuBar, PTOC_SetMenuBar }, nullptr }, + { { (void*)&C_MenuSelect, PTOC_MenuSelect }, nullptr }, + { { (void*)&C_MenuKey, PTOC_MenuKey }, nullptr }, + { { (void*)&C_GetItemIcon, PTOC_GetItemIcon }, nullptr }, + { { (void*)&C_SetItemIcon, PTOC_SetItemIcon }, nullptr }, + { { (void*)&C_GetItemStyle, PTOC_GetItemStyle }, nullptr }, + { { (void*)&C_SetItemStyle, PTOC_SetItemStyle }, nullptr }, + { { (void*)&C_GetItemMark, PTOC_GetItemMark }, nullptr }, + { { (void*)&C_SetItemMark, PTOC_SetItemMark }, nullptr }, + { { (void*)&C_CheckItem, PTOC_CheckItem }, nullptr }, + { { (void*)&C_GetItem, PTOC_GetItem }, nullptr }, + { { (void*)&C_SetItem, PTOC_SetItem }, nullptr }, + { { (void*)&C_CalcMenuSize, PTOC_CalcMenuSize }, nullptr }, + { { (void*)&C_GetMHandle, PTOC_GetMHandle }, nullptr }, + { { (void*)&C_SetMenuFlash, PTOC_SetMenuFlash }, nullptr }, + { { (void*)&C_PlotIcon, PTOC_PlotIcon }, nullptr }, + { { (void*)&C_FlashMenuBar, PTOC_FlashMenuBar }, nullptr }, + { { (void*)&C_AddResMenu, PTOC_AddResMenu }, nullptr }, + { { (void*)&C_PinRect, PTOC_PinRect }, nullptr }, + { { (void*)&C_DeltaPoint, PTOC_DeltaPoint }, nullptr }, + { { (void*)&C_CountMItems, PTOC_CountMItems }, nullptr }, + { { (void*)&C_InsertResMenu, PTOC_InsertResMenu }, nullptr }, + { { (void*)&C_DelMenuItem, PTOC_DelMenuItem }, nullptr }, + { { (void*)&C_UpdtControl, PTOC_UpdtControl }, nullptr }, + { { (void*)&C_NewControl, PTOC_NewControl }, nullptr }, + { { (void*)&C_DisposeControl, PTOC_DisposeControl }, nullptr }, + { { (void*)&C_KillControls, PTOC_KillControls }, nullptr }, + { { (void*)&C_ShowControl, PTOC_ShowControl }, nullptr }, + { { (void*)&C_HideControl, PTOC_HideControl }, nullptr }, + { { (void*)&C_MoveControl, PTOC_MoveControl }, nullptr }, + { { (void*)&C_GetCRefCon, PTOC_GetCRefCon }, nullptr }, + { { (void*)&C_SetCRefCon, PTOC_SetCRefCon }, nullptr }, + { { (void*)&C_SizeControl, PTOC_SizeControl }, nullptr }, + { { (void*)&C_HiliteControl, PTOC_HiliteControl }, nullptr }, + { { (void*)&C_GetCTitle, PTOC_GetCTitle }, nullptr }, + { { (void*)&C_SetCTitle, PTOC_SetCTitle }, nullptr }, + { { (void*)&C_GetCtlValue, PTOC_GetCtlValue }, nullptr }, + { { (void*)&C_GetCtlMin, PTOC_GetCtlMin }, nullptr }, + { { (void*)&C_GetCtlMax, PTOC_GetCtlMax }, nullptr }, + { { (void*)&C_SetCtlValue, PTOC_SetCtlValue }, nullptr }, + { { (void*)&C_SetCtlMin, PTOC_SetCtlMin }, nullptr }, + { { (void*)&C_SetCtlMax, PTOC_SetCtlMax }, nullptr }, + { { (void*)&C_TestControl, PTOC_TestControl }, nullptr }, + { { (void*)&C_DragControl, PTOC_DragControl }, nullptr }, + { { (void*)&C_TrackControl, PTOC_TrackControl }, nullptr }, + { { (void*)&C_DrawControls, PTOC_DrawControls }, nullptr }, + { { (void*)&C_GetCtlAction, PTOC_GetCtlAction }, nullptr }, + { { (void*)&C_SetCtlAction, PTOC_SetCtlAction }, nullptr }, + { { (void*)&C_FindControl, PTOC_FindControl }, nullptr }, + { { (void*)&C_Draw1Control, PTOC_Draw1Control }, nullptr }, + { { (void*)&_Dequeue, static_cast(-1) }, nullptr }, + { { (void*)&_Enqueue, static_cast(-1) }, nullptr }, + { { (void*)&C_GetNextEvent, PTOC_GetNextEvent }, nullptr }, + { { (void*)&C_EventAvail, PTOC_EventAvail }, nullptr }, + { { (void*)&C_GetMouse, PTOC_GetMouse }, nullptr }, + { { (void*)&C_StillDown, PTOC_StillDown }, nullptr }, + { { (void*)&C_Button, PTOC_Button }, nullptr }, + { { (void*)&C_TickCount, PTOC_TickCount }, nullptr }, + { { (void*)&C_GetKeys, PTOC_GetKeys }, nullptr }, + { { (void*)&C_WaitMouseUp, PTOC_WaitMouseUp }, nullptr }, + { { (void*)&C_UpdtDialog, PTOC_UpdtDialog }, nullptr }, + { { (void*)&C_CouldDialog, PTOC_CouldDialog }, nullptr }, + { { (void*)&C_FreeDialog, PTOC_FreeDialog }, nullptr }, + { { (void*)&C_InitDialogs, PTOC_InitDialogs }, nullptr }, + { { (void*)&C_GetNewDialog, PTOC_GetNewDialog }, nullptr }, + { { (void*)&C_NewDialog, PTOC_NewDialog }, nullptr }, + { { (void*)&C_SelIText, PTOC_SelIText }, nullptr }, + { { (void*)&C_IsDialogEvent, PTOC_IsDialogEvent }, nullptr }, + { { (void*)&C_DialogSelect, PTOC_DialogSelect }, nullptr }, + { { (void*)&C_DrawDialog, PTOC_DrawDialog }, nullptr }, + { { (void*)&C_CloseDialog, PTOC_CloseDialog }, nullptr }, + { { (void*)&C_DisposDialog, PTOC_DisposDialog }, nullptr }, + { { (void*)&C_FindDItem, PTOC_FindDItem }, nullptr }, + { { (void*)&C_Alert, PTOC_Alert }, nullptr }, + { { (void*)&C_StopAlert, PTOC_StopAlert }, nullptr }, + { { (void*)&C_NoteAlert, PTOC_NoteAlert }, nullptr }, + { { (void*)&C_CautionAlert, PTOC_CautionAlert }, nullptr }, + { { (void*)&C_CouldAlert, PTOC_CouldAlert }, nullptr }, + { { (void*)&C_FreeAlert, PTOC_FreeAlert }, nullptr }, + { { (void*)&C_ParamText, PTOC_ParamText }, nullptr }, + { { (void*)&C_ErrorSound, PTOC_ErrorSound }, nullptr }, + { { (void*)&C_GetDItem, PTOC_GetDItem }, nullptr }, + { { (void*)&C_SetDItem, PTOC_SetDItem }, nullptr }, + { { (void*)&C_SetIText, PTOC_SetIText }, nullptr }, + { { (void*)&C_GetIText, PTOC_GetIText }, nullptr }, + { { (void*)&C_ModalDialog, PTOC_ModalDialog }, nullptr }, + { { (void*)&C_DetachResource, PTOC_DetachResource }, nullptr }, + { { (void*)&C_SetResPurge, PTOC_SetResPurge }, nullptr }, + { { (void*)&C_CurResFile, PTOC_CurResFile }, nullptr }, + { { (void*)&C_InitResources, PTOC_InitResources }, nullptr }, + { { (void*)&C_RsrcZoneInit, PTOC_RsrcZoneInit }, nullptr }, + { { (void*)&C_OpenResFile, PTOC_OpenResFile }, nullptr }, + { { (void*)&C_UseResFile, PTOC_UseResFile }, nullptr }, + { { (void*)&C_UpdateResFile, PTOC_UpdateResFile }, nullptr }, + { { (void*)&C_CloseResFile, PTOC_CloseResFile }, nullptr }, + { { (void*)&C_SetResLoad, PTOC_SetResLoad }, nullptr }, + { { (void*)&C_CountResources, PTOC_CountResources }, nullptr }, + { { (void*)&C_GetIndResource, PTOC_GetIndResource }, nullptr }, + { { (void*)&C_CountTypes, PTOC_CountTypes }, nullptr }, + { { (void*)&C_GetIndType, PTOC_GetIndType }, nullptr }, + { { (void*)&__GetResource, static_cast(-1) }, nullptr }, + { { (void*)&C_GetNamedResource, PTOC_GetNamedResource }, nullptr }, + { { (void*)&C_LoadResource, PTOC_LoadResource }, nullptr }, + { { (void*)&C_ReleaseResource, PTOC_ReleaseResource }, nullptr }, + { { (void*)&C_HomeResFile, PTOC_HomeResFile }, nullptr }, + { { (void*)&C_SizeResource, PTOC_SizeResource }, nullptr }, + { { (void*)&C_GetResAttrs, PTOC_GetResAttrs }, nullptr }, + { { (void*)&C_SetResAttrs, PTOC_SetResAttrs }, nullptr }, + { { (void*)&C_GetResInfo, PTOC_GetResInfo }, nullptr }, + { { (void*)&C_SetResInfo, PTOC_SetResInfo }, nullptr }, + { { (void*)&C_ChangedResource, PTOC_ChangedResource }, nullptr }, + { { (void*)&C_AddResource, PTOC_AddResource }, nullptr }, + unimplemented_toolstuff, + { { (void*)&C_RmveResource, PTOC_RmveResource }, nullptr }, + unimplemented_toolstuff, + { { (void*)&C_ResError, PTOC_ResError }, nullptr }, + { { (void*)&C_WriteResource, PTOC_WriteResource }, nullptr }, + { { (void*)&C_CreateResFile, PTOC_CreateResFile }, nullptr }, + { { (void*)&C_SystemEvent, PTOC_SystemEvent }, nullptr }, + { { (void*)&C_SystemClick, PTOC_SystemClick }, nullptr }, + { { (void*)&C_SystemTask, PTOC_SystemTask }, nullptr }, + { { (void*)&C_SystemMenu, PTOC_SystemMenu }, nullptr }, + { { (void*)&C_OpenDeskAcc, PTOC_OpenDeskAcc }, nullptr }, + { { (void*)&C_CloseDeskAcc, PTOC_CloseDeskAcc }, nullptr }, + { { (void*)&C_GetPattern, PTOC_GetPattern }, nullptr }, + { { (void*)&C_GetCursor, PTOC_GetCursor }, nullptr }, + { { (void*)&C_GetString, PTOC_GetString }, nullptr }, + { { (void*)&C_GetIcon, PTOC_GetIcon }, nullptr }, + { { (void*)&C_GetPicture, PTOC_GetPicture }, nullptr }, + { { (void*)&C_GetNewWindow, PTOC_GetNewWindow }, nullptr }, + { { (void*)&C_GetNewControl, PTOC_GetNewControl }, nullptr }, + { { (void*)&C_GetMenu, PTOC_GetMenu }, nullptr }, + { { (void*)&C_GetNewMBar, PTOC_GetNewMBar }, nullptr }, + { { (void*)&C_UniqueID, PTOC_UniqueID }, nullptr }, + { { (void*)&C_SystemEdit, PTOC_SystemEdit }, nullptr }, + { { (void*)&C_KeyTrans, PTOC_KeyTrans }, nullptr }, + { { (void*)&C_OpenRFPerm, PTOC_OpenRFPerm }, nullptr }, + { { (void*)&C_RsrcMapEntry, PTOC_RsrcMapEntry }, nullptr }, + { { (void*)&_Secs2Date, static_cast(-1) }, nullptr }, + { { (void*)&_Date2Secs, static_cast(-1) }, nullptr }, + { { (void*)&C_SysBeep, PTOC_SysBeep }, nullptr }, + { { (void*)&C_SysError, PTOC_SysError }, nullptr }, + unimplemented_toolstuff, + { { (void*)&C_TEGetText, PTOC_TEGetText }, nullptr }, + { { (void*)&C_TEInit, PTOC_TEInit }, nullptr }, + { { (void*)&C_TEDispose, PTOC_TEDispose }, nullptr }, + { { (void*)&C_TextBox, PTOC_TextBox }, nullptr }, + { { (void*)&C_TESetText, PTOC_TESetText }, nullptr }, + { { (void*)&C_TECalText, PTOC_TECalText }, nullptr }, + { { (void*)&C_TESetSelect, PTOC_TESetSelect }, nullptr }, + { { (void*)&C_TENew, PTOC_TENew }, nullptr }, + { { (void*)&C_TEUpdate, PTOC_TEUpdate }, nullptr }, + { { (void*)&C_TEClick, PTOC_TEClick }, nullptr }, + { { (void*)&C_TECopy, PTOC_TECopy }, nullptr }, + { { (void*)&C_TECut, PTOC_TECut }, nullptr }, + { { (void*)&C_TEDelete, PTOC_TEDelete }, nullptr }, + { { (void*)&C_TEActivate, PTOC_TEActivate }, nullptr }, + { { (void*)&C_TEDeactivate, PTOC_TEDeactivate }, nullptr }, + { { (void*)&C_TEIdle, PTOC_TEIdle }, nullptr }, + { { (void*)&C_TEPaste, PTOC_TEPaste }, nullptr }, + { { (void*)&C_TEKey, PTOC_TEKey }, nullptr }, + { { (void*)&C_TEScroll, PTOC_TEScroll }, nullptr }, + { { (void*)&C_TEInsert, PTOC_TEInsert }, nullptr }, + { { (void*)&C_TESetJust, PTOC_TESetJust }, nullptr }, + { { (void*)&C_Munger, PTOC_Munger }, nullptr }, + { { (void*)&_HandToHand, static_cast(-1) }, nullptr }, + { { (void*)&_PtrToXHand, static_cast(-1) }, nullptr }, + { { (void*)&_PtrToHand, static_cast(-1) }, nullptr }, + { { (void*)&_HandAndHand, static_cast(-1) }, nullptr }, + { { (void*)&C_InitPack, PTOC_InitPack }, nullptr }, + { { (void*)&C_InitAllPacks, PTOC_InitAllPacks }, nullptr }, + { { (void*)&_Pack0, static_cast(-1) }, nullptr }, + { { (void*)&C_Pack1, static_cast(PTOC_Pack1) }, nullptr }, + { { (void*)&_Pack2, static_cast(-1) }, nullptr }, + { { (void*)&_Pack3, static_cast(-1) }, nullptr }, + { { (void*)&_Pack4, static_cast(-1) }, nullptr }, + { { (void*)&_Pack5, static_cast(-1) }, nullptr }, + { { (void*)&_Pack6, static_cast(-1) }, nullptr }, + { { (void*)&_Pack7, static_cast(-1) }, nullptr }, + { { (void*)&_PtrAndHand, static_cast(-1) }, nullptr }, + { { (void*)&_LoadSeg, static_cast(-1) }, nullptr }, + { { (void*)&C_UnloadSeg, PTOC_UnloadSeg }, nullptr }, + { { (void*)&_Launch, static_cast(-1) }, nullptr }, + { { (void*)&_Chain, static_cast(-1) }, nullptr }, + { { (void*)&C_ExitToShell, PTOC_ExitToShell }, nullptr }, + { { (void*)&C_GetAppParms, PTOC_GetAppParms }, nullptr }, + { { (void*)&C_GetResFileAttrs, PTOC_GetResFileAttrs }, nullptr }, + { { (void*)&C_SetResFileAttrs, PTOC_SetResFileAttrs }, nullptr }, + unimplemented_toolstuff, + { { (void*)&C_InfoScrap, PTOC_InfoScrap }, nullptr }, + { { (void*)&C_UnloadScrap, PTOC_UnloadScrap }, nullptr }, + { { (void*)&C_LoadScrap, PTOC_LoadScrap }, nullptr }, + { { (void*)&C_ZeroScrap, PTOC_ZeroScrap }, nullptr }, + { { (void*)&C_GetScrap, PTOC_GetScrap }, nullptr }, + { { (void*)&C_PutScrap, PTOC_PutScrap }, nullptr }, + { { (void*)&_Debugger, static_cast(-1) }, nullptr }, + { { (void*)&C_OpenCPort, PTOC_OpenCPort }, nullptr }, + { { (void*)&C_InitCPort, PTOC_InitCPort }, nullptr }, + { { (void*)&C_CloseCPort, PTOC_CloseCPort }, nullptr }, + { { (void*)&C_NewPixMap, PTOC_NewPixMap }, nullptr }, + { { (void*)&C_DisposPixMap, PTOC_DisposPixMap }, nullptr }, + { { (void*)&C_CopyPixMap, PTOC_CopyPixMap }, nullptr }, + { { (void*)&C_SetPortPix, PTOC_SetPortPix }, nullptr }, + { { (void*)&C_NewPixPat, PTOC_NewPixPat }, nullptr }, + { { (void*)&C_DisposPixPat, PTOC_DisposPixPat }, nullptr }, + { { (void*)&C_CopyPixPat, PTOC_CopyPixPat }, nullptr }, + { { (void*)&C_PenPixPat, PTOC_PenPixPat }, nullptr }, + { { (void*)&C_BackPixPat, PTOC_BackPixPat }, nullptr }, + { { (void*)&C_GetPixPat, PTOC_GetPixPat }, nullptr }, + { { (void*)&C_MakeRGBPat, PTOC_MakeRGBPat }, nullptr }, + { { (void*)&C_FillCRect, PTOC_FillCRect }, nullptr }, + { { (void*)&C_FillCOval, PTOC_FillCOval }, nullptr }, + { { (void*)&C_FillCRoundRect, PTOC_FillCRoundRect }, nullptr }, + { { (void*)&C_FillCArc, PTOC_FillCArc }, nullptr }, + { { (void*)&C_FillCRgn, PTOC_FillCRgn }, nullptr }, + { { (void*)&C_FillCPoly, PTOC_FillCPoly }, nullptr }, + { { (void*)&C_RGBForeColor, PTOC_RGBForeColor }, nullptr }, + { { (void*)&C_RGBBackColor, PTOC_RGBBackColor }, nullptr }, + { { (void*)&C_SetCPixel, PTOC_SetCPixel }, nullptr }, + { { (void*)&C_GetCPixel, PTOC_GetCPixel }, nullptr }, + { { (void*)&C_GetCTable, PTOC_GetCTable }, nullptr }, + { { (void*)&C_GetForeColor, PTOC_GetForeColor }, nullptr }, + { { (void*)&C_GetBackColor, PTOC_GetBackColor }, nullptr }, + { { (void*)&C_GetCCursor, PTOC_GetCCursor }, nullptr }, + { { (void*)&C_SetCCursor, PTOC_SetCCursor }, nullptr }, + { { (void*)&C_AllocCursor, PTOC_AllocCursor }, nullptr }, + { { (void*)&C_GetCIcon, PTOC_GetCIcon }, nullptr }, + { { (void*)&C_PlotCIcon, PTOC_PlotCIcon }, nullptr }, + { { (void*)&C_OpenCPicture, PTOC_OpenCPicture }, nullptr }, + { { (void*)&C_OpColor, PTOC_OpColor }, nullptr }, + { { (void*)&C_HiliteColor, PTOC_HiliteColor }, nullptr }, + { { (void*)&C_CharExtra, PTOC_CharExtra }, nullptr }, + { { (void*)&C_DisposCTable, PTOC_DisposCTable }, nullptr }, + { { (void*)&C_DisposeCIcon, PTOC_DisposeCIcon }, nullptr }, + { { (void*)&C_DisposCCursor, PTOC_DisposCCursor }, nullptr }, + { { (void*)&C_GetMaxDevice, PTOC_GetMaxDevice }, nullptr }, + { { (void*)&C_GetCTSeed, PTOC_GetCTSeed }, nullptr }, + { { (void*)&C_GetDeviceList, PTOC_GetDeviceList }, nullptr }, + { { (void*)&C_GetMainDevice, PTOC_GetMainDevice }, nullptr }, + { { (void*)&C_GetNextDevice, PTOC_GetNextDevice }, nullptr }, + { { (void*)&C_TestDeviceAttribute, PTOC_TestDeviceAttribute }, nullptr }, + { { (void*)&C_SetDeviceAttribute, PTOC_SetDeviceAttribute }, nullptr }, + { { (void*)&C_InitGDevice, PTOC_InitGDevice }, nullptr }, + { { (void*)&C_NewGDevice, PTOC_NewGDevice }, nullptr }, + { { (void*)&C_DisposGDevice, PTOC_DisposGDevice }, nullptr }, + { { (void*)&C_SetGDevice, PTOC_SetGDevice }, nullptr }, + { { (void*)&C_GetGDevice, PTOC_GetGDevice }, nullptr }, + { { (void*)&C_Color2Index, PTOC_Color2Index }, nullptr }, + { { (void*)&C_Index2Color, PTOC_Index2Color }, nullptr }, + { { (void*)&C_InvertColor, PTOC_InvertColor }, nullptr }, + { { (void*)&C_RealColor, PTOC_RealColor }, nullptr }, + { { (void*)&C_GetSubTable, PTOC_GetSubTable }, nullptr }, + unimplemented_toolstuff, + { { (void*)&C_MakeITable, PTOC_MakeITable }, nullptr }, + { { (void*)&C_AddSearch, PTOC_AddSearch }, nullptr }, + { { (void*)&C_AddComp, PTOC_AddComp }, nullptr }, + { { (void*)&C_SetClientID, PTOC_SetClientID }, nullptr }, + { { (void*)&C_ProtectEntry, PTOC_ProtectEntry }, nullptr }, + { { (void*)&C_ReserveEntry, PTOC_ReserveEntry }, nullptr }, + { { (void*)&C_SetEntries, PTOC_SetEntries }, nullptr }, + { { (void*)&C_QDError, PTOC_QDError }, nullptr }, + { { (void*)&C_SetWinColor, PTOC_SetWinColor }, nullptr }, + { { (void*)&C_GetAuxWin, PTOC_GetAuxWin }, nullptr }, + { { (void*)&C_SetCtlColor, PTOC_SetCtlColor }, nullptr }, + { { (void*)&C_GetAuxCtl, PTOC_GetAuxCtl }, nullptr }, + { { (void*)&C_NewCWindow, PTOC_NewCWindow }, nullptr }, + { { (void*)&C_GetNewCWindow, PTOC_GetNewCWindow }, nullptr }, + { { (void*)&C_SetDeskCPat, PTOC_SetDeskCPat }, nullptr }, + { { (void*)&C_GetCWMgrPort, PTOC_GetCWMgrPort }, nullptr }, + { { (void*)&C_SaveEntries, PTOC_SaveEntries }, nullptr }, + { { (void*)&C_RestoreEntries, PTOC_RestoreEntries }, nullptr }, + { { (void*)&C_NewCDialog, PTOC_NewCDialog }, nullptr }, + { { (void*)&C_DelSearch, PTOC_DelSearch }, nullptr }, + { { (void*)&C_DelComp, PTOC_DelComp }, nullptr }, + { { (void*)&C_SetStdCProcs, PTOC_SetStdCProcs }, nullptr }, + { { (void*)&C_CalcCMask, PTOC_CalcCMask }, nullptr }, + { { (void*)&C_SeedCFill, PTOC_SeedCFill }, nullptr }, + { { (void*)&C_IMVI_CopyDeepMask, PTOC_IMVI_CopyDeepMask }, nullptr }, + { { (void*)&_HighLevelFSDispatch, static_cast(-1) }, nullptr }, /* AA52 */ + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, +#if (!defined (powerpc) && !defined (__ppc__)) || defined (CFM_PROBLEMS) + unimplemented_toolstuff, + unimplemented_toolstuff, /* AA5A */ +#else + { { (void*)&_MixedMode, static_cast(-1) }, nullptr }, + { { (void*)&_CodeFragment, static_cast(-1) }, nullptr }, /* AA5A */ +#endif + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + { { (void*)&C_DelMCEntries, PTOC_DelMCEntries }, nullptr }, + { { (void*)&C_GetMCInfo, PTOC_GetMCInfo }, nullptr }, + { { (void*)&C_SetMCInfo, PTOC_SetMCInfo }, nullptr }, + { { (void*)&C_DispMCInfo, PTOC_DispMCInfo }, nullptr }, + { { (void*)&C_GetMCEntry, PTOC_GetMCEntry }, nullptr }, + { { (void*)&C_SetMCEntries, PTOC_SetMCEntries }, nullptr }, + { { (void*)&C_MenuChoice, PTOC_MenuChoice }, nullptr }, + unimplemented_toolstuff, + { { (void*)&_DialogDispatch, static_cast(-1) }, nullptr }, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + { { (void*)&C_InitPalettes, PTOC_InitPalettes }, nullptr }, + { { (void*)&C_NewPalette, PTOC_NewPalette }, nullptr }, + { { (void*)&C_GetNewPalette, PTOC_GetNewPalette }, nullptr }, + { { (void*)&C_DisposePalette, PTOC_DisposePalette }, nullptr }, + { { (void*)&C_ActivatePalette, PTOC_ActivatePalette }, nullptr }, + { { (void*)&C_NSetPalette, PTOC_NSetPalette }, nullptr }, + { { (void*)&C_GetPalette, PTOC_GetPalette }, nullptr }, + { { (void*)&C_PmForeColor, PTOC_PmForeColor }, nullptr }, + { { (void*)&C_PmBackColor, PTOC_PmBackColor }, nullptr }, + { { (void*)&C_AnimateEntry, PTOC_AnimateEntry }, nullptr }, + { { (void*)&C_AnimatePalette, PTOC_AnimatePalette }, nullptr }, + { { (void*)&C_GetEntryColor, PTOC_GetEntryColor }, nullptr }, + { { (void*)&C_SetEntryColor, PTOC_SetEntryColor }, nullptr }, + { { (void*)&C_GetEntryUsage, PTOC_GetEntryUsage }, nullptr }, + { { (void*)&C_SetEntryUsage, PTOC_SetEntryUsage }, nullptr }, + { { (void*)&C_CTab2Palette, PTOC_CTab2Palette }, nullptr }, + { { (void*)&C_Palette2CTab, PTOC_Palette2CTab }, nullptr }, + { { (void*)&C_CopyPalette, PTOC_CopyPalette }, nullptr }, + { { (void*)&_PaletteDispatch, static_cast(-1) }, nullptr }, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + { { (void*)&_QuickTime, static_cast(-1) }, nullptr }, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, +#if defined (powerpc) && !defined (__ppc__) + { { (void*)&_modeswitch, static_cast(-1) }, nullptr }, +#else + unimplemented_toolstuff, +#endif + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + { { (void*)&_WackyQD32Trap, static_cast(-1) }, nullptr }, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + { { (void*)&_QDExtensions, static_cast(-1) }, nullptr }, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + { { (void*)&_IconDispatch, static_cast(-1) }, nullptr }, + { { (void*)&C_DeviceLoop, PTOC_DeviceLoop }, nullptr }, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + unimplemented_toolstuff, + { { (void*)&_DebugStr, static_cast(-1) }, nullptr }, +}; + +toolstuff_t Executor::pstuff[] = { + { { (void*)&C_ROMlib_mytrack, PTOC_ROMlib_mytrack }, nullptr }, + { { (void*)&C_ROMlib_stdftrack, PTOC_ROMlib_stdftrack }, nullptr }, + { { (void*)&C_ROMlib_myfilt, PTOC_ROMlib_myfilt }, nullptr }, + { { (void*)&C_ROMlib_stdffilt, PTOC_ROMlib_stdffilt }, nullptr }, + { { (void*)&C_ROMlib_numsonlyfilterproc, + PTOC_ROMlib_numsonlyfilterproc }, nullptr }, + { { (void*)&C_ROMlib_stlfilterproc, PTOC_ROMlib_stlfilterproc }, nullptr }, + +/* NOTE: the following four routines don't really use pascal calling + conventions, but we do need pstuff entries for them so we can + look for their addresses and short circuit calls to them. The + zero is correct because they take no args and return no value */ + + { { (void*)&C_ROMlib_wakeup, 0 }, nullptr }, + { { (void*)&C_ROMlib_vcatch, 0 }, nullptr }, + { { (void*)C_ROMlib_dotext, 0 }, nullptr }, + { { (void*)&C_handle_refresh, 0 }, nullptr }, + + { { (void*)&C_ROMlib_mysound, PTOC_ROMlib_mysound }, nullptr }, + { { (void*)&C_ROMlib_myjobproc, PTOC_ROMlib_myjobproc }, nullptr }, + { { (void*)&C_ROMlib_mystlproc, PTOC_ROMlib_mystlproc }, nullptr }, + + { { (void*)C_cdef0, PTOC_cdef0 }, nullptr }, + { { (void*)&C_cdef16, PTOC_cdef16 }, nullptr }, + { { (void*)&C_ldef0, PTOC_ldef0 }, nullptr }, + { { (void*)&C_mdef0, PTOC_mdef0 }, nullptr }, + { { (void*)&C_mbdf0, PTOC_mbdf0 }, nullptr }, + { { (void*)C_wdef0, PTOC_wdef0 }, nullptr }, + { { (void*)&C_wdef16, PTOC_wdef16 }, nullptr }, + { { (void*)&C_snth5, PTOC_snth5 }, nullptr }, + + { { (void*)&C_IUMagString, PTOC_IUMagString }, nullptr }, + { { (void*)&C_PrStlInit, PTOC_PrStlInit }, nullptr }, + { { (void*)C_PrJobInit, PTOC_PrJobInit }, nullptr }, + + { { (void*)C_StdText, PTOC_StdText }, nullptr }, + { { (void*)C_StdLine, PTOC_StdLine }, nullptr }, + { { (void*)C_StdRect, PTOC_StdRect }, nullptr }, + { { (void*)&C_StdOval, PTOC_StdOval }, nullptr }, + { { (void*)C_StdRRect, PTOC_StdRRect }, nullptr }, + { { (void*)C_StdArc, PTOC_StdArc }, nullptr }, + { { (void*)&C_StdRgn, PTOC_StdRgn }, nullptr }, + { { (void*)&C_StdPoly, PTOC_StdPoly }, nullptr }, + { { (void*)C_StdBits, PTOC_StdBits }, nullptr }, + { { (void*)&C_StdComment, PTOC_StdComment }, nullptr }, + { { (void*)C_StdTxMeas, PTOC_StdTxMeas }, nullptr }, + { { (void*)C_StdPutPic, PTOC_StdPutPic }, nullptr }, + + { { (void*)&C_FMSwapFont, PTOC_FMSwapFont }, nullptr}, + { { (void*)&C_InitCursor, PTOC_InitCursor }, nullptr}, + + { { (void*)&C_textasPS, PTOC_textasPS }, nullptr}, + { { (void*)&C_PrText, PTOC_PrText }, nullptr}, + { { (void*)&C_PrLine, PTOC_PrLine }, nullptr}, + { { (void*)&C_PrRect, PTOC_PrRect }, nullptr}, + { { (void*)&C_PrRRect, PTOC_PrRRect }, nullptr}, + { { (void*)&C_PrOval, PTOC_PrOval }, nullptr}, + { { (void*)&C_PrArc, PTOC_PrArc }, nullptr}, + { { (void*)&C_PrPoly, PTOC_PrPoly }, nullptr}, + { { (void*)&C_PrRgn, PTOC_PrRgn }, nullptr}, + { { (void*)&C_PrBits, PTOC_PrBits }, nullptr}, + { { (void*)&C_PrComment, PTOC_PrComment }, nullptr}, + { { (void*)&C_PrTxMeas, PTOC_PrTxMeas }, nullptr}, + { { (void*)&C_PrGetPic, PTOC_PrGetPic }, nullptr}, + { { (void*)&C_PrPutPic, PTOC_PrPutPic }, nullptr}, + { { (void*)&C_donotPrText, PTOC_donotPrText }, nullptr}, + { { (void*)&C_donotPrLine, PTOC_donotPrLine }, nullptr}, + { { (void*)&C_donotPrRect, PTOC_donotPrRect }, nullptr}, + { { (void*)&C_donotPrRRect, PTOC_donotPrRRect }, nullptr}, + { { (void*)&C_donotPrOval, PTOC_donotPrOval }, nullptr}, + { { (void*)&C_donotPrArc, PTOC_donotPrArc }, nullptr}, + { { (void*)&C_donotPrPoly, PTOC_donotPrPoly }, nullptr}, + { { (void*)&C_donotPrRgn, PTOC_donotPrRgn }, nullptr}, + { { (void*)&C_donotPrBits, PTOC_donotPrBits }, nullptr}, + { { (void*)&C_donotPrGetPic, PTOC_donotPrGetPic }, nullptr}, + { { (void*)&C_donotPrPutPic, PTOC_donotPrPutPic }, nullptr}, + { { (void*)&C_ROMlib_filebox, PTOC_ROMlib_filebox }, nullptr}, + { { (void*)&C_StdGetPic, PTOC_StdGetPic }, nullptr}, + + { { (void*)&_flushcache, static_cast(-1) }, nullptr}, + { { (void*)&_Key1Trans, static_cast(-1) }, nullptr}, + { { (void*)&_Key2Trans, static_cast(-1) }, nullptr}, + + { { NULL /* was C_ROMlib_licensefilt */, 0 /* was PTOC_ROMlib_licensefilt */ }, nullptr }, + { { (void*)&C_unixmount, PTOC_unixmount }, nullptr }, + { { (void*)&C_GestaltTablesOnly, PTOC_GestaltTablesOnly }, nullptr }, + { { (void*)&C_sound_timer_handler, 0 }, nullptr }, + { { (void*)&C_adb_service_stub, 0 }, nullptr }, + { { (void*)&C_cdef1008, PTOC_cdef1008 }, nullptr }, + { { (void*)&_bad_trap_unimplemented, static_cast(-1) }, nullptr }, + { { (void*)&C_pack8_unknown_selector, PTOC_pack8_unknown_selector }, nullptr }, + { { (void*)&C_PhysicalGestalt, PTOC_PhysicalGestalt }, nullptr }, + + { { (void*)&C_HideCursor, PTOC_HideCursor }, nullptr }, + { { (void*)&C_ShowCursor, PTOC_ShowCursor }, nullptr }, + { { (void*)&C_ShieldCursor, PTOC_ShieldCursor }, nullptr }, + { { (void*)&C_SetCursor, PTOC_SetCursor }, nullptr }, + { { (void*)&C_ObscureCursor, PTOC_ObscureCursor }, nullptr }, + { { (void*)&C_unknown574, PTOC_ShowCursor }, nullptr }, + + { { (void*)&C_ROMlib_circle_ok, PTOC_ROMlib_circle_ok }, nullptr}, + { { (void*)&C_ROMlib_orientation, PTOC_ROMlib_orientation }, nullptr}, + + { { (void*)&C_new_draw_scroll, PTOC_DeviceLoopDrawingProcTemplate }, nullptr}, + { { (void*)&C_new_pos_ctl, PTOC_DeviceLoopDrawingProcTemplate }, nullptr}, +}; + +static void *fsroutines[][2] = { + { /* 0xA000 */ (void*)PBOpen, (void*)PBHOpen /* 0 */ }, +#define OPENTRAP 0 +#define OPENINDEX 0 + + { /* 0xA001 */ (void*)PBClose, (void*)PBClose /* 1 */ }, +#define CLOSETRAP 1 +#define CLOSEINDEX 1 + + { /* 0xA002 */ (void*)PBRead, (void*)PBRead /* 2 */ }, +#define READTRAP 2 +#define READINDEX 2 + + { /* 0xA003 */ (void*)PBWrite, (void*)PBWrite /* 3 */ }, +#define WRITETRAP 3 +#define WRITEINDEX 3 + + { /* 0xA004 */ (void*)PBControl, (void*)PBControl /* 4 */ }, +#define CONTROLTRAP 4 +#define CONTROLINDEX 4 + + { /* 0xA005 */ (void*)PBStatus, (void*)PBStatus /* 5 */ }, +#define STATUSTRAP 5 +#define STATUSINDEX 5 + + { /* 0xA006 */ (void*)PBKillIO, (void*)PBKillIO /* 6 */ }, +#define KILLIOTRAP 6 +#define KILLIOINDEX 6 + + { /* 0xA007 */ (void*)PBGetVInfo, (void*)PBHGetVInfo /* 7 */ }, +#define GETVINFOTRAP 7 +#define GETVINFOINDEX 7 + + { /* 0xA008 */ (void*)PBCreate, (void*)PBHCreate /* 8 */ }, +#define CREATETRAP 8 +#define CREATEINDEX 8 + + { /* 0xA009 */ (void*)PBDelete, (void*)PBHDelete /* 9 */ }, +#define DELETETRAP 9 +#define DELETEINDEX 9 + + { /* 0xA00A */ (void*)PBOpenRF, (void*)PBHOpenRF /* 10 */ }, +#define OPENRFTRAP 0xA +#define OPENRFINDEX 10 + + { /* 0xA00B */ (void*)PBRename, (void*)PBHRename /* 11 */ }, +#define RENAMETRAP 0xB +#define RENAMEINDEX 11 + + { /* 0xA00C */ (void*)PBGetFInfo, (void*)PBHGetFInfo /* 12 */ }, +#define GETFINFOTRAP 0xC +#define GETFINFOINDEX 12 + + { /* 0xA00D */ (void*)PBSetFInfo, (void*)PBHSetFInfo /* 13 */ }, +#define SETFINFOTRAP 0xD +#define SETFINFOINDEX 13 + + { /* 0xA00E */ (void*)PBUnmountVol, (void*)PBUnmountVol /* 14 */ }, +#define UNMOUNTVOLTRAP 0xE +#define UNMOUNTVOLINDEX 14 + + { /* 0xA00F */ (void*)PBMountVol, (void*)PBMountVol /* 15 */ }, +#define MOUNTVOLTRAP 0xF +#define MOUNTVOLINDEX 15 + + { /* 0xA010 */ (void*)PBAllocate, (void*)PBAllocate /* 16 */ }, +#define ALLOCATETRAP 0x10 +#define ALLOCATEINDEX 16 + + { /* 0xA011 */ (void*)PBGetEOF, (void*)PBGetEOF /* 17 */ }, +#define GETEOFTRAP 0x11 +#define GETEOFINDEX 17 + + { /* 0xA012 */ (void*)PBSetEOF, (void*)PBSetEOF /* 18 */ }, +#define SETEOFTRAP 0x12 +#define SETEOFINDEX 18 + + { /* 0xA013 */ (void*)PBFlushVol, (void*)PBFlushVol /* 19 */ }, +#define FLUSHVOLTRAP 0x13 +#define FLUSHVOLINDEX 19 + + { /* 0xA014 */ (void*)PBGetVol, (void*)PBHGetVol /* 20 */ }, +#define GETVOLTRAP 0x14 +#define GETVOLINDEX 20 + + { /* 0xA015 */ (void*)PBSetVol, (void*)PBHSetVol /* 21 */ }, +#define SETVOLTRAP 0x15 +#define SETVOLINDEX 21 + + { /* 0xA017 */ (void*)PBEject, (void*)PBEject /* 22 */ }, +#define EJECTTRAP 0x17 +#define EJECTINDEX 22 + + { /* 0xA018 */ (void*)PBGetFPos, (void*)PBGetFPos /* 23 */ }, +#define GETFPOSTRAP 0x18 +#define GETFPOSINDEX 23 + + { /* 0xA035 */ (void*)PBOffLine, (void*)PBOffLine /* 24 */ }, +#define OFFLINETRAP 0x35 +#define OFFLINEINDEX 24 + + { /* 0xA041 */ (void*)PBSetFLock, (void*)PBHSetFLock /* 25 */ }, +#define SETFLOCKTRAP 0x41 +#define SETFLOCKINDEX 25 + + { /* 0xA042 */ (void*)PBRstFLock, (void*)PBHRstFLock /* 26 */ }, +#define RSTFLOCKTRAP 0x42 +#define RSTFLOCKINDEX 26 + + { /* 0xA043 */ (void*)PBSetFVers, (void*)PBSetFVers /* 27 */ }, +#define SETFVERSTRAP 0x43 +#define SETFVERSINDEX 27 + + { /* 0xA044 */ (void*)PBSetFPos, (void*)PBSetFPos /* 28 */ }, +#define SETFPOSTRAP 0x44 +#define SETFPOSINDEX 28 + + { /* 0xA045 */ (void*)PBFlushFile, (void*)PBFlushFile /* 29 */ }, +#define FLUSHFILETRAP 0x45 +#define FLUSHFILEINDEX 29 + +}; + +osstuff_t Executor::osstuff[0x100] = { + { nullptr, (void*)PBOpen }, + { nullptr, (void*)PBClose }, + { nullptr, (void*)PBRead }, + { nullptr, (void*)PBWrite }, + { nullptr, (void*)PBControl }, + { nullptr, (void*)PBStatus }, + { nullptr, (void*)PBKillIO }, + { nullptr, (void*)PBGetVInfo }, + { nullptr, (void*)PBCreate }, + { nullptr, (void*)PBDelete }, + { nullptr, (void*)PBOpenRF }, + { nullptr, (void*)PBRename }, + { nullptr, (void*)PBGetFInfo }, + { nullptr, (void*)PBSetFInfo }, + { nullptr, (void*)PBUnmountVol }, + { nullptr, (void*)PBMountVol }, + { nullptr, (void*)PBAllocate }, + { nullptr, (void*)PBGetEOF }, + { nullptr, (void*)PBSetEOF }, + { nullptr, (void*)PBFlushVol }, + { nullptr, (void*)PBGetVol }, + { nullptr, (void*)PBSetVol }, + { nullptr, (void*)_FInitQueue }, + { nullptr, (void*)PBEject }, + { nullptr, (void*)PBGetFPos }, + { nullptr, (void*)_InitZone }, + { nullptr, (void*)_GetZone }, + { nullptr, (void*)_SetZone }, + { nullptr, (void*)_FreeMem }, + { nullptr, (void*)_MaxMem }, + { nullptr, (void*)_NewPtr }, + { nullptr, (void*)_DisposPtr }, + { nullptr, (void*)_SetPtrSize }, + { nullptr, (void*)_GetPtrSize }, + { nullptr, (void*)_NewHandle }, + { nullptr, (void*)_DisposHandle }, + { nullptr, (void*)_SetHandleSize }, + { nullptr, (void*)_GetHandleSize }, + { nullptr, (void*)_HandleZone }, + { nullptr, (void*)_ReallocHandle }, + { nullptr, (void*)_RecoverHandle }, + { nullptr, (void*)_HLock }, + { nullptr, (void*)_HUnlock }, + { nullptr, (void*)_EmptyHandle }, + { nullptr, (void*)_InitApplZone }, + { nullptr, (void*)_SetApplLimit }, + { nullptr, (void*)_BlockMove }, + { nullptr, (void*)_PostEvent }, + { nullptr, (void*)_OSEventAvail }, + { nullptr, (void*)_GetOSEvent }, + { nullptr, (void*)_FlushEvents }, + { nullptr, (void*)_VInstall }, + { nullptr, (void*)_VRemove }, + { nullptr, (void*)PBOffLine }, + { nullptr, (void*)_MoreMasters }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_WriteParam }, + { nullptr, (void*)_ReadDateTime }, + { nullptr, (void*)_SetDateTime }, + { nullptr, (void*)_Delay }, + { nullptr, (void*)_EqualString }, + { nullptr, (void*)_DrvrInstall }, + { nullptr, (void*)_DrvrRemove }, + { nullptr, (void*)_InitUtil }, + { nullptr, (void*)_ResrvMem }, + { nullptr, (void*)PBSetFLock }, + { nullptr, (void*)PBRstFLock }, + { nullptr, (void*)PBSetFVers }, + { nullptr, (void*)PBSetFPos }, + { nullptr, (void*)PBFlushFile }, + { nullptr, (void*)_GetTrapAddress }, + { nullptr, (void*)_SetTrapAddress }, + { nullptr, (void*)_PtrZone }, + { nullptr, (void*)_HPurge }, + { nullptr, (void*)_HNoPurge }, + { nullptr, (void*)_SetGrowZone }, + { nullptr, (void*)_CompactMem }, + { nullptr, (void*)_PurgeMem }, + { nullptr, (void*)_AddDrive }, + { nullptr, (void*)_RDrvrInstall }, + { nullptr, (void*)_RelString }, + { nullptr, (void*)_IMVI_ReadXPRam }, + { nullptr, (void*)_IMVI_WriteXPRam }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_UprString }, + { nullptr, (void*)_StripAddress }, + { nullptr, (void*)_IMVI_LowerText }, + { nullptr, (void*)_SetApplBase }, + { nullptr, (void*)_InsTime }, + { nullptr, (void*)_RmvTime }, + { nullptr, (void*)_PrimeTime }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_IMVI_MemoryDispatch }, + { nullptr, (void*)_SwapMMUMode }, + { nullptr, (void*)_NMInstall }, + { nullptr, (void*)_NMRemove }, + { nullptr, (void*)_HFSDispatch }, + { nullptr, (void*)_MaxBlock }, + { nullptr, (void*)_PurgeSpace }, + { nullptr, (void*)_MaxApplZone }, + { nullptr, (void*)_MoveHHi }, + { nullptr, (void*)_StackSpace }, + { nullptr, (void*)_NewEmptyHandle }, + { nullptr, (void*)_HSetRBit }, + { nullptr, (void*)_HClrRBit }, + { nullptr, (void*)_HGetState }, + { nullptr, (void*)_HSetState }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_SlotManager }, + { nullptr, (void*)_SlotVInstall }, + { nullptr, (void*)_SlotVRemove }, + { nullptr, (void*)_AttachVBL }, + { nullptr, (void*)_DoVBLTask }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_DTInstall }, + { nullptr, (void*)_SIntRemove }, + { nullptr, (void*)_CountADBs }, + { nullptr, (void*)_GetIndADB }, + { nullptr, (void*)_GetADBInfo }, + { nullptr, (void*)_SetADBInfo }, + { nullptr, (void*)_ADBReInit }, + { nullptr, (void*)_ADBOp }, + { nullptr, (void*)_GetDefaultStartup }, + { nullptr, (void*)_SetDefaultStartup }, + { nullptr, (void*)_InternalWait }, + { nullptr, (void*)_GetVideoDefault }, + { nullptr, (void*)_SetVideoDefault }, + { nullptr, (void*)_SIntInstall }, + { nullptr, (void*)_SetOSDefault }, + { nullptr, (void*)_GetOSDefault }, + { nullptr, (void*)_IMVI_IdleUpdate }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_IMVI_SlpQInstall }, + { nullptr, (void*)_CommToolboxDispatch }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_IMVI_DebugUtil }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_IMVI_DeferUserFn }, + { nullptr, (void*)_SysEnvirons }, + { nullptr, (void*)_IMVI_Translate24To32 }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Microseconds }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_HWPriv }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Gestalt }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_flushcache }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_IMVI_PPC }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_ResourceStub }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, + { nullptr, (void*)_Unimplemented }, +}; + +PUBLIC void Executor::filltables( void ) +{ + int i, fsindex; + syn68k_addr_t unimpl = 0; + + unimpl = callback_install( (callback_handler_t) (void*)_Unimplemented, + nullptr); + + for (i = 0; i < (int) NELEM(tooltraptable); ++i) + tooltraptable[i] = toolstuff[i].orig = (void *) + ((toolstuff[i].ptoc.wheretogo == (void*)_Unimplemented) ? + unimpl + : + callback_install( (callback_handler_t) + (toolstuff[i].ptoc.magic != (ULONGINT) -1 ? + (void*)PascalToCCall + : + toolstuff[i].ptoc.wheretogo), + &toolstuff[i].ptoc )); + + for (i = 0; i < (int) NELEM(pstuff); ++i) + pstuff[i].orig = ((void *) + ((pstuff[i].ptoc.wheretogo == (void*)_Unimplemented) + ? SYN68K_TO_US (unimpl) + : SYN68K_TO_US (callback_install((callback_handler_t) + ((pstuff[i].ptoc.magic + != (ULONGINT) -1) + ? (void*)PascalToCCall + : pstuff[i].ptoc.wheretogo), + &pstuff[i].ptoc )))); + + for (i = 0; i < (int) NELEM(ostraptable); ++i) { + switch (i) { + case OPENTRAP: + fsindex = OPENINDEX; + break; + case CLOSETRAP: + fsindex = CLOSEINDEX; + break; + case READTRAP: + fsindex = READINDEX; + break; + case WRITETRAP: + fsindex = WRITEINDEX; + break; + case CONTROLTRAP: + fsindex = CONTROLINDEX; + break; + case STATUSTRAP: + fsindex = STATUSINDEX; + break; + case KILLIOTRAP: + fsindex = KILLIOINDEX; + break; + case GETVINFOTRAP: + fsindex = GETVINFOINDEX; + break; + case CREATETRAP: + fsindex = CREATEINDEX; + break; + case DELETETRAP: + fsindex = DELETEINDEX; + break; + case OPENRFTRAP: + fsindex = OPENRFINDEX; + break; + case RENAMETRAP: + fsindex = RENAMEINDEX; + break; + case GETFINFOTRAP: + fsindex = GETFINFOINDEX; + break; + case SETFINFOTRAP: + fsindex = SETFINFOINDEX; + break; + case UNMOUNTVOLTRAP: + fsindex = UNMOUNTVOLINDEX; + break; + case MOUNTVOLTRAP: + fsindex = MOUNTVOLINDEX; + break; + case ALLOCATETRAP: + fsindex = ALLOCATEINDEX; + break; + case GETEOFTRAP: + fsindex = GETEOFINDEX; + break; + case SETEOFTRAP: + fsindex = SETEOFINDEX; + break; + case FLUSHVOLTRAP: + fsindex = FLUSHVOLINDEX; + break; + case GETVOLTRAP: + fsindex = GETVOLINDEX; + break; + case SETVOLTRAP: + fsindex = SETVOLINDEX; + break; + case EJECTTRAP: + fsindex = EJECTINDEX; + break; + case GETFPOSTRAP: + fsindex = GETFPOSINDEX; + break; + case OFFLINETRAP: + fsindex = OFFLINEINDEX; + break; + case SETFLOCKTRAP: + fsindex = SETFLOCKINDEX; + break; + case RSTFLOCKTRAP: + fsindex = RSTFLOCKINDEX; + break; + case SETFVERSTRAP: + fsindex = SETFVERSINDEX; + break; + case SETFPOSTRAP: + fsindex = SETFPOSINDEX; + break; + case FLUSHFILETRAP: + fsindex = FLUSHFILEINDEX; + break; + default: + fsindex = static_cast(-1); + break; + }; + + if (fsindex == static_cast(-1)) + ostraptable[i] = osstuff[i].orig = (void *) + ((osstuff[i].func == (void*)_Unimplemented) ? + unimpl + : + callback_install((callback_handler_t)osstuff[i].func, + osstuff[i].func)); + else { + osstuff[i].func = (void *) _HFSRoutines; + ostraptable[i] = osstuff[i].orig = (void *) + callback_install((callback_handler_t)_HFSRoutines, + fsroutines[fsindex] ); + } + } +} diff --git a/src/error.c b/src/error.cpp similarity index 98% rename from src/error.c rename to src/error.cpp index b56f5c59..b2b97d80 100644 --- a/src/error.c +++ b/src/error.cpp @@ -22,6 +22,8 @@ char ROMlib_rcsid_error[] = #include "rsys/mman.h" #include "rsys/flags.h" +using namespace Executor; + /* This is a bit mask containing the bitwise OR of the various * ERROR_..._BIT flags in rsys/error.h. */ @@ -35,7 +37,7 @@ static const struct } error_options[] = { - { "all", ~0 }, + { "all", ~(uint32_t)0 }, { "fast", ( ERROR_BIT_MASK (ERROR_FILESYSTEM_LOG) | ERROR_BIT_MASK (ERROR_TRACE_INFO) | ERROR_BIT_MASK (ERROR_TRAP_FAILURE) @@ -74,7 +76,7 @@ error_parse_option_string (const char *options) bool success_p; success_p = TRUE; - option_name = alloca (strlen (options) + 1); /* big enough for any option.*/ + option_name = (char*)alloca (strlen (options) + 1); /* big enough for any option.*/ options_end = options + strlen (options); /* Munch through the option string, extracting out the comma-separated @@ -339,7 +341,7 @@ err_vprintf (const char *fmt, va_list ap) } else { - ram_err_buf = new_buf; + ram_err_buf = (char*)new_buf; } } @@ -518,4 +520,5 @@ _errno_warning (const char *file, int line, const char *fn, flush_stream (); } +#undef NULL_STRING const char NULL_STRING[] = ""; /* used to avoid bogus gcc warnings */ diff --git a/src/executor.c b/src/executor.cpp similarity index 96% rename from src/executor.c rename to src/executor.cpp index 7a561299..289f3f8a 100644 --- a/src/executor.c +++ b/src/executor.cpp @@ -7,7 +7,7 @@ char ROMlib_rcsid_executor[] = "$Id: executor.c 88 2005-05-25 03:59:37Z ctm $"; #endif -#define DEBUG +//#define DEBUG #include "rsys/common.h" @@ -58,6 +58,8 @@ char ROMlib_rcsid_executor[] = #define PRIVATE #define PUBLIC +using namespace Executor; + #define FASTALINETRAPS /* @@ -90,7 +92,7 @@ PRIVATE void emthandler(LONGINT wsignal, LONGINT code, struct sigcontext *scp) #endif /* NEXT && !SYN68K */ -LONGINT debugnumber, debugtable[1<<12], cutoff = 20; +LONGINT Executor::debugnumber, debugtable[1<<12], cutoff = 20; #if !defined (MSDOS) && !defined (NDEBUG) typedef struct @@ -170,7 +172,7 @@ trap_watch (char *name, void *x, int size) } trap_watchpoints[trap_watchpoint_next].size = size; trap_watchpoints[trap_watchpoint_next].handle_p = FALSE; - trap_watchpoints[trap_watchpoint_next].x = x; + trap_watchpoints[trap_watchpoint_next].x = (char*)x; trap_data = trap_watchpoints[trap_watchpoint_next].orig = &trap_watchpoint_data[trap_watchpoint_next_data]; @@ -192,7 +194,7 @@ trap_watch_handle (char *name, Handle x, int size) } trap_watchpoints[trap_watchpoint_next].size = size; trap_watchpoints[trap_watchpoint_next].handle_p = TRUE; - trap_watchpoints[trap_watchpoint_next].x = (void *) x; + trap_watchpoints[trap_watchpoint_next].x = (char *) x; trap_data = trap_watchpoints[trap_watchpoint_next].orig = &trap_watchpoint_data[trap_watchpoint_next_data]; @@ -247,7 +249,7 @@ check_trap_watchpoints (char *msg) /* differs */ fprintf (stderr, "%s", msg); trap_dump_bits ("old", trap_watchpoints[i].orig, size); - trap_dump_bits ("new", x, size); + trap_dump_bits ("new", (char*)x, size); memcpy (trap_watchpoints[i].orig, x, size); @@ -260,7 +262,7 @@ check_trap_watchpoints (char *msg) PRIVATE void setup28( void ) { -#if defined (NEXT) && !defined (SYN68K) +#if defined (MACOSX_) && !defined (SYN68K) #if 1 static LONGINT trap_dispatcher_callback = -1; @@ -276,9 +278,9 @@ PRIVATE void setup28( void ) #endif /* NEXT && !SYN68K */ } -PUBLIC void setupsignals( void ) +PUBLIC void Executor::setupsignals( void ) { -#if defined (NEXT) +#if defined (MACOSX_) LONGINT tocatch[] = { SIGHUP, SIGINT, @@ -302,14 +304,14 @@ PUBLIC void setupsignals( void ) 0 }, *tocatchp; #endif /* NEXT */ -#if !defined (FASTALINETRAPS) || defined (NEXT) +#if !defined (FASTALINETRAPS) || defined (MACOSX_) #if defined(USE_BSD_SIGNALS) typedef struct sigvec sigvec_t; typedef struct sigstack sigstack_t; #endif #endif /* FASTALINETRAPS || NEXT */ -#if (!defined (FASTALINETRAPS) || defined (NEXT)) && !defined (SYN68K) +#if (!defined (FASTALINETRAPS) || defined (MACOSX_)) && !defined (SYN68K) { sigstack_t sigstackarg; sigvec_t sigvecarg; @@ -349,7 +351,7 @@ enum { MODESWITCHTRAPWORD = 0xaafe }; #define FAKEPascalToCCall(xxx) \ do {PUSHADDR(0xEACE4321); (void) PascalToCCall(0x87654231, xxx); } while (0) -unsigned short mostrecenttrap; +unsigned short Executor::mostrecenttrap; /* #define MEMORY_WATCH */ @@ -385,7 +387,7 @@ compare_zone_infos (uint16 trapn, zone_info_t current[3], zone_info_t new[3]) } #endif -PUBLIC syn68k_addr_t alinehandler(syn68k_addr_t pc, void *ignored) +PUBLIC syn68k_addr_t Executor::alinehandler(syn68k_addr_t pc, void *ignored) { syn68k_addr_t retval; unsigned short trapno, status; @@ -524,7 +526,7 @@ PUBLIC syn68k_addr_t alinehandler(syn68k_addr_t pc, void *ignored) return retval; } -PUBLIC void executor_main( void ) +PUBLIC void Executor::executor_main( void ) { char quickbytes[grafSize]; LONGINT tmpA5; diff --git a/src/fileAccess.c b/src/fileAccess.cpp similarity index 95% rename from src/fileAccess.c rename to src/fileAccess.cpp index 9c1f6c3d..32c276fb 100644 --- a/src/fileAccess.c +++ b/src/fileAccess.cpp @@ -28,6 +28,7 @@ char ROMlib_rcsid_fileAccess[] = #include "rsys/file.h" #include "rsys/suffix_maps.h" #include "rsys/lockunlock.h" +#include "rsys/prefs.h" #include @@ -35,10 +36,26 @@ char ROMlib_rcsid_fileAccess[] = #include "winfs.h" #endif -int ROMlib_nosync = 0; /* if non-zero, we don't call sync () or fsync () */ +using namespace Executor; + +namespace Executor { + PRIVATE OSErr PBLockUnlockRange(ParmBlkPtr, BOOLEAN, lockunlock_t); + PRIVATE VCB *vlookupbydrive(INTEGER); + PRIVATE char *dirindex(char *, LONGINT, BOOLEAN, struct stat *); + PRIVATE unsigned char tohex(unsigned char); + PRIVATE INTEGER Mac_to_UNIX7(unsigned char *, INTEGER, unsigned char *); + PRIVATE BOOLEAN myscandir(char *, char, char *, INTEGER); + PRIVATE LONGINT weasel(char *, struct stat *); + PRIVATE OSErr macopen(char *, short, LONGINT *, BOOLEAN, Byte *); + PRIVATE void freeprn(fcbrec *); + PRIVATE OSErr getprn(INTEGER *); + PRIVATE OSErr PBOpenForkD(ParmBlkPtr, BOOLEAN, ForkType, LONGINT); + PRIVATE OSErr PBLockUnlockRange(ParmBlkPtr, BOOLEAN a, lockunlock_t op); + int ROMlib_nosync = 0; /* if non-zero, we don't call sync () or fsync () */ +} #if !defined(NDEBUG) -PUBLIC void fs_err_hook (OSErr err) +PUBLIC void Executor::fs_err_hook (OSErr err) { } #endif @@ -169,7 +186,7 @@ A3(PUBLIC, OSErr, FSRead, INTEGER, rn, LONGINT *, count, /* IMIV-109 */ } PUBLIC OSErr -FSReadAll (INTEGER rn, LONGINT *countp, Ptr buffp) +Executor::FSReadAll (INTEGER rn, LONGINT *countp, Ptr buffp) { LONGINT orig_count; OSErr retval; @@ -198,7 +215,7 @@ A3(PUBLIC, OSErr, FSWrite, INTEGER, rn, LONGINT *, count, /* IMIV-110 */ } PUBLIC OSErr -FSWriteAll (INTEGER rn, LONGINT *countp, Ptr buffp) +Executor::FSWriteAll (INTEGER rn, LONGINT *countp, Ptr buffp) { LONGINT orig_count; OSErr retval; @@ -343,7 +360,7 @@ A0(PUBLIC, void, ROMlib_rewinddir) * are two upper case hex digits. */ -PUBLIC BOOLEAN ROMlib_isresourcefork(const char *fullname) +PUBLIC BOOLEAN Executor::ROMlib_isresourcefork(const char *fullname) { LONGINT fd; LONGINT magic; @@ -379,26 +396,26 @@ PUBLIC BOOLEAN ROMlib_isresourcefork(const char *fullname) return retval; } -int ROMlib_no_dot_files = FALSE; +int Executor::ROMlib_no_dot_files = FALSE; -static boolean_t +static bool dislike_name (char *namep) { - boolean_t retval; + bool retval = false; if (strcmp (namep, ".") == 0 || strcmp (namep, "..") == 0 || strcmp (namep, ".AppleDouble") == 0 || strcmp (namep, ".AppleDesktop") == 0 || (ROMlib_no_dot_files && namep[0] == '.')) - retval = TRUE; + retval = true; else { char *buf; int namelen; namelen = strlen (namep); - buf = alloca (namelen); + buf = (char*)alloca (namelen); memcpy (buf, namep, namelen); namelen -= ROMlib_UNIX7_to_Mac (buf, namelen); retval = namelen > 31; @@ -446,7 +463,7 @@ A4(PRIVATE, char *, dirindex, char *, dir, LONGINT, index, BOOLEAN, nodirectorie saveZone = TheZone; TheZone = SysZone; - cachedir = malloc (dirnamelen+1+MAXNAMLEN+1); + cachedir = (char*)malloc (dirnamelen+1+MAXNAMLEN+1); TheZone = saveZone; if (!cachedir) /*-->*/ return 0; @@ -520,7 +537,7 @@ A2(PUBLIC, char *, ROMlib_newunixfrommac, char *, ip, INTEGER, n) { char *retval; - if ((retval = malloc (3*n+1))) /* worst case numbers */ + if ((retval = (char*)malloc (3*n+1))) /* worst case numbers */ retval[Mac_to_UNIX7((unsigned char *) ip, n, (unsigned char *) retval)] = 0; return retval; @@ -770,7 +787,7 @@ A9(PUBLIC, OSErr, ROMlib_nami, ParmBlkPtr, pb, LONGINT, dir, /* INTERNAL */ } } vcbstrlen = strlen(vcbp->unixname); - vcbanddir = ALLOCA(vcbstrlen + content.dsize + 2); + vcbanddir = (char*)ALLOCA(vcbstrlen + content.dsize + 2); BlockMove((Ptr) vcbp->unixname, (Ptr) vcbanddir, (Size) vcbstrlen+1); if (content.dsize) { if (vcbanddir[vcbstrlen-1] != '/') @@ -852,13 +869,13 @@ A9(PUBLIC, OSErr, ROMlib_nami, ParmBlkPtr, pb, LONGINT, dir, /* INTERNAL */ #if 0 therest = ROMlib_newunixfrommac((char *) fnamep+1, fnamep[0]); #else - therest = malloc ((Size) fnamep[0] + 1); + therest = (char*)malloc ((Size) fnamep[0] + 1); BlockMove((Ptr) fnamep+1, (Ptr) therest, (Size) fnamep[0]); therest[fnamep[0]] = 0; #endif } therestlen = therest ? strlen(therest) : 0; - *pathname = malloc (therestlen + strlen(vcbanddir)+2); + *pathname = (char*)malloc (therestlen + strlen(vcbanddir)+2); *filename = *pathname + strlen(vcbanddir) +1; *endname = *filename + therestlen + 1; BlockMove((Ptr) vcbanddir, (Ptr) *pathname, (Size) strlen(vcbanddir)); @@ -939,7 +956,7 @@ A3(PUBLIC, char *, ROMlib_resname, char *, pathname, /* INTERNAL */ { newsize = pathnamesize + filenamesize + apple_double_fork_prefix_length; - newname = malloc (newsize); + newname = (char*)malloc (newsize); memcpy (newname, pathname, pathnamesize); strcpy (&newname[pathnamesize], apple_double_fork_prefix); memcpy (newname + pathnamesize + apple_double_fork_prefix_length, @@ -949,7 +966,7 @@ A3(PUBLIC, char *, ROMlib_resname, char *, pathname, /* INTERNAL */ { /* "E:/" --> "E:/%%2F" */ newsize = filenamesize + sizeof (ROOTS_PERCENT_FILE); - newname = malloc (newsize); + newname = (char*)malloc (newsize); sprintf (newname, "%s%s", filename, ROOTS_PERCENT_FILE); } return newname; @@ -1406,24 +1423,24 @@ A2(PUBLIC, OSErr, ufsPBUnlockRange, ParmBlkPtr, pb, /* INTERNAL */ PRIVATE OSErr pbsetfpos (ParmBlkPtr pb, boolean_t can_go_past_eof) { - OSErr err; - INTEGER forkoffset; - LONGINT toseek; - int fd; - fcbrec *fp; + OSErr err; + INTEGER forkoffset; + LONGINT toseek; + int fd; + fcbrec *fp; - fp = PRNTOFPERR(Cx(pb->ioParam.ioRefNum), &err); - if (err == noErr) { + fp = PRNTOFPERR(Cx(pb->ioParam.ioRefNum), &err); + if (err == noErr) { forkoffset = FORKOFFSET(fp); err = pbfpos(pb, &toseek, can_go_past_eof); fd = fp->fcfd; pb->ioParam.ioPosOffset = CL(lseek(fd, toseek, L_SET) - forkoffset); - } - fs_err_hook (err); - return err; + } + fs_err_hook (err); + return err; } -PUBLIC int ROMlib_newlinetocr = TRUE; +PUBLIC int Executor::ROMlib_newlinetocr = TRUE; /* * NOTE: ROMlib_destroy_blocks is a wrapper routine that either destroys @@ -1433,9 +1450,9 @@ PUBLIC int ROMlib_newlinetocr = TRUE; * addresses. */ -PUBLIC int ROMlib_flushoften = 0; +PUBLIC int Executor::ROMlib_flushoften = 0; -PUBLIC unsigned long ROMlib_destroy_blocks(syn68k_addr_t start, uint32 count, +PUBLIC unsigned long Executor::ROMlib_destroy_blocks(syn68k_addr_t start, uint32 count, BOOLEAN flush_only_faulty_checksums) { unsigned long num_blocks_destroyed; diff --git a/src/fileCreate.c b/src/fileCreate.cpp similarity index 97% rename from src/fileCreate.c rename to src/fileCreate.cpp index 6206429d..a3f8e097 100644 --- a/src/fileCreate.c +++ b/src/fileCreate.cpp @@ -21,6 +21,8 @@ char ROMlib_rcsid_fileCreate[] = #include "rsys/filedouble.h" #include "rsys/suffix_maps.h" +using namespace Executor; + A4(PUBLIC, OSErr, Create, StringPtr, filen, INTEGER, vrn, /* IMIV-112 */ OSType, creator, OSType, filtyp) { @@ -66,6 +68,11 @@ A2(PUBLIC, OSErr, FSDelete, StringPtr, filen, INTEGER, vrn) /* IMIV-113 */ return(PBDelete(&pbr, 0)); } +namespace Executor { + static OSErr PBCreateForD(ParmBlkPtr, BOOLEAN, FOrDType, LONGINT); + static OSErr PBDeleteForD(ParmBlkPtr, BOOLEAN, FOrDType, LONGINT); +} + A4(PRIVATE, OSErr, PBCreateForD, ParmBlkPtr, pb, BOOLEAN, a, FOrDType, ford, LONGINT, dir) { diff --git a/src/fileDirs.c b/src/fileDirs.cpp similarity index 98% rename from src/fileDirs.c rename to src/fileDirs.cpp index 5f9577f1..1a9476d7 100644 --- a/src/fileDirs.c +++ b/src/fileDirs.cpp @@ -21,6 +21,8 @@ char ROMlib_rcsid_fileDirs[] = #include "rsys/file.h" #include "rsys/filedouble.h" +using namespace Executor; + /* * Remember, vrn and wdn are negative numbers */ @@ -89,7 +91,7 @@ A6(PUBLIC, OSErr, ROMlib_PBMoveOrRename, ParmBlkPtr, pb, /* INTERNAL */ &newfilename, &newendname, TRUE, (VCBExtra **)0, (struct stat *) 0)) == noErr) { if (op == CatMove) { - fullnewname = ALLOCA(newendname - newpathname + + fullnewname = (char*)ALLOCA(newendname - newpathname + oldendname - oldfilename + 2); /* + '/' and null */ sprintf(fullnewname, "%s/%s", newpathname, oldfilename); } else diff --git a/src/fileDouble.c b/src/fileDouble.cpp similarity index 92% rename from src/fileDouble.c rename to src/fileDouble.cpp index 39968254..00864149 100644 --- a/src/fileDouble.c +++ b/src/fileDouble.cpp @@ -15,12 +15,14 @@ char ROMlib_rcsid_fileDouble[] = #include "winfs.h" #endif -int afpd_conventions_p; -int netatalk_conventions_p; +int Executor::afpd_conventions_p; +int Executor::netatalk_conventions_p; -char apple_double_quote_char; -const char *apple_double_fork_prefix; -int apple_double_fork_prefix_length; +char Executor::apple_double_quote_char; +const char *Executor::apple_double_fork_prefix; +int Executor::apple_double_fork_prefix_length; + +using namespace Executor; /* * Coded more or less up to the spec: APDA M0908LL/A @@ -111,7 +113,7 @@ PRIVATE void initialize_ourdefault( void ) PRIVATE defaultentries_t ourentries; PUBLIC void -double_dir_op (char *name, double_dir_op_t op) +Executor::double_dir_op (char *name, double_dir_op_t op) { char *last_slash; @@ -136,9 +138,9 @@ double_dir_op (char *name, double_dir_op_t op) *last_slash = save; len = strlen (name) + 1 + apple_double_fork_prefix_length + 1; - to_del = alloca (len); + to_del = (char*)alloca (len); sprintf (to_del, "%s/%s", name, apple_double_fork_prefix); - to_unlink = alloca (len + strlen(PARENT_FILE)); + to_unlink = (char*)alloca (len + strlen(PARENT_FILE)); sprintf (to_unlink, "%s%s", to_del, PARENT_FILE); unlink (to_unlink); to_del[len-2] = 0; /* remove trailing slash */ @@ -196,11 +198,21 @@ A3(PUBLIC, OSErr, ROMlib_newresfork, char *, name, LONGINT *, fdp, #define OURBSIZE 512 +namespace Executor { + PRIVATE BOOLEAN getsetentry(GetOrSetType gors, LONGINT fd, + Single_ID sid, Single_descriptor * savesdp, + ULONGINT * lengthp); + PRIVATE void writebyteat(LONGINT fd, LONGINT loc); + PRIVATE BOOLEAN getsetpiece(GetOrSetType gors, LONGINT fd, + Single_descriptor *sdp, char *bufp, LONGINT length); + +} + A5(PRIVATE, BOOLEAN, getsetentry, GetOrSetType, gors, LONGINT, fd, Single_ID, sid, Single_descriptor *, savesdp, ULONGINT *, lengthp) { - LONGINT saveloc; + off_t saveloc; struct defaulthead *dfp; INTEGER nread; Single_descriptor *sdp; @@ -269,7 +281,7 @@ A1(PUBLIC, LONGINT, ROMlib_FORKOFFSET, fcbrec *, fp) /* INTERNAL */ A2(PRIVATE, void, writebyteat, LONGINT, fd, LONGINT, loc) { - LONGINT saveloc; + off_t saveloc; saveloc = lseek(fd, 0L, L_INCR); lseek(fd, loc, L_SET); @@ -281,7 +293,8 @@ A2(PRIVATE, void, writebyteat, LONGINT, fd, LONGINT, loc) A1(PUBLIC, OSErr, ROMlib_seteof, fcbrec *, fp) /* INTERNAL */ { - ULONGINT leof, peof, curloc; + ULONGINT leof, peof; + off_t curloc; LONGINT fd; Single_descriptor d; Single_ID idwanted; @@ -338,7 +351,7 @@ A1(PUBLIC, OSErr, ROMlib_seteof, fcbrec *, fp) /* INTERNAL */ A5(PRIVATE, BOOLEAN, getsetpiece, GetOrSetType, gors, LONGINT, fd, Single_descriptor *, sdp, char *, bufp, LONGINT, length) { - LONGINT saveloc; + off_t saveloc; BOOLEAN retval; saveloc = lseek(fd, 0L, L_INCR); @@ -380,7 +393,7 @@ A1(PUBLIC, OSErr, ROMlib_geteofostype, fcbrec *, fp) /* INTERNAL */ else fp->fcPLen = fp->fcleof = d.length; } else - fp->fcleof = fp->fcPLen = CL(sbuf.st_size); + fp->fcleof = fp->fcPLen = CL((int)sbuf.st_size); if (err == noErr) { if (!getsetentry(Get, fd, Finder_Info_ID, &d, NULL) || (!getsetpiece(Get, fd, &d, (char *) &finfo, sizeof(finfo)))) @@ -433,7 +446,7 @@ fprintf(stderr, "%s(%d): open '%s' fails\n", __FILE__, __LINE__, rpathname); memset(datep, 0, sizeof(*datep)); memset(finfop, 0, sizeof(*finfop)); memset(fxinfop, 0, sizeof(*fxinfop)); - *lenp = CL(sbuf.st_size); + *lenp = CL((int)sbuf.st_size); *rlenp = 0; break; case Set: @@ -471,7 +484,7 @@ fprintf(stderr, "%s(%d): open '%s' fails\n", __FILE__, __LINE__, rpathname); if (fxinfop) *fxinfop = sfinfo.fxinfo; - *lenp = CL(sbuf.st_size); + *lenp = CL((int)sbuf.st_size); } if (getsetentry(Get, rfd, Resource_Fork_ID, &d, NULL)) *rlenp = d.length; diff --git a/src/fileHighlevel.c b/src/fileHighlevel.cpp similarity index 98% rename from src/fileHighlevel.c rename to src/fileHighlevel.cpp index 016cbe5e..fce4aee8 100644 --- a/src/fileHighlevel.c +++ b/src/fileHighlevel.cpp @@ -25,6 +25,8 @@ char ROMlib_rcsid_fileHighlevel[] = #include "rsys/hfs.h" #include "rsys/executor.h" +using namespace Executor; + /* * extract the last component of a name: * @@ -113,7 +115,7 @@ P4 (PUBLIC pascal trap, OSErr, FSMakeFSSpec, { OSErr err; - cpb.hFileInfo.ioNamePtr = CLC (0); + cpb.hFileInfo.ioNamePtr = (StringPtr)CLC (0); cpb.hFileInfo.ioVRefNum = CW (vRefNum); cpb.hFileInfo.ioFDirIndex = CWC (-1); cpb.hFileInfo.ioDirID = CL (dir_id); @@ -574,7 +576,7 @@ P2 (PUBLIC pascal trap, INTEGER, FSpOpenResFile, calls that are handy to use elsewhere, so they're included here. */ PUBLIC OSErr -HCreate (INTEGER vref, LONGINT dirid, Str255 name, OSType creator, OSType type) +Executor::HCreate (INTEGER vref, LONGINT dirid, Str255 name, OSType creator, OSType type) { HParamBlockRec hpb; OSErr retval; @@ -599,7 +601,7 @@ HCreate (INTEGER vref, LONGINT dirid, Str255 name, OSType creator, OSType type) } PUBLIC OSErr -HOpenRF (INTEGER vref, LONGINT dirid, Str255 name, SignedByte perm, +Executor::HOpenRF (INTEGER vref, LONGINT dirid, Str255 name, SignedByte perm, INTEGER *refp) { HParamBlockRec hpb; diff --git a/src/fileInfo.c b/src/fileInfo.cpp similarity index 98% rename from src/fileInfo.c rename to src/fileInfo.cpp index 91e986df..c15a2ba2 100644 --- a/src/fileInfo.c +++ b/src/fileInfo.cpp @@ -25,6 +25,8 @@ char ROMlib_rcsid_fileInfo[] = #include +using namespace Executor; + #if 0 #if defined (CYGWIN32) @@ -269,7 +271,7 @@ A2(PUBLIC, INTEGER, ROMlib_UNIX7_to_Mac, char *, cname, INTEGER, length) } PUBLIC Byte -open_attrib_bits (LONGINT file_id, VCB *vcbp, INTEGER *refnump) +Executor::open_attrib_bits (LONGINT file_id, VCB *vcbp, INTEGER *refnump) { Byte retval; int i; @@ -584,6 +586,11 @@ A2(PUBLIC, OSErr, ufsPBHSetFInfo, HParmBlkPtr, pb, /* INTERNAL */ return ROMlib_PBGetSetFInfoD((ParmBlkPtr) pb, a, Set, &d, FALSE); } +namespace Executor { + PRIVATE int flipwritebits(char*, LockOrUnlockType); + PRIVATE OSErr PBLockUnlock(ParmBlkPtr,BOOLEAN, LONGINT, LockOrUnlockType); +} + A2(PRIVATE, int, flipwritebits, char *, file, LockOrUnlockType, op) { struct stat sbuf; diff --git a/src/fileMisc.c b/src/fileMisc.cpp similarity index 88% rename from src/fileMisc.c rename to src/fileMisc.cpp index 62f1e0d9..ee605412 100644 --- a/src/fileMisc.c +++ b/src/fileMisc.cpp @@ -47,6 +47,8 @@ char ROMlib_rcsid_fileMisc[] = #include +using namespace Executor; + /* NOTE: calling most of the routines here is a sign that the user may be depending on the internal layout of things a bit too much */ @@ -171,7 +173,7 @@ PRIVATE INTEGER ROMlib_ejdriveno = 2; */ PUBLIC DrvQExtra * -ROMlib_addtodq (ULONGINT drvsize, const char *devicename, INTEGER partition, +Executor::ROMlib_addtodq (ULONGINT drvsize, const char *devicename, INTEGER partition, INTEGER drefnum, drive_flags_t flags, hfs_access_t *hfsp) { INTEGER dno; @@ -283,7 +285,7 @@ root_directory_p(char *path, dev_t our_dev) * way to map the "drive number" into such a string) */ -PUBLIC char *ROMlib_volumename; +PUBLIC char *Executor::ROMlib_volumename; PRIVATE void ROMlib_automount_helper(char *path, char *aliasp) { @@ -408,7 +410,7 @@ PRIVATE void ROMlib_automount_helper(char *path, char *aliasp) } } -PUBLIC void ROMlib_automount(char *path) +PUBLIC void Executor::ROMlib_automount(char *path) { ROMlib_automount_helper (path, NULL); } @@ -426,14 +428,14 @@ char *combine_str(const char *str1, const char *str2) if (!str1 || !str2) return 0; len1 = strlen(str1); - retval = malloc(len1 + strlen(str2) + 1); + retval = (char*)malloc(len1 + strlen(str2) + 1); strcpy(retval, str1); strcpy(retval + len1, str2); return retval; } PUBLIC void -convert_slashs_to_backslashs (char *p) +Executor::convert_slashs_to_backslashs (char *p) { if (p) { @@ -624,21 +626,21 @@ e2_is_mounted (void) #endif -PUBLIC StringPtr ROMlib_exefname; -PUBLIC char *ROMlib_exeuname; +PUBLIC StringPtr Executor::ROMlib_exefname; +PUBLIC char *Executor::ROMlib_exeuname; -PUBLIC char *ROMlib_ConfigurationFolder; -PUBLIC char *ROMlib_SystemFolder; -PUBLIC char *ROMlib_DefaultFolder; -PUBLIC char *ROMlib_PublicDirectoryMap; -PUBLIC char *ROMlib_PrivateDirectoryMap; -PUBLIC char *ROMlib_ExcelApp; -PUBLIC char *ROMlib_WordApp; +PUBLIC char *Executor::ROMlib_ConfigurationFolder; +PUBLIC char *Executor::ROMlib_SystemFolder; +PUBLIC char *Executor::ROMlib_DefaultFolder; +PUBLIC char *Executor::ROMlib_PublicDirectoryMap; +PUBLIC char *Executor::ROMlib_PrivateDirectoryMap; +PUBLIC char *Executor::ROMlib_ExcelApp; +PUBLIC char *Executor::ROMlib_WordApp; PUBLIC char *ROMlib_MacVolumes; -PUBLIC char *ROMlib_ScreenDumpFile; +PUBLIC char *Executor::ROMlib_ScreenDumpFile; PRIVATE char *ROMlib_OffsetFile; -PUBLIC LONGINT ROMlib_magic_offset = -1; +PUBLIC LONGINT Executor::ROMlib_magic_offset = -1; PRIVATE void skip_comments (FILE *fp) @@ -722,8 +724,8 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ int sysnamelen; char *p, *ep, *newp; static struct dangerstr { /* DANGER DANGER DANGER */ - char *name; /* this is taken from */ - char *value; /* instead of us including it ... */ + std::string name; /* this is taken from */ + std::string value; /* instead of us including it ... */ } defvec[] = { /* if changes we're SOL */ #if defined (LINUX) {"ConfigurationFolder", "/var/opt/executor/share/conf"}, @@ -793,31 +795,31 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ #define AFPD(m,n) (afpd_conventions_p ? (n) : (m)) #endif -#define CONFIGURATIONFOLDER defvec[0].name -#define SYSTEMFOLDER defvec[1].name -#define PUBLICDIRECTORYMAP defvec[2].name -#define PRIVATEDIRECTORYMAP defvec[3].name -#define DEFAULTFOLDER defvec[4].name -#define EXCELAPP defvec[5].name -#define WORDAPP defvec[6].name -#define MACVOLUMES defvec[7].name -#define SCREENDUMPFILE defvec[8].name -#define OFFSETFILE defvec[9].name -#define PRINTERSINI defvec[10].name -#define PRINTDEF defvec[11].name - -#define CONFIGURATIONFOLDER_DEF defvec[0].value -#define SYSTEMFOLDER_DEF defvec[AFPD (1, 12)].value -#define PUBLICDIRECTORYMAP_DEF defvec[2].value -#define PRIVATEDIRECTORYMAP_DEF defvec[3].value -#define DEFAULTFOLDER_DEF defvec[AFPD (4, 13)].value -#define EXCELAPP_DEF defvec[AFPD (5, 14)].value -#define WORDAPP_DEF defvec[AFPD (6, 15)].value -#define MACVOLUMES_DEF defvec[7].value -#define SCREENDUMPFILE_DEF defvec[8].value -#define OFFSETFILE_DEF defvec[9].value -#define PRINTERSINI_DEF defvec[10].value -#define PRINTDEF_DEF defvec[11].value +#define CONFIGURATIONFOLDER defvec[0].name.c_str() +#define SYSTEMFOLDER defvec[1].name.c_str() +#define PUBLICDIRECTORYMAP defvec[2].name.c_str() +#define PRIVATEDIRECTORYMAP defvec[3].name.c_str() +#define DEFAULTFOLDER defvec[4].name.c_str() +#define EXCELAPP defvec[5].name.c_str() +#define WORDAPP defvec[6].name.c_str() +#define MACVOLUMES defvec[7].name.c_str() +#define SCREENDUMPFILE defvec[8].name.c_str() +#define OFFSETFILE defvec[9].name.c_str() +#define PRINTERSINI defvec[10].name.c_str() +#define PRINTDEF defvec[11].name.c_str() + +#define CONFIGURATIONFOLDER_DEF defvec[0].value.c_str() +#define SYSTEMFOLDER_DEF defvec[AFPD (1, 12)].value.c_str() +#define PUBLICDIRECTORYMAP_DEF defvec[2].value.c_str() +#define PRIVATEDIRECTORYMAP_DEF defvec[3].value.c_str() +#define DEFAULTFOLDER_DEF defvec[AFPD (4, 13)].value.c_str() +#define EXCELAPP_DEF defvec[AFPD (5, 14)].value.c_str() +#define WORDAPP_DEF defvec[AFPD (6, 15)].value.c_str() +#define MACVOLUMES_DEF defvec[7].value.c_str() +#define SCREENDUMPFILE_DEF defvec[8].value.c_str() +#define OFFSETFILE_DEF defvec[9].value.c_str() +#define PRINTERSINI_DEF defvec[10].value.c_str() +#define PRINTDEF_DEF defvec[11].value.c_str() CurDirStore = CLC(2); @@ -864,46 +866,6 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ ROMlib_PrintersIni = copystr(getenv(PRINTERSINI)); ROMlib_PrintDef = copystr(getenv(PRINTDEF)); -#if defined(NEXTSTEP) - NXRegisterDefaults(ROMlib_appname, defvec); - - if (!ROMlib_ConfigurationFolder) - ROMlib_ConfigurationFolder = - copystr(NXGetDefaultValue(ROMlib_appname, CONFIGURATIONFOLDER)); - if (!ROMlib_SystemFolder) - ROMlib_SystemFolder = - copystr(NXGetDefaultValue(ROMlib_appname, SYSTEMFOLDER)); - if (!ROMlib_PublicDirectoryMap) - ROMlib_PublicDirectoryMap = - copystr(NXGetDefaultValue(ROMlib_appname, PUBLICDIRECTORYMAP)); - if (!ROMlib_PrivateDirectoryMap) - ROMlib_PrivateDirectoryMap = - copystr(NXGetDefaultValue(ROMlib_appname, PRIVATEDIRECTORYMAP)); - if (!ROMlib_DefaultFolder) - ROMlib_DefaultFolder = - copystr(NXGetDefaultValue(ROMlib_appname, DEFAULTFOLDER)); - if (!ROMlib_ExcelApp) - ROMlib_ExcelApp = - copystr(NXGetDefaultValue(ROMlib_appname, EXCELAPP)); - if (!ROMlib_WordApp) - ROMlib_WordApp = - copystr(NXGetDefaultValue(ROMlib_appname, WORDAPP)); - if (!ROMlib_MacVolumes) - ROMlib_MacVolumes = - copystr(NXGetDefaultValue(ROMlib_appname, MACVOLUMES)); - if (!ROMlib_ScreenDumpFile) - ROMlib_ScreenDumpFile = - copystr(NXGetDefaultValue(ROMlib_appname, SCREENDUMPFILE)); - if (!ROMlib_OffsetFile) - ROMlib_OffsetFile = - copystr(NXGetDefaultValue(ROMlib_appname, OFFSETFILE)); - if (!ROMlib_PrintersIni) - ROMlib_PrintersIni = - copystr(NXGetDefaultValue(ROMlib_appname, PRINTERSINI)); - if (!ROMlib_PrintDef) - ROMlib_PrintDef = - copystr(NXGetDefaultValue(ROMlib_appname, PRINTDEF)); -#else if (!ROMlib_ConfigurationFolder) ROMlib_ConfigurationFolder = copystr(CONFIGURATIONFOLDER_DEF); if (!ROMlib_SystemFolder) @@ -928,7 +890,6 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ ROMlib_PrintersIni = copystr(PRINTERSINI_DEF); if (!ROMlib_PrintDef) ROMlib_PrintDef = copystr(PRINTDEF_DEF); -#endif parse_offset_file (); @@ -944,7 +905,7 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ { \ char *str2; \ \ - str2 = malloc(strlen(str) + strlen(suffix) + 1); \ + str2 = (char*)malloc(strlen(str) + strlen(suffix) + 1); \ sprintf(str2, "%s%s", str, suffix); \ str = str2; \ } @@ -1002,7 +963,7 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ { char *tempname; - tempname = alloca(strlen(newp) + 1 + namelen + 1); + tempname = (char*)alloca(strlen(newp) + 1 + namelen + 1); sprintf(tempname, "%s/%s", newp, direntp->d_name); ROMlib_openharddisk(tempname, &m); } @@ -1039,7 +1000,7 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ cpb.hFileInfo.ioDirID = CL((LONGINT) ST_INO (sbuf)); } else { sysnamelen = 1+strlen(ROMlib_SystemFolder)+1+strlen(SYSMACNAME+1)+1; - sysname = alloca(sysnamelen); + sysname = (char*)alloca(sysnamelen); *sysname = sysnamelen - 2; /* don't count first byte or nul */ sprintf(sysname+1, "%s:%s", ROMlib_SystemFolder, SYSMACNAME+1); cpb.hFileInfo.ioNamePtr = (StringPtr) RM(sysname); @@ -1201,7 +1162,7 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ #if defined (BINCOMPAT) fcbrec * -PRNTOFPERR (INTEGER prn, OSErr *errp) +Executor::PRNTOFPERR (INTEGER prn, OSErr *errp) { fcbrec *retval; OSErr err; diff --git a/src/fileVolumes.c b/src/fileVolumes.cpp similarity index 96% rename from src/fileVolumes.c rename to src/fileVolumes.cpp index 474058bb..98d948de 100644 --- a/src/fileVolumes.c +++ b/src/fileVolumes.cpp @@ -37,6 +37,8 @@ char ROMlib_rcsid_fileVolumes[] = #define RETURN(x) { err = (x); goto DONE; } +using namespace Executor; + /* * For now we just use 101 entries in our hash table, no matter what. * The hash function should be pretty damn uniform, so even if we have @@ -64,6 +66,10 @@ char ROMlib_rcsid_fileVolumes[] = #define HASHSIZE 101 +namespace Executor { + static hashlink_t **hashloc(VCBExtra*, LONGINT); +} + A2(PRIVATE, hashlink_t **, hashloc, VCBExtra *, vcbp, LONGINT, dir) { hashlink_t **hlpp; @@ -147,8 +153,8 @@ recsetdp (VCBExtra * vcbp, datum *dp, hashlink_t *hlp, chain_t *therest) ourlen = strlen (hlp->dirname+1); /* don't count flag byte */ dp->dsize = ourlen + chaincount(therest) + 1; dp->dptr = malloc(dp->dsize); - strcpy(dp->dptr, hlp->dirname+1); - chainfill(dp->dptr + ourlen, therest); + strcpy((char*)dp->dptr, hlp->dirname+1); + chainfill((char*)((uintptr_t)dp->dptr + ourlen), therest); } else { @@ -199,14 +205,14 @@ A2(PUBLIC, datum, ROMlib_dbm_fetch, VCBExtra *, vcbp, LONGINT, dir) /* INTERNAL return foo; } -PRIVATE char *copystring(const char *orig, newness_t new) +PRIVATE char *copystring(const char *orig, newness_t new1) { - int length; + size_t length; char *retval; length = strlen(orig); - retval = malloc(length + 2); /* +1 for NULL, +1 for new */ - retval[0] = new; + retval = (char*)malloc(length + 2); /* +1 for NULL, +1 for new */ + retval[0] = new1; strcpy(retval+1, orig); return retval; } @@ -240,7 +246,7 @@ filename_from_pathname (const char *path) --__lastcp; \ } \ \ - __retval = alloca (__len + 1); \ + __retval = (char*)alloca (__len + 1); \ memcpy (__retval, __path, __len); \ __retval[__len] = 0; \ \ @@ -283,7 +289,7 @@ filename_match (const char *prefix, const char *path1, const char *path2) */ PRIVATE BOOLEAN hashinsert(VCBExtra *vcbp, char *pathname, LONGINT *diridp, - LONGINT parid, newness_t new) + LONGINT parid, newness_t new1) { BOOLEAN retval; hashlink_t **hlpp, *newlink; @@ -293,7 +299,7 @@ PRIVATE BOOLEAN hashinsert(VCBExtra *vcbp, char *pathname, LONGINT *diridp, int len; len = strlen (pathname) + 1; - newpathname = alloca (len); + newpathname = (char*)alloca (len); memcpy (newpathname, pathname, len); ROMlib_undotdot (newpathname); pathname = newpathname; @@ -313,7 +319,7 @@ PRIVATE BOOLEAN hashinsert(VCBExtra *vcbp, char *pathname, LONGINT *diridp, { warning_unexpected ("%s %s %d %d %d %d %s %d %d", vcbp->unixname, pathname, *diridp, parid, - new, (*hlpp)->dirname[0], + new1, (*hlpp)->dirname[0], (*hlpp)->dirname+1, (*hlpp)->dirid, (*hlpp)->parid); goto use_new_value_to_be_safe; @@ -351,10 +357,10 @@ PRIVATE BOOLEAN hashinsert(VCBExtra *vcbp, char *pathname, LONGINT *diridp, if (*hlpp) { if ((*hlpp)->dirid == *diridp && (*hlpp)->parid == parid && strcmp(savep, (*hlpp)->dirname+1) == 0) { - if (new >= checked_val && + if (new1 >= checked_val && (*hlpp)->dirname[0] < checked_val) (*hlpp)->dirname[0] = checked_val; - } else if (new >= (unsigned char) (*hlpp)->dirname[0]) { + } else if (new1 >= (unsigned char) (*hlpp)->dirname[0]) { free((*hlpp)->dirname); (*hlpp)->dirname = 0; } @@ -367,7 +373,7 @@ PRIVATE BOOLEAN hashinsert(VCBExtra *vcbp, char *pathname, LONGINT *diridp, } (*hlpp)->parid = parid; if (!(*hlpp)->dirname) - (*hlpp)->dirname = copystring(savep, new); + (*hlpp)->dirname = copystring(savep, new1); } } } @@ -396,7 +402,7 @@ A4(PUBLIC, BOOLEAN, ROMlib_dbm_store, VCBExtra *, vcbp, char *, pathname, /* INT return retval; } -PUBLIC void ROMlib_dbm_delete_inode( VCBExtra *vcbp, LONGINT inode ) +PUBLIC void Executor::ROMlib_dbm_delete_inode( VCBExtra *vcbp, LONGINT inode ) { hashlink_t **hlpp, *todie; @@ -542,7 +548,7 @@ PRIVATE void readadbm(const char *dbmname, VCBExtra *vcbp) datum key, content; rkey_t *keyp; rcontent_t *contentp; - newness_t new; + newness_t new1; LONGINT dirid; /* @@ -554,13 +560,13 @@ PRIVATE void readadbm(const char *dbmname, VCBExtra *vcbp) else { for (DBM_FIRSTKEY(&key, db); key.dptr; DBM_NEXTKEY(&key, db)) { keyp = (rkey_t *) key.dptr; - if (isamatch(keyp, vcbp, &new)) { + if (isamatch(keyp, vcbp, &new1)) { DBM_FETCH (&content, db, key); if (content.dsize) { contentp = (rcontent_t *) content.dptr; dirid = CL(keyp->dirid); hashinsert(vcbp, extractpathname(contentp), &dirid, - CL(contentp->parid), new); + CL(contentp->parid), new1); } } } @@ -622,7 +628,7 @@ A1(PUBLIC, void, ROMlib_dbm_open, VCBExtra *, vcbp) /* INTERNAL */ LONGINT dirid; size = (LONGINT) sizeof(hashlink_t) * HASHSIZE; - vcbp->u.ufs.hashtable = malloc(size); + vcbp->u.ufs.hashtable = (hashlink_t**)malloc(size); vcbp->u.ufs.nhashentries = HASHSIZE; memset(vcbp->u.ufs.hashtable, 0, size); readadbm(ROMlib_PublicDirectoryMap, vcbp); @@ -685,7 +691,7 @@ A1(PUBLIC, OSErr, ufsPBMountVol, ParmBlkPtr, pb) /* INTERNAL */ { char *new_name; - new_name = alloca(3); + new_name = (char*)alloca(3); new_name[0] = name[0]; new_name[1] = '/'; new_name[2] = 0; @@ -806,6 +812,11 @@ A2(PUBLIC, OSErr, Eject, StringPtr, voln, INTEGER, vrn) /* IMIV-108 */ return(PBEject(&pbr)); } +namespace Executor { + static VCB *findvcb(StringPtr, INTEGER, BOOLEAN*, INTEGER*); + static VCB *grabvcb(ParmBlkPtr, INTEGER *); +} + A4(PRIVATE, VCB *, findvcb, StringPtr, sp, INTEGER, vrn, BOOLEAN *, iswd, INTEGER *, vrnp) { @@ -928,6 +939,10 @@ find_pseudo_block_size (long n_blocks, long block_size) return retval; } +namespace Executor { + static VCB *common(ParmBlkPtr); +} + A1(PRIVATE, VCB *, common, ParmBlkPtr, pb) { VCB *vcbp; diff --git a/src/finder.c b/src/finder.cpp similarity index 70% rename from src/finder.c rename to src/finder.cpp index 4f28b6de..97092091 100644 --- a/src/finder.c +++ b/src/finder.cpp @@ -14,8 +14,10 @@ char ROMlib_rcsid_finder[] = #include "rsys/file.h" +using namespace Executor; + PUBLIC OSErr -PBDTGetPath (DTPBPtr dtp) +Executor::PBDTGetPath (DTPBPtr dtp) { OSErr retval; @@ -24,7 +26,7 @@ PBDTGetPath (DTPBPtr dtp) } PUBLIC OSErr -PBDTOpenInform (DTPBPtr dtp) +Executor::PBDTOpenInform (DTPBPtr dtp) { OSErr retval; @@ -33,7 +35,7 @@ PBDTOpenInform (DTPBPtr dtp) } PUBLIC OSErr -PBDTCloseDown (DTPBPtr dtp) +Executor::PBDTCloseDown (DTPBPtr dtp) { OSErr retval; @@ -42,7 +44,7 @@ PBDTCloseDown (DTPBPtr dtp) } PUBLIC OSErr -PBDTGetIcon (DTPBPtr dtp, BOOLEAN async) +Executor::PBDTGetIcon (DTPBPtr dtp, BOOLEAN async) { OSErr retval; @@ -52,7 +54,7 @@ PBDTGetIcon (DTPBPtr dtp, BOOLEAN async) } PUBLIC OSErr -PBDTGetIconInfo (DTPBPtr dtp, BOOLEAN async) +Executor::PBDTGetIconInfo (DTPBPtr dtp, BOOLEAN async) { OSErr retval; @@ -62,7 +64,7 @@ PBDTGetIconInfo (DTPBPtr dtp, BOOLEAN async) } PUBLIC OSErr -PBDTGetAPPL (DTPBPtr dtp, BOOLEAN async) +Executor::PBDTGetAPPL (DTPBPtr dtp, BOOLEAN async) { OSErr retval; @@ -72,7 +74,7 @@ PBDTGetAPPL (DTPBPtr dtp, BOOLEAN async) } PUBLIC OSErr -PBDTGetComment (DTPBPtr dtp, BOOLEAN async) +Executor::PBDTGetComment (DTPBPtr dtp, BOOLEAN async) { OSErr retval; @@ -82,7 +84,7 @@ PBDTGetComment (DTPBPtr dtp, BOOLEAN async) } PUBLIC OSErr -PBDTAddIcon (DTPBPtr dtp, BOOLEAN async) +Executor::PBDTAddIcon (DTPBPtr dtp, BOOLEAN async) { OSErr retval; @@ -92,7 +94,7 @@ PBDTAddIcon (DTPBPtr dtp, BOOLEAN async) } PUBLIC OSErr -PBDTAddAPPL (DTPBPtr dtp, BOOLEAN async) +Executor::PBDTAddAPPL (DTPBPtr dtp, BOOLEAN async) { OSErr retval; @@ -102,7 +104,7 @@ PBDTAddAPPL (DTPBPtr dtp, BOOLEAN async) } PUBLIC OSErr -PBDTSetComment (DTPBPtr dtp, BOOLEAN async) +Executor::PBDTSetComment (DTPBPtr dtp, BOOLEAN async) { OSErr retval; @@ -112,7 +114,7 @@ PBDTSetComment (DTPBPtr dtp, BOOLEAN async) } PUBLIC OSErr -PBDTRemoveAPPL (DTPBPtr dtp, BOOLEAN async) +Executor::PBDTRemoveAPPL (DTPBPtr dtp, BOOLEAN async) { OSErr retval; @@ -122,7 +124,7 @@ PBDTRemoveAPPL (DTPBPtr dtp, BOOLEAN async) } PUBLIC OSErr -PBDTRemoveComment (DTPBPtr dtp, BOOLEAN async) +Executor::PBDTRemoveComment (DTPBPtr dtp, BOOLEAN async) { OSErr retval; @@ -132,7 +134,7 @@ PBDTRemoveComment (DTPBPtr dtp, BOOLEAN async) } PUBLIC OSErr -PBDTFlush (DTPBPtr dtp, BOOLEAN async) +Executor::PBDTFlush (DTPBPtr dtp, BOOLEAN async) { OSErr retval; @@ -142,7 +144,7 @@ PBDTFlush (DTPBPtr dtp, BOOLEAN async) } PUBLIC OSErr -PBDTGetInfo (DTPBPtr dtp, BOOLEAN async) +Executor::PBDTGetInfo (DTPBPtr dtp, BOOLEAN async) { OSErr retval; @@ -152,7 +154,7 @@ PBDTGetInfo (DTPBPtr dtp, BOOLEAN async) } PUBLIC OSErr -PBDTReset (DTPBPtr dtp, BOOLEAN async) +Executor::PBDTReset (DTPBPtr dtp, BOOLEAN async) { OSErr retval; @@ -162,7 +164,7 @@ PBDTReset (DTPBPtr dtp, BOOLEAN async) } PUBLIC OSErr -PBDTDelete (DTPBPtr dtp, BOOLEAN async) +Executor::PBDTDelete (DTPBPtr dtp, BOOLEAN async) { OSErr retval; diff --git a/src/float4.c b/src/float4.cpp similarity index 99% rename from src/float4.c rename to src/float4.cpp index c28f1301..7b829032 100644 --- a/src/float4.c +++ b/src/float4.cpp @@ -17,10 +17,6 @@ char ROMlib_rcsid_float4[] = #include "rsys/common.h" -#if defined (NEXT) -#define INLINE_MATH -#endif - #include #include #include @@ -30,6 +26,8 @@ char ROMlib_rcsid_float4[] = #include "rsys/floatconv.h" #include "rsys/float_fcw.h" +using namespace Executor; + #if !defined (CYGWIN32) #define IEEE_T_FORMAT "%.20Lf" @@ -954,7 +952,7 @@ P_SAVED0D1A0A1_4 (PUBLIC pascal trap, void, ROMlib_Fx2dec, DecForm *, int exponent, digits_to_keep; /* Convert the number to ASCII. */ - digit_string = alloca (SIGDIGLEN + 256); /* tons of extra space */ + digit_string = (char*)alloca (SIGDIGLEN + 256); /* tons of extra space */ #if !defined (CYGWIN32) sprintf (digit_string, "%.80Lf", n); diff --git a/src/float5.c b/src/float5.cpp similarity index 99% rename from src/float5.c rename to src/float5.cpp index ea65a0d2..dd29b5d8 100644 --- a/src/float5.c +++ b/src/float5.cpp @@ -9,15 +9,13 @@ char ROMlib_rcsid_float5[] = #include "rsys/common.h" -#if defined (NeXT) -#define INLINE_MATH -#endif #include #include "SANE.h" #include "rsys/float.h" #include "rsys/floatconv.h" +using namespace Executor; P_SAVED0D1A0A1_1 (PUBLIC pascal trap, void, ROMlib_FlnX, x80_t *, dp) { diff --git a/src/float7.c b/src/float7.cpp similarity index 99% rename from src/float7.c rename to src/float7.cpp index 51fefd47..4f87650a 100644 --- a/src/float7.c +++ b/src/float7.cpp @@ -14,6 +14,8 @@ char ROMlib_rcsid_float7[] = #include "rsys/float.h" #include +using namespace Executor; + #define LOWER(x) ((x) | 0x20) /* converts to lower case if x is A-Z */ #if defined (BINCOMPAT) diff --git a/src/floatnext.c b/src/floatnext.cpp similarity index 99% rename from src/floatnext.c rename to src/floatnext.cpp index 5c0b4545..22296a6f 100644 --- a/src/floatnext.c +++ b/src/floatnext.cpp @@ -12,10 +12,7 @@ char ROMlib_rcsid_floatnext[] = #include "rsys/float.h" #include "rsys/floatconv.h" -#if defined (NEXT) -#define INLINE_MATH -#endif - +using namespace Executor; /* Subtracts one from the given multi-byte big endian unsigned number. */ static void diff --git a/src/font.c b/src/font.cpp similarity index 96% rename from src/font.c rename to src/font.cpp index 5f6bc533..05171a62 100644 --- a/src/font.c +++ b/src/font.cpp @@ -21,6 +21,8 @@ char ROMlib_rcsid_font[] = #include "rsys/font.h" #include "rsys/glue.h" +using namespace Executor; + #define MAXTABLES 12 PRIVATE void @@ -78,13 +80,13 @@ invalidate_all_widths (void) for (i = 0; i < n_entries; ++i) { DisposHandle (MR (hp[i].p)); - hp[i].p = CLC (0); + hp[i].p = (Handle)CLC (0); } HUnlock (wlh); } PUBLIC void -ROMlib_shutdown_font_manager (void) +Executor::ROMlib_shutdown_font_manager (void) { invalidate_all_widths (); } @@ -180,6 +182,20 @@ PRIVATE fchartstr ftstr = { { 1, 1, 1, }, /* undert */ }; +namespace Executor { + PRIVATE void mungfmo(ctrip,FMOutput*); + PRIVATE BOOLEAN widthlistmatch(FMInput *); + PRIVATE int countones(unsigned short); + PRIVATE INTEGER *findfondwidths(); + PRIVATE void buildtable(INTEGER); + PRIVATE void findclosestfont(INTEGER family, INTEGER size, + INTEGER *lesserp, INTEGER *greaterp); + PRIVATE void findclosestfond(FHandle fh, INTEGER size, INTEGER *powerof2p, + INTEGER * lesserp, INTEGER * greaterp); + PRIVATE INTEGER closestface(); + PRIVATE void newwidthtable(FMInput *fmip); +} + A2(PRIVATE, void, mungfmo, ctrip, cp, FMOutput *, fmop) { Byte *p; @@ -257,7 +273,7 @@ A1(PRIVATE, int, countones, unsigned short, i) return retval + counts[i&0xF]; } -INTEGER nhappybits(unsigned short want, unsigned short have) +static INTEGER nhappybits(unsigned short want, unsigned short have) { return (have & ~want) ? -1 : countones(have); } @@ -307,7 +323,7 @@ A0(PRIVATE, INTEGER *, findfondwidths) #define FIXED4(n) (((LONGINT) ((unsigned short) n) << 4) * (Cx(WIDTHPTR->aSize))) PUBLIC Fixed -font_width_expand (Fixed width, Fixed fixed_extra, Fixed hOutputInverse) +Executor::font_width_expand (Fixed width, Fixed fixed_extra, Fixed hOutputInverse) { Fixed retval; diff --git a/src/fontIMVI.c b/src/fontIMVI.cpp similarity index 97% rename from src/fontIMVI.c rename to src/fontIMVI.cpp index 21437859..40e0c541 100644 --- a/src/fontIMVI.c +++ b/src/fontIMVI.cpp @@ -11,6 +11,8 @@ char ROMlib_rcsid_fontIMVI[] = #include "FontMgr.h" +using namespace Executor; + static boolean_t outline_preferred_p = FALSE; P1 (PUBLIC pascal trap, void, SetOutlinePreferred, diff --git a/src/genfndecls.c b/src/genfndecls.cpp similarity index 89% rename from src/genfndecls.c rename to src/genfndecls.cpp index 4cbc6722..92f3e315 100644 --- a/src/genfndecls.c +++ b/src/genfndecls.cpp @@ -15,6 +15,8 @@ char ROMlib_rcsid_genfndecls[] = #include #include +using namespace Executor; + void * xmalloc (unsigned size) { @@ -55,7 +57,7 @@ static inline void line_buf_grow (char ch) { if (line_buf_len == line_buf_max_len) - line_buf = xrealloc (line_buf, line_buf_max_len *= 4); + line_buf = (char*)xrealloc (line_buf, line_buf_max_len *= 4); line_buf[line_buf_len ++] = ch; line_buf[line_buf_len] = '\0'; @@ -74,7 +76,7 @@ static inline void fndecl () { char ch, *t; - char public[7]; + char public1[7]; ch = next_char (); if (! (isdigit (ch) @@ -84,15 +86,15 @@ fndecl () while (next_char () != '(') ; - *public = next_char (); - public[1] = next_char (); - public[2] = next_char (); - public[3] = next_char (); - public[4] = next_char (); - public[5] = next_char (); - public[6] = '\0'; + *public1 = next_char (); + public1[1] = next_char (); + public1[2] = next_char (); + public1[3] = next_char (); + public1[4] = next_char (); + public1[5] = next_char (); + public1[6] = '\0'; - if (strcmp (public, "PUBLIC")) + if (strcmp (public1, "PUBLIC")) return; /* read until matching close paren */ diff --git a/src/gensplash.c b/src/gensplash.cpp similarity index 99% rename from src/gensplash.c rename to src/gensplash.cpp index c0c67e7a..1bef6c5b 100644 --- a/src/gensplash.c +++ b/src/gensplash.cpp @@ -13,6 +13,8 @@ char ROMlib_rcsid_gensplash[] = #include "rsys/splash.h" +using namespace Executor; + int bpp, log2_bpp; struct splash_screen_color color_buf[256]; diff --git a/src/gestalt.c b/src/gestalt.cpp similarity index 96% rename from src/gestalt.c rename to src/gestalt.cpp index f1648006..1591e832 100644 --- a/src/gestalt.c +++ b/src/gestalt.cpp @@ -20,10 +20,7 @@ char ROMlib_rcsid_gestalt[] = #include "rsys/version.h" #include "rsys/vdriver.h" -#if defined (CYGWIN32) -#include "win_dongle.h" -#include "win_print.h" -#endif +using namespace Executor; typedef struct { @@ -326,20 +323,20 @@ replace_selector_in_table (OSType selector, LONGINT new_value, replace_selector_in_table (selector, new_value, table, NELEM (table)) PUBLIC void -replace_physgestalt_selector (OSType selector, uint32 new_value) +Executor::replace_physgestalt_selector (OSType selector, uint32 new_value) { REPLACE_SELECTOR_IN_TABLE (selector, new_value, phystable); } PUBLIC void -gestalt_set_memory_size (uint32 size) +Executor::gestalt_set_memory_size (uint32 size) { REPLACE_SELECTOR_IN_TABLE (gestaltLogicalRAMSize , size, gtable); REPLACE_SELECTOR_IN_TABLE (gestaltPhysicalRAMSize, size, gtable); } PUBLIC void -gestalt_set_system_version (uint32 version) +Executor::gestalt_set_system_version (uint32 version) { REPLACE_SELECTOR_IN_TABLE (gestaltSystemVersion, version, gtable); } @@ -374,7 +371,7 @@ gestalt_helper(OSType selector, LONGINT *responsep, BOOLEAN searchlist, *responsep = CLC (0); /* better safe than sorry */ if (searchlist && (gp = find_selector_on_list(selector))) - retval = CToPascalCall(gp->selectorFunction, CTOP_GestaltTablesOnly, + retval = CToPascalCall(&gp->selectorFunction, CTOP_GestaltTablesOnly, selector, responsep); else { @@ -444,7 +441,7 @@ PRIVATE gestalt_list_entry_t *gestalt_listp = NULL; PRIVATE size_t listp_size = 0; PUBLIC void -ROMlib_clear_gestalt_list (void) +Executor::ROMlib_clear_gestalt_list (void) { free (gestalt_listp); gestalt_listp = NULL; @@ -452,11 +449,11 @@ ROMlib_clear_gestalt_list (void) } PUBLIC void -ROMlib_add_to_gestalt_list (OSType selector, OSErr retval, uint32 new_value) +Executor::ROMlib_add_to_gestalt_list (OSType selector, OSErr retval, uint32 new_value) { typeof (gestalt_listp) new_listp; - new_listp = realloc (gestalt_listp, listp_size + sizeof *gestalt_listp); + new_listp = (typeof(gestalt_listp))realloc (gestalt_listp, listp_size + sizeof *gestalt_listp); if (!new_listp) warning_unexpected ("out of memory"); else @@ -631,7 +628,7 @@ A3(PUBLIC trap, OSErrRET, ReplaceGestalt, OSType, selector, ProcPtr, selFunc, retval = gestaltUndefSelectorErr; else { - *oldSelFuncp = P_GestaltTablesOnly; + *oldSelFuncp = (ProcPtr)P_GestaltTablesOnly; retval = new_link(selector, selFunc); } } diff --git a/src/globals.cpp b/src/globals.cpp new file mode 100644 index 00000000..6119cc25 --- /dev/null +++ b/src/globals.cpp @@ -0,0 +1,328 @@ +/* Copyright 1990, 1996 by Abacus Research and + * Development, Inc. All rights reserved. + */ + +#if !defined (OMIT_RCSID_STRINGS) +char ROMlib_rcsid_globals[] = + "$Id: globals.c 63 2004-12-24 18:19:43Z ctm $"; +#endif + +#include "rsys/common.h" + +#if !defined (nilhandle_H) + +#include "MemoryMgr.h" +#include "DeviceMgr.h" +#include "SoundDvr.h" +#include "QuickDraw.h" +#include "CQuickDraw.h" +#include "FontMgr.h" +#include "WindowMgr.h" +#include "ControlMgr.h" +#include "MenuMgr.h" +#include "AppleEvents.h" + +using namespace Executor; + +#define DATA(type, name, suffix, address, supported, manager, citation) \ +type name suffix + +DATA(HIDDEN_Ptr, nilhandle_H,, 0x00, TRUE-b, rsys/misc, MADEUP); +/* + * NOTE: MacWrite starts writing longwords at location 0x80 for TRAPs + */ +DATA(LONGINT, trapvectors,[10], 0x80, TRUE-b, rsys/misc, WHOKNOWS); +DATA(HIDDEN_Ptr, dodusesit_H,, 0xE4, TRUE-b, rsys/misc, WHOKNOWS); +DATA(INTEGER, monkeylives,, 0x100, TRUE-b, OSEvent, SysEqu.a); +DATA(INTEGER, ScrVRes,, 0x102, TRUE , QuickDraw, IMI-473); +DATA(INTEGER, ScrHRes,, 0x104, TRUE , QuickDraw, IMI-473); +DATA(INTEGER, ScreenRow,, 0x106, TRUE , QuickDraw, ThinkC); +DATA(HIDDEN_Ptr, MemTop_H,, 0x108, TRUE , MemoryMgr, IMII-19); +DATA(HIDDEN_Ptr, BufPtr_H,, 0x10C, TRUE-b, MemoryMgr, IMII-19); +DATA(HIDDEN_Ptr, HeapEnd_H,, 0x114, TRUE , MemoryMgr, IMII-19); +DATA(HIDDEN_THz, TheZone_H,, 0x118, TRUE , MemoryMgr, IMII-31); +DATA(HIDDEN_DCtlHandlePtr, UTableBase_H,,0x11C, FALSE, DeviceMgr, IMII-192); +DATA(Byte, loadtrap,, 0x12D, TRUE-b, SegmentLdr, SysEqu.a); +DATA(Byte, CPUFlag,, 0x12F, TRUE-b, StartMgr, IMV-348); +DATA(HIDDEN_Ptr, ApplLimit_H,, 0x130, TRUE , MemoryMgr, IMII-19); +DATA(INTEGER, SysEvtMask,, 0x144, TRUE , OSEvent, IMII-70); +DATA(QHdr, EventQueue,, 0x14A, TRUE , OSEvent, IMII-71); +DATA(HIDDEN_LONGINT, RndSeed_L,, 0x156, TRUE , QuickDraw, IMI-195); +DATA(INTEGER, SysVersion,, 0x15A, TRUE , OSUtil, ThinkC); +DATA(Byte, SEvtEnb,, 0x15C, FALSE , DeskMgr, IMI-443); +DATA(QHdr, VBLQueue,, 0x160, TRUE , VRetraceMgr, IMII-352); +DATA(HIDDEN_ULONGINT,Ticks_UL,, 0x16A, TRUE , OSEvent, IMI-260); +DATA(Byte, MBState,, 0x172, True-b, EventMgr, PegLeg); +DATA(unsigned char, KeyMap,[16], 0x174, TRUE-b, EventMgr, SysEqu.a); +/* was LONGINT KeypadMap[2]; */ +DATA(INTEGER, KeyThresh,, 0x18E, TRUE , ToolboxEvent, IMI-246); +DATA(INTEGER, KeyRepThresh,, 0x190, TRUE , ToolboxEvent, IMI-246); +DATA(HIDDEN_ProcPtr, Lvl1DT_H,[8], 0x192, FALSE , DeviceMgr, IMII-197); +/* + * Hypercard does a movel to this location. + */ +DATA(LONGINT, hyperlong,, 0x1AA, TRUE-b, rsys/misc, WHOKNOWS); +DATA(HIDDEN_ProcPtr, Lvl2DT_H,[8], 0x1B2, FALSE , DeviceMgr, IMII-198); +DATA(INTEGER, UnitNtryCnt,, 0x1D2, TRUE-b, DeviceMgr, ThinkC); +DATA(HIDDEN_Ptr, VIA_H,, 0x1D4, TRUE-b, DeviceMgr, IMIII-39); +DATA(HIDDEN_Ptr, SCCRd_H,, 0x1D8, FALSE , DeviceMgr, IMII-199); +DATA(HIDDEN_Ptr, SCCWr_H,, 0x1DC, FALSE , DeviceMgr, IMII-199); +DATA(HIDDEN_Ptr, IWM_H,, 0x1E0, FALSE , DeviceMgr, ThinkC); +DATA(Byte, Scratch20,[20], 0x1E4, TRUE , MemoryMgr, IMI-85); +DATA(Byte, SPValid,, 0x1F8, TRUE , OSUtil, IMII-392); +DATA(Byte, SPATalkA,, 0x1F9, TRUE , OSUtil, IMII-392); +DATA(Byte, SPATalkB,, 0x1FA, TRUE , OSUtil, IMII-392); +DATA(Byte, SPConfig,, 0x1FB, TRUE , OSUtil, IMII-392); +DATA(INTEGER, SPPortA,, 0x1FC, TRUE , OSUtil, IMII-392); +DATA(INTEGER, SPPortB,, 0x1FE, TRUE , OSUtil, IMII-392); +DATA(LONGINT, SPAlarm,, 0x200, TRUE , OSUtil, IMII-392); +DATA(INTEGER, SPFont,, 0x204, TRUE , OSUtil, IMII-392); +DATA(Byte, SPKbd,, 0x206, TRUE , OSUtil, IMII-369); +DATA(Byte, SPPrint,, 0x207, TRUE , OSUtil, IMII-392); +DATA(Byte, SPVolCtl,, 0x208, TRUE , OSUtil, IMII-392); +DATA(Byte, SPClikCaret,, 0x209, TRUE , OSUtil, IMII-392); +DATA(Byte, SPMisc2,, 0x20B, TRUE , OSUtil, IMII-392); +DATA(ULONGINT, Time,, 0x20C, TRUE , OSUtil, IMI-260); +DATA(INTEGER, BootDrive,, 0x210, TRUE , FileMgr, IMIV-212); +DATA(INTEGER, SFSaveDisk,, 0x214, TRUE , StdFilePkg, IMIV-72); +DATA(Byte, KbdLast,, 0x218, FALSE , QuickDraw, IMV-367); +DATA(Byte, KbdType,, 0x21E, FALSE , QuickDraw, IMV-367); +DATA(INTEGER, MemErr,, 0x220, TRUE , MemoryMgr, IMIV-80); +DATA(Byte, SdVolume,, 0x260, TRUE-b, SoundDvr, IMII-232); +DATA(HIDDEN_FTSndRecPtr,SoundPtr_H,, 0x262, FALSE , SoundDvr, IMII-227); +DATA(HIDDEN_Ptr, SoundBase_H,, 0x266, TRUE-b, SoundDvr, IMIII-21); +DATA(Byte, SoundActive,, 0x27E, TRUE , SoundDvr, MPW); +DATA(Byte, SoundLevel,, 0x27F, FALSE , SoundDvr, IMII-234); +DATA(INTEGER, CurPitch,, 0x280, TRUE-b, SoundDvr, IMII-226); +/* + * NOTE: mathones is a LONGINT that Mathematica looks at that contains -1 + * on a Mac+ + */ +DATA(LONGINT, mathones,, 0x282, TRUE-b, rsys/misc, WHOKNOWS); +/* + * NOTE: Theoretically ROM85 is mentioned in IMV, but I don't know where. + * On a Mac+ the value 0x7FFF is stored there. + * tim: It is at least on page IMV-328. + */ +DATA(INTEGER, ROM85,, 0x28E, TRUE-b, MacTypes, IMV-328); +DATA(Byte, PortBUse,, 0x291, TRUE-b, AppleTalk, IMII-305); +DATA(Byte, ScreenVars,[8], 0x292, FALSE , QuickDraw, MPW); +/* + * NOTE: Key1Trans in the keyboard translator procedure, and Key2Trans in the + * numeric keypad translator procedure (MPW). + */ +DATA(HIDDEN_Ptr, Key1Trans_H,, 0x29E, FALSE , QuickDraw, MPW); +DATA(HIDDEN_Ptr, Key2Trans_H,, 0x2A2, FALSE , QuickDraw, MPW); +DATA(HIDDEN_THz, SysZone_H,, 0x2A6, TRUE , MemoryMgr, IMII-19); +DATA(HIDDEN_THz, ApplZone_H,, 0x2AA, TRUE , MemoryMgr, IMII-19); +DATA(HIDDEN_Ptr, ROMBase_H,, 0x2AE, TRUE-b, MemoryMgr, IMIV-236); +DATA(HIDDEN_Ptr, RAMBase_H,, 0x2B2, FALSE , MemoryMgr, IMI-87); +DATA(HIDDEN_AE_info_ptr,AE_info_H,, 0x2B6, TRUE, AppleEvents, AEGizmo); +DATA(HIDDEN_Ptr, DSAlertTab_H,, 0x2BA, TRUE , SysErr, IMII-359); +DATA(HIDDEN_ProcPtr, ExtStsDT_H,[4], 0x2BE, FALSE , DeviceMgr, IMII-199); +DATA(HIDDEN_Ptr, ABusVars_H,, 0x2D8, FALSE , AppleTalk, IMII-328); +DATA(HIDDEN_Ptr, ABusDCE_H,, 0x2DC, FALSE , AppleTalk, MPW); +DATA(Byte, FinderName,[16], 0x2E0, TRUE , SegmentLdr, IMII-59); +DATA(LONGINT, DoubleTime,, 0x2F0, TRUE , ToolboxEvent, IMI-260); +DATA(LONGINT, CaretTime,, 0x2F4, TRUE , ToolboxEvent, IMI-260); +DATA(Byte, ScrDmpEnb,, 0x2F8, TRUE , ToolboxEvent, IMI-258); +DATA(LONGINT, BufTgFNum,, 0x2FC, FALSE , DiskDvr, IMII-212); +DATA(INTEGER, BufTgFFlg,, 0x300, FALSE , DiskDvr, IMII-212); +DATA(INTEGER, BufTgFBkNum,, 0x302, FALSE , DiskDvr, IMII-212); +DATA(LONGINT, BufTgDate,, 0x304, FALSE , DiskDvr, IMII-212); +DATA(QHdr, DrvQHdr,, 0x308, TRUE , FileMgr, IMIV-182); +DATA(HIDDEN_Ptr, heapcheck_H,, 0x316, TRUE-b, MemoryMgr, SysEqu.a); +DATA(LONGINT, Lo3Bytes,, 0x31A, TRUE , MemoryMgr, IMI-85); +DATA(LONGINT, MinStack,, 0x31E, TRUE-b, MemoryMgr, IMII-17); +DATA(LONGINT, DefltStack,, 0x322, TRUE-b, MemoryMgr, IMII-17); +DATA(HIDDEN_Handle, GZRootHnd_H,, 0x328, TRUE , MemoryMgr, IMI-43); +DATA(HIDDEN_Handle, GZMoveHnd_H,, 0x330, FALSE , MemoryMgr, LowMem.h); +DATA(HIDDEN_ProcPtr, EjectNotify_H,, 0x338, FALSE , FileMgr, ThinkC); +DATA(HIDDEN_ProcPtr, IAZNotify_H,, 0x33C, TRUE-b, MemoryMgr, ThinkC); +DATA(HIDDEN_Ptr, FCBSPtr_H,, 0x34E, TRUE , FileMgr, IMIV-179); +DATA(HIDDEN_VCBPtr, DefVCBPtr_H,, 0x352, TRUE , FileMgr, IMIV-178); +DATA(QHdr, VCBQHdr,, 0x356, TRUE , FileMgr, IMIV-178); +DATA(QHdr, FSQHdr,, 0x360, TRUE , FileMgr, IMIV-176); +DATA(HIDDEN_Ptr, WDCBsPtr_H,, 0x372, TRUE , FileMgr, idunno); +DATA(INTEGER, DefVRefNum,, 0x384, TRUE , FileMgr, MPW); +DATA(LONGINT, CurDirStore,, 0x398, TRUE , StdFilePkg, IMIV-72); +/* + * Note: MacLinkPC+ loads 0x358 into a register (i.e. the address of the + * pointer to the first element on the VCB queue) and then uses + * 72 off of it (0x3A0) and 78 off of it (0x3A6). As LONGINT as + * there are zeros there, that doesn't hurt us, but normally, + * we'd have negative ones in there. Hence we describe them + * here and set them to zero in executor. + */ +/* DATA(HIDDEN_Ptr, FmtDefaults_H,, 0x39E, FALSE , FileMgr, ThinkC); */ +DATA(INTEGER, MCLKPCmiss1,, 0x3A0, TRUE-b, MacLinkPC, badaccess); +DATA(INTEGER, MCLKPCmiss2,, 0x3A6, TRUE-b, MacLinkPC, badaccess); +DATA(HIDDEN_Ptr, ToExtFS_H,, 0x3F2, FALSE , FileMgr, IMIV-212); +DATA(INTEGER, FSFCBLen,, 0x3F6, TRUE , FileMgr, IMIV-97); +DATA(Rect, DSAlertRect,, 0x3F8, TRUE , SysErr, IMII-362); +DATA(HIDDEN_ProcPtr, JUnknown574_H,, 0x574, TRUE-b, QuickDraw, IMV); +DATA(HIDDEN_ProcPtr, JADBProc_H,, 0x6B8, FALSE , QuickDraw, IMV); +/* + * JFLUSH is a guess from disassembling some of Excel 3.0 + */ +DATA(HIDDEN_ProcPtr, JFLUSH_H,, 0x6F4, TRUE-b, idunno, guess); +DATA(HIDDEN_ProcPtr, JResUnknown1_H,, 0x700, TRUE-b, idunno, resedit); +DATA(HIDDEN_ProcPtr, JResUnknown2_H,, 0x714, TRUE-b, idunno, resedit); +DATA(HIDDEN_ProcPtr, JHideCursor_H,, 0x800, TRUE-b, QuickDraw, Private.a); +DATA(HIDDEN_ProcPtr, JShowCursor_H,, 0x804, TRUE-b, QuickDraw, Private.a); +DATA(HIDDEN_ProcPtr, JShieldCursor_H,, 0x808, TRUE-b, QuickDraw, Private.a); +DATA(HIDDEN_ProcPtr, JScrnAddr_H,, 0x80C, FALSE , QuickDraw, Private.a); +DATA(HIDDEN_ProcPtr, JScrnSize_H,, 0x810, FALSE , QuickDraw, Private.a); +DATA(HIDDEN_ProcPtr, JInitCrsr_H,, 0x814, TRUE-b, QuickDraw, Private.a); +DATA(HIDDEN_ProcPtr, JSetCrsr_H,, 0x818, TRUE-b, QuickDraw, Private.a); +DATA(HIDDEN_ProcPtr, JCrsrObscure_H,, 0x81C, TRUE-b, QuickDraw, Private.a); +DATA(HIDDEN_ProcPtr, JUpdateProc_H,, 0x820, FALSE , QuickDraw, Private.a); +DATA(HIDDEN_Ptr, ScrnBase_H,, 0x824, TRUE , QuickDraw, IMII-19); +/* + * MouseLocation used to be 0x830, but that doesn't jibe with what I've + * seen of Crystal Quest --ctm + */ +DATA(Point, MTemp,, 0x828, True-b, QuickDraw, PegLeg); +DATA(Point, MouseLocation,, 0x82C, TRUE , QuickDraw, Vamp); +DATA(Point, MouseLocation2,, 0x830, TRUE , QuickDraw, MacAttack); +DATA(Rect, CrsrPin,, 0x834, FALSE , QuickDraw, ThinkC); +DATA(HIDDEN_GDHandle,MainDevice_H,, 0x8A4, TRUE , QuickDraw, IMV); +DATA(HIDDEN_GDHandle,DeviceList_H,, 0x8A8, TRUE , QuickDraw, IMV); +DATA(Byte, QDColors,, 0x8B0, FALSE , QuickDraw, IMV); +DATA(BOOLEAN, CrsrVis,, 0x8CC, TRUE , QuickDraw, SysEqu.a); +DATA(Byte, CrsrBusy,, 0x8CD, TRUE , QuickDraw, SysEqu.a); +DATA(INTEGER, CrsrState,, 0x8D0, TRUE , QuickDraw, SysEqu.a); +DATA(LONGINT, mousemask,, 0x8D6, TRUE-b, QuickDraw, .a); +DATA(LONGINT, mouseoffset,, 0x8DA, TRUE-b, QuickDraw, SysEqu.a); +DATA(INTEGER, JournalFlag,, 0x8DE, FALSE , ToolboxEvent, IMI-261); +DATA(HIDDEN_ProcPtr, JSwapFont_H,, 0x8E0, TRUE-b, FontMgr, Private.a); +DATA(HIDDEN_Handle, WidthListHand_H,, 0x8E4, TRUE , FontMgr, IMIV-42); +DATA(INTEGER, JournalRef,, 0x8E8, FALSE , ToolboxEvent, IMI-261); +DATA(INTEGER, CrsrThresh,, 0x8EC, FALSE , OSUtil, IMII-372); +DATA(HIDDEN_ProcPtr, JCrsrTask_H,, 0x8EE, TRUE , , ); +DATA(Byte, WWExist,, 0x8F2, TRUE , SysError, SysEqu.a); +DATA(Byte, QDExist,, 0x8F3, TRUE , SysError, SysEqu.a); +DATA(HIDDEN_Ptr, JFetch_H,, 0x8F4, FALSE , DeviceMgr, IMII-194); +DATA(HIDDEN_Ptr, JStash_H,, 0x8F8, FALSE , DeviceMgr, IMII-195); +DATA(HIDDEN_Ptr, JIODone_H,, 0x8FC, FALSE , DeviceMgr, IMII-195); +DATA(INTEGER, CurApRefNum,, 0x900, TRUE , SegmentLdr, IMII-58); +DATA(HIDDEN_Ptr, CurrentA5_H,, 0x904, TRUE , MemoryMgr, IMI-95); +DATA(HIDDEN_Ptr, CurStackBase_H,, 0x908, TRUE-b, MemoryMgr, IMII-19); +/* + * NOTE: IMIII says CurApName is 32 bytes LONGINT, but it looks to me like + * it is really 34 bytes LONGINT. + */ +DATA(Byte, CurApName,[34], 0x910, TRUE , SegmentLdr, IMII-58); +DATA(INTEGER, CurJTOffset,, 0x934, TRUE-b, SegmentLdr, IMII-62); +DATA(INTEGER, CurPageOption,, 0x936, TRUE , SegmentLdr, IMII-60); +DATA(Byte, HiliteMode,, 0x938, TRUE-b, QuickDraw, IMV); +/* + * NOTE: Since we don't support printing yet, starting PrintErr at 0 + * is what we mean by supporting it. + */ +DATA(INTEGER, PrintErr,, 0x944, TRUE-b, PrintMgr, IMII-161); +/* + * NOTE: The graphing program looks for a -1 in 0x952 + */ +DATA(INTEGER, graphlooksat,, 0x952, TRUE-b, rsys/misc, WHOKNOWS); +/* + * NOTE: MacWrite stores a copy of the trap address for LoadSeg in 954 + */ +DATA(LONGINT, macwritespace,, 0x954, TRUE-b, rsys/misc, WHOKNOWS); +DATA(LONGINT, ScrapSize,, 0x960, TRUE , ScrapMgr, IMI-457); +DATA(HIDDEN_Handle, ScrapHandle_H,, 0x964, TRUE , ScrapMgr, IMI-457); +DATA(INTEGER, ScrapCount,, 0x968, TRUE , ScrapMgr, IMI-457); +DATA(INTEGER, ScrapState,, 0x96A, TRUE , ScrapMgr, IMI-457); +DATA(HIDDEN_StringPtr, ScrapName_H,, 0x96C, TRUE , ScrapMgr, IMI-457); +DATA(HIDDEN_Handle, ROMFont0_H,, 0x980, TRUE , FontMgr, IMI-233); +DATA(INTEGER, ApFontID,, 0x984, TRUE , FontMgr, IMIV-31); +DATA(FMInput, ROMlib_myfmi,, 0x988, TRUE , FontMgr, ToolEqu.a); +DATA(FMOutput, ROMlib_fmo,, 0x998, TRUE , FontMgr, Private.a); +DATA(Byte, ToolScratch,[8], 0x9CE, TRUE , MemoryMgr, IMI-85); +DATA(HIDDEN_WindowPeek,WindowList_H,, 0x9D6, TRUE , WindowMgr, IMI-274); +DATA(INTEGER, SaveUpdate,, 0x9DA, TRUE , WindowMgr, IMI-297); +DATA(INTEGER, PaintWhite,, 0x9DC, TRUE , WindowMgr, IMI-297); +DATA(HIDDEN_GrafPtr, WMgrPort_H,, 0x9DE, TRUE , WindowMgr, IMI-282); +DATA(HIDDEN_RgnHandle,OldStructure_H,, 0x9E6, TRUE , WindowMgr, IMI-296); +DATA(HIDDEN_RgnHandle,OldContent_H,, 0x9EA, TRUE , WindowMgr, IMI-296); +DATA(HIDDEN_RgnHandle,GrayRgn_H,, 0x9EE, TRUE , WindowMgr, IMI-282); +DATA(HIDDEN_RgnHandle,SaveVisRgn_H,, 0x9F2, TRUE , WindowMgr, IMI-293); +DATA(HIDDEN_ProcPtr, DragHook_H,, 0x9F6, TRUE , WindowMgr, IMI-324); +DATA(Byte, Scratch8,[8], 0x9FA, TRUE , MemoryMgr, IMI-85); +DATA(LONGINT, OneOne,, 0xA02, TRUE , MemoryMgr, IMI-85); +DATA(LONGINT, MinusOne,, 0xA06, TRUE , MemoryMgr, IMI-85); +DATA(INTEGER, TopMenuItem,, 0xA0A, TRUE , MenuMgr, IMV-249); +DATA(INTEGER, AtMenuBottom,, 0xA0C, TRUE , MenuMgr, IMV-249); +DATA(HIDDEN_Handle, MenuList_H,, 0xA1C, TRUE , MenuMgr, IMI-346); +DATA(INTEGER, MBarEnable,, 0xA20, TRUE , MenuMgr, IMI-356); +DATA(INTEGER, MenuFlash,, 0xA24, TRUE , MenuMgr, IMI-361); +DATA(INTEGER, TheMenu,, 0xA26, TRUE , MenuMgr, IMI-357); +DATA(HIDDEN_ProcPtr, MBarHook_H,, 0xA2C, TRUE , MenuMgr, IMI-356); +DATA(HIDDEN_ProcPtr, MenuHook_H,, 0xA30, TRUE , MenuMgr, IMI-356); +DATA(Pattern, DragPattern,, 0xA34, TRUE , WindowMgr, IMI-324); +DATA(Pattern, DeskPattern,, 0xA3C, TRUE , WindowMgr, IMI-282); +DATA(Byte, macfpstate,[6], 0xA4A, TRUE-b, unknown, ToolEqu.a); +DATA(HIDDEN_Handle, TopMapHndl_H,, 0xA50, TRUE , ResourceMgr, IMI-115); +DATA(HIDDEN_Handle, SysMapHndl_H,, 0xA54, TRUE , ResourceMgr, IMI-114); +DATA(INTEGER, SysMap,, 0xA58, TRUE , ResourceMgr, IMI-114); +DATA(INTEGER, CurMap,, 0xA5A, TRUE , ResourceMgr, IMI-117); +DATA(INTEGER, resreadonly,, 0xA5C, FALSE , ResourceMgr, ToolEqu.a); +DATA(BOOLEAN, ResLoad,, 0xA5E, TRUE , ResourceMgr, IMI-118); +DATA(INTEGER, ResErr,, 0xA60, TRUE , ResourceMgr, IMI-118); +DATA(Byte, FScaleDisable,, 0xA63, TRUE , FontMgr, IMI-222); +DATA(HIDDEN_WindowPtr,CurActivate_H,, 0xA64, TRUE , WindowMgr, IMI-280); +DATA(HIDDEN_WindowPtr,CurDeactive_H,, 0xA68, TRUE , WindowMgr, IMI-280); +DATA(HIDDEN_ProcPtr, DeskHook_H,, 0xA6C, TRUE , WindowMgr, IMI-282); +DATA(HIDDEN_ProcPtr, TEDoText_H,, 0xA70, TRUE , TextEdit, IMI-391); +DATA(HIDDEN_ProcPtr, TERecal_H,, 0xA74, FALSE , TextEdit, IMI-391); +DATA(Byte, ApplScratch,[12], 0xA78, TRUE , MemoryMgr, IMI-85); +DATA(HIDDEN_WindowPtr,GhostWindow_H,, 0xA84, TRUE , WindowMgr, IMI-287); +DATA(HIDDEN_ProcPtr, ResumeProc_H,, 0xA8C, TRUE , DialogMgr, IMI-411); +DATA(INTEGER, ANumber,, 0xA98, TRUE , DialogMgr, IMI-423); +DATA(INTEGER, ACount,, 0xA9A, TRUE , DialogMgr, IMI-423); +DATA(HIDDEN_ProcPtr, DABeeper_H,, 0xA9C, TRUE , DialogMgr, IMI-411); +DATA(HIDDEN_Handle, DAStrings_H,[4], 0xAA0, TRUE , DialogMgr, IMI-421); +DATA(INTEGER, TEScrpLength,, 0xAB0, TRUE , TextEdit, IMI-389); +DATA(HIDDEN_Handle, TEScrpHandle_H,, 0xAB4, TRUE , TextEdit, IMI-389); +DATA(HIDDEN_Handle, AppPacks_H,[8], 0xAB8, TRUE-b , PackageMgr, ThinkC); +DATA(Byte, SysResName,[20], 0xAD8, TRUE , ResourceMgr, IMI-114); +DATA(HIDDEN_Handle, AppParmHandle_H,, 0xAEC, TRUE , SegmentLdr, IMII-57); +DATA(INTEGER, DSErrCode,, 0xAF0, TRUE , MacTypes, IMII-362); +DATA(HIDDEN_ProcPtr, ResErrProc_H,, 0xAF2, TRUE , ResourceMgr, IMI-116); +DATA(INTEGER, DlgFont,, 0xAFA, TRUE , DialogMgr, IMI-412); +DATA(HIDDEN_WidthTablePtr,WidthPtr_H,, 0xB10, TRUE , FontMgr, IMIV-42); +DATA(INTEGER, SCSIFlags,, 0xB22, TRUE-b, uknown, Private.a); +DATA(HIDDEN_WidthTableHandle,WidthTabHandle_H,,0xB2A,TRUE, FontMgr, IMIV-42); +DATA(LONGINT, LastSPExtra,, 0xB4C, TRUE-b, rsys/misc, WHOKNOWS); +DATA(LONGINT, MenuDisable,, 0xB54, TRUE , MenuMgr, IMV-249); +DATA(HIDDEN_Handle, MBDFHndl_H,, 0xB58, TRUE , MenuMgr, Private.a); +DATA(HIDDEN_Handle, MBSaveLoc_H,, 0xB5C, TRUE , MenuMgr, Private.a); +DATA(Byte, RomMapInsert,, 0xB9E, FALSE , ResourceMgr, IMIV-19); +DATA(Byte, TmpResLoad,, 0xB9F, FALSE , ResourceMgr, IMIV-19); +DATA(LONGINT, IntlSpec,, 0xBA0, TRUE , FontMgr, IMIV-42); +DATA(INTEGER, SysFontFam,, 0xBA6, TRUE , FontMgr, IMIV-31); +DATA(INTEGER, SysFontSiz,, 0xBA8, TRUE , FontMgr, IMIV-31); +DATA(INTEGER, MBarHeight,, 0xBAA, TRUE , MenuMgr, IMV-253); +DATA(INTEGER, TESysJust,, 0xBAC, TRUE-b, ScriptMgr, ToolEqu.a); +DATA(HIDDEN_FamRecHandle, LastFOND_H,, 0xBC2, TRUE , FontMgr, IMIV-36); +DATA(INTEGER, fondid,, 0xBC6, TRUE-b, FontMgr, ToolEqu.a); +DATA(Byte, FractEnable,, 0xBF4, TRUE , FontMgr, IMIV-32); +DATA(Byte, MMUType,, 0xCB1, FALSE , OSUtil, MPW); +DATA(Byte, MMU32Bit,, 0xCB2, TRUE-b, OSUtil, IMV-592); +DATA(HIDDEN_GDHandle,TheGDevice_H,, 0xCC8, TRUE , QuickDraw, IMV); +DATA(HIDDEN_AuxWinHandle,AuxWinHead_H,, 0xCD0, TRUE , WindowMgr, IMV-200); +DATA(HIDDEN_AuxCtlHandle,AuxCtlHead_H,, 0xCD4, TRUE , ControlMgr, IMV-216); +DATA(HIDDEN_PixPatHandle, DeskCPat_H,, 0xCD8, TRUE , WindowMgr, SysEqua.a); +DATA(INTEGER, TimeDBRA,, 0xD00, FALSE , StartMgr, IMV); +DATA(INTEGER, TimeSCCDB,, 0xD02, FALSE , StartMgr, IMV); +DATA(HIDDEN_ProcPtr, JVBLTask_H,, 0xD28, FALSE , VRetraceMgr, IMV); +DATA(HIDDEN_CGrafPtr,WMgrCPort_H,, 0xD2C, FALSE , QuickDraw, IMV-205); +DATA(HIDDEN_Handle, SynListHandle_H,, 0xD32, FALSE , FontMgr, IMV-182); +DATA(HIDDEN_MCTableHandle,MenuCInfo_H,, 0xD50, TRUE , QuickDraw, IMV-242); +DATA(QHdr, DTQueue,, 0xD92, FALSE , OSUtil, IMV-466); +DATA(HIDDEN_ProcPtr, JDTInstall_H,, 0xD9C, FALSE , OSUtil, IMV); +DATA(RGBColor, HiliteRGB,, 0xDA0, TRUE , QuickDraw, IMV-62); +DATA(INTEGER, TimeSCSIDB,, 0xDA6, FALSE , StartMgr, IMV); +DATA(LONGINT, lastlowglobal,, 0x2000, TRUE-b, rsys/misc, MadeUp); + +#endif diff --git a/src/hfsBtree.c b/src/hfsBtree.cpp similarity index 94% rename from src/hfsBtree.c rename to src/hfsBtree.cpp index c2e01bda..19d97de3 100644 --- a/src/hfsBtree.c +++ b/src/hfsBtree.cpp @@ -74,6 +74,8 @@ char ROMlib_rcsid_hfsBtree[] = #include "rsys/hfs_plus.h" +using namespace Executor; + #if 0 PUBLIC ULONGINT blockchecksum(void *blockp) { @@ -114,7 +116,7 @@ PRIVATE void checkcache(short refnum) } #endif -PUBLIC cacheentry *ROMlib_addrtocachep(Ptr addr, HVCB *vcbp) +PUBLIC cacheentry *Executor::ROMlib_addrtocachep(Ptr addr, HVCB *vcbp) { cachehead *headp; cacheentry *retval; @@ -145,7 +147,7 @@ PUBLIC cacheentry *ROMlib_addrtocachep(Ptr addr, HVCB *vcbp) * the file is already there. */ -PUBLIC OSErr ROMlib_errortype(btparam *btpb) +PUBLIC OSErr Executor::ROMlib_errortype(btparam *btpb) { trailentry *tep; btnode *btp; @@ -251,7 +253,7 @@ PRIVATE void checkbtp(btnode *btp) } #endif /* CATFILEDEBUG */ -PUBLIC BOOLEAN ROMlib_searchnode(btnode *btp, void *key, compfp fp, +PUBLIC BOOLEAN Executor::ROMlib_searchnode(btnode *btp, void *key, compfp fp, anykey **keypp, INTEGER *afterp) { INTEGER low, high, mid; @@ -326,7 +328,7 @@ PRIVATE void makefirst(cachehead *headp, cacheentry *entryp) } } -PUBLIC OSErr ROMlib_putcache(cacheentry *cachep) +PUBLIC OSErr Executor::ROMlib_putcache(cacheentry *cachep) { OSErr err; HVCB *vcbp; @@ -365,7 +367,7 @@ PUBLIC LONGINT tagtfs1; PRIVATE BOOLEAN ROMlib_index_cached = FALSE; -PUBLIC OSErr ROMlib_getcache(cacheentry **retpp, uint16 refnum, ULONGINT logbno, +PUBLIC OSErr Executor::ROMlib_getcache(cacheentry **retpp, uint16 refnum, ULONGINT logbno, cacheflagtype flags) { cacheentry *retval, *lastp, *lastdirtyp, *lastfreep; @@ -468,7 +470,7 @@ PUBLIC OSErr ROMlib_getcache(cacheentry **retpp, uint16 refnum, ULONGINT logbno, } #if defined (CATFILEDEBUG) -PUBLIC void ROMlib_checkleaves(INTEGER refnum) +PUBLIC void Executor::ROMlib_checkleaves(INTEGER refnum) { OSErr err; cacheentry *block0cachep, *cachep; @@ -500,7 +502,7 @@ PUBLIC void ROMlib_checkleaves(INTEGER refnum) } #endif /* CATFILEDEBUG */ -PUBLIC OSErr ROMlib_cleancache(HVCB *vcbp) +PUBLIC OSErr Executor::ROMlib_cleancache(HVCB *vcbp) { INTEGER i; cachehead *headp; @@ -518,7 +520,7 @@ PUBLIC OSErr ROMlib_cleancache(HVCB *vcbp) return err; } -PUBLIC OSErr ROMlib_flushcachevcbp(HVCB *vcbp) +PUBLIC OSErr Executor::ROMlib_flushcachevcbp(HVCB *vcbp) { INTEGER i; cachehead *headp; @@ -554,7 +556,7 @@ PUBLIC OSErr ROMlib_flushcachevcbp(HVCB *vcbp) * first and last node have the CACHEBUSY bit set. */ -PUBLIC OSErr ROMlib_keyfind(btparam *btpb) +PUBLIC OSErr Executor::ROMlib_keyfind(btparam *btpb) { cacheentry *cachep; OSErr err; @@ -583,7 +585,7 @@ PUBLIC OSErr ROMlib_keyfind(btparam *btpb) type = 0; #endif /* LETGCCWAIL */ for (;;) { - err = ROMlib_getcache(&cachep, btpb->refnum, node, 0); + err = ROMlib_getcache(&cachep, btpb->refnum, node, (cacheflagtype)0); if (err == noErr) { tep->logbno = node; tep->cachep = cachep; @@ -619,7 +621,7 @@ PUBLIC OSErr ROMlib_keyfind(btparam *btpb) * computation.. */ -PUBLIC OSErr ROMlib_btnext(anykey **nextpp, anykey *keyp, HVCB *vcbp) +PUBLIC OSErr Executor::ROMlib_btnext(anykey **nextpp, anykey *keyp, HVCB *vcbp) { cacheentry *cachep; btnode *btp; @@ -637,7 +639,7 @@ PUBLIC OSErr ROMlib_btnext(anykey **nextpp, anykey *keyp, HVCB *vcbp) else if (i < CW(btp->ndNRecs) - 1) retval = BTENTRY(btp, i+1); else if ((node = CL(btp->ndFLink))) { - err = ROMlib_getcache(&cachep, CW(cachep->refnum), node, 0); + err = ROMlib_getcache(&cachep, CW(cachep->refnum), node, (cacheflagtype)0); if (err != noErr) { fs_err_hook (err); @@ -692,7 +694,7 @@ PRIVATE OSErr MapBitSetOrClr(cacheentry *block0cachep, LONGINT bit, } else { if (btp->ndFLink) { bit -= nmapnodes; - err = ROMlib_getcache(&cachep, refnum, CL(btp->ndFLink), 0); + err = ROMlib_getcache(&cachep, refnum, CL(btp->ndFLink), (cacheflagtype)0); if (err != noErr) { fs_err_hook (err); @@ -741,7 +743,7 @@ PRIVATE OSErr add_free_nodes(cacheentry *block0cachep, ULONGINT n_new_nodes) if (nnodes + n_new_nodes > nmapnodes) { if (btp->ndFLink) { nnodes -= nmapnodes; - err = ROMlib_getcache(&newcachep, refnum, CL(btp->ndFLink), 0); + err = ROMlib_getcache(&newcachep, refnum, CL(btp->ndFLink), (cacheflagtype)0); if (err != noErr) { fs_err_hook (err); @@ -830,7 +832,7 @@ PRIVATE OSErr MapFindFirstBitAndSet(cacheentry *block0cachep, } else { if (btp->ndFLink) { retval += nmapnodes; - err = ROMlib_getcache(&cachep, refnum, CL(btp->ndFLink), 0); + err = ROMlib_getcache(&cachep, refnum, CL(btp->ndFLink), (cacheflagtype)0); if (err != noErr) { fs_err_hook (err); @@ -880,7 +882,7 @@ PRIVATE OSErr deletenode(cacheentry *todeletep) if (CL(block0p->lastleaf) == node) block0p->lastleaf = CL(blink); if (blink) { - err = ROMlib_getcache(&linkcachep, refnum, blink, 0); + err = ROMlib_getcache(&linkcachep, refnum, blink, (cacheflagtype)0); if (err != noErr) { fs_err_hook (err); @@ -891,7 +893,7 @@ PRIVATE OSErr deletenode(cacheentry *todeletep) linkcachep->flags |= CACHEDIRTY; } if (flink) { - err = ROMlib_getcache(&linkcachep, refnum, flink, 0); + err = ROMlib_getcache(&linkcachep, refnum, flink, (cacheflagtype)0); if (err != noErr) { fs_err_hook (err); @@ -1102,7 +1104,7 @@ PRIVATE OSErr btsetkey(cacheentry *cachep, INTEGER index, anykey *srckeyp) PRIVATE OSErr pullout(cacheentry *selfcachep, INTEGER selfindex, cacheentry *parentcachep, INTEGER parentindex, INTEGER *todeletep) { - cacheentry *leftcachep, *rightcachep; + cacheentry *leftcachep = NULL, *rightcachep = NULL; btnode *btp, *parentbtp, *leftbtp, *rightbtp; short *offsetp; INTEGER adjust; @@ -1363,7 +1365,7 @@ PRIVATE OSErr updatenumentries(cacheentry *block0cachep, INTEGER adjust) return noErr; } -PUBLIC OSErr ROMlib_btdelete(btparam *btpb) +PUBLIC OSErr Executor::ROMlib_btdelete(btparam *btpb) { OSErr err; trailentry *tep; @@ -1492,7 +1494,7 @@ PUBLIC OSErr ROMlib_btdelete(btparam *btpb) return err; } -PUBLIC OSErr ROMlib_makecatparam(btparam *btpb, HVCB *vcbp, LONGINT dirid, +PUBLIC OSErr Executor::ROMlib_makecatparam(btparam *btpb, HVCB *vcbp, LONGINT dirid, INTEGER namelen, Ptr namep) { OSErr retval; @@ -1506,7 +1508,7 @@ PUBLIC OSErr ROMlib_makecatparam(btparam *btpb, HVCB *vcbp, LONGINT dirid, return retval; } -PUBLIC OSErr ROMlib_dirtyleaf(void *p, HVCB *vcbp) +PUBLIC OSErr Executor::ROMlib_dirtyleaf(void *p, HVCB *vcbp) { OSErr err; cacheentry *cachep; @@ -1601,7 +1603,7 @@ PRIVATE OSErr valenceadjust(btparam *btpb, INTEGER toadjust, filekind kind) * ROMlib_filedelete calls ROMlib_btdelete but adjusts valences (is called by ROMlib_dirdelete) */ -PUBLIC OSErr ROMlib_filedelete(btparam *btpb, filekind kind) +PUBLIC OSErr Executor::ROMlib_filedelete(btparam *btpb, filekind kind) { OSErr err; @@ -1616,7 +1618,7 @@ PUBLIC OSErr ROMlib_filedelete(btparam *btpb, filekind kind) * ROMlib_dirdelete calls ROMlib_filedelete but also deletes the thread record */ -PUBLIC OSErr ROMlib_dirdelete(btparam *btpb) +PUBLIC OSErr Executor::ROMlib_dirdelete(btparam *btpb) { OSErr err; directoryrec *drp; @@ -1674,9 +1676,6 @@ PRIVATE OSErr savebusybuffers(HVCB *vcbp, saverec_t ***savehandlep) return noErr; } -#if defined(__alpha) -#warning restorebusybuffers uses unsafe savehandle -#endif PRIVATE OSErr restorebusybuffers(saverec_t **savehandle) { INTEGER nentries; @@ -1775,7 +1774,7 @@ PRIVATE OSErr getfreenode(cacheentry **newcachepp, cacheentry *block0cachep) if (!(block0cachep->flags & CACHEBUSY)) warning_unexpected ("not busy"); block0cachep->flags |= CACHEDIRTY; - err = ROMlib_getcache(&newcachep, refnum, newblock, GETCACHESAVE|GETCACHENOREAD); + err = ROMlib_getcache(&newcachep, refnum, newblock, (cacheflagtype)(GETCACHESAVE|GETCACHENOREAD)); if (err == noErr) *newcachepp = newcachep; fs_err_hook (err); @@ -1820,7 +1819,7 @@ PRIVATE OSErr getnewnode(cacheentry **newcachepp, cacheentry *leftp) leftp->flags |= CACHEDIRTY; newbtp->ndBLink = CL(leftnode); if ((flink = CL(newbtp->ndFLink))) { - err = ROMlib_getcache(&linkcachep, refnum, flink, 0); + err = ROMlib_getcache(&linkcachep, refnum, flink, (cacheflagtype)0); if (err != noErr) { fs_err_hook (err); @@ -2130,7 +2129,7 @@ PRIVATE OSErr btcreate(btparam *btpb, void *datap, INTEGER datasize) btpb->trail[0].cachep = block0cachep; if (block0p->numentries == 0) { - err = makefirstentry(btpb, datap, datasize); + err = ::makefirstentry(btpb, (char*)datap, datasize); fs_err_hook (err); return err; } @@ -2149,7 +2148,7 @@ PRIVATE OSErr btcreate(btparam *btpb, void *datap, INTEGER datasize) } tep = btpb->trail + btpb->leafindex; keytoinsertp = &btpb->tofind; - datatoinsertp = datap; + datatoinsertp = (char*)datap; sizetoinsert = datasize; done = FALSE; refnum = CW(block0cachep->refnum); @@ -2233,7 +2232,7 @@ PRIVATE void makethreadrec(threadrec *recp, LONGINT SWparid, StringPtr namep) * NOTE: ROMlib_filecreate IS used to create directories as well (see ROMlib_dircreate below) */ -PUBLIC OSErr ROMlib_filecreate(btparam *btpb, void *data, filekind kind) +PUBLIC OSErr Executor::ROMlib_filecreate(btparam *btpb, void *data, filekind kind) { OSErr err; INTEGER datasize; @@ -2250,7 +2249,7 @@ PUBLIC OSErr ROMlib_filecreate(btparam *btpb, void *data, filekind kind) * ROMlib_dircreate calls ROMlib_filecreate but also creates a thread record */ -PUBLIC OSErr ROMlib_dircreate(btparam *btpb, directoryrec *data) +PUBLIC OSErr Executor::ROMlib_dircreate(btparam *btpb, directoryrec *data) { OSErr err; threadrec rec; @@ -2268,7 +2267,7 @@ PUBLIC OSErr ROMlib_dircreate(btparam *btpb, directoryrec *data) return err; } -PUBLIC xtntkey *ROMlib_newextentrecord(filecontrolblock *fcbp, uint16 newabn) +PUBLIC xtntkey *Executor::ROMlib_newextentrecord(filecontrolblock *fcbp, uint16 newabn) { xtntrec rec; HVCB *vcbp; @@ -2282,7 +2281,7 @@ PUBLIC xtntkey *ROMlib_newextentrecord(filecontrolblock *fcbp, uint16 newabn) ROMlib_makextntparam(&btparamrec, vcbp, forkwanted, CL(fcbp->fcbFlNum), newabn); if ((err = btcreate(&btparamrec, rec, sizeof(rec))) != noErr) { warning_unexpected ("couldn't create new xtntrec"); - return 0; + return 0; } btparamrec.leafindex = -1; err = btlegitimize(&btparamrec); @@ -2293,7 +2292,7 @@ PUBLIC xtntkey *ROMlib_newextentrecord(filecontrolblock *fcbp, uint16 newabn) return (xtntkey *) btparamrec.foundp; } -PUBLIC OSErr ROMlib_btrename(btparam *btpb, StringPtr newnamep) +PUBLIC OSErr Executor::ROMlib_btrename(btparam *btpb, StringPtr newnamep) { btparam newbtparam; OSErr err; @@ -2302,8 +2301,8 @@ PUBLIC OSErr ROMlib_btrename(btparam *btpb, StringPtr newnamep) newbtparam = *btpb; err = ROMlib_makecatkey((catkey *) &newbtparam.tofind, - CL(((catkey *) &btpb->tofind)->ckrParID), newnamep[0], - (Ptr) newnamep+1); + CL(((catkey *) &btpb->tofind)->ckrParID), newnamep[0], + (Ptr) newnamep+1); newbtparam.leafindex = -1; /* I don't think this line does anything */ /* useful, but I noticed it the day that */ /* I was wrapping up Executor/DOS 1.0 and */ @@ -2311,51 +2310,51 @@ PUBLIC OSErr ROMlib_btrename(btparam *btpb, StringPtr newnamep) /* After all, it is harmless. */ btpb->leafindex = -1; if (err == noErr) - err = btlegitimize(btpb); + err = btlegitimize(btpb); if (err != noErr) - { - fs_err_hook (err); - return err; - } + { + fs_err_hook (err); + return err; + } if (!btpb->success) { warning_unexpected ("no success in ROMlib_btrename"); - err = fsDSIntErr; - fs_err_hook (err); - return err; + err = fsDSIntErr; + fs_err_hook (err); + return err; } datap = DATAPFROMKEY(btpb->foundp); switch (((filerec *)datap)->cdrType) { - case FILETYPE: - datasize = sizeof(filerec); - break; - case DIRTYPE: - datasize = sizeof(directoryrec); - break; - default: - warning_unexpected ("unknown cdrType in ROMlib_btrename"); - err = fsDSIntErr; - fs_err_hook (err); - return err; + case FILETYPE: + datasize = sizeof(filerec); + break; + case DIRTYPE: + datasize = sizeof(directoryrec); + break; + default: + warning_unexpected ("unknown cdrType in ROMlib_btrename"); + err = fsDSIntErr; + fs_err_hook (err); + return err; } - datap = alloca(datasize); + datap = (char*)alloca(datasize); memmove(datap, DATAPFROMKEY(btpb->foundp), datasize); err = btcreate(&newbtparam, datap, datasize); if (err != noErr) - { - fs_err_hook (err); -/*-->*/ return err; - } + { + fs_err_hook (err); + /*-->*/ return err; + } btpb->leafindex = -1; err = ROMlib_btdelete(btpb); if (err == noErr && ((filerec *)datap)->cdrType == DIRTYPE) { - err = ROMlib_makecatkey((catkey *) &newbtparam.tofind, - CL(((directoryrec *)datap)->dirDirID), 0, (Ptr) 0); - newbtparam.leafindex = -1; - if (err == noErr) - err = btlegitimize(&newbtparam); - datap = DATAPFROMKEY(newbtparam.foundp); - str255assign(((threadrec *)datap)->thdCName, newnamep); - newbtparam.trail[newbtparam.leafindex].cachep->flags |= CACHEDIRTY; + err = ROMlib_makecatkey((catkey *) &newbtparam.tofind, + CL(((directoryrec *)datap)->dirDirID), 0, (Ptr) 0); + newbtparam.leafindex = -1; + if (err == noErr) + err = btlegitimize(&newbtparam); + datap = DATAPFROMKEY(newbtparam.foundp); + str255assign(((threadrec *)datap)->thdCName, newnamep); + newbtparam.trail[newbtparam.leafindex].cachep->flags |= CACHEDIRTY; } fs_err_hook (err); return err; @@ -2369,7 +2368,7 @@ PUBLIC OSErr ROMlib_btrename(btparam *btpb, StringPtr newnamep) enum { STARTFLAGS = 0 }; -PUBLIC OSErr ROMlib_btcreateemptyfile(btparam *btpb) +PUBLIC OSErr Executor::ROMlib_btcreateemptyfile(btparam *btpb) { OSErr err; filerec rec; @@ -2391,7 +2390,7 @@ PUBLIC OSErr ROMlib_btcreateemptyfile(btparam *btpb) return err; } -PUBLIC OSErr ROMlib_btcreateemptydir(btparam *btpb, LONGINT *newidp) +PUBLIC OSErr Executor::ROMlib_btcreateemptydir(btparam *btpb, LONGINT *newidp) { directoryrec rec; HVCB *vcbp; @@ -2414,7 +2413,7 @@ PUBLIC OSErr ROMlib_btcreateemptydir(btparam *btpb, LONGINT *newidp) * NOTE: ROMlib_getcache clears the ROMlib_index_cached flag */ -PUBLIC OSErr ROMlib_btpbindex (ioParam *pb, LONGINT dirid, HVCB **vcbpp, +PUBLIC OSErr Executor::ROMlib_btpbindex (ioParam *pb, LONGINT dirid, HVCB **vcbpp, filerec **frpp, catkey **catkeypp, BOOLEAN filesonly) { ioParam newpb; diff --git a/src/hfsChanging.c b/src/hfsChanging.cpp similarity index 85% rename from src/hfsChanging.c rename to src/hfsChanging.cpp index ad950b48..c4293599 100644 --- a/src/hfsChanging.c +++ b/src/hfsChanging.cpp @@ -13,15 +13,22 @@ char ROMlib_rcsid_hfsChanging[] = #include "MemoryMgr.h" #include "rsys/hfs.h" -typedef enum { GetOp, SetOp, LockOp, UnlockOp } changeop; +using namespace Executor; + +typedef enum { + GetOp, + SetOp, + LockOp, + UnlockOp +} changeop; PRIVATE OSErr PBFInfoHelper(changeop op, fileParam *pb, LONGINT dirid, BOOLEAN async) { OSErr err, err1; HVCB *vcbp; - filerec *frp; - catkey *catkeyp; + filerec *frp = NULL; + catkey *catkeyp = NULL; btparam btparamrec; filekind kind; @@ -89,48 +96,48 @@ PRIVATE OSErr PBFInfoHelper(changeop op, fileParam *pb, LONGINT dirid, PBRETURN(pb, err); } -PUBLIC OSErr hfsPBGetFInfo(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBGetFInfo(ParmBlkPtr pb, BOOLEAN async) { return PBFInfoHelper(GetOp, (fileParam *) pb, 0L, async); } -PUBLIC OSErr hfsPBHGetFInfo(HParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBHGetFInfo(HParmBlkPtr pb, BOOLEAN async) { return PBFInfoHelper(GetOp, (fileParam *) pb, CL(pb->fileParam.ioDirID), async); } -PUBLIC OSErr hfsPBSetFInfo(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBSetFInfo(ParmBlkPtr pb, BOOLEAN async) { return PBFInfoHelper(SetOp, (fileParam *) pb, 0L, async); } -PUBLIC OSErr hfsPBHSetFInfo(HParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBHSetFInfo(HParmBlkPtr pb, BOOLEAN async) { return PBFInfoHelper(SetOp, (fileParam *) pb, CL(pb->fileParam.ioDirID), async); } -PUBLIC OSErr hfsPBSetFLock(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBSetFLock(ParmBlkPtr pb, BOOLEAN async) { return PBFInfoHelper(LockOp, (fileParam *) pb, 0L, async); } -PUBLIC OSErr hfsPBHSetFLock(HParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBHSetFLock(HParmBlkPtr pb, BOOLEAN async) { return PBFInfoHelper(LockOp, (fileParam *) pb, CL(pb->fileParam.ioDirID), async); } -PUBLIC OSErr hfsPBRstFLock(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBRstFLock(ParmBlkPtr pb, BOOLEAN async) { return PBFInfoHelper(UnlockOp, (fileParam *) pb, 0L, async); } -PUBLIC OSErr hfsPBHRstFLock(HParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBHRstFLock(HParmBlkPtr pb, BOOLEAN async) { return PBFInfoHelper(UnlockOp, (fileParam *) pb, CL (pb->fileParam.ioDirID), async); } -PUBLIC OSErr hfsPBSetFVers(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBSetFVers(ParmBlkPtr pb, BOOLEAN async) { PBRETURN((ioParam *)pb, wrgVolTypErr); } @@ -218,13 +225,13 @@ renamehelper(ioParam *pb, BOOLEAN async, LONGINT dirid, filekind kind) PBRETURN(pb, err); } -PUBLIC OSErr hfsPBRename(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBRename(ParmBlkPtr pb, BOOLEAN async) { return renamehelper((ioParam *) pb, async, 0L, regular); } -PUBLIC OSErr hfsPBHRename(HParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBHRename(HParmBlkPtr pb, BOOLEAN async) { return renamehelper((ioParam *) pb, async, CL(pb->fileParam.ioDirID), - regular|directory); + (filekind)(regular|directory)); } diff --git a/src/hfsCreate.c b/src/hfsCreate.cpp similarity index 82% rename from src/hfsCreate.c rename to src/hfsCreate.cpp index ff184a5f..e5303f75 100644 --- a/src/hfsCreate.c +++ b/src/hfsCreate.cpp @@ -12,7 +12,9 @@ char ROMlib_rcsid_hfsCreate[] = #include "FileMgr.h" #include "rsys/hfs.h" -typedef enum { create, delete } createop; +using namespace Executor; + +typedef enum { create, delete1 } createop; PRIVATE OSErr freeallblocks(HVCB *vcbp, filerec *frp) { @@ -55,7 +57,7 @@ PRIVATE OSErr createhelper(ioParam *pb, BOOLEAN async, createop op, filerec *frp; HVCB *vcbp; - curkind = regular | directory; + curkind = (filekind)(regular | directory); err = ROMlib_findvcbandfile(pb, dirid, &btparamrec, &curkind, FALSE); vcbp = btparamrec.vcbp; switch (err) { @@ -95,7 +97,7 @@ PRIVATE OSErr createhelper(ioParam *pb, BOOLEAN async, createop op, } break; case fnfErr: - if (op == delete) + if (op == delete1) err = fnfErr; else { err = ROMlib_writevcbp(vcbp); @@ -120,31 +122,31 @@ PRIVATE OSErr createhelper(ioParam *pb, BOOLEAN async, createop op, PBRETURN(pb, err); } -PUBLIC OSErr hfsPBCreate(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBCreate(ParmBlkPtr pb, BOOLEAN async) { return createhelper((ioParam *) pb, async, create, (LONGINT) 0, regular); } -PUBLIC OSErr hfsPBHCreate(HParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBHCreate(HParmBlkPtr pb, BOOLEAN async) { return createhelper((ioParam *)pb, async, create, CL(pb->fileParam.ioDirID), regular); } -PUBLIC OSErr hfsPBDirCreate(HParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBDirCreate(HParmBlkPtr pb, BOOLEAN async) { return createhelper((ioParam *)pb, async, create, CL(pb->fileParam.ioDirID), directory); } -PUBLIC OSErr hfsPBDelete(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBDelete(ParmBlkPtr pb, BOOLEAN async) { - return createhelper((ioParam *) pb, async, delete, (LONGINT) 0, - regular|directory); + return createhelper((ioParam *) pb, async, delete1, (LONGINT) 0, + (filekind)(regular | directory)); } -PUBLIC OSErr hfsPBHDelete(HParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBHDelete(HParmBlkPtr pb, BOOLEAN async) { - return createhelper((ioParam *)pb, async, delete, CL(pb->fileParam.ioDirID), - regular|directory); + return createhelper((ioParam *)pb, async, delete1, CL(pb->fileParam.ioDirID), + (filekind)(regular | directory)); } diff --git a/src/hfsFile.c b/src/hfsFile.cpp similarity index 94% rename from src/hfsFile.c rename to src/hfsFile.cpp index 4828e808..1c378dc6 100644 --- a/src/hfsFile.c +++ b/src/hfsFile.cpp @@ -14,7 +14,9 @@ char ROMlib_rcsid_hfsFile[] = #include "rsys/file.h" #include "rsys/hfs.h" -PUBLIC filecontrolblock *ROMlib_getfreefcbp( void ) +using namespace Executor; + +PUBLIC filecontrolblock *Executor::ROMlib_getfreefcbp( void ) { short length; filecontrolblock *fcbp, *efcbp; @@ -28,7 +30,7 @@ PUBLIC filecontrolblock *ROMlib_getfreefcbp( void ) return fcbp < efcbp ? fcbp : 0; } -PUBLIC filecontrolblock *ROMlib_refnumtofcbp(uint16 refnum) +PUBLIC filecontrolblock *Executor::ROMlib_refnumtofcbp(uint16 refnum) { uint16 len; filecontrolblock *retval; @@ -89,12 +91,11 @@ PRIVATE LONGINT xtntbnotophys(xtntrec xtr, unsigned short bno, return retblock; } -PUBLIC compretval ROMlib_xtntcompare(void *firstp, void *secondp) +PUBLIC compretval Executor::ROMlib_xtntcompare(void *firstp, void *secondp) { - xtntkey *xp1, *xp2; + xtntkey *xp1 = (xtntkey *)firstp; + xtntkey *xp2 = (xtntkey *)secondp; - xp1 = firstp; - xp2 = secondp; if (Cx(xp1->xkrFNum) < Cx(xp2->xkrFNum)) return firstisless; else if (Cx(xp1->xkrFNum) > Cx(xp2->xkrFNum)) @@ -115,22 +116,21 @@ PUBLIC compretval ROMlib_xtntcompare(void *firstp, void *secondp) } } -PUBLIC compretval ROMlib_catcompare(void *firstp, void *secondp) +PUBLIC compretval Executor::ROMlib_catcompare(void *firstp, void *secondp) { - catkey *ckp1, *ckp2; - - ckp1 = firstp; - ckp2 = secondp; + catkey *ckp1 = (catkey *)firstp; + catkey *ckp2 = (catkey *)secondp; + if (Cx(ckp1->ckrParID) < Cx(ckp2->ckrParID)) return firstisless; if (Cx(ckp1->ckrParID) > Cx(ckp2->ckrParID)) return firstisgreater; else - return RelString((StringPtr) ckp1->ckrCName, (StringPtr) ckp2->ckrCName, + return (compretval)Executor::RelString((StringPtr) ckp1->ckrCName, (StringPtr) ckp2->ckrCName, FALSE, TRUE); } -PUBLIC void ROMlib_makextntkey(xtntkey *keyp, forktype forkwanted, LONGINT flnum, +PUBLIC void Executor::ROMlib_makextntkey(xtntkey *keyp, forktype forkwanted, LONGINT flnum, uint16 bno) { keyp->xkrKeyLen = 7; @@ -139,7 +139,7 @@ PUBLIC void ROMlib_makextntkey(xtntkey *keyp, forktype forkwanted, LONGINT flnum keyp->xkrFABN = CW(bno); } -PUBLIC void ROMlib_makextntparam(btparam *btpb, HVCB *vcbp, forktype forkwanted, +PUBLIC void Executor::ROMlib_makextntparam(btparam *btpb, HVCB *vcbp, forktype forkwanted, LONGINT flnum, uint16 bno) { btpb->vcbp = vcbp; @@ -170,7 +170,7 @@ PRIVATE xtntkey *fcbpbnotoxkeyp(filecontrolblock *fcbp, uint16 bno) return xkeyp; } -PUBLIC LONGINT ROMlib_logtophys(filecontrolblock *fcbp, LONGINT absoffset, +PUBLIC LONGINT Executor::ROMlib_logtophys(filecontrolblock *fcbp, LONGINT absoffset, LONGINT *nphyscontigp) { uint16 bno; @@ -437,7 +437,7 @@ PRIVATE void smokexpvcbp(ULONGINT tosmoke, xtntdesc *xp, HVCB *vcbp) } } -PUBLIC OSErr ROMlib_allochelper(ioParam *pb, BOOLEAN async, alloctype alloc, +PUBLIC OSErr Executor::ROMlib_allochelper(ioParam *pb, BOOLEAN async, alloctype alloc, BOOLEAN writefcbp) { filecontrolblock *fcbp; @@ -655,7 +655,7 @@ PUBLIC OSErr ROMlib_allochelper(ioParam *pb, BOOLEAN async, alloctype alloc, PBRETURN(pb, err); } -PUBLIC OSErr hfsPBSetEOF(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBSetEOF(ParmBlkPtr pb, BOOLEAN async) { OSErr err; err = ROMlib_allochelper((ioParam *) pb, async, seteof, TRUE); @@ -663,7 +663,7 @@ PUBLIC OSErr hfsPBSetEOF(ParmBlkPtr pb, BOOLEAN async) return err; } -PUBLIC OSErr hfsPBAllocate(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBAllocate(ParmBlkPtr pb, BOOLEAN async) { OSErr err; err = ROMlib_allochelper((ioParam *) pb, async, allocany, TRUE); @@ -671,7 +671,7 @@ PUBLIC OSErr hfsPBAllocate(ParmBlkPtr pb, BOOLEAN async) return err; } -PUBLIC OSErr hfsPBAllocContig(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBAllocContig(ParmBlkPtr pb, BOOLEAN async) { OSErr err; @@ -927,7 +927,7 @@ PRIVATE OSErr PBReadWrite(ioParam *pb, BOOLEAN async, accesstype rw) #undef RETURN -PUBLIC OSErr hfsPBRead(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBRead(ParmBlkPtr pb, BOOLEAN async) { OSErr err; err = PBReadWrite((ioParam *) pb, async, reading); @@ -935,7 +935,7 @@ PUBLIC OSErr hfsPBRead(ParmBlkPtr pb, BOOLEAN async) return err; } -PUBLIC OSErr hfsPBWrite(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBWrite(ParmBlkPtr pb, BOOLEAN async) { OSErr err; @@ -961,8 +961,8 @@ PRIVATE OSErr dirtyfcbp(filecontrolblock *fcbp) refnum = (char *) fcbp - (char *) MR(FCBSPtr); vcbp = MR(fcbp->fcbVPtr); if ((catpos = Cx(fcbp->fcbCatPos))) { - err = ROMlib_getcache(&cachep, CW(MR(fcbp->fcbVPtr)->vcbCTRef), - catpos, 0); + err = Executor::ROMlib_getcache(&cachep, CW(MR(fcbp->fcbVPtr)->vcbCTRef), + catpos, (cacheflagtype)0); if (err != noErr) { fs_err_hook (err); @@ -970,13 +970,13 @@ PRIVATE OSErr dirtyfcbp(filecontrolblock *fcbp) } namep = fcbp->fcbCName; ROMlib_makecatkey(&key, Cx(fcbp->fcbDirID), namep[0], (Ptr) namep+1); - if (!ROMlib_searchnode((btnode *)cachep->buf, (void *)&key, ROMlib_catcompare, + if (!Executor::ROMlib_searchnode((btnode *)cachep->buf, (void *)&key, ROMlib_catcompare, &retkeyp, &dumint)) { btparam btparamrec; btparamrec.vcbp = MR (fcbp->fcbVPtr); btparamrec.tofind.catk = key; - btparamrec.fp = ROMlib_catcompare; + btparamrec.fp = Executor::ROMlib_catcompare; btparamrec.refnum = CW (MR (fcbp->fcbVPtr)->vcbCTRef); err = ROMlib_keyfind (&btparamrec); if (err == noErr) @@ -1037,7 +1037,7 @@ PRIVATE OSErr dirtyfcbp(filecontrolblock *fcbp) return noErr; } -PUBLIC OSErr hfsPBFlushFile(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBFlushFile(ParmBlkPtr pb, BOOLEAN async) { filecontrolblock *fcbp; OSErr err; @@ -1054,7 +1054,7 @@ PUBLIC OSErr hfsPBFlushFile(ParmBlkPtr pb, BOOLEAN async) PBRETURN((ioParam *) pb, err); } -PUBLIC OSErr hfsPBClose(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBClose(ParmBlkPtr pb, BOOLEAN async) { filecontrolblock *fcbp; OSErr err; @@ -1071,7 +1071,7 @@ PUBLIC OSErr hfsPBClose(ParmBlkPtr pb, BOOLEAN async) PBRETURN((ioParam *) pb, err); } -PUBLIC OSErr ROMlib_makecatkey(catkey *keyp, LONGINT dirid, INTEGER namelen, +PUBLIC OSErr Executor::ROMlib_makecatkey(catkey *keyp, LONGINT dirid, INTEGER namelen, Ptr namep) { OSErr retval; @@ -1129,7 +1129,7 @@ PRIVATE OSErr findentry(LONGINT dirid, StringPtr name, btparam *btpb, } if (namep[namelen-1] == ':') { /* trailing colon means we want */ --namelen; /* only a directory */ - *kindp &= directory; + *kindp = (filekind)(*kindp & directory); } if (namelen <= 0 && !ignorename && (*kindp & (directory|thread) ) == 0) @@ -1271,7 +1271,7 @@ PRIVATE BOOLEAN dir_prefixes_volume(StringPtr dirnamep, StringPtr volnamep) return dirnamep[volnamep[0]+1] == ':'; } -PUBLIC OSErr ROMlib_findvcbandfile(ioParam *pb, LONGINT dirid, btparam *btpb, +PUBLIC OSErr Executor::ROMlib_findvcbandfile(ioParam *pb, LONGINT dirid, btparam *btpb, filekind *kindp, BOOLEAN ignorename) { OSErr err; @@ -1351,7 +1351,7 @@ PUBLIC OSErr ROMlib_findvcbandfile(ioParam *pb, LONGINT dirid, btparam *btpb, * so whether that causes a conflict (the conflicting refnum is filled in). */ -PUBLIC OSErr ROMlib_alreadyopen(HVCB *vcbp, LONGINT flnum, SignedByte *permp, +PUBLIC OSErr Executor::ROMlib_alreadyopen(HVCB *vcbp, LONGINT flnum, SignedByte *permp, INTEGER *refnump, busyconcern_t busy) { short length; @@ -1532,7 +1532,7 @@ PRIVATE OSErr PBOpenHelper(ioParam *pb, forktype ft, LONGINT dirid, BOOLEAN asyn #undef RETURN -PUBLIC OSErr hfsPBOpen(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBOpen(ParmBlkPtr pb, BOOLEAN async) { OSErr err; err = PBOpenHelper((ioParam *) pb, datafork, 0L, async); @@ -1540,7 +1540,7 @@ PUBLIC OSErr hfsPBOpen(ParmBlkPtr pb, BOOLEAN async) return err; } -PUBLIC OSErr hfsPBOpenRF(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBOpenRF(ParmBlkPtr pb, BOOLEAN async) { OSErr err; err = PBOpenHelper((ioParam *) pb, resourcefork, 0L, async); @@ -1548,7 +1548,7 @@ PUBLIC OSErr hfsPBOpenRF(ParmBlkPtr pb, BOOLEAN async) return err; } -PUBLIC OSErr hfsPBHOpen(HParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBHOpen(HParmBlkPtr pb, BOOLEAN async) { OSErr err; @@ -1558,7 +1558,7 @@ PUBLIC OSErr hfsPBHOpen(HParmBlkPtr pb, BOOLEAN async) return err; } -PUBLIC OSErr hfsPBHOpenRF(HParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBHOpenRF(HParmBlkPtr pb, BOOLEAN async) { OSErr err; @@ -1576,17 +1576,17 @@ PUBLIC OSErr hfsPBHOpenRF(HParmBlkPtr pb, BOOLEAN async) * on a network. */ -PUBLIC OSErr hfsPBLockRange(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBLockRange(ParmBlkPtr pb, BOOLEAN async) { PBRETURN((ioParam *) pb, noErr); } -PUBLIC OSErr hfsPBUnlockRange(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBUnlockRange(ParmBlkPtr pb, BOOLEAN async) { PBRETURN((ioParam *) pb, noErr); } -PUBLIC OSErr hfsPBGetFPos(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBGetFPos(ParmBlkPtr pb, BOOLEAN async) { filecontrolblock *fcbp; OSErr err; @@ -1606,7 +1606,7 @@ PUBLIC OSErr hfsPBGetFPos(ParmBlkPtr pb, BOOLEAN async) PBRETURN((ioParam *) pb, noErr); } -PUBLIC OSErr hfsPBSetFPos(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBSetFPos(ParmBlkPtr pb, BOOLEAN async) { filecontrolblock *fcbp; LONGINT newpos; @@ -1633,7 +1633,7 @@ PUBLIC OSErr hfsPBSetFPos(ParmBlkPtr pb, BOOLEAN async) PBRETURN((ioParam *) pb, retval); } -PUBLIC OSErr hfsPBGetEOF(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBGetEOF(ParmBlkPtr pb, BOOLEAN async) { filecontrolblock *fcbp; OSErr err; diff --git a/src/hfsHelper.c b/src/hfsHelper.cpp similarity index 77% rename from src/hfsHelper.c rename to src/hfsHelper.cpp index 19977bfe..98eec640 100644 --- a/src/hfsHelper.c +++ b/src/hfsHelper.cpp @@ -26,8 +26,16 @@ char ROMlib_rcsid_hfsHelper[] = #if defined (MSDOS) || defined (CYGWIN32) #include "dosdisk.h" #include "aspi.h" +#else +#include +#include +#include +#include +#include #endif +using namespace Executor; + #if !defined(MAC) #define FLOPPYWORKSFS "/usr/filesystems/macintosh.fs" @@ -41,84 +49,19 @@ char ROMlib_rcsid_hfsHelper[] = #define HFSXFERDOTFS "/usr/filesystems/HFS_XFer.fs" #define HFSXFERUTIL HFSXFERDOTFS "/HFS_XFer.util" -#if defined (NEXT) PRIVATE LONGINT pipefd[2]; -#endif /* NEXT */ -PUBLIC LONGINT ROMlib_sock; +PUBLIC LONGINT Executor::ROMlib_sock; + +extern void mustbesetuid( void ); +extern ULONGINT ROMlib_ourmtime; +extern LONGINT ROMlib_xfervmsize; +extern char *ROMlib_xfervmaddr; -PUBLIC void ROMlib_hfsinit( void ) + +PUBLIC void Executor::ROMlib_hfsinit( void ) { -#if defined (NEXT) - struct stat sbuf; - struct sockaddr sockname; - LONGINT i; - char device[DEVNAMELEN]; - LONGINT nread, nwritten; - LONGINT err; - LONGINT savemask; - LONGINT myfd; - LONGINT mode; - - if (geteuid()) - mustbesetuid(); - if (Ustat(HFSXFERDOTFS, &sbuf) < 0) { - savemask = umask(0); - Umkdir(HFSXFERDOTFS, 0755); - umask(savemask); - } - if (((Ustat(HFSXFERUTIL, &sbuf) < 0) || (sbuf.st_mtime < ROMlib_ourmtime)) - && ROMlib_xfervmsize) { - myfd = Uopen(HFSXFERUTIL, O_BINARY|O_CREAT|O_WRONLY, 000); - if (myfd >= 0) { - nwritten = write(myfd, ROMlib_xfervmaddr, ROMlib_xfervmsize); - err = close(myfd); - if (nwritten == ROMlib_xfervmsize && err == 0) - Uchmod(HFSXFERUTIL, 04711); - else - Uunlink(HFSXFERUTIL); - } - } - if (Ustat(FLOPPYWORKSFS, &sbuf) >= 0) - Urename(FLOPPYWORKSFS, NEWFLOPPYWORKSFS); - if (Ustat(MAC30FS, &sbuf) >= 0) - Urename(MAC30FS, NEWMAC30FS); - pipefd[1] = -1; - pipe((void *) pipefd); - if (fork() == 0) { - setpgrp(0, 0); - for (i = 1; i < NSIG; ++i) - signal(i, SIG_IGN); - close(pipefd[1]); - do { - nread = read(pipefd[0], device, sizeof(device)); - if (nread > 1) { - sscanf(device+strlen(device)+1, "%o", &mode); - Uchmod(device, mode); - } - } while (nread > 0); - Urename(NEWFLOPPYWORKSFS, FLOPPYWORKSFS); - Urename(NEWMAC30FS, MAC30FS); - Uunlink(OURSOCK); - exit(0); - } else - close(pipefd[0]); - - ROMlib_sock = socket(AF_UNIX, SOCK_STREAM, 0); - gui_assert(ROMlib_sock >= 0); - sockname.sa_family = AF_UNIX; - memmove(sockname.sa_data, OURSOCK, sizeof(OURSOCK)); - Uunlink(OURSOCK); - err = bind(ROMlib_sock, &sockname, sizeof(sockname)); - if (err < 0) - someoneelseonfloppy(); -/* gui_assert(err >= 0); */ - ROMlib_setuid(getuid()); - err = fcntl(ROMlib_sock, F_SETFL, FNDELAY); -/* gui_assert(err >= 0); */ - err = listen(ROMlib_sock, 1); -/* gui_assert(err >= 0); */ -#endif /* NEXT */ + } /* @@ -139,57 +82,24 @@ do { \ \ ejectable = EJECTABLE(filename); \ *(lenp) = strlen((filename)) + 1 + 6 + 1 + 1 + 1; \ - (buf) = alloca(*(lenp)); \ + (buf) = (char*)alloca(*(lenp)); \ sprintf((buf), "%s%c%06o%c%c", (filename), 0, (sbuf).st_mode & 07777, 0, \ ejectable);\ } while (0) #define NRETRIES 5 -#if defined (NEXT) -PUBLIC long ROMlib_priv_open(const char *filename, long mode) -{ - long retval; - struct stat sbuf; - long savemode; - char *dname; - long len; - int count; - - if (Ustat(filename, &sbuf) < 0) - retval = ROMlib_maperrno(); - else { - savemode = sbuf.st_mode; - sbuf.st_mode = 0666; - ASSIGN_NAME_MODE_STRING(dname, &len, filename, sbuf); - write(pipefd[1], dname, len); - count = NRETRIES; - do { - if (count != NRETRIES) - Delay(60, (LONGINT *) 0); - retval = Uopen(filename, mode); - } while ((retval < 0) && (errno == EACCES) && --count); - if (retval < 0) - retval = ROMlib_maperrno(); - sbuf.st_mode = savemode; - ASSIGN_NAME_MODE_STRING(dname, &len, filename, sbuf); - write(pipefd[1], dname, len); - } - return retval; -} -#else PUBLIC long -ROMlib_priv_open (const char *filename, long mode) +Executor::ROMlib_priv_open (const char *filename, long mode) { - long retval; + long retval; - retval = Uopen(filename, mode, 0); - if (retval < 0) - retval = ROMlib_maperrno(); - - return retval; + retval = Uopen(filename, mode, 0); + if (retval < 0) + retval = ROMlib_maperrno(); + + return retval; } -#endif PRIVATE void eject_floppy_notify( void ) { @@ -206,7 +116,7 @@ PRIVATE void eject_floppy_notify( void ) Alert(EJECTALERTID, (ProcPtr) 0); } -PUBLIC OSErr ROMlib_ejectfloppy( LONGINT floppyfd ) +PUBLIC OSErr Executor::ROMlib_ejectfloppy( LONGINT floppyfd ) { OSErr err; @@ -231,7 +141,7 @@ PUBLIC OSErr ROMlib_ejectfloppy( LONGINT floppyfd ) eject_floppy_notify(); } else { #endif -#if defined(NEXTSTEP) || defined (MACOSX) +#if defined (MACOSX_) if (floppyfd != -1 && ioctl(floppyfd, DKIOCEJECT, (char *) 0) < 0) { fprintf(stderr, "couldn't eject disk\n"); err = ioErr; @@ -239,7 +149,7 @@ PUBLIC OSErr ROMlib_ejectfloppy( LONGINT floppyfd ) #endif if (floppyfd != -1) close(floppyfd); -#if defined(LINUX) || defined (MACOSX) +#if defined(LINUX) || defined (MACOSX_) eject_floppy_notify(); #endif #if defined(MSDOS) || defined (CYGWIN32) @@ -248,7 +158,7 @@ PUBLIC OSErr ROMlib_ejectfloppy( LONGINT floppyfd ) return err; } -PUBLIC void ROMlib_OurClose( void ) +PUBLIC void Executor::ROMlib_OurClose( void ) { HVCB *vcbp, *next; ParamBlockRec pbr; @@ -259,7 +169,7 @@ PUBLIC void ROMlib_OurClose( void ) if (Cx(vcbp->vcbCTRef)) { pbr.ioParam.ioVRefNum = vcbp->vcbVRefNum; PBUnmountVol(&pbr); -#if defined (NEXTSTEP) || defined (MACOSX) +#if defined (MACOSX_) || defined (MACOSX_) if (!(Cx(vcbp->vcbAtrb) & VNONEJECTABLEBIT) && Cx(vcbp->vcbDrvNum)) ROMlib_ejectfloppy(((VCBExtra *) vcbp)->u.hfs.fd); #endif @@ -272,7 +182,7 @@ PUBLIC void ROMlib_OurClose( void ) PRIVATE BOOLEAN isejectable( const charCx( *dname), LONGINT fd ) { BOOLEAN retval; -#if defined(NEXTSTEP) || defined (MACOSX) +#if defined(MACOSX_) || defined (MACOSX_) struct scsi_req sr; char inqbuf[sizeof(struct inquiry_reply) + 3]; struct inquiry_replyCx( *inqp); @@ -281,7 +191,7 @@ PRIVATE BOOLEAN isejectable( const charCx( *dname), LONGINT fd ) /* look for rfd[0-9] */ retval = FALSE; -#if defined(NEXTSTEP) || defined (MACOSX) +#if defined(MACOSX_) || defined (MACOSX) for (p = dname; p = index(p, 'r'); ++p) { if (p[1] == 'f' && p[2] == 'd' && isdigit(p[3])) { retval = TRUE; @@ -323,16 +233,13 @@ PRIVATE LONGINT try_to_open_disk( const char *dname, { LONGINT floppyfd; int len; -#if defined(NEXTSTEP) - struct drive_info drvinfo; -#endif *flagsp = 0; len = strlen(dname)+1; /* first component: name */ len += strlen(dname+len)+1; /* second component: permission */ if (!dname[len]) *flagsp |= DRIVE_FLAGS_FIXED; /* third component: ejectable */ -#if defined (NEXT) +#if defined (MACOSX_) if (pipefd[1] != -1) write(pipefd[1], dname, len); #endif /* NEXT */ @@ -349,18 +256,8 @@ PRIVATE LONGINT try_to_open_disk( const char *dname, 0000)) < 0)) /* fprintf(stderr, "can't open %s\n", dname) */; else { -#if defined(NEXTSTEP) - if (ioctl(floppyfd, DKIOCINFO, &drvinfo) == 0) { - *bsizep = drvinfo.di_devblklen; - *maxbytesp = drvinfo.di_maxbcount / *bsizep * *bsizep; - } else { - *bsizep = PHYSBSIZE; - *maxbytesp = 1024L * 1024; - } -#else *bsizep = PHYSBSIZE; *maxbytesp = 1024L * 1024; -#endif } if (floppyfd >= 0) @@ -396,7 +293,7 @@ read_driver_block_size (LONGINT fd, LONGINT bsize, LONGINT maxbytes, } PUBLIC void -try_to_mount_disk (const char *dname, LONGINT floppyfd, LONGINT *messp, +Executor::try_to_mount_disk (const char *dname, LONGINT floppyfd, LONGINT *messp, LONGINT bsize, LONGINT maxbytes, drive_flags_t flags, uint32 offset_in) { @@ -416,7 +313,7 @@ try_to_mount_disk (const char *dname, LONGINT floppyfd, LONGINT *messp, LONGINT driver_block_size; *messp = 0; - tbuf = alloca (bsize + 3); + tbuf = (char*)alloca (bsize + 3); buf = (char *) (((long)tbuf +3)&~3); partition = 0; @@ -553,7 +450,7 @@ try_to_mount_disk (const char *dname, LONGINT floppyfd, LONGINT *messp, } } -PUBLIC void ROMlib_openfloppy( const char *dname, LONGINT *messp) +PUBLIC void Executor::ROMlib_openfloppy( const char *dname, LONGINT *messp) { LONGINT floppyfd; LONGINT bsize, maxbytes; @@ -567,7 +464,7 @@ PUBLIC void ROMlib_openfloppy( const char *dname, LONGINT *messp) offset); } -PUBLIC void ROMlib_openharddisk( const char *dname, LONGINT *messp ) +PUBLIC void Executor::ROMlib_openharddisk( const char *dname, LONGINT *messp ) { char *newbuf; long len; @@ -584,7 +481,7 @@ PUBLIC void ROMlib_openharddisk( const char *dname, LONGINT *messp ) #define JUMPTODONEIF(x) if ((x)) { err = ioErr; goto DONE; } -PUBLIC OSErr ROMlib_readwrite(LONGINT fd, char *buffer, LONGINT count, LONGINT offset, +PUBLIC OSErr Executor::ROMlib_readwrite(LONGINT fd, char *buffer, LONGINT count, LONGINT offset, accesstype rw, LONGINT blocksize, LONGINT maxtransfer) { char *newbuffer; @@ -693,7 +590,7 @@ PUBLIC OSErr ROMlib_readwrite(LONGINT fd, char *buffer, LONGINT count, LONGINT o } PUBLIC OSErr -ROMlib_transphysblk (hfs_access_t *hfsp, LONGINT physblock, short nphysblocks, +Executor::ROMlib_transphysblk (hfs_access_t *hfsp, LONGINT physblock, short nphysblocks, Ptr bufp, accesstype rw, LONGINT *actp) { LONGINT fd; @@ -702,7 +599,7 @@ ROMlib_transphysblk (hfs_access_t *hfsp, LONGINT physblock, short nphysblocks, #if defined(MAC) ioParam pb; - + pb.ioVRefNum = vcbp->vcbDrvNum; pb.ioRefNum = vcbp->vcbDRefNum; pb.ioBuffer = CL(bufp); @@ -710,41 +607,42 @@ ROMlib_transphysblk (hfs_access_t *hfsp, LONGINT physblock, short nphysblocks, pb.ioPosMode = CW(fsFromStart); pb.ioPosOffset = CL(physblock); err = rw == reading ? PBRead ((ParmBlkPtr) &pb, FALSE) : - PBWrite((ParmBlkPtr) &pb, FALSE); + PBWrite((ParmBlkPtr) &pb, FALSE); if (actp) - *actp = pb.ioActCount; + *actp = pb.ioActCount; #else #if defined(NEXTSTEP) || defined (MACOSX) if ((LONGINT) bufp & 3) { - newbufp = alloca( (LONGINT) nphysblocks * PHYSBSIZE + 4); - newbufp = (Ptr) (((LONGINT) newbufp + 3) & ~3); - if (rw == writing) - memmove(newbufp, bufp, (LONGINT) nphysblocks * PHYSBSIZE); + newbufp = alloca( (LONGINT) nphysblocks * PHYSBSIZE + 4); + newbufp = (Ptr) (((LONGINT) newbufp + 3) & ~3); + if (rw == writing) + memmove(newbufp, bufp, (LONGINT) nphysblocks * PHYSBSIZE); } else -#endif - newbufp = bufp; +#endif + newbufp = bufp; fd = hfsp->fd; - + err = ROMlib_readwrite(fd, (char *) newbufp, - (LONGINT) nphysblocks * PHYSBSIZE, - physblock + hfsp->offset, rw, hfsp->bsize, - hfsp->maxbytes); + (LONGINT) nphysblocks * PHYSBSIZE, + physblock + hfsp->offset, rw, hfsp->bsize, + hfsp->maxbytes); #if defined(NEXTSTEP) || defined (MACOSX) - if (rw == reading && bufp != newbufp && err == noErr) - memmove(bufp, newbufp, (LONGINT) nphysblocks * PHYSBSIZE); + if (rw == reading && bufp != newbufp && err == noErr) + memmove(bufp, newbufp, (LONGINT) nphysblocks * PHYSBSIZE); #endif if (actp) - *actp = err != noErr ? 0 : CL((LONGINT) nphysblocks * PHYSBSIZE); - - + *actp = err != noErr ? 0 : CL((LONGINT) nphysblocks * PHYSBSIZE); + + #endif if (err != noErr) warning_unexpected ("fd = 0x%x, err in transphysblock (err = %d)", - fd, err); + fd, err); return err; } -PUBLIC char *ROMlib_indexn(char *str, char tofind, INTEGER length) + +PUBLIC char *Executor::ROMlib_indexn(char *str, char tofind, INTEGER length) { while (--length >= 0) if (*str++ == tofind) @@ -753,7 +651,7 @@ PUBLIC char *ROMlib_indexn(char *str, char tofind, INTEGER length) } #if !defined(str255assign) -PUBLIC void str255assign(StringPtr dstp, StringPtr srcp) +PUBLIC void Executor::str255assign(StringPtr dstp, StringPtr srcp) { memmove(dstp, srcp, (size_t) srcp[0]+1); } @@ -764,11 +662,11 @@ PUBLIC void str255assign(StringPtr dstp, StringPtr srcp) * ROMlib_indexqueue is one based; not zero based. */ -PUBLIC void *ROMlib_indexqueue(QHdr *qp, short index) +PUBLIC void *Executor::ROMlib_indexqueue(QHdr *qp, short index) { QElemPtr p; -#if defined(MAC) +#if 0 for (p = CL(qp->qHead); (--index > 0) && p; p = CL(p->qLink)) ; #else @@ -778,7 +676,7 @@ PUBLIC void *ROMlib_indexqueue(QHdr *qp, short index) return p; } -PUBLIC OSErr ROMlib_writefcbp(filecontrolblock *fcbp) +PUBLIC OSErr Executor::ROMlib_writefcbp(filecontrolblock *fcbp) { Byte flags; OSErr retval; @@ -793,7 +691,7 @@ PUBLIC OSErr ROMlib_writefcbp(filecontrolblock *fcbp) return retval; } -PUBLIC OSErr ROMlib_writevcbp(HVCB *vcbp) +PUBLIC OSErr Executor::ROMlib_writevcbp(HVCB *vcbp) { INTEGER vflags; OSErr retval; diff --git a/src/hfsHier.c b/src/hfsHier.cpp similarity index 95% rename from src/hfsHier.c rename to src/hfsHier.cpp index b3617906..4229c3d6 100644 --- a/src/hfsHier.c +++ b/src/hfsHier.cpp @@ -14,6 +14,8 @@ char ROMlib_rcsid_hfsHier[] = #include "rsys/hfs.h" #include "rsys/file.h" +using namespace Executor; + typedef enum { catGet, catSet } catop; PRIVATE OSErr cathelper(CInfoPBPtr pb, BOOLEAN async, catop op) @@ -55,7 +57,7 @@ PRIVATE OSErr cathelper(CInfoPBPtr pb, BOOLEAN async, catop op) kind = directory; ignorename = TRUE; } else { - kind = regular | directory; + kind = filekind(regular | directory); ignorename = FALSE; } err = ROMlib_findvcbandfile((ioParam *) pb, CL(pb->hFileInfo.ioDirID), @@ -75,7 +77,7 @@ PRIVATE OSErr cathelper(CInfoPBPtr pb, BOOLEAN async, catop op) switch (kind) { case regular: - frp = voidp; + frp = (filerec*)voidp; pbf = (HFileInfo *) pb; if (op == catGet) { if (UPDATE_IONAMEPTR_P(*pbf)) @@ -116,7 +118,7 @@ PRIVATE OSErr cathelper(CInfoPBPtr pb, BOOLEAN async, catop op) } break; case directory: - drp = voidp; + drp = (directoryrec*)voidp; pbd = (DirInfo *) pb; if (op == catGet) { if (UPDATE_IONAMEPTR_P(*pbd)) @@ -170,7 +172,7 @@ PRIVATE OSErr cathelper(CInfoPBPtr pb, BOOLEAN async, catop op) } -PUBLIC OSErr hfsPBGetCatInfo(CInfoPBPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBGetCatInfo(CInfoPBPtr pb, BOOLEAN async) { OSErr err; err = cathelper(pb, async, catGet); @@ -178,7 +180,7 @@ PUBLIC OSErr hfsPBGetCatInfo(CInfoPBPtr pb, BOOLEAN async) return err; } -PUBLIC OSErr hfsPBSetCatInfo(CInfoPBPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBSetCatInfo(CInfoPBPtr pb, BOOLEAN async) { OSErr err; err = cathelper(pb, async, catSet); @@ -223,7 +225,7 @@ PRIVATE OSErr parentchild(HVCB *vcbp, catkey *parentcatp, return err; } -PUBLIC OSErr hfsPBCatMove(CMovePBPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBCatMove(CMovePBPtr pb, BOOLEAN async) { OSErr err, err1; filekind srccurkind, dstcurkind; @@ -234,7 +236,7 @@ PUBLIC OSErr hfsPBCatMove(CMovePBPtr pb, BOOLEAN async) filerec srcfrec; BOOLEAN ignorename; - srccurkind = regular | directory; + srccurkind = (filekind)(regular | directory); err = ROMlib_findvcbandfile((ioParam *) pb, CL(pb->ioDirID), &srcbtparam, &srccurkind, FALSE); if (err == noErr) { diff --git a/src/hfsMisc.c b/src/hfsMisc.cpp similarity index 99% rename from src/hfsMisc.c rename to src/hfsMisc.cpp index 6077ca8d..f8d6d66a 100644 --- a/src/hfsMisc.c +++ b/src/hfsMisc.cpp @@ -14,6 +14,8 @@ char ROMlib_rcsid_hfsMisc[] = #include "rsys/hfs.h" #include "rsys/file.h" +using namespace Executor; + #if defined (TESTFCB) PUBLIC void testfcb() { diff --git a/src/hfsVolume.c b/src/hfsVolume.cpp similarity index 93% rename from src/hfsVolume.c rename to src/hfsVolume.cpp index 88be57de..16bc19a9 100644 --- a/src/hfsVolume.c +++ b/src/hfsVolume.cpp @@ -13,11 +13,14 @@ char ROMlib_rcsid_hfsVolume[] = #include "MemoryMgr.h" #include "rsys/hfs.h" #include "rsys/file.h" +#include "rsys/hfs_plus.h" #if defined (CYGWIN32) #include "winfs.h" #endif +using namespace Executor; + /* * TODO: support read and write count. This will make it possible to * discriminate between identically named disks (i.e. when you @@ -147,7 +150,7 @@ PRIVATE OSErr initcache(HVCB *vcbp) return noErr; } -PUBLIC boolean_t ROMlib_hfs_plus_support = FALSE; +PUBLIC boolean_t Executor::ROMlib_hfs_plus_support = FALSE; PRIVATE boolean_t is_hfs_plus_wrapper (volumeinfoPtr vp) @@ -211,7 +214,7 @@ PRIVATE OSErr readvolumeinfo(HVCB *vcbp) /* call once during mounting */ ((CW(vcbp->vcbNmAlBlks) * Cx(vcbp->vcbAlBlkSiz)) + \ (Cx(vcbp->vcbAlBlSt) * PHYSBSIZE)) -void vcbsync(HVCB *vcbp) +void Executor::vcbsync(HVCB *vcbp) { if (!ROMlib_nosync) fsync(((VCBExtra *)vcbp)->u.hfs.fd); @@ -232,7 +235,7 @@ PRIVATE OSErr writevolumeinfo(HVCB *vcbp, Ptr p) return err; } -OSErr ROMlib_flushvcbp(HVCB *vcbp) +OSErr Executor::ROMlib_flushvcbp(HVCB *vcbp) { Ptr realp, p; OSErr retval; @@ -244,7 +247,7 @@ OSErr ROMlib_flushvcbp(HVCB *vcbp) { if (Cx(vcbp->vcbFlags) & VCBDIRTY) { - realp = alloca ((Size) 512 + 4); /* needs to be aligned on unix */ + realp = (Ptr)alloca ((Size) 512 + 4); /* needs to be aligned on unix */ p = (Ptr) (((long) realp+3) & ~3L); vip = (volumeinfoPtr) p; @@ -286,7 +289,7 @@ PRIVATE HVCB *vcbbyname(StringPtr name) #define VCB_CMP_FUNC strcmp #endif -PUBLIC HVCB *ROMlib_vcbbybiggestunixname(const char *name) +PUBLIC HVCB *Executor::ROMlib_vcbbybiggestunixname(const char *name) { HVCB *vcbp, *bestvcbp; int namesize, bestsize; @@ -298,7 +301,7 @@ PUBLIC HVCB *ROMlib_vcbbybiggestunixname(const char *name) const char *ip; len = strlen (name) + 1; - new_name = alloca (len); + new_name = (char*)alloca (len); for (op = new_name, ip = name; (c = *ip++);) *op++ = c == '\\' ? '/' : c; *op++ = 0; @@ -323,7 +326,7 @@ PUBLIC HVCB *ROMlib_vcbbybiggestunixname(const char *name) } PUBLIC VCBExtra * -ROMlib_vcbbyunixname(char *name) +Executor::ROMlib_vcbbyunixname(char *name) { HVCB *vcbp; @@ -336,7 +339,7 @@ ROMlib_vcbbyunixname(char *name) return (VCBExtra *) vcbp; } -PUBLIC HVCB *ROMlib_vcbbydrive(short vrefnum) +PUBLIC HVCB *Executor::ROMlib_vcbbydrive(short vrefnum) { HVCB *vcbp; @@ -348,7 +351,7 @@ PUBLIC HVCB *ROMlib_vcbbydrive(short vrefnum) } PUBLIC DrvQExtra * -ROMlib_dqbydrive (short vrefnum) +Executor::ROMlib_dqbydrive (short vrefnum) { DrvQEl *dp; DrvQExtra *retval; @@ -364,7 +367,7 @@ ROMlib_dqbydrive (short vrefnum) return dp ? retval : 0; } -PUBLIC HVCB *ROMlib_vcbbyvrn(short vrefnum) +PUBLIC HVCB *Executor::ROMlib_vcbbyvrn(short vrefnum) { HVCB *vcbp; @@ -375,7 +378,7 @@ PUBLIC HVCB *ROMlib_vcbbyvrn(short vrefnum) return vcbp; } -PUBLIC HVCB *ROMlib_findvcb(short vrefnum, StringPtr name, LONGINT *diridp, +PUBLIC HVCB *Executor::ROMlib_findvcb(short vrefnum, StringPtr name, LONGINT *diridp, BOOLEAN usedefault) { HVCB *vcbp; @@ -416,18 +419,18 @@ PUBLIC HVCB *ROMlib_findvcb(short vrefnum, StringPtr name, LONGINT *diridp, PRIVATE INTEGER drvtodref(INTEGER vref) /* TODO: flesh this out */ { #if 0 - switch (vref) { - case 1: - case 2: - return -5; - case 3: - case 4: - return -2; - default: - return 0; - } + switch (vref) { + case 1: + case 2: + return -5; + case 3: + case 4: + return -2; + default: + return 0; + } #else - return OURHFSDREF; + return OURHFSDREF; #endif } @@ -465,10 +468,10 @@ PRIVATE INTEGER openxtnt(LONGINT filnum, LONGINT clpsize, LONGINT filsize, xtntr #define XTNUM 3 #define CTNUM 4 -PUBLIC INTEGER ROMlib_nextvrn = 0; /* TODO: low memory global */ +PUBLIC INTEGER Executor::ROMlib_nextvrn = 0; /* TODO: low memory global */ PUBLIC OSErr -hfsPBMountVol (ParmBlkPtr pb, LONGINT floppyfd, LONGINT offset, LONGINT bsize, +Executor::hfsPBMountVol (ParmBlkPtr pb, LONGINT floppyfd, LONGINT offset, LONGINT bsize, LONGINT maxbytes, drive_flags_t flags, DrvQExtra *dqp) { HVCB *vcbp, *vcbp2; @@ -726,19 +729,19 @@ PRIVATE OSErr commonGetVInfo(HVolumeParam *pb, BOOLEAN async, fstype fs) } #undef RETURN -PUBLIC OSErr hfsPBGetVInfo(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBGetVInfo(ParmBlkPtr pb, BOOLEAN async) { return commonGetVInfo((HVolumeParam *)pb, async, mfs); } -PUBLIC OSErr hfsPBHGetVInfo(HParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBHGetVInfo(HParmBlkPtr pb, BOOLEAN async) { return commonGetVInfo((HVolumeParam *) pb, async, hfs); } #define ATRBMASK VSOFTLOCKBIT -PUBLIC OSErr hfsPBSetVInfo(HParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBSetVInfo(HParmBlkPtr pb, BOOLEAN async) { OSErr err; HVCB *vcbp; @@ -784,7 +787,7 @@ PRIVATE OSErr getvolcommon(volumeParam *pb) return err; } -PUBLIC OSErr hfsPBGetVol(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBGetVol(ParmBlkPtr pb, BOOLEAN async) { OSErr err; @@ -792,9 +795,9 @@ PUBLIC OSErr hfsPBGetVol(ParmBlkPtr pb, BOOLEAN async) PBRETURN((volumeParam *) pb, err); } -PUBLIC LONGINT DefDirID = CLC(2); +PUBLIC LONGINT Executor::DefDirID = CLC(2); -PUBLIC OSErr hfsPBHGetVol(WDPBPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBHGetVol(WDPBPtr pb, BOOLEAN async) { wdentry *wdp; OSErr err; @@ -897,17 +900,17 @@ PRIVATE OSErr setvolhelper(volumeParam *pb, BOOLEAN aysnc, LONGINT dirid, PBRETURN(pb, err); } -PUBLIC OSErr hfsPBSetVol(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBSetVol(ParmBlkPtr pb, BOOLEAN async) { return setvolhelper((volumeParam *) pb, async, 0, TRUE); } -PUBLIC OSErr hfsPBHSetVol(WDPBPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBHSetVol(WDPBPtr pb, BOOLEAN async) { return setvolhelper((volumeParam *) pb, async, Cx(pb->ioWDDirID), FALSE); } -PUBLIC OSErr hfsPBFlushVol(ParmBlkPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBFlushVol(ParmBlkPtr pb, BOOLEAN async) { VCB *vcbp; OSErr err; @@ -937,7 +940,7 @@ PRIVATE void closeallvcbfiles(HVCB *vcbp) } } -PUBLIC OSErr hfsPBUnmountVol(ParmBlkPtr pb) +PUBLIC OSErr Executor::hfsPBUnmountVol(ParmBlkPtr pb) { OSErr err; HVCB *vcbp; @@ -997,7 +1000,7 @@ PRIVATE OSErr offlinehelper(volumeParam *pb, HVCB *vcbp) return err; } -PUBLIC OSErr hfsPBOffLine(ParmBlkPtr pb) +PUBLIC OSErr Executor::hfsPBOffLine(ParmBlkPtr pb) { OSErr err; HVCB *vcbp; @@ -1015,7 +1018,7 @@ PUBLIC OSErr hfsPBOffLine(ParmBlkPtr pb) PBRETURN((volumeParam *) pb, err); } -PUBLIC OSErr hfsPBEject(ParmBlkPtr pb) +PUBLIC OSErr Executor::hfsPBEject(ParmBlkPtr pb) { OSErr err; HVCB *vcbp; @@ -1047,7 +1050,7 @@ PUBLIC OSErr hfsPBEject(ParmBlkPtr pb) PBRETURN((volumeParam *) pb, err); } -PUBLIC OSErr ROMlib_pbvolrename(ioParam *pb, StringPtr newnamep) +PUBLIC OSErr Executor::ROMlib_pbvolrename(ioParam *pb, StringPtr newnamep) { OSErr err; HParamBlockRec hpb; diff --git a/src/hfsWorkingdir.c b/src/hfsWorkingdir.cpp similarity index 89% rename from src/hfsWorkingdir.c rename to src/hfsWorkingdir.cpp index 35285462..e5a280a8 100644 --- a/src/hfsWorkingdir.c +++ b/src/hfsWorkingdir.cpp @@ -14,11 +14,13 @@ char ROMlib_rcsid_hfsWorkingdir[] = #include "rsys/file.h" #include "MemoryMgr.h" +using namespace Executor; + /* * TODO: use this working directory stuff in ROMlib */ -PUBLIC OSErr ROMlib_dirbusy(LONGINT dirid, HVCB *vcbp) +PUBLIC OSErr Executor::ROMlib_dirbusy(LONGINT dirid, HVCB *vcbp) { #if defined(MAC) wdentry *wdp, *ewdp; @@ -33,7 +35,7 @@ PUBLIC OSErr ROMlib_dirbusy(LONGINT dirid, HVCB *vcbp) #endif } -PUBLIC OSErr ROMlib_mkwd(WDPBPtr pb, HVCB *vcbp, LONGINT dirid, LONGINT procid) +PUBLIC OSErr Executor::ROMlib_mkwd(WDPBPtr pb, HVCB *vcbp, LONGINT dirid, LONGINT procid) { wdentry *wdp, *ewdp, *firstfreep; OSErr retval; @@ -82,7 +84,7 @@ PUBLIC OSErr ROMlib_mkwd(WDPBPtr pb, HVCB *vcbp, LONGINT dirid, LONGINT procid) return retval; } -PUBLIC OSErr hfsPBOpenWD(WDPBPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBOpenWD(WDPBPtr pb, BOOLEAN async) { LONGINT dirid; OSErr retval; @@ -91,7 +93,7 @@ PUBLIC OSErr hfsPBOpenWD(WDPBPtr pb, BOOLEAN async) HVCB *vcbp; StringPtr namep; - kind = regular|directory; + kind = (filekind)(regular|directory); retval = ROMlib_findvcbandfile((ioParam *)pb, Cx(pb->ioWDDirID), &btparamrec, &kind, FALSE); if (retval != noErr) @@ -111,7 +113,7 @@ PUBLIC OSErr hfsPBOpenWD(WDPBPtr pb, BOOLEAN async) PBRETURN(pb, retval); } -PUBLIC OSErr hfsPBCloseWD(WDPBPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBCloseWD(WDPBPtr pb, BOOLEAN async) { wdentry *wdp; OSErr retval; @@ -127,7 +129,7 @@ PUBLIC OSErr hfsPBCloseWD(WDPBPtr pb, BOOLEAN async) PBRETURN(pb, retval); } -PUBLIC OSErr hfsPBGetWDInfo(WDPBPtr pb, BOOLEAN async) +PUBLIC OSErr Executor::hfsPBGetWDInfo(WDPBPtr pb, BOOLEAN async) { OSErr retval; wdentry *wdp, *ewdp; @@ -190,7 +192,7 @@ PUBLIC OSErr hfsPBGetWDInfo(WDPBPtr pb, BOOLEAN async) } PUBLIC OSErr -GetWDInfo (INTEGER wd, INTEGER *vrefp, LONGINT *dirp, LONGINT *procp) +Executor::GetWDInfo (INTEGER wd, INTEGER *vrefp, LONGINT *dirp, LONGINT *procp) { OSErr retval; @@ -207,7 +209,7 @@ GetWDInfo (INTEGER wd, INTEGER *vrefp, LONGINT *dirp, LONGINT *procp) return retval; } -PUBLIC void ROMlib_adjustdirid(LONGINT *diridp, HVCB *vcbp, INTEGER vrefnum) +PUBLIC void Executor::ROMlib_adjustdirid(LONGINT *diridp, HVCB *vcbp, INTEGER vrefnum) { wdentry *wdp; diff --git a/src/hfsXbar.c b/src/hfsXbar.cpp similarity index 98% rename from src/hfsXbar.c rename to src/hfsXbar.cpp index 2c554ecc..4cda1eec 100644 --- a/src/hfsXbar.c +++ b/src/hfsXbar.cpp @@ -15,6 +15,9 @@ char ROMlib_rcsid_hfsXbar[] = #include "rsys/file.h" #include "rsys/stdfile.h" #include "rsys/flags.h" +#include "rsys/prefs.h" + +using namespace Executor; /* * TODO: pass the information gleaned by hfsvol and hfsfil into the @@ -150,7 +153,7 @@ try_to_reopen (DrvQExtra *dqp) #endif } -PUBLIC int ROMlib_directdiskaccess = FALSE; +PUBLIC int Executor::ROMlib_directdiskaccess = FALSE; A2(PUBLIC trap, OSErrRET, PBRead, ParmBlkPtr, pb, BOOLEAN, async) { @@ -202,7 +205,7 @@ A2(PUBLIC trap, OSErrRET, PBRead, ParmBlkPtr, pb, BOOLEAN, async) to_find = CW (pb->ioParam.ioPosMode) >> 8; pbr.ioParam.ioPosMode &= CWC (0x7F); - buf = alloca (CL (pb->ioParam.ioReqCount)); + buf = (char*)alloca (CL (pb->ioParam.ioReqCount)); pbr.ioParam.ioBuffer = (Ptr) RM (buf); retval = PBRead (&pbr, FALSE); @@ -210,10 +213,10 @@ A2(PUBLIC trap, OSErrRET, PBRead, ParmBlkPtr, pb, BOOLEAN, async) pb->ioParam.ioPosOffset = pbr.ioParam.ioPosOffset; act_count = CL (pb->ioParam.ioActCount); - p_to_find = memchr (buf, to_find, act_count); + p_to_find = (char*)memchr (buf, to_find, act_count); if (to_find == '\r' && ROMlib_newlinetocr) - p_alternate = memchr (buf, '\n', act_count); + p_alternate = (char*)memchr (buf, '\n', act_count); else p_alternate = 0; diff --git a/src/hintemplate.h b/src/hintemplate.h index 7709be0b..2b29e3e6 100644 --- a/src/hintemplate.h +++ b/src/hintemplate.h @@ -15,7 +15,7 @@ PRIVATE DECL { STATEDECL - register INTEGER x, x1, x2, y; + register INTEGER x = 0, x1 = 0, x2 = 0, y = 0; register INTEGER *ip, *op; register int rev; INTEGER y0, y1; diff --git a/src/hle.c b/src/hle.cpp similarity index 90% rename from src/hle.c rename to src/hle.cpp index ff7f0b1e..60ac7cb2 100644 --- a/src/hle.c +++ b/src/hle.cpp @@ -12,6 +12,8 @@ char ROMlib_rcsid_hle[] = #include "OSEvent.h" #include "MemoryMgr.h" +using namespace Executor; + typedef struct hle_q_elt { struct hle_q_elt *next; @@ -24,21 +26,21 @@ static hle_q_elt_t *hle_q; static HighLevelEventMsgPtr current_hle_msg; void -hle_init (void) +Executor::hle_init (void) { hle_q = NULL; current_hle_msg = NULL; } void -hle_reinit (void) +Executor::hle_reinit (void) { hle_q = NULL; current_hle_msg = NULL; } void -hle_reset (void) +Executor::hle_reset (void) { if (current_hle_msg == NULL) return; @@ -50,7 +52,7 @@ hle_reset (void) } boolean_t -hle_get_event (EventRecord *evt, boolean_t remflag) +Executor::hle_get_event (EventRecord *evt, boolean_t remflag) { if (hle_q) { @@ -112,7 +114,7 @@ P3 (PUBLIC pascal trap, Boolean, GetSpecificHighLevelEvent, Boolean evt_handled_p; evt_handled_p - = CToPascalCall (fn, CTOP_GetSpecificHighLevelEventProcTemplate, + = CToPascalCall (&fn, CTOP_GetSpecificHighLevelEventProcTemplate, t->hle_msg, /* ##### target id */ NULL); @@ -126,8 +128,11 @@ P3 (PUBLIC pascal trap, Boolean, GetSpecificHighLevelEvent, return FALSE; } -P3 (PUBLIC pascal, Boolean, GetSpecificHighLevelEventProcTemplate, - Ptr, data, HighLevelEventMsgPtr, hle_msg, TargetID *, target_id) +namespace Executor { + PUBLIC pascal Boolean C_GetSpecificHighLevelEventProcTemplate(Ptr, HighLevelEventMsgPtr, TargetID *); +} + +P3 (PUBLIC pascal, Boolean, GetSpecificHighLevelEventProcTemplate, Ptr, data, HighLevelEventMsgPtr, hle_msg, TargetID *, target_id) { /* template for CTOP_... and PTOC_... flags generation */ abort (); diff --git a/src/ibm_keycodes.c b/src/ibm_keycodes.cpp similarity index 96% rename from src/ibm_keycodes.c rename to src/ibm_keycodes.cpp index 9dfa4f50..b0053f4c 100644 --- a/src/ibm_keycodes.c +++ b/src/ibm_keycodes.cpp @@ -10,9 +10,11 @@ char ROMlib_rcsid_ibm_keycodes[] = #include "rsys/common.h" #include "rsys/keyboard.h" -#if defined (MSDOS) || defined (EVENT_SVGALIB) || defined (CYGWIN32) || (defined (SDL) && (defined (LINUX) || defined (MACOSX))) +using namespace Executor; -unsigned char ibm_virt_to_mac_virt[] = +#if defined (MSDOS) || defined (EVENT_SVGALIB) || defined (CYGWIN32) || (defined (SDL) && (defined (LINUX) || defined (MACOSX_))) + +unsigned char Executor::ibm_virt_to_mac_virt[] = { 0xFF, /* unused 0x00 */ 0x35, /* ESC 0x01 */ diff --git a/src/icon.c b/src/icon.cpp similarity index 99% rename from src/icon.c rename to src/icon.cpp index bd684812..663d0dbe 100644 --- a/src/icon.c +++ b/src/icon.cpp @@ -21,6 +21,8 @@ char ROMlib_rcsid_icon[] = #include "rsys/mman.h" #include "rsys/icon.h" +using namespace Executor; + #define ICON_RETURN_ERROR(error) \ ({ \ OSErr _error_ = (error); \ diff --git a/src/image.c b/src/image.cpp similarity index 93% rename from src/image.c rename to src/image.cpp index e3c852da..3c1ac3c3 100644 --- a/src/image.c +++ b/src/image.cpp @@ -16,10 +16,12 @@ char ROMlib_rcsid_image[] = #include "rsys/image.h" +using namespace Executor; + #define MAX_ROWBYTES_FOR_WIDTH(w) ((((w) * 32 + 31) / 32) * 4) pixel_image_t * -image_init (pixel_image_desc_t *image_desc) +Executor::image_init (pixel_image_desc_t *image_desc) { pixel_image_t *retval; int i; @@ -97,7 +99,7 @@ image_init (pixel_image_desc_t *image_desc) /* all image_... functions assume thePort as target */ void -image_copy (pixel_image_t *image, int color_p /* visual */, +Executor::image_copy (pixel_image_t *image, int color_p /* visual */, Rect *dst_rect, int mode) { WRAPPER_PIXMAP_FOR_COPY (wrapper); @@ -120,7 +122,7 @@ image_copy (pixel_image_t *image, int color_p /* visual */, } void -image_validate_x_bits (pixel_image_t *image, int color_p /* visual */) +Executor::image_validate_x_bits (pixel_image_t *image, int color_p /* visual */) { GDHandle gdev; PixMapHandle bits, x_bits; @@ -160,7 +162,7 @@ image_validate_x_bits (pixel_image_t *image, int color_p /* visual */) /* assumes color */ void -image_update_ctab (pixel_image_t *image, const RGBColor *new_colors, +Executor::image_update_ctab (pixel_image_t *image, const RGBColor *new_colors, int max_color) { PixMapHandle bits; diff --git a/src/image_inits.c b/src/image_inits.cpp similarity index 90% rename from src/image_inits.c rename to src/image_inits.cpp index 93f14180..d95821c9 100644 --- a/src/image_inits.c +++ b/src/image_inits.cpp @@ -9,9 +9,12 @@ char ROMlib_rcsid_image_inits[] = #include "rsys/common.h" #include "rsys/ctl.h" +#include "rsys/image.h" + +using namespace Executor; void -image_inits (void) +Executor::image_inits (void) { image_arrow_up_active_init (); image_arrow_up_inactive_init (); diff --git a/src/include/ADB.h b/src/include/ADB.h index 569854a4..743adc51 100644 --- a/src/include/ADB.h +++ b/src/include/ADB.h @@ -8,6 +8,7 @@ * $Id: ADB.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { typedef struct PACKED { SignedByte devType; @@ -28,5 +29,6 @@ extern INTEGER CountADBs (void); extern OSErr GetIndADB (ADBDataBlock *adbp, INTEGER index); extern OSErr GetADBInfo (ADBDataBlock *adbp, INTEGER address); extern OSErr SetADBInfo (ADBSetInfoBlock *adbp, INTEGER address); +} #endif /* !_ADB_H_ */ diff --git a/src/include/AliasMgr.h b/src/include/AliasMgr.h index 027e57e8..9be025cd 100644 --- a/src/include/AliasMgr.h +++ b/src/include/AliasMgr.h @@ -4,6 +4,7 @@ #include "FileMgr.h" +namespace Executor { typedef ProcPtr AliasFilterProcPtr; typedef Handle AliasHandle; typedef int16 AliasTypeInfo; @@ -24,43 +25,44 @@ enum kFontFolderType = T('f', 'o', 'n', 't'), }; -extern pascal trap OSErr C_FindFolder (int16 vRefNum, OSType folderType, - Boolean createFolder, +extern pascal trap Executor::OSErr C_FindFolder (int16 vRefNum, Executor::OSType folderType, + Executor::Boolean createFolder, int16 *foundVRefNum, int32 *foundDirID); -extern pascal trap OSErr C_NewAlias (FSSpecPtr fromFile, FSSpecPtr target, - AliasHandle *alias); +extern pascal trap Executor::OSErr C_NewAlias (Executor::FSSpecPtr fromFile, Executor::FSSpecPtr target, + Executor::AliasHandle *alias); -extern pascal trap OSErr C_NewAliasMinimal (FSSpecPtr target, - AliasHandle *alias); +extern pascal trap Executor::OSErr C_NewAliasMinimal (Executor::FSSpecPtr target, + Executor::AliasHandle *alias); -extern pascal trap OSErr C_NewAliasMinimalFromFullPath - (int16 fullpathLength, Ptr fullpath, - Str32 zoneName, Str31 serverName, AliasHandle *alias); +extern pascal trap Executor::OSErr C_NewAliasMinimalFromFullPath + (int16 fullpathLength, Executor::Ptr fullpath, + Executor::Str32 zoneName, Executor::Str31 serverName, Executor::AliasHandle *alias); -extern pascal trap OSErr C_UpdateAlias (FSSpecPtr fromFile, FSSpecPtr target, - AliasHandle alias, - Boolean *wasChanged); +extern pascal trap Executor::OSErr C_UpdateAlias (Executor::FSSpecPtr fromFile, Executor::FSSpecPtr target, + Executor::AliasHandle alias, + Executor::Boolean *wasChanged); -extern pascal trap OSErr C_ResolveAlias (FSSpecPtr fromFile, - AliasHandle alias, - FSSpecPtr target, - Boolean *wasAliased); +extern pascal trap Executor::OSErr C_ResolveAlias (Executor::FSSpecPtr fromFile, + Executor::AliasHandle alias, + Executor::FSSpecPtr target, + Executor::Boolean *wasAliased); -extern pascal trap OSErr C_ResolveAliasFile (FSSpecPtr theSpec, - Boolean resolveAliasChains, - Boolean *targetIsFolder, - Boolean *wasAliased); +extern pascal trap Executor::OSErr C_ResolveAliasFile (Executor::FSSpecPtr theSpec, + Executor::Boolean resolveAliasChains, + Executor::Boolean *targetIsFolder, + Executor::Boolean *wasAliased); -extern pascal trap OSErr C_MatchAlias (FSSpecPtr fromFile, int32 rulesMask, - AliasHandle alias, int16 *aliasCount, - FSSpecArrayPtr aliasList, - Boolean *needsUpdate, - AliasFilterProcPtr aliasFilter, - Ptr yourDataPtr); -extern pascal trap OSErr C_GetAliasInfo (AliasHandle alias, - AliasTypeInfo index, - Str63 theString); +extern pascal trap Executor::OSErr C_MatchAlias (Executor::FSSpecPtr fromFile, int32 rulesMask, + Executor::AliasHandle alias, int16 *aliasCount, + Executor::FSSpecArrayPtr aliasList, + Executor::Boolean *needsUpdate, + Executor::AliasFilterProcPtr aliasFilter, + Executor::Ptr yourDataPtr); +extern pascal trap Executor::OSErr C_GetAliasInfo (Executor::AliasHandle alias, + Executor::AliasTypeInfo index, + Executor::Str63 theString); +} #endif diff --git a/src/include/AppleEvents.h b/src/include/AppleEvents.h index f72485e1..e97587a0 100644 --- a/src/include/AppleEvents.h +++ b/src/include/AppleEvents.h @@ -11,6 +11,7 @@ #include "EventMgr.h" #include "NotifyMgr.h" +namespace Executor { typedef int32 AEEventClass; typedef int32 AEEventID; typedef int32 AEKeyword; @@ -484,6 +485,6 @@ extern pascal trap OSErr C_AESetObjectCallbacks (ProcPtr myCompareProc, ProcPtr myMarkProc, ProcPtr myAdjustMarksProc, ProcPtr myGetErrDescProc); - +} #endif /* ! _AppleEvents_H_ */ diff --git a/src/include/AppleTalk.h b/src/include/AppleTalk.h index 493ef53d..b5449a9a 100644 --- a/src/include/AppleTalk.h +++ b/src/include/AppleTalk.h @@ -1,3 +1,3 @@ #if !defined (PortBUse) -extern Byte PortBUse; +extern Executor::Byte PortBUse; #endif diff --git a/src/include/BinaryDecimal.h b/src/include/BinaryDecimal.h index d599a6a0..e1f90579 100644 --- a/src/include/BinaryDecimal.h +++ b/src/include/BinaryDecimal.h @@ -7,13 +7,8 @@ * $Id: BinaryDecimal.h 63 2004-12-24 18:19:43Z ctm $ */ - -/* DO NOT DELETE THIS LINE */ -#if !defined (__STDC__) -extern void NumToString(); -extern void StringToNum(); -#else /* __STDC__ */ -extern trap void NumToString( LONGINT l, StringPtr s ); -extern trap void StringToNum( StringPtr s, LONGINT *lp ); -#endif /* __STDC__ */ +namespace Executor { +extern trap void NumToString( LONGINT l, StringPtr s ); +extern trap void StringToNum( StringPtr s, LONGINT *lp ); +} #endif /* __BINDEC__ */ diff --git a/src/include/CQuickDraw.h b/src/include/CQuickDraw.h index 1cdee17d..a8a1322a 100644 --- a/src/include/CQuickDraw.h +++ b/src/include/CQuickDraw.h @@ -4,6 +4,7 @@ #include "WindowMgr.h" +namespace Executor { typedef HIDDEN_CGrafPtr *HIDDEN_CGrafPtr_Ptr; MAKE_HIDDEN(HIDDEN_CGrafPtr_Ptr); @@ -127,10 +128,10 @@ typedef enum pmAllUpdates_enum = 0xE000, } pmUpdates; -#define pmNoUpdates ((INTEGER) pmNoUpdates_enum) -#define pmBkUpdates ((INTEGER) pmBkUpdates_enum) -#define pmFgUpdates ((INTEGER) pmFgUpdates_enum) -#define pmAllUpdates ((INTEGER) pmAllUpdates_enum) +#define pmNoUpdates ((pmUpdates) pmNoUpdates_enum) +#define pmBkUpdates ((pmUpdates) pmBkUpdates_enum) +#define pmFgUpdates ((pmUpdates) pmFgUpdates_enum) +#define pmAllUpdates ((pmUpdates) pmAllUpdates_enum) MAKE_HIDDEN(PalettePtr); typedef HIDDEN_PalettePtr *PaletteHandle; @@ -468,5 +469,5 @@ extern HIDDEN_GDHandle DeviceList_H; # define DeviceList ((typeof DeviceList_H.type[0])(DeviceList_H.p)) #endif - +} #endif /* _CQUICKDRAW_H_ */ diff --git a/src/include/CommTool.h b/src/include/CommTool.h index ef470042..aa6f7467 100644 --- a/src/include/CommTool.h +++ b/src/include/CommTool.h @@ -8,6 +8,7 @@ * $Id: CommTool.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { typedef struct PACKED { PACKED_MEMBER(QElemPtr, qLink); @@ -56,5 +57,5 @@ extern OSErr CRMRemove (QElemPtr); extern QElemPtr CRMSearch (QElemPtr); extern CRMErr InitCRM (void); - +} #endif diff --git a/src/include/Components.h b/src/include/Components.h index 200c1bba..26e00f47 100644 --- a/src/include/Components.h +++ b/src/include/Components.h @@ -8,6 +8,7 @@ * $Id: Components.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { typedef struct ComponentRecord { LONGINT data[1]; @@ -23,5 +24,5 @@ typedef struct ComponentInstanceRecord ComponentInstanceRecord; typedef ComponentInstanceRecord *ComponentInstance; - +} #endif diff --git a/src/include/ControlMgr.h b/src/include/ControlMgr.h index 889343ef..8fa10bd8 100644 --- a/src/include/ControlMgr.h +++ b/src/include/ControlMgr.h @@ -8,7 +8,7 @@ * $Id: ControlMgr.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { #define pushButProc 0 #define checkBoxProc 1 #define radioButProc 2 @@ -81,9 +81,11 @@ typedef ControlRecord *ControlPtr; MAKE_HIDDEN(ControlPtr); typedef HIDDEN_ControlPtr *ControlHandle; MAKE_HIDDEN(ControlHandle); +} #include "WindowMgr.h" +namespace Executor { struct PACKED __cr { PACKED_MEMBER(ControlHandle, nextControl); PACKED_MEMBER(WindowPtr, contrlOwner); @@ -232,5 +234,6 @@ extern pascal trap void C_SizeControl( ControlHandle c, INTEGER width, INTEGER height ); extern pascal trap void P_SizeControl( ControlHandle c, INTEGER width, INTEGER height ); extern pascal trap void C_SetCtlColor (ControlHandle ctl, CCTabHandle ctab); +} #endif /* __STDC__ */ #endif /* __CONTROL__ */ diff --git a/src/include/DeskMgr.h b/src/include/DeskMgr.h index 7e6345f5..3b7051b4 100644 --- a/src/include/DeskMgr.h +++ b/src/include/DeskMgr.h @@ -8,6 +8,7 @@ * $Id: DeskMgr.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { #define undoCmd 0 #define cutCmd 2 #define copyCmd 3 @@ -25,16 +26,7 @@ extern Byte SEvtEnb; /* DO NOT DELETE THIS LINE */ -#if !defined (__STDC__) -extern INTEGER OpenDeskAcc(); -extern void CloseDeskAcc(); -extern void SystemClick(); -extern BOOLEAN SystemEdit(); -extern void SystemTask(); -extern BOOLEAN SystemEvent(); -extern void SystemMenu(); -#else /* __STDC__ */ -extern pascal trap INTEGER C_OpenDeskAcc( +extern pascal trap INTEGER C_OpenDeskAcc( Str255 acc ); extern pascal trap INTEGER P_OpenDeskAcc( Str255 acc ); extern pascal trap void C_CloseDeskAcc( INTEGER rn ); extern pascal trap void P_CloseDeskAcc( INTEGER rn); @@ -42,6 +34,6 @@ extern pascal trap void C_SystemClick( EventRecord *evp, WindowPtr wp ); extern extern pascal trap BOOLEAN C_SystemEdit( INTEGER editcmd ); extern pascal trap BOOLEAN P_SystemEdit( INTEGER editcmd); extern pascal trap void C_SystemTask( void ); extern pascal trap void P_SystemTask( void ); extern pascal trap BOOLEAN C_SystemEvent( EventRecord *evp ); extern pascal trap BOOLEAN P_SystemEvent( EventRecord *evp); -extern pascal trap void C_SystemMenu( LONGINT menu ); extern pascal trap void P_SystemMenu( LONGINT menu); -#endif /* __STDC__ */ +extern pascal trap void C_SystemMenu( LONGINT menu ); extern pascal trap void P_SystemMenu( LONGINT menu); +} #endif /* __DESKMGR__ */ diff --git a/src/include/DeviceMgr.h b/src/include/DeviceMgr.h index 2045d983..a9d4e6da 100644 --- a/src/include/DeviceMgr.h +++ b/src/include/DeviceMgr.h @@ -18,6 +18,7 @@ * might expect. */ +namespace Executor { typedef struct { ProcPtr udrvrOpen; ProcPtr udrvrPrime; /* read and write */ @@ -142,4 +143,5 @@ extern OSErr Status( INTEGER rn, INTEGER code, Ptr param ); extern OSErr KillIO( INTEGER rn ); extern DCtlHandle GetDCtlEntry( INTEGER rn ); #endif /* __STDC__ */ +} #endif /* __DEVICEMGR__ */ diff --git a/src/include/DialogMgr.h b/src/include/DialogMgr.h index e7c33b63..19bc6bb0 100644 --- a/src/include/DialogMgr.h +++ b/src/include/DialogMgr.h @@ -11,6 +11,7 @@ #include "WindowMgr.h" #include "TextEdit.h" +namespace Executor { #define ctrlItem 4 #define btnCtrl 0 #define chkCtrl 1 @@ -204,5 +205,6 @@ extern pascal trap OSErr C_SetDialogTracksCursor (DialogPtr dialog, extern void AppendDITL (DialogPtr, Handle, DITLMethod); extern void ShortenDITL (DialogPtr, int16); extern int16 CountDITL (DialogPtr); +} #endif /* _DIALOG_H_ */ diff --git a/src/include/Disk.h b/src/include/Disk.h index 7bf52272..ea9259c2 100644 --- a/src/include/Disk.h +++ b/src/include/Disk.h @@ -8,6 +8,7 @@ * $Id: Disk.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { #define nsDrvErr (-56) #define paramErr (-50) #define wPrErr (-44) @@ -59,4 +60,5 @@ extern OSErr DiskEject( INTEGER rn ); extern OSErr SetTagBuffer( Ptr bp ); extern OSErr DriveStatus( INTEGER dn, DrvSts *statp ); #endif /* __STDC__ */ +} #endif /* __DISK__ */ diff --git a/src/include/DiskInit.h b/src/include/DiskInit.h index f34eab30..f2865c1f 100644 --- a/src/include/DiskInit.h +++ b/src/include/DiskInit.h @@ -21,7 +21,7 @@ #define paramErr (-50) #define volOnLinErr (-55) - +namespace Executor { /* DO NOT DELETE THIS LINE */ #if !defined (__STDC__) extern void DILoad(); @@ -40,4 +40,5 @@ extern OSErr C_DIFormat( INTEGER dn ); extern OSErr C_DIVerify( INTEGER dn ); extern OSErr C_DIZero( INTEGER dn, StringPtr vname ); #endif /* __STDC__ */ +} #endif /* __DISKINIT__ */ diff --git a/src/include/EditionMgr.h b/src/include/EditionMgr.h index 15b46164..3f7d1f59 100644 --- a/src/include/EditionMgr.h +++ b/src/include/EditionMgr.h @@ -12,6 +12,8 @@ #include "IntlUtil.h" #include "AliasMgr.h" + +namespace Executor { #define declare_subtypes(type) \ typedef struct type ## Record type ## Record; \ typedef type ## Record *type ## Ptr; \ @@ -273,5 +275,6 @@ extern pascal trap OSErr C_CallFormatIOProc (FormatIOVerb selector, FormatIOParamBlock *param_block, FormatIOProcPtr proc); +} #endif /* _EDITIONMGR_H_ */ diff --git a/src/include/EventMgr.h b/src/include/EventMgr.h index 9da6b1c9..01667eee 100644 --- a/src/include/EventMgr.h +++ b/src/include/EventMgr.h @@ -10,6 +10,7 @@ #include "QuickDraw.h" +namespace Executor { #define nullEvent 0 #define mouseDown 1 #define mouseUp 2 @@ -74,5 +75,6 @@ typedef struct PACKED { #if !defined (KeyMap) extern unsigned char KeyMap[16]; #endif +} #endif /* __EVENT__ */ diff --git a/src/include/FileMgr.h b/src/include/FileMgr.h index ee88aa91..d87663fb 100644 --- a/src/include/FileMgr.h +++ b/src/include/FileMgr.h @@ -10,6 +10,88 @@ * $Id: FileMgr.h 86 2005-05-25 00:47:12Z ctm $ */ +//So as to not conflict with OS X defines +#undef PBGetVInfo +#undef PBXGetVolInfo +#undef PBGetVol +#undef PBSetVol +#undef PBFlushVol +#undef PBCreate +#undef PBDelete +#undef PBOpenDF +#undef PBOpenRF +#undef PBRename +#undef PBGetFInfo +#undef PBSetFInf +#undef PBSetFLock +#undef PBRstFLock +#undef PBSetFVers +#undef PBAllocate +#undef PBGetEOF +#undef PBSetEOF +#undef PBGetFPos +#undef PBSetFPos +#undef PBFlushFile +#undef PBCatSearch +#undef PBOpenWD +#undef PBCloseWD +#undef PBHSetVol +#undef PBHGetVol +#undef PBCatMove +#undef PBDirCreate +#undef PBGetWDInfo +#undef PBGetFCBInfo +#undef PBGetCatInfo +#undef PBSetCatInfo +#undef PBAllocContig +#undef PBLockRange +#undef PBUnlockRange +#undef PBSetVInfo +#undef PBHGetVInfo +#undef PBHOpen +#undef PBHOpenRF +#undef PBHOpenDF +#undef PBHCreate +#undef PBHDelete +#undef PBHRename +#undef PBHRstFLock +#undef PBHSetFLock +#undef PBHGetFInfo +#undef PBHSetFInfo +#undef PBMakeFSSpec +#undef PBHGetVolParms +#undef PBHGetLogInInfo +#undef PBHGetDirAccess +#undef PBHSetDirAccess +#undef PBHMapID +#undef PBHMapName +#undef PBHCopyFile +#undef PBHMoveRename +#undef PBHOpenDeny +#undef PBHOpenRFDeny +#undef PBExchangeFiles +#undef PBCreateFileIDRef +#undef PBResolveFileIDRef +#undef PBDeleteFileIDRef +#undef PBGetForeignPrivs +#undef PBSetForeignPrivs +#undef PBDTAddIcon +#undef PBDTGetIcon +#undef PBDTGetIconInfo +#undef PBDTAddAPPL +#undef PBDTRemoveAPPL +#undef PBDTGetAPPL +#undef PBDTSetComment +#undef PBDTRemoveComment +#undef PBDTGetComment +#undef PBDTFlush +#undef PBDTReset +#undef PBDTGetInfo +#undef PBDTDelete +#undef PBSetFInfo +#undef PBGetFInfo + +namespace Executor { #define fOnDesk 1 #define fHasBundle 8192 #define fInvisible 16384 @@ -443,8 +525,8 @@ extern OSErr AllocContig( INTEGER rn, LONGINT *count ); extern OSErr FSClose( INTEGER rn ); extern void ROMlib_rewinddir( void ); extern char *ROMlib_newunixfrommac( char *ip, INTEGER n ); -extern trap OSErrRET OpenDeny( HParmBlkPtr pb, BOOLEAN a ); -extern trap OSErrRET PBHGetLogInInfo( HParmBlkPtr pb, BOOLEAN a ); +extern trap OSErrRET OpenDeny( HParmBlkPtr pb, BOOLEAN a ); +extern trap OSErrRET PBHGetLogInInfo( HParmBlkPtr pb, BOOLEAN a ); extern trap OSErrRET PBHGetDirAccess( HParmBlkPtr pb, BOOLEAN a ); extern trap OSErrRET PBHCopyFile( HParmBlkPtr pb, BOOLEAN a ); extern trap OSErrRET PBHMapID( HParmBlkPtr pb, BOOLEAN a ); @@ -476,8 +558,8 @@ extern OSErr GetVol( StringPtr voln, INTEGER *vrn ); extern OSErr SetVol( StringPtr voln, INTEGER vrn ); extern OSErr FlushVol( StringPtr voln, INTEGER vrn ); extern OSErr UnmountVol( StringPtr voln, INTEGER vrn ); -extern OSErr Eject( StringPtr voln, INTEGER vrn ); -extern trap OSErrRET PBHRename( HParmBlkPtr pb, BOOLEAN async ); +extern OSErr Eject( StringPtr voln, INTEGER vrn ); +extern trap OSErrRET PBHRename( HParmBlkPtr pb, BOOLEAN async ); extern trap OSErrRET PBHCreate( HParmBlkPtr pb, BOOLEAN async ); extern trap OSErrRET PBDirCreate( HParmBlkPtr pb, BOOLEAN async ); extern trap OSErrRET PBHDelete( HParmBlkPtr pb, BOOLEAN async ); @@ -573,5 +655,5 @@ extern OSErr HOpenRF (INTEGER vref, LONGINT dirid, Str255 name, extern OSErr GetWDInfo (INTEGER wd, INTEGER *vrefp, LONGINT *dirp, LONGINT *procp); - +} #endif /* _FILEMGR_H_ */ diff --git a/src/include/Finder.h b/src/include/Finder.h index b31fa553..5687dbaf 100644 --- a/src/include/Finder.h +++ b/src/include/Finder.h @@ -8,6 +8,7 @@ * $Id: Finder.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { typedef struct PACKED { PACKED_MEMBER(QElemPtr, qLink); @@ -53,5 +54,5 @@ extern OSErr PBDTFlush (DTPBPtr dtp, BOOLEAN async); extern OSErr PBDTGetInfo (DTPBPtr dtp, BOOLEAN async); extern OSErr PBDTReset (DTPBPtr dtp, BOOLEAN async); extern OSErr PBDTDelete (DTPBPtr dtp, BOOLEAN async); - +} #endif diff --git a/src/include/FontMgr.h b/src/include/FontMgr.h index 43e591d4..0aed68b4 100644 --- a/src/include/FontMgr.h +++ b/src/include/FontMgr.h @@ -9,7 +9,7 @@ */ #include "QuickDraw.h" - +namespace Executor { #define systemFont 0 #define applFont 1 #define newYork 2 @@ -218,5 +218,5 @@ extern pascal trap OSErr C_OutlineMetrics (int16 byte_count, Ptr text, extern pascal trap void C_SetPreserveGlyph (Boolean preserve_glyph); extern pascal trap Boolean C_GetPreserveGlyph (void); extern pascal trap OSErr C_FlushFonts (void); - +} #endif /* _FONTMGR_H_ */ diff --git a/src/include/Gestalt.h b/src/include/Gestalt.h index 690b1626..7eacda6e 100644 --- a/src/include/Gestalt.h +++ b/src/include/Gestalt.h @@ -1,6 +1,7 @@ #if !defined (__GESTALT__) #define __GESTALT__ +namespace Executor { #define gestaltPhysicalRAMSize T('r','a','m',' ') #if !defined (USE_WINDOWS_NOT_MAC_TYPEDEFS_AND_DEFINES) @@ -171,5 +172,5 @@ extern trap OSErrRET C_GestaltTablesOnly( OSType selector, LONGINT *responsep ); #endif - +} #endif diff --git a/src/include/HelpMgr.h b/src/include/HelpMgr.h index 96bbd00d..39e09db6 100644 --- a/src/include/HelpMgr.h +++ b/src/include/HelpMgr.h @@ -12,6 +12,7 @@ #include "MenuMgr.h" #include "WindowMgr.h" +namespace Executor { typedef struct PACKED HMStringResType { INTEGER hmmResID; @@ -107,5 +108,6 @@ extern OSErr HMGetIndHelpMsg (ResType type, INTEGER resid, INTEGER *variantp, HMMessageRecord *helpmsgp, INTEGER *count); +} #endif /* !_HELPMGR_H_ */ diff --git a/src/include/Iconutil.h b/src/include/Iconutil.h index 633112f5..a8e5958e 100644 --- a/src/include/Iconutil.h +++ b/src/include/Iconutil.h @@ -17,6 +17,7 @@ #define mini4BitData (T ('i', 'c', 'm', '4')) #define mini8BitData (T ('i', 'c', 'm', '8')) +namespace Executor { /* IconAlignmentType values */ enum { @@ -209,4 +210,6 @@ extern pascal trap OSErr C_GetIconCacheProc (Handle cache, IconGetterProcPtr *proc); extern pascal trap OSErr C_SetIconCacheProc (Handle cache, IconGetterProcPtr proc); +} + #endif /* !_ICON_UTIL_H */ diff --git a/src/include/IntlUtil.h b/src/include/IntlUtil.h index 1445b6d9..33494a50 100644 --- a/src/include/IntlUtil.h +++ b/src/include/IntlUtil.h @@ -10,6 +10,7 @@ * $Id: IntlUtil.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { #define currSymLead 16 #define currNegSym 32 #define currTrailingZ 64 @@ -180,5 +181,5 @@ extern pascal trap INTEGER C_IUTextOrder( Ptr ptra, Ptr ptrb, INTEGER lena, extern pascal trap void C_IUGetItlTable( ScriptCode script, INTEGER tablecode, Handle *itlhandlep, LONGINT *offsetp, LONGINT *lengthp); - +} #endif /* _INTLUTIL_H_ */ diff --git a/src/include/ListMgr.h b/src/include/ListMgr.h index 147a2b1d..a1e9142c 100644 --- a/src/include/ListMgr.h +++ b/src/include/ListMgr.h @@ -10,6 +10,7 @@ #include "ControlMgr.h" +namespace Executor { typedef Point Cell; #if 1 || !defined(__alpha) @@ -155,4 +156,5 @@ extern pascal trap void C_LCellSize( Point csize, extern pascal trap BOOLEAN C_LGetSelect( BOOLEAN next, Cell *cellp, ListHandle list ); #endif /* __STDC__ */ +} #endif /* __LIST__ */ diff --git a/src/include/MacTypes.h b/src/include/MacTypes.h index d04d77b1..ca0a2720 100644 --- a/src/include/MacTypes.h +++ b/src/include/MacTypes.h @@ -8,12 +8,21 @@ * $Id: MacTypes.h 86 2005-05-25 00:47:12Z ctm $ */ +#include "rsys/mactype.h" +#ifdef __cplusplus +namespace Executor { +#endif + #define a5 (EM_A5) - + +#if !defined(__MACTYPES__) || defined(__cplusplus) typedef int8 SignedByte; +#endif typedef uint8 Byte; +#if !defined(__MACTYPES__) || defined(__cplusplus) typedef int8 *Ptr; +#endif #if (SIZEOF_CHAR_P == 4) && !FORCE_EXPERIMENTAL_PACKED_MACROS #define MAKE_HIDDEN(typ) typedef struct { typ p; } HIDDEN_ ## typ @@ -21,13 +30,13 @@ typedef int8 *Ptr; #define MAKE_HIDDEN(typ) \ typedef union PACKED { uint32 pp; typ type[0];} HIDDEN_ ## typ #endif - MAKE_HIDDEN(Ptr); +#if !defined(__MACTYPES__) || defined(__cplusplus) typedef HIDDEN_Ptr *Handle; +#endif MAKE_HIDDEN(Handle); - typedef BOOLEAN Boolean; typedef Byte Str15[16]; @@ -35,18 +44,21 @@ typedef Byte Str31[32]; typedef Byte Str32[33]; typedef Byte Str63[64]; typedef Byte Str255[256]; +#if !defined(__MACTYPES__) || defined(__cplusplus) typedef Byte *StringPtr; - +#endif + MAKE_HIDDEN(StringPtr); typedef HIDDEN_StringPtr *StringHandle; +#if !defined(__MACTYPES__) || defined(__cplusplus) typedef int (*ProcPtr)(); - +#endif MAKE_HIDDEN(ProcPtr); - +#if !defined(__MACTYPES__) || defined(__cplusplus) typedef LONGINT Fixed, Fract; - +#endif /* SmallFract represnts values between 0 and 65535 */ typedef unsigned short SmallFract; @@ -83,7 +95,9 @@ typedef union __qe *QElemPtr; MAKE_HIDDEN(QElemPtr); -#define noErr 0 + enum { + noErr = 0 + }; /* from Quickdraw.h */ typedef struct PACKED Point @@ -138,4 +152,7 @@ typedef INTEGER LangCode; /* DO NOT DELETE THIS LINE */ extern INTEGER ROM85; extern INTEGER DSErrCode; +#ifdef __cplusplus +} +#endif #endif /* _MACTYPES_H_ */ diff --git a/src/include/MemoryMgr.h b/src/include/MemoryMgr.h index d0b4ca2f..22c46e01 100644 --- a/src/include/MemoryMgr.h +++ b/src/include/MemoryMgr.h @@ -8,12 +8,12 @@ * $Id: MemoryMgr.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { #define memFullErr (-108) #define memLockedErr (-117) #define memPurErr (-112) #define memWZErr (-111) -enum { memAZErr = -113 }; +//enum { memAZErr = -113 }; #define nilHandleErr (-109) #define memROZErr (-99) @@ -197,5 +197,5 @@ extern pascal trap Handle C_TempNewHandle (Size logical_size, OSErr *result_code extern pascal trap void C_TempHLock (Handle h, OSErr *result_code); extern pascal trap void C_TempHUnlock (Handle h, OSErr *result_code); extern pascal trap void C_TempDisposeHandle (Handle h, OSErr *result_code); - +} #endif /* _MEMORY_MGR_H_ */ diff --git a/src/include/MenuMgr.h b/src/include/MenuMgr.h index d52255f4..84b22162 100644 --- a/src/include/MenuMgr.h +++ b/src/include/MenuMgr.h @@ -11,6 +11,7 @@ #include "QuickDraw.h" #include "ResourceMgr.h" +namespace Executor { #define noMark 0 #define mDrawMsg 0 @@ -201,6 +202,7 @@ extern pascal trap void C_DispMCInfo (MCTableHandle); extern pascal trap MCEntryPtr C_GetMCEntry (INTEGER, INTEGER); extern pascal trap void C_SetMCEntries (INTEGER, MCTablePtr); extern pascal trap void C_InvalMenuBar (void); +} #endif /* __STDC__ */ #endif /* __MENU__ */ diff --git a/src/include/NotifyMgr.h b/src/include/NotifyMgr.h index 1053a8e0..156810ef 100644 --- a/src/include/NotifyMgr.h +++ b/src/include/NotifyMgr.h @@ -8,6 +8,7 @@ * $Id: NotifyMgr.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { typedef struct PACKED { PACKED_MEMBER(QElemPtr, qLink); INTEGER qType; @@ -26,5 +27,5 @@ typedef struct PACKED { extern trap OSErrRET NMInstall( NMRecPtr nmptr ); extern trap OSErrRET NMRemove( NMRecPtr nmptr ); - +} #endif /* __NOTIFYMGR__ */ diff --git a/src/include/OSEvent.h b/src/include/OSEvent.h index 0da5f940..542523b0 100644 --- a/src/include/OSEvent.h +++ b/src/include/OSEvent.h @@ -13,6 +13,7 @@ * $Id: OSEvent.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { #define evtNotEnb 1 typedef struct PACKED { @@ -134,5 +135,6 @@ extern boolean_t hle_get_event (EventRecord *evt, boolean_t remflag); extern void hle_init (void); extern void hle_reinit (void); extern void hle_reset (void); +} #endif /* !_OSEVENT_H_ */ diff --git a/src/include/OSUtil.h b/src/include/OSUtil.h index f49ce3f7..01a84c24 100644 --- a/src/include/OSUtil.h +++ b/src/include/OSUtil.h @@ -12,6 +12,7 @@ #include "FileMgr.h" #include "OSEvent.h" +namespace Executor { #define macXLMachine 0 #define macMachine 1 #define UNIXMachine 1127 @@ -196,9 +197,12 @@ extern trap void Environs( INTEGER *rom, INTEGER *machine ); extern trap OSErrRET SysEnvirons( INTEGER vers, SysEnvRecPtr p ); extern void Restart( void ); extern void SetUpA5( void ); -extern void RestoreA5( void ); -extern void GetMMUMode( INTEGER *ip ); +extern void RestoreA5( void ); +#undef GetMMUMode +#undef SwapMMUMode +extern void GetMMUMode( INTEGER *ip ); extern void SwapMMUMode( Byte *bp ); extern LONGINT StripAddress( LONGINT l ); #endif /* __STDC__ */ +} #endif /* __OSUTIL__ */ diff --git a/src/include/PPC.h b/src/include/PPC.h index 62526ba7..fe012da3 100644 --- a/src/include/PPC.h +++ b/src/include/PPC.h @@ -7,6 +7,8 @@ * $Id: PPC.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { + typedef int16 PPCPortKinds; typedef int16 PPCLocationKind; @@ -43,5 +45,6 @@ typedef struct PACKED PPCPortRec } port; } u; } PPCPortRec, *PPCPortPtr; +} #endif /* !_PPC_H_ */ diff --git a/src/include/Package.h b/src/include/Package.h index 3787c50f..e0b8edd0 100644 --- a/src/include/Package.h +++ b/src/include/Package.h @@ -8,7 +8,7 @@ * $Id: Package.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { #define dskInit 2 #define stdFile 3 #define flPoint 4 @@ -27,4 +27,5 @@ extern void InitAllPacks(); extern pascal trap void C_InitPack( INTEGER packid ); extern pascal trap void P_InitPack( INTEGER packid); extern pascal trap void C_InitAllPacks( void ); extern pascal trap void P_InitAllPacks( void ); #endif /* __STDC__ */ +} #endif /* __PACKAGE__ */ diff --git a/src/include/PrintMgr.h b/src/include/PrintMgr.h index f5f087b1..7108f40b 100644 --- a/src/include/PrintMgr.h +++ b/src/include/PrintMgr.h @@ -10,6 +10,7 @@ * $Id: PrintMgr.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { #define bDraftLoop 0 #define bSpoolLoop 1 @@ -271,4 +272,5 @@ extern pascal trap BOOLEAN C_PrStlDialog( THPrint hPrint ); extern pascal trap BOOLEAN C_PrJobDialog( THPrint hPrint ); extern pascal trap void C_PrJobMerge( THPrint hPrintSrc, THPrint hPrintDst ); #endif /* __STDC__ */ +} #endif /* __PRINTING__ */ diff --git a/src/include/ProcessMgr.h b/src/include/ProcessMgr.h index 2289c30e..3e4b56fb 100644 --- a/src/include/ProcessMgr.h +++ b/src/include/ProcessMgr.h @@ -11,6 +11,7 @@ * $Id: ProcessMgr.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { typedef INTEGER LaunchFlags; typedef struct PACKED ProcessSerialNumber @@ -167,5 +168,5 @@ extern pascal trap OSErr C_GetPortNameFromProcessSerialNumber extern OSErr NewLaunch( StringPtr appl, INTEGER vrefnum, LaunchParamBlockRec *lpbp ); - +} #endif diff --git a/src/include/QuickDraw.h b/src/include/QuickDraw.h index c9efc38a..76f44bf8 100644 --- a/src/include/QuickDraw.h +++ b/src/include/QuickDraw.h @@ -8,6 +8,7 @@ * $Id: QuickDraw.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { enum { grafSize = 206 }; /* number of bytes InitGraf needs */ @@ -33,38 +34,29 @@ enum { grafSize = 206 }; /* number of bytes InitGraf needs */ #define hilite 50 -#define blackColor 33 -#define whiteColor 30 -#define redColor 205 -#define greenColor 341 -#define blueColor 409 -#define cyanColor 273 -#define magentaColor 137 -#define yellowColor 69 +enum { + blackColor = 33, + whiteColor = 30, + redColor = 205, + greenColor = 341, + blueColor = 409, + cyanColor = 273, + magentaColor = 137, + yellowColor = 69 +}; #define picLParen 0 #define picRParen 1 -typedef enum { bold=1, italic=2, underline=4, outline=8, - shadow=16, condense=32, extend=64 } StyleItem; - -#if 0 -/* - * The enum doesn't suffice since some compilers will complain if you - * try do bitwise arithmetic with the members of an enum - * - * Unfortunately, we can't do the #defines below because there are structures - * that have fields named "bold". - */ - -#define bold 1 -#define italic 2 -#define underline 4 -#define outline 8 -#define shadow 16 -#define condense 32 -#define extend 64 -#endif /* 0 */ +typedef enum { + bold = 1, + italic = 2, + underline = 4, + outline = 8, + shadow = 16, + condense = 32, + extend = 64 +} StyleItem; typedef SignedByte Style; @@ -683,5 +675,5 @@ extern pascal trap void C_IMVI_CopyDeepMask ( Rect *dstRect, INTEGER mode, RgnHandle maskRgn); - +} #endif /* _QUICKDRAW_H_ */ diff --git a/src/include/QuickTime.h b/src/include/QuickTime.h index 29acb350..cca09f46 100644 --- a/src/include/QuickTime.h +++ b/src/include/QuickTime.h @@ -12,6 +12,7 @@ #include "CQuickDraw.h" #include "FileMgr.h" +namespace Executor { typedef struct MovieRecord { LONGINT data[1]; @@ -52,4 +53,5 @@ extern pascal trap ComponentInstance C_NewMovieController (Movie movie, extern pascal trap void C_DisposeMovieController (ComponentInstance cntrller); extern pascal trap OSErr C_OpenMovieFile (const FSSpec *filespecp, INTEGER *refnump, uint8 perm); +} #endif diff --git a/src/include/ResourceMgr.h b/src/include/ResourceMgr.h index 66257787..e657aa57 100644 --- a/src/include/ResourceMgr.h +++ b/src/include/ResourceMgr.h @@ -9,7 +9,7 @@ * $Id: ResourceMgr.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { /* resource attribute masks */ #define resSysHeap 64 #define resPurgeable 32 @@ -56,9 +56,9 @@ extern Byte SysResName[20]; #define SysMapHndl (SysMapHndl_H.p) #define ResErrProc (ResErrProc_H.p) -extern BOOLEAN ROMlib_InstallxDEF( ProcPtr thedef, ResType typ, - INTEGER id ); -extern pascal trap void C_SetResLoad( BOOLEAN load ); extern pascal trap void P_SetResLoad( BOOLEAN load); +extern BOOLEAN ROMlib_InstallxDEF( ProcPtr thedef, ResType typ, + INTEGER id ); +extern pascal trap void C_SetResLoad( BOOLEAN load ); extern pascal trap void P_SetResLoad( BOOLEAN load); extern pascal trap INTEGER C_CountResources( ResType typ ); extern pascal trap INTEGER P_CountResources( ResType typ); extern pascal trap INTEGER C_Count1Resources( ResType typ ); extern pascal trap INTEGER P_Count1Resources( @@ -80,7 +80,7 @@ extern pascal trap void C_ReleaseResource( Handle res ); extern pascal trap void extern pascal trap void C_DetachResource( Handle res ); extern pascal trap void P_DetachResource( Handle res); extern pascal trap INTEGER C_UniqueID( ResType typ ); extern pascal trap INTEGER P_UniqueID( ResType typ); extern pascal trap INTEGER C_Unique1ID( ResType typ ); extern pascal trap INTEGER P_Unique1ID( ResType typ); -extern pascal trap void C_GetResInfo( Handle res, INTEGER *id, +extern pascal trap void C_GetResInfo( Handle res, INTEGER *id1, ResType *typ, StringPtr name ); extern pascal trap void P_GetResInfo( Handle res, INTEGER *id, ResType *typ, StringPtr name ); extern pascal trap INTEGER C_GetResAttrs( Handle res ); extern pascal trap INTEGER P_GetResAttrs( Handle res); @@ -131,5 +131,6 @@ extern pascal trap void C_WritePartialResource (Handle resource, extern pascal trap void C_SetResourceSize (Handle resource, int32 size); extern pascal Handle C_GetNextFOND (Handle fondHandle); +} #endif /* _RESOURCE_H_ */ diff --git a/src/include/SANE.h b/src/include/SANE.h index a81ddf94..63c8bf41 100644 --- a/src/include/SANE.h +++ b/src/include/SANE.h @@ -8,7 +8,7 @@ * $Id: SANE.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { /* Big-endian 64 bit "comp" data type. Note that this has a NaN value! */ typedef union { struct PACKED { @@ -283,4 +283,5 @@ extern pascal trap void C_ROMlib_Fgethv( LONGINT * hvp, unsigned short sel ); extern pascal trap void C_ROMlib_FnextX (uint8 *x, uint8 *y, unsigned short sel); #endif /* __STDC__ */ +} #endif diff --git a/src/include/ScrapMgr.h b/src/include/ScrapMgr.h index 284af1e9..f3d93578 100644 --- a/src/include/ScrapMgr.h +++ b/src/include/ScrapMgr.h @@ -13,6 +13,7 @@ #define noScrapErr (-100) #define noTypeErr (-102) +namespace Executor { typedef struct PACKED { LONGINT scrapSize; PACKED_MEMBER(Handle, scrapHandle); @@ -34,16 +35,7 @@ extern INTEGER ScrapState; #define ScrapHandle (ScrapHandle_H.p) #define ScrapName (ScrapName_H.p) -#if !defined (__STDC__) -extern PScrapStuff InfoScrap(); -extern LONGINT UnloadScrap(); -extern LONGINT LoadScrap(); -extern LONGINT ROMlib_ZeroScrap(); -extern LONGINT ZeroScrap(); -extern LONGINT PutScrap(); -extern LONGINT GetScrap(); -#else /* __STDC__ */ -extern pascal trap PScrapStuff C_InfoScrap( void ); extern pascal trap PScrapStuff P_InfoScrap( void ); +extern pascal trap PScrapStuff C_InfoScrap( void ); extern pascal trap PScrapStuff P_InfoScrap( void ); extern pascal trap LONGINT C_UnloadScrap( void ); extern pascal trap LONGINT P_UnloadScrap( void ); extern pascal trap LONGINT C_LoadScrap( void ); extern pascal trap LONGINT P_LoadScrap( void ); extern LONGINT ROMlib_ZeroScrap( void ); @@ -51,6 +43,6 @@ extern pascal trap LONGINT C_ZeroScrap( void ); extern pascal trap LONGINT P_Ze extern pascal trap LONGINT C_PutScrap( LONGINT len, ResType rest, Ptr p ); extern pascal trap LONGINT P_PutScrap( LONGINT len, ResType rest, Ptr p); extern pascal trap LONGINT C_GetScrap( Handle h, ResType rest, LONGINT *off ); extern pascal trap LONGINT P_GetScrap( Handle h, ResType rest, - LONGINT *off ); -#endif /* __STDC__ */ + LONGINT *off ); +} #endif /* __SCRAP__ */ diff --git a/src/include/ScriptMgr.h b/src/include/ScriptMgr.h index bf9a515d..1c51fe1e 100644 --- a/src/include/ScriptMgr.h +++ b/src/include/ScriptMgr.h @@ -11,6 +11,7 @@ #include "SANE.h" #include "IntlUtil.h" +namespace Executor { typedef INTEGER String2DateStatus; #define smRoman 0 @@ -345,5 +346,6 @@ extern INTEGER C_CharacterType (Ptr textbufp, INTEGER offset, extern INTEGER C_TransliterateText (Handle srch, Handle dsth, INTEGER target, LONGINT srcmask, ScriptCode script); +} #endif /* _SCRIPTMGR_H_ */ diff --git a/src/include/SegmentLdr.h b/src/include/SegmentLdr.h index 5367954a..54f19344 100644 --- a/src/include/SegmentLdr.h +++ b/src/include/SegmentLdr.h @@ -11,6 +11,7 @@ #include "rsys/noreturn.h" +namespace Executor { extern _NORET_1_ pascal trap void C_ExitToShell( void ) _NORET_2_; #if !defined (USE_WINDOWS_NOT_MAC_TYPEDEFS_AND_DEFINES) @@ -41,21 +42,23 @@ extern INTEGER CurPageOption; extern void flushcache (void); -extern trap void HWPriv( LONGINT d0, LONGINT a0 ); +extern trap void HWPriv( LONGINT d0, LONGINT a0 ); extern char *ROMlib_undotdot( char *origp ); extern void CountAppFiles( INTEGER *messagep, INTEGER *countp ); extern void GetAppFiles( INTEGER index, AppFile *filep ); extern void ClrAppFiles( INTEGER index ); -extern pascal trap void C_GetAppParms( StringPtr namep, - INTEGER *rnp, HIDDEN_Handle *aphandp ); extern pascal trap void P_GetAppParms( StringPtr namep, - INTEGER *rnp, HIDDEN_Handle *aphandp ); -extern pascal trap void P_ExitToShell( void ); extern pascal trap void Launch( StringPtr appl, INTEGER vrefnum ); extern pascal trap void Chain( StringPtr appl, INTEGER vrefnum ); + +extern pascal trap void C_GetAppParms( StringPtr namep, + INTEGER *rnp, HIDDEN_Handle *aphandp ); extern pascal trap void P_GetAppParms( StringPtr namep, + INTEGER *rnp, HIDDEN_Handle *aphandp ); +extern pascal trap void P_ExitToShell( void ); extern pascal trap void C_UnloadSeg( Ptr addr ); extern pascal trap void P_UnloadSeg( Ptr addr); extern pascal trap void C_LoadSeg( INTEGER volatile segno ); extern pascal trap void P_LoadSeg( INTEGER volatile segno); -extern pascal trap void C_UnloadSeg( Ptr addr ); extern pascal trap void P_UnloadSeg( Ptr addr); -#endif +extern pascal trap void C_UnloadSeg( Ptr addr ); extern pascal trap void P_UnloadSeg( Ptr addr); +#endif +} #endif /* __SEGMENT__ */ diff --git a/src/include/Serial.h b/src/include/Serial.h index df6204d5..cfb0a0b3 100644 --- a/src/include/Serial.h +++ b/src/include/Serial.h @@ -8,6 +8,7 @@ * $Id: Serial.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { #if defined (USE_WINDOWS_NOT_MAC_TYPEDEFS_AND_DEFINES) #define __Byte uint8 #define __SignedByte int8 @@ -126,5 +127,6 @@ extern __OSErr SerStatus( INTEGER rn, SerStaRec *serstap ); #undef __OSErr #undef __Ptr #endif +} #endif /* __SERIAL__ */ diff --git a/src/include/ShutDown.h b/src/include/ShutDown.h index d7a85ed7..e47285a7 100644 --- a/src/include/ShutDown.h +++ b/src/include/ShutDown.h @@ -1,6 +1,7 @@ /* shutdown manager define/routines */ +namespace Executor { #define sdOnPowerOff 1 #define sdOnRestart 2 #define sdOnUnmount 4 @@ -12,4 +13,4 @@ extern pascal trap void C_ShutDwnStart (void); extern pascal trap void C_ShutDwnInstall (ProcPtr shutdown_proc, int16 flags); extern pascal trap void C_ShutDwnRemove (ProcPtr shutdown_proc); - +} diff --git a/src/include/SoundDvr.h b/src/include/SoundDvr.h index e9997048..3e242595 100644 --- a/src/include/SoundDvr.h +++ b/src/include/SoundDvr.h @@ -8,7 +8,7 @@ * $Id: SoundDvr.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { #define swMode (-1) #define ftMode 1 #define ffMode 0 @@ -76,5 +76,6 @@ extern INTEGER CurPitch; #endif #define SoundBase (SoundBase_H.p) +} #endif /* __SOUND__ */ diff --git a/src/include/SoundMgr.h b/src/include/SoundMgr.h index af10d1e0..79f3d4ef 100644 --- a/src/include/SoundMgr.h +++ b/src/include/SoundMgr.h @@ -10,6 +10,7 @@ #include "QuickDraw.h" +namespace Executor { typedef struct PACKED { INTEGER cmd; INTEGER param1; @@ -365,4 +366,5 @@ extern long C_DirectorUnknown3 (void); extern INTEGER C_DirectorUnknown4 (ResType, INTEGER, Ptr, Ptr); #endif /* __STDC__ */ +} #endif /* __SOUNDMGR__ */ diff --git a/src/include/StartMgr.h b/src/include/StartMgr.h index 63dafac8..1c053b2f 100644 --- a/src/include/StartMgr.h +++ b/src/include/StartMgr.h @@ -9,6 +9,7 @@ */ +namespace Executor { typedef union { struct { SignedByte sdExtDevID; @@ -37,5 +38,6 @@ typedef struct { #if !defined (CPUFlag) extern Byte CPUFlag; #endif +} #endif diff --git a/src/include/StdFilePkg.h b/src/include/StdFilePkg.h index 2a667226..03fe9b32 100644 --- a/src/include/StdFilePkg.h +++ b/src/include/StdFilePkg.h @@ -11,6 +11,7 @@ * $Id: StdFilePkg.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { #define putDlgID (-3999) #define putSave 1 @@ -149,6 +150,6 @@ extern pascal trap void C_CustomGetFile (FileFilterYDProcPtr filefilter, UNIV Ptr yourdatap); #endif /* __STDC__ */ - +} #endif /* __STDFILE__ */ diff --git a/src/include/SysErr.h b/src/include/SysErr.h index 0229c298..371d9bea 100644 --- a/src/include/SysErr.h +++ b/src/include/SysErr.h @@ -8,6 +8,7 @@ * $Id: SysErr.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { typedef enum { EXIST_YES = 0, EXIST_NO = 0xFF } exist_enum_t; #if !defined (DSAlertTab_H) @@ -22,5 +23,6 @@ extern Byte QDExist; extern char syserr_msg[]; extern pascal void C_SysError (short errorcode); +} #endif /* !_SYSERR_H_ */ diff --git a/src/include/TextEdit.h b/src/include/TextEdit.h index 09f8c138..7912f6f0 100644 --- a/src/include/TextEdit.h +++ b/src/include/TextEdit.h @@ -10,6 +10,7 @@ #include "QuickDraw.h" +namespace Executor { /* new justification defines, accepted by `TESetAlignment ()' and `TETextBox ()' */ #define teFlushDefault 0 @@ -503,7 +504,8 @@ extern INTEGER TEScrpLength; #define TEDoText (TEDoText_H.p) #define TEScrpHandle (TEScrpHandle_H.p) -extern pascal trap void C_TESetText( Ptr p, LONGINT ln, TEHandle teh ); extern pascal trap void P_TESetText( Ptr p, LONGINT ln, TEHandle teh); + +extern pascal trap void C_TESetText( Ptr p, LONGINT ln, TEHandle teh ); extern pascal trap void P_TESetText( Ptr p, LONGINT ln, TEHandle teh); extern pascal trap CharsHandle C_TEGetText( TEHandle teh ); extern pascal trap CharsHandle P_TEGetText( TEHandle teh); extern pascal trap void C_TESetJust( INTEGER j, TEHandle teh ); extern pascal trap void P_TESetJust( INTEGER j, TEHandle teh); extern pascal trap void C_TEUpdate( Rect *r, TEHandle teh ); extern pascal trap void P_TEUpdate( Rect *r, TEHandle teh); @@ -581,8 +583,7 @@ extern OSErr TEToScrap( void ); extern Handle TEScrapHandle( void ); extern LONGINT TEGetScrapLen( void ); extern void TESetScrapLen( LONGINT ln ); - extern pascal trap int16 C_TEFeatureFlag (int16 feature, int16 action, TEHandle te); - +} #endif /* _TEXTEDIT_H_ */ diff --git a/src/include/ThinkC.h b/src/include/ThinkC.h index a23a5645..a9ba0b4e 100644 --- a/src/include/ThinkC.h +++ b/src/include/ThinkC.h @@ -7,7 +7,7 @@ * $Id: ThinkC.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { #if !defined (__STDC__) extern void CDebugStr(); #else /* __STDC__ */ @@ -24,4 +24,5 @@ extern StringPtr CtoPstr( char *str ); extern char *PtoCstr( StringPtr str ); extern pascal trap void C_DebugStr( StringPtr p ); extern pascal trap void P_DebugStr( StringPtr p); #endif /* __STDC__ */ +} #endif /* __THINKCDOTH__ */ diff --git a/src/include/TimeMgr.h b/src/include/TimeMgr.h index 7f4cf568..b30d4e9a 100644 --- a/src/include/TimeMgr.h +++ b/src/include/TimeMgr.h @@ -8,7 +8,7 @@ * $Id: TimeMgr.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { typedef struct PACKED { PACKED_MEMBER(QElemPtr, qLink); INTEGER qType; @@ -27,4 +27,5 @@ extern void InsTime( QElemPtr taskp ); extern void RmvTime( QElemPtr taskp ); extern void PrimeTime( QElemPtr taskp, LONGINT count ); #endif /* __STDC__ */ +} #endif /* __TIMEMGR__ */ diff --git a/src/include/ToolboxEvent.h b/src/include/ToolboxEvent.h index d740433d..27038b5a 100644 --- a/src/include/ToolboxEvent.h +++ b/src/include/ToolboxEvent.h @@ -10,7 +10,7 @@ #include "EventMgr.h" - +namespace Executor { #if !defined (KeyThresh) extern INTEGER KeyThresh; extern INTEGER KeyRepThresh; @@ -54,4 +54,5 @@ extern pascal trap LONGINT C_TickCount( void ); extern pascal trap LONGINT P_Ti extern LONGINT GetDblTime( void ); extern LONGINT GetCaretTime( void ); #endif /* __STDC__ */ +} #endif /* __TOOLEVENT__ */ diff --git a/src/include/ToolboxUtil.h b/src/include/ToolboxUtil.h index 7c25c74f..f8bd6e2c 100644 --- a/src/include/ToolboxUtil.h +++ b/src/include/ToolboxUtil.h @@ -11,6 +11,7 @@ #include "QuickDraw.h" #include "SANE.h" +namespace Executor { #define sysPatListID 0 #define iBeamCursor 1 @@ -85,5 +86,6 @@ extern pascal trap void C_R_Fix2X( Fixed x, extended80 *ret ); extern pascal trap void C_R_Frac2X( Fract x, extended80 *ret ); extern pascal trap Fixed C_R_X2Fix( extended80 *x ); extern pascal trap Fract C_R_X2Frac( extended80 *x ); +} #endif /* _TOOLBOX_UTIL_H_ */ diff --git a/src/include/VDriver.h b/src/include/VDriver.h index 1e80d4f3..22268b28 100644 --- a/src/include/VDriver.h +++ b/src/include/VDriver.h @@ -10,6 +10,7 @@ #include "FileMgr.h" +namespace Executor { typedef struct PACKED { COMMONFSQUEUEDEFS; @@ -64,6 +65,6 @@ typedef struct PACKED } VDDefModeRec; typedef VDDefModeRec *VDDefModePtr; - +} #endif /* !__VDRIVER__ */ diff --git a/src/include/VRetraceMgr.h b/src/include/VRetraceMgr.h index 9f0f5670..eefc02db 100644 --- a/src/include/VRetraceMgr.h +++ b/src/include/VRetraceMgr.h @@ -8,6 +8,8 @@ * $Id: VRetraceMgr.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { + #define qErr (-1) #define vTypErr (-2) @@ -30,5 +32,5 @@ extern trap OSErrRET VRemove( VBLTaskPtr vtaskp ); extern QHdrPtr GetVBLQHdr( void ); extern trap OSErrRET SlotVInstall( VBLTaskPtr vtaskp, INTEGER slot ); extern trap OSErrRET SlotVRemove( VBLTaskPtr vtaskp, INTEGER slot ); - +} #endif /* __VRETRACE__ */ diff --git a/src/include/WindowMgr.h b/src/include/WindowMgr.h index 1d5a7550..055033bb 100644 --- a/src/include/WindowMgr.h +++ b/src/include/WindowMgr.h @@ -11,6 +11,7 @@ #include "QuickDraw.h" #include "EventMgr.h" +namespace Executor { #define documentProc 0 #define dBoxProc 1 #define plainDBox 2 @@ -75,9 +76,9 @@ typedef CGrafPtr CWindowPtr; typedef struct __wr WindowRecord; typedef WindowRecord *WindowPeek; MAKE_HIDDEN(WindowPeek); - +} #include "ControlMgr.h" - +namespace Executor { struct PACKED __wr { GrafPort port; INTEGER windowKind; @@ -160,55 +161,6 @@ extern Pattern DeskPattern; #define AuxWinHead (AuxWinHead_H.p) #define DeskCPat (DeskCPat_H.p) -#if !defined (__STDC__) -extern void SetWTitle(); -extern void GetWTitle(); -extern WindowPtr FrontWindow(); -extern void HiliteWindow(); -extern void BringToFront(); -extern void SelectWindow(); -extern void ShowHide(); -extern void HideWindow(); -extern void ShowWindow(); -extern void SendBehind(); -extern void DrawGrowIcon(); -extern void InitWindows(); -extern void GetWMgrPort(); -extern WindowPtr NewWindow(); -extern WindowPtr GetNewWindow(); -extern void CloseWindow(); -extern void DisposeWindow(); -extern void SetWRefCon(); -extern LONGINT GetWRefCon(); -extern void SetWindowPic(); -extern PicHandle GetWindowPic(); -extern LONGINT PinRect(); -extern LONGINT DragTheRgn(); -extern LONGINT DragGrayRgn(); -extern void ClipAbove(); -extern BOOLEAN CheckUpdate(); -extern void SaveOld(); -extern void PaintOne(); -extern void PaintBehind(); -extern void CalcVis(); -extern void CalcVisBehind(); -extern void DrawNew(); -extern INTEGER GetWVariant(); -extern INTEGER FindWindow(); -extern BOOLEAN TrackBox(); -extern BOOLEAN TrackGoAway(); -extern void ZoomWindow(); -extern void MoveWindow(); -extern void DragWindow(); -extern LONGINT GrowWindow(); -extern void SizeWindow(); -extern void InvalRect(); -extern void InvalRgn(); -extern void ValidRect(); -extern void ValidRgn(); -extern void BeginUpdate(); -extern void EndUpdate(); -#else /* __STDC__ */ extern pascal trap void C_SetWTitle( WindowPtr w, StringPtr t ); extern pascal trap void P_SetWTitle( WindowPtr w, StringPtr t); extern pascal trap void C_GetWTitle( WindowPtr w, StringPtr t ); extern pascal trap void P_GetWTitle( WindowPtr w, StringPtr t); extern pascal trap WindowPtr C_FrontWindow( void ); extern pascal trap WindowPtr P_FrontWindow( void ); @@ -281,5 +233,5 @@ extern pascal trap void C_EndUpdate( WindowPtr w ); extern pascal trap void P_En extern pascal trap void C_SetWinColor (WindowPtr w, CTabHandle new_w_ctab); extern pascal trap void C_SetDeskCPat( PixPatHandle ); extern pascal trap void P_SetDeskCPat( PixPatHandle ); -#endif /* __STDC__ */ +} #endif /* __WINDOW__ */ diff --git a/src/include/paramline.h b/src/include/paramline.h index d677cb56..cf59d084 100644 --- a/src/include/paramline.h +++ b/src/include/paramline.h @@ -1,10 +1,18 @@ #if !defined (__PARAMLINE_H__) #define __PARAMLINE_H__ +#ifdef __cplusplus +extern "C" { +#endif + extern int count_params (const char *p, int n); extern char *get_param (const char **bufpp, int *nleftp); extern void paramline_to_argcv (const char *cmdp, int *argcp, char ***argvp); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/include/rsys/CFriendly.h b/src/include/rsys/CFriendly.h new file mode 100644 index 00000000..fa2980bb --- /dev/null +++ b/src/include/rsys/CFriendly.h @@ -0,0 +1,28 @@ +// +// CFriendly.h +// CocoaExecutor +// +// Created by C.W. Betts on 7/30/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#ifndef CocoaExecutor_CFriendly_h +#define CocoaExecutor_CFriendly_h + +#define getthecrc CB_getthecrc +short CB_getthecrc(ResType typ, long id1); +#define ROMlib_version_long CGet_ROMlib_version_long() +long CGet_ROMlib_version_long(); +uint32 ROMlib_PrDrvrVers_Set(uint32); +#define CREATE_SYSTEM_VERSION(a, b, c) \ +((((a) & 0xF) << 8) | (((b) & 0xF) << 4) | ((c) & 0xF)) +#define ROMlib_delay CGet_ROMlib_delay() +int CGet_ROMlib_delay(); +#define ROMlib_delayp CGet_ROMlib_delayp() +int *CGet_ROMlib_delayp(); +#define ROMlib_refreshp CGet_ROMlib_refreshp() +int *CGet_ROMlib_refreshp(); +#define ROMlib_add_to_gestalt_list CB_ROMlib_add_to_gestalt_list +void CB_ROMlib_add_to_gestalt_list(OSType selector, OSErr retval, uint32 new_value); + +#endif diff --git a/src/include/rsys/Info.plist b/src/include/rsys/Info.plist new file mode 100644 index 00000000..6ac80163 --- /dev/null +++ b/src/include/rsys/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.github.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSHumanReadableCopyright + Copyright © 2014 C.W. Betts. All rights reserved. + NSPrincipalClass + + + diff --git a/src/include/rsys/PSstrings.h b/src/include/rsys/PSstrings.h index 3ed18d3a..1dbdfbc6 100644 --- a/src/include/rsys/PSstrings.h +++ b/src/include/rsys/PSstrings.h @@ -1,11 +1,11 @@ #if !defined(__rsys_PSstrings__) #define __rsys_PSstrings__ - +namespace Executor { extern const char ROMlib_doc_begin[]; extern const char ROMlib_doc_prolog[]; extern const char ROMlib_doc_end_prolog[]; extern const char ROMlib_doc_end[]; extern const char ROMlib_page_begin[]; extern const char ROMlib_page_end[]; - +} #endif /* !defined(__rsys_PSstrings__) */ diff --git a/src/include/rsys/Xdefs.h b/src/include/rsys/Xdefs.h index 13a0c511..bef32f83 100644 --- a/src/include/rsys/Xdefs.h +++ b/src/include/rsys/Xdefs.h @@ -32,41 +32,6 @@ #define Bool LONGINT #endif /* BINCOMPAT */ -#if !defined (__STDC__) - -extern int XAutoRepeatOff(); -extern int XAutoRepeatOn(); -extern int XBell(); -extern int XChangeProperty(); -extern int XChangeWindowAttributes(); -extern Bool XCheckTypedEvent(); -extern Bool XCheckWindowEvent(); -extern int XClearWindow(); -extern int XConvertSelection(); -extern int XDefineCursor(); -extern int XFree(); -extern int XFreeCursor(); -extern int XFreeGC(); -extern int XFreePixmap(); -extern int XGeometry(); -extern Status XGetGeometry(); -extern Window XGetSelectionOwner(); -extern int XGetWindowProperty(); -extern Atom XInternAtom(); -extern int XMapWindow(); -extern int XNextEvent(); -extern int XPutImage(); -extern Bool XQueryPointer(); -extern int XSelectInput(); -extern Status XSendEvent(); -extern int XSetSelectionOwner(); -extern int XSetStandardProperties(); -extern int XSetWMHints(); -extern int XSync(); -extern int XWarpPointer(); - -#else /* __STDC__ */ - #if !defined (NEXT) extern LONGINT XAutoRepeatOff( Display *dp ); @@ -182,8 +147,6 @@ extern LONGINT XWarpPointer( Display *dp, Window srcw, Window dstw, LONGINT srcx #endif /* NEXT */ -#endif /* __STDC__ */ - #endif /* !defined(__alpha) */ #if defined (BINCOMPAT) diff --git a/src/include/rsys/aboutbox.h b/src/include/rsys/aboutbox.h index fcf8ed6d..dcdf4efd 100644 --- a/src/include/rsys/aboutbox.h +++ b/src/include/rsys/aboutbox.h @@ -1,7 +1,8 @@ #if !defined (_RSYS_ABOUTBOX_H_) #define _RSYS_ABOUTBOX_H_ +namespace Executor { extern StringPtr about_box_menu_name_pstr; extern void do_about_box (void); - +} #endif /* !_RSYS_ABOUTBOX_H_ */ diff --git a/src/include/rsys/aboutpanel.h b/src/include/rsys/aboutpanel.h index 7985c44c..e26d92db 100644 --- a/src/include/rsys/aboutpanel.h +++ b/src/include/rsys/aboutpanel.h @@ -1,8 +1,8 @@ #if !defined(__RSYS_ABOUTPANEL__) #define __RSYS_ABOUTPANEL__ - +namespace Executor { extern void ROMlib_circledefault(DialogPtr dp); #define ABOUTOKITEM 1 - +} #endif /* !defined(__RSYS_ABOUTPANEL__) */ diff --git a/src/include/rsys/adb.h b/src/include/rsys/adb.h index 4aedd670..71aa2469 100644 --- a/src/include/rsys/adb.h +++ b/src/include/rsys/adb.h @@ -8,10 +8,9 @@ * $Id: adb.h 63 2004-12-24 18:19:43Z ctm $ */ -#include "ADB.h" - +namespace Executor { extern void C_adb_service_stub (void); extern void adb_apeiron_hack (boolean_t deltas_p, ...); extern void reset_adb_vector (void); - +} #endif diff --git a/src/include/rsys/alias.h b/src/include/rsys/alias.h index 17b4a8e5..8268cae1 100644 --- a/src/include/rsys/alias.h +++ b/src/include/rsys/alias.h @@ -1,6 +1,7 @@ #if !defined (__rsys_alias_h__) # define __rsys_alias_h__ +namespace Executor { typedef unsigned char Str27[28]; typedef struct PACKED @@ -71,6 +72,6 @@ typedef struct PACKED PACKED_MEMBER(alias_tail_ptr, tailp); } alias_parsed_t; - +} #endif /* !defined (__rsys_alias_h__) */ diff --git a/src/include/rsys/appearance.h b/src/include/rsys/appearance.h index 9021d250..4239a5f5 100644 --- a/src/include/rsys/appearance.h +++ b/src/include/rsys/appearance.h @@ -13,16 +13,15 @@ this is just a hack to make it so that end-users can ask for a different set of WDEFs, CDEFs, etc. at run time */ - +namespace Executor { typedef enum { appearance_sys7, appearance_win3, -} -appearance_t; +} appearance_t; extern void ROMlib_set_appearance (void); extern boolean_t ROMlib_parse_appearance (const char *appearance_str); extern appearance_t ROMlib_get_appearance (void); - +} #endif diff --git a/src/include/rsys/apple_events.h b/src/include/rsys/apple_events.h index 9c05cb1e..b6355280 100644 --- a/src/include/rsys/apple_events.h +++ b/src/include/rsys/apple_events.h @@ -1,6 +1,6 @@ #if !defined (__rsys_apple_events_h__) # define __rsys_apple_events_h__ - +namespace Executor { /* #### internal */ typedef struct PACKED @@ -108,5 +108,5 @@ typedef struct subdesc_info boolean_t key_p; int inline_desc_header_size; } subdesc_info_t; - +} #endif /* !defined (__rsys_apple_events_h__) */ diff --git a/src/include/rsys/arch.h b/src/include/rsys/arch.h index d3e80d8e..0fa418ef 100644 --- a/src/include/rsys/arch.h +++ b/src/include/rsys/arch.h @@ -8,6 +8,7 @@ * $Id: arch.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { extern boolean_t arch_init (void); - +} #endif /* !_RSYS_ARCH_H_ */ diff --git a/src/include/rsys/autorefresh.h b/src/include/rsys/autorefresh.h index b3f1c633..cfbf2ebc 100644 --- a/src/include/rsys/autorefresh.h +++ b/src/include/rsys/autorefresh.h @@ -1,6 +1,7 @@ #if !defined (_RSYS_SCREENCHECKSUM_H_) #define _RSYS_SCREENCHECKSUM_H_ +namespace Executor { /* Milliseconds between checks for refresh mode. */ #define AUTOREFRESH_CHECK_MSECS 1000 @@ -9,5 +10,5 @@ extern boolean_t do_autorefresh_p; extern void note_executor_changed_screen (int top, int bottom); extern boolean_t autodetect_refresh (void); - +} #endif /* !_RSYS_SCREENCHECKSUM_H_ */ diff --git a/src/include/rsys/blockdev.h b/src/include/rsys/blockdev.h index 5811b75f..0fe9c13e 100644 --- a/src/include/rsys/blockdev.h +++ b/src/include/rsys/blockdev.h @@ -1,6 +1,6 @@ #if !defined (_RSYS_BLOCKDEV_H_) #define _RSYS_BLOCKDEV_H_ - +namespace Executor { typedef struct _blockdev_t { uint32 block_size; @@ -34,5 +34,5 @@ extern boolean_t blockdev_write (blockdev_t *b, uint32 offset, const void *buf, uint32 num_bytes); extern boolean_t blockdev_seek_set (blockdev_t *b, uint32 offset); extern void blockdev_close (blockdev_t *b); - +} #endif /* !_RSYS_BLOCKDEV_H_ */ diff --git a/src/include/rsys/blockinterrupts.h b/src/include/rsys/blockinterrupts.h index a3e3eabe..b3eda833 100644 --- a/src/include/rsys/blockinterrupts.h +++ b/src/include/rsys/blockinterrupts.h @@ -10,21 +10,13 @@ #include "rsys/time.h" +namespace Executor { typedef uint32 real_int_state_t; -#if defined (MSDOS) -# include - -# define block_real_ints() \ - ((real_int_state_t) __dpmi_get_and_disable_virtual_interrupt_state ()) -# define restore_real_ints(n) \ - ((void) __dpmi_get_and_set_virtual_interrupt_state (n)) -#else # define block_real_ints() \ ((real_int_state_t) sigblock (sigmask (SIGALRM))) # define restore_real_ints(n) \ ((void) sigsetmask (n)) -#endif #if defined (SYN68K) @@ -72,10 +64,6 @@ typedef real_int_state_t virtual_int_state_t; #if defined (SYN68K) -#if defined (MSDOS) -#include "dosevq.h" -#endif - extern void do_virtual_interrupt (void); #define check_virtual_interrupt() \ do \ @@ -105,5 +93,6 @@ do { \ { body } \ restore_real_ints (__rstate); \ } while (0) +} #endif /* !_BLOCKINTERRUPTS_H_ */ diff --git a/src/include/rsys/byteswap.h b/src/include/rsys/byteswap.h index ae97ba9d..e444c4ad 100644 --- a/src/include/rsys/byteswap.h +++ b/src/include/rsys/byteswap.h @@ -24,15 +24,15 @@ * #define RM(rhs) (rhs) / * ROMlib to Mac * / */ -#define MR(n) ((typeof (n))({ typeof (n) _t = n; _t ? ((((unsigned long) (_t))) + ROMlib_offset) : 0;})) -#define RM(n) ((typeof (n))({ typeof (n) _t = n; _t ? ((((unsigned long) (_t)- ROMlib_offset)) ) : 0;})) +#define MR(n) ((typeof (n))({ typeof (n) _t = n; _t ? ((((unsigned int) (_t))) + ROMlib_offset) : 0;})) +#define RM(n) ((typeof (n))({ typeof (n) _t = n; _t ? ((((unsigned int) (_t)- ROMlib_offset)) ) : 0;})) #define CLC_NULL NULL #else /* !defined (BIGENDIAN) */ #define CW(n) ((typeof (n)) (long) swap16 ((unsigned short) (long) (n))) -#define CL(n) ((typeof (n)) swap32 ((unsigned long) ((n)|0))) +#define CL(n) ((typeof (n)) swap32 ((unsigned int) ((n)|0))) #if 0 #define MR(n) ((typeof (n))(n ? ((swap32 ((unsigned long) (n))) + ROMlib_offset) : 0)) @@ -41,7 +41,7 @@ #if (SIZEOF_CHAR_P == 4) && !FORCE_EXPERIMENTAL_PACKED_MACROS -# define MR(n) ((typeof (n))({ typeof (n) _t = n; _t ? ((swap32 ((unsigned long) (_t))) + ROMlib_offset) : 0;})) +# define MR(n) ((typeof (n))({ typeof (n) _t = n; _t ? ((swap32 ((unsigned int) (_t))) + ROMlib_offset) : 0;})) #else @@ -65,10 +65,10 @@ #define CWC(n) ((typeof (n)) (signed short) ((((n) << 8) & 0xFF00) \ | (((n) >> 8) & 0x00FF))) -#define CLC(n) ((typeof (n)) (long) ( (((long) ((n)|0) & 0x000000FF) << 24) \ - | (((long) (n) & 0x0000FF00) << 8) \ - | (((long) (n) & 0x00FF0000) >> 8) \ - | (((unsigned long) (n) & 0xFF000000) \ +#define CLC(n) ((typeof (n)) (int) ( (((int) ((n)|0) & 0x000000FF) << 24) \ + | (((int) (n) & 0x0000FF00) << 8) \ + | (((int) (n) & 0x00FF0000) >> 8) \ + | (((unsigned int) (n) & 0xFF000000) \ >> 24))) #define CLC_NULL NULL diff --git a/src/include/rsys/cfm.h b/src/include/rsys/cfm.h index 681da61e..53f53c8b 100644 --- a/src/include/rsys/cfm.h +++ b/src/include/rsys/cfm.h @@ -10,6 +10,7 @@ * $Id: cfm.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { enum { kUnresolvedCFragSymbolAddress = 0 @@ -264,5 +265,6 @@ extern OSErr C_GetIndSymbol (ConnectionID id, LONGINT index, extern ConnectionID ROMlib_new_connection (uint32 n_sects); extern void ROMlib_release_tracking_values (void); +} #endif diff --git a/src/include/rsys/check_structs.h b/src/include/rsys/check_structs.h index cf5ab0af..4cf04579 100644 --- a/src/include/rsys/check_structs.h +++ b/src/include/rsys/check_structs.h @@ -1,6 +1,7 @@ #if !defined(__rsys_check_structs_h__) #define __rsys_check_structs_h__ +namespace Executor { extern void check_structs(void); - +} #endif diff --git a/src/include/rsys/checkpoint.h b/src/include/rsys/checkpoint.h index 9c610baa..1c865a04 100644 --- a/src/include/rsys/checkpoint.h +++ b/src/include/rsys/checkpoint.h @@ -9,7 +9,7 @@ */ #define CHECKPOINT_FILE "failure.txt" - +namespace Executor { typedef struct { boolean_t sound_fails; @@ -36,5 +36,5 @@ extern void checkpoint_macdrive (checkpoint_t *cp, checkpoint_option option, extern void checkpoint_dosdrives (checkpoint_t *cp, checkpoint_option option, uint32 drive); extern void disable_checkpointing (void); - +} #endif diff --git a/src/include/rsys/color_wheel_bits.h b/src/include/rsys/color_wheel_bits.h index 7ff21bdf..e61b120e 100644 --- a/src/include/rsys/color_wheel_bits.h +++ b/src/include/rsys/color_wheel_bits.h @@ -8,7 +8,8 @@ * $Id: color_wheel_bits.h 63 2004-12-24 18:19:43Z ctm $ */ -extern char color_wheel_bits_8[]; -extern char color_wheel_bits_4[]; - +namespace Executor { +const extern unsigned char color_wheel_bits_8[]; +const extern unsigned char color_wheel_bits_4[]; +} #endif diff --git a/src/include/rsys/common.h b/src/include/rsys/common.h index e28513de..c69896c1 100644 --- a/src/include/rsys/common.h +++ b/src/include/rsys/common.h @@ -27,7 +27,7 @@ #undef USE_WINDOWS_NOT_MAC_TYPEDEFS_AND_DEFINES #endif -#if !defined (LINUX) && !defined (MSDOS) && !defined (NEXT) && !defined(CYGWIN32) && !defined (MACOSX) +#if !defined (LINUX) && !defined (MSDOS) && !defined (NEXT) && !defined(CYGWIN32) && !defined (MACOSX_) # error "Unsupported host" #endif @@ -51,6 +51,9 @@ #include "front-end-config.h" #endif +#ifdef __cplusplus +namespace Executor { +#endif typedef struct { } @@ -67,5 +70,7 @@ extern boolean_t host_spfcommon (host_spf_reply_block *replyp, sf_flavor_t flavor, void *activeList, void *activateproc, void *yourdatap); - +#ifdef __cplusplus +} +#endif #endif /* !_COMMON_H_ */ diff --git a/src/include/rsys/commonevt.h b/src/include/rsys/commonevt.h index 61f4cbd9..45fbd8fb 100644 --- a/src/include/rsys/commonevt.h +++ b/src/include/rsys/commonevt.h @@ -8,6 +8,7 @@ * X have their own idea of what the type "Cursor" should be. */ +namespace Executor { typedef struct { enum { commonkeypress, commonkeyrelease, commonbuttonpress, commonbuttonrelease, commonexpose, commonenternotify, @@ -28,5 +29,5 @@ typedef struct { #define commonbutton1 1 #define commonbutton2 2 #define commonbutton3 3 - +} #endif /* !_COMMONEVT_H_ */ diff --git a/src/include/rsys/cquick.h b/src/include/rsys/cquick.h index 67d0d058..846a6c54 100644 --- a/src/include/rsys/cquick.h +++ b/src/include/rsys/cquick.h @@ -4,7 +4,7 @@ #include "CQuickDraw.h" #include "rsys/rgbutil.h" - +namespace Executor { #define SET_HILITE_BIT() \ (BitSet ((Ptr) &HiliteMode, pHiliteBit)) @@ -750,5 +750,5 @@ extern Handle ROMlib_copy_handle (Handle); SetGDevice (TheGDevice_new); \ body \ SetGDevice (TheGDevice_save); } while (0) - +} #endif /* _CQUICK_H_ */ diff --git a/src/include/rsys/crc.h b/src/include/rsys/crc.h index 23717aa9..f521cc6e 100644 --- a/src/include/rsys/crc.h +++ b/src/include/rsys/crc.h @@ -8,7 +8,8 @@ * $Id: crc.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { extern short getthecrc(ResType type, long id); extern unsigned short ROMlib_crcccitt(unsigned char *data, long length); - +} #endif /* _RSYS_CRC_H_ */ diff --git a/src/include/rsys/ctl.h b/src/include/rsys/ctl.h index d1cea5cf..f9468b59 100644 --- a/src/include/rsys/ctl.h +++ b/src/include/rsys/ctl.h @@ -17,6 +17,7 @@ #include "rsys/cquick.h" #include "rsys/pstuff.h" +namespace Executor { extern const ColorSpec default_ctl_colors[]; extern CTabHandle default_ctl_ctab; extern AuxCtlHandle default_aux_ctl; @@ -153,4 +154,5 @@ extern void C_new_draw_scroll (INTEGER depth, INTEGER flags, GDHandle target, extern void C_new_pos_ctl (INTEGER depth, INTEGER flags, GDHandle target, LONGINT l); +} #endif /* !_CTL_H_ */ diff --git a/src/include/rsys/custom.h b/src/include/rsys/custom.h index 8c91ae9e..35b5f122 100644 --- a/src/include/rsys/custom.h +++ b/src/include/rsys/custom.h @@ -12,6 +12,10 @@ * misc. quantities needed by both Executor and the customization tool. */ +#ifdef __cplusplus +extern "C" { +#endif + enum { CUSTOM_BLOCK_SIZE = 393216, }; /* enough room for splash screen and license */ @@ -99,5 +103,8 @@ extern custom_chars_t *ROMlib_default_appp; extern custom_val_t *ROMlib_days_of_demop; extern void ROMlib_do_custom (void); +#ifdef __cplusplus +} +#endif #endif diff --git a/src/include/rsys/dcache.h b/src/include/rsys/dcache.h index cc01a7e7..c07834fe 100644 --- a/src/include/rsys/dcache.h +++ b/src/include/rsys/dcache.h @@ -1,6 +1,6 @@ #if !defined (_RSYS_DCACHE_H_) #define _RSYS_DCACHE_H_ - +namespace Executor { typedef uint32 (*write_callback_funcp_t) (uint32 fd, const void *buf, uint32 offset, uint32 count); @@ -10,13 +10,13 @@ typedef uint32 (*read_callback_funcp_t) (uint32 fd, void *buf, extern boolean_t dcache_set_enabled (boolean_t enabled_p); extern uint32 dcache_read (uint32 fd, void *buf, uint32 offset, uint32 count, - read_callback_funcp_t read_callback); + read_callback_funcp_t read_callback = NULL); extern uint32 dcache_write (uint32 fd, const void *buf, uint32 offset, - uint32 count, write_callback_funcp_t write_callback); + uint32 count, write_callback_funcp_t write_callback = NULL); -extern boolean_t dcache_invalidate (uint32 fd, boolean_t flush_p); +extern boolean_t dcache_invalidate (uint32 fd, boolean_t flush_p = FALSE); extern boolean_t dcache_flush (uint32 fd); -extern boolean_t dcache_invalidate_all (boolean_t flush_p); - +extern boolean_t dcache_invalidate_all (boolean_t flush_p = FALSE); +} #endif /* !_RSYS_DCACHE_H_ */ diff --git a/src/include/rsys/depthconv.h b/src/include/rsys/depthconv.h index 60ca2071..8ee59f16 100644 --- a/src/include/rsys/depthconv.h +++ b/src/include/rsys/depthconv.h @@ -4,7 +4,7 @@ #include "rsys/rgbutil.h" #include "CQuickDraw.h" - +namespace Executor { /* Public API */ typedef void (*depthconv_func_t) (const void *table, const uint8 *src_base, int src_row_bytes, @@ -125,6 +125,6 @@ DEPTHCONV_DECL (depthconv_32_16); DEPTHCONV_DECL (depthconv_32_32); #undef DEPTHCONV_DECL - +} #endif /* !_DEPTHCONV_H_ */ diff --git a/src/include/rsys/desk.h b/src/include/rsys/desk.h index a57bde37..9dca068b 100644 --- a/src/include/rsys/desk.h +++ b/src/include/rsys/desk.h @@ -1,5 +1,5 @@ #if !defined(_RSYS_DESK_H_) -#define _RSYS_DESK_H__ +#define _RSYS_DESK_H_ /* * Copyright 1995 by Abacus Research and Development, Inc. @@ -7,7 +7,7 @@ * * $Id: desk.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { enum { DESK_ACC_MIN = 12, DESK_ACC_MAX = 31 }; - +} #endif diff --git a/src/include/rsys/desperate.h b/src/include/rsys/desperate.h index 759dc890..49abb137 100644 --- a/src/include/rsys/desperate.h +++ b/src/include/rsys/desperate.h @@ -1,6 +1,6 @@ #if !defined (_RSYS_DESPERATE_H_) #define _RSYS_DESPERATE_H_ - +namespace Executor { extern boolean_t handle_desperate_switch (int *argcp, char ***argvp); - +} #endif /* _RSYS_DESPERATE_H_ */ diff --git a/src/include/rsys/dial.h b/src/include/rsys/dial.h index b4590023..95c93b76 100644 --- a/src/include/rsys/dial.h +++ b/src/include/rsys/dial.h @@ -1,6 +1,6 @@ #if !defined (__rsys_dial_h__) # define __rsys_dial_h__ - +namespace Executor { typedef struct PACKED { int16 count; @@ -10,5 +10,5 @@ typedef struct PACKED uint8 len; int16 res_id; } icon_item_template_t; - +} #endif /* !defined (__rsys_dial_h__) */ diff --git a/src/include/rsys/dirtyrect.h b/src/include/rsys/dirtyrect.h index 7f2e28ef..20cc3b35 100644 --- a/src/include/rsys/dirtyrect.h +++ b/src/include/rsys/dirtyrect.h @@ -2,12 +2,13 @@ #define _DIRTYRECT_H_ #include "host_bltmacros.h" - +namespace Executor { extern void dirty_rect_accrue (int top, int left, int bottom, int right); extern void dirty_rect_update_screen (void); extern boolean_t dirty_rect_subsumed_p (int top, int left, int bottom, int right); extern int num_dirty_rects; +} #endif /* !_DIRTYRECT_H_ */ diff --git a/src/include/rsys/drive_flags.h b/src/include/rsys/drive_flags.h index 3f670b27..4434da30 100644 --- a/src/include/rsys/drive_flags.h +++ b/src/include/rsys/drive_flags.h @@ -1,12 +1,13 @@ #if !defined(__rsys_drive_flags__) #define __rsys_drive_flags__ +namespace Executor { typedef unsigned char drive_flags_t; enum { DRIVE_FLAGS_LOCKED = 1, DRIVE_FLAGS_FIXED = 2, DRIVE_FLAGS_FLOPPY = 4 }; - +} #endif /* !defined(__rsys_drive_flags__) */ diff --git a/src/include/rsys/dump.h b/src/include/rsys/dump.h index e7eafe05..c7e940dd 100644 --- a/src/include/rsys/dump.h +++ b/src/include/rsys/dump.h @@ -3,7 +3,7 @@ #include #include "Palettes.h" #endif - +namespace Executor { extern int dump_verbosity; extern FILE *o_fp; @@ -59,3 +59,4 @@ extern void dump_finish (void); extern void dump_set_field (int field); extern void dump_clear_field (int field); +} diff --git a/src/include/rsys/emustubs.h b/src/include/rsys/emustubs.h index 69ab0b90..4ae85f07 100644 --- a/src/include/rsys/emustubs.h +++ b/src/include/rsys/emustubs.h @@ -7,7 +7,7 @@ * * $Id: emustubs.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { typedef struct PACKED { PACKED_MEMBER(Ptr, buffer); @@ -204,5 +204,5 @@ extern syn68k_addr_t _IMVI_PPC (syn68k_addr_t ignoreme, void **ignoreme2); extern syn68k_addr_t _HFSRoutines (syn68k_addr_t ignoreme, void **ignoreme2); extern syn68k_addr_t _CodeFragment (syn68k_addr_t ignoreme, void **ignoreme2); extern syn68k_addr_t _MixedMode (syn68k_addr_t ignoreme, void **ignoreme2); - +} #endif diff --git a/src/include/rsys/error.h b/src/include/rsys/error.h index c41fdc74..eedf263f 100644 --- a/src/include/rsys/error.h +++ b/src/include/rsys/error.h @@ -13,7 +13,9 @@ #include "rsys/noreturn.h" - +#ifdef __cplusplus +extern "C" { +#endif /* * Classes of warnings: * @@ -188,6 +190,9 @@ extern bool log_err_to_ram_p; extern void error_dump_ram_err_buf (const char *separator_message); #endif -extern const char NULL_STRING[]; - +//extern const char NULL_STRING[]; +#define NULL_STRING "" +#ifdef __cplusplus +} +#endif #endif /* !_ERROR_H_ */ diff --git a/src/include/rsys/evil.h b/src/include/rsys/evil.h index b3d13921..c6404f36 100644 --- a/src/include/rsys/evil.h +++ b/src/include/rsys/evil.h @@ -9,9 +9,9 @@ */ #define EVIL_ILLUSTRATOR_7_HACK - +namespace Executor { #if defined (EVIL_ILLUSTRATOR_7_HACK) extern BOOLEAN ROMlib_evil_illustrator_7_hack; #endif - +} #endif diff --git a/src/include/rsys/executor.h b/src/include/rsys/executor.h index bc082b05..e338e3ac 100644 --- a/src/include/rsys/executor.h +++ b/src/include/rsys/executor.h @@ -9,12 +9,12 @@ */ #define BROWSER_NAME "Browser" - +namespace Executor { extern LONGINT debugnumber; extern LONGINT ROMlib_creator; extern syn68k_addr_t alinehandler(syn68k_addr_t pc, void *ignored); extern void setupsignals(void); extern void filltables (void); extern void executor_main (void); - +} #endif diff --git a/src/include/rsys/file.h b/src/include/rsys/file.h index f0ea10d4..8b30b4b1 100644 --- a/src/include/rsys/file.h +++ b/src/include/rsys/file.h @@ -23,7 +23,7 @@ extern char *copystr (const char *name); /* relative paths of the system folder */ #define SYSMACNAME "\006System" - +namespace Executor { typedef struct PACKED { LONGINT fd; LONGINT offset; @@ -168,7 +168,7 @@ do \ warning_trap_failure ("%d", err); \ BADRETURNHOOK(err); \ if (a) { \ - register ProcPtr compp; \ + ProcPtr compp; \ \ if ((compp = MR(((ParmBlkPtr) (pb))->ioParam.ioCompletion))) { \ CALLCOMPLETION(pb, compp, err); \ @@ -540,5 +540,5 @@ extern unsigned char ROMlib_fromhex (unsigned char c); extern char *ROMlib_volumename; extern INTEGER ROMlib_nextvrn; - +} #endif /* !defined(__rsys_file__) */ diff --git a/src/include/rsys/filedouble.h b/src/include/rsys/filedouble.h index fcbd1319..6cf48f4d 100644 --- a/src/include/rsys/filedouble.h +++ b/src/include/rsys/filedouble.h @@ -9,7 +9,7 @@ * * $Id: filedouble.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { typedef enum { Data_Fork_ID = 1, Resource_Fork_ID, @@ -81,5 +81,5 @@ extern const char *apple_double_fork_prefix; extern int apple_double_fork_prefix_length; extern void double_dir_op (char *name, double_dir_op_t op); - +} #endif diff --git a/src/include/rsys/flags.h b/src/include/rsys/flags.h index fc0b6bc3..e5e8cb74 100644 --- a/src/include/rsys/flags.h +++ b/src/include/rsys/flags.h @@ -1,3 +1,4 @@ +namespace Executor { /* FALSE if we are blitting straight to screen memory, TRUE if we are blitting to a shadow screen */ extern INTEGER ROMlib_shadow_screen_p; @@ -49,3 +50,4 @@ extern int ROMlib_newlinetocr; the required system version. set by `InitResources ()', and used by `InitWindows ()' */ extern boolean_t system_file_version_skew_p; +} diff --git a/src/include/rsys/float.h b/src/include/rsys/float.h index d2097e4b..666c419c 100644 --- a/src/include/rsys/float.h +++ b/src/include/rsys/float.h @@ -13,6 +13,7 @@ #include #include +namespace Executor { #if !defined (macfpstate) extern Byte macfpstate[6]; #endif @@ -191,5 +192,5 @@ log1p (double x) #endif /* NEED_LOG1P */ #define _romlib_float_h_2_ - +} #endif diff --git a/src/include/rsys/float_fcw.h b/src/include/rsys/float_fcw.h index 44cef001..1f4f0381 100644 --- a/src/include/rsys/float_fcw.h +++ b/src/include/rsys/float_fcw.h @@ -7,9 +7,9 @@ * * $Id: float_fcw.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { extern uint32 ROMlib_get_fcw_fsw (void); extern void ROMlib_set_fcw_fsw (uint32 fcwfsw); extern void ROMlib_compare_fcw_fsw (uint32 fcwfsw, const char *func, int line); - +} #endif diff --git a/src/include/rsys/floatconv.h b/src/include/rsys/floatconv.h index 8c7affed..433e9be9 100644 --- a/src/include/rsys/floatconv.h +++ b/src/include/rsys/floatconv.h @@ -57,7 +57,7 @@ union ieee754_double #endif - +namespace Executor { EXTERN_INLINE ieee_t x80_to_ieee (const x80_t *x) ALWAYS_INLINE; @@ -447,5 +447,5 @@ ieee_to_comp (ieee_t val, comp_t *dest) #endif } } - +} #endif diff --git a/src/include/rsys/font.h b/src/include/rsys/font.h index 46619ad7..7864a6dd 100644 --- a/src/include/rsys/font.h +++ b/src/include/rsys/font.h @@ -5,6 +5,7 @@ * $Id: font.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { typedef struct PACKED { INTEGER size; INTEGER style; @@ -38,3 +39,4 @@ extern Fixed font_width_expand (Fixed width, Fixed extra, Fixed hOutputInverse); extern void ROMlib_shutdown_font_manager (void); +} diff --git a/src/include/rsys/gestalt.h b/src/include/rsys/gestalt.h index 89291c63..76de0bcc 100644 --- a/src/include/rsys/gestalt.h +++ b/src/include/rsys/gestalt.h @@ -1,6 +1,7 @@ #if !defined(_RSYS_GESTALT_H_) #define _RSYS_GESTALT_H_ +namespace Executor { #if defined (USE_WINDOWS_NOT_MAC_TYPEDEFS_AND_DEFINES) typedef uint32 OSType; typedef uint32 OSErr; @@ -42,5 +43,5 @@ extern void gestalt_set_memory_size (uint32 size); extern void gestalt_set_cpu_type (uint32 type); #endif - +} #endif /* !_RSYS_GESTALT_H_ */ diff --git a/src/include/rsys/glue.h b/src/include/rsys/glue.h index 1d126cbb..65035235 100644 --- a/src/include/rsys/glue.h +++ b/src/include/rsys/glue.h @@ -6,7 +6,7 @@ */ #include "MemoryMgr.h" - +namespace Executor { #define CFROMP(cp, pp) \ (BlockMove((Ptr) pp+1, (Ptr) cp, (Size) (unsigned char) pp[0]), \ cp[(unsigned char) pp[0]] = 0, \ @@ -20,3 +20,4 @@ extern StringPtr ROMlib_PFROMC(StringPtr pp, char *cp, Size len); #define PASCALSTR(x, len) \ (len = strlen(x), ROMlib_PFROMC(alloca(len+1), x, len)) +} diff --git a/src/include/rsys/gworld.h b/src/include/rsys/gworld.h index 3d8b305e..ed1ed6a7 100644 --- a/src/include/rsys/gworld.h +++ b/src/include/rsys/gworld.h @@ -1,6 +1,6 @@ #if !defined (_GWORLD_H_) #define _GWORLD_H_ - +namespace Executor { typedef struct gw_info { GWorldPtr gw; @@ -21,5 +21,5 @@ extern gw_info_t *lookup_gw_info_by_gw_pixmap (PixMapHandle); extern gw_info_t *lookup_gw_info_by_gw_pixmap_baseaddr (void *); extern gw_info_t *lookup_gw_info_by_gw_gd_pixmap (PixMapHandle); - +} #endif /* !_GWORLD_H_ */ diff --git a/src/include/rsys/hfs.h b/src/include/rsys/hfs.h index 0bfc4982..2ef91d16 100644 --- a/src/include/rsys/hfs.h +++ b/src/include/rsys/hfs.h @@ -15,7 +15,7 @@ #if !defined(USE_WINDOWS_NOT_MAC_TYPEDEFS_AND_DEFINES) -#include +#include "rsys/cruft.h" #include "OSUtil.h" #include "FileMgr.h" @@ -29,7 +29,7 @@ #include "ThinkC.h" #define HVCB VCB - +namespace Executor { #define DEVNAMELEN 50 /* much bigger than necessary */ @@ -236,7 +236,7 @@ typedef struct PACKED { #define DATAPFROMKEY(p) ((char *)(p) + ((((catkey *)p)->ckrKeyLen + 2) & ~1)) -typedef enum { mfs, hfs } fstype; +typedef enum { mfs, hfs, hfsp } fstype; typedef enum { regular = 1, directory = 2, thread = 4 } filekind; #if defined(MAC) @@ -602,5 +602,5 @@ extern void vcbsync(HVCB *vcbp); #endif /* __STDC__ */ #endif - +} #endif /* !defined(__RSYS_HFS__) */ diff --git a/src/include/rsys/hfs_plus.h b/src/include/rsys/hfs_plus.h index 63ea780e..29602ed0 100644 --- a/src/include/rsys/hfs_plus.h +++ b/src/include/rsys/hfs_plus.h @@ -7,7 +7,7 @@ * * $Id: hfs_plus.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { #if 1 typedef unsigned char UInt8; typedef unsigned short UInt16; @@ -210,5 +210,5 @@ typedef struct PACKED HFSPlusAttrExtents HFSPlusAttrExtents; extern boolean_t ROMlib_hfs_plus_support; - +} #endif diff --git a/src/include/rsys/hook.h b/src/include/rsys/hook.h index 930584d0..a86c768c 100644 --- a/src/include/rsys/hook.h +++ b/src/include/rsys/hook.h @@ -1,6 +1,6 @@ #if !defined (_HOOK_H_) #define _HOOK_H_ - +namespace Executor { typedef enum { ctl_actionnumber, ctl_cdefnumber, @@ -65,5 +65,5 @@ extern void ROMlib_hook (LONGINT hn); #define HOOKSAVEREGS() #define HOOKRESTOREREGS() - +} #endif /* !_HOOK_H_ */ diff --git a/src/include/rsys/host.h b/src/include/rsys/host.h index 6355b8f3..3337864f 100644 --- a/src/include/rsys/host.h +++ b/src/include/rsys/host.h @@ -1,8 +1,8 @@ -#if !defined (__HOST__) -#define __HOST__ +#if !defined (__Exec_HOST__) +#define __Exec_HOST__ #include "CQuickDraw.h" - +namespace Executor { extern int host_cursor_depth; extern void host_set_cursor (char *cursor_data, @@ -13,5 +13,5 @@ extern boolean_t host_hide_cursor_if_intersects (int top, int left, int bottom, int right); extern void host_beep_at_user (void); extern void host_flush_shadow_screen (void); - +} #endif /* !__HOST__ */ diff --git a/src/include/rsys/icon.h b/src/include/rsys/icon.h index 92ca0e38..664fc076 100644 --- a/src/include/rsys/icon.h +++ b/src/include/rsys/icon.h @@ -2,7 +2,7 @@ #define __rsys_icon_h__ #define N_SUITE_ICONS 6 - +namespace Executor { /* NOTE: Cotton didn't really use a struct and I'm not about to munch his code, especially since we don't know the real layout and this is subject to change. I just wanted to paste in the flags field so we can drop a @@ -14,5 +14,5 @@ typedef struct PACKED INTEGER label; } cotton_suite_layout_t; - +} #endif /* !defined (__rsys_icon_h__) */ diff --git a/src/include/rsys/image.h b/src/include/rsys/image.h index adeec44e..d1ca8b29 100644 --- a/src/include/rsys/image.h +++ b/src/include/rsys/image.h @@ -1,6 +1,8 @@ #include "QuickDraw.h" +namespace Executor { + typedef struct pixel_image { Rect bounds; @@ -20,7 +22,7 @@ typedef struct pixel_image typedef struct image_bits_desc { - char *raw_bits; + unsigned char *raw_bits; int row_bytes; int bpp; } image_bits_desc_t; @@ -39,3 +41,4 @@ extern void image_validate_x_bits (pixel_image_t *image, extern void image_update_ctab (pixel_image_t *image, const RGBColor *new_colors, int max_color); extern void image_inits (void); +} diff --git a/src/include/rsys/ini.h b/src/include/rsys/ini.h index 5388d244..b4ea7b49 100644 --- a/src/include/rsys/ini.h +++ b/src/include/rsys/ini.h @@ -7,7 +7,7 @@ * * $Id: ini.h 87 2005-05-25 01:57:33Z ctm $ */ - +namespace Executor { typedef char *heading_t; typedef char *ini_key_t; typedef char *value_t; @@ -40,5 +40,5 @@ extern boolean_t add_heading_to_file (FILE *fp, heading_t heading); extern boolean_t add_key_value_to_file (FILE *fp, ini_key_t key, value_t value); extern boolean_t close_ini_file (FILE *fp); extern value_t find_key (heading_t heading, ini_key_t key); - +} #endif diff --git a/src/include/rsys/interfacelib.h b/src/include/rsys/interfacelib.h index 284ac9ee..9392ecd3 100644 --- a/src/include/rsys/interfacelib.h +++ b/src/include/rsys/interfacelib.h @@ -2,10 +2,10 @@ #define _rsys_interfacelib_h_ #include "rsys/cfm.h" - +namespace Executor { extern OSErr ROMlib_GetInterfaceLib (Str63 library, OSType arch, LoadFlags loadflags, ConnectionID *cidp, Ptr *mainaddrp, Str255 errName); - +} #endif diff --git a/src/include/rsys/itm.h b/src/include/rsys/itm.h index 091a11b5..e9df4887 100644 --- a/src/include/rsys/itm.h +++ b/src/include/rsys/itm.h @@ -9,7 +9,7 @@ */ #include "rsys/pstuff.h" - +namespace Executor { typedef struct PACKED { PACKED_MEMBER(Handle, itmhand); Rect itmr; @@ -133,5 +133,5 @@ typedef pascal void (*soundprocp) (INTEGER sound); extern void BEEPER (INTEGER n); #define BEEP(n) BEEPER(n) - +} #endif /* _ITM_H_ */ diff --git a/src/include/rsys/iv.h b/src/include/rsys/iv.h index d68d04d6..5c83cd9e 100644 --- a/src/include/rsys/iv.h +++ b/src/include/rsys/iv.h @@ -7,7 +7,7 @@ #if !defined (_IMAGE_COMMON_H_) #define _IMAGE_COMMON_H_ - +namespace Executor { #define PORT (htons (7117)) typedef struct color @@ -22,5 +22,5 @@ typedef struct image_header int row_bytes; color_t image_color_map[256]; } image_header_t; - +} #endif /* !_IMAGE_COMMON_H_ */ diff --git a/src/include/rsys/jumpvectors.h b/src/include/rsys/jumpvectors.h index b239ae7b..9bd1e127 100644 --- a/src/include/rsys/jumpvectors.h +++ b/src/include/rsys/jumpvectors.h @@ -1,6 +1,6 @@ #if !defined(__RSYS_JUMPVECTORS__) #define __RSYS_JUMPVECTORS__ - +namespace Executor { #if !defined (JFLUSH_H) extern HIDDEN_ProcPtr JFLUSH_H, JResUnknown1_H, JResUnknown2_H; #endif @@ -8,5 +8,5 @@ extern HIDDEN_ProcPtr JFLUSH_H, JResUnknown1_H, JResUnknown2_H; #define JFLUSH (JFLUSH_H.p) #define JResUnknown1 (JResUnknown1_H.p) #define JResUnknown2 (JResUnknown2_H.p) - +} #endif /* !defined(__RSYS_JUMPVECTORS__) */ diff --git a/src/include/rsys/keyboard.h b/src/include/rsys/keyboard.h index 9e558a06..7f6969ff 100644 --- a/src/include/rsys/keyboard.h +++ b/src/include/rsys/keyboard.h @@ -1,6 +1,6 @@ #if !defined(_RSYS_KEYBOARD_H_) #define _RSYS_KEYBOARD_H_ - +namespace Executor { /* * Copyright 1995 by Abacus Research and Development, Inc. * All rights reserved. @@ -205,6 +205,6 @@ typedef HIDDEN_kchr_ptr_t *kchr_hand; #define MKV_RESET 0x7f extern unsigned char ibm_virt_to_mac_virt[]; - +} #endif /* !defined(_RSYS_KEYBOARD_H_) */ diff --git a/src/include/rsys/keyboards.h b/src/include/rsys/keyboards.h index 3d3b3ee4..a26adfe6 100644 --- a/src/include/rsys/keyboards.h +++ b/src/include/rsys/keyboards.h @@ -7,19 +7,20 @@ * * $Id: keyboards.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { /* * Don't change the order of these without reworking the * next_virt_to_mac_virt table in NEXT.c */ typedef enum { + no_keyboard = 0, adb_keyboard, default_keyboard, pc_keyboard } keyboard_enum_t; -#define NVIRTMAPS (pc_keyboard) +#define NVIRTMAPS (Executor::pc_keyboard) #define NKEYSTOMAP (0x68) extern keyboard_enum_t ROMlib_keyboard_type; @@ -38,5 +39,5 @@ extern unsigned char next_virt_to_mac_virt[NVIRTMAPS][NKEYSTOMAP]; #if defined (SDL) && defined (CYGWIN32) extern void ROMlib_set_use_scancodes (boolean_t val); #endif - +} #endif diff --git a/src/include/rsys/keycode.h b/src/include/rsys/keycode.h index be52cc21..9bc095a0 100644 --- a/src/include/rsys/keycode.h +++ b/src/include/rsys/keycode.h @@ -1,7 +1,7 @@ #if !defined (NELEM) #define NELEM(s) (sizeof (s) / sizeof (s)[0]) #endif - +namespace Executor { #define BASE_REVISION 1 /* revision expiration started with E 1.x */ #define MONTHS_IN_YEAR 12 #define BASE_MONTH 1 /* January is typically digitized as 1 */ @@ -26,7 +26,7 @@ extern int n_cpu_bits[16]; extern int revision_number_bits[4]; extern int expiration_date_bits[8]; extern int unassigned_bits[5]; -extern unsigned char key32[32]; +extern unsigned char key32[33]; extern int valid_key_format(const unsigned char *key); extern void undes(block_t ciphertext, block_t keyin, block_t plaintext); @@ -42,3 +42,4 @@ extern ordering_t KeyTr1; extern ordering_t FinalTr; extern ordering_t swap; extern block_t key; +} diff --git a/src/include/rsys/launch.h b/src/include/rsys/launch.h index a7b6c929..2bd66749 100644 --- a/src/include/rsys/launch.h +++ b/src/include/rsys/launch.h @@ -7,7 +7,7 @@ * * $Id: launch.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { extern uint32 ROMlib_version_long; extern void ROMlib_set_ppc (boolean_t val); extern int ROMlib_uaf; @@ -31,6 +31,6 @@ typedef struct PACKED { extern launch_failure_t ROMlib_launch_failure; extern INTEGER ROMlib_exevrefnum; - +} #endif diff --git a/src/include/rsys/libcproto.h b/src/include/rsys/libcproto.h index c71aaa74..ff906d2c 100644 --- a/src/include/rsys/libcproto.h +++ b/src/include/rsys/libcproto.h @@ -9,7 +9,7 @@ */ -#if defined(NEXTSTEP) || defined(MSDOS) || defined(SUN) || defined(LINUX) +#if defined(MACOSX_) || defined(MSDOS) || defined(SUN) || defined(LINUX) #if defined(GO32) @@ -194,7 +194,7 @@ extern int Uutimes(const char *path, struct timeval tvp[2]); #define Uclosedir closedir #define Ureaddir readdir -#else /* NEXTSTEP || MSDOS || SUN || LINUX */ +#else /* MACOSX_ || MSDOS || SUN || LINUX */ #include /* GNU assert produces warning messages */ #include "libcconsts.h" diff --git a/src/include/rsys/licensetext.h b/src/include/rsys/licensetext.h index cb0b4765..f20af5d5 100644 --- a/src/include/rsys/licensetext.h +++ b/src/include/rsys/licensetext.h @@ -1,6 +1,6 @@ #if !defined (_RSYS_LICENSETEXT_H_) #define _RSYS_LICENSETEXT_H_ - +namespace Executor { typedef struct { const char *heading; @@ -8,5 +8,5 @@ typedef struct } license_text_page_t; extern license_text_page_t ROMlib_license[]; - +} #endif /* _RSYS_LICENSETEXT_H_ */ diff --git a/src/include/rsys/list.h b/src/include/rsys/list.h index 9c5db114..1bd55734 100644 --- a/src/include/rsys/list.h +++ b/src/include/rsys/list.h @@ -13,7 +13,7 @@ #include "ResourceMgr.h" #include "rsys/mman.h" #include "rsys/pstuff.h" - +namespace Executor { extern void C_ldef0 (INTEGER, BOOLEAN, Rect *, Cell, INTEGER, INTEGER, ListHandle); @@ -22,7 +22,7 @@ extern void #if !defined (BINCOMPAT) #if !defined (UNIX) #define LISTCALL(msg, sel, rect, cell, doff, dlen, list) \ - CallPascal((INTEGER) (msg), (sel), (rect), (cell), (doff), (dlen), + CallPascal((INTEGER) (msg), (sel), (rect), (cell), (doff), (dlen), \ (list), *(*list)->listDefProc) #else /* UNIX */ @@ -53,14 +53,8 @@ extern void ROMlib_listcall (INTEGER mess, BOOLEAN sel, Rect *rp, Cell cell, #define LISTEND(l) HSetState(HxP(l, listDefProc), liststate) -#if !defined (__STDC__) -extern void ROMlib_vminmax(); -extern void ROMlib_hminmax(); -extern INTEGER *ROMlib_getoffp(); -#else /* __STDC__ */ extern void ROMlib_vminmax( INTEGER *minp, INTEGER *maxp, ListPtr lp ); extern void ROMlib_hminmax( INTEGER *minp, INTEGER *maxp, ListPtr lp ); extern INTEGER *ROMlib_getoffp( Cell cell, ListHandle list); -#endif /* __STDC__ */ - +} #endif /* !defined(__RSYS_LIST__) */ diff --git a/src/include/rsys/local_charset.h b/src/include/rsys/local_charset.h index fad7bc31..75c079c3 100644 --- a/src/include/rsys/local_charset.h +++ b/src/include/rsys/local_charset.h @@ -8,6 +8,8 @@ * $Id: local_charset.h 88 2005-05-25 03:59:37Z ctm $ */ +namespace Executor { extern void ROMlib_localize_string (char *p); +} #endif diff --git a/src/include/rsys/lockunlock.h b/src/include/rsys/lockunlock.h index da152630..1a380dc3 100644 --- a/src/include/rsys/lockunlock.h +++ b/src/include/rsys/lockunlock.h @@ -8,6 +8,7 @@ * $Id: lockunlock.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { typedef enum { lock, @@ -33,5 +34,5 @@ PUBLIC OSErr ROMlib_find_fd_start_count (int fd, uint32 start_byte, #define afpRangeNotLocked (-5020) #define afpRangeOverlap (-5021) #define afpNoMoreLocks (-5015) - +} #endif diff --git a/src/include/rsys/lowglobals.h b/src/include/rsys/lowglobals.h index 74ab85fd..dc02ffaf 100644 --- a/src/include/rsys/lowglobals.h +++ b/src/include/rsys/lowglobals.h @@ -8,6 +8,9 @@ * $Id: lowglobals.h 63 2004-12-24 18:19:43Z ctm $ */ +#ifdef __cplusplus +namespace Executor { +#endif extern BOOLEAN force_big_offset; #define nilhandle_H (*(HIDDEN_Ptr *)(0x00 + ROMlib_offset)) @@ -256,4 +259,8 @@ extern BOOLEAN force_big_offset; #define TimeSCSIDB (*(INTEGER *)(0xDA6 + ROMlib_offset)) #define lastlowglobal (*(LONGINT *)(0x2000 + ROMlib_offset)) +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/include/rsys/mactype.h b/src/include/rsys/mactype.h index 3b62f424..c440a596 100644 --- a/src/include/rsys/mactype.h +++ b/src/include/rsys/mactype.h @@ -8,7 +8,12 @@ * $Id: mactype.h 63 2004-12-24 18:19:43Z ctm $ */ +#include "rsys/macros.h" +#include "rsys/types.h" +#ifdef __cplusplus +namespace Executor { +#endif typedef int16 INTEGER; typedef int32 LONGINT; typedef uint32 ULONGINT; @@ -20,5 +25,8 @@ typedef int16 CHAR; /* very important not to use this as char */ typedef struct { int32 l PACKED; } HIDDEN_LONGINT; typedef struct { uint32 u PACKED; } HIDDEN_ULONGINT; +#ifdef __cplusplus +} +#endif #endif /* _MACTYPE_H_ */ diff --git a/src/include/rsys/mathlib.h b/src/include/rsys/mathlib.h index ce8f5bcf..f46378ad 100644 --- a/src/include/rsys/mathlib.h +++ b/src/include/rsys/mathlib.h @@ -3,9 +3,10 @@ #include "rsys/cfm.h" +namespace Executor { extern OSErr ROMlib_GetMathLib (Str63 library, OSType arch, LoadFlags loadflags, ConnectionID *cidp, Ptr *mainaddrp, Str255 errName); - +} #endif diff --git a/src/include/rsys/menu.h b/src/include/rsys/menu.h index b804352e..4abe7c5d 100644 --- a/src/include/rsys/menu.h +++ b/src/include/rsys/menu.h @@ -1,6 +1,6 @@ #if !defined (__MENU_H_) -#define _MENU_H_ +#define __MENU_H_ /* * Copyright 1986, 1989, 1990 by Abacus Research and Development, Inc. @@ -14,6 +14,7 @@ #include "rsys/mman.h" #include "rsys/pstuff.h" +namespace Executor { #define MI_ID_X(mi) (HxX (mi, menuID)) #define MI_WIDTH_X(mi) (HxX (mi, menuWidth)) #define MI_HEIGHT_X(mi) (HxX (mi, menuHeight)) @@ -280,12 +281,10 @@ typedef struct PACKED } entry[1]; } table, *tablePtr, **tableHandle; -extern int ROMlib_sticky_menus_p; -extern int ROMlib_AppleChar; - void cleanup_icon_info (icon_info_t *info); int get_icon_info (mextp item_info, icon_info_t *info, int need_icon_p); +extern int ROMlib_sticky_menus_p; void menu_bar_color (RGBColor *bar_color); void menu_title_color (int16 id, RGBColor *title_color); @@ -295,5 +294,9 @@ void menu_item_colors (int16 id, int16 item, RGBColor *mark_color, RGBColor *command_color); void menu_delete_entries (int16 menu_id); +} + +extern "C" int ROMlib_AppleChar; + #endif /* !_MENU_H_ */ diff --git a/src/include/rsys/mixed_mode.h b/src/include/rsys/mixed_mode.h index 57f01b71..046d99ab 100644 --- a/src/include/rsys/mixed_mode.h +++ b/src/include/rsys/mixed_mode.h @@ -2,7 +2,7 @@ #define _mixed_mode_h_ #include - +namespace Executor { typedef uint8 ISAType; typedef uint16 CallingConventionType; typedef uint32 ProcInfoType; @@ -129,5 +129,5 @@ extern UniversalProcPtr C_NewFatRoutineDescriptor (ProcPtr m68k, ProcPtr ppc, extern OSErr C_SaveMixedModeState (void *statep, uint32 vers); extern OSErr C_RestoreMixedModeState (void *statep, uint32 vers); - +} #endif diff --git a/src/include/rsys/mman.h b/src/include/rsys/mman.h index de940c62..3a0f18e2 100644 --- a/src/include/rsys/mman.h +++ b/src/include/rsys/mman.h @@ -11,6 +11,7 @@ * $Id: mman.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { /* common case handle state accessor; lock the handle and return the pre-locked handle state */ extern SignedByte hlock_return_orig_state (Handle h); @@ -174,7 +175,7 @@ enum { TRAP_MASK = 0xF9FF }; _hp->f1 = _v1; \ _hp->f2 = _v2; \ _hp->f3 = _v3; \ - _hp->f4 = _v4; \ + _hp->f4 = (typeof(_hp->f4))_v4; \ _hp->f5 = _v5; \ _hp->f6 = _v6; \ }) @@ -249,8 +250,8 @@ enum { TRAP_MASK = 0xF9FF }; _hp->f6 = _v6; \ _hp->f7 = _v7; \ _hp->f8 = _v8; \ - _hp->f9 = _v9; \ - _hp->f10 = _v10; \ + _hp->f9 = (typeof (_hp->f9))_v9; \ + _hp->f10 = (typeof (_hp->f10))_v10; \ _hp->f11 = _v11; \ }) @@ -479,5 +480,5 @@ enum { TRAP_MASK = 0xF9FF }; HSetState (handle2, handle2_state); \ HSetState (handle1, handle1_state); \ } while (FALSE) - +} #endif /* !_MMAN_PUBLIC_H_ */ diff --git a/src/include/rsys/mman_private.h b/src/include/rsys/mman_private.h index 22f1d3c7..153ba904 100644 --- a/src/include/rsys/mman_private.h +++ b/src/include/rsys/mman_private.h @@ -11,7 +11,7 @@ */ #include "rsys/mman.h" - +namespace Executor { typedef struct PACKED block_header { /* the bogo new IM books implies (via a picture) that the field @@ -117,7 +117,7 @@ extern unsigned long ROMlib_memtop; ((block)->master_ptr_flags = (state)) /* set the master pointer of a handle to a given value */ -#define SETMASTER(handle, ptr) ((handle)->p = RM (ptr)) +#define SETMASTER(handle, ptr) ((handle)->p = (Ptr)RM (ptr)) #define BLOCK_NEXT(block) \ ((block_header_t *) ((char *) (block) + PSIZE (block))) @@ -260,5 +260,5 @@ extern void mman_heap_death (const char *func, const char *where); _HEAP_DEATH (__PRETTY_FUNCTION__, " in " __FILE__ ":", __LINE__) #define HEAPEND (MR(HeapEnd) + MIN_BLOCK_SIZE) /* temporary ctm hack */ - +} #endif /* _MMAN_PRIVATE_H */ diff --git a/src/include/rsys/new_mmanstubs.h b/src/include/rsys/new_mmanstubs.h index 9acbbbf8..f2975108 100644 --- a/src/include/rsys/new_mmanstubs.h +++ b/src/include/rsys/new_mmanstubs.h @@ -1,6 +1,6 @@ #if !defined(__RSYS_NEW_MMANSTUBS__) #define __RSYS_NEW_MMANSTUBS__ - +namespace Executor { extern OSErrRET HSetStateError( Handle h, SignedByte flags ); #define HSetState(h, flags) \ (MemErr = CW(HSetStateError(h, flags)), (void) 0) @@ -174,5 +174,5 @@ extern Handle NewHandleFlagErrorP( ULONGINT size, short trapno, OSErrRET *errp ) extern Ptr NewPtrFlagErrorP( ULONGINT size, short trapno, OSErrRET *errp ); #define NewPtr(size) (NewPtrFlagErrorP(size, 0, 0)) - +} #endif /* !defined(__RSYS_NEW_MMANSTUBS__) */ diff --git a/src/include/rsys/newvga.h b/src/include/rsys/newvga.h index 2fde595c..e82ceca9 100644 --- a/src/include/rsys/newvga.h +++ b/src/include/rsys/newvga.h @@ -2,7 +2,7 @@ #define _VGA_H_ #include "QuickDraw.h" - +namespace Executor { #define NUM_STANDARD_VGA_MODES 2 #define NUM_VESA_MODES 8 #define EXTRA_VGA_MODES 16 /* Arbitrary, but allow for extra modes. */ @@ -105,5 +105,5 @@ extern void *vdriver_frame_buffer (int *width, int *height, int *row_bytes, extern void vdriver_set_colors (int first_color, int num_colors, const RGBColor *color_array); extern int vdriver_set_mode (int width, int height, int bpp); - +} #endif /* !_VGA_H_ */ diff --git a/src/include/rsys/nextprint.h b/src/include/rsys/nextprint.h index 864178c7..6cb16c59 100644 --- a/src/include/rsys/nextprint.h +++ b/src/include/rsys/nextprint.h @@ -10,7 +10,7 @@ /* cottons: added `__' to idle because it conflits with posix function of the same name */ - +namespace Executor { typedef enum { __idle, seenOpenDoc, seenOpenPage, @@ -146,5 +146,5 @@ extern void ROMlib_updatemacpagerect(comRect *rp1, comRect *rp2, comRect *rp3); extern char **ROMlib_availableFonts(void); extern void ROMlib_newFont(char *font, float txSize); - +} #endif diff --git a/src/include/rsys/notmac.h b/src/include/rsys/notmac.h index caaf9f01..a084d752 100644 --- a/src/include/rsys/notmac.h +++ b/src/include/rsys/notmac.h @@ -1,4 +1,5 @@ #if !defined (__NOTMAC__) +#define __NOTMAC__ /* * Copyright 1990 by Abacus Research and Development, Inc. * All rights reserved. @@ -13,7 +14,7 @@ extern char ROMlib_start_drive; #if !defined (USE_WINDOWS_NOT_MAC_TYPEDEFS_AND_DEFINES) #include "rsys/commonevt.h" - +namespace Executor { extern char ROMlib_startdir[]; extern char *ROMlib_ConfigurationFolder; @@ -32,7 +33,6 @@ extern BOOLEAN ROMlib_shouldalarm(); extern BOOLEAN ROMlib_shouldalarm( void ); #endif /* __STDC__ */ -#define __NOTMAC__ /* DO NOT DELETE THIS LINE */ #if !defined (__STDC__) extern void initX(); @@ -58,10 +58,10 @@ extern BOOLEAN checkwindoweventX( char **eventp, commonevent *commonp ); extern void autorepeatonX( void ); extern LONGINT lookupkeysymX( char *p ); extern void bellX( void ); -extern void PutScrapX( LONGINT type, LONGINT length, char *p, int scrap_cnt ); -extern LONGINT GetScrapX( LONGINT type, char **h ); +extern void PutScrapX( OSType type, LONGINT length, char *p, int scrap_cnt ); +extern LONGINT GetScrapX( OSType type, char **h ); #endif /* __STDC__ */ - +} #endif #endif /* __NOTMAC__ */ diff --git a/src/include/rsys/option.h b/src/include/rsys/option.h index 8f574a75..76f11813 100644 --- a/src/include/rsys/option.h +++ b/src/include/rsys/option.h @@ -1,6 +1,6 @@ #if !defined (_RSYS_OPTION_H_) #define _RSYS_OPTION_H_ - +namespace Executor { typedef enum option_kind { /* this option has no argument; it evaluates to `def' if provided */ @@ -61,7 +61,7 @@ typedef struct opt_val char *t_val; priority_t t_pri; - char *val; + const char *val; priority_t pri; } opt_val_t; @@ -90,15 +90,9 @@ int opt_parse (opt_database_t *db, option_t *opts, int n_opts, int opt_int_val (opt_database_t *db, char *opt, int *retval, boolean_t *parse_error_p); -#if !defined (OPENSTEP) -int opt_val (opt_database_t *db, char *opt, char **retval); -void opt_put_val (opt_database_t *db, char *opt, char *value, - priority_t pri, int temp_val_p); -#else int opt_val (opt_database_t *db, char *opt, const char **retval); void opt_put_val (opt_database_t *db, char *opt, const char *value, priority_t pri, int temp_val_p); -#endif void opt_put_int_val (opt_database_t *db, char *opt, int value, priority_t pri, int temp_val_p); @@ -110,5 +104,5 @@ void opt_register_pre_note (char *note); extern uint32 parse_drive_opt (const char *opt_name, const char *opt_value); extern FILE * executor_dir_fopen (const char *file, const char *perm); extern int executor_dir_remove (const char *file); - +} #endif /* !_RSYS_OPTION_H_ */ diff --git a/src/include/rsys/options.h b/src/include/rsys/options.h index 97606952..7dc5dbc1 100644 --- a/src/include/rsys/options.h +++ b/src/include/rsys/options.h @@ -8,6 +8,10 @@ * $Id: options.h 63 2004-12-24 18:19:43Z ctm $ */ +#ifdef __cplusplus +using namespace Executor; +extern "C" { +#endif typedef struct { LONGINT first; LONGINT second; @@ -62,5 +66,7 @@ enum }; #define INITIALPAIRVALUE (-1000) - +#ifdef __cplusplus +} +#endif #endif diff --git a/src/include/rsys/os.h b/src/include/rsys/os.h index 951d96cb..c8f92d30 100644 --- a/src/include/rsys/os.h +++ b/src/include/rsys/os.h @@ -7,7 +7,8 @@ * * $Id: os.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { extern boolean_t os_init (void); +} #endif /* !_RSYS_OS_H_ */ diff --git a/src/include/rsys/osevent.h b/src/include/rsys/osevent.h index 0262303a..730b5347 100644 --- a/src/include/rsys/osevent.h +++ b/src/include/rsys/osevent.h @@ -2,7 +2,7 @@ #define _RSYS_OSEVENT_H_ /* #include "rsys/cruft.h" This include shouldn't be necessary */ - +namespace Executor { extern INTEGER ROMlib_mods; #if !defined (MBState) @@ -42,5 +42,5 @@ extern uint16 ROMlib_right_to_left_key_map (uint16 what); extern boolean_t ROMlib_get_index_and_bit (LONGINT loc, int *indexp, uint8 *bitp); - +} #endif diff --git a/src/include/rsys/osutil.h b/src/include/rsys/osutil.h index 1cbd5d73..ead6d77a 100644 --- a/src/include/rsys/osutil.h +++ b/src/include/rsys/osutil.h @@ -7,22 +7,22 @@ * * $Id: osutil.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { +extern long long ROMlib_long_long_secs (Executor::INTEGER year, Executor::INTEGER month, + Executor::INTEGER day, Executor::INTEGER hour, + Executor::INTEGER minute, Executor::INTEGER second); -extern long long ROMlib_long_long_secs (INTEGER year, INTEGER month, - INTEGER day, INTEGER hour, - INTEGER minute, INTEGER second); - -extern void date_to_swapped_fields (long long mactime, INTEGER *yearp, - INTEGER *monthp, INTEGER *dayp, - INTEGER *hourp, INTEGER *minutep, - INTEGER *secondp, INTEGER *dayofweekp, - INTEGER *dayofyearp, INTEGER *weekofyearp); +extern void date_to_swapped_fields (long long mactime, Executor::INTEGER *yearp, + Executor::INTEGER *monthp, Executor::INTEGER *dayp, + Executor::INTEGER *hourp, Executor::INTEGER *minutep, + Executor::INTEGER *secondp, Executor::INTEGER *dayofweekp, + Executor::INTEGER *dayofyearp, Executor::INTEGER *weekofyearp); extern void C_ROMlib_wakeup( void ); #define PARAMRAMMACNAME "\010ParamRAM" -extern LONGINT ROMlib_GMTcorrect; /* Correction for GMT to localtime */ +extern Executor::LONGINT ROMlib_GMTcorrect; /* Correction for GMT to localtime */ #define U70MINUSM04 2082844800 /* 1/1/1970 - 1/1/1904 */ #define UNIXTIMETOMACTIME(x) ((x) - ROMlib_GMTcorrect + U70MINUSM04) @@ -30,5 +30,5 @@ extern LONGINT ROMlib_GMTcorrect; /* Correction for GMT to localtime */ #define MACTIMETOGUNIXTIME(x) ((x) + ROMlib_GMTcorrect - U70MINUSM04) extern char ROMlib_phoneyrom[]; - +} #endif /* ! efined(__RSYS_OSUTIL__) */ diff --git a/src/include/rsys/parse.h b/src/include/rsys/parse.h index a1ca8049..02b30ba5 100644 --- a/src/include/rsys/parse.h +++ b/src/include/rsys/parse.h @@ -9,7 +9,7 @@ */ #include "rsys/options.h" - +extern "C" { extern int yyparse (void); /* ick -- that's what yacc produces */ extern void ROMlib_HideScreen( void ); extern void ROMlib_SetTitle(char *name); @@ -18,5 +18,5 @@ extern void ROMlib_ShowScreen( void ); extern void ROMlib_SetSize(pair_t *pairsp, pair_t *pairs2p); extern char *ROMlib_GetTitle (void); extern void ROMlib_FreeTitle (char *title); - +} #endif diff --git a/src/include/rsys/parsenum.h b/src/include/rsys/parsenum.h index 4d5920ca..e4cd59e8 100644 --- a/src/include/rsys/parsenum.h +++ b/src/include/rsys/parsenum.h @@ -1,7 +1,8 @@ #if !defined (_RSYS_PARSENUM_H_) #define _RSYS_PARSENUM_H_ +namespace Executor { extern boolean_t parse_number (const char *orig_num, int32 *val, unsigned round_up_to_multiple_of); - +} #endif /* !_RSYS_PARSENUM_H_ */ diff --git a/src/include/rsys/parseopt.h b/src/include/rsys/parseopt.h index 5f721dc6..8882afc1 100644 --- a/src/include/rsys/parseopt.h +++ b/src/include/rsys/parseopt.h @@ -1,14 +1,14 @@ #if !defined (_RSYS_PARSEOPT_H_) #define _RSYS_PARSEOPT_H_ - +namespace Executor { extern boolean_t parse_system_version (const char *vers); extern boolean_t parse_size_opt (const char *opt, const char *arg); -extern boolean_t parse_prres_opt (INTEGER *outx, INTEGER *outy, +extern boolean_t parse_prres_opt (Executor::INTEGER *outx, Executor::INTEGER *outy, const char *arg); extern boolean_t ROMlib_parse_version (const char *vers, uint32 *version_out); #define CREATE_SYSTEM_VERSION(a, b, c) \ ((((a) & 0xF) << 8) | (((b) & 0xF) << 4) | ((c) & 0xF)) - +} #endif /* !_RSYS_PARSEOPT_H_ */ diff --git a/src/include/rsys/partition.h b/src/include/rsys/partition.h index 6f8bb838..9e5181d3 100644 --- a/src/include/rsys/partition.h +++ b/src/include/rsys/partition.h @@ -7,6 +7,7 @@ * by HFS_XFer.util.c, which doesn't know our Mac stuff */ +namespace Executor { #if !defined(PACKED) #define PACKED __attribute__((packed)) typedef unsigned long ULONGINT; @@ -57,3 +58,4 @@ typedef struct PACKED { #define OLDMAPSIG1 'S' #define PARTOFFSET 1 +} diff --git a/src/include/rsys/pef.h b/src/include/rsys/pef.h index 107984df..28f14d61 100644 --- a/src/include/rsys/pef.h +++ b/src/include/rsys/pef.h @@ -9,7 +9,7 @@ * * $Id: pef.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { typedef struct PACKED PEFContainerHeader { OSType tag1; @@ -259,5 +259,5 @@ pef_hash_t; extern PEFLoaderInfoHeader_t *ROMlib_build_pef_hash (const map_entry_t table[], int count); - +} #endif diff --git a/src/include/rsys/picture.h b/src/include/rsys/picture.h index b5763ba0..213cea8b 100644 --- a/src/include/rsys/picture.h +++ b/src/include/rsys/picture.h @@ -10,6 +10,7 @@ #include "rsys/quick.h" +namespace Executor { #define PIC_SHORT_COMMENT 0xA0 #define PIC_LONG_COMMENT 0xA1 @@ -241,4 +242,5 @@ typedef HIDDEN_piccacheptr *piccachehand; extern PicHandle ROMlib_OpenPicture_helper (const Rect *pf, const OpenCPicParams *params); +} #endif /* _PICTURE_H_ */ diff --git a/src/include/rsys/prefs.h b/src/include/rsys/prefs.h index a1eb21bd..1a1a6648 100644 --- a/src/include/rsys/prefs.h +++ b/src/include/rsys/prefs.h @@ -1,6 +1,10 @@ #if !defined(__RSYS_PREFS__) #define __RSYS_PREFS__ +#ifdef __cplusplus +namespace Executor { +#endif + typedef enum { WriteAlways, WriteInBltrgn, @@ -9,6 +13,7 @@ typedef enum { WriteNever } WriteWhenType; /* This is an extension */ +#ifdef __cplusplus extern WriteWhenType ROMlib_when; extern int ROMlib_PretendSound; extern int ROMlib_cacheheuristic; @@ -28,15 +33,23 @@ extern int ROMlib_pretend_alias; extern int ROMlib_pretend_script; extern int ROMlib_pretend_edition; -extern char *ROMlib_configfilename; -extern FILE *configfile; extern uint32 system_version; +#endif #define ROMLIB_DEBUG_BIT (1 << 1) +#ifdef __cplusplus extern void ROMlib_WriteWhen (WriteWhenType when); extern void do_dump_screen (void); +} +extern "C" { +#endif +extern char *ROMlib_configfilename; +extern FILE *configfile; +#ifdef __cplusplus +} +#endif #endif /* !defined(__RSYS_PREFS__) */ diff --git a/src/include/rsys/print.h b/src/include/rsys/print.h index e8fb73ad..78b87a9b 100644 --- a/src/include/rsys/print.h +++ b/src/include/rsys/print.h @@ -19,7 +19,7 @@ extern win_printp_t ROMlib_wp; #endif - +namespace Executor { enum { postscriptbegin = 190, @@ -237,13 +237,8 @@ extern char *cstring_from_str255 (Str255 text); extern void disable_stdtext (void); extern void enable_stdtext (void); -extern char *ROMlib_win32_token; #define WIN32_TOKEN (ROMlib_win32_token ? ROMlib_win32_token : "Win32") -extern uint32 ROMlib_PrDrvrVers; - -extern char *ROMlib_new_printer_name; -extern char *ROMlib_new_label; extern void ROMlib_rotatebegin (LONGINT flippage, LONGINT angle); extern void ROMlib_rotatecenter (double yoffset, double xoffset); @@ -252,9 +247,15 @@ extern void ROMlib_gsave (void); extern void ROMlib_grestore (void); extern void ROMlib_acknowledge_job_dialog (THPrint thprint); +} -#if !defined (NEXTSTEP) -extern FILE *ROMlib_printfile; -#endif +extern "C" { +extern char *ROMlib_win32_token; +extern uint32 ROMlib_PrDrvrVers; + +extern char *ROMlib_new_printer_name; +extern char *ROMlib_new_label; +extern FILE *ROMlib_printfile; +} #endif /* !defined(__RSYS_PRINT__) */ diff --git a/src/include/rsys/process.h b/src/include/rsys/process.h index 0ad7a5ac..7a1b0e22 100644 --- a/src/include/rsys/process.h +++ b/src/include/rsys/process.h @@ -1,11 +1,11 @@ #if !defined (__rsys_process_h__) # define __rsys_process_h__ - +namespace Executor { typedef struct PACKED size_resource { int16 flags; int32 pref_size; int32 min_size; } size_resource_t; - +} #endif /* !defined (__rsys_process_h__) */ diff --git a/src/include/rsys/pstuff.h b/src/include/rsys/pstuff.h index b0eaf199..5ed8b983 100644 --- a/src/include/rsys/pstuff.h +++ b/src/include/rsys/pstuff.h @@ -1,6 +1,7 @@ #if !defined (_PSTUFF_H_) #define _PSTUFF_H_ +namespace Executor { extern toolstuff_t pstuff[]; extern osstuff_t osstuff[]; @@ -106,5 +107,5 @@ extern osstuff_t osstuff[]; #define P_new_draw_scroll (pstuff[85].orig) #define P_new_pos_ctl (pstuff[86].orig) - +} #endif /* !defined(_PSTUFF_H_) */ diff --git a/src/include/rsys/qcolor.h b/src/include/rsys/qcolor.h index 68c4ab79..a04d2432 100644 --- a/src/include/rsys/qcolor.h +++ b/src/include/rsys/qcolor.h @@ -7,7 +7,7 @@ * * $Id: qcolor.h 63 2004-12-24 18:19:43Z ctm $ */ - +namespace Executor { extern ColorSpec *default_ctab_colors[]; - +} #endif diff --git a/src/include/rsys/quick.h b/src/include/rsys/quick.h index 731cae7b..44fa4d46 100644 --- a/src/include/rsys/quick.h +++ b/src/include/rsys/quick.h @@ -14,6 +14,7 @@ in inline functions below */ #include "rsys/trapglue.h" +namespace Executor { typedef struct PACKED ccrsr_res { CCrsr crsr; @@ -170,4 +171,5 @@ extern void ROMlib_PICWRITE (Ptr addr, INTEGER count); extern RgnHandle ROMlib_circrgn (Rect *rp); extern void ROMlib_initport (GrafPtr p); +} #endif /* __QUICK__ */ diff --git a/src/include/rsys/redrawscreen.h b/src/include/rsys/redrawscreen.h index 045c13a5..8bf51a2b 100644 --- a/src/include/rsys/redrawscreen.h +++ b/src/include/rsys/redrawscreen.h @@ -8,6 +8,8 @@ * $Id: redrawscreen.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { extern void redraw_screen (void); +} #endif /* !_REDRAWSCREEN_H_ */ diff --git a/src/include/rsys/refresh.h b/src/include/rsys/refresh.h index 26c5f59e..3a94e815 100644 --- a/src/include/rsys/refresh.h +++ b/src/include/rsys/refresh.h @@ -1,13 +1,13 @@ #if !defined (_refresh_h_) #define _refresh_h_ - -extern void set_refresh_rate (int new); +namespace Executor { +extern void set_refresh_rate (int new1); extern void dequeue_refresh_task (void); -extern void C_handle_refresh (void); +void C_handle_refresh (void); extern BOOLEAN find_changed_rect_and_update_shadow (const uint32 *screen, uint32 *shadow, long row_longs, long num_rows, int *top_long, int *left_long, int *bottom_long, int *right_long); - +} #endif /* !_refresh_h_ */ diff --git a/src/include/rsys/release.h b/src/include/rsys/release.h index 86bf2f2a..a9bb6f55 100644 --- a/src/include/rsys/release.h +++ b/src/include/rsys/release.h @@ -13,7 +13,7 @@ * In the meantime, there's still a little cruft in here. */ -#define DISPLAY_SPLASH_SCREEN +#undef DISPLAY_SPLASH_SCREEN /* Set up the bit mask for which classes of debugging information * we can generate. This can be overridden on the command line diff --git a/src/include/rsys/resource.h b/src/include/rsys/resource.h index 4049dc0f..1d48cb1f 100644 --- a/src/include/rsys/resource.h +++ b/src/include/rsys/resource.h @@ -10,6 +10,7 @@ #include "ResourceMgr.h" #include "rsys/string.h" +namespace Executor { #define ULTIMA_III_HACK #if defined (ULTIMA_III_HACK) extern boolean_t ROMlib_ultima_iii_hack; @@ -74,17 +75,6 @@ typedef struct PACKED { /* empty resource template */ } empty_resource_template_t; -#if !defined (__STDC__) -extern resmaphand ROMlib_rntohandl(); -extern Handle ROMlib_mgetres(); -extern OSErr ROMlib_findres(), ROMlib_findmapres(), - ROMlib_typidtop(), ROMlib_maptypidtop(); -extern void ROMlib_invalar(); -extern Handle ROMlib_getrestid(); -extern INTEGER ROMlib_setreserr(); -extern void ROMlib_wr(); -extern LONGINT ROMlib_SizeResource(); -#else /* __STDC__ */ extern resmaphand ROMlib_rntohandl(INTEGER rn, Handle *pph ); extern Handle ROMlib_mgetres( resmaphand map, resref *rr ); extern OSErr ROMlib_findres( Handle r, resmaphand *mapp, typref **trp, @@ -102,7 +92,6 @@ extern INTEGER ROMlib_setreserr(INTEGER reserr); extern void ROMlib_wr(resmaphand map, resref *rr); extern LONGINT ROMlib_SizeResource(Handle res, BOOLEAN usehandle); extern Handle ROMlib_mgetres2(resmaphand map, resref *rr); -#endif /* __STDC__ */ #define REF0 0 /* special refrence number signifying system file */ @@ -213,6 +202,6 @@ typedef struct PACKED { LONGINT diskoff; resref *rrptr; } res_sorttype_t; - +} #define __MYRESOURCE__ #endif /* __MYRESOURCE__ */ diff --git a/src/include/rsys/rgbutil.h b/src/include/rsys/rgbutil.h index 751696db..b8baf23a 100644 --- a/src/include/rsys/rgbutil.h +++ b/src/include/rsys/rgbutil.h @@ -4,6 +4,7 @@ #include "QuickDraw.h" +namespace Executor { /* forward decl */ struct rgb_spec; @@ -60,5 +61,5 @@ extern void make_rgb_spec (rgb_spec_t *rgb_spec, int num_green_bits, int low_green_bit, int num_blue_bits, int low_blue_bit, uint32 seed_x); - +} #endif /* !_RGBUTIL_H_ */ diff --git a/src/include/rsys/safe_alloca.h b/src/include/rsys/safe_alloca.h index dbc3d42d..58f7a68b 100644 --- a/src/include/rsys/safe_alloca.h +++ b/src/include/rsys/safe_alloca.h @@ -20,7 +20,7 @@ #define SAFE_alloca(size) \ ( \ ___newsize = (size) + 3 * sizeof(long), \ - ___tempptr = alloca(___newsize), \ + ___tempptr = (typeof(___tempptr))alloca(___newsize), \ ((uint32 *)___tempptr)[0] = ___newsize, \ ((uint32 *)___tempptr)[1] = FIREWALL_START, \ ___tempptr[___newsize-4] = FIREWALL_STOP_0, \ diff --git a/src/include/rsys/scrap.h b/src/include/rsys/scrap.h index bf197e91..ab8cb53a 100644 --- a/src/include/rsys/scrap.h +++ b/src/include/rsys/scrap.h @@ -8,6 +8,7 @@ * $Id: scrap.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { extern void sendsuspendevent (void); extern void sendresumeevent (boolean_t cvtclip); @@ -20,5 +21,6 @@ extern int get_scrap_helper_dib (void *vh, void *lp); extern void put_scrap_helper_dib (void *lp); #endif #endif +} #endif diff --git a/src/include/rsys/segment.h b/src/include/rsys/segment.h index c68d5203..ad05dc8c 100644 --- a/src/include/rsys/segment.h +++ b/src/include/rsys/segment.h @@ -4,10 +4,9 @@ extern char ROMlib_exit; -#if !defined (USE_WINDOWS_NOT_MAC_TYPEDEFS_AND_DEFINES) - -#include +#include "SegmentLdr.h" +namespace Executor { typedef struct PACKED { INTEGER message; INTEGER count; @@ -24,18 +23,12 @@ extern char *ROMlib_undotdot (char *origp); extern INTEGER ROMlib_num_code_resources; #endif /* ONLY_DESTROY_BETWEEN_CODE_SEGMENTS */ -#if defined (MSDOS) -extern char ROMlib_savecwd[]; -#endif - -#if defined (NEXTSTEP) extern LONGINT ROMlib_appbit, ROMlib_whichapps; extern INTEGER ROMlib_acceptsanotherfile; -#endif extern void ROMlib_seginit (LONGINT argc, char **argv); extern void empty_timer_queues (void); extern BOOLEAN ROMlib_startupscreen; -#endif +} #endif /* !_SEGMENT_H_ */ diff --git a/src/include/rsys/serial.h b/src/include/rsys/serial.h index 10ab53b2..bce489c7 100644 --- a/src/include/rsys/serial.h +++ b/src/include/rsys/serial.h @@ -8,6 +8,7 @@ * $Id: serial.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { typedef struct PACKED{ PACKED_MEMBER(Ptr, p); INTEGER i; @@ -18,5 +19,5 @@ extern OSErr ROMlib_serialprime (ParmBlkPtr pbp, DCtlPtr dcp); extern OSErr ROMlib_serialctl (ParmBlkPtr pbp, DCtlPtr dcp); extern OSErr ROMlib_serialstatus (ParmBlkPtr pbp, DCtlPtr dcp); extern OSErr ROMlib_serialclose (ParmBlkPtr pbp, DCtlPtr dcp); - +} #endif diff --git a/src/include/rsys/slash.h b/src/include/rsys/slash.h index 8acd6708..2d85d6fa 100644 --- a/src/include/rsys/slash.h +++ b/src/include/rsys/slash.h @@ -1,6 +1,10 @@ #if !defined (_SLASH_H_) #define _SLASH_H_ +#ifdef __cplusplus +extern "C" { +#endif + #if defined (MSDOS) || defined (CYGWIN32) extern int Uaccess(const char *path, int mode); @@ -49,4 +53,8 @@ extern int Uclose (int fd); #endif /* !MSDOS && !defined (CYGWIN32) */ +#ifdef __cplusplus +} +#endif + #endif /* !_SLASH_H_ */ diff --git a/src/include/rsys/sounddriver.h b/src/include/rsys/sounddriver.h index 9f486b41..9f1b9d7c 100644 --- a/src/include/rsys/sounddriver.h +++ b/src/include/rsys/sounddriver.h @@ -3,40 +3,39 @@ #include "rsys/soundopts.h" -struct _sound_driver_t -{ - boolean_t (*sound_init) (struct _sound_driver_t *); - void (*sound_shutdown) (struct _sound_driver_t *); - boolean_t (*sound_works_p) (struct _sound_driver_t *); - boolean_t (*sound_silent_p) (struct _sound_driver_t *); - void (*sound_hunger_finish) (struct _sound_driver_t *); - void (*sound_go) (struct _sound_driver_t *); - void (*sound_stop) (struct _sound_driver_t *); - void (*sound_hunger_start) (struct _sound_driver_t *); - struct hunger_info (*sound_get_hunger_info) (struct _sound_driver_t *); - void (*sound_clear_pending) (struct _sound_driver_t *); +namespace Executor { +class SoundDriver { +public: + virtual bool sound_init() = 0; + virtual void sound_shutdown() = 0; + virtual bool sound_works() = 0; + virtual bool sound_silent() = 0; + virtual void sound_go() = 0; + virtual void sound_stop() = 0; + virtual void HungerStart() = 0; + virtual struct hunger_info GetHungerInfo() = 0; + virtual void HungerFinish() = 0; + virtual void sound_clear_pending() = 0; + virtual bool HasSoundClearPending() = 0; }; -typedef struct _sound_driver_t sound_driver_t; - /* Current sound driver in use. */ -extern sound_driver_t sound_driver; +extern SoundDriver *sound_driver; extern void sound_init (void); -#define _SOUND_CALL(func) (sound_driver.func (&sound_driver)) +#define _SOUND_CALL(func) (sound_driver->func ()) #define SOUND_SHUTDOWN() _SOUND_CALL (sound_shutdown) -#define SOUND_WORKS_P() _SOUND_CALL (sound_works_p) -#define SOUND_SILENT_P() _SOUND_CALL (sound_silent_p) -#define SOUND_HUNGER_FINISH() _SOUND_CALL (sound_hunger_finish) +#define SOUND_WORKS_P() _SOUND_CALL (sound_works) +#define SOUND_SILENT_P() _SOUND_CALL (sound_silent) +#define SOUND_HUNGER_FINISH() _SOUND_CALL (HungerFinish) #define SOUND_GO() _SOUND_CALL (sound_go) #define SOUND_STOP() _SOUND_CALL (sound_stop) -#define SOUND_HUNGER_START() _SOUND_CALL (sound_hunger_start) -#define SOUND_GET_HUNGER_INFO() _SOUND_CALL (sound_get_hunger_info) -#define SOUND_GET_HUNGER_INFO() _SOUND_CALL (sound_get_hunger_info) +#define SOUND_HUNGER_START() _SOUND_CALL (HungerStart) +#define SOUND_GET_HUNGER_INFO() _SOUND_CALL (GetHungerInfo) #define SOUND_CLEAR_PENDING() _SOUND_CALL (sound_clear_pending) - +} #include "sound-config.h" #endif /* !_RSYS_SOUNDDRIVER_H_ */ diff --git a/src/include/rsys/soundfake.h b/src/include/rsys/soundfake.h index c03f58fa..45e233be 100644 --- a/src/include/rsys/soundfake.h +++ b/src/include/rsys/soundfake.h @@ -2,7 +2,39 @@ #define _RSYS_SOUNDFAKE_H_ #include "rsys/sounddriver.h" +#include "TimeMgr.h" -extern boolean_t sound_fake_init (sound_driver_t *); +namespace Executor { + class SoundFake: SoundDriver { + public: + virtual bool sound_init(); + virtual void sound_shutdown(); + virtual bool sound_works(); + virtual bool sound_silent(); + virtual void HungerFinish(); + virtual void sound_go(); + virtual void sound_stop(); + virtual void HungerStart(); + virtual struct hunger_info GetHungerInfo(); + virtual void sound_clear_pending(); + virtual bool HasSoundClearPending() { + return true; + } + + private: + snd_time t1; + /* # of fake buffers currently enqueued. */ + int num_fake_buffers_enqueued; + /* Set to TRUE when we're shutting down, and don't want any new sound + * to creep in. + */ + syn68k_addr_t fake_sound_callback; + bool no_more_sound_p; + TMTask fake_sound_tm_task; + static syn68k_addr_t handle_fake_sound_callback (syn68k_addr_t addr, void *junk); + void NoteSoundInterrupt(); + void set_up_tm_task(); + }; +} #endif /* !_RSYS_SOUNDFAKE_H_ */ diff --git a/src/include/rsys/soundopts.h b/src/include/rsys/soundopts.h index 795387df..aa4517a2 100644 --- a/src/include/rsys/soundopts.h +++ b/src/include/rsys/soundopts.h @@ -6,21 +6,22 @@ /* to get extern for `ROMlib_PretendSound' */ #include "rsys/prefs.h" +namespace Executor { typedef enum { soundoff, soundpretend, soundon } sound_t; -#if defined (NEXTSTEP) +#if defined (MACOSX_) extern void ROMlib_outbuffer( char *buf, LONGINT nsamp, LONGINT rate, void *chanp ); extern void ROMlib_callcompletion( void *chanp ); -#else /* !NEXTSTEP */ +#else /* !MACOSX_ */ #define ROMlib_outbuffer(buf, nsamp, rate, chanp) \ ROMlib_soundcomplete (chanp) #define ROMlib_callcompletion(chanp) \ ROMlib_soundcomplete (chanp) -#endif /* !NEXTSTEP */ +#endif /* !MACOSX_ */ extern void ROMlib_soundcomplete( void *chanp ); @@ -66,7 +67,6 @@ typedef struct PACKED _ModifierStub { int current_db; } ModifierStub, *ModifierStubPtr; -extern BOOLEAN C_snth5( SndChannelPtr, SndCommand *, ModifierStubPtr ); #define SND_CHAN_FIRSTMOD(c) MR ((ModifierStubPtr)c->firstMod) #define SND_CHAN_CURRENT_START(c) (SND_CHAN_FIRSTMOD (c)->current_start) @@ -78,12 +78,8 @@ extern BOOLEAN C_snth5( SndChannelPtr, SndCommand *, ModifierStubPtr ); #define SND_CHAN_CMDINPROG_P(c) (SND_CHAN_FLAGS_X (c) & CWC (CHAN_CMDINPROG_FLAG)) #define SND_CHAN_DBINPROG_P(c) (SND_CHAN_FLAGS_X (c) & CWC (CHAN_DBINPROG_FLAG)) -#if !defined (SDL) -#define SND_RATE 22255 -#else extern int ROMlib_SND_RATE; #define SND_RATE ROMlib_SND_RATE -#endif struct hunger_info { @@ -96,8 +92,12 @@ struct hunger_info extern syn68k_addr_t sound_callback (syn68k_addr_t, void *); -extern boolean_t sound_disabled_p; +extern bool sound_disabled_p; extern int ROMlib_get_snd_cmds (Handle sndh, SndCommand **cmdsp); + +BOOLEAN C_snth5( SndChannelPtr, SndCommand *, ModifierStubPtr ); +} + #endif /* !defined(__RSYS_SOUNDOPTS__) */ diff --git a/src/include/rsys/srcblt.h b/src/include/rsys/srcblt.h index e4312d97..32a595ec 100644 --- a/src/include/rsys/srcblt.h +++ b/src/include/rsys/srcblt.h @@ -5,13 +5,15 @@ #include "rsys/cquick.h" #include "rsys/vdriver.h" +extern "C" { + #if !defined (ARCH_PROVIDES_RAW_SRCBLT) #define USE_PORTABLE_SRCBLT #endif -extern boolean_t srcblt_rgn (RgnHandle rh, int mode, int log2_bpp, - const blt_bitmap_t *src, const blt_bitmap_t *dst, - Point *src_origin, Point *dst_origin, +extern boolean_t srcblt_rgn (Executor::RgnHandle rh, int mode, int log2_bpp, + const Executor::blt_bitmap_t *src, const Executor::blt_bitmap_t *dst, + Executor::Point *src_origin, Executor::Point *dst_origin, uint32 fg_color, uint32 bk_color) asm ("_srcblt_rgn"); @@ -47,7 +49,7 @@ extern const void **srcblt_shift_fgbk_i386_stubs SRCBLT_ARRAY[8]; extern int srcblt_log2_bpp asm ("_srcblt_log2_bpp"); -extern const INTEGER *srcblt_rgn_start asm ("_srcblt_rgn_start"); +extern const Executor::INTEGER *srcblt_rgn_start asm ("_srcblt_rgn_start"); extern const void **srcblt_stub_table asm ("_srcblt_stub_table"); @@ -65,5 +67,5 @@ extern char *srcblt_dst_baseaddr asm ("_srcblt_dst_baseaddr"); extern int srcblt_shift_offset asm ("_srcblt_shift_offset"); extern boolean_t srcblt_reverse_scanlines_p asm ("_srcblt_reverse_scanlines_p"); - +} #endif /* !_SRCBLT_H_ */ diff --git a/src/include/rsys/stdbits.h b/src/include/rsys/stdbits.h index 4de6d7b6..76924ca3 100644 --- a/src/include/rsys/stdbits.h +++ b/src/include/rsys/stdbits.h @@ -1,6 +1,6 @@ #if !defined (_STDBITS_H_) #define _STDBITS_H_ - +namespace Executor { struct cleanup_info { enum @@ -28,5 +28,5 @@ extern void canonicalize_bogo_map_cleanup (BitMap *bogo_map, struct cleanup_info *info); extern void canonicalize_bogo_map (BitMap *bogo_map, PixMap **canonical_addr, struct cleanup_info *info); - +} #endif /* !_STDBITS_H_ */ diff --git a/src/include/rsys/stdfile.h b/src/include/rsys/stdfile.h index dd057841..38883c98 100644 --- a/src/include/rsys/stdfile.h +++ b/src/include/rsys/stdfile.h @@ -1,5 +1,5 @@ #if !defined(__RSYS_STDFILE__) -#define __RSYS__STDFILE__ +#define __RSYS_STDFILE__ #include "rsys/pstuff.h" #include "FileMgr.h" @@ -8,6 +8,7 @@ #include "DialogMgr.h" #include "rsys/file.h" +namespace Executor { /* * Copyright 1989 - 1995 by Abacus Research and Development, Inc. * All rights reserved. @@ -44,15 +45,11 @@ extern int linuxfloppy_open(int disk, LONGINT *bsizep, drive_flags_t *flagsp, const char *dname); #endif -extern OSErr C_unixmount( CInfoPBRec *cbp ); - -#if defined (MSDOS) || defined (CYGWIN32) -extern uint32 ROMlib_macdrives; -extern uint32 ROMlib_dosdrives; -#endif enum { STANDARD_HEIGHT = 200, STANDARD_WIDTH = 348 }; extern int nodrivesearch_p; +OSErr C_unixmount( CInfoPBRec *cbp ); +} #endif /* !defined(__RSYS_STDFILE__) */ diff --git a/src/include/rsys/stdio_smashage.h b/src/include/rsys/stdio_smashage.h index d879e8e8..f4e06240 100644 --- a/src/include/rsys/stdio_smashage.h +++ b/src/include/rsys/stdio_smashage.h @@ -11,10 +11,11 @@ #if defined (STDIO_SMASHAGE_DEBUGGING) #define fprintf ROMlib_checking_fprintf +namespace Executor { extern void stdio_smashage_init (void); extern void stdio_smashage_compare (void); extern int ROMlib_checking_fprintf(FILE *stream, const char *format, ...); - +} #endif #endif /* !_STDIO_SMASHAGE_H_ */ diff --git a/src/include/rsys/string.h b/src/include/rsys/string.h index cfa2f558..3edeacb6 100644 --- a/src/include/rsys/string.h +++ b/src/include/rsys/string.h @@ -1,13 +1,15 @@ #if !defined (_RSYS_STRING_H_) #define _RSYS_STRING_H_ +namespace Executor { + #define TEMP_C_STRING_FROM_STR255(str) \ ({ \ char *retval; \ int str_len; \ \ str_len = *(unsigned char *)(str); \ - retval = alloca (str_len + 1); \ + retval = (char*)alloca (str_len + 1); \ memcpy (retval, (unsigned char *) (str) + 1, str_len); \ retval[str_len] = 0; \ retval; \ @@ -15,8 +17,9 @@ extern void str255_from_c_string (Str255 str255, const char *c_stringp); extern char *pstr_index_after (StringPtr p, char c, int i); -extern void str63assign (Str63 new, const StringPtr old); -extern void str31assign (Str63 new, const StringPtr old); +extern void str63assign (Str63 new1, const StringPtr old); +extern void str31assign (Str63 new1, const StringPtr old); extern StringHandle stringhandle_from_c_string (const char *c_stringp); +} #endif /* !_RSYS_STRING_H_ */ diff --git a/src/include/rsys/stub.c b/src/include/rsys/stub.c new file mode 100644 index 00000000..23eab5d3 --- /dev/null +++ b/src/include/rsys/stub.c @@ -0,0 +1,15 @@ +// +// stub.c +// CocoaExecutor +// +// Created by C.W. Betts on 7/31/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#include + + +extern void rsys_stub_func_154485156() +{ + +} diff --git a/src/include/rsys/stubify.h b/src/include/rsys/stubify.h index 5549227c..431764d9 100644 --- a/src/include/rsys/stubify.h +++ b/src/include/rsys/stubify.h @@ -5,6 +5,9 @@ #include "rsys/ptocflags.h" #include "rsys/trapglue.h" +#ifdef __cplusplus +namespace Executor { +#endif extern long CToPascalCall (void *, unsigned long, ...); extern toolstuff_t toolstuff[NTOOLENTRIES]; @@ -5492,6 +5495,12 @@ extern toolstuff_t toolstuff[NTOOLENTRIES]; ( C_AEDeleteItem((A1), (A2)) ) #define AESizeOfNthItem(A1, A2, A3, A4) \ ( C_AESizeOfNthItem((A1), (A2), (A3), (A4)) ) +#undef AEGetKeyDesc +#undef AEPutKeyDesc +#undef AEGetKeyPtr +#undef AEPutKeyPtr +#undef AEDeleteKeyDesc +#undef AESizeOfKeyDesc #define AEGetKeyDesc(A1, A2, A3, A4) \ ( C_AEGetKeyDesc((A1), (A2), (A3), (A4)) ) #define AEPutKeyDesc(A1, A2, A3) \ @@ -6600,6 +6609,8 @@ extern toolstuff_t toolstuff[NTOOLENTRIES]; ? C_BitShift(__stub_arg_1, __stub_arg_2)\ : (LONGINT) CToPascalCall (SYN68K_TO_US(new_addr), CTOP_BitShift , __stub_arg_1, __stub_arg_2));\ }) +#undef HiWord +#undef LoWord #define HiWord(A1) \ ({ \ void *new_addr;\ @@ -7126,6 +7137,8 @@ extern toolstuff_t toolstuff[NTOOLENTRIES]; ( C_GetIndSymbol((A1), (A2), (A3), (A4), (A5)) ) #define FindSymbol(A1, A2, A3, A4) \ ( C_FindSymbol((A1), (A2), (A3), (A4)) ) +#undef NewRoutineDescriptor +#undef DisposeRoutineDescriptor #define NewRoutineDescriptor(A1, A2, A3) \ ( C_NewRoutineDescriptor((A1), (A2), (A3)) ) #define DisposeRoutineDescriptor(A1) \ @@ -7136,4 +7149,8 @@ extern toolstuff_t toolstuff[NTOOLENTRIES]; ( C_SaveMixedModeState((A1), (A2)) ) #define RestoreMixedModeState(A1, A2) \ ( C_RestoreMixedModeState((A1), (A2)) ) + +#ifdef __cplusplus +} +#endif #endif /* !defined(_STUBIFY_H_) */ diff --git a/src/include/rsys/syncint.h b/src/include/rsys/syncint.h index 402cee63..7af9caab 100644 --- a/src/include/rsys/syncint.h +++ b/src/include/rsys/syncint.h @@ -1,31 +1,9 @@ #if !defined (_syncint_h_) #define _syncint_h_ -#if defined (MSDOS) - -#include -#include - -extern uint32 fetch_elapsed_1024 (void); -extern void set_elapsed_1024 (uint32 v); -extern uint8 use_bios_timer_p; -extern boolean_t set_expect_slow_clock (boolean_t will_be_slow_p); - -#define M68K_WATCHDOG_PRIORITY 7 /* unmaskable */ -#define M68K_WATCHDOG_VECTOR (24 + M68K_WATCHDOG_PRIORITY) - -#endif /* MSDOS */ - -#if defined (SDL) -#define SDL_DEFINE_INIT_ONLY - -#include "SDL/SDL.h" -#include "SDL/SDL_timer.h" - -#undef SDL_DEFINE_INIT_ONLY -#endif /* SDL */ - +namespace Executor { extern int syncint_init (void); extern void syncint_post (unsigned long usecs); +} #endif /* !_syncint_h_ */ diff --git a/src/include/rsys/syserr.h b/src/include/rsys/syserr.h index 72529bdd..634eb226 100644 --- a/src/include/rsys/syserr.h +++ b/src/include/rsys/syserr.h @@ -1,6 +1,7 @@ #if !defined (__rsys_syserr_h__) # define __rsys_syserr_h__ +namespace Executor { typedef struct PACKED { INTEGER count; @@ -21,7 +22,7 @@ typedef struct PACKED { INTEGER len3; Rect rect3; - char icon3[32][4]; + unsigned char icon3[32][4]; INTEGER id4; INTEGER len4; @@ -101,5 +102,6 @@ struct PACKED sdef { INTEGER alen; char text[1]; }; +} #endif /* !defined (__rsys_syserr_h__) */ diff --git a/src/include/rsys/system_error.h b/src/include/rsys/system_error.h index 10fc47d3..c2c33b32 100644 --- a/src/include/rsys/system_error.h +++ b/src/include/rsys/system_error.h @@ -1,6 +1,7 @@ #if !defined (_SYSTEM_ERROR_H_) #define _SYSTEM_ERROR_H_ +namespace Executor { enum { GENERIC_COMPLAINT_ID = -3000 }; typedef void (*system_error_callback_t) (void); @@ -12,5 +13,6 @@ extern int system_error (const char *_message, int _default_button, system_error_callback_t func0, system_error_callback_t func1, system_error_callback_t func2); +} #endif /* !_SYSTEM_ERROR_H_ */ diff --git a/src/include/rsys/tempalloc.h b/src/include/rsys/tempalloc.h index 1d9263a6..451acb7e 100644 --- a/src/include/rsys/tempalloc.h +++ b/src/include/rsys/tempalloc.h @@ -102,7 +102,7 @@ do { \ * so there's no need for this complexity. */ #define TEMP_ALLOC_DECL(name) -#define TEMP_ALLOC_ALLOCATE(ptr_var, name, size) (ptr_var = alloca (size)) +#define TEMP_ALLOC_ALLOCATE(ptr_var, name, size) (ptr_var = (typeof(ptr_var))alloca (size)) #define TEMP_ALLOC_FREE(name) #endif /* !MSDOS */ diff --git a/src/include/rsys/tesave.h b/src/include/rsys/tesave.h index d6af0a19..2b08d90c 100644 --- a/src/include/rsys/tesave.h +++ b/src/include/rsys/tesave.h @@ -10,6 +10,7 @@ #include "rsys/pstuff.h" +namespace Executor { typedef struct PACKED { #if 0 @@ -80,20 +81,6 @@ extern void generic_elt_calc_height_ascent (generic_elt_t *elt); #define SCRAP_ELT_TO_GENERIC_ELT(scrap_elt) \ ((generic_elt_t *) (&(scrap_elt)->scrpHeight)) -#if !defined (__STDC__) -extern INTEGER ROMlib_StyleTextWidth(); -extern INTEGER ROMlib_word(); -extern INTEGER ROMlib_caltext(); -extern void ROMlib_togglelite(); -extern void ROMlib_tesave(); -extern void ROMlib_terestore(); -extern void ROMlib_tedoitall(); -extern INTEGER ROMlib_stylecompare(); -extern void ROMlib_teinsertstyleinfo(); -extern void ROMlib_teremovestyleinfo(); -extern INTEGER C_ROMlib_dotext(); -extern void ROMlib_teautoloop(); -#else /* __STDC__ */ extern INTEGER ROMlib_StyleTextWidth( TEPtr tep, INTEGER start, INTEGER count ); extern INTEGER ROMlib_word( char *p ); @@ -120,7 +107,6 @@ extern int16 te_char_to_run_index (TEStyleHandle te_style, int16 sel); extern int16 te_char_to_lineno (TEPtr te, int16 sel); extern void ROMlib_teautoloop( TEHandle teh ); -#endif /* __STDC__ */ extern int16 ROMlib_call_TEDoText (TEPtr tp, int16 first, int16 last, int16 what); @@ -145,5 +131,5 @@ MAKE_HIDDEN(tehiddenh); #define TEHIDDENHX(teh) ((*(HIDDEN_tehiddenh *)&(MR((*teh).p))->recalBack).p) extern void ROMlib_recompute_caret (TEHandle te); - +} #endif /* __TESAVE__ */ diff --git a/src/include/rsys/text.h b/src/include/rsys/text.h index 75bbf869..264f0331 100644 --- a/src/include/rsys/text.h +++ b/src/include/rsys/text.h @@ -8,9 +8,11 @@ * $Id: text.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { extern boolean_t disable_text_printing (void); extern void set_text_printing (boolean_t state); extern INTEGER ROMlib_wordb (char * p); extern int ROMlib_forward_del_p; +} #endif diff --git a/src/include/rsys/time.h b/src/include/rsys/time.h index d9b95b78..b3814a86 100644 --- a/src/include/rsys/time.h +++ b/src/include/rsys/time.h @@ -12,6 +12,7 @@ extern struct timeval ROMlib_start_time; extern unsigned long msecs_elapsed (void); +namespace Executor { #if !defined (USE_WINDOWS_NOT_MAC_TYPEDEFS_AND_DEFINES) extern QHdr ROMlib_timehead; @@ -19,5 +20,6 @@ extern QHdr ROMlib_timehead; extern syn68k_addr_t catchalarm (syn68k_addr_t pc, void *unused); #endif #endif +} #endif /* _RSYS_TIME_H_ */ diff --git a/src/include/rsys/toolevent.h b/src/include/rsys/toolevent.h index fc20be79..3bf56e4c 100644 --- a/src/include/rsys/toolevent.h +++ b/src/include/rsys/toolevent.h @@ -8,6 +8,7 @@ * $Id: toolevent.h 63 2004-12-24 18:19:43Z ctm $ */ +namespace Executor { typedef struct PACKED { INTEGER version; INTEGER tableno[256]; @@ -17,7 +18,9 @@ typedef struct PACKED { extern void dofloppymount (void); extern BOOLEAN ROMlib_beepedonce; -extern int ROMlib_right_button_modifier; extern void ROMlib_send_quit (void); +} + +extern "C" int ROMlib_right_button_modifier; #endif /* !_TOOLEVENT_H_ */ diff --git a/src/include/rsys/toolutil.h b/src/include/rsys/toolutil.h index 0776590f..c1c39703 100644 --- a/src/include/rsys/toolutil.h +++ b/src/include/rsys/toolutil.h @@ -3,10 +3,12 @@ #include "SANE.h" +namespace Executor { extern StringHandle ROMlib_phoney_name_string; extern void unpack_int16_bits (HIDDEN_Ptr *sp, HIDDEN_Ptr *dp, INTEGER len); extern trap void R_Fix2X (void *dummyretpc, Fixed x, extended80 *ret); extern trap void R_Frac2X(void *dummyretpc, Fract x, extended80 *ret); +} #endif /* !defined(__RSYS_TOOLUTIL__) */ diff --git a/src/include/rsys/trapdecl.h b/src/include/rsys/trapdecl.h index 00e3c8ff..f84a035f 100644 --- a/src/include/rsys/trapdecl.h +++ b/src/include/rsys/trapdecl.h @@ -1,71 +1,88 @@ #if !defined (_TRAPDECL_H_) #define _TRAPDECL_H_ +#ifdef __cplusplus +#define ASFunc(v, t0, n0, ...) \ +v t0 Executor::n0(__VA_ARGS__) + +#define PascalFunc(v, t0, n0, ...) \ +v t0 Executor::C_ ## n0(__VA_ARGS__) + +#else +#define ASFunc(v, t0, n0, ...) \ +v t0 n0(__VA_ARGS__) + +#define PascalFunc(v, t0, n0, ...) \ +v t0 C_ ## n0(__VA_ARGS__) + + +#endif + #define A0(v, t0, n0) \ -v t0 n0(void) +ASFunc(v, t0, n0, void) #define A1(v, t0, n0, t1, n1) \ -v t0 n0(t1 n1) +ASFunc(v, t0, n0, t1 n1) #define A2(v, t0, n0, t1, n1, t2, n2) \ -v t0 n0(t1 n1, t2 n2) +ASFunc(v, t0, n0, t1 n1, t2 n2) #define A3(v, t0, n0, t1, n1, t2, n2, t3, n3) \ -v t0 n0(t1 n1, t2 n2, t3 n3) +ASFunc(v, t0, n0, t1 n1, t2 n2, t3 n3) #define A4(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4) \ -v t0 n0(t1 n1, t2 n2, t3 n3, t4 n4) +ASFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4) #define A5(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5) \ -v t0 n0(t1 n1, t2 n2, t3 n3, t4 n4, t5 n5) +ASFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4, t5 n5) #define A6(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5, t6, n6) \ -v t0 n0(t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6) +ASFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6) #define A7(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5, t6, n6, t7, n7)\ -v t0 n0(t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7) +ASFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7) #define A8(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5, t6, n6, t7, n7, t8, n8)\ -v t0 n0(t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8) +ASFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8) #define A9(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5, t6, n6, t7, n7, t8, n8, t9, n9)\ -v t0 n0(t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9) +ASFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9) #define P0(v, t0, n0) \ -v t0 C_ ## n0(void) +PascalFunc(v, t0, n0, void) #define P1(v, t0, n0, t1, n1) \ -v t0 C_ ## n0(t1 n1) +PascalFunc(v, t0, n0, t1 n1) #define P2(v, t0, n0, t1, n1, t2, n2) \ -v t0 C_ ## n0(t1 n1, t2 n2) +PascalFunc(v, t0, n0, t1 n1, t2 n2) #define P3(v, t0, n0, t1, n1, t2, n2, t3, n3) \ -v t0 C_ ## n0(t1 n1, t2 n2, t3 n3) +PascalFunc(v, t0, n0, t1 n1, t2 n2, t3 n3) #define P4(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4) \ -v t0 C_ ## n0(t1 n1, t2 n2, t3 n3, t4 n4) +PascalFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4) #define P5(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5) \ -v t0 C_ ## n0(t1 n1, t2 n2, t3 n3, t4 n4, t5 n5) +PascalFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4, t5 n5) #define P6(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5, t6, n6) \ -v t0 C_ ## n0(t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6) +PascalFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6) #define P7(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5, t6, n6, t7, n7)\ -v t0 C_ ## n0(t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7) +PascalFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7) #define P8(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5, t6, n6, t7, n7, t8, n8)\ -v t0 C_ ## n0(t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8) +PascalFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8) #define P9(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5, t6, n6, t7, n7, t8, n8, t9, n9)\ -v t0 C_ ## n0(t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9) +PascalFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9) #define P10(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5, t6, n6, t7, n7, t8, n8, t9, n9, t10, n10)\ -v t0 C_ ## n0(t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9, t10 n10) +PascalFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9, t10 n10) #define P11(v, t0, n0, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5, t6, n6, t7, n7, t8, n8, t9, n9, t10, n10, t11, n11)\ -v t0 C_ ## n0(t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9, t10 n10, t11 n11) +PascalFunc(v, t0, n0, t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7, t8 n8, t9 n9, t10 n10, t11 n11) #define P_SAVED0D1A0A1_0 P0 #define P_SAVED0D1A0A1_1 P1 diff --git a/src/include/rsys/trapglue.h b/src/include/rsys/trapglue.h index 69549e12..cba645f7 100644 --- a/src/include/rsys/trapglue.h +++ b/src/include/rsys/trapglue.h @@ -1,6 +1,9 @@ #if !defined(__TRAPGLUE__) #define __TRAPGLUE__ +#ifdef __cplusplus +namespace Executor { +#endif typedef struct { void *wheretogo; ULONGINT magic; @@ -26,7 +29,9 @@ extern void *ostraptable[NOSENTRIES]; extern syn68k_addr_t PascalToCCall(syn68k_addr_t ignoreme, ptocblock_t *infop); - extern unsigned short mostrecenttrap; +#ifdef __cplusplus +} +#endif #endif diff --git a/src/include/rsys/types.h b/src/include/rsys/types.h index 1c74e37d..c626b0ea 100644 --- a/src/include/rsys/types.h +++ b/src/include/rsys/types.h @@ -2,12 +2,16 @@ #define _RSYS_TYPES_H_ #if !defined (INT_TYPES_TYPEDEFED) -typedef unsigned char uint8; -typedef signed char int8; -typedef unsigned short uint16; -typedef signed short int16; -typedef unsigned int uint32; -typedef signed int int32; +#include +#include +typedef int8_t int8; +typedef uint8_t uint8; +typedef int16_t int16; +typedef uint16_t uint16; +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; #define INT_TYPES_TYPEDEFED #endif /* !INT_TYPES_TYPEDEFED */ diff --git a/src/include/rsys/uniquefile.h b/src/include/rsys/uniquefile.h index af00c4aa..0bfd55e2 100644 --- a/src/include/rsys/uniquefile.h +++ b/src/include/rsys/uniquefile.h @@ -8,8 +8,10 @@ * $Id: uniquefile.h 63 2004-12-24 18:19:43Z ctm $ */ -extern boolean_t unique_file_name (const char *template, +namespace Executor { +extern boolean_t unique_file_name (const char *template1, const char *default_template, Str255 result); +} #endif /* !_RSYS_UNIQUEFILE_ */ diff --git a/src/include/rsys/vbl.h b/src/include/rsys/vbl.h index 6a04dc53..b2a4f788 100644 --- a/src/include/rsys/vbl.h +++ b/src/include/rsys/vbl.h @@ -1,7 +1,9 @@ #if !defined(__RSYS_VBL__) #define __RSYS_VBL__ +namespace Executor { extern void C_ROMlib_vcatch( void ); +} #endif /* !defined(__RSYS_VBL__) */ diff --git a/src/include/rsys/vdriver.h b/src/include/rsys/vdriver.h index d6c623c9..b4aef145 100644 --- a/src/include/rsys/vdriver.h +++ b/src/include/rsys/vdriver.h @@ -2,11 +2,15 @@ #if !defined (_VDRIVER_H_) #define _VDRIVER_H_ +namespace Executor { struct ColorSpec; +} #include "rsys/rgbutil.h" #include "host_bltmacros.h" +namespace Executor { + /* Minimum screen size we'll allow. */ #define VDRIVER_MIN_SCREEN_WIDTH 512 #define VDRIVER_MIN_SCREEN_HEIGHT 342 @@ -42,12 +46,12 @@ typedef enum VDRIVER_ACCEL_FULL_UPDATE, VDRIVER_ACCEL_HOST_SCREEN_UPDATE_ONLY } vdriver_accel_result_t; - +} /* host_vdriver.h can override some of the following with macros. */ #include "host_vdriver.h" - +namespace Executor { #if !defined (vdriver_init) extern boolean_t vdriver_init (int max_width, int max_height, int max_bpp, boolean_t fixed_p, int *argc, char *argv[]); @@ -188,5 +192,5 @@ extern boolean_t vdriver_grayscale_p; #if !defined (vdriver_fixed_clut_p) extern boolean_t vdriver_fixed_clut_p; #endif - +} #endif /* !_VDRIVER_H_ */ diff --git a/src/include/rsys/version.h b/src/include/rsys/version.h index c0f7d6ec..1fa8b98d 100644 --- a/src/include/rsys/version.h +++ b/src/include/rsys/version.h @@ -3,6 +3,10 @@ /* $Id: version.h 94 2005-05-25 15:53:40Z ctm $ */ +#ifdef __cplusplus +extern "C" { +#endif + #if !defined (EXECUTOR_VERSION) #define EXECUTOR_VERSION "2.1pr16" /* don't forget EXECUTOR_VERSION_NUMERIC */ #endif @@ -35,7 +39,7 @@ extern char *ROMlib_executor_full_name; #define VERSION_SIG PLATFORM_CYGWIN32 #elif defined(LINUX) #define VERSION_SIG PLATFORM_LINUX -#elif defined(MACOSX) +#elif defined(MACOSX_) #define VERSION_SIG PLATFORM_MACOSX #else #error "Need VERSION_SIG #define" @@ -55,4 +59,8 @@ enum extern void ROMlib_set_system_version (uint32 version); +#ifdef __cplusplus +} +#endif + #endif /* !_RSYS_VERSION_H_ */ diff --git a/src/include/rsys/vgavdriver.h b/src/include/rsys/vgavdriver.h index d84c8b03..b6a43793 100644 --- a/src/include/rsys/vgavdriver.h +++ b/src/include/rsys/vgavdriver.h @@ -3,6 +3,7 @@ #include "rsys/vdriver.h" +namespace Executor { typedef struct { int width; @@ -111,4 +112,6 @@ extern boolean_t vgahost_unmap_linear_fbuf (unsigned long num_bytes); extern void vgahost_set_rw_windows (int win); extern void vgahost_set_read_window (int win); extern void vgahost_set_write_window (int win); +} + #endif /* !_VGADRIVER_H_ */ diff --git a/src/include/rsys/wind.h b/src/include/rsys/wind.h index 92abc50b..ff2ffd6a 100644 --- a/src/include/rsys/wind.h +++ b/src/include/rsys/wind.h @@ -1,6 +1,6 @@ #if !defined(__WIND_H_) -#define _WIND_H_ +#define __WIND_H_ /* * Copyright 1986, 1989, 1990 by Abacus Research and Development, Inc. @@ -18,6 +18,7 @@ #include "rsys/smash.h" #include "rsys/pstuff.h" +namespace Executor { typedef struct PACKED { Rect _wrect; INTEGER _wprocid; @@ -116,5 +117,6 @@ extern RGBColor *validate_colors_for_window (GrafPtr w); #define WINDOW_NEXT_WINDOW(wp) (MR (WINDOW_NEXT_WINDOW_X (wp))) #define WINDOW_PIC(wp) (MR (WINDOW_PIC_X (wp))) #define WINDOW_REF_CON(wp) (Cx (WINDOW_REF_CON_X (wp))) +} #endif /* !_WIND_H_ */ diff --git a/src/include/rsys/x.h b/src/include/rsys/x.h index 52e0502a..41f87ee3 100644 --- a/src/include/rsys/x.h +++ b/src/include/rsys/x.h @@ -1,6 +1,8 @@ #if !defined(_RSYS_X_H_) #define _RSYS_X_H_ +namespace Executor { extern void ROMlib_set_curr_width_height (void); +} #endif /* !defined(_RSYS_X_H_) */ diff --git a/src/include/rsys/xdata.h b/src/include/rsys/xdata.h index 3e3e3a89..fef63399 100644 --- a/src/include/rsys/xdata.h +++ b/src/include/rsys/xdata.h @@ -5,7 +5,7 @@ #include "rsys/rgbutil.h" #include "rsys/cquick.h" - +namespace Executor { typedef struct { uint16 x_rot_count; /* Number of pixels x-rotated. */ @@ -67,5 +67,5 @@ xdata_for_pixpat_with_space (p, d, \ extern xdata_handle_t xdata_for_pattern (const Pattern pattern, PixMapPtr target); extern void xdata_free (xdata_handle_t x); - +} #endif /* !defined (_RSYS_XDATA_H_) */ diff --git a/src/include/rsys/xdblt.h b/src/include/rsys/xdblt.h index 4b55ec3a..28a7f776 100644 --- a/src/include/rsys/xdblt.h +++ b/src/include/rsys/xdblt.h @@ -12,6 +12,7 @@ #define USE_PORTABLE_PATBLT #endif +extern "C" { extern void xdblt_canon_pattern (void) #if !defined (USE_PORTABLE_PATBLT) asm ("_xdblt_canon_pattern") @@ -22,6 +23,7 @@ extern char xdblt_nop asm ("_xdblt_nop"); extern char xdblt_short_init_ebp asm ("_xdblt_short_init_ebp"); extern char xdblt_tall_narrow_init_ebp asm ("_xdblt_tall_narrow_init_ebp"); extern char xdblt_tall_wide_init_ebp asm ("_xdblt_tall_wide_init_ebp"); +} extern const void *xdblt_nop_table[]; @@ -32,6 +34,7 @@ extern const void **xdblt_tall_narrow_stubs[5]; extern const void **xdblt_short_wide_stubs[5]; extern const void **xdblt_tall_wide_stubs[5]; +namespace Executor { extern boolean_t xdblt_xdata_norgb_norotate (RgnHandle rh, int mode, int pat_x_rotate_count, int pat_y_rotate_count, @@ -50,8 +53,9 @@ extern boolean_t xdblt_pattern (RgnHandle rh, int mode, int pat_x_rotate_count, int pat_y_rotate_count, const Pattern pattern, PixMap *dst, uint32 fg_color, uint32 bk_color); +} - +extern "C" { extern uint32 xdblt_pattern_value asm ("_xdblt_pattern_value"); extern uint32 xdblt_log2_pattern_row_bytes asm ("_xdblt_log2_pattern_row_bytes"); @@ -62,13 +66,13 @@ extern uint32 *xdblt_pattern_end asm ("_xdblt_pattern_end"); extern uint32 xdblt_pattern_row_0 asm ("_xdblt_pattern_row_0"); extern const void **xdblt_stub_table asm ("_xdblt_stub_table"); extern uint32 xdblt_log2_bpp asm ("_xdblt_log2_bpp"); -extern const INTEGER *xdblt_rgn_start asm ("_xdblt_rgn_start"); +extern const Executor::INTEGER *xdblt_rgn_start asm ("_xdblt_rgn_start"); extern uint32 xdblt_x_offset asm ("_xdblt_x_offset"); extern uint32 *xdblt_dst_baseaddr asm ("_xdblt_dst_baseaddr"); extern uint32 xdblt_dst_row_bytes asm ("_xdblt_dst_row_bytes"); extern uint32 xdblt_insert_bits asm ("_xdblt_insert_bits"); extern const uint32 xdblt_mask_array[32] asm ("_xdblt_mask_array"); - +} /* This must be a macro instead of a function because it sometimes * does an alloca. This macro is used by both the pattern and source @@ -93,12 +97,12 @@ do { \ else \ { \ INTEGER *space; \ - ptr_name = space = alloca (72 * 1024); \ + ptr_name = space = (INTEGER*)alloca (72 * 1024); \ nonspecial_rgn_to_special_rgn (RGNP_DATA (r), space); \ } \ } while (0) -extern INTEGER phony_special_region[7]; +extern Executor::INTEGER phony_special_region[7]; typedef enum { diff --git a/src/ini.c b/src/ini.cpp similarity index 60% rename from src/ini.c rename to src/ini.cpp index 665b5e2c..8c7c9310 100644 --- a/src/ini.c +++ b/src/ini.cpp @@ -15,38 +15,36 @@ char ROMlib_rcsid_ini[] = #include "rsys/common.h" #include +#include #include "rsys/ini.h" +using namespace Executor; + typedef struct heading_link_str { struct heading_link_str *next; heading_t heading; pair_link_t *pairs; -} -heading_link_t; +} heading_link_t; PRIVATE heading_link_t *headings; PUBLIC heading_t -new_heading (unsigned char *start, int len) +Executor::new_heading (unsigned char *start, int len) { heading_t retval; heading_link_t *linkp; - linkp = malloc (sizeof *linkp); + linkp = (heading_link_t*)malloc (sizeof *linkp); if (!linkp) retval = NULL; - else - { - linkp->heading = malloc (len + 1); - if (!linkp->heading) - { + else { + linkp->heading = (heading_t)malloc (len + 1); + if (!linkp->heading) { retval = NULL; free (linkp); - } - else - { + } else { strncpy (linkp->heading, (char *) start, len); linkp->heading[len] = 0; linkp->next = headings; @@ -54,7 +52,7 @@ new_heading (unsigned char *start, int len) headings = linkp; retval = linkp->heading; } - } + } return retval; } @@ -67,57 +65,46 @@ find_heading (heading_t heading) if (cachep && strcmp (cachep->heading, heading) == 0) retval = cachep; - else - { - for (retval = headings; - retval && strcmp (retval->heading, heading) != 0; - retval = retval->next) - ; - if (retval) - cachep = retval; - } + else { + for (retval = headings; + retval && strcmp (retval->heading, heading) != 0; + retval = retval->next) + ; + if (retval) + cachep = retval; + } return retval; } PUBLIC void -new_key_value_pair (heading_t heading, unsigned char *keystart, int keylen, +Executor::new_key_value_pair (heading_t heading, unsigned char *keystart, int keylen, unsigned char *valuestart, int valuelen) { - pair_link_t *pairp; - - pairp = malloc (sizeof *pairp); - if (pairp) - { - pairp->key = malloc (keylen+1); - if (!pairp->key) - free (pairp); - else - { - pairp->value = malloc (valuelen+1); - if (!pairp->value) - { - free (pairp->key); - free (pairp); - } - else - { - heading_link_t *headingp; - - strncpy (pairp->key, (char *) keystart, keylen); - pairp->key[keylen] = 0; - strncpy (pairp->value, (char *) valuestart, valuelen); - pairp->value[valuelen] = 0; - headingp = find_heading (heading); - pairp->next = 0; - if (!headingp) - { + pair_link_t *pairp = (pair_link_t*)malloc (sizeof *pairp); + if (pairp) { + pairp->key = (ini_key_t)malloc (keylen+1); + if (!pairp->key) + free (pairp); + else { + pairp->value = (value_t)malloc (valuelen+1); + if (!pairp->value) { + free (pairp->key); + free (pairp); + } else { + heading_link_t *headingp; + + strncpy (pairp->key, (char *) keystart, keylen); + pairp->key[keylen] = 0; + strncpy (pairp->value, (char *) valuestart, valuelen); + pairp->value[valuelen] = 0; + headingp = find_heading (heading); + pairp->next = 0; + if (!headingp) { warning_unexpected ("couldn't find %s", heading); free (pairp->key); free (pairp->value); free (pairp); - } - else - { + } else { pair_link_t **pairpp; for (pairpp = &headingp->pairs; @@ -126,9 +113,9 @@ new_key_value_pair (heading_t heading, unsigned char *keystart, int keylen, ; *pairpp = pairp; } - } + } } - } + } } #if 0 @@ -159,21 +146,18 @@ discard_all_inis (void) #endif PUBLIC boolean_t -read_ini_file (const char *filename) +Executor::read_ini_file (const char *filename) { + using namespace std; FILE *fp; boolean_t retval; fp = fopen (filename, "r"); - if (fp) - { - heading_t heading; - int line; + if (fp) { + string heading = ""; + int line = 0; - heading = ""; - line = 0; - while (!feof (fp)) - { + while (!feof (fp)) { unsigned char buf[1024]; unsigned char *p; @@ -183,80 +167,76 @@ read_ini_file (const char *filename) for (p = buf; *p && isspace (*p); ++p) ; - switch (*p) - { + switch (*p) { case '[': - { - unsigned char *ep; - - ++p; - ep = (unsigned char *) strrchr ((char *) p, ']'); - if (*ep) - heading = new_heading (p, ep - p); - else - warning_unexpected ("missing ] on line %d", line); - } + { + unsigned char *ep; + + ++p; + ep = (unsigned char *) strrchr ((char *) p, ']'); + if (*ep) + heading = new_heading (p, ep - p); + else + warning_unexpected ("missing ] on line %d", line); + } break; case '#': case 0: break; default: - { - unsigned char *eq; - - eq = (unsigned char *) strchr ((char *) p, '='); - if (!eq) - warning_unexpected ("missing = on line %d", line); - else - { + { + unsigned char *eq; + + eq = (unsigned char *) strchr ((char *) p, '='); + if (!eq) + warning_unexpected ("missing = on line %d", line); + else { unsigned char *ep; ep = p + strlen ((char *) p); while (isspace (*(ep-1))) --ep; - new_key_value_pair (heading, p, eq - p, eq+1, ep-eq-1); + new_key_value_pair ((heading_t)heading.c_str(), p, eq - p, eq+1, ep-eq-1); } - } + } break; - } + } } - } + } retval = !!fp; return retval; } PUBLIC pair_link_t * -get_pair_link_n (heading_t heading, int n) +Executor::get_pair_link_n (heading_t heading, int n) { pair_link_t *retval; heading_link_t *headingp; retval = NULL; headingp = find_heading (heading); - if (headingp) - { - retval = headingp->pairs; - while (retval && n > 0) - { + if (headingp) { + retval = headingp->pairs; + while (retval && n > 0) { retval = retval->next; --n; } - } + } return retval; } PUBLIC FILE * -open_ini_file_for_writing (const char *filename) +Executor::open_ini_file_for_writing (const char *filename) { FILE *retval; - + retval = fopen (filename, "w"); return retval; } PUBLIC boolean_t -add_heading_to_file (FILE *fp, heading_t heading) +Executor::add_heading_to_file (FILE *fp, heading_t heading) { boolean_t retval; @@ -265,7 +245,7 @@ add_heading_to_file (FILE *fp, heading_t heading) } PUBLIC boolean_t -add_key_value_to_file (FILE *fp, ini_key_t key, value_t value) +Executor::add_key_value_to_file (FILE *fp, ini_key_t key, value_t value) { boolean_t retval; @@ -274,7 +254,7 @@ add_key_value_to_file (FILE *fp, ini_key_t key, value_t value) } PUBLIC boolean_t -close_ini_file (FILE *fp) +Executor::close_ini_file (FILE *fp) { boolean_t retval; @@ -283,17 +263,15 @@ close_ini_file (FILE *fp) } PUBLIC value_t -find_key (heading_t heading, ini_key_t key) +Executor::find_key (heading_t heading, ini_key_t key) { value_t retval; heading_link_t *headingp; retval = NULL; - if (heading && key) - { - headingp = find_heading (heading); - if (headingp) - { + if (heading && key) { + headingp = find_heading (heading); + if (headingp) { pair_link_t *pairp; for (pairp = headingp->pairs; @@ -303,6 +281,6 @@ find_key (heading_t heading, ini_key_t key) if (pairp) retval = pairp->value; } - } + } return retval; } diff --git a/src/interfacelib.c b/src/interfacelib.cpp similarity index 99% rename from src/interfacelib.c rename to src/interfacelib.cpp index 0d11bb13..f1d6f1d3 100644 --- a/src/interfacelib.c +++ b/src/interfacelib.cpp @@ -72,6 +72,8 @@ char ROMlib_rcsid_interfacelib[] = #include "rsys/emustubs.h" #include "rsys/mixed_mode.h" +using namespace Executor; + #if 0 /* set of routines that are known to have point trouble */ Routines that actually return points: diff --git a/src/iu.c b/src/iu.cpp similarity index 95% rename from src/iu.c rename to src/iu.cpp index ed93bbca..6b070662 100644 --- a/src/iu.c +++ b/src/iu.cpp @@ -20,12 +20,46 @@ char ROMlib_rcsid_iu[] = #include "rsys/hook.h" #include +using namespace Executor; + /* * outl adds the characters in the four bytes of a longint to the place * pointed to by the pointer pointed to by opp, the pointer pointed to * by opp is incremented for each character that is added. */ + +namespace Executor { + typedef struct { + unsigned char primary; + unsigned char secondary; + } sorttype; + +#if !defined (__STDC__) + typedef INTEGER (*locptype)(); +#else /* __STDC__ */ + typedef INTEGER (*locptype)( Ptr ptr, INTEGER len, sorttype *sp ); +#endif /* __STDC__ */ + + PRIVATE void outl(LONGINT, char**); + PRIVATE void outs(StringPtr, INTEGER, char**); + PRIVATE void outn(INTEGER, BOOLEAN, char**); + PRIVATE void month(INTEGER, Intl0Ptr, char, char**); + PRIVATE void day(INTEGER, Intl0Ptr, char, char**); + PRIVATE void year(INTEGER, Intl0Ptr, char, char**); + PRIVATE INTEGER defaultorder(unsigned char *, INTEGER, + sorttype *); + PRIVATE INTEGER germanylocalization(unsigned char *, INTEGER, + sorttype*); + PRIVATE INTEGER britainlocalization(unsigned char *, INTEGER, + sorttype *); + PRIVATE INTEGER defaultlocalization(unsigned char *, INTEGER, + sorttype *); + PRIVATE INTEGER iuhelper(Ptr, Ptr, INTEGER, + INTEGER, BOOLEAN); +} + + A2(PRIVATE, void, outl, LONGINT, l, char **, opp) { if (l & 0xFF000000) { @@ -291,11 +325,6 @@ P3(PUBLIC pascal trap, void, IUSetIntl, INTEGER, rn, /* IMI-506 */ UseResFile(oldcurmap); } -typedef struct { - unsigned char primary; - unsigned char secondary; -} sorttype; - PRIVATE sorttype highsortvalues[] = { { 'A', 0x02 }, { 'A', 0x04 }, { 'C', 0x01 }, { 'E', 0x01 }, { 'N', 0x01 }, { 'O', 0x01 }, { 'U', 0x01 }, { 'A', 0x81 }, @@ -493,11 +522,6 @@ A3(PRIVATE, INTEGER, defaultlocalization, unsigned char *, cp, INTEGER, len, * the exact format of localization routines, we don't care, for now. */ -#if !defined (__STDC__) -typedef INTEGER (*locptype)(); -#else /* __STDC__ */ -typedef INTEGER (*locptype)( Ptr ptr, INTEGER len, sorttype *sp ); -#endif /* __STDC__ */ A5(PRIVATE, INTEGER, iuhelper, Ptr, ptr1, Ptr, ptr2, INTEGER, len1, INTEGER, len2, BOOLEAN, ignoresec) diff --git a/src/iv-stubs.c b/src/iv-stubs.cpp similarity index 95% rename from src/iv-stubs.c rename to src/iv-stubs.cpp index 6d37d925..3128ef10 100644 --- a/src/iv-stubs.c +++ b/src/iv-stubs.cpp @@ -31,6 +31,8 @@ char ROMlib_rcsid_vi_stubs[] #include #include +using namespace Executor; + #define print_errno_error_message(call, msg) \ ({ \ fprintf (stderr, "%s:%d; %s: %s; %s\n", \ @@ -158,7 +160,7 @@ dump_image (BitMap *bogo_bitmap, Rect *rect) map_height = RECT_HEIGHT (&pixmap->bounds); map_row_bytes = ((width * 8 + 31) / 32) * 4; - base_addr = alloca (map_row_bytes * height); + base_addr = (char*)alloca (map_row_bytes * height); new_pixmap.rowBytes = CW (map_row_bytes); new_pixmap.baseAddr = RM ((Ptr) base_addr); @@ -169,7 +171,7 @@ dump_image (BitMap *bogo_bitmap, Rect *rect) new_pixmap.pmTable = NULL; - conv_table = alloca (CTAB_STORAGE_FOR_SIZE (1 << depth)); + conv_table = (ColorTable*)alloca (CTAB_STORAGE_FOR_SIZE (1 << depth)); for (i = 0; i < (1 << depth); i ++) conv_table->ctTable[i].value = CW (i); @@ -207,7 +209,7 @@ dump_rgn_as_image (RgnHandle rh) bm.bounds = RGN_BBOX (rh); row_bytes = ((RECT_WIDTH (&bm.bounds) + 31) / 32) * 4; bm.rowBytes = CW (row_bytes); - baseaddr = alloca (row_bytes * RECT_HEIGHT (&bm.bounds)); + baseaddr = (char*)alloca (row_bytes * RECT_HEIGHT (&bm.bounds)); bm.baseAddr = RM ((Ptr) baseaddr); memset (baseaddr, '\377', row_bytes * RECT_HEIGHT (&bm.bounds)); diff --git a/src/keycode.c b/src/keycode.mm similarity index 91% rename from src/keycode.c rename to src/keycode.mm index 61230339..a2e96065 100644 --- a/src/keycode.c +++ b/src/keycode.mm @@ -48,10 +48,8 @@ char ROMlib_rcsid_keycode[] = "$Id: keycode.c 63 2004-12-24 18:19:43Z ctm $"; #include "rsys/common.h" #include "rsys/next.h" -#if defined(NEXTSTEP) && 0 -#include "next/MacAppClass.h" -#include "next/MacViewClass.h" -#endif +#import "MacAppClass.h" +#import "MacViewClass.h" #include "rsys/soundopts.h" #include "rsys/blockinterrupts.h" @@ -61,6 +59,8 @@ char ROMlib_rcsid_keycode[] = "$Id: keycode.c 63 2004-12-24 18:19:43Z ctm $"; #include "rsys/keycode.h" +using namespace Executor; + PUBLIC int valid_key_format(const unsigned char *key) { int retval; @@ -92,7 +92,7 @@ PUBLIC int valid_key_format(const unsigned char *key) */ -PUBLIC ordering_t InitialTr = { +PUBLIC ordering_t Executor::InitialTr = { 0, 58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, @@ -100,7 +100,7 @@ PUBLIC ordering_t InitialTr = { 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7, }; -PUBLIC ordering_t FinalTr = { +PUBLIC ordering_t Executor::FinalTr = { 0, 40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31, 38, 6, 46, 14, 54, 22, 62, 30, 37, 5, 45, 13, 53, 21, 61, 29, @@ -108,7 +108,7 @@ PUBLIC ordering_t FinalTr = { 34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25, }; -PUBLIC ordering_t swap = { +PUBLIC ordering_t Executor::swap = { 0, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, @@ -116,7 +116,7 @@ PUBLIC ordering_t swap = { 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, }; -PUBLIC ordering_t KeyTr1 = { +PUBLIC ordering_t Executor::KeyTr1 = { 0, 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, @@ -216,7 +216,7 @@ PRIVATE unsigned char rots[33] = { 28, 55, 54, 54, 54, 54, 54, 54, 55, 54, 54, 54, 54, 54, 54, 55 }; -PUBLIC void transpose(block_t data, ordering_t t, int n) +PUBLIC void Executor::transpose(block_t data, ordering_t t, int n) { block_t x; int i; @@ -239,7 +239,7 @@ PRIVATE void rotate(block_t key) memcpy(key, x, sizeof(block_t)); } -PUBLIC void f(int i, block_t key, block_t a, block_t x) +PUBLIC void Executor::f(int i, block_t key, block_t a, block_t x) { block_t e, ikey, y; int r, k, j; @@ -265,7 +265,7 @@ PUBLIC void f(int i, block_t key, block_t a, block_t x) transpose(x, ptr, 32); } -PUBLIC void undes(block_t ciphertext, block_t keyin, block_t plaintext) +PUBLIC void Executor::undes(block_t ciphertext, block_t keyin, block_t plaintext) { int i, j; block_t a, b, x, key; @@ -295,7 +295,7 @@ PUBLIC void undes(block_t ciphertext, block_t keyin, block_t plaintext) * FIXME: need 32 bits here, and need to change user, app and special */ -PUBLIC int serial_bits[32] = +PUBLIC int Executor::serial_bits[32] = { #if defined (RELEASE_PRE_BETA) 46,20,36,23, 5,45,12, 3, @@ -310,7 +310,7 @@ PUBLIC int serial_bits[32] = #endif }; -PUBLIC int n_cpu_bits[16] = +PUBLIC int Executor::n_cpu_bits[16] = { #if defined (RELEASE_PRE_BETA) 56,25,32,61,37,34,49,42, @@ -321,7 +321,7 @@ PUBLIC int n_cpu_bits[16] = #endif }; -PUBLIC int revision_number_bits[4] = +PUBLIC int Executor::revision_number_bits[4] = { #if defined (RELEASE_PRE_BETA) 33, @@ -336,23 +336,23 @@ PUBLIC int revision_number_bits[4] = #endif }; -PUBLIC int expiration_date_bits[8] = +PUBLIC int Executor::expiration_date_bits[8] = { 40,47,48,50,51,52,54,57 }; -PUBLIC int unassigned_bits[5] = +PUBLIC int Executor::unassigned_bits[5] = { 0, 58,59,62,63, /* NOTE: 0 must be included here, because currently we */ }; /* don't even encode bit 0 in our key */ #if defined (RELEASE_PRE_BETA) -PUBLIC unsigned char key32[32] = "gq2kt8ziwjc5x6vde79f3b4nysphmaur"; +PUBLIC unsigned char Executor::key32[] = "gq2kt8ziwjc5x6vde79f3b4nysphmaur"; #else -PUBLIC unsigned char key32[32] = "5x6vde79f3b4nysphmaurgq2kt8ziwjc"; +PUBLIC unsigned char Executor::key32[] = "5x6vde79f3b4nysphmaurgq2kt8ziwjc"; #endif -PUBLIC block_t key = { +PUBLIC block_t Executor::key = { 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, @@ -364,7 +364,7 @@ PUBLIC block_t key = { 0, 1, 0, 1, 1, 1, 0, 1, }; -PUBLIC void texttoblock(const unsigned char *theirkey, block_t text) +PUBLIC void Executor::texttoblock(const unsigned char *theirkey, block_t text) { static int beenhere = 0; static unsigned char translate[256]; @@ -390,7 +390,7 @@ PUBLIC void texttoblock(const unsigned char *theirkey, block_t text) } } -PUBLIC void bitstonum(unsigned long *result, const int *locs, int numbits, +PUBLIC void Executor::bitstonum(unsigned long *result, const int *locs, int numbits, const block_t text) { unsigned long l; @@ -401,7 +401,7 @@ PUBLIC void bitstonum(unsigned long *result, const int *locs, int numbits, *result |= l; } -PUBLIC int decode(const unsigned char *theirkey, decoded_info_t *infop) +PUBLIC int Executor::decode(const unsigned char *theirkey, decoded_info_t *infop) { block_t ciphertext, plaintext; unsigned long templong; diff --git a/src/launch.c b/src/launch.cpp similarity index 96% rename from src/launch.c rename to src/launch.cpp index 90c558c4..bcb05017 100644 --- a/src/launch.c +++ b/src/launch.cpp @@ -87,9 +87,11 @@ char ROMlib_rcsid_launch[] = #include "rsys/version.h" #include "rsys/appearance.h" +using namespace Executor; + PRIVATE boolean_t ppc_launch_p = FALSE; -PUBLIC void ROMlib_set_ppc (boolean_t val) +PUBLIC void Executor::ROMlib_set_ppc (boolean_t val) { ppc_launch_p = val; } @@ -97,8 +99,10 @@ PUBLIC void ROMlib_set_ppc (boolean_t val) #define CONFIGEXTENSION ".ecf" #define OLD_CONFIG_EXTENSION ".econf" /* must be longer than configextension */ +//Exported as a C value FILE *configfile; +//Exported as a C value int32 ROMlib_options; static int16 name0stripappl(StringPtr name) @@ -126,14 +130,14 @@ static int16 name0stripappl(StringPtr name) * the user has changed things by hand). */ -PUBLIC int ROMlib_nowarn32; +PUBLIC int Executor::ROMlib_nowarn32; PUBLIC char *ROMlib_configfilename = NULL; -PUBLIC int ROMlib_pretend_help = FALSE; -PUBLIC int ROMlib_pretend_alias = FALSE; -PUBLIC int ROMlib_pretend_edition = FALSE; -PUBLIC int ROMlib_pretend_script = FALSE; +PUBLIC int Executor::ROMlib_pretend_help = FALSE; +PUBLIC int Executor::ROMlib_pretend_alias = FALSE; +PUBLIC int Executor::ROMlib_pretend_edition = FALSE; +PUBLIC int Executor::ROMlib_pretend_script = FALSE; void remalloc (char **strp) @@ -144,7 +148,7 @@ remalloc (char **strp) if (*strp) { len = strlen (*strp) + 1; - new_string = malloc (len); + new_string = (char*)malloc (len); if (new_string) memcpy (new_string, *strp, len); *strp = new_string; @@ -179,7 +183,7 @@ PRIVATE void ParseConfigFile(StringPtr exefname, OSType type) allocsize = sizeof("0x1234ABCD")-1; /* BELOW */ dirsize = strlen(ROMlib_ConfigurationFolder); ROMlib_configfilename = - realloc(ROMlib_configfilename, + (char*)realloc(ROMlib_configfilename, dirsize + 1 + allocsize + sizeof(OLD_CONFIG_EXTENSION)); strdst = (Ptr) ROMlib_configfilename; BlockMove((Ptr) ROMlib_ConfigurationFolder, strdst, dirsize); @@ -301,7 +305,7 @@ do \ \ _x = (x); \ len = strlen (_x) + 1; \ - _title = alloca (len); \ + _title = (char*)alloca (len); \ memcpy (_title, _x, len); \ ROMlib_localize_string (_title); \ ROMlib_SetTitle (_title); \ @@ -314,7 +318,7 @@ while (0) SetTitle(ROMlib_WindowName); else { strwidth = fname0; - newtitle = alloca(strwidth + 1); + newtitle = (char*)alloca(strwidth + 1); memcpy(newtitle, exefname+1, strwidth); newtitle[strwidth] = 0; dot = strrchr(newtitle, '.'); @@ -365,18 +369,18 @@ PRIVATE void beginexecutingat( LONGINT startpc ) C_ExitToShell(); } -PUBLIC LONGINT ROMlib_appbit; +PUBLIC LONGINT Executor::ROMlib_appbit; -size_info_t size_info; +size_info_t Executor::size_info; #define VERSFMT "(0x%02x, 0x%02x, 0x%02x, 0x%02x, %d)" #define VERSSIZE(vp) (sizeof(VERSFMT) + (vp)->shortname[0] + 6) -LONGINT ROMlib_creator; +LONGINT Executor::ROMlib_creator; PUBLIC void *ROMlib_foolgcc; /* to force the alloca to be done */ -PUBLIC void SFSaveDisk_Update (INTEGER vrefnum, Str255 filename) +PUBLIC void Executor::SFSaveDisk_Update (INTEGER vrefnum, Str255 filename) { ParamBlockRec pbr; Str255 save_name; @@ -389,7 +393,7 @@ PUBLIC void SFSaveDisk_Update (INTEGER vrefnum, Str255 filename) SFSaveDisk = CW (-CW (pbr.volumeParam.ioVRefNum)); } -PUBLIC uint32 ROMlib_version_long; +PUBLIC uint32 Executor::ROMlib_version_long; PRIVATE boolean_t cfrg_match (const cfir_t *cfirp, OSType arch_x, uint8 type_x, Str255 name) @@ -404,7 +408,7 @@ cfrg_match (const cfir_t *cfirp, OSType arch_x, uint8 type_x, Str255 name) } PUBLIC cfir_t * -ROMlib_find_cfrg (Handle cfrg, OSType arch, uint8 type, Str255 name) +Executor::ROMlib_find_cfrg (Handle cfrg, OSType arch, uint8 type, Str255 name) { cfrg_resource_t *cfrgp; int n_descripts; @@ -482,10 +486,10 @@ cfm_launch (Handle cfrg0, OSType desired_arch, FSSpecPtr fsp) C_ExitToShell (); } -PUBLIC int ROMlib_uaf; +PUBLIC int Executor::ROMlib_uaf; -PUBLIC launch_failure_t ROMlib_launch_failure = launch_no_failure; -PUBLIC INTEGER ROMlib_exevrefnum; +PUBLIC launch_failure_t Executor::ROMlib_launch_failure = launch_no_failure; +PUBLIC INTEGER Executor::ROMlib_exevrefnum; PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, LaunchParamBlockRec *lpbp) @@ -589,7 +593,7 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, ROMlib_version_long = 0; if (h) { vp = (vers_t *) STARH(h); - versbuf = alloca(VERSSIZE(vp)); + versbuf = (char*)alloca(VERSSIZE(vp)); memcpy(versbuf, vp->shortname+1, vp->shortname[0]); sprintf(versbuf+vp->shortname[0], VERSFMT, (LONGINT) vp->c[0], @@ -678,7 +682,7 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, h = GetResource(CL(finfo.fdCreator), 0); if (h) { namelen = *MR(*(unsigned char **)h); - namebuf = alloca(namelen+1); + namebuf = (char*)alloca(namelen+1); memcpy(namebuf, (char *) STARH(h)+1, namelen); namebuf[namelen] = 0; } else @@ -1196,7 +1200,7 @@ our_special_map (resmaphand map) void -empty_timer_queues (void) +Executor::empty_timer_queues (void) { TMTask *tp, *nexttp; VBLTaskPtr vp, nextvp; @@ -1314,7 +1318,7 @@ ROMlib_filename_from_fsspec (char **strp, FSSpec *fsp) } PUBLIC OSErr -NewLaunch (StringPtr fName_arg, INTEGER vRefNum_arg, LaunchParamBlockRec *lpbp) +Executor::NewLaunch (StringPtr fName_arg, INTEGER vRefNum_arg, LaunchParamBlockRec *lpbp) { OSErr retval; static char beenhere = FALSE; @@ -1357,7 +1361,7 @@ NewLaunch (StringPtr fName_arg, INTEGER vRefNum_arg, LaunchParamBlockRec *lpbp) n_filenames += CW (ap->n_fsspec); } n_filename_bytes = n_filenames * sizeof *filenames; - filenames = alloca (n_filename_bytes); + filenames = (char**)alloca (n_filename_bytes); memset (filenames, 0, n_filename_bytes); retval = ROMlib_filename_from_fsspec (&filenames[0], MR (lpbp->launchAppSpec)); diff --git a/src/licensetext.c b/src/licensetext.c deleted file mode 100644 index c11fe92f..00000000 --- a/src/licensetext.c +++ /dev/null @@ -1,247 +0,0 @@ -#if 0 -/* Copyright 1996, 1997 by Abacus Research and - * Development, Inc. All rights reserved. - */ - -#if !defined (OMIT_RCSID_STRINGS) -char ROMlib_rcsid_licensetext[] = - "$Id: licensetext.c 63 2004-12-24 18:19:43Z ctm $"; -#endif - -#include "rsys/common.h" - -#include "rsys/licensetext.h" - -license_text_page_t ROMlib_license[] = -{ - { -#if defined (RELEASE_DEMO) - -#if !defined (WRAPPER_NAME) || WRAPPER_NAME != JWM - "Executor Demo Information", - -#if defined(LINUX) - "Through January 31st 1999, Executor/Linux is available for $35 to " - "full-time students and for $75 to everyone else. Please read our web " - "pages () or the file " - "/usr/doc/executor-aux-*/License_Fees for more information.\r\r" -#endif - -#if defined(MSDOS) || defined(CYGWIN32) - "Through January 31st 1999, Executor/DOS and Executor/Win32 are available " - "for $65 to " - "full-time students and for $150 to everyone else. Please read our web " - "pages () or the file " - "fees.txt for more information.\r\r" -#endif - - "Please read this entire message. You will need to use the scroll-bar " - "to see it all.\r\r" - - "This is a demo version of Executor. This demo is available solely " - "so you can evaluate whether or not Executor is worth purchasing. " - "This demo should expire at the end of the 30th day after you have " - "installed it. " - "In this demo version, all pages printed will have " - "\"Demo\" written on them. This demo version of Executor will read " - "Macintosh formatted floppies and hard drives but will not allow you to " - "write to or format them. The remaining difference between this demo " - "version and the commercial version of Executor is that Command-Key " - "equivalents will not work in this demo version.\r\r" - -#else - "JWM Executor Demo Information", - - "This demo version of Executor 2.0 is licensed only to run Japanese " - "WordMage (JWM) and a few specific auxiliary programs: ARDI's Browser, " - "Documents created by DocMaker, JConv, User Info, " - "Brian's Sound Tool, Giffer, Stuffit Expander, Compact Pro, Compact Pro " - "User's Guide, Compact Pro Self-Extracting Archives, StuffIt Lite, " - "StuffIt Lite Self-Extracting Archives, Desktop Textures Vol. 1, and " - "TexEdit. As such, this version of Executor can't " - "be redistributed, or modified. Using this version of Executor to run " - "Macintosh programs other than the ones explicitly mentioned above is a " - "violation of this license agreement. " - "This demo will only run for thirty minutes before it will force you to " - "exit. In addition, all pages printed from this demo version will have " - "\"Demo\" written on them. This demo version of Executor will read " - "Macintosh formatted floppies and hard drives but will not allow you to " - "write to or format them.\r\r" -#endif - -#else - "DO NOT REDISTRIBUTE", - -#if defined(WRAPPER_NAME) && WRAPPER_NAME == JWM - "This version of Executor 2.0 is licensed only to run Japanese " - "WordMage (JWM) and a few specific auxiliary programs: ARDI's Browser, " - "Documents created by DocMaker, JConv, User Info, " - "Brian's Sound Tool, Giffer, Stuffit Expander, Compact Pro, Compact Pro " - "User's Guide, Compact Pro Self-Extracting Archives, StuffIt Lite, " - "StuffIt Lite Self-Extracting Archives, Desktop Textures Vol. 1, and " - "TexEdit. As such, this version of Executor can't " - "be redistributed, or modified. Using this version of Executor to run " - "Macintosh programs other than the ones explicitly mentioned above is a " - "violation of this license agreement." -#elif defined (WRAPPER_NAME) && WRAPPER_NAME == TTS - "This version of Executor 2.0 is licensed only to run software " - "supplied by Teacher Technology Systems (TTS): CalGen, " - "Curriculum Manager, LogBook, RollBook and Test Generator. " - "As such, this version of Executor can't " - "be redistributed, or modified. Using this version of Executor to run " - "programs other than the ones explicitly mentioned above is a " - "violation of this license agreement." -#elif defined (WRAPPER_NAME) && WRAPPER_NAME == SUNPATH - "This version of Executor 2.0 is licensed only to run sunPATH by Wide " - "Screen Software. " - "As such, this version of Executor can't " - "be redistributed, or modified. Using this version of Executor to run " - "programs other than sunPATH is a violation of this license agreement." -#else - "This is the full featured version of Executor 2.0. As such, it can't " - "be redistributed.\r\r" -#endif - -#endif - -#if !defined (WRAPPER_NAME) - "To get the most out of this software, please visit our web site " - "frequently ." -#endif - }, - - { - "License Description", - - "Executor is written and copyrighted by Abacus Research and Development, " - "Inc. (ARDI). Executor is not sold, but is provided under this " - "Software License Agreement. " - -#if defined (RELEASE_DEMO) - "This license allows for 30 days the licensee to " - "use this demo version of Executor " - "without any licensing fee. After the 30 day evaluation period " - "licensee no longer has any rights to use this software." -#else - "This license allows the licensee the use of this " - -#if defined (WRAPPER_NAME) && WRAPPER_NAME == JWM - "JWM-specific version of Executor in conjunction with JWM and the " - "auxiliary applications." -#elif defined (WRAPPER_NAME) && WRAPPER_NAME == TTS - "TTS-specific version of Executor." -#elif defined (WRAPPER_NAME) && WRAPPER_NAME == SUNPATH - "sunPATH-specific version of Executor." -#else - "fully enabled version (commercial) of Executor after " - "payment of the appropriate licensing fees to ARDI." -#endif - -#endif - - }, - - { - "Duplication and Redistribution", - -#if defined (RELEASE_DEMO) - "Complete distributions of this demo version of Executor may be copied " - "and redistributed as long as all copies are unmodified and contain all " - "of the original files in their entirety." -#else - "This " -#if defined (WRAPPER_NAME) && WRAPPER_NAME == JWM - "JWM-specific version" -#elif defined (WRAPPER_NAME) && WRAPPER_NAME == TTS - "TTS-specific version" -#elif defined (WRAPPER_NAME) && WRAPPER_NAME == SUNPATH - "sunPATH-specific version" -#else - "fully enabled version (commercial)" -#endif - " of Executor may be copied only " - "for backup purposes." -#endif - " Licensee may not " - "modify or create derivative works based on Executor or any part thereof." - }, - -#if defined (RELEASE_COMMERCIAL) && !defined (WRAPPER_NAME) - { - "NO WARRANTY", - - "Executor is licensed without a warranty. ARDI disclaims all warranties " - "relating to this software, whether expressed or implied, including but " - "not limited to any implied warranties of merchantability and fitness for " - "a particular purpose. All such warranties are expressly and " - "specifically disclaimed." - }, -#endif - - { - "ARDI Disclaims Liability", - - "In no event will ARDI be liable for indirect, special, incidental, " - "or consequential damages resulting from the use of Executor, even " - "if advised of the possibility of such damages." - }, - -#if defined (RELEASE_COMMERCIAL) && !defined (WRAPPER_NAME) - { - "Exclusions, Limitations", - - "If Licensee uses the licensed software in a " - "state which does not allow the exclusion or limitation of implied " - "warranties or limitation of liabilities for incidental or consequential " - "damages, then the limitations on warranties and exclusions of " - "damages agreed upon by the parties to this license agreement shall " - "be interpreted, to the extent permitted by the applicable state's " - "law, to fulfill the agreement of the parties set forth herein." - }, -#endif - - { - "General Terms", - - "This license is the entire agreement between Licensee and ARDI. " - "If any provision of this License shall be held to be unenforceable, " - "such holding shall not affect the enforceability of the remaining " - "provisions. This license shall be governed by and construed under " - "the laws of the State of New Mexico. Licensee agrees to bring any " - "proceeding concerning this license before a court of the State of " - "New Mexico or a Federal court located in the State of New Mexico." - }, - - { - "U.S. Government Restrictions", - - "This Software is licensed only with RESTRICTED RIGHTS.\r\r" - - "For civilian agencies: The use, reproduction, or disclosure of " - "this software is subject to restrictions as set forth in subparagraphs " - "(a) through (d) of the Commercial Computer Software--Restricted " - "Rights clause at 52.227-19 of the Federal Acquisition Regulations. " - "For Department of Defense agencies: The use, reproduction, or " - "disclosure of this software by the Government is subject to " - "restrictions as set forth in subparagraph (c)(1)(ii) of the Rights " - "in Technical Data and Computer Software clause at DFARS 252.227-7013." - }, - -#if defined(MSDOS) - { - "PROGRAMMERS: Free source available for cwsdpmi and wmemu387", - - "The files: \"cwsdpmi.exe\" (a DPMI provider), and \"wmemu387.dxe\" (an " - "FPU emulator) were both written outside " - "of ARDI by people who want you to be able to get the source to these " - "two files. More information is provided in the docs subdirectory.\r\r" - - "Executor includes software developed by the University of California " - "and its contributors." - }, -#endif - - { NULL, NULL }, /* array terminator */ -}; - -#endif diff --git a/src/listAccess.c b/src/listAccess.cpp similarity index 97% rename from src/listAccess.c rename to src/listAccess.cpp index c2904f6f..0c2b0ae2 100644 --- a/src/listAccess.c +++ b/src/listAccess.cpp @@ -16,6 +16,8 @@ char ROMlib_rcsid_listAccess[] = #include "rsys/list.h" #include "rsys/hook.h" +using namespace Executor; + P4(PUBLIC pascal trap, void, LFind, INTEGER *, offsetp, /* IMIV-274 */ INTEGER *, lenp, Cell, cell, ListHandle, list) { @@ -104,6 +106,10 @@ typedef pascal INTEGER (*cmpf)(Ptr p1, Ptr p2, INTEGER len1, INTEGER len2); #define CALLCMP(a1, a2, a3, a4, fp) \ ROMlib_CALLCMP(a1, a2, a3, a4, (cmpf) fp) +namespace Executor { + static inline INTEGER ROMlib_CALLCMP(Ptr,Ptr,INTEGER,INTEGER,cmpf); +} + A5(static inline, INTEGER, ROMlib_CALLCMP, Ptr, p1, Ptr, p2, INTEGER, l1, INTEGER, l2, cmpf, fp) { @@ -114,7 +120,7 @@ A5(static inline, INTEGER, ROMlib_CALLCMP, Ptr, p1, Ptr, p2, INTEGER, l1, else { ROMlib_hook(list_cmpnumber); HOOKSAVEREGS(); - retval = CToPascalCall(fp, CTOP_IUMagString, p1, p2, l1, l2); + retval = CToPascalCall(&fp, CTOP_IUMagString, p1, p2, l1, l2); HOOKRESTOREREGS(); } return retval; diff --git a/src/listAddDel.c b/src/listAddDel.cpp similarity index 99% rename from src/listAddDel.c rename to src/listAddDel.cpp index be60149d..3e40237f 100644 --- a/src/listAddDel.c +++ b/src/listAddDel.cpp @@ -14,6 +14,8 @@ char ROMlib_rcsid_listAddDel[] = #include "MemoryMgr.h" #include "rsys/list.h" +using namespace Executor; + P3(PUBLIC pascal trap, INTEGER, LAddColumn, INTEGER, count, /* IMIV-271 */ INTEGER, coln, ListHandle, list) { diff --git a/src/listCreate.c b/src/listCreate.cpp similarity index 99% rename from src/listCreate.c rename to src/listCreate.cpp index b0f823f8..1ac0a125 100644 --- a/src/listCreate.c +++ b/src/listCreate.cpp @@ -15,6 +15,8 @@ char ROMlib_rcsid_listCreate[] = #include "ListMgr.h" #include "rsys/list.h" +using namespace Executor; + #define STEF_lActivefix A3(PUBLIC, void, ROMlib_vminmax, INTEGER *, minp, /* INTERNAL */ diff --git a/src/listDisplay.c b/src/listDisplay.cpp similarity index 97% rename from src/listDisplay.c rename to src/listDisplay.cpp index 9295cac5..e4c267c2 100644 --- a/src/listDisplay.c +++ b/src/listDisplay.cpp @@ -16,6 +16,8 @@ char ROMlib_rcsid_listDisplay[] = #include "rsys/list.h" #include "rsys/hook.h" +using namespace Executor; + P2(PUBLIC pascal trap, void, LDraw, Cell, cell, /* IMIV-275 */ ListHandle, list) { @@ -237,7 +239,7 @@ P2(PUBLIC pascal trap, void, LActivate, BOOLEAN, act, /* IMIV-276 */ #if defined (BINCOMPAT) void -ROMlib_listcall (INTEGER mess, BOOLEAN sel, Rect *rp, Cell cell, INTEGER off, +Executor::ROMlib_listcall (INTEGER mess, BOOLEAN sel, Rect *rp, Cell cell, INTEGER off, INTEGER len, ListHandle lhand) { Handle listdefhand; @@ -257,7 +259,7 @@ ROMlib_listcall (INTEGER mess, BOOLEAN sel, Rect *rp, Cell cell, INTEGER off, else { ROMlib_hook(list_ldefnumber); HOOKSAVEREGS(); - CToPascalCall(lp, CTOP_ldef0, mess, sel, rp, cell, off, len, lhand); + CToPascalCall(&lp, CTOP_ldef0, mess, sel, rp, cell, off, len, lhand); HOOKRESTOREREGS(); } } diff --git a/src/listMouse.c b/src/listMouse.cpp similarity index 94% rename from src/listMouse.c rename to src/listMouse.cpp index be2a61e2..db046884 100644 --- a/src/listMouse.c +++ b/src/listMouse.cpp @@ -22,6 +22,25 @@ char ROMlib_rcsid_listMouse[] = #include "rsys/pstuff.h" #include "rsys/hook.h" +using namespace Executor; + +#if defined (BINCOMPAT) +typedef pascal BOOLEAN (*clickproc)( void ); +#endif + +namespace Executor { + PRIVATE void findcell(Cell*,ListHandle); + PRIVATE void setselectnilflag(BOOLEAN setit, Cell cell, + ListHandle list, BOOLEAN hiliteempty); + static inline BOOLEAN ROMlib_CALLCLICK(clickproc); + PRIVATE void scrollbyvalues(ListHandle); + PRIVATE void rect2value(register Rect * in, register Rect * butnotin, + register INTEGER value, register ListHandle list, + BOOLEAN hiliteempty); + PRIVATE void rectvalue(register Rect * rp, register INTEGER value, + register ListHandle list, BOOLEAN hiliteempty); +} + A2(PRIVATE, void, findcell, Cell *, cp, ListHandle, list) { cp->h = CW((CW(cp->h) - Hx(list, rView.left)) / Hx(list, cellSize.h) + @@ -166,13 +185,8 @@ P2(PUBLIC, pascal void, ROMlib_mytrack, ControlHandle, ch, INTEGER, part) } #if !defined (BINCOMPAT) - #define CALLCLICK(f) (CallPascalB(f)) - #else /* BINCOMPAT */ - -typedef pascal BOOLEAN (*clickproc)( void ); - #define CALLCLICK(f) ROMlib_CALLCLICK((clickproc)(f)) A1(static inline, BOOLEAN, ROMlib_CALLCLICK, clickproc, fp) @@ -181,7 +195,7 @@ A1(static inline, BOOLEAN, ROMlib_CALLCLICK, clickproc, fp) ROMlib_hook(list_clicknumber); HOOKSAVEREGS(); - retval = CToPascalCall(fp, CTOP_Button); + retval = CToPascalCall(&fp, CTOP_Button); HOOKRESTOREREGS(); return retval; } diff --git a/src/listOps.c b/src/listOps.cpp similarity index 98% rename from src/listOps.c rename to src/listOps.cpp index ed45edea..b38e022b 100644 --- a/src/listOps.c +++ b/src/listOps.cpp @@ -14,6 +14,8 @@ char ROMlib_rcsid_listOps[] = #include "MemoryMgr.h" #include "rsys/list.h" +using namespace Executor; + A2(PUBLIC, INTEGER *, ROMlib_getoffp, Cell, cell, /* INTERNAL */ ListHandle, list) { @@ -31,6 +33,10 @@ A2(PUBLIC, INTEGER *, ROMlib_getoffp, Cell, cell, /* INTERNAL */ typedef enum { Add, Rep } AddOrRep; +namespace Executor { + PRIVATE void cellhelper(AddOrRep, Ptr, INTEGER, Cell, ListHandle); +} + A5(PRIVATE, void, cellhelper, AddOrRep, addorrep, Ptr, dp, INTEGER, dl, Cell, cell, ListHandle, list) { diff --git a/src/listStdLDEF.c b/src/listStdLDEF.cpp similarity index 90% rename from src/listStdLDEF.c rename to src/listStdLDEF.cpp index d76d3445..e9422c91 100644 --- a/src/listStdLDEF.c +++ b/src/listStdLDEF.cpp @@ -11,6 +11,11 @@ char ROMlib_rcsid_listStdLDEF[] = #include "ListMgr.h" #include "MemoryMgr.h" +namespace Executor { + PRIVATE void draw(BOOLEAN, Rect*, INTEGER, INTEGER, ListHandle); + void C_ldef0(INTEGER, BOOLEAN, Rect*, Cell, INTEGER, INTEGER, ListHandle); +} + A5(PRIVATE, void, draw, BOOLEAN, sel, Rect *, rect, INTEGER, doff, INTEGER, dl, ListHandle, list) { diff --git a/src/local_charset.c b/src/local_charset.cpp similarity index 99% rename from src/local_charset.c rename to src/local_charset.cpp index dc723d10..b9b049e0 100644 --- a/src/local_charset.c +++ b/src/local_charset.cpp @@ -19,7 +19,7 @@ char ROMlib_rcsid_local_charset[] = * this can be more intelligently adjusted. */ -#if defined (CYGWIN32) || defined (MSDOS) +#if defined (CYGWIN32) || defined (MSDOS) || defined (MACOSX_) /* No representation for: 138, S caron @@ -475,7 +475,7 @@ hexval(unsigned char c) } PUBLIC void -ROMlib_localize_string (char *p) +Executor::ROMlib_localize_string (char *p) { unsigned char c; unsigned char *ip, *op; diff --git a/src/lockrange.c b/src/lockrange.cpp similarity index 87% rename from src/lockrange.c rename to src/lockrange.cpp index 312f87a9..0bc861cd 100644 --- a/src/lockrange.c +++ b/src/lockrange.cpp @@ -30,6 +30,8 @@ char ROMlib_rcsid_lockrange[] = #include "rsys/lockunlock.h" +using namespace Executor; + typedef struct { int fd; @@ -54,7 +56,7 @@ delete_entry (lock_entry_t *entry) PUBLIC OSErr -ROMlib_fd_clear_locks_after_open (int fd, boolean_t be_surprised_p) +Executor::ROMlib_fd_clear_locks_after_open (int fd, boolean_t be_surprised_p) { int i; int n_removed; @@ -78,7 +80,7 @@ ROMlib_fd_clear_locks_after_open (int fd, boolean_t be_surprised_p) { typeof (entries) new_entries; - new_entries = realloc (entries, n_entries * sizeof *entries); + new_entries = (typeof(new_entries))realloc (entries, n_entries * sizeof *entries); if (new_entries) entries = new_entries; else @@ -88,7 +90,7 @@ ROMlib_fd_clear_locks_after_open (int fd, boolean_t be_surprised_p) } PUBLIC OSErr -ROMlib_fd_release_locks_for_close (int fd) +Executor::ROMlib_fd_release_locks_for_close (int fd) { OSErr err; OSErr retval; @@ -114,7 +116,7 @@ ROMlib_fd_release_locks_for_close (int fd) } PUBLIC OSErr -ROMlib_fd_add_range (int fd, uint32 start_byte, uint32 count) +Executor::ROMlib_fd_add_range (int fd, uint32 start_byte, uint32 count) { OSErr retval; @@ -124,7 +126,7 @@ ROMlib_fd_add_range (int fd, uint32 start_byte, uint32 count) { typeof (entries) new_entries; - new_entries = realloc (entries, (n_entries + 1) * sizeof *entries); + new_entries = (typeof(new_entries))realloc (entries, (n_entries + 1) * sizeof *entries); if (!new_entries) { retval = afpNoMoreLocks; @@ -146,7 +148,7 @@ ROMlib_fd_add_range (int fd, uint32 start_byte, uint32 count) } PUBLIC OSErr -ROMlib_fd_range_overlap (int fd, uint32 start_byte, uint32 count) +Executor::ROMlib_fd_range_overlap (int fd, uint32 start_byte, uint32 count) { OSErr retval; @@ -209,7 +211,7 @@ find_fd_start_count_helper (int fd, uint32 start_byte, uint32 count) } PUBLIC OSErr -ROMlib_find_fd_start_count (int fd, uint32 start_byte, uint32 count) +Executor::ROMlib_find_fd_start_count (int fd, uint32 start_byte, uint32 count) { OSErr retval; @@ -220,7 +222,7 @@ ROMlib_find_fd_start_count (int fd, uint32 start_byte, uint32 count) } PUBLIC OSErr -ROMlib_fd_remove_range (int fd, uint32 start_byte, uint32 count) +Executor::ROMlib_fd_remove_range (int fd, uint32 start_byte, uint32 count) { OSErr retval; lock_entry_t *entry; diff --git a/src/main.c b/src/main.cpp similarity index 96% rename from src/main.c rename to src/main.cpp index d76f41b9..92132c6f 100644 --- a/src/main.c +++ b/src/main.cpp @@ -80,6 +80,7 @@ char ROMlib_rcsid_main[] = #include "rsys/dcache.h" #include "rsys/system_error.h" #include "rsys/filedouble.h" +#include "rsys/option.h" #include "rsys/os.h" #include "rsys/arch.h" @@ -132,25 +133,27 @@ char ROMlib_rcsid_main[] = #include "x.h" #endif -BOOLEAN force_big_offset = CONFIG_OFFSET_P; +using namespace Executor; + +BOOLEAN Executor::force_big_offset = CONFIG_OFFSET_P; -#if defined (NEXTSTEP) +#if defined (MACOSX_) #define main oldmain char *ROMlib_xfervmaddr; LONGINT ROMlib_xfervmsize = 0; -#endif /* NEXTSTEP */ +#endif /* MACOSX_ */ -PUBLIC int ROMlib_noclock = 0; +PUBLIC int Executor::ROMlib_noclock = 0; #if defined (NOMOUSE_COMMAND_LINE_OPTION) PUBLIC int ROMlib_no_mouse = 1; #endif /* optional resolution other than 72dpix72dpi for printing */ -PUBLIC INTEGER ROMlib_optional_res_x, ROMlib_optional_res_y; +PUBLIC INTEGER Executor::ROMlib_optional_res_x, Executor::ROMlib_optional_res_y; /* A string approximating the original command line. */ -PUBLIC const char *ROMlib_command_line; +PUBLIC const char *Executor::ROMlib_command_line; /* Set to TRUE if there was any error parsing arguments. */ PRIVATE boolean_t bad_arg_p = FALSE; @@ -163,14 +166,14 @@ PRIVATE boolean_t graphics_p = TRUE; /* for a description of flags declared here, see */ /* Initial screen size. This can be changed dynamically. */ -INTEGER flag_width = 0, flag_height = 0; /* 0 means "use default". */ +INTEGER Executor::flag_width = 0, Executor::flag_height = 0; /* 0 means "use default". */ /* Initial bits per pixel. The screen depth can be changed dynamically. */ -int flag_bpp = 0; /* 0 means "use default". */ +int Executor::flag_bpp = 0; /* 0 means "use default". */ -INTEGER ROMlib_shadow_screen_p = TRUE; +INTEGER Executor::ROMlib_shadow_screen_p = TRUE; -INTEGER ROMlib_no_windows; +INTEGER Executor::ROMlib_no_windows; #if defined (MSDOS) || defined (CYGWIN32) int ROMlib_drive_check = 0; @@ -184,7 +187,7 @@ static boolean_t use_native_code_p = TRUE; applications, set through the `-system' options. contains the version number in the form `0xABC' which corresponds to system version A.B.C */ -uint32 system_version = 0x700; /* keep this in sync with Browser's .ecf file */ +uint32 Executor::system_version = 0x700; /* keep this in sync with Browser's .ecf file */ static option_t common_opts[] = { @@ -445,7 +448,7 @@ capable of color.", { "hfsplusro", "unsupported -- do not use", opt_no_arg, NULL }, }; -opt_database_t *common_db; +opt_database_t *Executor::common_db; /* Prints the specified value in a representation appropriate for command @@ -502,12 +505,12 @@ A4(PUBLIC, LONGINT, wait4, LONGINT, pid, union wait *, statusp, LONGINT, } #endif /* NEED_WAIT4 */ -PUBLIC char ROMlib_startdir[MAXPATHLEN]; +PUBLIC char Executor::ROMlib_startdir[MAXPATHLEN]; PUBLIC INTEGER ROMlib_startdirlen; #if defined (MSDOS) || defined (CYGWIN32) PUBLIC char ROMlib_start_drive; #endif -PUBLIC char *ROMlib_appname; +PUBLIC char *Executor::ROMlib_appname; #if !defined(LINUX) #define SHELL "/bin/sh" @@ -521,12 +524,17 @@ PUBLIC char *ROMlib_appname; ULONGINT ROMlib_ourmtime; -#if defined (NEXTSTEP) +#if defined (MACOSX_) -#if !defined (STRICT_OPENSTEP) #include #include -#endif + +extern void willsetperms( void ); +extern void badfilesystem( void ); +namespace Executor { + PRIVATE void misc_self_examination(char*); + PRIVATE void setstartdir(char *); +} A1(PRIVATE, void, misc_self_examination, char *, us) { @@ -652,7 +660,7 @@ A1(PRIVATE, void, misc_self_examination, char *, us) Uchmod(us, 04755); } } -#endif /* defined (NEXTSTEP) */ +#endif /* defined (MACOSX_) */ #if defined(MSDOS) || defined (CYGWIN32) PUBLIC char ROMlib_savecwd[MAXPATHLEN]; @@ -691,13 +699,13 @@ A1(PRIVATE, void, setstartdir, char *, argv0) lookhere = argv0; else { - pipe((void *) p); + pipe(p); if ((pid = fork()) == 0) { ROMlib_setuid(getuid()); close(1); dup(p[1]); arg0len = strlen(argv0); - whichstr = alloca(arg0len + sizeof(WHICH)); + whichstr = (char*)alloca(arg0len + sizeof(WHICH)); memmove(whichstr, WHICH, sizeof(WHICH) - 1); memmove(whichstr + sizeof(WHICH) - 1, argv0, arg0len + 1); execl(SHELL, "sh", "-c", whichstr, (char *) 0); @@ -718,7 +726,7 @@ A1(PRIVATE, void, setstartdir, char *, argv0) lookhere = buf; } } -#if defined(NEXTSTEP) +#if defined(MACOSX_) misc_self_examination (lookhere); #endif suffix = rindex(lookhere, '/'); @@ -731,7 +739,7 @@ A1(PRIVATE, void, setstartdir, char *, argv0) getcwd(ROMlib_startdir, sizeof ROMlib_startdir); Uchdir(savedir); ROMlib_startdirlen = strlen(ROMlib_startdir) + 1; -#if defined(NEXTSTEP) +#if defined(MACOSX_) if (strcmp(ROMlib_startdir + ROMlib_startdirlen - sizeof(APPWRAP), APPWRAP) != 0) { memmove(ROMlib_startdir + ROMlib_startdirlen - 1, APPWRAP, @@ -791,9 +799,9 @@ A1(PRIVATE, void, setstartdir, char *, argv0) #endif /* defined(MSDOS) */ } -PUBLIC BOOLEAN ROMlib_startupscreen = TRUE; +PUBLIC BOOLEAN Executor::ROMlib_startupscreen = TRUE; -char *program_name; +char *Executor::program_name; #if defined (SYN68K) @@ -1122,7 +1130,7 @@ construct_command_line_string (int argc, char **argv) for (i = 0, string_length = 0; i < argc; i++) string_length += strlen (argv[i]) + 1; - s = malloc (string_length + 1); + s = (char*)malloc (string_length + 1); s[0] = '\0'; for (j = 0; j < argc; j++) sprintf (s + strlen (s), "%s%s", j ? " " : "", argv[j]); @@ -1167,7 +1175,7 @@ zap_comments (char *buf, int n_left) ({ \ char *retval; \ \ - retval = alloca (strlen (ROMlib_startdir) + 1 + strlen (filename) + 1); \ + retval = (char*)alloca (strlen (ROMlib_startdir) + 1 + strlen (filename) + 1); \ sprintf (retval, "%s/%s", ROMlib_startdir, (filename)); \ retval; \ }) @@ -1191,7 +1199,7 @@ zap_comments (char *buf, int n_left) #endif PUBLIC FILE * -executor_dir_fopen (const char *file, const char *perm) +Executor::executor_dir_fopen (const char *file, const char *perm) { char *pathname; FILE *retval; @@ -1202,7 +1210,7 @@ executor_dir_fopen (const char *file, const char *perm) } PUBLIC int -executor_dir_remove (const char *file) +Executor::executor_dir_remove (const char *file) { char *pathname; int retval; @@ -1230,7 +1238,7 @@ read_args_from_file (const char *filename, int *argcp, char ***argvpp) n_extra_params = count_params (buf, nread); *argcp += n_extra_params; saveargv = *argvpp; - *argvpp = malloc ((*argcp+1) * sizeof *argvpp); + *argvpp = (char**)malloc ((*argcp+1) * sizeof *argvpp); bufp = buf; memcpy (*argvpp, saveargv, (*argcp - n_extra_params) * sizeof **argvpp); for (i = *argcp - n_extra_params; i < *argcp; ++i) @@ -1262,14 +1270,22 @@ win_drive_to_bit (const char *drive_namep) #define READ_IMPLIES_EXEC 0x0400000 #endif +#ifdef MACOSX_ +namespace Executor { + PUBLIC int oldmain(int, char**); +} + A2 (PUBLIC, int, main, int, argc, char **, argv) +#else +int main(int argc, char** argv) +#endif { check_structs (); INTEGER i; static unsigned short jmpl_to_ResourceStub[3] = { - CWC (0x4EF9), 0, 0 /* Filled in below. */ + CWC ((unsigned short)0x4EF9), 0, 0 /* Filled in below. */ }; long l; ULONGINT save_trap_vectors[64]; @@ -1284,7 +1300,7 @@ A2 (PUBLIC, int, main, int, argc, char **, argv) vdriver_opt_register, NULL, }; - char *arg; + const char *arg; #if defined(PERSONALITY_HACK) int pers; @@ -1356,7 +1372,7 @@ A2 (PUBLIC, int, main, int, argc, char **, argv) ROMlib_WriteWhen (WriteInOSEvent); -#if defined (NEXTSTEP) +#if defined (MACOSX_) ROMlib_seteuid (0); /* This is necessary because when people copy setuid-root files from floppies, the setuid bit stays, but the "root" part doesn't, so @@ -1730,7 +1746,7 @@ A2 (PUBLIC, int, main, int, argc, char **, argv) #endif { - char *str; + const char *str; if (opt_val (common_db, "prvers", &str)) { @@ -1986,7 +2002,7 @@ A2 (PUBLIC, int, main, int, argc, char **, argv) #endif { - char *appearance_str; + const char *appearance_str; if (opt_val (common_db, "appearance", &appearance_str)) bad_arg_p |= !ROMlib_parse_appearance (appearance_str); @@ -1996,7 +2012,7 @@ A2 (PUBLIC, int, main, int, argc, char **, argv) /* parse the `-system' option */ { - char *system_str; + const char *system_str; if (opt_val (common_db, "system", &system_str)) bad_arg_p |= !parse_system_version (system_str); diff --git a/src/map_to_c/map_to_c.1 b/src/map_to_c/map_to_c.1 new file mode 100644 index 00000000..a66db767 --- /dev/null +++ b/src/map_to_c/map_to_c.1 @@ -0,0 +1,79 @@ +.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. +.\"See Also: +.\"man mdoc.samples for a complete listing of options +.\"man mdoc for the short list of editing options +.\"/usr/share/misc/mdoc.template +.Dd 7/27/14 \" DATE +.Dt map_to_c 1 \" Program name and manual section number +.Os Darwin +.Sh NAME \" Section Header - required - don't modify +.Nm map_to_c, +.\" The following lines are read in generating the apropos(man -k) database. Use only key +.\" words here as the database is built based on the words here and in the .ND line. +.Nm Other_name_for_same_program(), +.Nm Yet another name for the same program. +.\" Use .Nm macro to designate other names for the documented program. +.Nd This line parsed for whatis database. +.Sh SYNOPSIS \" Section Header - required - don't modify +.Nm +.Op Fl abcd \" [-abcd] +.Op Fl a Ar path \" [-a path] +.Op Ar file \" [file] +.Op Ar \" [file ...] +.Ar arg0 \" Underlined argument - use .Ar anywhere to underline +arg2 ... \" Arguments +.Sh DESCRIPTION \" Section Header - required - don't modify +Use the .Nm macro to refer to your program throughout the man page like such: +.Nm +Underlining is accomplished with the .Ar macro like this: +.Ar underlined text . +.Pp \" Inserts a space +A list of items with descriptions: +.Bl -tag -width -indent \" Begins a tagged list +.It item a \" Each item preceded by .It macro +Description of item a +.It item b +Description of item b +.El \" Ends the list +.Pp +A list of flags and their descriptions: +.Bl -tag -width -indent \" Differs from above in tag removed +.It Fl a \"-a flag as a list item +Description of -a flag +.It Fl b +Description of -b flag +.El \" Ends the list +.Pp +.\" .Sh ENVIRONMENT \" May not be needed +.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 +.\" .It Ev ENV_VAR_1 +.\" Description of ENV_VAR_1 +.\" .It Ev ENV_VAR_2 +.\" Description of ENV_VAR_2 +.\" .El +.Sh FILES \" File used or created by the topic of the man page +.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact +.It Pa /usr/share/file_name +FILE_1 description +.It Pa /Users/joeuser/Library/really_long_file_name +FILE_2 description +.El \" Ends the list +.\" .Sh DIAGNOSTICS \" May not be needed +.\" .Bl -diag +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .El +.Sh SEE ALSO +.\" List links in ascending order by section, alphabetically within a section. +.\" Please do not reference files that do not exist without filing a bug report +.Xr a 1 , +.Xr b 1 , +.Xr c 1 , +.Xr a 2 , +.Xr b 2 , +.Xr a 3 , +.Xr b 3 +.\" .Sh BUGS \" Document known, unremedied bugs +.\" .Sh HISTORY \" Document history if command behaves in a unique manner \ No newline at end of file diff --git a/src/map_to_c.c b/src/map_to_c/map_to_c.cpp similarity index 90% rename from src/map_to_c.c rename to src/map_to_c/map_to_c.cpp index 9b92d9b1..20808b09 100644 --- a/src/map_to_c.c +++ b/src/map_to_c/map_to_c.cpp @@ -13,29 +13,32 @@ char ROMlib_rcsid_map_to_c[] = #include #include "rsys/image.h" +#include "rsys/byteswap.h" + +using namespace Executor; /* consume input from o_fp, produce output to o_fp */ -FILE *i_fp, *o_fp; -char *in_file, *out_file; +static FILE *i_fp, *o_fp; +static const char *in_file, *out_file; -char *programname; +static char *programname; -int lineno = 1; +static int lineno = 1; -pixel_image_desc_t image_desc; +static pixel_image_desc_t image_desc; -int orig_style_p; -int parsing_p; +static int orig_style_p; +static int parsing_p; -struct rgb_color +static struct rgb_color { - int16 red, green, blue; + uint16_t red, green, blue; } colors[256]; -int n_colors; +static int n_colors; -void -fatal_error (char *message) +static void +fatal_error (const char *message) { if (parsing_p) fprintf (stderr, "%s:%d; %s\n", in_file, lineno, message); @@ -44,7 +47,7 @@ fatal_error (char *message) exit (EXIT_FAILURE); } -void * +static void * xmalloc (int size) { void *p; @@ -55,7 +58,7 @@ xmalloc (int size) return p; } -void * +static void * xrealloc (void *p, int new_size) { p = realloc (p, new_size); @@ -64,40 +67,40 @@ xrealloc (void *p, int new_size) return p; } -void +static void emit_prologue (char *map_name, int depth) { - fprintf (o_fp, "char %s_%d_bits[] =\n", map_name, depth); + fprintf (o_fp, "unsigned char %s_%d_bits[] =\n", map_name, depth); fprintf (o_fp, "{\n"); } -void +static void emit_row_start () { fprintf (o_fp, " "); } -void +static void emit_row_end () { fprintf (o_fp, "\n"); } -void +static void emit_char (unsigned char x) { fprintf (o_fp, "%u, ", (unsigned int) x); } -Rect bounds; +static Rect bounds; /* max possible number of `bits' */ -image_bits_desc_t bits[5]; +static image_bits_desc_t bits[5]; /* number of bits */ -int n_bits; +static int n_bits; -void +static void emit_epilogue (char *map_name, int row_bytes, int bpp) { /* end bits */ @@ -110,7 +113,7 @@ emit_epilogue (char *map_name, int row_bytes, int bpp) /* emit the description structure and initialize function */ -void +static void emit_rest (char *map_name) { int i; @@ -180,7 +183,7 @@ emit_rest (char *map_name) } } -char +static char read_char_internal () { char x; @@ -192,7 +195,7 @@ read_char_internal () return x; } -void +static void read_white_space () { char x; @@ -210,7 +213,7 @@ read_white_space () } } -int +static int read_char (char char_to_read) { read_white_space (); @@ -218,7 +221,7 @@ read_char (char char_to_read) return read_char_internal () == char_to_read; } -char * +static char * read_string () { char *string_base; @@ -231,13 +234,13 @@ read_string () return NULL; size = 64; - string_base = xmalloc (size); + string_base = (char*)xmalloc (size); i = 0; do { if (i == size) - string_base = xrealloc (string_base, size *= 2); + string_base = (char*)xrealloc (string_base, size *= 2); string_base[i] = read_char_internal (); } while (string_base[i ++] != '"'); @@ -247,13 +250,13 @@ read_string () return string_base; } -int +static int valid_idn_char_p (char x) { return isalnum (x) || x == '_'; } -char * +static char * read_idn () { char *idn_base; @@ -263,13 +266,13 @@ read_idn () read_white_space (); size = 64; - idn_base = xmalloc (size); + idn_base = (char*)xmalloc (size); i = 0; do { if (i == size) - idn_base = xrealloc (idn_base, size *= 2); + idn_base = (char*)xrealloc (idn_base, size *= 2); idn_base[i] = read_char_internal (); } while (valid_idn_char_p (idn_base[i ++])); @@ -283,13 +286,13 @@ read_idn () return idn_base; } -int +static int valid_num_char_p (char x) { return isdigit (x); } -int +static int read_num (int *err) { char *num_base; @@ -300,13 +303,13 @@ read_num (int *err) read_white_space (); size = 64; - num_base = xmalloc (size); + num_base = (char*)xmalloc (size); i = 0; do { if (i == size) - num_base = xrealloc (num_base, size *= 2); + num_base = (char*)xrealloc (num_base, size *= 2); num_base[i] = read_char_internal (); } while (valid_num_char_p (num_base[i ++])); @@ -331,30 +334,30 @@ read_num (int *err) return retval; } -int +static int valid_hexnum_char_p (char x) { return isxdigit (x); } -int +static size_t read_hexnum (int *err) { char *num_base; int size; - int retval; + size_t retval; int i; read_white_space (); size = 64; - num_base = xmalloc (size); + num_base = (char*)xmalloc (size); i = 0; do { if (i == size) - num_base = xrealloc (num_base, size *= 2); + num_base = (char*)xrealloc (num_base, size *= 2); num_base[i] = read_char_internal (); } while (valid_hexnum_char_p (num_base[i ++])); @@ -379,7 +382,7 @@ read_hexnum (int *err) return retval; } -int +static int find_index (char *spec, char pixel) { int i; @@ -392,7 +395,7 @@ find_index (char *spec, char pixel) return -1; /* will never get here; to quiet gcc */ } -void +static void read_and_process_block (char *map_name, int which_depth, int depth, int width, int height) @@ -523,7 +526,7 @@ read_and_process_block (char *map_name, free (spec); } -void +static void read_and_process_file () { int err; diff --git a/src/mathlib.c b/src/mathlib.cpp similarity index 99% rename from src/mathlib.c rename to src/mathlib.cpp index 9a594600..1f09c8b3 100644 --- a/src/mathlib.c +++ b/src/mathlib.cpp @@ -19,6 +19,8 @@ char ROMlib_rcsid_mathlib[] = #include "SANE.h" +using namespace Executor; + PRIVATE void num2dec (/* const */DecForm *f, double d, uint32 unused1, uint32 unused2, Decimal *dp) diff --git a/src/menu.c b/src/menu.cpp similarity index 96% rename from src/menu.c rename to src/menu.cpp index d20faaf4..c39024d2 100644 --- a/src/menu.c +++ b/src/menu.cpp @@ -44,8 +44,36 @@ char ROMlib_rcsid_menu[] = #include "rsys/notmac.h" #include "rsys/version.h" #include "rsys/custom.h" +#include "rsys/stubify.h" -PUBLIC int ROMlib_sticky_menus_p = 0; +using namespace Executor; + +typedef pascal void (*menuhookp)( void ); + +#if !defined(BINCOMPAT) +typedef pascal void (*mbarhookp)( Rect *rp ); +#else /* defined(BINCOMPAT) */ +typedef pascal LONGINT (*mbarhookp)( Rect *rp ); +#endif /* defined(BINCOMPAT) */ + +#define CALLMENUHOOK(fp) ROMlib_CALLMENUHOOK((menuhookp)(fp)) +#define CALLMBARHOOK(arg, fp) ROMlib_CALLMBARHOOK(arg, (mbarhookp)(fp)) + + +namespace Executor { + PUBLIC int ROMlib_sticky_menus_p = 0; + PRIVATE void dirtymenusize(MenuHandle); + PRIVATE BOOLEAN findroot(INTEGER menuid, INTEGER * root_unswp); + static inline void ROMlib_CALLMENUHOOK(menuhookp fp); + static inline LONGINT ROMlib_CALLMBARHOOK(Rect * rp, mbarhookp fp); + PRIVATE INTEGER wheretowhich(LONGINT offset); + PRIVATE void shadowrect(Rect * rp); + PRIVATE void restoren(INTEGER ntodrop, RgnHandle restoredrgn, Rect * rp); + PRIVATE void initpairs(startendpairs pairs); + PRIVATE BOOLEAN mtoggle(INTEGER mid, highstate h); + PRIVATE MenuHandle menunumtomh(INTEGER mid, INTEGER * sixp); + PRIVATE MenuHandle itemishierarchical(MenuHandle, INTEGER, INTEGER *); +} A1(PRIVATE, void, dirtymenusize, MenuHandle, mh) { @@ -90,11 +118,11 @@ P0(PUBLIC pascal trap, void, ClearMenuBar) HxX(MENULIST, muright) = CWC(MENULEFT); /* int 2 */ (&STARH(MENULIST)->mufu)[3] = CWC(sizeof(muelem)); /* lastHMenu: int 6 */ - (*(HIDDEN_Handle *)&(&STARH(MENULIST)->mufu)[1]).p = CLC(0);/* menuTitleSave: int 4,5 */ + (*(HIDDEN_Handle *)&(&STARH(MENULIST)->mufu)[1]).p = (Handle)CLC(0);/* menuTitleSave: int 4,5 */ } #define BLACK_RGB { CWC (0), CWC (0), CWC (0) } -#define WHITE_RGB { CWC (0xFFFF), CWC (0xFFFF), CWC (0xFFFF) } +#define WHITE_RGB { CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF) } #define RESERVED_RGB /* arbitrary */ WHITE_RGB PRIVATE MCEntry default_menu_ctab[] = { @@ -102,7 +130,7 @@ PRIVATE MCEntry default_menu_ctab[] = BLACK_RGB, WHITE_RGB, BLACK_RGB, WHITE_RGB, /* reserved */ CWC (0), }, /* end marker */ - { CWC (-99), /* reserved */ CWC (0), + { CWC ((short)-99), /* reserved */ CWC (0), RESERVED_RGB, RESERVED_RGB, RESERVED_RGB, RESERVED_RGB, /* reserved */ CWC (0), }, }; @@ -290,6 +318,13 @@ typedef struct { /* NOTE: These structures are strictly local */ INTEGER menoff; /* although *menh will still need to be swapped */ } endinfo; +namespace Executor { + PRIVATE void toend(MenuHandle, endinfo*); + PRIVATE void app(StringPtr, char, char, char, char, char, endinfo*); + PRIVATE void handleinsert(Handle, StringPtr); + PRIVATE void xInsertResMenu(MenuHandle, StringPtr, ResType, INTEGER); +} + A2(PRIVATE, void, toend, MenuHandle, mh, endinfo *, eip) { char *menuop; @@ -866,17 +901,6 @@ P1 (PUBLIC pascal trap, void, HiliteMenu, INTEGER, mid) TheMenu = CW (mid); } -typedef pascal void (*menuhookp)( void ); - - -#if !defined(BINCOMPAT) -typedef pascal void (*mbarhookp)( Rect *rp ); -#else /* defined(BINCOMPAT) */ -typedef pascal LONGINT (*mbarhookp)( Rect *rp ); -#endif /* defined(BINCOMPAT) */ - -#define CALLMENUHOOK(fp) ROMlib_CALLMENUHOOK((menuhookp)(fp)) - A1(static inline, void, ROMlib_CALLMENUHOOK, menuhookp, fp) { ROMlib_hook(menu_menuhooknumber); @@ -975,7 +999,7 @@ A3(PRIVATE, MenuHandle, itemishierarchical, MenuHandle, mh, INTEGER, item, #define HIERRECTBIT (1L<<16) -int32 ROMlib_menuhelper (MenuHandle mh, Rect *saverp, +int32 Executor::ROMlib_menuhelper (MenuHandle mh, Rect *saverp, int32 oldwhere, BOOLEAN ispopup, int16 nmenusdisplayed) { @@ -1223,7 +1247,7 @@ int32 ROMlib_menuhelper (MenuHandle mh, Rect *saverp, tempi = CW(tempi); MENUCALL(mChooseMsg, mh, &r, tempp, &tempi); tempi = CW(tempi); -#if !defined(NEXTSTEP) +#if !defined(MACOSX_) if (MenuFlash) { for (i = 0; i < Cx(MenuFlash); i++) @@ -1595,7 +1619,7 @@ A0(PUBLIC, BOOLEAN, ROMlib_shouldalarm) void -ROMlib_menucall (INTEGER mess, MenuHandle themenu, Rect * menrect, Point hit, +Executor::ROMlib_menucall (INTEGER mess, MenuHandle themenu, Rect * menrect, Point hit, INTEGER * which) { Handle defproc; @@ -1620,7 +1644,7 @@ ROMlib_menucall (INTEGER mess, MenuHandle themenu, Rect * menrect, Point hit, LOCK_HANDLE_EXCURSION_1 (defproc, { - CToPascalCall ((menuprocp) STARH (defproc), + CToPascalCall (STARH (defproc), CTOP_mdef0, mess, themenu, menrect, hit, which); }); } @@ -1629,7 +1653,7 @@ ROMlib_menucall (INTEGER mess, MenuHandle themenu, Rect * menrect, Point hit, LONGINT -ROMlib_mbdfcall (INTEGER msg, INTEGER param1, LONGINT param2) +Executor::ROMlib_mbdfcall (INTEGER msg, INTEGER param1, LONGINT param2) { Handle defproc; int32 retval; diff --git a/src/menuColor.c b/src/menuColor.cpp similarity index 95% rename from src/menuColor.c rename to src/menuColor.cpp index 5cbe4704..000db2f5 100644 --- a/src/menuColor.c +++ b/src/menuColor.cpp @@ -16,8 +16,10 @@ char ROMlib_rcsid_menuColor[] = #include "rsys/menu.h" #include "rsys/cquick.h" +using namespace Executor; + void -menu_bar_color (RGBColor *bar_color) +Executor::menu_bar_color (RGBColor *bar_color) { MCEntryPtr mc_entry; @@ -29,7 +31,7 @@ menu_bar_color (RGBColor *bar_color) } void -menu_title_color (int16 id, RGBColor *title_color) +Executor::menu_title_color (int16 id, RGBColor *title_color) { MCEntryPtr mc_entry; @@ -43,7 +45,7 @@ menu_title_color (int16 id, RGBColor *title_color) } void -menu_bk_color (int16 id, RGBColor *bk_color) +Executor::menu_bk_color (int16 id, RGBColor *bk_color) { MCEntryPtr mc_entry; @@ -61,7 +63,7 @@ menu_bk_color (int16 id, RGBColor *bk_color) } void -menu_item_colors (int16 id, int16 item, +Executor::menu_item_colors (int16 id, int16 item, RGBColor *bk_color, RGBColor *name_color, RGBColor *mark_color, RGBColor *command_color) { @@ -101,7 +103,7 @@ menu_item_colors (int16 id, int16 item, } void -menu_delete_entries (int16 menu_id) +Executor::menu_delete_entries (int16 menu_id) { MCTableHandle menu_c_info; MCEntryPtr entries; diff --git a/src/menuV.c b/src/menuV.cpp similarity index 99% rename from src/menuV.c rename to src/menuV.cpp index d9169bfa..18bc1563 100644 --- a/src/menuV.c +++ b/src/menuV.cpp @@ -22,6 +22,8 @@ char ROMlib_rcsid_menuV[] = #include "rsys/wind.h" #include "rsys/prefs.h" +using namespace Executor; + P1(PUBLIC pascal trap, void, InitProcMenu, INTEGER, mbid) { if (!MenuList) diff --git a/src/mixed_mode.c b/src/mixed_mode.cpp similarity index 98% rename from src/mixed_mode.c rename to src/mixed_mode.cpp index 99ae9c5b..d1ec8c98 100644 --- a/src/mixed_mode.c +++ b/src/mixed_mode.cpp @@ -19,6 +19,8 @@ char ROMlib_rcsid_mixed_mode[] = #include "rsys/file.h" +using namespace Executor; + P3 (PUBLIC pascal trap, UniversalProcPtr, NewRoutineDescriptor, ProcPtr, proc, ProcInfoType, info, ISAType, isa) { diff --git a/src/mkexpandtables.c b/src/mkexpandtables/mkexpandtables.c similarity index 100% rename from src/mkexpandtables.c rename to src/mkexpandtables/mkexpandtables.c diff --git a/src/mkseedtables.c b/src/mkseedtables/mkseedtables.c similarity index 97% rename from src/mkseedtables.c rename to src/mkseedtables/mkseedtables.c index 2039411c..b31a091d 100644 --- a/src/mkseedtables.c +++ b/src/mkseedtables/mkseedtables.c @@ -90,7 +90,7 @@ static void buildexpandtable() printf("};\n"); } -int main() +int main(int argc, const char * argv[]) { buildbinarytotrinary(); buildexpandtable(); diff --git a/src/mksspairtable.c b/src/mksspairtable/mksspairtable.c similarity index 96% rename from src/mksspairtable.c rename to src/mksspairtable/mksspairtable.c index dd7cc4e5..8404ec33 100644 --- a/src/mksspairtable.c +++ b/src/mksspairtable/mksspairtable.c @@ -19,7 +19,7 @@ char ROMlib_rcsid_mksspairtable[] = * that represent all the state changes +1 with 0 as a sentinel. */ -int main( void ) +int main(int argc, const char * argv[]) { int lowbit, i, j, value, curbit; diff --git a/src/mkultable.c b/src/mkultable/mkultable.c similarity index 95% rename from src/mkultable.c rename to src/mkultable/mkultable.c index 388789bd..f31345cb 100644 --- a/src/mkultable.c +++ b/src/mkultable/mkultable.c @@ -17,7 +17,7 @@ char ROMlib_rcsid_mkultable[] = typedef unsigned int ULONGINT; -int main() +int main(int argc, const char * argv[]) { ULONGINT i, j; ULONGINT out; diff --git a/src/mkvol/mkvol.c b/src/mkvol/mkvol.cpp similarity index 91% rename from src/mkvol/mkvol.c rename to src/mkvol/mkvol.cpp index 4ce83a11..9a120508 100644 --- a/src/mkvol/mkvol.c +++ b/src/mkvol/mkvol.cpp @@ -20,7 +20,7 @@ char ROMlib_rcsid_mkvol[] = #include -#if defined(__NeXT__) +#if defined(MACOSX_) #include #endif @@ -46,31 +46,22 @@ char ROMlib_rcsid_mkvol[] = typedef short int INTEGER; -#if !defined (__NeXT__) -typedef int boolean_t; -#endif - -#if !defined(__alpha) -typedef long LONGINT; -typedef long int32; -#elif defined(__BORLANDC__) -typedef long LONGINT; -typedef long int32; -#else typedef int LONGINT; typedef int int32; + +#ifndef TRUE +typedef enum { FALSE, TRUE } boolean_t; #endif -#include "../include/rsys/parsenum.h" +#include "rsys/parsenum.h" -#if !defined (TRUE) -enum { FALSE, TRUE }; -#endif +using namespace Executor; -PRIVATE boolean_t write_zeros = FALSE; -PRIVATE void -my_bzero (void *ptr, long nbytes) +PRIVATE bool write_zeros = false; + +static inline void +my_bzero (void *ptr, size_t nbytes) { memset (ptr, 0, nbytes); } @@ -164,7 +155,7 @@ write_volume_info (info_t * infop) */ nalblks = ((infop->nsecs_left - 3 + infop->nsecs_in_alblock - 1) / infop->nsecs_in_alblock); - infop->nsecs_in_map = ((long) nalblks + NMAPBITS - 1) / NMAPBITS; + infop->nsecs_in_map = (int32)(((long) nalblks + NMAPBITS - 1) / NMAPBITS); nalblks = (infop->nsecs_left - infop->nsecs_in_map - 3 + infop->nsecs_in_alblock - 1) / infop->nsecs_in_alblock; infop->nalblocks_in_tree = nalblks / 128; /* TODO: find proper mapping */ @@ -382,7 +373,7 @@ write_catalog (info_t * infop) (unsigned char) catkeyp->ckrCName[0]); set_key_len (catkeyp); - dirp = EVENUP ((char *) catkeyp + catkeyp->ckrKeyLen); + dirp = (directoryrec*)EVENUP ((char *) catkeyp + catkeyp->ckrKeyLen); dirp->cdrType = CBC (DIRTYPE); dirp->cdrResrv2 = CBC (0); dirp->dirFlags = CWC (0); @@ -402,7 +393,7 @@ write_catalog (info_t * infop) catkeyp->ckrCName[0] = 0; set_key_len (catkeyp); - threadp = EVENUP ((char *) catkeyp + catkeyp->ckrKeyLen); + threadp = (threadrec*)EVENUP ((char *) catkeyp + catkeyp->ckrKeyLen); threadp->cdrType = CBC (THREADTYPE); threadp->cdrResrv2 = CBC (0); threadp->thdParID = CLC (1); @@ -420,7 +411,7 @@ write_catalog (info_t * infop) (unsigned char) catkeyp->ckrCName[0]); set_key_len (catkeyp); - filep = EVENUP ((char *) catkeyp + catkeyp->ckrKeyLen); + filep = (filerec*)EVENUP ((char *) catkeyp + catkeyp->ckrKeyLen); filep->cdrType = CBC (FILETYPE); filep->cdrResrv2 = CB (0); filep->filFlags = CBC (0); @@ -468,7 +459,7 @@ write_catalog (info_t * infop) } #define STR_ID 0 -#define STR_NAME "\012Finder 1.0" +#define STR_NAME "\pFinder 1.0" /* * NOTE: the "-1" below is because both the byte count and the null zero @@ -483,82 +474,78 @@ write_catalog (info_t * infop) PRIVATE int write_desktop (info_t * infop) { - +#pragma pack(push, 2) typedef struct - { - char zeros[22] LPACKED; - INTEGER fileattrs PACKED; - INTEGER typeoff PACKED; - INTEGER nameoff PACKED; - INTEGER ntypesminus1 PACKED; - char restype1[4] LPACKED; - INTEGER ntype1minus1 PACKED; - INTEGER reflistoff1 PACKED; - INTEGER resid1 PACKED; - INTEGER resnamoff1 PACKED; - char resattr1 LPACKED; - unsigned char resdoff1[3] LPACKED; - LONGINT reszero1 PACKED; - } - map_t; - + { + char zeros[22]; + INTEGER fileattrs; + INTEGER typeoff; + INTEGER nameoff; + INTEGER ntypesminus1; + char restype1[4]; + INTEGER ntype1minus1; + INTEGER reflistoff1; + INTEGER resid1; + INTEGER resnamoff1; + char resattr1; + unsigned char resdoff1[3]; + LONGINT reszero1; + } map_t; + typedef struct - { - LONGINT datoff PACKED; - LONGINT mapoff PACKED; - LONGINT datlen PACKED; - LONGINT maplen PACKED; - char sysuse[112] LPACKED; - char appluse[128] LPACKED; - LONGINT datalen1 PACKED; - char data1[DATLEN - sizeof (LONGINT)] LPACKED; - map_t map LPACKED; - } - res_data_t; - - static struct - { - res_data_t data; - char filler[SECSIZE - sizeof (res_data_t)]; - } - buf = { + LONGINT datoff; + LONGINT mapoff; + LONGINT datlen; + LONGINT maplen; + char sysuse[112]; + char appluse[128]; + LONGINT datalen1; + char data1[DATLEN - sizeof (LONGINT)]; + map_t map; + } + res_data_t; + + const static struct { + res_data_t data; + char filler[SECSIZE - sizeof (res_data_t)]; + } buf = { { CLC (256), CLC (256 + DATLEN), CLC (DATLEN), CLC (MAPLEN), { - 0, 0, 0, /* ... */ + 0, 0, 0, /* ... */ } , { - 0, 0, 0, /* ... */ + 0, 0, 0, /* ... */ } , CLC (DATLEN - sizeof (LONGINT)), STR_NAME, { - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - } - , - 0x0000, - CWC (22 + 2 + 2 + 2), /* zeros ... nameoff */ - CWC (MAPLEN), - CWC (1 - 1), - { 'S', 'T', 'R', ' ' }, - CWC (1 - 1), - CWC (2 + 4 + 2 + 2), /* ntypesminus1 ... reflistoff1 */ - CWC (STR_ID), - CWC (-1), /* no name */ + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + , + 0x0000, + CWC (22 + 2 + 2 + 2), /* zeros ... nameoff */ + CWC (MAPLEN), + CWC (1 - 1), + { 'S', 'T', 'R', ' ' }, + CWC (1 - 1), + CWC (2 + 4 + 2 + 2), /* ntypesminus1 ... reflistoff1 */ + CWC (STR_ID), + CWC (-1), /* no name */ #if !defined(resPreload) #define resPreload 4 #endif - CBC (resPreload), - { 0, 0, 0 }, - 0, + CBC (resPreload), + { 0, 0, 0 }, + 0, } , } @@ -568,6 +555,7 @@ write_desktop (info_t * infop) WRITE_AND_RETURN_ERROR (infop, &buf, sizeof (buf)); --infop->nsecs_left; return noErr; +#pragma pack(pop) } PRIVATE int @@ -659,7 +647,8 @@ format_disk(unsigned long timevar, const char *volumename, int nsecs, #include -#define DEFAULT_SUFFIX ".hfv" +//#define DEFAULT_SUFFIX ".hfv" +#define DEFAULT_SUFFIX ".img" PRIVATE int mixed_case_match (const char *str1, const char *str2) @@ -678,15 +667,11 @@ mixed_case_match (const char *str1, const char *str2) PRIVATE void adjust_hfv_name (char **namepp) { - char *namep, *suffixp; - int name_len; + char *namep = *namepp, *suffixp; + size_t name_len = strlen(namep); FILE *fp; - namep = *namepp; - name_len = strlen (namep); - - if (name_len >= 4) - { + if (name_len >= 4) { suffixp = namep + name_len - 4; if (mixed_case_match (suffixp, DEFAULT_SUFFIX)) memcpy (suffixp, DEFAULT_SUFFIX, strlen (DEFAULT_SUFFIX)); @@ -700,7 +685,7 @@ adjust_hfv_name (char **namepp) { char *new_namep; - new_namep = malloc (name_len + 4 + 1); + new_namep = (char*)malloc (name_len + 4 + 1); sprintf (new_namep, "%s.hfv", namep); fprintf (stderr, "Adding \".hfv\" to rename \"%s\" to \"%s\"\n", namep, new_namep); @@ -774,10 +759,9 @@ check_hfv_name (const char *hfv_name) PRIVATE boolean_t check_volume_name (const char *volume_name) { - int len; + size_t len = strlen (volume_name); boolean_t success_p; - len = strlen (volume_name); if (len == 0) { fprintf (stderr, "You can't have an empty volume name!\n"); @@ -840,7 +824,7 @@ check_volume_size (const char *volume_size_string) static void cleanup_string (char *s) { - int len; + size_t len; len = strlen (s); @@ -873,7 +857,7 @@ read_parameter (const char *prompt, char **s, cleanup_string (buf); } while (!verify_func (buf)); - *s = strcpy (malloc (strlen (buf) + 1), buf); + *s = strcpy ((char*)malloc (strlen (buf) + 1), buf); success_p = TRUE; done: @@ -886,6 +870,8 @@ read_parameter (const char *prompt, char **s, #define OS_NAME "Linux" #elif defined (__NeXT__) #define OS_NAME "NEXTSTEP" +#elif defined (MACOSX_) +#define OS_NAME "Mac OS X" #endif PRIVATE boolean_t diff --git a/src/mkvol/mkvol.h b/src/mkvol/mkvol.h index 8c51816d..3af00c10 100644 --- a/src/mkvol/mkvol.h +++ b/src/mkvol/mkvol.h @@ -6,7 +6,7 @@ * All rights reserved. */ -typedef size_t (*write_funcp_t) (int user_arg, void *bufp, size_t buf_len); +typedef size_t (*write_funcp_t) (int user_arg, const void *bufp, size_t buf_len); extern int format_disk(unsigned long timevar, const char *volumename, int nsecs, diff --git a/src/mkvol/mkvol_internal.h b/src/mkvol/mkvol_internal.h index 29c1f447..7528e39f 100644 --- a/src/mkvol/mkvol_internal.h +++ b/src/mkvol/mkvol_internal.h @@ -13,31 +13,13 @@ #if !defined(_MKVOL_INTERNAL_H_) #define _MKVOL_INTERNAL_H_ -#if defined(__alpha) || defined(i386) || defined(__BORLANDC__) || defined (__x86_64__) +#if defined(__alpha) || defined(i386) || defined(__BORLANDC__) || defined (__x86_64__) || defined(__LITTLE_ENDIAN__) #define LITTLEENDIAN -#elif defined(mc68000) || defined (powerpc) || defined (__ppc__) +#elif defined(mc68000) || defined (powerpc) || defined (__ppc__) || defined(__BIG_ENDIAN__) #else #error "I don't know enough about this machine" #endif -#if defined(__GNUC__) - -#if !defined(mc68000) -#define PACKED __attribute__((packed)) -#else /* defined(mc68000) */ -#define PACKED -#endif /* defined(mc68000) */ - -#else /* defined(__GNUC__) */ - -#if defined(__BORLANDC__) -#define PACKED -#else -#error "Don't know how to handle PACKED" -#endif - -#endif /* !defined(__GNUC__) */ - #define TICK(str) (((LONGINT) (unsigned char) str[0] << 24) | \ ((LONGINT) (unsigned char) str[1] << 16) | \ ((LONGINT) (unsigned char) str[2] << 8) | \ @@ -59,10 +41,10 @@ ( (signed short) ((((rhs) << 8) & 0xFF00) | \ (((rhs) >> 8) & 0x00FF))) -#define CLCreal(rhs) ( ((((unsigned long) (rhs) & 0x000000FF) << 24) |\ - (((unsigned long) (rhs) & 0x0000FF00) << 8) |\ - (((unsigned long) (rhs) & 0x00FF0000) >> 8) |\ - (((unsigned long) (rhs) & 0xFF000000) >> 24)) ) +#define CLCreal(rhs) ( ((((unsigned int) (rhs) & 0x000000FF) << 24) |\ + (((unsigned int) (rhs) & 0x0000FF00) << 8) |\ + (((unsigned int) (rhs) & 0x00FF0000) >> 8) |\ + (((unsigned int) (rhs) & 0xFF000000) >> 24)) ) #define CW(rhs) CWCreal(rhs) #define CWC(rhs) CWCreal(rhs) @@ -75,87 +57,85 @@ #define fInvisible 16384 -typedef long OSType; +#pragma pack(push, 2) + +typedef unsigned int OSType; typedef struct { - short v PACKED; - short h PACKED; + short v; + short h; } Point; -#if !defined(LPACKED) -# define LPACKED -#endif - typedef struct { - OSType fdType PACKED; - OSType fdCreator PACKED; - unsigned short fdFlags PACKED; - Point fdLocation LPACKED; - unsigned short fdFldr PACKED; + OSType fdType; + OSType fdCreator; + unsigned short fdFlags; + Point fdLocation; + unsigned short fdFldr; } FInfo; typedef struct { - unsigned short blockstart PACKED; - unsigned short blockcount PACKED; + unsigned short blockstart ; + unsigned short blockcount ; } xtntdesc, xtntrec[3]; /* WILL NEED Cx() */ typedef struct { - unsigned short drSigWord PACKED; /* 0 */ - long drCrDate PACKED; /* 2 */ - long drLsMod PACKED; /* 6 */ - unsigned short drAtrb PACKED; /* 10 */ - unsigned short drNmFls PACKED; /* 12 */ - unsigned short drVBMSt PACKED; /* 14 */ - unsigned short drAllocPtr PACKED; /* 16 */ - unsigned short drNmAlBlks PACKED; /* 18 */ - long drAlBlkSiz PACKED; /* 20 */ - long drClpSiz PACKED; - unsigned short drAlBlSt PACKED; - long drNxtCNID PACKED; - unsigned short drFreeBks PACKED; - unsigned char drVN[28] LPACKED; - long drVolBkUp PACKED; - unsigned short drVSeqNum PACKED; - long drWrCnt PACKED; - long drXTClpSiz PACKED; - long drCTClpSiz PACKED; - unsigned short drNmRtDirs PACKED; - long drFilCnt PACKED; - long drDirCnt PACKED; - long drFndrInfo[8] PACKED; - unsigned short drVCSize PACKED; - unsigned short drVCBMSize PACKED; - unsigned short drCtlCSize PACKED; - long drXTFlSize PACKED; - xtntrec drXTExtRec LPACKED; - long drCTFlSize PACKED; - xtntrec drCTExtRec LPACKED; + unsigned short drSigWord ; /* 0 */ + int drCrDate ; /* 2 */ + int drLsMod ; /* 6 */ + unsigned short drAtrb ; /* 10 */ + unsigned short drNmFls ; /* 12 */ + unsigned short drVBMSt ; /* 14 */ + unsigned short drAllocPtr ; /* 16 */ + unsigned short drNmAlBlks ; /* 18 */ + int drAlBlkSiz ; /* 20 */ + int drClpSiz ; + unsigned short drAlBlSt ; + int drNxtCNID ; + unsigned short drFreeBks ; + unsigned char drVN[28] ; + int drVolBkUp ; + unsigned short drVSeqNum ; + int drWrCnt ; + int drXTClpSiz ; + int drCTClpSiz ; + unsigned short drNmRtDirs ; + int drFilCnt ; + int drDirCnt ; + int drFndrInfo[8] ; + unsigned short drVCSize ; + unsigned short drVCBMSize ; + unsigned short drCtlCSize ; + int drXTFlSize ; + xtntrec drXTExtRec ; + int drCTFlSize ; + xtntrec drCTExtRec ; } volumeinfo, *volumeinfoPtr, **volumeinfoHandle; typedef struct { - long ndFLink PACKED; - long ndBLink PACKED; - unsigned char ndType LPACKED; - char ndLevel LPACKED; - short ndNRecs PACKED; - unsigned short idunno PACKED; + int ndFLink ; + int ndBLink ; + unsigned char ndType ; + char ndLevel ; + short ndNRecs ; + unsigned short idunno ; } btnode; typedef enum { indexnode, leafnode = 0xFF } btnodetype; typedef struct { - unsigned char ckrKeyLen LPACKED; - char ckrResrv1 LPACKED; - long ckrParID PACKED; - unsigned char ckrCName[32] LPACKED; + unsigned char ckrKeyLen ; + char ckrResrv1 ; + int ckrParID ; + unsigned char ckrCName[32] ; } catkey; typedef struct { - unsigned char xkrKeyLen LPACKED; - unsigned char xkrFkType LPACKED; - long xkrFNum PACKED; - unsigned short xkrFABN PACKED; + unsigned char xkrKeyLen ; + unsigned char xkrFkType ; + int xkrFNum ; + unsigned short xkrFABN ; } xtntkey; typedef union { @@ -167,52 +147,52 @@ typedef union { #define FILETYPE 2 typedef struct { - char cdrType LPACKED; - char cdrResrv2 LPACKED; - char filFlags LPACKED; - char filTyp LPACKED; - FInfo filUsrWds LPACKED; /* not sure what form */ - long filFlNum PACKED; - unsigned short filStBlk PACKED; /* I don't think this is used */ - long filLgLen PACKED; - long filPyLen PACKED; - unsigned short filRStBlk PACKED; /* not used? */ - long filRLgLen PACKED; - long filRPyLen PACKED; - long filCrDat PACKED; - long filMdDat PACKED; - long filBkDat PACKED; - long filFndrInfo[4] PACKED; - unsigned short filClpSize PACKED; - xtntrec filExtRec LPACKED; - xtntrec filRExtRec LPACKED; - long filResrv PACKED; + char cdrType ; + char cdrResrv2 ; + char filFlags ; + char filTyp ; + FInfo filUsrWds ; /* not sure what form */ + int filFlNum ; + unsigned short filStBlk ; /* I don't think this is used */ + int filLgLen ; + int filPyLen ; + unsigned short filRStBlk ; /* not used? */ + int filRLgLen ; + int filRPyLen ; + int filCrDat ; + int filMdDat ; + int filBkDat ; + int filFndrInfo[4] ; + unsigned short filClpSize ; + xtntrec filExtRec ; + xtntrec filRExtRec ; + int filResrv ; } filerec; #define DIRTYPE 1 typedef struct { - char cdrType LPACKED; - char cdrResrv2 LPACKED; - unsigned short dirFlags PACKED; - unsigned short dirVal PACKED; - long dirDirID PACKED; - long dirCrDat PACKED; - long dirMdDat PACKED; - long dirBkDat PACKED; - long dirUsrInfo[4] PACKED; - long dirFndrInfo[4] PACKED; - long dirResrv[4] PACKED; + char cdrType ; + char cdrResrv2 ; + unsigned short dirFlags ; + unsigned short dirVal ; + int dirDirID ; + int dirCrDat ; + int dirMdDat ; + int dirBkDat ; + int dirUsrInfo[4] ; + int dirFndrInfo[4] ; + int dirResrv[4] ; } directoryrec; #define THREADTYPE 3 typedef struct { - char cdrType LPACKED; - char cdrResrv2 LPACKED; - char thdResrv[8] LPACKED; - long thdParID PACKED; - unsigned char thdCName[32] LPACKED; + char cdrType ; + char cdrResrv2 ; + char thdResrv[8] ; + int thdParID ; + unsigned char thdCName[32] ; } threadrec; typedef enum { datafork, resourcefork = 0xFF } forktype; @@ -222,24 +202,26 @@ typedef enum { databusy, resourcebusy, eitherbusy } busyconcern_t; typedef enum { reading, writing } accesstype; typedef struct { - long flink PACKED; /* 0 */ - long blink PACKED; /* 4 */ - unsigned char type LPACKED; /* 8 */ - unsigned char dummy LPACKED; /* 9 */ - unsigned short hesthreejim PACKED; /* 10 */ - long height PACKED; /* 12 */ - long root PACKED; /* 16 */ - long numentries PACKED; /* 20 */ - long firstleaf PACKED; /* 24 */ - long lastleaf PACKED; /* 28 */ - unsigned short btnodesize PACKED; /* 32 */ - unsigned short indexkeylen PACKED; /* 34 */ - long nnodes PACKED; /* 36 */ - long nfreenodes PACKED; /* 40 */ - unsigned char reserved[72] LPACKED; /* 44 */ - unsigned char dummy2[132] LPACKED; /* 116 */ - unsigned char map[256] LPACKED; /* 248 */ - long unknown2[2] PACKED; /* 504 */ + int flink ; /* 0 */ + int blink ; /* 4 */ + unsigned char type ; /* 8 */ + unsigned char dummy ; /* 9 */ + unsigned short hesthreejim ; /* 10 */ + int height ; /* 12 */ + int root ; /* 16 */ + int numentries ; /* 20 */ + int firstleaf ; /* 24 */ + int lastleaf ; /* 28 */ + unsigned short btnodesize ; /* 32 */ + unsigned short indexkeylen ; /* 34 */ + int nnodes ; /* 36 */ + int nfreenodes ; /* 40 */ + unsigned char reserved[72] ; /* 44 */ + unsigned char dummy2[132] ; /* 116 */ + unsigned char map[256] ; /* 248 */ + int unknown2[2] ; /* 504 */ } btblock0; +#pragma pack(pop) + #endif diff --git a/src/mman.c b/src/mman.cpp similarity index 93% rename from src/mman.c rename to src/mman.cpp index 6b3e6fe6..82d3899a 100644 --- a/src/mman.c +++ b/src/mman.cpp @@ -33,7 +33,7 @@ char ROMlib_rcsid_mman[] = #include "dpmilock.h" #endif -#if defined (LINUX) || defined (MACOSX) +#if defined (LINUX) || defined (MACOSX_) #include #if !defined (MAP_ANONYMOUS) @@ -42,13 +42,13 @@ char ROMlib_rcsid_mman[] = #endif /* LINUX */ -#if defined(NEXT) && !defined (STRICT_OPENSTEP) #include -#endif -int ROMlib_applzone_size = DEFAULT_APPLZONE_SIZE; -int ROMlib_syszone_size = DEFAULT_SYSZONE_SIZE; -int ROMlib_stack_size = DEFAULT_STACK_SIZE; +using namespace Executor; + +int Executor::ROMlib_applzone_size = DEFAULT_APPLZONE_SIZE; +int Executor::ROMlib_syszone_size = DEFAULT_SYSZONE_SIZE; +int Executor::ROMlib_stack_size = DEFAULT_STACK_SIZE; /* these two variables define, in ROMlib space, the beginning of mac-memory and the end of mac memory. They're purpose is to try to prevent routines @@ -58,13 +58,13 @@ int ROMlib_stack_size = DEFAULT_STACK_SIZE; 0xFFFF0048 both here and on a Mac. On a Mac, this doesn't cause a crash. */ -PUBLIC unsigned long ROMlib_syszone; -PUBLIC unsigned long ROMlib_memtop; +PUBLIC unsigned long Executor::ROMlib_syszone; +PUBLIC unsigned long Executor::ROMlib_memtop; #if defined (MM_MANY_APPLZONES) /* for debugging, we can have multiple applzones which are used roundrobin */ -int mm_n_applzones = 1; +int Executor::mm_n_applzones = 1; static int mm_current_applzone; #endif @@ -76,7 +76,7 @@ static int mm_current_applzone; } while (FALSE) SignedByte -hlock_return_orig_state (Handle h) +Executor::hlock_return_orig_state (Handle h) { block_header_t *block; SignedByte state; @@ -104,13 +104,13 @@ hlock_return_orig_state (Handle h) } Size -zone_size (THz zone) +Executor::zone_size (THz zone) { return (char *) ZONE_BK_LIM (zone) - (char *) zone; } SignedByte -HGetState (Handle h) +Executor::HGetState (Handle h) { block_header_t *block; @@ -139,7 +139,7 @@ HGetState (Handle h) } void -HSetState (Handle h, SignedByte flags) +Executor::HSetState (Handle h, SignedByte flags) { block_header_t *block; @@ -164,7 +164,7 @@ HSetState (Handle h, SignedByte flags) } void -HLock (Handle h) +Executor::HLock (Handle h) { block_header_t *block; @@ -189,7 +189,7 @@ HLock (Handle h) } void -HUnlock (Handle h) +Executor::HUnlock (Handle h) { block_header_t *block; @@ -214,7 +214,7 @@ HUnlock (Handle h) } void -HPurge (Handle h) +Executor::HPurge (Handle h) { block_header_t *block; @@ -239,7 +239,7 @@ HPurge (Handle h) } void -HNoPurge (Handle h) +Executor::HNoPurge (Handle h) { block_header_t *block; @@ -264,7 +264,7 @@ HNoPurge (Handle h) } void -HSetRBit (Handle h) +Executor::HSetRBit (Handle h) { block_header_t *block; @@ -289,7 +289,7 @@ HSetRBit (Handle h) } void -HClrRBit (Handle h) +Executor::HClrRBit (Handle h) { block_header_t *block; @@ -342,7 +342,7 @@ canonicalize_memory_sizes (void) void -InitApplZone (void) +Executor::InitApplZone (void) { /* ApplZone must already be set before getting here */ @@ -368,7 +368,7 @@ InitApplZone (void) void -print_mem_full_message (void) +Executor::print_mem_full_message (void) { fprintf (stderr, "Executor has run out of memory. Try specifying " @@ -381,7 +381,7 @@ print_mem_full_message (void) } void -ROMlib_InitZones (offset_enum which) +Executor::ROMlib_InitZones (offset_enum which) { static boolean_t beenhere = FALSE; static Ptr stack_begin, stack_end; @@ -437,7 +437,7 @@ ROMlib_InitZones (offset_enum which) * byte of any address in the space just allocated. */ if (memory == NULL) - memory = mmap_permanent_memory (total_allocated_memory); + memory = (char*)mmap_permanent_memory (total_allocated_memory); #endif /* TRY_TO_MMAP_ZONES */ #if defined (SBRK_PERMANENT_MEMORY) @@ -451,7 +451,7 @@ ROMlib_InitZones (offset_enum which) /* Allocate with malloc if we don't have it yet. */ if (memory == NULL) - memory = malloc (total_allocated_memory); + memory = (char*)malloc (total_allocated_memory); if (memory == NULL) { @@ -497,7 +497,7 @@ ROMlib_InitZones (offset_enum which) MemTop = mem_top; - SysZone = (void *) RM (memory); + SysZone = (THz) RM (memory); ROMlib_syszone = (unsigned long) memory; ROMlib_memtop = (unsigned long) (memory + total_allocated_memory); InitZone (0, 32, (Ptr) ((long) MR (SysZone) + init_syszone_size), @@ -529,7 +529,7 @@ ROMlib_InitZones (offset_enum which) ApplZone = (THz) RM ((long) MR (SysZone) + INIT_SYSZONE_SIZE); #endif - InitApplZone (); + Executor::InitApplZone (); ApplLimit = RM ((Ptr) ((long) MR (ApplZone) + INIT_APPLZONE_SIZE)); @@ -544,7 +544,7 @@ ROMlib_InitZones (offset_enum which) } void -SetApplBase (Ptr newbase) +Executor::SetApplBase (Ptr newbase) { int32 totend; @@ -574,12 +574,12 @@ SetApplBase (Ptr newbase) so we just let the old bkLim stand. */ ApplZone = RM ((THz) newbase); - InitApplZone (); + Executor::InitApplZone (); SET_MEM_ERR (noErr); } void -MoreMasters (void) +Executor::MoreMasters (void) { THz current_zone; uint32 *handles; @@ -619,7 +619,7 @@ print_free (void) #endif void -InitZone (ProcPtr pGrowZone, int16 cMoreMasters, +Executor::InitZone (ProcPtr pGrowZone, int16 cMoreMasters, Ptr limitPtr, THz zone) { block_header_t *last_block; @@ -659,7 +659,7 @@ InitZone (ProcPtr pGrowZone, int16 cMoreMasters, #if 0 zone->sparePtr = CLC ((Ptr) 0x83d2); /* From experimentation */ #else - zone->sparePtr = CLC (0); /* Better safe than sorry */ + zone->sparePtr = (Ptr)CLC (0); /* Better safe than sorry */ #endif zone->allocPtr = RM ((Ptr) first_block); @@ -680,7 +680,7 @@ InitZone (ProcPtr pGrowZone, int16 cMoreMasters, } THz -GetZone (void) +Executor::GetZone (void) { MM_SLAM ("entry"); @@ -689,7 +689,7 @@ GetZone (void) } void -SetZone (THz hz) +Executor::SetZone (THz hz) { MM_SLAM ("entry"); TheZone = RM (hz); @@ -698,7 +698,7 @@ SetZone (THz hz) Handle -_NewEmptyHandle_flags (boolean_t sys_p) +Executor::_NewEmptyHandle_flags (boolean_t sys_p) { THz save_zone, current_zone; Handle h; @@ -738,7 +738,7 @@ _NewEmptyHandle_flags (boolean_t sys_p) } Handle -_NewHandle_flags (Size size, boolean_t sys_p, boolean_t clear_p) +Executor::_NewHandle_flags (Size size, boolean_t sys_p, boolean_t clear_p) { Handle newh; block_header_t *block; @@ -788,7 +788,7 @@ _NewHandle_flags (Size size, boolean_t sys_p, boolean_t clear_p) #define TTS_HACK (ROMlib_options & ROMLIB_DISPOSHANDLE_HACK_BIT) void -DisposHandle (Handle h) +Executor::DisposHandle (Handle h) { MM_SLAM ("entry"); @@ -853,7 +853,7 @@ DisposHandle (Handle h) } Size -GetHandleSize (Handle h) +Executor::GetHandleSize (Handle h) { block_header_t *block; Size retval; @@ -881,7 +881,7 @@ GetHandleSize (Handle h) } void -SetHandleSize (Handle h, Size newsize) +Executor::SetHandleSize (Handle h, Size newsize) { block_header_t *block; int32 oldpsize; @@ -889,7 +889,7 @@ SetHandleSize (Handle h, Size newsize) boolean_t save_memnomove_p; unsigned int state; -#if defined (X) /* what about NEXTSTEP? */ +#if defined (X) /* what about MACOSX_? */ if (h == MR (TEScrpHandle)) WeOwnScrapX (); #endif @@ -981,7 +981,7 @@ SetHandleSize (Handle h, Size newsize) && (unsigned long) (ptr) <= (unsigned long) ZONE_BK_LIM (MR (z))) THz -HandleZone (Handle h) +Executor::HandleZone (Handle h) { THz zone; block_header_t *block; @@ -1058,11 +1058,11 @@ HandleZone (Handle h) } Handle -_RecoverHandle_flags (Ptr p, boolean_t sys_p) +Executor::_RecoverHandle_flags (Ptr p, boolean_t sys_p) { block_header_t *block; THz zones[3]; - Handle h; + Handle h = 0; int i; MM_SLAM ("entry"); @@ -1102,7 +1102,7 @@ _RecoverHandle_flags (Ptr p, boolean_t sys_p) } void -ReallocHandle (Handle h, Size size) +Executor::ReallocHandle (Handle h, Size size) { block_header_t *oldb, *newb; int32 newsize; @@ -1189,7 +1189,7 @@ int do_save_alloc = 0; #endif Ptr -_NewPtr_flags (Size size, boolean_t sys_p, boolean_t clear_p) +Executor::_NewPtr_flags (Size size, boolean_t sys_p, boolean_t clear_p) { Ptr p; block_header_t *b; @@ -1249,7 +1249,7 @@ _NewPtr_flags (Size size, boolean_t sys_p, boolean_t clear_p) } void -DisposPtr (Ptr p) +Executor::DisposPtr (Ptr p) { MM_SLAM ("entry"); @@ -1284,7 +1284,7 @@ DisposPtr (Ptr p) Size -GetPtrSize (Ptr p) +Executor::GetPtrSize (Ptr p) { block_header_t *block; @@ -1304,7 +1304,7 @@ GetPtrSize (Ptr p) } void -SetPtrSize (Ptr p, Size newsize) +Executor::SetPtrSize (Ptr p, Size newsize) { block_header_t *block; LONGINT oldpsize; @@ -1401,7 +1401,7 @@ legit_zone_p (THz zone) } THz -PtrZone (Ptr p) +Executor::PtrZone (Ptr p) { block_header_t *block; THz zone; @@ -1433,7 +1433,7 @@ PtrZone (Ptr p) } int32 -_FreeMem_flags (boolean_t sys_p) +Executor::_FreeMem_flags (boolean_t sys_p) { uint32 freespace; @@ -1449,7 +1449,7 @@ _FreeMem_flags (boolean_t sys_p) } Size -_MaxMem_flags (Size *growp, boolean_t sys_p) +Executor::_MaxMem_flags (Size *growp, boolean_t sys_p) { block_header_t *b; THz save_zone; @@ -1554,7 +1554,7 @@ _MaxMem_flags (Size *growp, boolean_t sys_p) Size -_CompactMem_flags (Size sizeneeded, boolean_t sys_p) +Executor::_CompactMem_flags (Size sizeneeded, boolean_t sys_p) { int32 amtfree; block_header_t *src, *target, *ap; @@ -1663,7 +1663,7 @@ _CompactMem_flags (Size sizeneeded, boolean_t sys_p) } void -_ResrvMem_flags (Size needed, boolean_t sys_p) +Executor::_ResrvMem_flags (Size needed, boolean_t sys_p) { THz save_zone; THz current_zone; @@ -1724,7 +1724,7 @@ _ResrvMem_flags (Size needed, boolean_t sys_p) } void -_PurgeMem_flags (Size sizeneeded, boolean_t sys_p) +Executor::_PurgeMem_flags (Size sizeneeded, boolean_t sys_p) { long amount_free, max_free; block_header_t *b; @@ -1799,19 +1799,19 @@ BlockMove_and_possibly_flush_cache (Ptr src, Ptr dst, Size cnt, } void -BlockMove (Ptr src, Ptr dst, Size cnt) +Executor::BlockMove (Ptr src, Ptr dst, Size cnt) { BlockMove_and_possibly_flush_cache (src, dst, cnt, TRUE); } void -BlockMoveData (Ptr src, Ptr dst, Size cnt) +Executor::BlockMoveData (Ptr src, Ptr dst, Size cnt) { BlockMove_and_possibly_flush_cache (src, dst, cnt, FALSE); } void -BlockMove_the_trap (Ptr src, Ptr dst, Size cnt, boolean_t flush_p) +Executor::BlockMove_the_trap (Ptr src, Ptr dst, Size cnt, boolean_t flush_p) { MM_SLAM ("entry"); BlockMove_and_possibly_flush_cache (src, dst, cnt, flush_p); @@ -1819,7 +1819,7 @@ BlockMove_the_trap (Ptr src, Ptr dst, Size cnt, boolean_t flush_p) } void -MaxApplZone (void) +Executor::MaxApplZone (void) { MM_SLAM ("entry"); @@ -1828,7 +1828,7 @@ MaxApplZone (void) } void -MoveHHi (Handle h) +Executor::MoveHHi (Handle h) { MM_SLAM ("entry"); @@ -1857,7 +1857,7 @@ MoveHHi (Handle h) } int32 -_MaxBlock_flags (boolean_t sys_p) +Executor::_MaxBlock_flags (boolean_t sys_p) { THz save_zone; THz current_zone; @@ -1898,7 +1898,7 @@ _MaxBlock_flags (boolean_t sys_p) } void -_PurgeSpace_flags (Size *total_out, Size *contig_out, boolean_t sys_p) +Executor::_PurgeSpace_flags (Size *total_out, Size *contig_out, boolean_t sys_p) { THz save_zone, current_zone; int32 total_free; @@ -1948,7 +1948,7 @@ _PurgeSpace_flags (Size *total_out, Size *contig_out, boolean_t sys_p) } Size -StackSpace (void) +Executor::StackSpace (void) { int32 fp; @@ -1964,7 +1964,7 @@ StackSpace (void) } void -SetApplLimit (Ptr new_limit) +Executor::SetApplLimit (Ptr new_limit) { /* NOTE TO CLIFF: We can't do any sanity checks here (not even a brk()), since @@ -1983,7 +1983,7 @@ SetApplLimit (Ptr new_limit) } void -SetGrowZone (ProcPtr newgz) +Executor::SetGrowZone (ProcPtr newgz) { MM_SLAM ("entry"); @@ -1992,7 +1992,7 @@ SetGrowZone (ProcPtr newgz) } void -EmptyHandle (Handle h) +Executor::EmptyHandle (Handle h) { THz save_zone, current_zone; block_header_t *b; @@ -2053,7 +2053,7 @@ EmptyHandle (Handle h) /* Fluff for Cliff */ void -ROMlib_installhandle (Handle sh, Handle dh) +Executor::ROMlib_installhandle (Handle sh, Handle dh) { THz save_zone; @@ -2088,7 +2088,7 @@ ROMlib_installhandle (Handle sh, Handle dh) } OSErr -MemError (void) +Executor::MemError (void) { MM_SLAM ("entry"); @@ -2096,7 +2096,7 @@ MemError (void) } THz -SystemZone (void) +Executor::SystemZone (void) { MM_SLAM ("entry"); @@ -2104,7 +2104,7 @@ SystemZone (void) } THz -ApplicZone (void) +Executor::ApplicZone (void) { MM_SLAM ("entry"); @@ -2116,7 +2116,7 @@ ApplicZone (void) * NewHandleSys_copy_ptr macros to access this function. */ Handle -_NewHandle_copy_ptr_flags (Size size, const void *data_to_copy, +Executor::_NewHandle_copy_ptr_flags (Size size, const void *data_to_copy, boolean_t sys_p) { Handle h; @@ -2132,7 +2132,7 @@ _NewHandle_copy_ptr_flags (Size size, const void *data_to_copy, * NewHandleSys_copy_handle macros to access this function. */ Handle -_NewHandle_copy_handle_flags (Size size, Handle data_to_copy, boolean_t sys_p) +Executor::_NewHandle_copy_handle_flags (Size size, Handle data_to_copy, boolean_t sys_p) { Handle h; @@ -2149,7 +2149,7 @@ _NewHandle_copy_handle_flags (Size size, Handle data_to_copy, boolean_t sys_p) * NewPtrSys_copy_ptr macros to access this function. */ Ptr -_NewPtr_copy_ptr_flags (Size size, const void *data_to_copy, +Executor::_NewPtr_copy_ptr_flags (Size size, const void *data_to_copy, boolean_t sys_p) { Ptr p; @@ -2165,7 +2165,7 @@ _NewPtr_copy_ptr_flags (Size size, const void *data_to_copy, * NewPtrSys_copy_handle macros to access this function. */ Ptr -_NewPtr_copy_handle_flags (Size size, Handle data_to_copy, boolean_t sys_p) +Executor::_NewPtr_copy_handle_flags (Size size, Handle data_to_copy, boolean_t sys_p) { Ptr p; diff --git a/src/mmansubr.c b/src/mmansubr.cpp similarity index 94% rename from src/mmansubr.c rename to src/mmansubr.cpp index 4d1ab0f0..89df08af 100644 --- a/src/mmansubr.c +++ b/src/mmansubr.cpp @@ -23,9 +23,11 @@ char ROMlib_rcsid_mmansubr[] = #include +using namespace Executor; + /* Attempts to notify the user of a catastrophic heap failure then exits. */ void -mman_heap_death (const char *func, const char *where) +Executor::mman_heap_death (const char *func, const char *where) { static boolean_t already_dead_p = FALSE; char err_msg[256]; @@ -101,7 +103,7 @@ dump_zone (THz zone) #if ERROR_SUPPORTED_P (ERROR_MEMORY_MANAGER_SLAM) -block_header_t * +static block_header_t * addr_block (THz zone, char *addr) { block_header_t *t; @@ -119,14 +121,14 @@ addr_block (THz zone, char *addr) return NULL; } -boolean_t +static boolean_t addr_in_zone_p (THz zone, char *addr) { return ((char *) ZONE_HEAP_DATA (zone) <= addr && addr <= (char *) ZONE_BK_LIM (zone)); } -void +static void addr_info (char *addr) { THz zones[3], addr_zone; @@ -315,7 +317,7 @@ addr_info (char *addr) } void -ROMlib_sledgehammer_zone (THz zone, boolean_t print_p, +Executor::ROMlib_sledgehammer_zone (THz zone, boolean_t print_p, const char *fn, const char *file, int lineno, const char *where, zone_info_t *infop) { @@ -449,20 +451,20 @@ ROMlib_sledgehammer_zone (THz zone, boolean_t print_p, } void -ROMlib_sledgehammer_zones (const char *fn, const char *file, int lineno, +Executor::ROMlib_sledgehammer_zones (const char *fn, const char *file, int lineno, const char *where, zone_info_t *info_array) { - ROMlib_sledgehammer_zone (MR (SysZone), FALSE, - fn, file, lineno, where, - info_array ? &info_array[0] : NULL); - ROMlib_sledgehammer_zone (MR (ApplZone), FALSE, - fn, file, lineno, where, - info_array ? &info_array[1] : NULL); - if (TheZone != SysZone - && TheZone != ApplZone) - ROMlib_sledgehammer_zone (MR (TheZone), FALSE, - fn, file, lineno, where, - info_array ? &info_array[2] : NULL); + ROMlib_sledgehammer_zone (MR (SysZone), FALSE, + fn, file, lineno, where, + info_array ? &info_array[0] : NULL); + ROMlib_sledgehammer_zone (MR (ApplZone), FALSE, + fn, file, lineno, where, + info_array ? &info_array[1] : NULL); + if (TheZone != SysZone + && TheZone != ApplZone) + ROMlib_sledgehammer_zone (MR (TheZone), FALSE, + fn, file, lineno, where, + info_array ? &info_array[2] : NULL); } #endif @@ -482,7 +484,7 @@ mm_set_block_fields_common (block_header_t *block, } void -mm_set_block_fields_offset (block_header_t *block, +Executor::mm_set_block_fields_offset (block_header_t *block, unsigned state, unsigned use, unsigned size_correction, uint32 physical_size, uint32 location) @@ -493,7 +495,7 @@ mm_set_block_fields_offset (block_header_t *block, } void -mm_set_block_fields_zone (block_header_t *block, +Executor::mm_set_block_fields_zone (block_header_t *block, unsigned state, unsigned use, unsigned size_correction, uint32 physical_size, uint32 location) @@ -509,7 +511,7 @@ mm_set_block_fields_zone (block_header_t *block, calculate the offset of the master pointer in the location field. */ void -ROMlib_setupblock (block_header_t *block, +Executor::ROMlib_setupblock (block_header_t *block, uint32 size, int16 use, Handle master_ptr, ...) { int32 oldsize; @@ -607,7 +609,7 @@ ROMlib_setupblock (block_header_t *block, } void -ROMlib_coalesce (block_header_t *block) +Executor::ROMlib_coalesce (block_header_t *block) { block_header_t *t_block; int32 total_free; @@ -635,7 +637,7 @@ ROMlib_coalesce (block_header_t *block) /* Mark a block free. If relocatable, the master must have already been updated appropriately */ void -ROMlib_freeblock (block_header_t *block) +Executor::ROMlib_freeblock (block_header_t *block) { THz current_zone; @@ -652,7 +654,7 @@ ROMlib_freeblock (block_header_t *block) /* Move the relocatable block at OLDL to the empty block NEWL, growing its size to NEWSIZE */ void -ROMlib_moveblock (block_header_t *oldl, block_header_t *newl, +Executor::ROMlib_moveblock (block_header_t *oldl, block_header_t *newl, uint32 newsize) { Handle master; @@ -674,7 +676,7 @@ ROMlib_moveblock (block_header_t *oldl, block_header_t *newl, /* Move the relocatable block at BLOCK to some point after the block AFTER if at all possible. Return 1 if successful. */ boolean_t -ROMlib_pushblock (block_header_t *block, block_header_t *after) +Executor::ROMlib_pushblock (block_header_t *block, block_header_t *after) { block_header_t *t_block; THz current_zone; @@ -700,12 +702,12 @@ ROMlib_pushblock (block_header_t *block, block_header_t *after) return FALSE; } -boolean_t ROMlib_memnomove_p = 0; +boolean_t Executor::ROMlib_memnomove_p = 0; /* Make space for a block of size SIZE starting at BLOCK. If space exists return 1, else return 0. */ boolean_t -ROMlib_makespace (block_header_t **block_out, uint32 size) +Executor::ROMlib_makespace (block_header_t **block_out, uint32 size) { block_header_t *b; uint32 total_size; @@ -777,7 +779,7 @@ ROMlib_makespace (block_header_t **block_out, uint32 size) /* Tell if BLOCK is locked or not */ boolean_t -ROMlib_locked (block_header_t *block) +Executor::ROMlib_locked (block_header_t *block) { Handle h; @@ -790,7 +792,7 @@ ROMlib_locked (block_header_t *block) /* Find the total amount of free space starting at block. Compress them all. */ int32 -ROMlib_amtfree (block_header_t *block) +Executor::ROMlib_amtfree (block_header_t *block) { int32 total; block_header_t *b; @@ -820,14 +822,14 @@ ROMlib_amtfree (block_header_t *block) #if !defined (NDEBUG) void -checkallocptr (void) +Executor::checkallocptr (void) { block_header_t *b; THz current_zone; current_zone = MR (TheZone); - if (ZONE_ALLOC_PTR_X (current_zone) == CLC (0)) + if (ZONE_ALLOC_PTR_X (current_zone) == (Ptr)CLC (0)) return; for (b = ZONE_HEAP_DATA (current_zone); b != ZONE_BK_LIM (current_zone); @@ -848,7 +850,7 @@ checkallocptr (void) address in newblk. Size must include the header. Return an error code. Don't actually set the block up here.*/ OSErr -ROMlib_relalloc (Size size, block_header_t ** newblk) +Executor::ROMlib_relalloc (Size size, block_header_t ** newblk) { block_header_t *b; block_header_t *start; @@ -996,7 +998,7 @@ ROMlib_relalloc (Size size, block_header_t ** newblk) ZONE_ALLOC_PTR_X (current_zone) = CLC_NULL; ROMlib_hook (memory_gznumber); HOOKSAVEREGS (); - retval = CToPascalCall (ZONE_GZ_PROC (current_zone), CTOP_BitNot, size); + retval = CToPascalCall ((void*)ZONE_GZ_PROC (current_zone), CTOP_BitNot, size); HOOKRESTOREREGS (); if (retval) diff --git a/src/notify.c b/src/notify.cpp similarity index 98% rename from src/notify.c rename to src/notify.cpp index 17c773f5..6d7f84d1 100644 --- a/src/notify.c +++ b/src/notify.cpp @@ -13,6 +13,8 @@ char ROMlib_rcsid_notify[] = #include "rsys/smash.h" #include "rsys/hook.h" +using namespace Executor; + /* Forward declarations in NotifyMgr.h (DO NOT DELETE THIS LINE) */ typedef pascal void nmfunc( NMRecPtr nmptr ); diff --git a/src/option.c b/src/option.mm similarity index 77% rename from src/option.c rename to src/option.mm index 1e8c54ec..644dc85c 100644 --- a/src/option.c +++ b/src/option.mm @@ -18,20 +18,10 @@ char ROMlib_rcsid_option[] = #include "rsys/parsenum.h" #include "rsys/notmac.h" -#ifdef NEXTSTEP +#import +#import -#ifndef OPENSTEP - -#include - -#else /* OPENSTEP */ - -#include -#include - -#endif /* OPENSTEP */ - -#endif /* NEXTSTEP */ +using namespace Executor; struct opt_block { @@ -53,18 +43,33 @@ static int help_buf_len, help_buf_len_max; static char *help_buf; void -opt_init (void) +Executor::opt_init (void) { } void -opt_shutdown (void) +Executor::opt_shutdown (void) { - free (wrap_buf); - free (help_buf); - free (pre_notes); - free (opt_blocks); + if (wrap_buf) { + free (wrap_buf); + wrap_buf = nullptr; + } + + if (help_buf) { + free (help_buf); + help_buf = nullptr; + } + + if (pre_notes) { + free (pre_notes); + pre_notes = nullptr; + } + + if (opt_blocks) { + free (opt_blocks); + opt_blocks = nullptr; + } } void @@ -77,7 +82,7 @@ strcpy_to_wrap_buf (char *text) if (wrap_buf_size < text_len) { - wrap_buf = realloc (wrap_buf, text_len * sizeof *wrap_buf); + wrap_buf = (char*)realloc (wrap_buf, text_len * sizeof *wrap_buf); wrap_buf_size = text_len; } for (dst = wrap_buf, src = text; *src;) @@ -121,7 +126,7 @@ wrap (char *buf, } void -_safe_strncat (char *dst, char *src, int len) +_safe_strncat (char *dst, const char *src, int len) { char *t; int dst_len; @@ -135,11 +140,11 @@ _safe_strncat (char *dst, char *src, int len) } void -send_to_help_buf (char *text, int len, int append_newline_p) +send_to_help_buf (const char *text, int len, int append_newline_p) { if (help_buf == NULL) { - help_buf = malloc (2 * len); + help_buf = (char*)malloc (2 * len); help_buf_len_max = 2 * len; *help_buf = '\0'; @@ -148,7 +153,7 @@ send_to_help_buf (char *text, int len, int append_newline_p) else if (help_buf_len + len > help_buf_len_max) { help_buf_len_max *= 2; - help_buf = realloc (help_buf, help_buf_len_max * sizeof *help_buf); + help_buf = (char*)realloc (help_buf, help_buf_len_max * sizeof *help_buf); } _safe_strncat (help_buf, text, len); @@ -195,7 +200,7 @@ _generate_help_message (void) for (opt_i = 0; opt_i < n_opts; opt_i ++) { - char *spaces = " "; + const char *spaces = " "; int next_len, out_len; option_t *opt = &opts[opt_i]; @@ -232,7 +237,7 @@ _generate_help_message (void) } char * -opt_help_message (void) +Executor::opt_help_message (void) { if (help_buf == NULL) _generate_help_message (); @@ -240,18 +245,18 @@ opt_help_message (void) } void -opt_register_pre_note (char *note) +Executor::opt_register_pre_note (char *note) { if (!pre_notes) { n_pre_notes = 0; max_pre_notes = 4; - pre_notes = malloc (max_pre_notes * sizeof *pre_notes); + pre_notes = (char**)malloc (max_pre_notes * sizeof *pre_notes); } if (n_pre_notes == max_pre_notes) { max_pre_notes *= 2; - pre_notes = realloc (pre_notes, max_pre_notes * sizeof *pre_notes); + pre_notes = (char**)realloc (pre_notes, max_pre_notes * sizeof *pre_notes); } pre_notes[n_pre_notes ++] = note; } @@ -265,7 +270,7 @@ opt_register_pre_note (char *note) void -opt_register (char *new_interface, +Executor::opt_register (char *new_interface, option_t *new_opts, int n_new_opts) { int block_i; @@ -309,12 +314,12 @@ opt_register (char *new_interface, { n_opt_blocks = 0; n_opt_blocks_max = 4; - opt_blocks = malloc (n_opt_blocks_max * sizeof *opt_blocks); + opt_blocks = (struct opt_block*)malloc (n_opt_blocks_max * sizeof *opt_blocks); } else if (n_opt_blocks == n_opt_blocks_max) { n_opt_blocks_max *= 2; - opt_blocks = realloc (opt_blocks, n_opt_blocks_max * sizeof *opt_blocks); + opt_blocks = (struct opt_block*)realloc (opt_blocks, n_opt_blocks_max * sizeof *opt_blocks); } block = &opt_blocks[n_opt_blocks ++]; @@ -325,11 +330,9 @@ opt_register (char *new_interface, } opt_database_t * -opt_alloc_db (void) +Executor::opt_alloc_db (void) { - opt_database_t *retval; - - retval = malloc (sizeof *retval); + opt_database_t *retval = (opt_database_t*)malloc(sizeof *retval); retval->opt_vals = NULL; retval->n_opt_vals = 0; @@ -366,71 +369,37 @@ opt_lookup (opt_database_t *db, char *opt) retval = opt_lookup_helper (db, opt); -#if defined(NEXTSTEP) if (!retval || !retval->t_val) { -#ifndef OPENSTEP - static boolean_t defaults_registered; - static NXDefaultsVector vec = { { NULL } }; - const char *try; -#else /* OPENSTEP */ NSUserDefaults *defaults; - NSString *try; -#endif /* OPENSTEP */ + NSString *try1; -#ifndef OPENSTEP - if (!defaults_registered) - { - NXRegisterDefaults (ROMlib_appname, vec); - defaults_registered = TRUE; - } -#else /* OPENSTEP */ defaults = [NSUserDefaults standardUserDefaults]; - try = [defaults stringForKey:[NSString stringWithCString:opt]]; -#endif /* OPENSTEP */ - -#ifndef OPENSTEP - /* Allow dwrites to work. */ - try = NXGetDefaultValue (ROMlib_appname, opt); -#endif /* not OPENSTEP */ - if (try) - { - if (retval) -#ifndef OPENSTEP - retval->val = strcpy (malloc (strlen (try) + 1), try); -#else /* OPENSTEP */ - { + try1 = [defaults stringForKey:@(opt)]; + + if (try1) { + if (retval) { char *str; int len; - len = [try cStringLength]; - str = malloc (len+1); - [try getCString:str maxLength:len]; + len = [try1 lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; + str = (char*)malloc (len+1); + [try1 getCString:str maxLength:len encoding:NSUTF8StringEncoding]; retval->val = str; } -#endif /* OPENSTEP */ else { -#ifndef OPENSTEP - opt_put_val (db, opt, try, pri_dwrite, FALSE); -#else /* OPENSTEP */ - opt_put_val (db, opt, [try cString], pri_dwrite, FALSE); -#endif /* OPENSTEP */ + opt_put_val (db, opt, [try1 UTF8String], pri_dwrite, FALSE); retval = opt_lookup_helper (db, opt); } } } -#endif return retval; } void -#ifndef OPENSTEP -opt_put_val (opt_database_t *db, char *opt, char *val, -#else /* OPENSTEP */ -opt_put_val (opt_database_t *db, char *opt, const char *val, -#endif /* OPENSTEP */ +Executor::opt_put_val (opt_database_t *db, char *opt, const char *val, priority_t pri, int temp_val_p) { opt_val_t *opt_val; @@ -445,14 +414,14 @@ opt_put_val (opt_database_t *db, char *opt, const char *val, { /* allocate some new ones */ db->max_opt_vals *= 2; - db->opt_vals = realloc (db->opt_vals, + db->opt_vals = (opt_val_t*)realloc (db->opt_vals, (sizeof *(db->opt_vals) * db->max_opt_vals)); } } else { - db->opt_vals = malloc (sizeof *(db->opt_vals) * db->max_opt_vals); + db->opt_vals = (opt_val_t*)malloc (sizeof *(db->opt_vals) * db->max_opt_vals); } opt_val = &db->opt_vals[db->n_opt_vals ++]; @@ -463,7 +432,7 @@ opt_put_val (opt_database_t *db, char *opt, const char *val, if (temp_val_p) { - opt_val->t_val = val; + opt_val->t_val = (char*)val; opt_val->t_pri = pri; } else @@ -474,13 +443,13 @@ opt_put_val (opt_database_t *db, char *opt, const char *val, } void -opt_put_int_val (opt_database_t *db, char *opt, int valint, +Executor::opt_put_int_val (opt_database_t *db, char *opt, int valint, priority_t pri, int temp_val_p) { char *val, buf[256]; sprintf (buf, "%d", valint); - val = malloc (strlen (buf) + 1); + val = (char*)malloc (strlen (buf) + 1); strcpy (val, buf); opt_put_val (db, opt, val, pri, temp_val_p); @@ -489,18 +458,10 @@ opt_put_int_val (opt_database_t *db, char *opt, int valint, #define option_value(opt_val) ((opt_val)->t_val ?: (opt_val)->val) int -#ifndef OPENSTEP -opt_val (opt_database_t *db, char *opt, char **retval) -#else /* OPENSTEP */ -opt_val (opt_database_t *db, char *opt, const char **retval) -#endif /* OPENSTEP */ +Executor::opt_val (opt_database_t *db, char *opt, const char **retval) { opt_val_t *opt_val; -#ifndef OPENSTEP - char *val = NULL; -#else /* OPENSTEP */ const char *val = NULL; -#endif /* OPENSTEP */ boolean_t found_p = FALSE; opt_val = opt_lookup (db, opt); @@ -524,15 +485,11 @@ opt_val (opt_database_t *db, char *opt, const char **retval) * Returns TRUE if a value was found. */ int -opt_int_val (opt_database_t *db, char *opt, int *retval, +Executor::opt_int_val (opt_database_t *db, char *opt, int *retval, boolean_t *parse_error_p) { opt_val_t *opt_val; -#ifndef OPENSTEP - char *val = NULL; -#else /* OPENSTEP */ const char *val = NULL; -#endif /* OPENSTEP */ opt_val = opt_lookup (db, opt); if (opt_val && (val = option_value (opt_val)) && retval) @@ -556,7 +513,7 @@ opt_int_val (opt_database_t *db, char *opt, int *retval, } int -opt_parse (opt_database_t *db, option_t *opts, int n_opts, +Executor::opt_parse (opt_database_t *db, option_t *opts, int n_opts, int *argc, char *argv[]) { int parse_error_p = FALSE; @@ -588,7 +545,7 @@ opt_parse (opt_database_t *db, option_t *opts, int n_opts, if (!strcmp (&arg[1], opt->text)) { - char *optval = NULL; + const char *optval = NULL; /* found the option */ switch (opt->kind) diff --git a/src/osevent.c b/src/osevent.cpp similarity index 91% rename from src/osevent.c rename to src/osevent.cpp index 0fff8e67..e8e9747e 100644 --- a/src/osevent.c +++ b/src/osevent.cpp @@ -47,16 +47,12 @@ char ROMlib_rcsid_osevent[] = #include "rsys/string.h" #include "rsys/keyboard.h" -#if defined (NEXTSTEP) #include "contextswitch.h" -#endif #include "DialogMgr.h" #include "SegmentLdr.h" -#if defined (MSDOS) -#include "dosevents.h" -#endif +using namespace Executor; #define NEVENT 20 @@ -65,11 +61,11 @@ PRIVATE EvQEl evs[NEVENT], *freeelem = evs+NEVENT-1; #define ROMlib_curs MouseLocation -PUBLIC INTEGER ROMlib_mods = btnState; +PUBLIC INTEGER Executor::ROMlib_mods = btnState; PRIVATE LONGINT autoticks; PRIVATE LONGINT lastdown = -1; -#if !defined(NEXTSTEP) +#if !defined(MACOSX_) PUBLIC short ROMlib_pinned = FALSE; #else PUBLIC short ROMlib_pinned = TRUE; @@ -78,7 +74,7 @@ PUBLIC short ROMlib_pinned = TRUE; PRIVATE Ptr kchr_ptr; PUBLIC void -invalidate_kchr_ptr (void) +Executor::invalidate_kchr_ptr (void) { kchr_ptr = 0; } @@ -86,7 +82,7 @@ invalidate_kchr_ptr (void) PRIVATE INTEGER kchr_id = 0; PUBLIC Ptr -ROMlib_kchr_ptr (void) +Executor::ROMlib_kchr_ptr (void) { if (!kchr_ptr) { @@ -106,7 +102,7 @@ ROMlib_kchr_ptr (void) } PUBLIC boolean_t -ROMlib_set_keyboard (const char *keyboardname) +Executor::ROMlib_set_keyboard (const char *keyboardname) { Handle new_h; @@ -139,7 +135,7 @@ ROMlib_set_keyboard (const char *keyboardname) PRIVATE boolean_t map_right_to_left = TRUE; PUBLIC uint16 -ROMlib_right_to_left_key_map (uint16 what) +Executor::ROMlib_right_to_left_key_map (uint16 what) { uint16 retval; @@ -171,7 +167,7 @@ ROMlib_right_to_left_key_map (uint16 what) */ PUBLIC LONGINT -ROMlib_xlate (INTEGER virt, INTEGER modifiers, boolean_t down_p) +Executor::ROMlib_xlate (INTEGER virt, INTEGER modifiers, boolean_t down_p) { static uint16 down_value[VIRT_MASK + 1]; LONGINT retval; @@ -191,6 +187,8 @@ ROMlib_xlate (INTEGER virt, INTEGER modifiers, boolean_t down_p) return retval; } +extern char ROMlib_started; + A1(PUBLIC, void, ROMlib_eventinit, boolean_t, graphics_valid_p) /* INTERNAL */ { static int beenhere = 0; @@ -208,9 +206,7 @@ A1(PUBLIC, void, ROMlib_eventinit, boolean_t, graphics_valid_p) /* INTERNAL */ for (p = evs+1, ep = evs+NEVENT; p != ep; p++) p->qLink = RM((QElemPtr) (p-1)); SysEvtMask = CWC(~(1L<< keyUp)); /* EVERYTHING except keyUp */ -#if defined (NEXT) ROMlib_started = 3; -#endif if (graphics_valid_p) { Rect *main_gd_bounds; @@ -235,6 +231,14 @@ A1(PUBLIC, void, ROMlib_eventinit, boolean_t, graphics_valid_p) /* INTERNAL */ } } +namespace Executor { + PRIVATE void dropevent(EvQEl*); + PRIVATE OSErrRET _PPostEvent(INTEGER evcode, + LONGINT evmsg, HIDDEN_EvQElPtr *qelpp); + PRIVATE BOOLEAN OSEventCommon(INTEGER evmask, EventRecord *eventp, + BOOLEAN dropit); +} + A1(PRIVATE, void, dropevent, EvQEl *, qp) { Dequeue((QElemPtr) qp, &EventQueue); @@ -244,7 +248,7 @@ A1(PRIVATE, void, dropevent, EvQEl *, qp) } EvQEl * -geteventelem (void) +Executor::geteventelem (void) { EvQEl *retval = freeelem; @@ -258,7 +262,7 @@ geteventelem (void) } PUBLIC boolean_t -ROMlib_get_index_and_bit (LONGINT loc, int *indexp, uint8 *bitp) +Executor::ROMlib_get_index_and_bit (LONGINT loc, int *indexp, uint8 *bitp) { boolean_t retval; @@ -423,9 +427,9 @@ A2(PUBLIC trap, void, FlushEvents, INTEGER, evmask, /* NOTE: According to IMII-69 we should be leaving stuff in d0 */ } -PUBLIC BOOLEAN ROMlib_bewaremovement; +PUBLIC BOOLEAN Executor::ROMlib_bewaremovement; -PUBLIC int ROMlib_refresh = 0; +PUBLIC int Executor::ROMlib_refresh = 0; A3(PRIVATE, BOOLEAN, OSEventCommon, INTEGER, evmask, EventRecord *, eventp, @@ -450,10 +454,10 @@ A3(PRIVATE, BOOLEAN, OSEventCommon, INTEGER, evmask, EventRecord *, eventp, GetCurrentProcess (&psn); { - AppleEvent *aevt = alloca (sizeof *aevt); - AEAddressDesc *target = alloca (sizeof *target); + AppleEvent *aevt = (AppleEvent *)alloca (sizeof *aevt); + AEAddressDesc *target = (AEAddressDesc *)alloca (sizeof *target); - AEDescList *list = alloca (sizeof *list); + AEDescList *list = (AEDescList *)alloca (sizeof *list); int16 count, dummy; err = AECreateDesc (typeProcessSerialNumber, @@ -515,9 +519,9 @@ A3(PRIVATE, BOOLEAN, OSEventCommon, INTEGER, evmask, EventRecord *, eventp, } eventp->message = CLC(0); -#if defined (NEXTSTEP) +#if defined (MACOSX_) contextswitch(&romlib_sp, &nextstep_sp); -#endif /* NEXTSTEP */ +#endif /* MACOSX_ */ ROMlib_memnomove_p = FALSE; /* this is an icky hack needed for Excel */ ticks = TickCount(); @@ -557,7 +561,7 @@ A3(PRIVATE, BOOLEAN, OSEventCommon, INTEGER, evmask, EventRecord *, eventp, eventp->when = CL(TickCount()); { -#if defined(X) || defined(NEXTSTEP) +#if defined(X) || defined(MACOSX_) if (!ROMlib_pinned) { LONGINT x, y; LONGINT newmods; @@ -599,7 +603,7 @@ A3(PRIVATE, BOOLEAN, OSEventCommon, INTEGER, evmask, EventRecord *, eventp, ROMlib_bewaremovement = FALSE; } } -#if defined(NEXTSTEP) +#if defined(MACOSX_) if (ROMlib_printtimeout < 0) { /* see MacViewClass.m */ dirty_rect_update_screen (); ROMlib_printtimeout = 1; @@ -637,7 +641,7 @@ A0(PUBLIC, QHdrPtr, GetEvQHdr) } PUBLIC void -post_keytrans_key_events (INTEGER evcode, LONGINT keywhat, int32 when, +Executor::post_keytrans_key_events (INTEGER evcode, LONGINT keywhat, int32 when, Point where, uint16 button_state, unsigned char virt) { INTEGER first_key, second_key; @@ -663,12 +667,12 @@ compare (const void *p1, const void *p2) { int retval; - retval = ROMlib_strcmp (p1, p2); + retval = ROMlib_strcmp ((const Byte*)p1, (const Byte*)p2); return retval; } PUBLIC void -display_keyboard_choices (void) +Executor::display_keyboard_choices (void) { INTEGER nres, i, nfound; unsigned char (*names)[256]; @@ -677,7 +681,7 @@ display_keyboard_choices (void) printf ("Available keyboard maps:\n"); SetResLoad (FALSE); nres = CountResources (TICK ("KCHR")); - names = alloca (nres * sizeof (*names)); + names = (typeof names)alloca (nres * sizeof (*names)); nfound = 0; for (i = 1; i <= nres; ++i) { @@ -699,7 +703,7 @@ display_keyboard_choices (void) } PUBLIC void -maybe_wait_for_keyup (void) +Executor::maybe_wait_for_keyup (void) { #if defined (SDL) && defined (CYGWIN32) /* Run SDL's event processor so that any pending events get diff --git a/src/ostrap.awk b/src/ostrap.awk deleted file mode 100644 index 9bbafbca..00000000 --- a/src/ostrap.awk +++ /dev/null @@ -1 +0,0 @@ -substr($1, 4, 1) ~ /[0-7]/ && NF >= 2 { print "0x00" substr($1, 5, 2), $2 } diff --git a/src/osutil.c.NEW b/src/osutil.c.NEW deleted file mode 100644 index 4ad47ab4..00000000 --- a/src/osutil.c.NEW +++ /dev/null @@ -1,981 +0,0 @@ -/* Copyright 1986, 1989, 1990 by Abacus Research and - * Development, Inc. All rights reserved. - */ - -#if !defined (OMIT_RCSID_STRINGS) -char ROMlib_rcsid_osutil[] = - "$Id: osutil.c,v 2.41 2001/08/09 00:01:32 ctm Exp ctm $"; -#endif - -/* Forward declarations in OSUtil.h (DO NOT DELETE THIS LINE) */ - -#include "rsys/common.h" -#include "QuickDraw.h" -#include "FileMgr.h" -#include "EventMgr.h" -#include "OSUtil.h" -#include "MemoryMgr.h" -#include "Serial.h" -#include "FontMgr.h" -#include "TimeMgr.h" -#include "MenuMgr.h" -#include "ToolboxEvent.h" - -#include "rsys/glue.h" -#include "rsys/notmac.h" -#include "rsys/mman.h" -#include "rsys/blockinterrupts.h" -#include "rsys/trapglue.h" -#include "rsys/pstuff.h" -#include "rsys/osutil.h" -#include "rsys/host.h" -#include "rsys/time.h" -#include "rsys/toolevent.h" - -#if defined(NEXT) && !defined (OPENSTEP) -#include -#endif - -#if defined(MSDOS) -#include -#endif - -#include "SDL.h" -#include "SDL_thread.h" - -/* - * NOTE: HandToHand is not directly called by the outside world. - * Hence, the handle that hp points to is not swapped. - */ - -A1(PUBLIC trap, OSErrRET, HandToHand, HIDDEN_Handle *, hp) -{ - Handle nh; - Size s; - OSErr err; - - if (!hp->p) - { - warning_unexpected ("hp = %p", hp); -/*-->*/ return nilHandleErr; - } - - s = GetHandleSize((*hp).p); - if ((err = MemError())) -/*-->*/ return(err); - - nh = NewHandle(s); - if ((err = MemError())) -/*-->*/ return(err); - - BlockMove(STARH((*hp).p), STARH(nh), s); - (*hp).p = nh; - return noErr; -} - -/* - * NOTE: PtrToHand is not directly callable, hence the handle that - * h points to isn't swapped. - */ - -A3(PUBLIC trap, OSErrRET, PtrToHand, Ptr, p, HIDDEN_Handle *, h, LONGINT, s) -{ - Handle nh; - OSErr err; - - nh = NewHandle(s); - if ((err = MemError())) - return(err); - BlockMove(p, STARH(nh), s); - if ((err = MemError())) - return(err); - (*h).p = nh; - return(noErr); -} - -A3(PUBLIC trap, OSErrRET, PtrToXHand, Ptr, p, Handle, h, LONGINT, s) -{ - OSErr err; - -/* - * DO *NOT* use ReallocHandle here. It will fail if the handle is locked. - */ - SetHandleSize(h, s); - if ((err = MemError())) - return(err); - BlockMove(p, STARH(h), s); - if ((err = MemError())) - return(err); - return(noErr); -} - -A2(PUBLIC trap, OSErrRET, HandAndHand, Handle, h1, Handle, h2) -{ - Size s1 = GetHandleSize(h1), s2 = GetHandleSize(h2); - OSErr err; - - SetHandleSize(h2, s1+s2); - if ((err = MemError())) - return(err); - BlockMove(STARH(h1), STARH(h2)+s2, s1); - if ((err = MemError())) - return(err); - return(noErr); -} - -A3(PUBLIC trap, OSErrRET, PtrAndHand, Ptr, p, Handle, h, LONGINT, s1) -{ - Size s2 = GetHandleSize(h); - OSErr err; - - SetHandleSize(h, s1+s2); - if ((err = MemError())) - return(err); - BlockMove(p, STARH(h)+s2, s1); - if ((err = MemError())) - return(err); - return(noErr); -} - -/* NOTE: This set of tables was created by running a test program on - the Mac. It replaces the tables that were hand created from - (incomplete) information in Inside Macintosh */ - -PRIVATE unsigned char casefold[256] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20, '!', '"', '#', '$', '%', '&','\'', '(', ')', '*', '+', ',', '-', '.', '/', - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', - '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[','\\', ']', '^', '_', - 'a', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~',0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0xCB,0x89,0x80,0xCC,0x81,0x82,0x83,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x84,0x97,0x98,0x99,0x85,0xCD,0x9C,0x9D,0x9E,0x86, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xAE,0xAF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCE, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, -}; - -PRIVATE unsigned char diacfold[256] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20, '!', '"', '#', '$', '%', '&','\'', '(', ')', '*', '+', ',', '-', '.', '/', - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', - '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[','\\', ']', '^', '_', - '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', - 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~',0x7F, - 'A', 'A', 'C', 'E', 'N', 'O', 'U', 'a', 'a', 'a', 'a', 'a', 'a', 'c', 'e', 'e', - 'e', 'e', 'i', 'i', 'i', 'i', 'n', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 'u', 'u', -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE, 'O', -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA, 'a', 'o',0xBD,0xBE, 'o', -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0x20, 'A', 'A', 'O',0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7, 'y',0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, -}; - -PRIVATE unsigned char bothfold[256] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20, '!', '"', '#', '$', '%', '&','\'', '(', ')', '*', '+', ',', '-', '.', '/', - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', - '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[','\\', ']', '^', '_', - 'a', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~',0x7F, - 'A', 'A', 'C', 'E', 'N', 'O', 'U', 'A', 'A', 'A', 'A', 'A', 'A', 'C', 'E', 'E', - 'E', 'E', 'I', 'I', 'I', 'I', 'N', 'O', 'O', 'O', 'O', 'O', 'U', 'U', 'U', 'U', -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE, 'O', -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA, 'A', 'O',0xBD,0xAE, 'O', -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA, 'A', 'A', 'O',0xCE,0xCE, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7, 'Y',0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, -}; - -PRIVATE unsigned char order[256] = { -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x21,0x22,0x23,0x28,0x29,0x2A,0x2B,0x2C,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,0x36, -0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,0x40,0x41,0x42,0x43,0x44,0x45,0x46, -0x47,0x48,0x57,0x59,0x5D,0x5F,0x66,0x68,0x6A,0x6C,0x72,0x74,0x76,0x78,0x7A,0x7E, -0x8C,0x8E,0x90,0x92,0x95,0x97,0x9E,0xA0,0xA2,0xA4,0xA7,0xA9,0xAA,0xAB,0xAC,0xAD, -0xAE,0x4E,0x58,0x5B,0x5E,0x61,0x67,0x69,0x6B,0x6D,0x73,0x75,0x77,0x79,0x7C,0x83, -0x8D,0x8F,0x91,0x93,0x96,0x99,0x9F,0xA1,0xA3,0xA5,0xA8,0xAF,0xB0,0xB1,0xB2,0xB3, -0x4A,0x4C,0x5A,0x60,0x7B,0x7F,0x98,0x4F,0x50,0x51,0x52,0x53,0x54,0x5C,0x62,0x63, -0x64,0x65,0x6E,0x6F,0x70,0x71,0x7D,0x84,0x85,0x86,0x87,0x88,0x9A,0x9B,0x9C,0x9D, -0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0x94,0xBB,0xBC,0xBD,0xBE,0xBF,0xC0,0x4D,0x81, -0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0x55,0x8A,0xCC,0x56,0x89, -0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0x26,0x27,0xD4,0x20,0x49,0x4B,0x80,0x82,0x8B, -0xD5,0xD6,0x24,0x25,0x2D,0x2E,0xD7,0xD8,0xA6,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF, -}; - - -A5(PUBLIC, LONGINT, ROMlib_RelString, unsigned char *, s1, unsigned char *, s2, - BOOLEAN, casesig, BOOLEAN, diacsig, LONGINT, d0) -{ - register INTEGER n1, n2; - register unsigned char *s, *t; - unsigned char c1, c2; - - s = s1; - t = s2; - n1 = d0 >> 16; - n2 = d0 & 0xFFFF; - if (n1 > n2) - n1 = n2; - if (casesig && diacsig) { - while (n1--) { - c1 = *s++; - c2 = *t++; - if ((c1 == 0x20 && c2 == 0xCA) || - (c2 == 0x20 && c1 == 0xCA)) -/*-->*/ continue; - if (c1 != c2) -/*-->*/ return order[c1] < order[c2] ? -1 : 1; - } - } else if ( casesig && !diacsig) { - while (n1--) { - c1 = *s++; - c2 = *t++; - if ((c1 == 0x20 && c2 == 0xCA) || - (c2 == 0x20 && c1 == 0xCA)) -/*-->*/ continue; - if (diacfold[c1] != diacfold[c2]) -/*-->*/ return order[diacfold[c1]] < order[diacfold[c2]] ? -1 : 1; - } - } else if (!casesig && diacsig) { - while (n1--) { - c1 = *s++; - c2 = *t++; - if ((c1 == 0x20 && c2 == 0xCA) || - (c2 == 0x20 && c1 == 0xCA)) -/*-->*/ continue; - if (casefold[c1] != casefold[c2]) -/*-->*/ return order[casefold[c1]] < order[casefold[c2]] ? -1 : 1; - } - } else { /*!casesig && !diacsig*/ - while (n1--) { - c1 = *s++; - c2 = *t++; - if ((c1 == 0x20 && c2 == 0xCA) || - (c2 == 0x20 && c1 == 0xCA)) -/*-->*/ continue; - if (bothfold[c1] != bothfold[c2]) -/*-->*/ return order[bothfold[c1]] < order[bothfold[c2]] ? -1 : 1; - } - } - n1 = d0 >> 16; - if (n1 != n2) -/*-->*/ return n1 < n2 ? -1 : 1; - return 0; -} - -A4(PUBLIC trap, INTEGERRET, RelString, StringPtr, s1, StringPtr, s2, - BOOLEAN, casesig, BOOLEAN, diacsig) -{ - return ROMlib_RelString((unsigned char *) s1 + 1, (unsigned char *) s2 + 1, - casesig, diacsig, - (LONGINT) (unsigned char) s1[0] << 16 | (unsigned char) s2[0]); -} - -A4(PUBLIC trap, BOOLEANRET, EqualString, StringPtr, s1, StringPtr, s2, - BOOLEAN, casesig, BOOLEAN, diacsig) -{ - return RelString(s1, s2, casesig, diacsig) ? FALSE : TRUE; -} - -A2(PUBLIC, int, ROMlib_strcmp, const Byte *, s1, const Byte *, s2) /* INTERNAL */ -{ - register int n1 = U(s1[0]), n2 = U(s2[0]); - register unsigned char *p1 = (char *) s1+1, *p2 = (char *) s2+1, c1, c2; - -#if !defined (LETGCCWAIL) - c1 = 0; - c2 = 0; -#endif /* LETGCCWAIL */ - - while (n1 && n2 && ((c1 = bothfold[U(*p1)]) == (c2 = bothfold[U(*p2)]))) { - n1--; - n2--; - p1++; - p2++; - } - if (!n1) - return n2 ? -1 : 0; - if (!n2) - return 1; - else - return c1 < c2 ? -1 : 1; -} - -A3(PUBLIC, void, ROMlib_UprString, StringPtr, s, BOOLEAN, diac, INTEGER, len) -{ - unsigned char *p, *ep, *base; - - if (diac) - base = casefold; - else - base = bothfold; - - for (p = s, ep = p + len; p != ep; p++) - *p = base[U(*p)]; -} - -A2(PUBLIC trap, void, UprString, StringPtr, s, BOOLEAN, diac) -{ - ROMlib_UprString(s+1, diac, (INTEGER) (unsigned char) s[0]); -} - -A1(PUBLIC, void, GetDateTime, LONGINT *, mactimepointer) -{ -#undef Time /* Why is this here? */ - if (mactimepointer) { - unsigned long msecs; - msecs = msecs_elapsed (); - *mactimepointer = CL (UNIXTIMETOMACTIME (ROMlib_start_time.tv_sec) - + (((ROMlib_start_time.tv_usec / 1000) + msecs) - / 1000)); - } -} - -A1(PUBLIC trap, OSErrRET, ReadDateTime, LONGINT *, secs) -{ - GetDateTime(secs); - return(noErr); -} - -A1(PUBLIC trap, OSErrRET, SetDateTime, LONGINT, mactime) -{ -#if !defined(SYSV) && !defined (CYGWIN32) - struct timeval thetime; - - thetime.tv_sec = MACTIMETOGUNIXTIME(mactime); - thetime.tv_usec = 0; - - if (settimeofday(&thetime, 0) < 0) - return(clkWrErr); - else - return(noErr); -#else /* defined(SYSV) */ -#warning "SetDateTime not implemented" - return clkWrErr; -#endif /* defined(SYSV) */ -} - -PRIVATE unsigned long long -secsinminutes (ULONGINT nminutes) -{ - return nminutes * 60; -} - -PRIVATE unsigned long long -secsinhours (ULONGINT nhours) -{ - return nhours * secsinminutes((LONGINT) 60); -} - -PRIVATE unsigned long long -secsindays (ULONGINT ndays) -{ - return ndays * secsinhours((LONGINT) 24); -} - -PRIVATE INTEGER daysinmonths[13] = { - 0, - 31, - 31 + 28, - 31 + 28 + 31, - 31 + 28 + 31 + 30, - 31 + 28 + 31 + 30 + 31, - 31 + 28 + 31 + 30 + 31 + 30, - 31 + 28 + 31 + 30 + 31 + 30 + 31, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31, -}; - -PRIVATE INTEGER daysinleapmonths[13] = { - 0, - 31, - 31 + 29, - 31 + 29 + 31, - 31 + 29 + 31 + 30, - 31 + 29 + 31 + 30 + 31, - 31 + 29 + 31 + 30 + 31 + 30, - 31 + 29 + 31 + 30 + 31 + 30 + 31, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31, -}; - -PRIVATE unsigned long long -secsinmonths (ULONGINT nmonths) -{ - return secsindays((ULONGINT) daysinmonths[nmonths]); -} - -PRIVATE unsigned long long -secsinleapmonths (ULONGINT nmonths) -{ - return secsindays((ULONGINT) daysinleapmonths[nmonths]); -} - -PRIVATE unsigned long long -daysinyears (ULONGINT year) -{ - return (ULONGINT) 365 * year + year / 4 - year / 100 + year / 400; -} - -A1(PRIVATE, BOOLEAN, isleap, ULONGINT, year) -{ - return !(year % 4) && (year % 100 || !(year % 400)); -} - - -/* month January = 1, hour Midnight = 0 */ - -PUBLIC long long -ROMlib_long_long_secs (INTEGER year, INTEGER month, INTEGER day, INTEGER hour, - INTEGER minute, INTEGER second) -{ -/* #warning Make this work for years < 1904 ... it's probably wrong */ - long long retval; - - if (year < 1904) - warning_unexpected ("year = %d", year); - retval = secsindays(daysinyears(year-1) - daysinyears(1903)); - retval += secsinmonths(month-1); - retval += secsindays(day-1); - retval += secsinhours(hour); - retval += secsinminutes(minute); - retval += second; - if (isleap(year) && month > 2) - retval += secsindays((ULONGINT) 1); - return retval; -} - -/* - * NOTE: not callable from the outside world directly - */ - -A2(PUBLIC trap, void, Date2Secs, DateTimeRec *, d, LONGINT *, s) -{ - LONGINT l; - - l = ROMlib_long_long_secs (CW (d->year), CW (d->month), CW (d->day), - CW (d->hour), CW (d->minute), CW (d->second)); - *s = l; -} - -/* #warning should fix to work with dates less than 1904 */ - -PUBLIC void -date_to_swapped_fields (long long mactime, INTEGER *yearp, INTEGER *monthp, - INTEGER *dayp, INTEGER *hourp, INTEGER *minutep, - INTEGER *secondp, INTEGER *dayofweekp, - INTEGER *dayofyearp, INTEGER *weekofyearp) -{ -#define NSECSINMINUTE (60L) -#define NSECSINHOUR (60L * NSECSINMINUTE) -#define NSECSINDAY (24L * NSECSINHOUR) -#define NSECSINYEAR (365L * NSECSINDAY) -#define NSECSINLEAPYEAR (366L * NSECSINDAY) - -/* - * NOTE: the function below relies on the start date being 1/1/1904. It is - * clear that Apple picked that date so there would be no funky non- - * leap years (1900 was one). - */ - long long secs_left; - ULONGINT approx_year, days, secs_approx_year; - INTEGER month, day, hour, minute; - - if (mactime < 0) - warning_unexpected (NULL_STRING); - - if (dayofweekp) - *dayofweekp = CW((mactime / NSECSINDAY + 5) % 7 + 1); - - approx_year = mactime / NSECSINLEAPYEAR; - days = 365 * approx_year + (approx_year+3)/4; - secs_left = mactime - (days * NSECSINDAY); - secs_approx_year = isleap(approx_year) ? NSECSINLEAPYEAR : NSECSINYEAR; - if (secs_left < secs_approx_year) - *yearp = CW(approx_year + 1904); - else { - approx_year++; - secs_left -= secs_approx_year; - *yearp = CW(approx_year + 1904); - } - - if (secs_left < 0) - { - warning_unimplemented ("This code is flat out wrong"); - secs_left %= NSECSINLEAPYEAR; - if (secs_left < 0) - secs_left += NSECSINLEAPYEAR; - warning_unexpected ("bad date"); - } - - if (dayofyearp) - *dayofyearp = CW (secs_left / NSECSINDAY + 1); - - if (weekofyearp) - *weekofyearp = CW (secs_left / NSECSINDAY / 7 + 1); - - if (isleap(approx_year)) { - for (month = 0; - secsinleapmonths(month+1) <= (unsigned long long) secs_left; - month++) - ; - secs_left -= secsinleapmonths(month); - } else { - for (month = 0; - secsinmonths(month+1) <= (unsigned long long) secs_left; - month++) - ; - secs_left -= secsinmonths(month); - } - *monthp = CW(month+1); - - day = secs_left / NSECSINDAY; - *dayp = CW(day + 1); - secs_left -= day * NSECSINDAY; - - hour = secs_left / NSECSINHOUR; - *hourp = CW(hour); - secs_left -= hour * NSECSINHOUR; - - minute = secs_left / NSECSINMINUTE; - *minutep = CW(minute); - secs_left -= minute * NSECSINMINUTE; - - *secondp = CW(secs_left); -} - -A2(PUBLIC trap, void, Secs2Date, LONGINT, mactime, DateTimeRec *, d) -{ - date_to_swapped_fields ((unsigned long) mactime, &d->year, &d->month, - &d->day, &d->hour, &d->minute, &d->second, - &d->dayOfWeek, 0, 0); -} - -A1(PUBLIC, void, GetTime, DateTimeRec *, d) -{ - LONGINT secs; - - GetDateTime(&secs); - Secs2Date(CL(secs), d); -} - -A1(PUBLIC, void, SetTime, DateTimeRec *, d) -{ - LONGINT secs; - - Date2Secs(d, &secs); - SetDateTime(secs); -} - -typedef enum {Read, Write} ReadWriteType; - -#define VALID 0xA8 - -A0(PRIVATE, void, setdefaults) -{ - SPValid = VALID; - SPAlarm = SPATalkB = SPATalkA = SPConfig = 0; - SPPrint = SPPortB = SPPortA = CW(baud9600 | stop10 | data8 | noParity); - SPFont = CW(geneva - 1); - SPKbd = 0x63; - SPVolCtl = 3; - SPClikCaret = 0x88; - SPMisc2 = 0x4C; -} - -A1(PRIVATE, OSErr, openparam, INTEGER *, rnp) -{ - static char paramname[] = PARAMRAMMACNAME; - OSErr err; - - err = FSOpen((StringPtr) paramname, Cx(BootDrive), rnp); - if (err == fnfErr) { - if ((err = Create((StringPtr) paramname, Cx(BootDrive), TICK("unix"), - TICK("pram"))) == noErr) - err = FSOpen((StringPtr) paramname, Cx(BootDrive), rnp); - } - return err; -} - -PUBLIC LONGINT ROMlib_GMTcorrect; - -A0(PRIVATE, void, deriveglobals) -{ - struct tm *tm, tml, tmg, *tmlater, *tmearlier; - time_t unixtimenow, gmtimenow, ltimenow; - - unixtimenow = (ROMlib_start_time.tv_sec - + ((ROMlib_start_time.tv_usec / 1000 + msecs_elapsed ()) - / 1000)); - tm = localtime(&unixtimenow); - BlockMove((Ptr) tm, (Ptr) &tml, (Size) sizeof(tml)); - tm = gmtime(&unixtimenow); - BlockMove((Ptr) tm, (Ptr) &tmg, (Size) sizeof(tmg)); - if (tml.tm_year != tmg.tm_year) { - tmlater = tml.tm_year > tmg.tm_year ? &tml : &tmg; - tmearlier = tml.tm_year > tmg.tm_year ? &tmg : &tml; - /* Adjust the day of year */ - tmlater->tm_yday = tmearlier->tm_yday + 1; - } - ltimenow = (tml.tm_yday * 24 * 60 * 60) + /* seconds per day */ - (tml.tm_hour * 60 * 60) + /* seconds per hour */ - (tml.tm_min * 60) + tml.tm_sec; - gmtimenow = (tmg.tm_yday * 24 * 60 * 60) + - (tmg.tm_hour * 60 * 60) + - (tmg.tm_min * 60) + tmg.tm_sec; - ROMlib_GMTcorrect = gmtimenow - ltimenow; - - KeyThresh = CW((short) ((SPKbd >> 4) & 0xF) * 4); - KeyRepThresh = CW((short) (SPKbd & 0xF) * 4); - MenuFlash = CW((short) (SPMisc2 >> 2) & 3); - CaretTime = CL((short) (SPClikCaret & 0xF) * 4); - DoubleTime = CL((short) (SPClikCaret & 0xF0) / 4); -} - -A0(PUBLIC trap, OSErrRET, InitUtil) /* IMII-380 */ -{ - INTEGER rn; - SysParmType sp; - LONGINT count; - OSErr err; - BOOLEAN badread; - -#if !defined(LETGCCWAIL) - badread = FALSE; -#endif - if ((err = openparam(&rn)) == noErr) { - count = sizeof(sp); - if (FSRead(rn, &count, (Ptr) &sp) == noErr && sp.valid == VALID && - count == sizeof(sp)) { - SPValid = sp.valid; - SPATalkA = sp.aTalkA; - SPATalkB = sp.aTalkB; - SPConfig = sp.config; - SPPortA = sp.portA; - SPPortB = sp.portB; - SPAlarm = sp.alarm; - SPFont = sp.font; - SPKbd = CW(sp.kbdPrint) >> 8; - SPPrint = CW(sp.kbdPrint); - SPVolCtl = CW(sp.volClik) >> 8; - SPClikCaret = CW(sp.volClik); -#if !defined (BIGENDIAN) - SPMisc2 = sp.misc; -#else - SPMisc2 = sp.misc >> 8; -#warning this is broken -#endif - badread = FALSE; - } else - badread = TRUE; - } - if (err != noErr || badread) - setdefaults(); - deriveglobals(); - if (err) - err = prInitErr; - else - err = FSClose(rn); - return err; -} - -A0(PUBLIC, SysPPtr, GetSysPPtr) /* IMII-381 */ -{ - return (SysPPtr) &SPValid; -} - -A0(PUBLIC trap, OSErrRET, WriteParam) /* IMII-382 */ -{ - INTEGER rn; - SysParmType sp; - LONGINT count; - OSErr err, err2; - - err = prWrErr; - if (openparam(&rn) == noErr) { - sp.valid = SPValid; - sp.aTalkA = SPATalkA; - sp.aTalkB = SPATalkB; - sp.config = SPConfig; - sp.portA = SPPortA; - sp.portB = SPPortB; - sp.alarm = SPAlarm; - sp.font = SPFont; - sp.kbdPrint = CW((short) (SPKbd << 8) | (SPPrint & 0xff)); - sp.volClik = CW((short) (SPVolCtl << 8) | (SPClikCaret & 0xff)); -#if !defined (BIGENDIAN) - sp.misc = SPMisc2; -#else - sp.misc = SPMisc2 << 8; -#endif - count = sizeof(sp); - if (FSWrite(rn, &count, (Ptr) &sp) == noErr && count == sizeof(sp)) - err = noErr; - deriveglobals(); - ROMlib_beepedonce = FALSE; - err2 = FSClose(rn); - if (err == noErr) - err = err2; - } - return err; -} - -A2(PUBLIC trap, void, Enqueue, QElemPtr, e, QHdrPtr, h) -{ - HIDDEN_QElemPtr *qpp; - virtual_int_state_t block; - - block = block_virtual_ints (); - for (qpp = (HIDDEN_QElemPtr *) &h->qHead; (*qpp).p && MR((*qpp).p) != e; - qpp = (HIDDEN_QElemPtr *) MR((*qpp).p)) - ; - if (!(*qpp).p) { - e->evQElem.qLink = 0; - if (h->qTail) - MR(h->qTail)->evQElem.qLink = RM(e); - else - h->qHead = RM(e); - h->qTail = RM(e); - } - restore_virtual_ints (block); -} - -A2(PUBLIC trap, OSErrRET, Dequeue, QElemPtr, e, QHdrPtr, h) -{ - HIDDEN_QElemPtr *qpp; - OSErr retval; - virtual_int_state_t block; - - retval = qErr; - block = block_virtual_ints (); - for (qpp = (HIDDEN_QElemPtr *) &h->qHead; (*qpp).p && MR((*qpp).p) != e; - qpp = (HIDDEN_QElemPtr *) MR((*qpp).p)) - ; - if ((*qpp).p) { - (*qpp).p = e->evQElem.qLink; - if (MR(h->qTail) == e) - h->qTail = qpp == (HIDDEN_QElemPtr *) &h->qHead ? (QElemPtr) 0 : RM((QElemPtr) qpp); - retval = noErr; - } - restore_virtual_ints (block); - return retval; -} - -A2(PUBLIC, LONGINT, NGetTrapAddress, INTEGER, n, INTEGER, ttype) /* IMII-384 */ -{ - LONGINT retval; - - retval = (LONGINT) ((ttype == OSTrap) ? - (LONGINT) CL((long) ostraptable[n&(NOSENTRIES-1)]) - : - (LONGINT) CL((long) tooltraptable[n&(NTOOLENTRIES-1)])); - warning_trace_info ("n = 0x%x, ttype = %d, retval = %p", (uint16) n, ttype, - (void *) retval); - return retval; -} - -#if !defined(BINCOMPAT) - -A2(PUBLIC, void, SetTrapAddress, LONGINT, addr, /* IMII-384 NOT SUPPORTED */ - INTEGER, n) -{ -} -#endif - -PRIVATE BOOLEAN shouldbeawake; -PUBLIC SDL_cond *shouldbeawake_cond = NULL; -PUBLIC SDL_mutex *shouldbeawake_mutex = NULL; - -A0(PUBLIC, void, C_ROMlib_wakeup) -{ - shouldbeawake = TRUE; -}; - -/* argument n is in 1/60ths of a second */ - -A2 (PUBLIC trap, void, Delay, LONGINT, n, LONGINT *, ftp) /* IMII-384 */ -{ - if (n > 0) - { -#if defined (CYGWIN32) - clock_t finish_clocks; - void __attribute__ ((stdcall)) Sleep(int32 dwMilliseconds); - - finish_clocks = clock() + n * CLOCKS_PER_SEC / 60; - while (clock () < finish_clocks) - { - Sleep(0); /* Give up current CPU timeslice */ - check_virtual_interrupt (); - } -#elif defined (MSDOS) - unsigned long finish_msecs; - /* Busy looping is fine here. */ - finish_msecs = msecs_elapsed () + n * 1000 / 60; - while (msecs_elapsed () < finish_msecs) - { - check_virtual_interrupt (); - } -#else /* !MSDOS */ - TMTask tm; - int old_mask; - old_mask = sigblock (sigmask (SIGALRM)); - - tm.tmAddr = RM ((ProcPtr) P_ROMlib_wakeup); - InsTime ((QElemPtr) &tm); - if (!shouldbeawake_cond) - shouldbeawake_cond = SDL_CreateCond (); - if (!shouldbeawake_mutex) - shouldbeawake_mutex = SDL_CreateMutex (); - - SDL_mutexP (shouldbeawake_mutex); - shouldbeawake = FALSE; - PrimeTime ((QElemPtr) &tm, n * 1000 / 60); - while (!shouldbeawake) - { -#if 0 -/* sigsuspend() is an elegant solution. Since SDL's timer also uses - SIGALRM under Linux, I'm not going to mess with this code. - The CYGWIN32 code above doesn't really need to be modified for SDL - either, since the SDL version would do basically the same thing. - */ - -#warning THIS WONT WORK WITH THREADED SDL - -#if !defined(USE_BSD_SIGNALS) - sigset_t zero_mask; - sigemptyset(&zero_mask); - sigsuspend (&zero_mask); /* NOTE: this will allow both UNIX signals - and our thread_set_state kludges */ -#else - sigsetmask (0); -#endif -#else - SDL_CondWait (shouldbeawake_cond, shouldbeawake_mutex); - SDL_mutexP (shouldbeawake_mutex); -#endif - check_virtual_interrupt (); - } - RmvTime ((QElemPtr) &tm); - SDL_mutexV (shouldbeawake_mutex); - - sigsetmask (old_mask); -#endif /* !MSDOS */ - } - - /* Note: we're really called from a stub, so no CL() is needed here. */ - if (ftp) - *ftp = TickCount (); -} - -P1(PUBLIC pascal trap, void, SysBeep, INTEGER, i) /* SYSTEM DEPENDENT */ -{ -#if defined(MAC) - DebugStr("\004Beep"); -#elif defined(X) || defined(NEXTSTEP) || defined (CYGWIN32) - host_beep_at_user (); -#elif defined(MSDOS) - sound(440); - Delay(i, (LONGINT *) 0); - sound(0); -#else - write(1, "\7", 1); -#endif -} - -PUBLIC char ROMlib_phoneyrom[10] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0x06, 0x7C, -}; - -A2(PUBLIC trap, void, Environs, INTEGER *, rom, INTEGER *, machine) -{ - unsigned char rom8, rom9; - - rom8 = ((unsigned char *)ROMlib_phoneyrom)[8]; - rom9 = ((unsigned char *)ROMlib_phoneyrom)[9]; - - *rom = CW (rom9); - *machine = CW (rom8 + 1); -} - -#if !defined(NEXT) && !defined(SYN68K) -INTEGER ROMlib_processor = env68020; -#else -INTEGER ROMlib_processor = env68040; -#endif - -#if !defined(SYN68K) -INTEGER ROMlib_hasFPU = TRUE; -#endif - -A2(PUBLIC trap, OSErrRET, SysEnvirons, INTEGER, vers, SysEnvRecPtr, p) -{ -#if defined(NEXT) - ROMlib_processor = ROMlib_040 ? env68040 : env68030; -#endif - - if (vers <= 0) -/*-->*/ return envBadVers; - p->environsVersion = CW (vers); - p->machineType = CWC (53); - p->systemVersion = SysVersion; - -#if !defined (SYN68K) - p->processor = CW(ROMlib_processor); - p->hasFPU = ROMlib_hasFPU; -#else /* SYN68K */ - p->processor = CWC(env68040); - p->hasFPU = FALSE; -#endif /* SYN68K */ - p->hasColorQD = TRUE; - p->keyBoardType = CWC(envAExtendKbd); - p->atDrvrVersNum = 0; - p->sysVRefNum = BootDrive; - - return vers <= SYSRECVNUM ? noErr : envVersTooBig; -} - -A0(PUBLIC, void, SetUpA5) -{ -} - -A0(PUBLIC, void, RestoreA5) -{ -} - -#define TRUE32b 1 - -A1(PUBLIC, void, GetMMUMode, INTEGER *, ip) /* IMV-592 */ -{ - *ip = CWC(TRUE32b); -} - -A1(PUBLIC, void, SwapMMUMode, Byte *, bp) /* IMV-593 */ -{ - *bp = CB(TRUE32b); -} - -A1(PUBLIC, LONGINT, StripAddress, LONGINT, l) /* IMV-593 */ -{ - return l; -} diff --git a/src/osutil.c b/src/osutil.cpp similarity index 98% rename from src/osutil.c rename to src/osutil.cpp index af65685b..2c786e73 100644 --- a/src/osutil.c +++ b/src/osutil.cpp @@ -31,15 +31,14 @@ char ROMlib_rcsid_osutil[] = #include "rsys/host.h" #include "rsys/time.h" #include "rsys/toolevent.h" - -#if defined(NEXT) && !defined (OPENSTEP) -#include -#endif +#include "rsys/stdfile.h" #if defined(MSDOS) #include #endif +using namespace Executor; + /* * NOTE: HandToHand is not directly called by the outside world. * Hence, the handle that hp points to is not swapped. @@ -439,6 +438,13 @@ daysinyears (ULONGINT year) return (ULONGINT) 365 * year + year / 4 - year / 100 + year / 400; } +namespace Executor { + PRIVATE BOOLEAN isleap(ULONGINT); + PRIVATE void setdefaults(); + PRIVATE OSErr openparam(INTEGER *); + PRIVATE void deriveglobals(); +} + A1(PRIVATE, BOOLEAN, isleap, ULONGINT, year) { return !(year % 4) && (year % 100 || !(year % 400)); @@ -448,7 +454,7 @@ A1(PRIVATE, BOOLEAN, isleap, ULONGINT, year) /* month January = 1, hour Midnight = 0 */ PUBLIC long long -ROMlib_long_long_secs (INTEGER year, INTEGER month, INTEGER day, INTEGER hour, +Executor::ROMlib_long_long_secs (INTEGER year, INTEGER month, INTEGER day, INTEGER hour, INTEGER minute, INTEGER second) { /* #warning Make this work for years < 1904 ... it's probably wrong */ @@ -497,7 +503,7 @@ init_cutoffs (void) } PUBLIC void -date_to_swapped_fields (long long mactime, INTEGER *yearp, INTEGER *monthp, +Executor::date_to_swapped_fields (long long mactime, INTEGER *yearp, INTEGER *monthp, INTEGER *dayp, INTEGER *hourp, INTEGER *minutep, INTEGER *secondp, INTEGER *dayofweekp, INTEGER *dayofyearp, INTEGER *weekofyearp) @@ -659,7 +665,7 @@ A1(PRIVATE, OSErr, openparam, INTEGER *, rnp) return err; } -PUBLIC LONGINT ROMlib_GMTcorrect; +PUBLIC LONGINT Executor::ROMlib_GMTcorrect; A0(PRIVATE, void, deriveglobals) { @@ -950,7 +956,7 @@ P1(PUBLIC pascal trap, void, SysBeep, INTEGER, i) /* SYSTEM DEPENDENT */ { #if defined(MAC) DebugStr("\004Beep"); -#elif defined(X) || defined(NEXTSTEP) || defined (CYGWIN32) +#elif defined(X) || defined(MACOSX_) || defined (CYGWIN32) host_beep_at_user (); #elif defined(MSDOS) sound(440); @@ -961,7 +967,7 @@ P1(PUBLIC pascal trap, void, SysBeep, INTEGER, i) /* SYSTEM DEPENDENT */ #endif } -PUBLIC char ROMlib_phoneyrom[10] = { +PUBLIC char Executor::ROMlib_phoneyrom[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0x06, 0x7C, }; diff --git a/src/pack.c b/src/pack.cpp similarity index 94% rename from src/pack.c rename to src/pack.cpp index c43ce0fb..ba09a0b5 100644 --- a/src/pack.c +++ b/src/pack.cpp @@ -12,6 +12,8 @@ char ROMlib_rcsid_pack[] = #include "rsys/common.h" #include "Package.h" +using namespace Executor; + P1(PUBLIC pascal trap, void, InitPack, INTEGER, packid) { /* NOP */ diff --git a/src/parse.y b/src/parse.y index 8e1ac3ad..6ddacae8 100644 --- a/src/parse.y +++ b/src/parse.y @@ -2,13 +2,17 @@ #include "rsys/common.h" #include "rsys/options.h" #include "rsys/prefs.h" +#include "rsys/version.h" +#if 0 #include "rsys/crc.h" #include "rsys/parse.h" #include "rsys/parseopt.h" #include "rsys/gestalt.h" #include "rsys/launch.h" #include "rsys/print.h" -#include "rsys/version.h" +#else +#include "rsys/CFriendly.h" +#endif /* Copyright 1992 - 2000 by Abacus Research and Development, Inc. * All rights reserved. @@ -21,7 +25,7 @@ char ROMlib_rcsid_parse[] = static long yylex( void ); static void freestring( char *string ); -char validblock = 1; +static char validblock = 1; char *ROMlib_win32_token = 0; char *ROMlib_WindowName = 0; char *ROMlib_DongleFamily = 0; @@ -32,7 +36,7 @@ static char *ROMlib_mac_cdrom; pair_t ROMlib_ScreenSize = { INITIALPAIRVALUE, INITIALPAIRVALUE }; pair_t ROMlib_MacSize = { INITIALPAIRVALUE, INITIALPAIRVALUE }; pair_t ROMlib_ScreenLocation = { INITIALPAIRVALUE, INITIALPAIRVALUE }; -unsigned short crcval; +static unsigned short crcval; int ROMlib_AppleChar = 0; int ROMlib_right_button_modifier = 0; @@ -169,13 +173,13 @@ sysversassignment: SYSTEMVERSION '=' number ';' prversassignment: PRVERSION '=' number ';' { if (validblock) - ROMlib_PrDrvrVers = $3 * 10; + ROMlib_PrDrvrVers_Set( $3 * 10); } | PRVERSION '=' number '.' number ';' { if (validblock) - ROMlib_PrDrvrVers = $3 * 10 + $5; + ROMlib_PrDrvrVers_Set( $3 * 10 + $5 ); } ; @@ -206,9 +210,9 @@ stringvar: WINDOWNAME ; numervar: RDELAY - { $$ = &ROMlib_delay; } + { $$ = ROMlib_delayp; } | REFRESHNUMBER - { $$ = &ROMlib_refresh; } + { $$ = ROMlib_refreshp; } | BITSNUMBER { $$ = &ROMlib_desired_bpp; } | APPLECHAR diff --git a/src/parsenum.c b/src/parsenum.cpp similarity index 97% rename from src/parsenum.c rename to src/parsenum.cpp index 808c9865..31b53ac2 100644 --- a/src/parsenum.c +++ b/src/parsenum.cpp @@ -11,6 +11,7 @@ char ROMlib_rcsid_parsenum[] = #include "rsys/parsenum.h" #include +using namespace Executor; /* If the given string has a 'k', 'K', 'm', or 'M' suffix, returns the * log base 2 corresponding to that size (either 10 or 20) and removes @@ -53,7 +54,7 @@ parse_base_number (const char *s, const char *digits, long long *vp, { long long v, divisor; boolean_t found_dot_p; - int radix; + size_t radix; /* Make sure there's at least one digit. */ if (s[0] == '\0') @@ -127,7 +128,7 @@ parse_base_number (const char *s, const char *digits, long long *vp, * want rounding, just pass "1" for round_up_to_multiple_of. */ boolean_t -parse_number (const char *orig_num, int32 *val, +Executor::parse_number (const char *orig_num, int32 *val, unsigned round_up_to_multiple_of) { long long orig_raw_val, raw_val, div; @@ -173,7 +174,7 @@ parse_number (const char *orig_num, int32 *val, raw_val /= div; /* Make sure we didn't exceed the precision of the result. */ - v = raw_val; + v = (int32)raw_val; if (v != raw_val) return FALSE; diff --git a/src/parseopt.c b/src/parseopt.cpp similarity index 92% rename from src/parseopt.c rename to src/parseopt.cpp index 8094cbde..135d7b58 100644 --- a/src/parseopt.c +++ b/src/parseopt.cpp @@ -18,6 +18,7 @@ char ROMlib_rcsid_parseopt[] = #include +using namespace Executor; /* Parse version e.g. "executor -system 7.0.2". Omitted * digits will be zero, so "executor -system 7" is equivalent to @@ -25,11 +26,11 @@ char ROMlib_rcsid_parseopt[] = */ boolean_t -ROMlib_parse_version (const char *vers, uint32 *version_out) +Executor::ROMlib_parse_version (const char *vers, uint32 *version_out) { boolean_t success_p; int major_version, minor_version, teeny_version; - char *major_str, *minor_str, *teeny_str; + const char *major_str, *minor_str, *teeny_str; char *temp_str, *system_str; /* Copy the version to a temp string we can manipulate. */ @@ -79,7 +80,7 @@ ROMlib_parse_version (const char *vers, uint32 *version_out) * "executor -system 7.0.0". Returns TRUE on success, else FALSE. */ boolean_t -parse_system_version (const char *vers) +Executor::parse_system_version (const char *vers) { boolean_t retval; @@ -99,7 +100,7 @@ parse_system_version (const char *vers) * on parse error. */ boolean_t -parse_size_opt (const char *opt, const char *arg) +Executor::parse_size_opt (const char *opt, const char *arg) { boolean_t success_p; int w, h; @@ -158,7 +159,7 @@ parse_size_opt (const char *opt, const char *arg) */ PUBLIC boolean_t -parse_prres_opt (INTEGER *outx, INTEGER *outy, const char *arg) +Executor::parse_prres_opt (INTEGER *outx, INTEGER *outy, const char *arg) { boolean_t retval; INTEGER x, y, *p; diff --git a/src/pef_hash.c b/src/pef_hash.cpp similarity index 98% rename from src/pef_hash.c rename to src/pef_hash.cpp index ac1c2d42..33cbfe6f 100644 --- a/src/pef_hash.c +++ b/src/pef_hash.cpp @@ -16,6 +16,8 @@ char ROMlib_rcsid_pef_hash[] = #include +using namespace Executor; + /* * * IM 8-43 provides C code that uses a loop to determine the exponent @@ -137,12 +139,10 @@ sort_entry_t; PRIVATE int hash_index_compare (const void *p1, const void *p2) { - const sort_entry_t *sp1, *sp2; + const sort_entry_t *sp1 = (const sort_entry_t *)p1; + const sort_entry_t *sp2 = (const sort_entry_t *)p2; int retval; - sp1 = p1; - sp2 = p2; - retval = sp1->hash_index - sp2->hash_index; return retval; } @@ -221,7 +221,7 @@ ROMlib_build_pef_hash (const map_entry_t table[], int count) ((char *) retval + symbol_table_offset)); string_tablep = ((typeof (string_tablep)) ((char *) retval + string_table_offset)); - sorted = alloca (sizeof *sorted * count); + sorted = (sort_entry_t *)alloca (sizeof *sorted * count); name_offset = 0; for (i = 0; i < count; ++i) { diff --git a/src/prError.c b/src/prError.cpp similarity index 95% rename from src/prError.c rename to src/prError.cpp index b85ca040..957b4e69 100644 --- a/src/prError.c +++ b/src/prError.cpp @@ -13,6 +13,8 @@ char ROMlib_rcsid_prError[] = #include "QuickDraw.h" #include "PrintMgr.h" +using namespace Executor; + P0(PUBLIC pascal trap, INTEGER, PrError) { return CW(PrintErr); diff --git a/src/prInit.c b/src/prInit.cpp similarity index 92% rename from src/prInit.c rename to src/prInit.cpp index 262a9207..607bc37d 100644 --- a/src/prInit.c +++ b/src/prInit.cpp @@ -16,8 +16,11 @@ char ROMlib_rcsid_prInit[] = #include "FileMgr.h" #include "ToolboxUtil.h" #include "MemoryMgr.h" +#include "rsys/print.h" -PUBLIC INTEGER ROMlib_printresfile = -1; +using namespace Executor; + +PUBLIC INTEGER Executor::ROMlib_printresfile = -1; P0(PUBLIC pascal trap, void, PrOpen) { diff --git a/src/prLowLevel.c b/src/prLowLevel.cpp similarity index 95% rename from src/prLowLevel.c rename to src/prLowLevel.cpp index 8448eadb..f570194a 100644 --- a/src/prLowLevel.c +++ b/src/prLowLevel.cpp @@ -33,11 +33,14 @@ char ROMlib_rcsid_prLowLevel[] = #include "rsys/options.h" #include "rsys/string.h" #include "rsys/osevent.h" +#include "contextswitch.h" #if defined (CYGWIN32) #include "win_print.h" #endif +using namespace Executor; + PUBLIC uint32 ROMlib_PrDrvrVers = 70; P0(PUBLIC pascal trap, void, PrDrvrOpen) /* TODO */ @@ -239,13 +242,13 @@ update_orientation (DialogPtr dp, INTEGER button) } PUBLIC char * -cstring_from_str255 (Str255 text) +Executor::cstring_from_str255 (Str255 text) { int len; char *retval; len = (uint8)text[0]; - retval = malloc (len+1); + retval = (char*)malloc (len+1); if (retval) { memcpy (retval, text+1, len); @@ -254,10 +257,10 @@ cstring_from_str255 (Str255 text) return retval; } -PUBLIC ini_key_t ROMlib_printer = NULL; +PUBLIC ini_key_t Executor::ROMlib_printer = NULL; PRIVATE ini_key_t ROMlib_paper = NULL; -PUBLIC ini_key_t ROMlib_port = NULL; -PUBLIC ini_key_t ROMlib_paper_orientation = NULL; +PUBLIC ini_key_t Executor::ROMlib_port = NULL; +PUBLIC ini_key_t Executor::ROMlib_paper_orientation = NULL; PRIVATE ini_key_t ROMlib_spool_template = NULL; #if defined (MSDOS) || defined (CYGWIN32) @@ -291,10 +294,10 @@ find_item_key (DialogPtr dlg, INTEGER itemno) return retval; } -PUBLIC char *ROMlib_spool_file; +PUBLIC char *Executor::ROMlib_spool_file; PUBLIC void -update_printing_globals (void) +Executor::update_printing_globals (void) { { value_t dimensions; @@ -358,7 +361,7 @@ update_ROMlib_printer_vars (TPPrDlg dp) { if (ROMlib_spool_file) free (ROMlib_spool_file); - ROMlib_spool_file = malloc (hs + 1); + ROMlib_spool_file = (char*)malloc (hs + 1); memcpy (ROMlib_spool_file, STARH (h), hs); ROMlib_spool_file [hs] = 0; } @@ -407,11 +410,9 @@ typedef enum { PRINT_TO_PORT, PRINT_TO_FILE, -#if defined (CYGWIN32) PRINT_TO_WIN32, -#endif -} -print_where_t; + PRINT_TO_NEXTSTEP +} print_where_t; PRIVATE print_where_t print_where; @@ -502,7 +503,7 @@ P2(PUBLIC pascal, void, ROMlib_mystlproc, DialogPtr, dp, INTEGER, itemno) switch(itemno) { case LAYOUT_OK_NO: -#if defined(NEXTSTEP) +#if defined(MACOSX_) printstate = seenPageSetUp; contextswitch(&romlib_sp, &nextstep_sp); #endif @@ -538,6 +539,11 @@ typedef pascal void (*pritemprocp) (TPPrDlg prrecptr, INTEGER item); #define CALLPRINITPROC(hPrint, fp) \ ROMlib_CALLPRINITPROC((hPrint), (prinitprocp)(fp)) +namespace Executor { + static inline TPPrDlg ROMlib_CALLPRINITPROC(THPrint, prinitprocp); + static inline void ROMlib_CALLPRITEMPROC(TPPrDlg, INTEGER, pritemprocp); +} + A2(static inline, TPPrDlg, ROMlib_CALLPRINITPROC, THPrint, hPrint, prinitprocp, fp) { @@ -549,7 +555,7 @@ A2(static inline, TPPrDlg, ROMlib_CALLPRINITPROC, THPrint, hPrint, retval = C_PrJobInit(hPrint); else { HOOKSAVEREGS(); - retval = (TPPrDlg) CToPascalCall(fp, CTOP_PrStlInit, hPrint); + retval = (TPPrDlg) CToPascalCall(&fp, CTOP_PrStlInit, hPrint); HOOKRESTOREREGS(); } return retval; @@ -568,7 +574,7 @@ A3(static inline, void, ROMlib_CALLPRITEMPROC, TPPrDlg, prrecptr, C_ROMlib_mystlproc((DialogPtr) prrecptr, item); else { HOOKSAVEREGS(); - CToPascalCall(fp, CTOP_ROMlib_myjobproc, prrecptr, item); + CToPascalCall(&fp, CTOP_ROMlib_myjobproc, prrecptr, item); HOOKRESTOREREGS(); } } @@ -640,7 +646,7 @@ P3(PUBLIC, pascal BOOLEAN, ROMlib_stlfilterproc, DialogPeek, dp, h = GetDIText ((DialogPtr) dp, LAYOUT_FILENAME_NO); len = GetHandleSize (h); - filename = alloca (len+1); + filename = (char*)alloca (len+1); memcpy (filename, STARH (h), len); filename[len] = 0; @@ -654,7 +660,7 @@ P3(PUBLIC, pascal BOOLEAN, ROMlib_stlfilterproc, DialogPeek, dp, "If you click on the \"Overwrite\" button, " \ "\"%s\" will be overwritten as soon as you print." - buf = alloca (sizeof (EXISTS_MESSAGE) + + buf = (char*)alloca (sizeof (EXISTS_MESSAGE) + strlen (filename) + strlen (filename) + 1); sprintf (buf, EXISTS_MESSAGE, filename, filename); if (system_error (buf, 0, @@ -697,7 +703,7 @@ set_userItem (DialogPtr dp, INTEGER itemno, void *funcp) INTEGER unused; GetDItem(dp, itemno, &unused, NULL, &r); - SetDItem(dp, itemno, userItem, funcp, &r); + SetDItem(dp, itemno, userItem, (Handle)funcp, &r); } PRIVATE void @@ -875,8 +881,8 @@ P2(PUBLIC, pascal void, ROMlib_orientation, DialogPeek, dp, INTEGER, which) PenPat (black); } -PUBLIC char *ROMlib_PrintersIni; -PUBLIC char *ROMlib_PrintDef; +PUBLIC char *Executor::ROMlib_PrintersIni; +PUBLIC char *Executor::ROMlib_PrintDef; PRIVATE void adjust_menu_common (TPPrDlg dlg, INTEGER item, heading_t heading, ini_key_t defkey) @@ -1015,7 +1021,7 @@ set_default_orientation (TPPrDlg dlg) } PUBLIC void -printer_init (void) +Executor::printer_init (void) { static boolean_t ini_read_p = FALSE; @@ -1094,7 +1100,7 @@ P1(PUBLIC pascal trap, TPPrDlg, PrStlInit, THPrint, hPrint) HIDDEN_Handle hh; Handle h; Str255 str; - int orig, new; + int orig, new1; Str255 new_printer_name; Str255 new_type_label; @@ -1113,10 +1119,10 @@ P1(PUBLIC pascal trap, TPPrDlg, PrStlInit, THPrint, hPrint) h = MR (hh.p); GetIText (h, str); orig = StringWidth (str); - new = StringWidth (new_type_label); + new1 = StringWidth (new_type_label); HUnlock (h); - r.left = CW (CW(r.left) + orig - new); + r.left = CW (CW(r.left) + orig - new1); SetDItem ((DialogPtr) retval, LAYOUT_PRINTER_TYPE_LABEL_NO, CW (item_type), h, &r); SetIText (GetDIText ((DialogPtr) retval, LAYOUT_PRINTER_NAME_NO), @@ -1154,13 +1160,13 @@ P2(PUBLIC pascal trap, BOOLEAN, PrDlgMain, THPrint, hPrint, ProcPtr, initfptr) printer_init (); retval = FALSE; -#if 0 && defined(NEXTSTEP) +#if 0 && defined(MACOSX_) /* * NOTE: we don't actually call this because Excel sets up some goofy pages * and then we get way confused. */ ROMlib_updatenextpagerect((comRect *) &Hx(hPrint, rPaper)); -#endif /* defined(NEXTSTEP) */ +#endif /* defined(MACOSX_) */ if ((prrecptr = CALLPRINITPROC(hPrint, initfptr))) { if (!SUNPATH_HACK || (((pritemprocp) MR(prrecptr->pItemProc) != (pritemprocp) P_ROMlib_myjobproc) || @@ -1209,11 +1215,11 @@ P2(PUBLIC pascal trap, BOOLEAN, PrDlgMain, THPrint, hPrint, ProcPtr, initfptr) CloseDialog((DialogPtr) prrecptr); DisposPtr((Ptr) prrecptr); } -#if defined(NEXTSTEP) +#if defined(MACOSX_) ROMlib_updatemacpagerect((comRect *) &HxX(hPrint, rPaper), (comRect *) &HxX(hPrint, prInfo.rPage), (comRect *) &HxX(hPrint, prInfoPT.rPage)); -#endif /* defined(NEXTSTEP) */ +#endif /* defined(MACOSX_) */ return retval; } diff --git a/src/prPrinting.c b/src/prPrinting.cpp similarity index 82% rename from src/prPrinting.c rename to src/prPrinting.cpp index c3b3a066..57087286 100644 --- a/src/prPrinting.c +++ b/src/prPrinting.cpp @@ -26,6 +26,8 @@ char ROMlib_rcsid_prPrinting[] = #include "rsys/vdriver.h" #include "rsys/file.h" #include "rsys/cleanup.h" +#include "contextswitch.h" +#include "rsys/prefs.h" #if defined (MSDOS) || defined (CYGWIN32) #include @@ -34,22 +36,24 @@ PUBLIC boolean_t deferred_printing_p = FALSE /* TRUE */; #endif +using namespace Executor; + PUBLIC int pageno = 0; /* This isn't really the way to do it */ -PUBLIC int ROMlib_passpostscript = TRUE; -PUBLIC int ROMlib_fontsubstitution = FALSE; - -PUBLIC char *ROMlib_document_paper_sizes; -PUBLIC char *ROMlib_paper_size; -PUBLIC const char *ROMlib_paper_size_name; -PUBLIC const char *ROMlib_paper_size_name_terminator; -PUBLIC int ROMlib_rotation; -PUBLIC int ROMlib_translate_x; -PUBLIC int ROMlib_translate_y; -PUBLIC int ROMlib_resolution_x = 72; -PUBLIC int ROMlib_resolution_y = 72; - -PUBLIC int ROMlib_paper_x; -PUBLIC int ROMlib_paper_y; +PUBLIC int Executor::ROMlib_passpostscript = TRUE; +PUBLIC int Executor::ROMlib_fontsubstitution = FALSE; + +PUBLIC char *Executor::ROMlib_document_paper_sizes; +PUBLIC char *Executor::ROMlib_paper_size; +PUBLIC const char *Executor::ROMlib_paper_size_name; +PUBLIC const char *Executor::ROMlib_paper_size_name_terminator; +PUBLIC int Executor::ROMlib_rotation; +PUBLIC int Executor::ROMlib_translate_x; +PUBLIC int Executor::ROMlib_translate_y; +PUBLIC int Executor::ROMlib_resolution_x = 72; +PUBLIC int Executor::ROMlib_resolution_y = 72; + +PUBLIC int Executor::ROMlib_paper_x; +PUBLIC int Executor::ROMlib_paper_y; /* This boolean is here to prevent Energy Scheming from causing trouble. ES calls PrPageClose twice at the end. This fix is sub-optimal, but @@ -59,11 +63,11 @@ PRIVATE boolean_t page_is_open = FALSE; #include "rsys/nextprint.h" -#if defined(NEXTSTEP) -printstate_t printstate; +#if defined(MACOSX_) +printstate_t Executor::printstate; #endif -LONGINT pagewanted = 0; +LONGINT Executor::pagewanted = 0; PRIVATE int lastpagewanted = 0; P4(PUBLIC pascal trap, void, donotPrArc, GrafVerb, verb, Rect *, r, @@ -301,7 +305,7 @@ P3(PUBLIC pascal trap, void, PrComment, INTEGER, kind, INTEGER, size, case postscripttextis: if (ROMlib_passpostscript) (PORT_GRAF_PROCS (thePort))->textProc - = RM(GOOFYCAST P_textasPS); + = (textProc_t)RM(GOOFYCAST P_textasPS); break; case postscripthandle: if (pageno >= pagewanted && pageno <= lastpagewanted && ROMlib_passpostscript) { @@ -324,80 +328,78 @@ PRIVATE boolean_t printport_open_p = FALSE; PRIVATE void ourinit (TPPrPort port, BOOLEAN preserve_font) { - INTEGER saved_font; - - saved_font = port->gPort.txFont; + INTEGER saved_font = port->gPort.txFont; printer_init (); update_printing_globals (); - if (!printport_open_p) { + if (!printport_open_p) { OpenPort((GrafPtr) &printport); printport_open_p = TRUE; - } else + } else InitPort((GrafPtr) &printport); - printport.txFont = CWC (-32768); /* force reload */ - printport.pnLoc.h = CWC (-32768); - printport.pnLoc.v = CWC (-32768); - OpenPort(&port->gPort); - sendpsprocs.textProc = RM(P_donotPrText); - sendpsprocs.lineProc = RM(P_donotPrLine); - sendpsprocs.rectProc = RM(P_donotPrRect); - sendpsprocs.rRectProc = RM(P_donotPrRRect); - sendpsprocs.ovalProc = RM(P_donotPrOval); - sendpsprocs.arcProc = RM(P_donotPrArc); - sendpsprocs.polyProc = RM(P_donotPrPoly); - sendpsprocs.rgnProc = RM(P_donotPrRgn); - sendpsprocs.bitsProc = RM(P_donotPrBits); - sendpsprocs.commentProc = RM(P_PrComment); - sendpsprocs.txMeasProc = RM(P_PrTxMeas); + printport.txFont = CWC (-32768); /* force reload */ + printport.pnLoc.h = CWC (-32768); + printport.pnLoc.v = CWC (-32768); + OpenPort(&port->gPort); + sendpsprocs.textProc = (textProc_t)RM(P_donotPrText); + sendpsprocs.lineProc = (lineProc_t)RM(P_donotPrLine); + sendpsprocs.rectProc = (rectProc_t)RM(P_donotPrRect); + sendpsprocs.rRectProc = (rRectProc_t)RM(P_donotPrRRect); + sendpsprocs.ovalProc = (ovalProc_t)RM(P_donotPrOval); + sendpsprocs.arcProc = (arcProc_t)RM(P_donotPrArc); + sendpsprocs.polyProc = (polyProc_t)RM(P_donotPrPoly); + sendpsprocs.rgnProc = (rgnProc_t)RM(P_donotPrRgn); + sendpsprocs.bitsProc = (bitsProc_t)RM(P_donotPrBits); + sendpsprocs.commentProc = (commentProc_t)RM(P_PrComment); + sendpsprocs.txMeasProc = (txMeasProc_t)RM(P_PrTxMeas); #if 0 - sendpsprocs.getPicProc = RM(P_donotPrGetPic); - sendpsprocs.putPicProc = RM(P_donotPrPutPic); + sendpsprocs.getPicProc = (getPicProc_t)RM(P_donotPrGetPic); + sendpsprocs.putPicProc = (putPicProc_t)RM(P_donotPrPutPic); #else - sendpsprocs.getPicProc = RM(P_StdGetPic); - sendpsprocs.putPicProc = RM(P_StdPutPic); -#endif - prprocs.textProc = RM(P_PrText); - prprocs.lineProc = RM(P_PrLine); - prprocs.rectProc = RM(P_PrRect); - prprocs.rRectProc = RM(P_PrRRect); - prprocs.ovalProc = RM(P_PrOval); - prprocs.arcProc = RM(P_PrArc); - prprocs.polyProc = RM(P_PrPoly); - prprocs.rgnProc = RM(P_PrRgn); - prprocs.bitsProc = RM(P_PrBits); - prprocs.commentProc = RM(P_PrComment); - prprocs.txMeasProc = RM(P_PrTxMeas); + sendpsprocs.getPicProc = (getPicProc_t)RM(P_StdGetPic); + sendpsprocs.putPicProc = (putPicProc_t)RM(P_StdPutPic); +#endif + prprocs.textProc = (textProc_t)RM(P_PrText); + prprocs.lineProc = (lineProc_t)RM(P_PrLine); + prprocs.rectProc = (rectProc_t)RM(P_PrRect); + prprocs.rRectProc = (rRectProc_t)RM(P_PrRRect); + prprocs.ovalProc = (ovalProc_t)RM(P_PrOval); + prprocs.arcProc = (arcProc_t)RM(P_PrArc); + prprocs.polyProc = (polyProc_t)RM(P_PrPoly); + prprocs.rgnProc = (rgnProc_t)RM(P_PrRgn); + prprocs.bitsProc = (bitsProc_t)RM(P_PrBits); + prprocs.commentProc = (commentProc_t)RM(P_PrComment); + prprocs.txMeasProc = (txMeasProc_t)RM(P_PrTxMeas); #if 0 - prprocs.getPicProc = RM(P_PrGetPic); - prprocs.putPicProc = RM(P_PrPutPic); + prprocs.getPicProc = (getPicProc_t)RM(P_PrGetPic); + prprocs.putPicProc = (putPicProc_t)RM(P_PrPutPic); #else - prprocs.getPicProc = RM(P_StdGetPic); - prprocs.putPicProc = RM(P_StdPutPic); + prprocs.getPicProc = (getPicProc_t)RM(P_StdGetPic); + prprocs.putPicProc = (putPicProc_t)RM(P_StdPutPic); #endif - port->saveprocs = prprocs; + port->saveprocs = prprocs; #if 1 - port->gPort.device = CWC(1); + port->gPort.device = CWC(1); #endif - port->gPort.grafProcs = RM(&port->saveprocs); + port->gPort.grafProcs = RM(&port->saveprocs); - SetRect (&port->gPort.portBits.bounds, - -1 * ROMlib_resolution_x / 2, - -1 * ROMlib_resolution_y / 2, - ROMlib_paper_x - (ROMlib_resolution_x / 2), - ROMlib_paper_y - (ROMlib_resolution_y / 2)); - SetRect (&port->gPort.portRect, 0, 0, - ROMlib_paper_x - 72, ROMlib_paper_y - 72); - HxX (MR (port->gPort.visRgn), rgnBBox) = port->gPort.portRect; + SetRect (&port->gPort.portBits.bounds, + -1 * ROMlib_resolution_x / 2, + -1 * ROMlib_resolution_y / 2, + ROMlib_paper_x - (ROMlib_resolution_x / 2), + ROMlib_paper_y - (ROMlib_resolution_y / 2)); + SetRect (&port->gPort.portRect, 0, 0, + ROMlib_paper_x - 72, ROMlib_paper_y - 72); + HxX (MR (port->gPort.visRgn), rgnBBox) = port->gPort.portRect; - if (preserve_font) - port->gPort.txFont = saved_font; + if (preserve_font) + port->gPort.txFont = saved_font; - NeXTOpenPage(); + NeXTOpenPage(); } -#if !defined(NEXTSTEP) +#if !defined(MACOSX_) #include #endif @@ -407,7 +409,7 @@ PRIVATE boolean_t need_pclose; PRIVATE void (*old_pipe_signal)(int); #endif -#if !defined (NEXTSTEP) +#if !defined (MACOSX_) PRIVATE FILE * open_ps_file (boolean_t *need_pclosep) { @@ -471,7 +473,7 @@ open_ps_file (boolean_t *need_pclosep) } return retval; } -#endif /* !NEXTSTEP */ +#endif /* !MACOSX_ */ PRIVATE boolean_t already_open = FALSE; @@ -500,7 +502,7 @@ call_job_dialog_if_needed (THPrint thprint) } PUBLIC void -ROMlib_acknowledge_job_dialog (THPrint thprint) +Executor::ROMlib_acknowledge_job_dialog (THPrint thprint) { #if defined (CYGWIN32) last_thprint = thprint; @@ -520,14 +522,14 @@ P3(PUBLIC pascal trap, TPPrPort, PrOpenDoc, THPrint, hPrint, TPPrPort, port, } ourinit(port, FALSE); -#if !defined (NEXTSTEP) +#if !defined (MACOSX_) pagewanted = Hx(hPrint, prJob.iFstPage); lastpagewanted = Hx(hPrint, prJob.iLstPage); #else lastpagewanted = 9999; #endif -#if !defined(NEXTSTEP) +#if !defined(MACOSX_) if (!already_open) { #if defined (QUESTIONABLE_FIX_FOR_LOGBOOK_THAT_BREAKS_PRINTING_UNDER_TESTGEN) @@ -581,7 +583,7 @@ P2(PUBLIC pascal trap, void, PrOpenPage, TPPrPort, port, TPRect, pPageFrame) ourinit(port, TRUE); if (pageno >= pagewanted && pageno <= lastpagewanted) { -#if !defined(NEXTSTEP) +#if !defined(MACOSX_) if (ROMlib_printfile) fprintf(ROMlib_printfile, ROMlib_page_begin, pageno - pagewanted + 1, pageno - pagewanted + 1, @@ -604,7 +606,7 @@ P1(PUBLIC pascal trap, void, PrClosePage, TPPrPort, pPrPort) { if (pageno >= pagewanted && pageno <= lastpagewanted) { -#if !defined(NEXTSTEP) +#if !defined(MACOSX_) if (ROMlib_printfile) fprintf(ROMlib_printfile, ROMlib_page_end, -55 + (ROMlib_rotation ? 30 : 0)); @@ -689,7 +691,7 @@ invoke_print_batch_file (const char *filename, ini_key_t printer, ini_key_t port P1(PUBLIC pascal trap, void, PrCloseDoc, TPPrPort, port) { -#if !defined(NEXTSTEP) +#if !defined(MACOSX_) if (ROMlib_printfile) { fprintf(ROMlib_printfile, ROMlib_doc_end, pageno - pagewanted + 1, @@ -771,7 +773,7 @@ P5(PUBLIC pascal trap, void, PrPicFile, THPrint, hPrint, TPPrPort, pPrPort, } PUBLIC void -print_reinit (void) +Executor::print_reinit (void) { printport_open_p = FALSE; } diff --git a/src/prRecords.c b/src/prRecords.cpp similarity index 97% rename from src/prRecords.c rename to src/prRecords.cpp index 6b9556ca..609172c2 100644 --- a/src/prRecords.c +++ b/src/prRecords.cpp @@ -18,6 +18,8 @@ char ROMlib_rcsid_prRecords[] = #include "rsys/pstuff.h" #include "rsys/print.h" +using namespace Executor; + PRIVATE void set_wDev (THPrint hPrint) { @@ -25,7 +27,7 @@ set_wDev (THPrint hPrint) } PUBLIC void -ROMlib_set_default_resolution (THPrint hPrint, INTEGER vres, INTEGER hres) +Executor::ROMlib_set_default_resolution (THPrint hPrint, INTEGER vres, INTEGER hres) { printer_init (); update_printing_globals (); diff --git a/src/priv.c b/src/priv.cpp similarity index 98% rename from src/priv.c rename to src/priv.cpp index fe8305c3..b43a00a2 100644 --- a/src/priv.c +++ b/src/priv.cpp @@ -9,6 +9,7 @@ char ROMlib_rcsid_priv[] = #include "rsys/common.h" +using namespace Executor; #if !defined (SYN68K) @@ -68,7 +69,7 @@ static void susword(short *addr, short value) static void canthandle( void ) { -#if 0 && defined(NEXTSTEP) /* unexpectedsignal is gone */ +#if 0 && defined(MACOSX_) /* unexpectedsignal is gone */ signal(SIGILL, (void *)unexpectedsignal); #endif } diff --git a/src/process.c b/src/process.cpp similarity index 97% rename from src/process.c rename to src/process.cpp index 043d7d99..47287609 100644 --- a/src/process.c +++ b/src/process.cpp @@ -17,6 +17,8 @@ char ROMlib_rcsid_process[] = #include "rsys/mman.h" #include "rsys/process.h" +using namespace Executor; + #define declare_handle_type(type_prefix) \ typedef type_prefix ## _t *type_prefix ## _ptr; \ MAKE_HIDDEN(type_prefix ## _ptr); \ @@ -38,6 +40,7 @@ get_size_resource () return (size_resource_handle) size; } +#pragma pack(push, 2) typedef struct process_info { struct process_info *next; @@ -50,22 +53,20 @@ typedef struct process_info ProcessSerialNumber serial_number; } process_info_t; +#pragma pack(pop) static process_info_t *process_info_list; static process_info_t *current_process_info; -static const int default_process_mode_flags; +static const int default_process_mode_flags = 0; -#if 0 /* ### not currently used */ static ProcessSerialNumber system_process = { 0, CLC (kSystemProcess) }; -#endif - static ProcessSerialNumber no_process = { 0, CLC (kNoProcess) }; static ProcessSerialNumber current_process = { 0, CLC (kCurrentProcess) }; void -process_create (boolean_t desk_accessory_p, +Executor::process_create (boolean_t desk_accessory_p, uint32 type, uint32 signature) { size_resource_handle size; diff --git a/src/qBit.c b/src/qBit.cpp similarity index 99% rename from src/qBit.c rename to src/qBit.cpp index 3329bc46..7bb42dd4 100644 --- a/src/qBit.c +++ b/src/qBit.cpp @@ -21,6 +21,8 @@ char ROMlib_rcsid_qBit[] = #include "rsys/picture.h" #include "rsys/mman.h" +using namespace Executor; + P6 (PUBLIC pascal trap, void, CopyBits, BitMap *, src_bitmap, BitMap *, dst_bitmap, const Rect *, src_rect, const Rect *, dst_rect, diff --git a/src/qCConv.c b/src/qCConv.cpp similarity index 99% rename from src/qCConv.c rename to src/qCConv.cpp index c6bcd3b2..68b4d28f 100644 --- a/src/qCConv.c +++ b/src/qCConv.cpp @@ -9,6 +9,9 @@ char ROMlib_rcsid_qCConv[] = #include "rsys/common.h" #include "QuickDraw.h" +#include "CQuickDraw.h" + +using namespace Executor; /* cmy and rgb color spaces are simply complements */ diff --git a/src/qCGrafPort.c b/src/qCGrafPort.cpp similarity index 99% rename from src/qCGrafPort.c rename to src/qCGrafPort.cpp index 5978efb1..7d5224d6 100644 --- a/src/qCGrafPort.c +++ b/src/qCGrafPort.cpp @@ -21,6 +21,8 @@ char ROMlib_rcsid_qCGrafport[] = #include "rsys/xdata.h" #include "rsys/evil.h" +using namespace Executor; + P1 (PUBLIC pascal trap, void, OpenCPort, CGrafPtr, port) { @@ -190,7 +192,7 @@ P1 (PUBLIC pascal trap, void, RGBBackColor, #if defined (EVIL_ILLUSTRATOR_7_HACK) if (ROMlib_evil_illustrator_7_hack) { - color = alloca (sizeof (RGBColor)); + color = (RGBColor*)alloca (sizeof (RGBColor)); color->red = 65535; color->green = 65535; color->blue = 65535; @@ -279,7 +281,7 @@ P1 (PUBLIC pascal trap, void, BackPixPat, } void -ROMlib_fill_pixpat (PixPatHandle new_fill) +Executor::ROMlib_fill_pixpat (PixPatHandle new_fill) { if (CGrafPort_p (thePort)) { diff --git a/src/qCRegular.c b/src/qCRegular.cpp similarity index 98% rename from src/qCRegular.c rename to src/qCRegular.cpp index a1d442a9..d1560012 100644 --- a/src/qCRegular.c +++ b/src/qCRegular.cpp @@ -16,6 +16,8 @@ char ROMlib_rcsid_qCRegular[] = #include "rsys/quick.h" #include "rsys/cquick.h" +using namespace Executor; + #define FillCxxx(CALLxxx) \ do \ { \ diff --git a/src/qColor.c b/src/qColor.cpp similarity index 80% rename from src/qColor.c rename to src/qColor.cpp index 506c99cf..2b4a3b21 100644 --- a/src/qColor.c +++ b/src/qColor.cpp @@ -21,25 +21,27 @@ char ROMlib_rcsid_qColor[] = #include "rsys/host.h" #include "rsys/qcolor.h" +using namespace Executor; + /* color quickdraw global stuff */ -ColorSpec ROMlib_white_cspec = +ColorSpec Executor::ROMlib_white_cspec = { - CWC (0), { CWC (0xFFFF), CWC (0xFFFF), CWC (0xFFFF) } + CWC (0), { CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF) } }; -ColorSpec ROMlib_black_cspec = +ColorSpec Executor::ROMlib_black_cspec = { CWC (1), { CWC (0x0), CWC (0x0), CWC (0x0) } }; -ColorSpec ROMlib_gray_cspec = +ColorSpec Executor::ROMlib_gray_cspec = { - CWC (0), { CWC (0x8000), CWC (0x8000), CWC (0x8000) } + CWC (0), { CWC ((unsigned short)0x8000), CWC ((unsigned short)0x8000), CWC ((unsigned short)0x8000) } }; -Rect ROMlib_pattern_bounds = +Rect Executor::ROMlib_pattern_bounds = { CWC (0), CWC (0), CWC (8), CWC (8), }; @@ -48,20 +50,20 @@ Rect ROMlib_pattern_bounds = /* FIXME: replace this with a correct references to the low global QDColors */ -struct qd_color_elt ROMlib_QDColors[] = +struct qd_color_elt Executor::ROMlib_QDColors[] = { { { CWC (0x0000), CWC (0x0000), CWC (0x0000) }, blackColor }, - { { CWC (0xFC00), CWC (0xF37D), CWC (0x052F) }, yellowColor }, - { { CWC (0xF2D7), CWC (0x0856), CWC (0x84EC) }, magentaColor }, - { { CWC (0xDD6B), CWC (0x08C2), CWC (0x06A2) }, redColor }, - { { CWC (0x0241), CWC (0xAb54), CWC (0xEAFF) }, cyanColor }, - { { CWC (0x0000), CWC (0x64AF), CWC (0x11B0) }, greenColor }, + { { CWC ((unsigned short)0xFC00), CWC ((unsigned short)0xF37D), CWC (0x052F) }, yellowColor }, + { { CWC ((unsigned short)0xF2D7), CWC ((unsigned short)0x0856), CWC ((unsigned short)0x84EC) }, magentaColor }, + { { CWC ((unsigned short)0xDD6B), CWC ((unsigned short)0x08C2), CWC ((unsigned short)0x06A2) }, redColor }, + { { CWC ((unsigned short)0x0241), CWC ((unsigned short)0xAb54), CWC ((unsigned short)0xEAFF) }, cyanColor }, + { { CWC (0x0000), CWC ((unsigned short)0x64AF), CWC ((unsigned short)0x11B0) }, greenColor }, { { CWC (0x0000), CWC (0x0000), CWC (0xD400) }, blueColor }, - { { CWC (0xFFFF), CWC (0xFFFF), CWC (0xFFFF) }, whiteColor }, + { { CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF) }, whiteColor }, }; RGBColor * -ROMlib_qd_color_to_rgb (LONGINT qd_color) +Executor::ROMlib_qd_color_to_rgb (LONGINT qd_color) { int i; @@ -115,7 +117,7 @@ P1(PUBLIC pascal trap, void, ColorBit, INTEGER, b) typedef CTabHandle clut_res_handle; -ColorSpec *default_ctab_colors[] = +ColorSpec *Executor::default_ctab_colors[] = { ctab_1bpp_values, ctab_2bpp_values, diff --git a/src/qColorMgr.c b/src/qColorMgr.cpp similarity index 99% rename from src/qColorMgr.c rename to src/qColorMgr.cpp index 66e01c59..53a49aa6 100644 --- a/src/qColorMgr.c +++ b/src/qColorMgr.cpp @@ -24,6 +24,8 @@ char ROMlib_rcsid_qColorMgr[] = #include "rsys/vdriver.h" #include "rsys/dirtyrect.h" +using namespace Executor; + INTEGER ROMlib_qd_error; P0 (PUBLIC pascal trap, INTEGER, QDError) @@ -407,7 +409,7 @@ P3 (PUBLIC pascal trap, void, GetSubTable, } int -average_color (GDHandle gd, +Executor::average_color (GDHandle gd, RGBColor *c1, RGBColor *c2, int ratio, RGBColor *out) { @@ -702,7 +704,7 @@ P3 (PUBLIC pascal trap, void, MakeITable, queue = (unsigned short *) alloca (sizeof (unsigned short) * itab_elt_count); head = tail = 0; - index_in_queue_p = alloca (sizeof *index_in_queue_p * itab_elt_count); + index_in_queue_p = (char*)alloca (sizeof *index_in_queue_p * itab_elt_count); memset (index_in_queue_p, '\000', sizeof *index_in_queue_p * itab_elt_count); /* Allocate an array for RGB errors and set all entries to the maximum. */ diff --git a/src/qColorPicker.c b/src/qColorPicker.cpp similarity index 98% rename from src/qColorPicker.c rename to src/qColorPicker.cpp index f861644f..ce518a14 100644 --- a/src/qColorPicker.c +++ b/src/qColorPicker.cpp @@ -30,6 +30,8 @@ char ROMlib_rcsid_qColorPicker[] = #include #include +using namespace Executor; + /* sanity defines */ #define _NewCWindow(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \ @@ -65,7 +67,7 @@ static Rect _bounds[] = /* top, left, bottom, right */ /* color picker window bounds; filled in by `compute_bounds' */ - { CWC (-1), CWC (-1), CWC (-1), CWC (-1) }, + { CWC ((short)-1), CWC ((short)-1), CWC ((short)-1), CWC ((short)-1) }, /* ok button bounds */ { CWC (330), CWC (410), CWC (350), CWC (470) }, @@ -457,7 +459,7 @@ str_if (char *text, int len, *return_fractional = atoi (fractbuf); } -static char normal_bits[] = +static unsigned char normal_bits[] = { image_bits (00000000), image_bits (00000000), image_bits (00011111), image_bits (11000000), @@ -483,7 +485,7 @@ static char normal_bits[] = image_bits (00000000), image_bits (00000000), }; -static char lower_highlighted_bits[] = +static unsigned char lower_highlighted_bits[] = { image_bits (00000000), image_bits (00000000), image_bits (00011111), image_bits (11000000), @@ -509,7 +511,7 @@ static char lower_highlighted_bits[] = image_bits (00000000), image_bits (00000000), }; -static char upper_highlighted_bits[] = +static unsigned char upper_highlighted_bits[] = { image_bits (00000000), image_bits (00000000), image_bits (00011111), image_bits (11000000), @@ -547,13 +549,13 @@ text_box_miniarrow_update (struct text_box *box, switch (_hilite) { case miniarrow_no_hilite: - bits = normal_bits; + bits = (char*)normal_bits; break; case miniarrow_up_hilite: - bits = upper_highlighted_bits; + bits = (char*)upper_highlighted_bits; break; case miniarrow_down_hilite: - bits = lower_highlighted_bits; + bits = (char*)lower_highlighted_bits; break; } @@ -1123,10 +1125,10 @@ color_wheel_init (void) InsetRect (color_wheel_bounds, -8, -8); bpp = PIXMAP_PIXEL_SIZE (GD_PMAP (MR (MainDevice))); - color_wheel_pixmap.baseAddr = RM ((bpp == 8) - ? (Ptr) color_wheel_bits_8 + color_wheel_pixmap.baseAddr = (Ptr)RM ((bpp == 8) + ? (intptr_t)&color_wheel_bits_8 : (bpp == 4 - ? (Ptr) color_wheel_bits_4 + ? (intptr_t)&color_wheel_bits_4 : (gui_abort (), NULL))); color_wheel_pixmap.rowBytes = CW ((bpp == 8) ? 0x80D0 @@ -1298,7 +1300,7 @@ P4 (PUBLIC pascal trap, BOOLEAN, GetColor, } { - HSLColor *hsl_color = alloca (sizeof *hsl_color); + HSLColor *hsl_color = (HSLColor *)alloca (sizeof *hsl_color); red = CW (in_color->red); green = CW (in_color->green); @@ -1371,7 +1373,7 @@ P4 (PUBLIC pascal trap, BOOLEAN, GetColor, THEPORT_SAVE_EXCURSION (color_picker_window, { - Rect *dummy_rect = alloca (sizeof *dummy_rect); + Rect *dummy_rect = (Rect*)alloca (sizeof *dummy_rect); memset (dummy_rect, '\000', sizeof *dummy_rect); ok_button = NewControl (color_picker_window, diff --git a/src/qColorutil.c b/src/qColorutil.cpp similarity index 93% rename from src/qColorutil.c rename to src/qColorutil.cpp index e1a9c815..6bf83483 100644 --- a/src/qColorutil.c +++ b/src/qColorutil.cpp @@ -15,18 +15,20 @@ char ROMlib_rcsid_qColorutil[] = #include "rsys/cquick.h" #include "rsys/mman.h" +using namespace Executor; + /* ctab with `zero' as the seed; if StdBits encounters a source pixmap with this as its color table, no depth conversion will be performed */ -CTabHandle ROMlib_dont_depthconv_ctab; +CTabHandle Executor::ROMlib_dont_depthconv_ctab; /* black and white color table; element zero is always white, elt one always black this colortable is always valid */ -CTabHandle ROMlib_bw_ctab; +CTabHandle Executor::ROMlib_bw_ctab; -CTabHandle no_stdbits_color_conversion_color_table; +CTabHandle Executor::no_stdbits_color_conversion_color_table; /* fore- and back-ground color table; elt zero is always fore-ground, elt one the background @@ -43,7 +45,7 @@ static CTabHandle ROMlib_fg_bk_ctab; static CTabHandle ROMlib_relative_bw_ctab; CTabHandle -validate_fg_bk_ctab (void) +Executor::validate_fg_bk_ctab (void) { int pixel_size; PixMapHandle gd_pmap; @@ -98,7 +100,7 @@ validate_fg_bk_ctab (void) } CTabHandle -validate_relative_bw_ctab (void) +Executor::validate_relative_bw_ctab (void) { GDHandle gd; PixMapHandle gd_pmap; @@ -142,7 +144,7 @@ validate_relative_bw_ctab (void) } void -ROMlib_copy_ctab (CTabHandle src, CTabHandle dst) +Executor::ROMlib_copy_ctab (CTabHandle src, CTabHandle dst) { int ctab_size; @@ -155,7 +157,7 @@ ROMlib_copy_ctab (CTabHandle src, CTabHandle dst) } void -ROMlib_color_init (void) +Executor::ROMlib_color_init (void) { ColorSpec *bw_ctab_table; @@ -199,7 +201,7 @@ ROMlib_color_init (void) } Handle -ROMlib_copy_handle (Handle src) +Executor::ROMlib_copy_handle (Handle src) { Handle retval; int handle_size; diff --git a/src/qCursor.c b/src/qCursor.cpp similarity index 97% rename from src/qCursor.c rename to src/qCursor.cpp index 8d1584f9..756496f4 100644 --- a/src/qCursor.c +++ b/src/qCursor.cpp @@ -30,6 +30,8 @@ char ROMlib_rcsid_qCursor[] = #if !defined (CURSOR_DEBUG) +using namespace Executor; + #define HOST_SET_CURSOR(d,m,x,y) host_set_cursor (d,m,x,y) #else @@ -37,6 +39,8 @@ char ROMlib_rcsid_qCursor[] = #include "rsys/dirtyrect.h" #include "rsys/vdriver.h" +using namespace Executor; + PRIVATE void cursor_debug (const uint8 *datap, const uint8 *maskp, int hot_x, int hot_y) { @@ -79,7 +83,7 @@ static boolean_t current_cursor_valid_p = FALSE; static int current_cursor_color_p; void -cursor_reset_current_cursor (void) +Executor::cursor_reset_current_cursor (void) { current_cursor_valid_p = FALSE; if (current_cursor_color_p) @@ -142,7 +146,7 @@ P1(PUBLIC pascal trap, void, SetCursor, Cursor *, cp) data_pixmap.pmTable = RM (validate_relative_bw_ctab ()); rowbytes = (16 * host_cursor_depth) / 8; - data_baseaddr = alloca (16 * rowbytes); + data_baseaddr = (char*)alloca (16 * rowbytes); target_pixmap.baseAddr = (Ptr) RM (data_baseaddr); target_pixmap.rowBytes = CWC (rowbytes); @@ -194,6 +198,10 @@ P0(PUBLIC pascal trap, void, ShowCursor) /* IMI-168 */ CrsrState = 0; } +namespace Executor { + PRIVATE void wewantpointermovements(INTEGER); +} + A1(PRIVATE, void, wewantpointermovements, INTEGER, x) { CrsrState = CW(CW(CrsrState) + x); @@ -291,7 +299,7 @@ P1 (PUBLIC pascal trap, CCrsrHandle, GetCCursor, INTEGER, crsr_id) return ccrsr_handle; } -Rect ROMlib_cursor_rect = +Rect Executor::ROMlib_cursor_rect = { CWC (0), CWC (0), CWC (16), CWC (16), }; @@ -429,7 +437,7 @@ P1 (PUBLIC pascal trap, void, SetCCursor, { current_ccrsr = (CCrsrHandle) NewHandle (sizeof (CCrsr)); CCRSR_DATA_X (current_ccrsr) = RM (NewHandle (0)); - CCRSR_XDATA_X (current_ccrsr) = RM (NULL); + CCRSR_XDATA_X (current_ccrsr) = (Handle)RM (NULL); CCRSR_MAP_X (current_ccrsr) = RM (NewPixMap ()); }); } diff --git a/src/qGDevice.c b/src/qGDevice.cpp similarity index 86% rename from src/qGDevice.c rename to src/qGDevice.cpp index 01c0d4ac..e647fdc2 100644 --- a/src/qGDevice.c +++ b/src/qGDevice.cpp @@ -25,6 +25,8 @@ char ROMlib_rcsid_gdev[] = #include "rsys/redrawscreen.h" #include "rsys/executor.h" +using namespace Executor; + /* * determined experimentally -- this fix is needed for Energy Scheming because * they put a bogus test for mode >= 8 in their code to detect color. NOTE: @@ -54,7 +56,7 @@ mode_from_bpp (int bpp) } void -gd_allocate_main_device (void) +Executor::gd_allocate_main_device (void) { GDHandle graphics_device; @@ -81,11 +83,11 @@ gd_allocate_main_device (void) GDevices with noDriver set. Looking around Apple's site shows that - people set this bit when + people set this2 bit when they're creating offscreen gDevices. It's not clear whether or not we should - be setting this bit. + be setting this2 bit. | (1 << noDriver) */ ); gd_set_bpp (graphics_device, !vdriver_grayscale_p, vdriver_fixed_clut_p, @@ -116,72 +118,72 @@ P2 (PUBLIC pascal trap, GDHandle, NewGDevice, INTEGER, ref_num, LONGINT, mode) { - GDHandle this; + GDHandle this2; Handle h; PixMapHandle pmh; ZONE_SAVE_EXCURSION (SysZone, { - this = (GDHandle) NewHandle ((Size) sizeof (GDevice)); + this2 = (GDHandle) NewHandle ((Size) sizeof (GDevice)); - if (this == NULL) - return this; + if (this2 == NULL) + return this2; /* initialize fields; for some of these, i'm not sure what the value should be */ - GD_ID_X (this) = CWC (0); /* ??? */ + GD_ID_X (this2) = CWC (0); /* ??? */ /* CLUT graphics device by default */ - GD_TYPE_X (this) = CWC (clutType); + GD_TYPE_X (this2) = CWC (clutType); /* how do i allocate a new inverse color table? */ h = RM (NewHandle (0)); - GD_ITABLE_X (this) = (ITabHandle) h; - GD_RES_PREF_X (this) = CWC (DEFAULT_ITABLE_RESOLUTION); + GD_ITABLE_X (this2) = (ITabHandle) h; + GD_RES_PREF_X (this2) = CWC (DEFAULT_ITABLE_RESOLUTION); - GD_SEARCH_PROC_X (this) = RM (NULL); - GD_COMP_PROC_X (this) = RM (NULL); + GD_SEARCH_PROC_X (this2) = (SProcHndl)RM (NULL); + GD_COMP_PROC_X (this2) = (CProcHndl)RM (NULL); - GD_FLAGS_X (this) = CWC (0); + GD_FLAGS_X (this2) = CWC (0); /* mode_from_bpp (1) indicates b/w hardware */ if (mode != mode_from_bpp (1)) - GD_FLAGS_X (this) |= CWC (1 << gdDevType); + GD_FLAGS_X (this2) |= CWC (1 << gdDevType); pmh = RM (NewPixMap ()); - GD_PMAP_X (this) = pmh; - CTAB_FLAGS_X (PIXMAP_TABLE (GD_PMAP (this))) |= CTAB_GDEVICE_BIT_X; + GD_PMAP_X (this2) = pmh; + CTAB_FLAGS_X (PIXMAP_TABLE (GD_PMAP (this2))) |= CTAB_GDEVICE_BIT_X; - GD_REF_CON_X (this) = CWC (0); /* ??? */ - GD_REF_NUM_X (this) = CW (ref_num); /* ??? */ - GD_MODE_X (this) = CL (mode); /* ??? */ + GD_REF_CON_X (this2) = CWC (0); /* ??? */ + GD_REF_NUM_X (this2) = CW (ref_num); /* ??? */ + GD_MODE_X (this2) = CL (mode); /* ??? */ - GD_NEXT_GD_X (this) = RM (NULL); + GD_NEXT_GD_X (this2) = (GDHandle)RM (NULL); - GD_RECT (this).top = CWC (0); - GD_RECT (this).left = CWC (0); - GD_RECT (this).bottom = CWC (0); - GD_RECT (this).right = CWC (0); + GD_RECT (this2).top = CWC (0); + GD_RECT (this2).left = CWC (0); + GD_RECT (this2).bottom = CWC (0); + GD_RECT (this2).right = CWC (0); /* handle to cursor's expanded data/mask? */ - GD_CCBYTES_X (this) = CWC (0); - GD_CCDEPTH_X (this) = CWC (0); - GD_CCXDATA_X (this) = RM (NULL); - GD_CCXMASK_X (this) = RM (NULL); + GD_CCBYTES_X (this2) = CWC (0); + GD_CCDEPTH_X (this2) = CWC (0); + GD_CCXDATA_X (this2) = (Handle)RM (NULL); + GD_CCXMASK_X (this2) = (Handle)RM (NULL); - GD_RESERVED_X (this) = CWC (0); + GD_RESERVED_X (this2) = CWC (0); - /* if mode is -1, this is a user created gdevice, + /* if mode is -1, this2 is a user created gdevice, and InitGDevice () should not be called (IMV-122) */ if (mode != -1) - InitGDevice (ref_num, mode, this); + InitGDevice (ref_num, mode, this2); }); - return this; + return this2; } void -gd_set_bpp (GDHandle gd, boolean_t color_p, boolean_t fixed_p, int bpp) +Executor::gd_set_bpp (GDHandle gd, boolean_t color_p, boolean_t fixed_p, int bpp) { PixMapHandle gd_pixmap; boolean_t main_device_p = (gd == MR (MainDevice)); @@ -248,7 +250,7 @@ gd_set_bpp (GDHandle gd, boolean_t color_p, boolean_t fixed_p, int bpp) /* it seems that `gd_ref_num' describes which device to initialize, and `mode' tells it what mode to start it in - i'm not sure how this relates to NeXT/vga video hardware, for now, + i'm not sure how this2 relates to NeXT/vga video hardware, for now, we do nothing */ P3 (PUBLIC pascal trap, void, InitGDevice, INTEGER, gd_ref_num, @@ -384,7 +386,7 @@ P4 (PUBLIC pascal trap, void, DeviceLoop, if ((flags & allDevices) || !EmptyRgn (sect_rgn)) { - CToPascalCall (drawing_proc, CTOP_DeviceLoopDrawingProcTemplate, + CToPascalCall (&drawing_proc, CTOP_DeviceLoopDrawingProcTemplate, PIXMAP_PIXEL_SIZE (GD_PMAP (gd)), GD_FLAGS (gd), gd, user_data); } @@ -396,6 +398,11 @@ P4 (PUBLIC pascal trap, void, DeviceLoop, DisposeRgn (sect_rgn); } +namespace Executor { +PUBLIC pascal trap void C_DeviceLoopDrawingProcTemplate(INTEGER depth, INTEGER deviceFlags, GDHandle targetDevice, + LONGINT userData); +} + P4 (PUBLIC pascal trap, void, DeviceLoopDrawingProcTemplate, INTEGER, depth, INTEGER, deviceFlags, GDHandle, targetDevice, LONGINT, userData) @@ -454,7 +461,7 @@ P4 (PUBLIC pascal trap, OSErr, SetDepth, if (gdh != MR (MainDevice)) { warning_unexpected ("Setting the depth of a device not the screen; " - "this violates bogus assumptions in SetDepth."); + "this2 violates bogus assumptions in SetDepth."); } gd_pixmap = GD_PMAP (gdh); @@ -472,7 +479,7 @@ P4 (PUBLIC pascal trap, OSErr, SetDepth, ? !(flags & (1 << gdDevType)) : vdriver_grayscale_p))) { - /* IMV says this returns non-zero in error case; not positive + /* IMV says this2 returns non-zero in error case; not positive cDepthErr is correct; need to verify */ ShowCursor (); restore_virtual_ints (int_state); diff --git a/src/qGWorld.c b/src/qGWorld.cpp similarity index 97% rename from src/qGWorld.c rename to src/qGWorld.cpp index 9ab2265d..f98b87a1 100644 --- a/src/qGWorld.c +++ b/src/qGWorld.cpp @@ -19,10 +19,12 @@ char ROMlib_rcsid_qGWorld[] = #include "rsys/mman.h" #include "rsys/qcolor.h" +using namespace Executor; + gw_info_t *gw_info_head, *gw_info_free; void -ROMlib_InitGWorlds (void) +Executor::ROMlib_InitGWorlds (void) { gw_info_head = NULL; gw_info_free = NULL; @@ -43,26 +45,26 @@ ROMlib_InitGWorlds (void) } gw_info_t * -lookup_gw_info_by_gw (GWorldPtr gw) +Executor::lookup_gw_info_by_gw (GWorldPtr gw) { LOOKUP_GW_INFO_BY_EXPR (t->gw, gw); } gw_info_t * -lookup_gw_info_by_gw_pixmap (PixMapHandle gw_pixmap) +Executor::lookup_gw_info_by_gw_pixmap (PixMapHandle gw_pixmap) { LOOKUP_GW_INFO_BY_EXPR (t->gw_pixmap, gw_pixmap); } gw_info_t * -lookup_gw_info_by_gw_pixmap_baseaddr (void *baseaddr) +Executor::lookup_gw_info_by_gw_pixmap_baseaddr (void *baseaddr) { LOOKUP_GW_INFO_BY_EXPR (PIXMAP_BASEADDR (t->gw_pixmap), baseaddr); } gw_info_t * -lookup_gw_info_by_gw_gd_pixmap (PixMapHandle gw_gd_pixmap) +Executor::lookup_gw_info_by_gw_gd_pixmap (PixMapHandle gw_gd_pixmap) { LOOKUP_GW_INFO_BY_EXPR (t->gw_gd_pixmap, gw_gd_pixmap); @@ -152,7 +154,7 @@ P6 (PUBLIC pascal trap, QDErr, NewGWorld, if (bounds->top || bounds->left) { - Rect *temp_bounds = alloca (sizeof *temp_bounds); + Rect *temp_bounds = (Rect*)alloca (sizeof *temp_bounds); temp_bounds->bottom = CW (RECT_HEIGHT (bounds)); temp_bounds->right = CW (RECT_WIDTH (bounds)); @@ -407,7 +409,7 @@ P6 (PUBLIC pascal trap, GWorldFlags, UpdateGWorld, does */ if (bounds->top || bounds->left) { - Rect *temp_bounds = alloca (sizeof *temp_bounds); + Rect *temp_bounds = (Rect*)alloca (sizeof *temp_bounds); *temp_bounds = *bounds; OffsetRect (temp_bounds, diff --git a/src/qGrafport.c b/src/qGrafport.cpp similarity index 97% rename from src/qGrafport.c rename to src/qGrafport.cpp index fad5b2a6..7622e359 100644 --- a/src/qGrafport.c +++ b/src/qGrafport.cpp @@ -21,6 +21,8 @@ char ROMlib_rcsid_qGrafport[] = #include "rsys/cquick.h" #include "rsys/picture.h" +using namespace Executor; + P1(PUBLIC pascal trap, void, InitGraf, Ptr, gp) { PixMapHandle main_gd_pixmap; @@ -107,10 +109,10 @@ A1(PUBLIC, void, ROMlib_initport, GrafPtr, p) /* INTERNAL */ PORT_BK_COLOR_X (p) = CLC (whiteColor); PORT_COLR_BIT_X (p) = CWC (0); PORT_PAT_STRETCH_X (p) = CWC (0); - PORT_PIC_SAVE_X (p) = CLC (0); - PORT_REGION_SAVE_X (p) = CLC (0); - PORT_POLY_SAVE_X (p) = CLC (0); - PORT_GRAF_PROCS_X (p) = CLC (0); + PORT_PIC_SAVE_X (p) = (Handle)CLC(0); + PORT_REGION_SAVE_X (p) = (Handle)CLC(0); + PORT_POLY_SAVE_X (p) = (Handle)CLC(0); + PORT_GRAF_PROCS_X (p) = (QDProcsPtr)CLC(0); } P1(PUBLIC pascal trap, void, SetPort, GrafPtr, p) diff --git a/src/qHooks.c b/src/qHooks.cpp similarity index 74% rename from src/qHooks.c rename to src/qHooks.cpp index e086701c..b62c2d23 100644 --- a/src/qHooks.c +++ b/src/qHooks.cpp @@ -14,25 +14,27 @@ char ROMlib_rcsid_qHooks[] = #include "rsys/print.h" #include "rsys/options.h" +using namespace Executor; + #if defined (BINCOMPAT) PRIVATE boolean_t text_is_enabled_p = TRUE; PUBLIC void -disable_stdtext (void) +Executor::disable_stdtext (void) { if (ROMlib_options & ROMLIB_TEXT_DISABLE_BIT) text_is_enabled_p = FALSE; } PUBLIC void -enable_stdtext (void) +Executor::enable_stdtext (void) { text_is_enabled_p = TRUE; } void -ROMlib_CALLTEXT (INTEGER bc, Ptr bufp, Point num, Point den) +Executor::ROMlib_CALLTEXT (INTEGER bc, Ptr bufp, Point num, Point den) { QDProcsPtr gp; pascal trap void (*pp) (INTEGER, Ptr, Point, Point); @@ -44,7 +46,7 @@ ROMlib_CALLTEXT (INTEGER bc, Ptr bufp, Point num, Point den) { ROMlib_hook (q_textprocnumber); HOOKSAVEREGS (); - CToPascalCall (pp, CTOP_StdText, bc, bufp, num, den); + CToPascalCall (&pp, CTOP_StdText, bc, bufp, num, den); HOOKRESTOREREGS (); } else @@ -54,7 +56,7 @@ ROMlib_CALLTEXT (INTEGER bc, Ptr bufp, Point num, Point den) void -ROMlib_CALLLINE (Point p) +Executor::ROMlib_CALLLINE (Point p) { QDProcsPtr gp; pascal trap void (*pp) (Point); @@ -64,7 +66,7 @@ ROMlib_CALLLINE (Point p) { ROMlib_hook (q_lineprocnumber); HOOKSAVEREGS (); - CToPascalCall (pp, CTOP_StdLine, p); + CToPascalCall (&pp, CTOP_StdLine, p); HOOKRESTOREREGS (); } else @@ -73,7 +75,7 @@ ROMlib_CALLLINE (Point p) void -ROMlib_CALLRECT (GrafVerb v, Rect * rp) +Executor::ROMlib_CALLRECT (GrafVerb v, Rect * rp) { QDProcsPtr gp; pascal trap void (*pp) (GrafVerb, Rect *); @@ -83,7 +85,7 @@ ROMlib_CALLRECT (GrafVerb v, Rect * rp) { ROMlib_hook (q_rectprocnumber); HOOKSAVEREGS (); - CToPascalCall (pp, CTOP_StdRect, v, rp); + CToPascalCall (&pp, CTOP_StdRect, v, rp); HOOKRESTOREREGS (); } else @@ -92,7 +94,7 @@ ROMlib_CALLRECT (GrafVerb v, Rect * rp) void -ROMlib_CALLOVAL (GrafVerb v, Rect * rp) +Executor::ROMlib_CALLOVAL (GrafVerb v, Rect * rp) { QDProcsPtr gp; pascal trap void (*pp) (GrafVerb, Rect *); @@ -102,7 +104,7 @@ ROMlib_CALLOVAL (GrafVerb v, Rect * rp) { ROMlib_hook (q_ovalprocnumber); HOOKSAVEREGS (); - CToPascalCall (pp, CTOP_StdOval, v, rp); + CToPascalCall (&pp, CTOP_StdOval, v, rp); HOOKRESTOREREGS (); } else @@ -111,7 +113,7 @@ ROMlib_CALLOVAL (GrafVerb v, Rect * rp) void -ROMlib_CALLRRECT (GrafVerb v, Rect * rp, INTEGER ow, INTEGER oh) +Executor::ROMlib_CALLRRECT (GrafVerb v, Rect * rp, INTEGER ow, INTEGER oh) { QDProcsPtr gp; pascal trap void (*pp) (GrafVerb, Rect *, INTEGER, INTEGER); @@ -121,7 +123,7 @@ ROMlib_CALLRRECT (GrafVerb v, Rect * rp, INTEGER ow, INTEGER oh) { ROMlib_hook (q_rrectprocnumber); HOOKSAVEREGS (); - CToPascalCall (pp, CTOP_StdRRect, v, rp, ow, oh); + CToPascalCall (&pp, CTOP_StdRRect, v, rp, ow, oh); HOOKRESTOREREGS (); } else @@ -130,7 +132,7 @@ ROMlib_CALLRRECT (GrafVerb v, Rect * rp, INTEGER ow, INTEGER oh) void -ROMlib_CALLARC (GrafVerb v, Rect * rp, INTEGER starta, INTEGER arca) +Executor::ROMlib_CALLARC (GrafVerb v, Rect * rp, INTEGER starta, INTEGER arca) { QDProcsPtr gp; pascal trap void (*pp) (GrafVerb, Rect *, INTEGER, INTEGER); @@ -140,7 +142,7 @@ ROMlib_CALLARC (GrafVerb v, Rect * rp, INTEGER starta, INTEGER arca) { ROMlib_hook (q_arcprocnumber); HOOKSAVEREGS (); - CToPascalCall (pp, CTOP_StdArc, v, rp, starta, arca); + CToPascalCall (&pp, CTOP_StdArc, v, rp, starta, arca); HOOKRESTOREREGS (); } else @@ -150,7 +152,7 @@ ROMlib_CALLARC (GrafVerb v, Rect * rp, INTEGER starta, INTEGER arca) void -ROMlib_CALLRGN (GrafVerb v, RgnHandle rh) +Executor::ROMlib_CALLRGN (GrafVerb v, RgnHandle rh) { QDProcsPtr gp; pascal trap void (*pp) (GrafVerb, RgnHandle); @@ -160,7 +162,7 @@ ROMlib_CALLRGN (GrafVerb v, RgnHandle rh) { ROMlib_hook (q_rgnprocnumber); HOOKSAVEREGS (); - CToPascalCall (pp, CTOP_StdRgn, v, rh); + CToPascalCall (&pp, CTOP_StdRgn, v, rh); HOOKRESTOREREGS (); } else @@ -169,7 +171,7 @@ ROMlib_CALLRGN (GrafVerb v, RgnHandle rh) void -ROMlib_CALLPOLY (GrafVerb v, PolyHandle rh) +Executor::ROMlib_CALLPOLY (GrafVerb v, PolyHandle rh) { QDProcsPtr gp; pascal trap void (*pp) (GrafVerb, PolyHandle); @@ -179,7 +181,7 @@ ROMlib_CALLPOLY (GrafVerb v, PolyHandle rh) { ROMlib_hook (q_polyprocnumber); HOOKSAVEREGS (); - CToPascalCall (pp, CTOP_StdPoly, v, rh); + CToPascalCall (&pp, CTOP_StdPoly, v, rh); HOOKRESTOREREGS (); } else @@ -188,7 +190,7 @@ ROMlib_CALLPOLY (GrafVerb v, PolyHandle rh) void -ROMlib_CALLBITS (BitMap * bmp, const Rect *srcrp, const Rect *dstrp, +Executor::ROMlib_CALLBITS (BitMap * bmp, const Rect *srcrp, const Rect *dstrp, INTEGER mode, RgnHandle maskrh) { QDProcsPtr gp; @@ -199,7 +201,7 @@ ROMlib_CALLBITS (BitMap * bmp, const Rect *srcrp, const Rect *dstrp, { ROMlib_hook (q_bitsprocnumber); HOOKSAVEREGS (); - CToPascalCall (pp, CTOP_StdBits, bmp, srcrp, dstrp, mode, maskrh); + CToPascalCall (&pp, CTOP_StdBits, bmp, srcrp, dstrp, mode, maskrh); HOOKRESTOREREGS (); } else @@ -208,7 +210,7 @@ ROMlib_CALLBITS (BitMap * bmp, const Rect *srcrp, const Rect *dstrp, void -ROMlib_CALLCOMMENT (INTEGER kind, INTEGER size, Handle datah) +Executor::ROMlib_CALLCOMMENT (INTEGER kind, INTEGER size, Handle datah) { QDProcsPtr gp; pascal trap void (*pp) (INTEGER, INTEGER, Handle); @@ -218,7 +220,7 @@ ROMlib_CALLCOMMENT (INTEGER kind, INTEGER size, Handle datah) { ROMlib_hook (q_commentprocnumber); HOOKSAVEREGS (); - CToPascalCall (pp, CTOP_StdComment, kind, size, datah); + CToPascalCall (&pp, CTOP_StdComment, kind, size, datah); HOOKRESTOREREGS (); } else @@ -227,7 +229,7 @@ ROMlib_CALLCOMMENT (INTEGER kind, INTEGER size, Handle datah) INTEGER -ROMlib_CALLTXMEAS (INTEGER bc, Ptr bufp, Point * nump, Point * denp, +Executor::ROMlib_CALLTXMEAS (INTEGER bc, Ptr bufp, Point * nump, Point * denp, FontInfo * fip) { QDProcsPtr gp; @@ -239,7 +241,7 @@ ROMlib_CALLTXMEAS (INTEGER bc, Ptr bufp, Point * nump, Point * denp, { ROMlib_hook (q_txmeasprocnumber); HOOKSAVEREGS (); - retval = CToPascalCall (pp, CTOP_StdTxMeas, bc, bufp, + retval = CToPascalCall (&pp, CTOP_StdTxMeas, bc, bufp, nump, denp, fip); HOOKRESTOREREGS (); } @@ -250,7 +252,7 @@ ROMlib_CALLTXMEAS (INTEGER bc, Ptr bufp, Point * nump, Point * denp, void -ROMlib_PICWRITE (Ptr addr, INTEGER count) +Executor::ROMlib_PICWRITE (Ptr addr, INTEGER count) { QDProcsPtr gp; pascal trap void (*pp) (Ptr, INTEGER); @@ -260,7 +262,7 @@ ROMlib_PICWRITE (Ptr addr, INTEGER count) { ROMlib_hook (q_putpicprocnumber); HOOKSAVEREGS (); - CToPascalCall (pp, CTOP_StdPutPic, addr, count); + CToPascalCall (&pp, CTOP_StdPutPic, addr, count); HOOKRESTOREREGS (); } else diff --git a/src/qIMIV.c b/src/qIMIV.cpp similarity index 96% rename from src/qIMIV.c rename to src/qIMIV.cpp index 84e88fee..d6358958 100644 --- a/src/qIMIV.c +++ b/src/qIMIV.cpp @@ -26,7 +26,11 @@ char ROMlib_rcsid_qIMIV[] = #undef ALLOCA #define ALLOCA(n) SAFE_alloca(n) -#include "seedtables.c" +namespace Executor { +#include "seedtables.ctable" +} + +using namespace Executor; #define DOLEFT 1 #define DORIGHT 2 @@ -40,6 +44,11 @@ typedef struct { typedef enum { Copy, Xor, Negate } transferop; +namespace Executor { + PRIVATE void transfer(INTEGER*, INTEGER*, INTEGER, INTEGER, INTEGER,INTEGER, transferop); + PRIVATE void xSeedFill(unsigned char *, unsigned char *, INTEGER, INTEGER, INTEGER, INTEGER, BOOLEAN, INTEGER, INTEGER); +} + A7(PRIVATE, void, transfer, INTEGER *, srcp, INTEGER *, dstp, INTEGER, srcr, INTEGER, dstr, INTEGER, height, INTEGER, widthw, transferop, op) { @@ -351,13 +360,13 @@ copy_mask_1 (BitMap *src_bm, BitMap *mask_bm, BitMap *dst_bm, save_pic_handle = PORT_PIC_SAVE_X (thePort); save_graf_procs = (Handle) PORT_GRAF_PROCS_X (thePort); - PORT_PIC_SAVE_X (thePort) = RM (NULL); - PORT_GRAF_PROCS_X (thePort) = RM (NULL); + PORT_PIC_SAVE_X (thePort) = (Handle)RM (NULL); + PORT_GRAF_PROCS_X (thePort) = (QDProcsPtr)RM (NULL); CopyBits (src_bm, dst_bm, src_rect, dst_rect, srcCopy, mask_rgn); PORT_PIC_SAVE_X (thePort) = save_pic_handle; - PORT_GRAF_PROCS_X (thePort) = (void *) save_graf_procs; + PORT_GRAF_PROCS_X (thePort) = (QDProcsPtr) save_graf_procs; DisposeRgn (mask_rect_rgn); DisposeRgn (mask_rgn); @@ -416,7 +425,7 @@ P6 (PUBLIC pascal trap, void, CopyMask, /* IMIV-24 */ row_bytes = (RECT_WIDTH (mask_rect) + 31) / 32 * 4; TEMP_ALLOC_ALLOCATE (mask_bits, temp_mask_bits, row_bytes * RECT_HEIGHT (mask_rect)); - mask_bm.baseAddr = RM (mask_bits); + mask_bm.baseAddr = (Ptr)RM (mask_bits); mask_bm.rowBytes = CW (row_bytes); mask_bm.bounds = *mask_rect; diff --git a/src/qIMV.c b/src/qIMV.cpp similarity index 94% rename from src/qIMV.c rename to src/qIMV.cpp index 8289162c..98e355a0 100644 --- a/src/qIMV.c +++ b/src/qIMV.cpp @@ -17,6 +17,8 @@ char ROMlib_rcsid_qIMV[] = #include "rsys/cquick.h" #include "rsys/tempalloc.h" +using namespace Executor; + /* these stubs are here to make my Pic V2 code work */ P1(PUBLIC pascal trap, void, CharExtra, Fixed, Extra) /* IMV-77 */ @@ -189,7 +191,7 @@ default_search_proc_stub (syn68k_addr_t dummy_addr, void *dummy) arg2 = (void *) POPADDR (); arg1 = (void *) POPADDR (); - result = default_search_proc (arg1, arg2); + result = default_search_proc ((RGBColor*)arg1, (int32*)arg2); WRITEUB (EM_A7, result); return retval; @@ -237,9 +239,9 @@ P8 (PUBLIC pascal trap, void, SeedCFill, BitMap *, srcbp, BitMap *, dstbp, save_pic_handle = PORT_PIC_SAVE_X (thePort); save_graf_procs = PORT_GRAF_PROCS_X (thePort); - PORT_PIC_SAVE_X (thePort) = CLC (0); - PORT_GRAF_PROCS_X (thePort) = CLC (0); - GD_SEARCH_PROC_X (gdev) = CLC (0); + PORT_PIC_SAVE_X (thePort) = (Handle)CLC (0); + PORT_GRAF_PROCS_X (thePort) = (QDProcsPtr)CLC (0); + GD_SEARCH_PROC_X (gdev) = (SProcHndl)CLC (0); AddSearch (matchprocp); width = RECT_WIDTH (srcrp); @@ -252,7 +254,7 @@ P8 (PUBLIC pascal trap, void, SeedCFill, BitMap *, srcbp, BitMap *, dstbp, row_words = (width + 15) / 16; temp_bitmap1.rowBytes = CW (row_words * 2); TEMP_ALLOC_ALLOCATE (t, temp_bitmap1_bits, row_words * 2 * height); - temp_bitmap1.baseAddr = RM (t); + temp_bitmap1.baseAddr = (Ptr)RM (t); memset (MR (temp_bitmap1.baseAddr), '\377', row_words * 2 * height); temp_bitmap1.bounds = temp_rect; @@ -263,7 +265,7 @@ P8 (PUBLIC pascal trap, void, SeedCFill, BitMap *, srcbp, BitMap *, dstbp, temp_bitmap2 = temp_bitmap1; TEMP_ALLOC_ALLOCATE (t, temp_bitmap2_bits, row_words * 2 * height); - temp_bitmap2.baseAddr = RM (t); + temp_bitmap2.baseAddr = (Ptr)RM (t); SeedFill (MR (temp_bitmap1.baseAddr), MR (temp_bitmap2.baseAddr), @@ -318,9 +320,9 @@ P7 (PUBLIC pascal trap, void, CalcCMask, BitMap *, srcbp, BitMap *, dstbp, save_pic_handle = PORT_PIC_SAVE_X (thePort); save_graf_procs = PORT_GRAF_PROCS_X (thePort); - PORT_PIC_SAVE_X (thePort) = CLC (0); - PORT_GRAF_PROCS_X (thePort) = CLC (0); - GD_SEARCH_PROC_X (gdev) = CLC (0); + PORT_PIC_SAVE_X (thePort) = (Handle)CLC (0); + PORT_GRAF_PROCS_X (thePort) = (QDProcsPtr)CLC (0); + GD_SEARCH_PROC_X (gdev) = (SProcHndl)CLC (0); AddSearch (matchprocp); width = RECT_WIDTH (srcrp); @@ -333,7 +335,7 @@ P7 (PUBLIC pascal trap, void, CalcCMask, BitMap *, srcbp, BitMap *, dstbp, row_words = (width + 15) / 16; temp_bitmap1.rowBytes = CW (row_words * 2); TEMP_ALLOC_ALLOCATE (t, temp_bitmap1_bits, row_words * 2 * height); - temp_bitmap1.baseAddr = RM (t); + temp_bitmap1.baseAddr = (Ptr)RM (t); memset (MR (temp_bitmap1.baseAddr), '\377', row_words * 2 * height); temp_bitmap1.bounds = temp_rect; @@ -344,7 +346,7 @@ P7 (PUBLIC pascal trap, void, CalcCMask, BitMap *, srcbp, BitMap *, dstbp, temp_bitmap2 = temp_bitmap1; TEMP_ALLOC_ALLOCATE (t, temp_bitmap2_bits, row_words * 2 * height); - temp_bitmap2.baseAddr = RM (t); + temp_bitmap2.baseAddr = (Ptr)RM (t); CalcMask (MR (temp_bitmap1.baseAddr), MR (temp_bitmap2.baseAddr), diff --git a/src/qIMVI.c b/src/qIMVI.cpp similarity index 97% rename from src/qIMVI.c rename to src/qIMVI.cpp index b8415c7e..eaa71be5 100644 --- a/src/qIMVI.c +++ b/src/qIMVI.cpp @@ -18,7 +18,9 @@ char ROMlib_rcsid_qIMVI[] = #include "rsys/region.h" #include "rsys/picture.h" -#include "sspairtable.c" +#include "sspairtable.ctable" + +using namespace Executor; /* * Basically a region is just a bunch of stop start pairs where the pairs @@ -87,7 +89,7 @@ P2 (PUBLIC pascal trap, OSErr, BitMapToRegion, RgnHandle, rh, scruffmask = 0xFF << (8 - ((right - left) % 8)); if (!scruffmask) scruffmask = 0xFF; - zeroline = alloca (linelen); + zeroline = (unsigned char*)alloca (linelen); memset (zeroline, 0, linelen); line0p = zeroline; diff --git a/src/qIMVxfer.c b/src/qIMVxfer.cpp similarity index 96% rename from src/qIMVxfer.c rename to src/qIMVxfer.cpp index f12beb45..f91da2cc 100644 --- a/src/qIMVxfer.c +++ b/src/qIMVxfer.cpp @@ -13,21 +13,23 @@ char ROMlib_rcsid_qIMVxfer[] = #include "CQuickDraw.h" #include "rsys/cquick.h" +using namespace Executor; + /* Helper function: creates a new, sorted table so the value is the * same as the index (although we don't bother filling in most of the * color table fields). */ static CTabPtr -sort_table (CTabPtr old, CTabPtr new, unsigned max_color) +sort_table (CTabPtr old, CTabPtr new1, unsigned max_color) { int i; - memset (&new->ctTable, 0, (max_color + 1) * sizeof (ColorSpec)); + memset (&new1->ctTable, 0, (max_color + 1) * sizeof (ColorSpec)); for (i = CW (old->ctSize); i >= 0; i--) - new->ctTable[CW (old->ctTable[i].value) & max_color].rgb = + new1->ctTable[CW (old->ctTable[i].value) & max_color].rgb = old->ctTable[i].rgb; - return new; + return new1; } /* declare a case in the transform switch */ @@ -94,7 +96,7 @@ sort_table (CTabPtr old, CTabPtr new, unsigned max_color) break void -convert_transparent (const PixMap *src1, const PixMap *src2, +Executor::convert_transparent (const PixMap *src1, const PixMap *src2, PixMap *dst, const Rect *r1, const Rect *r2, int16 mode, @@ -363,7 +365,7 @@ convert_transparent (const PixMap *src1, const PixMap *src2, * function. */ void -convert_pixmap_with_IMV_mode (const PixMap *src1, const PixMap *src2, +Executor::convert_pixmap_with_IMV_mode (const PixMap *src1, const PixMap *src2, PixMap *dst, CTabHandle src1_ctabh, CTabHandle src2_ctabh, ITabHandle itabh, @@ -578,7 +580,7 @@ convert_pixmap_with_IMV_mode (const PixMap *src1, const PixMap *src2, #define RGB_TO_DIRECT_PIXEL(bpp, red, green, blue, pixel) \ ((void) \ ({ \ - RGBColor color = { red, green, blue }; \ + RGBColor color = { (unsigned short)red, (unsigned short)green, (unsigned short)blue }; \ \ (pixel) = ((*rgb_spec->rgbcolor_to_pixel) \ (rgb_spec, &color, FALSE)); \ @@ -587,8 +589,8 @@ convert_pixmap_with_IMV_mode (const PixMap *src1, const PixMap *src2, #define RGB_TO_PIXEL(bpp, red, green, blue, pixel) \ ((void) \ ((bpp) == 32 || (bpp) == 16 \ - ? RGB_TO_DIRECT_PIXEL (bpp, red, green, blue, pixel) \ - : RGB_TO_INDIRECT_PIXEL (red, green, blue, pixel))) + ? (void)RGB_TO_DIRECT_PIXEL (bpp, (unsigned short)red, (unsigned short)green, (unsigned short)blue, pixel) \ + : (void)RGB_TO_INDIRECT_PIXEL (red, green, blue, pixel))) #define NONPAT_NEXT1 src1_row_base += src1_rowbytes #define PAT_NEXT1 \ diff --git a/src/qMisc.c b/src/qMisc.cpp similarity index 98% rename from src/qMisc.c rename to src/qMisc.cpp index a36a7938..2f4d8792 100644 --- a/src/qMisc.c +++ b/src/qMisc.cpp @@ -21,6 +21,13 @@ char ROMlib_rcsid_qMisc[] = #include "rsys/glue.h" #include "rsys/region.h" +using namespace Executor; + +namespace Executor { + static BOOLEAN EquivRect(Rect*, Rect*); + static INTEGER fromhex(char c); +} + A2(PRIVATE, BOOLEAN, EquivRect, Rect *, rp1, Rect *, rp2) { return Cx(rp1->bottom) - Cx(rp1->top) == Cx(rp2->bottom) - Cx(rp2->top) && diff --git a/src/qPaletteMgr.c b/src/qPaletteMgr.cpp similarity index 98% rename from src/qPaletteMgr.c rename to src/qPaletteMgr.cpp index 25f140dd..832bba33 100644 --- a/src/qPaletteMgr.c +++ b/src/qPaletteMgr.cpp @@ -24,6 +24,8 @@ char ROMlib_rcsid_qPaletteMgr[] = #include "rsys/vdriver.h" #include "rsys/dirtyrect.h" +using namespace Executor; + #define GD_CLUT_P(gd) (GD_TYPE_X (gd) == CWC (clutType)) #define CI_ALLOCATED_BIT_X CLC (0x80000000) @@ -101,10 +103,10 @@ lookup_pm_resource_holders (void) { max_resource_holders = 4; pm_resource_holders - = realloc (pm_resource_holders, (max_resource_holders + = (pm_resource_holder_t**)realloc (pm_resource_holders, (max_resource_holders * sizeof *pm_resource_holders)); device_to_resholder - = realloc (device_to_resholder, (max_resource_holders + = (GDHandle*)realloc (device_to_resholder, (max_resource_holders * sizeof *device_to_resholder)); index = n_resource_holders ++; } @@ -113,10 +115,10 @@ lookup_pm_resource_holders (void) { max_resource_holders *= 2; pm_resource_holders - = realloc (pm_resource_holders, (max_resource_holders + = (pm_resource_holder_t**)realloc (pm_resource_holders, (max_resource_holders * sizeof *pm_resource_holders)); device_to_resholder - = realloc (device_to_resholder, (max_resource_holders + = (GDHandle*)realloc (device_to_resholder, (max_resource_holders * sizeof *device_to_resholder)); index = n_resource_holders ++; } @@ -127,7 +129,7 @@ lookup_pm_resource_holders (void) device_to_resholder[index] = MR (TheGDevice); pm_resource_holders[index] - = malloc (256 * sizeof *pm_resource_holders[index]); + = (pm_resource_holder_t*)malloc (256 * sizeof *pm_resource_holders[index]); return pm_resource_holders[index]; } @@ -919,7 +921,7 @@ P1 (PUBLIC pascal trap, PaletteHandle, GetNewPalette, INTEGER, id) } void -pm_front_window_maybe_changed_hook (void) +Executor::pm_front_window_maybe_changed_hook (void) { WindowPtr t_w; @@ -933,7 +935,7 @@ pm_front_window_maybe_changed_hook (void) /* called when window `w' is deleted */ void -pm_window_closed (WindowPtr w) +Executor::pm_window_closed (WindowPtr w) { PaletteHandle palette; window_palette_alist_t t, prev; @@ -1155,7 +1157,7 @@ P3 (PUBLIC pascal trap, void, NSetPalette, INTEGER, nc_update) { set_palette_common (dst_window, src_palette, - nc_update & 0xff ? pmAllUpdates : nc_update); + (pmUpdates)(nc_update & 0xff ? pmAllUpdates : nc_update)); } P2 (PUBLIC pascal trap, void, SetPaletteUpdates, diff --git a/src/qPen.c b/src/qPen.cpp similarity index 97% rename from src/qPen.c rename to src/qPen.cpp index 7d72f6ad..ecc703f1 100644 --- a/src/qPen.c +++ b/src/qPen.cpp @@ -17,6 +17,8 @@ char ROMlib_rcsid_qPen[] = #include "rsys/cquick.h" #include "rsys/picture.h" +using namespace Executor; + P0(PUBLIC pascal trap, void, HidePen) { if (thePortX) @@ -89,7 +91,7 @@ P1(PUBLIC pascal trap, void, SetPenState, PenState *, ps) } void -draw_state_save (draw_state_t *draw_state) +Executor::draw_state_save (draw_state_t *draw_state) { GrafPtr current_port; @@ -111,7 +113,7 @@ draw_state_save (draw_state_t *draw_state) } void -draw_state_restore (draw_state_t *draw_state) +Executor::draw_state_restore (draw_state_t *draw_state) { GrafPtr current_port; diff --git a/src/qPicstuff.c b/src/qPicstuff.cpp similarity index 95% rename from src/qPicstuff.c rename to src/qPicstuff.cpp index 3d992270..2d42eccb 100644 --- a/src/qPicstuff.c +++ b/src/qPicstuff.cpp @@ -28,6 +28,8 @@ char ROMlib_rcsid_qPicstuff[] = #include "rsys/print.h" #include "rsys/executor.h" +using namespace Executor; + /* * Hooray for static variables. We have to do something like this because * the StdGetPic routine doesn't actually supply a source byte pointer. @@ -50,6 +52,17 @@ typedef struct { LONGINT argcode; } wps; +typedef struct assoc_link +{ + struct assoc_link *nextp; + StringPtr str; + INTEGER i; +} +assoc_link_t; + +PRIVATE assoc_link_t *assoc_headp = 0; + + /* * The top four bits that are used to describe how an opcode behaves are an * encoded form of which of the operands (described in the remaining 28 bits) @@ -128,6 +141,14 @@ PRIVATE unsigned short scalevalues[16] = { #define ARGMASK 0x0FFFFFFF /* everything except the scale bits */ +namespace Executor { + PRIVATE void nop(); + PRIVATE void thepat(Pattern * p); + PRIVATE void txratio(Point num, Point den); + PRIVATE void line(Point op, Point np); + PRIVATE void shrtline(Point op, SignedByte dh, SignedByte dv); +} + A0(PRIVATE, void, nop) { } @@ -228,6 +249,43 @@ PRIVATE void setnumerdenom(Point *nump, Point *denp) denp->v = denomv; } +namespace Executor { + PRIVATE void longtext(Point,StringPtr,Point*); + PRIVATE void dhtext(unsigned char, StringPtr, Point*); + PRIVATE void defhilite(); + PRIVATE void dvtext(unsigned char, StringPtr, Point*); + PRIVATE void fillrct(Rect *r); + PRIVATE void dhdvtext(Byte dh, Byte dv, + StringPtr s, Point *pp); + PRIVATE void fillrrct(Rect *r, INTEGER ow, INTEGER oh); + PRIVATE void fillovl(Rect *r); + PRIVATE void fillarc(Rect *r, INTEGER stang, INTEGER arcang); + PRIVATE void fillpoly(PolyHandle p); + PRIVATE void fillrgn(RgnHandle r); + PRIVATE void origin(INTEGER dh, INTEGER dv); + PRIVATE void pnlochfrac(INTEGER f); + PRIVATE void myreadcment(INTEGER kind); + PRIVATE void defhilite(); + PRIVATE void hilitemode(); + PRIVATE void fillpixpat(PixPatHandle ph); + PRIVATE void pnsize(INTEGER pv, INTEGER ph); + PRIVATE void textface(Byte f); + PRIVATE void charextra(INTEGER extra); + PRIVATE void shrtlinefrom(SignedByte dh, SignedByte dv); + PRIVATE void setpicclip(RgnHandle rh); + PRIVATE void eatRegion(RgnHandle rh, Size hs); + PRIVATE void eatRect(Rect *rp); + PRIVATE void eatPixMap(register PixMapPtr pixp, INTEGER rowb); + PRIVATE void eatBitMap(BitMap * bp, INTEGER rowb); + PRIVATE Size eatpixdata(PixMapPtr pixmap, BOOLEAN * freep); + PRIVATE void eatbitdata(register BitMap * bp, BOOLEAN packed); + PRIVATE void eatRGBColor(RGBColor * rgbp); + PRIVATE void eatColorTable(register PixMapPtr pixmap); + PRIVATE void eatPattern(Pattern pat); + PRIVATE void eatPixPat(PixPatHandle pixpat); + PRIVATE unsigned short nextop(INTEGER vers); +} + A3(PRIVATE, void, longtext, Point, pt, StringPtr, s, Point *, pp) { Point save, numer, denom; @@ -391,16 +449,6 @@ PRIVATE void W_BackPat( Pattern pp ) /* routines that associate a PICT font number with a font name */ -typedef struct assoc_link -{ - struct assoc_link *nextp; - StringPtr str; - INTEGER i; -} -assoc_link_t; - -PRIVATE assoc_link_t *assoc_headp = 0; - PRIVATE void begin_assoc (void) { @@ -438,7 +486,7 @@ makestr (StringPtr sp) int len; len = sp[0] + 1; - retval = malloc (len); + retval = (StringPtr)malloc (len); memcpy (retval, sp, len); return retval; } @@ -455,7 +503,7 @@ add_assoc (INTEGER i, StringPtr sp) { assoc_link_t *p; - p = malloc (sizeof *p); + p = (assoc_link_t *)malloc (sizeof *p); p->nextp = 0; p->str = makestr (sp); p->i = i; @@ -947,7 +995,7 @@ PRIVATE Byte eatByte() Byte retval; if (procp) - CToPascalCall(procp, CTOP_StdGetPic, &retval, sizeof(Byte)); + CToPascalCall(&procp, CTOP_StdGetPic, &retval, sizeof(Byte)); else retval = *nextbytep; ++nextbytep; @@ -959,7 +1007,7 @@ PRIVATE INTEGER eatINTEGERX() INTEGER retval; if (procp) - CToPascalCall(procp, CTOP_StdGetPic, &retval, sizeof(INTEGER)); + CToPascalCall(&procp, CTOP_StdGetPic, &retval, sizeof(INTEGER)); else retval = *(INTEGER *)nextbytep; nextbytep += sizeof(INTEGER); @@ -979,7 +1027,7 @@ PRIVATE LONGINT eatLONGINTX() LONGINT retval; if (procp) - CToPascalCall(procp, CTOP_StdGetPic, &retval, sizeof(LONGINT)); + CToPascalCall(&procp, CTOP_StdGetPic, &retval, sizeof(LONGINT)); else retval = *(LONGINT *)nextbytep; nextbytep += sizeof(LONGINT); @@ -998,7 +1046,7 @@ PRIVATE void eatString(Str255 str) { str[0] = eatByte(); if (procp) - CToPascalCall(procp, CTOP_StdGetPic, str+1, str[0]); + CToPascalCall(&procp, CTOP_StdGetPic, str+1, str[0]); else BlockMove((Ptr) nextbytep, (Ptr) str+1, str[0]); nextbytep += str[0]; @@ -1011,7 +1059,7 @@ PRIVATE void eatNBytes(LONGINT n) if (procp) { TEMP_ALLOC_DECL (temp_alloc_space); TEMP_ALLOC_ALLOCATE (bufp, temp_alloc_space, n); - CToPascalCall(procp, CTOP_StdGetPic, bufp, n); + CToPascalCall(&procp, CTOP_StdGetPic, bufp, n); TEMP_ALLOC_FREE (temp_alloc_space); } nextbytep += n; @@ -1025,7 +1073,7 @@ A2(PRIVATE, void, eatRegion, RgnHandle, rh, Size, hs) if (procp) { state = HGetState((Handle) rh); HLock((Handle) rh); - CToPascalCall(procp, CTOP_StdGetPic, (Ptr) STARH(rh) + sizeof(INTEGER), + CToPascalCall(&procp, CTOP_StdGetPic, (Ptr) STARH(rh) + sizeof(INTEGER), hs - sizeof(INTEGER)); HSetState((Handle) rh, state); } else @@ -1127,7 +1175,7 @@ A2(PRIVATE, Size, eatpixdata, PixMapPtr, pixmap, BOOLEAN *, freep) HLock (h); if (procp) - CToPascalCall (procp, CTOP_StdGetPic, STARH (h), pic_data_size); + CToPascalCall (&procp, CTOP_StdGetPic, STARH (h), pic_data_size); else if (pixmap->packType == CWC (2)) memcpy (STARH (h), nextbytep, pic_data_size); @@ -1159,7 +1207,7 @@ A2(PRIVATE, Size, eatpixdata, PixMapPtr, pixmap, BOOLEAN *, freep) HLock(h); pixmap->baseAddr = (*h).p; /* can't use STARH 'cause we don't */ /* want to byte swap the result */ - temp_scanline = alloca (rowb); + temp_scanline = (uint8*)alloca (rowb); for (scanline = (uint8 *) BITMAP_BASEADDR (pixmap), ep = scanline + final_data_size; scanline < ep; @@ -1172,7 +1220,7 @@ A2(PRIVATE, Size, eatpixdata, PixMapPtr, pixmap, BOOLEAN *, freep) { temph = NewHandle (length); HLock (temph); - CToPascalCall (procp, CTOP_StdGetPic, STARH (temph), length); + CToPascalCall (&procp, CTOP_StdGetPic, STARH (temph), length); inp = (Byte *) STARH (temph); } else @@ -1270,7 +1318,7 @@ A2(PRIVATE, void, eatbitdata, register BitMap *, bp, BOOLEAN, packed) TheZone = savezone; } HLock(h); - CToPascalCall(procp, CTOP_StdGetPic, STARH(h), datasize); + CToPascalCall(&procp, CTOP_StdGetPic, STARH(h), datasize); bp->baseAddr = (*h).p; } else bp->baseAddr = RM((Ptr) nextbytep); @@ -1293,7 +1341,7 @@ A2(PRIVATE, void, eatbitdata, register BitMap *, bp, BOOLEAN, packed) if (procp) { temph = NewHandle(length); HLock(temph); - CToPascalCall(procp, CTOP_StdGetPic, STARH(temph), length); + CToPascalCall(&procp, CTOP_StdGetPic, STARH(temph), length); inp = (Byte *) STARH(temph); } else { inp = nextbytep; @@ -1409,7 +1457,7 @@ A1 (PRIVATE, void, eatPixPat, PixPatHandle, pixpat) HASSIGN_3 (pixpat, - patXMap, RM (NULL), + patXMap, (Handle)RM (NULL), patXData, RM (NewHandleClear (sizeof (xdata_t))), patXValid, RM (-1)); }); @@ -1456,10 +1504,10 @@ P2(PUBLIC pascal trap, void, DrawPicture, PicHandle, pic, Rect *, destrp) INTEGER hsize; void (*f)(); INTEGER vers; - auto Fixed scaleh, scalev, tempf; /* "auto": cc -a bug avoidance */ + Fixed scaleh, scalev, tempf; /* "auto": cc -a bug avoidance */ RGBColor rgb; BitMap bm; - auto PixMap pm; /* "auto": cc -a bug avoidance */ + PixMap pm; /* "auto": cc -a bug avoidance */ BOOLEAN packed; GrafPort saveport, *the_port; CGrafPtr the_cport; @@ -1696,7 +1744,7 @@ P2(PUBLIC pascal trap, void, DrawPicture, PicHandle, pic, Rect *, destrp) if (procp) { state2 = HGetState(hand); HLock(hand); - CToPascalCall(procp, CTOP_StdGetPic, STARH(hand), + CToPascalCall(&procp, CTOP_StdGetPic, STARH(hand), hsize); HSetState(hand, state2); } else diff --git a/src/qPict2.c b/src/qPict2.cpp similarity index 99% rename from src/qPict2.c rename to src/qPict2.cpp index df955b00..08aa1e1c 100644 --- a/src/qPict2.c +++ b/src/qPict2.cpp @@ -17,6 +17,8 @@ char ROMlib_rcsid_qPic2[] = #include "rsys/cquick.h" #include "rsys/rgbutil.h" +using namespace Executor; + P1 (PUBLIC pascal trap, OSErr, DisposePictInfo, PictInfoID, pict_info_id) { diff --git a/src/qPicture.c b/src/qPicture.cpp similarity index 95% rename from src/qPicture.c rename to src/qPicture.cpp index 25561aaa..bdd59cbf 100644 --- a/src/qPicture.c +++ b/src/qPicture.cpp @@ -17,7 +17,9 @@ char ROMlib_rcsid_qPicture[] = #include "rsys/picture.h" #include "rsys/mman.h" -PUBLIC PicHandle ROMlib_OpenPicture_helper (const Rect *pf, +using namespace Executor; + +PUBLIC PicHandle Executor::ROMlib_OpenPicture_helper (const Rect *pf, const OpenCPicParams *params) { piccachehand pch; @@ -346,7 +348,7 @@ PRIVATE void updateoval( Point *ovp ) } } -PUBLIC void ROMlib_textpicupdate( Point num, Point den ) +PUBLIC void Executor::ROMlib_textpicupdate( Point num, Point den ) { updateclip(); updatefont(); @@ -359,7 +361,7 @@ PUBLIC void ROMlib_textpicupdate( Point num, Point den ) updatebackColor(); } -PUBLIC void ROMlib_drawingpicupdate( void ) +PUBLIC void Executor::ROMlib_drawingpicupdate( void ) { updateclip(); updatepnsize(); @@ -369,7 +371,7 @@ PUBLIC void ROMlib_drawingpicupdate( void ) updatebackColor(); } -PUBLIC void ROMlib_drawingverbpicupdate( GrafVerb v ) +PUBLIC void Executor::ROMlib_drawingverbpicupdate( GrafVerb v ) { ROMlib_drawingpicupdate(); switch (v) { @@ -392,7 +394,7 @@ PUBLIC void ROMlib_drawingverbpicupdate( GrafVerb v ) } } -PUBLIC void ROMlib_drawingverbrectpicupdate( GrafVerb v, Rect *rp ) +PUBLIC void Executor::ROMlib_drawingverbrectpicupdate( GrafVerb v, Rect *rp ) { piccachehand pch; @@ -401,7 +403,7 @@ PUBLIC void ROMlib_drawingverbrectpicupdate( GrafVerb v, Rect *rp ) HxX(pch, piclastrect) = *rp; /* currently unused */ } -PUBLIC void ROMlib_drawingverbrectovalpicupdate( GrafVerb v, Rect *rp, +PUBLIC void Executor::ROMlib_drawingverbrectovalpicupdate( GrafVerb v, Rect *rp, Point *ovp ) { ROMlib_drawingverbrectpicupdate( v, rp ); @@ -421,7 +423,7 @@ P0(PUBLIC pascal trap, void, ClosePicture) SetHandleSize ((Handle) ph, Hx (pch, pichowfar)); DisposeRgn(HxP(pch, picclip)); DisposHandle((Handle) pch); - PORT_PIC_SAVE_X (thePort) = RM (NULL); + PORT_PIC_SAVE_X (thePort) = (Handle)RM (NULL); ShowPen(); } } diff --git a/src/qPixMapConv.c b/src/qPixMapConv.cpp similarity index 95% rename from src/qPixMapConv.c rename to src/qPixMapConv.cpp index b1c1becf..4b876336 100644 --- a/src/qPixMapConv.c +++ b/src/qPixMapConv.cpp @@ -23,6 +23,8 @@ char ROMlib_rcsid_qPixMapConv[] = #include "rsys/mman.h" #include "rsys/vdriver.h" +using namespace Executor; + static uint32 depth_table_space[DEPTHCONV_MAX_UINT32_TABLE_SIZE]; static depthconv_func_t conversion_func = NULL; @@ -32,10 +34,10 @@ static int32 cached_src_seed_x = CLC (-1), cached_dst_seed_x = CLC (-1); static ITabHandle target_itab; -rgb_spec_t mac_16bpp_rgb_spec, mac_32bpp_rgb_spec; +rgb_spec_t Executor::mac_16bpp_rgb_spec, Executor::mac_32bpp_rgb_spec; void -pixmap_black_white (const PixMap *pixmap, +Executor::pixmap_black_white (const PixMap *pixmap, uint32 *black_return, uint32 *white_return) { if (pixmap->pixelType == CWC (RGBDirect)) @@ -58,7 +60,7 @@ pixmap_black_white (const PixMap *pixmap, } void -gd_black_white (GDHandle gdh, +Executor::gd_black_white (GDHandle gdh, uint32 *black_return, uint32 *white_return) { GDPtr gd; @@ -71,13 +73,13 @@ gd_black_white (GDHandle gdh, } void -pixmap_free_copy (PixMap *pm) +Executor::pixmap_free_copy (PixMap *pm) { DisposPtr (MR (pm->baseAddr)); } void -pixmap_copy (const PixMap *src_pm, const Rect *src_rect, +Executor::pixmap_copy (const PixMap *src_pm, const Rect *src_rect, PixMap *return_pm, Rect *return_rect) { /* alas, we must copy to a scratch bitmap */ @@ -123,7 +125,7 @@ pixmap_copy (const PixMap *src_pm, const Rect *src_rect, } boolean_t -pixmap_copy_if_screen (const PixMap *src_pm, const Rect *src_rect, +Executor::pixmap_copy_if_screen (const PixMap *src_pm, const Rect *src_rect, write_back_data_t *write_back_data) { #if defined (VDRIVER_SUPPORTS_REAL_SCREEN_BLITS) @@ -144,7 +146,7 @@ pixmap_copy_if_screen (const PixMap *src_pm, const Rect *src_rect, } uint32 -pixel_from_rgb (RGBColor *color, +pixel_from_rgb (RGBColor *color, const rgb_spec_t *rgb_spec) { if (rgb_spec) @@ -155,7 +157,7 @@ pixel_from_rgb (RGBColor *color, } void -canonical_from_bogo_color (uint32 index, +Executor::canonical_from_bogo_color (uint32 index, const rgb_spec_t *rgb_spec, uint32 *pixel_out, RGBColor *rgb_out) @@ -208,7 +210,7 @@ canonical_from_bogo_color (uint32 index, } void -ROMlib_fg_bk (uint32 *fg_pixel_out, uint32 *bk_pixel_out, +Executor::ROMlib_fg_bk (uint32 *fg_pixel_out, uint32 *bk_pixel_out, RGBColor *fg_rgb_out, RGBColor *bk_rgb_out, const rgb_spec_t *rgb_spec, boolean_t active_screen_addr_p, @@ -294,7 +296,7 @@ ROMlib_fg_bk (uint32 *fg_pixel_out, uint32 *bk_pixel_out, } const rgb_spec_t * -pixmap_rgb_spec (const PixMap *pixmap) +Executor::pixmap_rgb_spec (const PixMap *pixmap) { if (pixmap->pixelType == CWC (RGBDirect) || pixmap->pixelType == CWC (vdriver_rgb_pixel_type)) @@ -315,7 +317,7 @@ pixmap_rgb_spec (const PixMap *pixmap) } void -pixmap_set_pixel_fields (PixMap *pixmap, int bpp) +Executor::pixmap_set_pixel_fields (PixMap *pixmap, int bpp) { pixmap->packType = pixmap->packSize = CWC (0); @@ -379,7 +381,7 @@ sort_color_table (CTabHandle dsth, const CTabHandle srch) } void -convert_pixmap (const PixMap *src, PixMap *dst, +Executor::convert_pixmap (const PixMap *src, PixMap *dst, const Rect *rect, CTabPtr conv_table) { diff --git a/src/qPoint.c b/src/qPoint.cpp similarity index 97% rename from src/qPoint.c rename to src/qPoint.cpp index dd1bc3cc..6d1460f7 100644 --- a/src/qPoint.c +++ b/src/qPoint.cpp @@ -13,6 +13,8 @@ char ROMlib_rcsid_qPoint[] = #include "QuickDraw.h" #include "rsys/cquick.h" +using namespace Executor; + P2(PUBLIC pascal trap, void, AddPt, Point, src, Point *, dst) { dst->h = CW(CW(dst->h) + (src.h)); diff --git a/src/qPoly.c b/src/qPoly.cpp similarity index 96% rename from src/qPoly.c rename to src/qPoly.cpp index 6206621a..e4bb426b 100644 --- a/src/qPoly.c +++ b/src/qPoly.cpp @@ -18,6 +18,8 @@ char ROMlib_rcsid_qPoly[] = #include "rsys/quick.h" #include "rsys/cquick.h" +using namespace Executor; + P0(PUBLIC pascal trap, PolyHandle, OpenPoly) { PolyHandle ph; @@ -54,7 +56,7 @@ P0(PUBLIC pascal trap, void, ClosePoly) HxX(ph, polyBBox.left) = CW(left); HxX(ph, polyBBox.bottom) = CW(bottom); HxX(ph, polyBBox.right) = CW(right); - PORT_POLY_SAVE_X (thePort) = CWC (0); + PORT_POLY_SAVE_X (thePort) = (Handle)CWC (0); ShowPen(); } diff --git a/src/qRect.c b/src/qRect.cpp similarity index 99% rename from src/qRect.c rename to src/qRect.cpp index 587b2ac3..25c82461 100644 --- a/src/qRect.c +++ b/src/qRect.cpp @@ -13,6 +13,8 @@ char ROMlib_rcsid_qRect[] = #include "QuickDraw.h" #include "ToolboxUtil.h" +using namespace Executor; + P5(PUBLIC pascal trap, void, SetRect, Rect *, r, INTEGER, left, INTEGER, top, INTEGER, right, INTEGER, bottom) { diff --git a/src/qRegion.c b/src/qRegion.cpp similarity index 97% rename from src/qRegion.c rename to src/qRegion.cpp index 52adff50..1a10d595 100644 --- a/src/qRegion.c +++ b/src/qRegion.cpp @@ -20,6 +20,8 @@ char ROMlib_rcsid_qRegion[] = #include "rsys/mman.h" #include "rsys/safe_alloca.h" +using namespace Executor; + #undef ALLOCABEGIN #define ALLOCABEGIN SAFE_DECL(); #undef ALLOCA @@ -120,7 +122,7 @@ rgn_is_rect_p (const RgnHandle rgnh) /* ROMlib_sizergn: crawl through a region and set bbox and size fields */ void -ROMlib_sizergn (RgnHandle rh, boolean_t special_p) /* INTERNAL */ +Executor::ROMlib_sizergn (RgnHandle rh, boolean_t special_p) /* INTERNAL */ { register INTEGER *ip, i, left = RGN_STOP, right = -RGN_STOP, y; Size rs; @@ -212,7 +214,7 @@ P1(PUBLIC pascal trap, void, CloseRgn, RgnHandle, rh) ROMlib_installhandle (PORT_REGION_SAVE (thePort), (Handle) rh); SetHandleSize ((Handle) rh, RGN_SIZE (rh)); - PORT_REGION_SAVE_X (thePort) = RM (NULL); + PORT_REGION_SAVE_X (thePort) = (Handle)RM (NULL); ShowPen (); } @@ -579,6 +581,11 @@ P2 (PUBLIC pascal trap, BOOLEAN, PtInRgn, Point, p, RgnHandle, rh) } #if !defined (NDEBUG) + +namespace Executor { + PRIVATE void assertincreasing(INTEGER * ip); +} + A1(PRIVATE, void, assertincreasing, INTEGER *, ip) { LONGINT lastx = -327680; @@ -589,6 +596,24 @@ A1(PRIVATE, void, assertincreasing, INTEGER *, ip) } #endif /* NDEBUG */ +namespace Executor { + PRIVATE void sectbinop(RgnHandle srcrgn1, RgnHandle srcrgn2, + RgnHandle dstrgn); + typedef enum { + sectop, + unionop, + diffop + } optype; + + + + PRIVATE void binop(optype op, RgnHandle srcrgn1, RgnHandle srcrgn2, + RgnHandle dstrgn); + PRIVATE LONGINT comparex(char * cp1, char * cp2); + PRIVATE LONGINT comparey(char * cp1, char * cp2); + PRIVATE void ptorh(INTEGER *p, RgnHandle rh); +} + A3(PRIVATE, void, sectbinop, RgnHandle, srcrgn1, RgnHandle, srcrgn2, RgnHandle, dstrgn) { @@ -761,8 +786,6 @@ A3(PRIVATE, void, sectbinop, RgnHandle, srcrgn1, RgnHandle, srcrgn2, ALLOCAEND } -typedef enum { sectop, unionop, diffop } optype; - A4(PRIVATE, void, binop, optype, op, RgnHandle, srcrgn1, RgnHandle, srcrgn2, RgnHandle, dstrgn) { @@ -871,7 +894,7 @@ A4(PRIVATE, void, binop, optype, op, RgnHandle, srcrgn1, RgnHandle, srcrgn2, void -nonspecial_rgn_to_special_rgn (const INTEGER *src, INTEGER *dst) +Executor::nonspecial_rgn_to_special_rgn (const INTEGER *src, INTEGER *dst) { static const INTEGER empty_row[2] = { 0, RGN_STOP }; const INTEGER *prev; @@ -1012,6 +1035,16 @@ static INTEGER npairs; #include "hintemplate.h" +static int comparex(const void* cp1, const void* cp2) +{ + return Executor::comparex((char*)cp1, (char*)cp2); +} + +static int comparey(const void* cp1, const void* cp2) +{ + return Executor::comparey((char*)cp1, (char*)cp2); +} + A2(PRIVATE, LONGINT, comparex, char *, cp1, char *, cp2) { register INTEGER *p1, *p2; @@ -1108,9 +1141,9 @@ P3(PUBLIC pascal trap, void, InsetRgn, RgnHandle, rh, INTEGER, dh, INTEGER, dv) p = (INTEGER *) STARH(h); rhtopandinseth(rh, p, dh); /* must be combined for efficiency */ gui_assert(npairs * (int) sizeof(INTEGER) * 2 <= newsize); - qsort((char *) p, npairs, sizeof(INTEGER) * 2, (void *) comparex); + qsort(p, npairs, sizeof(INTEGER) * 2, ::comparex); hinset(p, dv); - qsort((char *) p, npairs, sizeof(INTEGER) * 2, (void *) comparey); + qsort(p, npairs, sizeof(INTEGER) * 2, ::comparey); ReallocHandle((Handle) rh, newsize); ptorh(p, rh); ROMlib_sizergn(rh, FALSE); diff --git a/src/qRegular.c b/src/qRegular.cpp similarity index 99% rename from src/qRegular.c rename to src/qRegular.cpp index 79cba251..30415c2f 100644 --- a/src/qRegular.c +++ b/src/qRegular.cpp @@ -18,6 +18,8 @@ char ROMlib_rcsid_qRegular[] = #include "rsys/ctl.h" #include "rsys/wind.h" +using namespace Executor; + P1(PUBLIC pascal trap, void, FrameRect, Rect *, r) { CALLRECT(frame, r); diff --git a/src/qScale.c b/src/qScale.cpp similarity index 86% rename from src/qScale.c rename to src/qScale.cpp index 324d0dfa..4b597e7a 100644 --- a/src/qScale.c +++ b/src/qScale.cpp @@ -13,6 +13,8 @@ char ROMlib_rcsid_qScale[] = #include "rsys/cquick.h" +using namespace Executor; + /* This routine scales old_bitmap and stores the result in dst_bitmap. * The only field of dst_bitmap that needs to be valid on entry is * baseAddr, which should point to enough information to hold the @@ -21,7 +23,7 @@ char ROMlib_rcsid_qScale[] = * to the newly scaled bits in that coordinate system. */ void -scale_blt_bitmap (const blt_bitmap_t *src_bitmap, blt_bitmap_t *dst_bitmap, +Executor::scale_blt_bitmap (const blt_bitmap_t *src_bitmap, blt_bitmap_t *dst_bitmap, const Rect *old_rect, const Rect *new_rect, int log2_bits_per_pixel) { @@ -37,7 +39,7 @@ scale_blt_bitmap (const blt_bitmap_t *src_bitmap, blt_bitmap_t *dst_bitmap, old_height = RECT_HEIGHT (old_rect); new_height = RECT_HEIGHT (new_rect); - /* If the old bitmap was empty, just create a new, empty bitmap. We + /* If the old bitmap was empty, just create a new1, empty bitmap. We * do this to avoid dividing by zero. */ if (new_width == 0 || new_height == 0) @@ -111,50 +113,50 @@ scale_blt_bitmap (const blt_bitmap_t *src_bitmap, blt_bitmap_t *dst_bitmap, case 0: /* 1 bpp */ SCALE_LOOP (dst_byte_width, { - unsigned char new; - new = BITS (0) << 7; + unsigned char new1; + new1 = BITS (0) << 7; x += dx; - new |= BITS (0) << 6; + new1 |= BITS (0) << 6; x += dx; - new |= BITS (0) << 5; + new1 |= BITS (0) << 5; x += dx; - new |= BITS (0) << 4; + new1 |= BITS (0) << 4; x += dx; - new |= BITS (0) << 3; + new1 |= BITS (0) << 3; x += dx; - new |= BITS (0) << 2; + new1 |= BITS (0) << 2; x += dx; - new |= BITS (0) << 1; + new1 |= BITS (0) << 1; x += dx; - new |= BITS (0); + new1 |= BITS (0); x += dx; - dst_row_base[h] = new; + dst_row_base[h] = new1; }); break; case 1: /* 2 bpp */ SCALE_LOOP (dst_byte_width, { - unsigned char new; - new = BITS (1) << 6; + unsigned char new1; + new1 = BITS (1) << 6; x += dx; - new |= BITS (1) << 4; + new1 |= BITS (1) << 4; x += dx; - new |= BITS (1) << 2; + new1 |= BITS (1) << 2; x += dx; - new |= BITS (1); + new1 |= BITS (1); x += dx; - dst_row_base[h] = new; + dst_row_base[h] = new1; }); break; case 2: /* 4 bpp */ SCALE_LOOP (dst_byte_width, { - unsigned char new; - new = BITS (2) << 4; + unsigned char new1; + new1 = BITS (2) << 4; x += dx; - new |= BITS (2); + new1 |= BITS (2); x += dx; - dst_row_base[h] = new; + dst_row_base[h] = new1; }); break; case 3: /* 8 bpp */ diff --git a/src/qStandard.c b/src/qStandard.c deleted file mode 100644 index 75b08b0a..00000000 --- a/src/qStandard.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright 1986, 1988, 1989, 1990 by Abacus Research and - * Development, Inc. All rights reserved. - */ - -#if !defined (OMIT_RCSID_STRINGS) -char ROMlib_rcsid_qStandard[] = - "$Id: qStandard.c 63 2004-12-24 18:19:43Z ctm $"; -#endif - -/* Forward declarations in QuickDraw.h (DO NOT DELETE THIS LINE) */ - -#include "rsys/common.h" -#include "QuickDraw.h" -#include "rsys/pstuff.h" - -#if !defined (BINCOMPAT) -#define PTRCAST (Ptr) -#else /* BINCOMPAT */ -#define PTRCAST -#endif /* BINCOMPAT */ - -P1(PUBLIC pascal trap, void, SetStdProcs, QDProcs *, procs) -{ - procs->textProc = RM(PTRCAST P_StdText); - procs->lineProc = RM(PTRCAST P_StdLine); - procs->rectProc = RM(PTRCAST P_StdRect); - procs->rRectProc = RM(PTRCAST P_StdRRect); - procs->ovalProc = RM(PTRCAST P_StdOval); - procs->arcProc = RM(PTRCAST P_StdArc); - procs->polyProc = RM(PTRCAST P_StdPoly); - procs->rgnProc = RM(PTRCAST P_StdRgn); - procs->bitsProc = RM(PTRCAST P_StdBits); - procs->commentProc = RM(PTRCAST P_StdComment); - procs->txMeasProc = RM(PTRCAST P_StdTxMeas); - procs->getPicProc = RM(PTRCAST P_StdGetPic); - procs->putPicProc = RM(PTRCAST P_StdPutPic); -} diff --git a/src/qStandard.cpp b/src/qStandard.cpp new file mode 100644 index 00000000..c6c68fc2 --- /dev/null +++ b/src/qStandard.cpp @@ -0,0 +1,39 @@ +/* Copyright 1986, 1988, 1989, 1990 by Abacus Research and + * Development, Inc. All rights reserved. + */ + +#if !defined (OMIT_RCSID_STRINGS) +char ROMlib_rcsid_qStandard[] = + "$Id: qStandard.c 63 2004-12-24 18:19:43Z ctm $"; +#endif + +/* Forward declarations in QuickDraw.h (DO NOT DELETE THIS LINE) */ + +#include "rsys/common.h" +#include "QuickDraw.h" +#include "rsys/pstuff.h" + +using namespace Executor; + +#if !defined (BINCOMPAT) +#define PTRCAST (Ptr) +#else /* BINCOMPAT */ +#define PTRCAST +#endif /* BINCOMPAT */ + +P1(PUBLIC pascal trap, void, SetStdProcs, QDProcs *, procs) +{ + procs->textProc = (textProc_t)RM(PTRCAST P_StdText); + procs->lineProc = (lineProc_t)RM(PTRCAST P_StdLine); + procs->rectProc = (rectProc_t)RM(PTRCAST P_StdRect); + procs->rRectProc = (rRectProc_t)RM(PTRCAST P_StdRRect); + procs->ovalProc = (ovalProc_t)RM(PTRCAST P_StdOval); + procs->arcProc = (arcProc_t)RM(PTRCAST P_StdArc); + procs->polyProc = (polyProc_t)RM(PTRCAST P_StdPoly); + procs->rgnProc = (rgnProc_t)RM(PTRCAST P_StdRgn); + procs->bitsProc = (bitsProc_t)RM(PTRCAST P_StdBits); + procs->commentProc = (commentProc_t)RM(PTRCAST P_StdComment); + procs->txMeasProc = (txMeasProc_t)RM(PTRCAST P_StdTxMeas); + procs->getPicProc = (getPicProc_t)RM(PTRCAST P_StdGetPic); + procs->putPicProc = (putPicProc_t)RM(PTRCAST P_StdPutPic); +} diff --git a/src/qStdArc.c b/src/qStdArc.cpp similarity index 97% rename from src/qStdArc.c rename to src/qStdArc.cpp index 96cef107..db15477c 100644 --- a/src/qStdArc.c +++ b/src/qStdArc.cpp @@ -18,8 +18,15 @@ char ROMlib_rcsid_qStdArc[] = #include "rsys/cquick.h" #include "rsys/picture.h" +using namespace Executor; + #define returnhv(hh, vv) { ptp->h = hh; ptp->v = vv; return; } +namespace Executor { + PRIVATE void getpoint(INTEGER, Rect*, Point*); + PRIVATE INTEGER findwall(Rect *r, INTEGER h, INTEGER v); +} + A3(PRIVATE, void, getpoint, INTEGER, angle, Rect *, r, Point *, ptp) { INTEGER left = CW(r->left), top = CW(r->top), diff --git a/src/qStdBits.c b/src/qStdBits.cpp similarity index 93% rename from src/qStdBits.c rename to src/qStdBits.cpp index fd6b5fcd..0aebefcc 100644 --- a/src/qStdBits.c +++ b/src/qStdBits.cpp @@ -27,6 +27,8 @@ char ROMlib_rcsid_qStdBits[] = #include "rsys/host.h" #include "rsys/tempalloc.h" +using namespace Executor; + static void ROMlib_real_copy_bits (PixMap *src, PixMap *dst, const Rect *src_rect, const Rect *dst_rect, INTEGER mode, RgnHandle mask); @@ -52,40 +54,39 @@ dy_zero_p (const Rect *srcr, const Rect *dstr, } void -canonicalize_bogo_map_cleanup (BitMap *bogo_map, +Executor::canonicalize_bogo_map_cleanup (BitMap *bogo_map, struct cleanup_info *info) { - switch (info->cleanup_type) - { - case cleanup_state: - HSetState (info->data.handle, info->h_state); - break; - case cleanup_free: - DisposHandle (info->data.handle); - break; - case cleanup_unlock_gworld_pixels: - UnlockPixels (info->data.pixmap_handle); - break; - case cleanup_unlock_gworld_pixels_update: - { - gw_info_t *gw_info; - - gw_info = info->data.gw_info; - - UnlockPixels (gw_info->gw_pixmap); - BITMAP_BASEADDR_X ((PixMap *) bogo_map) + switch (info->cleanup_type) { + case Executor::cleanup_info::cleanup_state: + HSetState (info->data.handle, info->h_state); + break; + case Executor::cleanup_info::cleanup_free: + DisposHandle (info->data.handle); + break; + case Executor::cleanup_info::cleanup_unlock_gworld_pixels: + UnlockPixels (info->data.pixmap_handle); + break; + case Executor::cleanup_info::cleanup_unlock_gworld_pixels_update: + { + gw_info_t *gw_info; + + gw_info = info->data.gw_info; + + UnlockPixels (gw_info->gw_pixmap); + BITMAP_BASEADDR_X ((PixMap *) bogo_map) = PIXMAP_BASEADDR_X (gw_info->gw_pixmap); - break; - } - case cleanup_none: - break; - default: - gui_fatal ("unknown cleanup type `%d'", info->cleanup_type); - } + break; + } + case Executor::cleanup_info::cleanup_none: + break; + default: + gui_fatal ("unknown cleanup type `%d'", info->cleanup_type); + } } void -canonicalize_bogo_map (BitMap *bogo_map, PixMap **canonical_addr, +Executor::canonicalize_bogo_map (BitMap *bogo_map, PixMap **canonical_addr, struct cleanup_info *info) { int high_bits = ((unsigned short) CW (bogo_map->rowBytes)) >> 14; @@ -118,7 +119,7 @@ canonicalize_bogo_map (BitMap *bogo_map, PixMap **canonical_addr, | PIXMAP_DEFAULT_ROW_BYTES_X); canonical->pmTable = PIXMAP_TABLE_X (gd_pmap); - info->cleanup_type = cleanup_none; + info->cleanup_type = Executor::cleanup_info::cleanup_none; } else { @@ -126,7 +127,7 @@ canonicalize_bogo_map (BitMap *bogo_map, PixMap **canonical_addr, canonical->rowBytes = (bogo_map->rowBytes | PIXMAP_DEFAULT_ROW_BYTES_X); - info->cleanup_type = cleanup_none; + info->cleanup_type = Executor::cleanup_info::cleanup_none; canonical->pmTable = RM (validate_relative_bw_ctab ()); } canonical->planeBytes = CWC (0); @@ -152,11 +153,11 @@ canonicalize_bogo_map (BitMap *bogo_map, PixMap **canonical_addr, BITMAP_BASEADDR_X ((PixMap *) bogo_map) = PIXMAP_BASEADDR_X (gw_info->gw_pixmap); - info->cleanup_type = cleanup_unlock_gworld_pixels_update; + info->cleanup_type = Executor::cleanup_info::cleanup_unlock_gworld_pixels_update; info->data.gw_info = gw_info; } else - info->cleanup_type = cleanup_none; + info->cleanup_type = Executor::cleanup_info::cleanup_none; *canonical_addr = (PixMap *) bogo_map; break; @@ -173,7 +174,7 @@ canonicalize_bogo_map (BitMap *bogo_map, PixMap **canonical_addr, pixmap = CPORT_PIXMAP (gw); *canonical_addr = STARH (pixmap); - info->cleanup_type = cleanup_unlock_gworld_pixels; + info->cleanup_type = Executor::cleanup_info::cleanup_unlock_gworld_pixels; info->data.pixmap_handle = pixmap; /* lock the pixels */ @@ -185,7 +186,7 @@ canonicalize_bogo_map (BitMap *bogo_map, PixMap **canonical_addr, *canonical_addr = STARH (pixmap_handle); - info->cleanup_type = cleanup_state; + info->cleanup_type = Executor::cleanup_info::cleanup_state; info->data.pixmap_handle = pixmap_handle; info->h_state = HGetState ((Handle) pixmap_handle); @@ -229,8 +230,8 @@ write_copybits_picdata (PixMap *src, PixMap *dst, PixMap *_src; Rect *_src_rect; - _src = alloca (sizeof *_src); - _src_rect = alloca (sizeof *_src_rect); + _src = (PixMap*)alloca (sizeof *_src); + _src_rect = (Rect*)alloca (sizeof *_src_rect); ZONE_SAVE_EXCURSION (ApplZone, @@ -363,7 +364,7 @@ write_copybits_picdata (PixMap *src, PixMap *dst, of StdBits pic recording. i can't say i fully understand it */ /* #### why the extra 5 bytes? */ - packed_line = alloca (row_bytes + 5); + packed_line = (uint8 *)alloca (row_bytes + 5); baseaddr = (uint8 *) MR (src->baseAddr); ip.p = (Ptr) baseaddr; parity = 0; @@ -402,7 +403,7 @@ write_copybits_picdata (PixMap *src, PixMap *dst, } void -ROMlib_bogo_stdbits (BitMap *src_bogo_map, BitMap *dst_bogo_map, +Executor::ROMlib_bogo_stdbits (BitMap *src_bogo_map, BitMap *dst_bogo_map, const Rect *src_rect, const Rect *dst_rect, short mode, RgnHandle mask) { @@ -449,7 +450,7 @@ ROMlib_bogo_stdbits (BitMap *src_bogo_map, BitMap *dst_bogo_map, } void -StdBitsPicSaveFlag (BitMap *src_bogo_map, +Executor::StdBitsPicSaveFlag (BitMap *src_bogo_map, const Rect *src_rect, const Rect *dst_rect, INTEGER mode, RgnHandle mask, BOOLEAN savepic) @@ -634,7 +635,7 @@ ROMlib_real_copy_bits_helper (PixMap *src, PixMap *dst, * (CW (src_rect->bottom) - CW (src_rect->top))); TEMP_ALLOC_ALLOCATE (new_src_bits, temp_depth_bits, n_bytes_needed); - new_src->baseAddr = RM (new_src_bits); + new_src->baseAddr = (Ptr)RM (new_src_bits); pixmap_set_pixel_fields (new_src, dst_depth); new_src->pmTable = PIXMAP_TABLE_X (the_gd_pmap); @@ -849,7 +850,7 @@ ROMlib_real_copy_bits (PixMap *src, PixMap *dst, TEMP_ALLOC_ALLOCATE (temp_bits, temp_alloc_bits, temp_bytes_needed); *new_src = *src; - new_src->baseAddr = RM (temp_bits); + new_src->baseAddr = (Ptr)RM (temp_bits); new_src->rowBytes = CW (temp_row_bytes | PIXMAP_DEFAULT_ROWBYTES); new_src->bounds = *dst_rect; diff --git a/src/qStdLine.c b/src/qStdLine.cpp similarity index 56% rename from src/qStdLine.c rename to src/qStdLine.cpp index ca1f2678..16cc28e8 100644 --- a/src/qStdLine.c +++ b/src/qStdLine.cpp @@ -18,6 +18,8 @@ char ROMlib_rcsid_qStdLine[] = #include "rsys/cquick.h" #include "rsys/picture.h" +using namespace Executor; + /* * eight scan convert routines... all very similar. * sco: do the scan convert and build two tables (using offsets) @@ -29,6 +31,30 @@ char ROMlib_rcsid_qStdLine[] = #define OUT(y, x) (*op2++ = (*op++ = (y)) + offy, \ *op2++ = (*op++ = (x)) + offx) +namespace Executor { + PRIVATE void scodydxx1x2(register LONGINT y1, register INTEGER x1, + INTEGER dy, INTEGER dx, INTEGER ** opp, INTEGER ** opp2, + register INTEGER offy, register INTEGER offx); + PRIVATE INTEGER *scrdydxx1x2(register LONGINT y1, register INTEGER x1, + INTEGER dy, INTEGER dx, register INTEGER * op); + PRIVATE void scodydxx2x1(register LONGINT y1, register INTEGER x1, + INTEGER dy, INTEGER dx, INTEGER ** opp, INTEGER ** opp2, + register INTEGER offy, register INTEGER offx); + PRIVATE INTEGER *scrdydxx2x1(register LONGINT y1, register INTEGER x1, + INTEGER dy, INTEGER dx, register INTEGER * op); + PRIVATE void scodxdyx1x2(register INTEGER y1, register LONGINT x1, + register INTEGER dy, register INTEGER dx, INTEGER ** opp, + INTEGER ** opp2, register INTEGER offy, register INTEGER offx); + PRIVATE INTEGER *scrdxdyx1x2(register INTEGER y1, register LONGINT x1, + register INTEGER dy, register INTEGER dx, register INTEGER * op); + PRIVATE void scodxdyx2x1(register INTEGER y1, register LONGINT x1, + register INTEGER dy, register INTEGER dx, INTEGER ** opp, + INTEGER ** opp2, register INTEGER offy, register INTEGER offx); + PRIVATE INTEGER *scrdxdyx2x1(register INTEGER y1, register LONGINT x1, + register INTEGER dy, register INTEGER dx, register INTEGER *op); + PRIVATE void regionify1(register INTEGER * ip1, + register INTEGER * ip2, RgnPtr rp); +} A8(PRIVATE, void, scodydxx1x2, register LONGINT, y1, register INTEGER, x1, INTEGER, dy, INTEGER, dx, INTEGER **, opp, INTEGER **, opp2, @@ -286,239 +312,237 @@ A3(PRIVATE, void, regionify1, register INTEGER *, ip1, rp->rgnSize = CW(-32768 + (op - (INTEGER *) rp) * sizeof(INTEGER)); } -#define SWAP(a, b) (temp = (a), (a) = (b), (b) = temp) - +#define SWAP std::swap #define MAXNPOINTS(dy) ((dy+3)*2 + 1) P1(PUBLIC pascal trap, void, StdLine, Point, p) { - INTEGER x1, x2, y1, y2, px, py, dx, dy; - INTEGER *oip; - INTEGER *op, *op2, *destpoints, *destpoints2; - Size psize; - INTEGER temp; - HIDDEN_RgnPtr rp; - Rect r; - register INTEGER r32767; - RgnHandle rh; - PolyHandle ph; - Point swappedp; - ALLOCABEGIN - PAUSEDECL; - - r32767 = 32767; - x1 = CW (PORT_PEN_LOC (thePort).h); - y1 = CW (PORT_PEN_LOC (thePort).v); - x2 = p.h; - y2 = p.v; - - px = CW (PORT_PEN_SIZE (thePort).h); - py = CW (PORT_PEN_SIZE (thePort).v); - - if (PORT_POLY_SAVE_X (thePort) && (x1 != x2 || y1 != y2)) { + INTEGER x1, x2, y1, y2, px, py, dx, dy; + INTEGER *oip; + INTEGER *op, *op2, *destpoints, *destpoints2; + Size psize; + HIDDEN_RgnPtr rp; + Rect r; + register INTEGER r32767; + RgnHandle rh; + PolyHandle ph; + Point swappedp; + ALLOCABEGIN + PAUSEDECL; + + r32767 = 32767; + x1 = CW (PORT_PEN_LOC (thePort).h); + y1 = CW (PORT_PEN_LOC (thePort).v); + x2 = p.h; + y2 = p.v; + + px = CW (PORT_PEN_SIZE (thePort).h); + py = CW (PORT_PEN_SIZE (thePort).v); + + if (PORT_POLY_SAVE_X (thePort) && (x1 != x2 || y1 != y2)) { ph = (PolyHandle) PORT_POLY_SAVE (thePort); - psize = GetHandleSize((Handle) ph); - if (psize == SMALLPOLY) { - SetHandleSize((Handle) ph, psize + 2 * sizeof(Point)); - oip = (INTEGER *)((char *) STARH(ph) + psize); - *oip++ = CW(y1); - *oip++ = CW(x1); - HxX(ph, polySize) = CW(Hx(ph, polySize) + 2 * sizeof(Point)); + psize = GetHandleSize((Handle) ph); + if (psize == SMALLPOLY) { + SetHandleSize((Handle) ph, psize + 2 * sizeof(Point)); + oip = (INTEGER *)((char *) STARH(ph) + psize); + *oip++ = CW(y1); + *oip++ = CW(x1); + HxX(ph, polySize) = CW(Hx(ph, polySize) + 2 * sizeof(Point)); } else { - SetHandleSize((Handle) ph, psize + sizeof(Point)); - oip = (INTEGER *)((char *) STARH(ph) + psize); - HxX(ph, polySize) = CW(Hx(ph, polySize) + sizeof(Point)); + SetHandleSize((Handle) ph, psize + sizeof(Point)); + oip = (INTEGER *)((char *) STARH(ph) + psize); + HxX(ph, polySize) = CW(Hx(ph, polySize) + sizeof(Point)); } - *oip++ = CW(y2); - *oip++ = CW(x2); - } - - PIC_SAVE_EXCURSION - ({ + *oip++ = CW(y2); + *oip++ = CW(x2); + } + + PIC_SAVE_EXCURSION + ({ ROMlib_drawingpicupdate(); PICOP(OP_Line); PICWRITE(&PORT_PEN_LOC (thePort), sizeof (PORT_PEN_LOC (thePort))); swappedp.h = CW(p.h); swappedp.v = CW(p.v); PICWRITE(&swappedp, sizeof(swappedp)); - }) - -/* - * NOTE: this early return used to be before we wrote the picture, but - * that messes up people who embed postscript in pictures and use - * StdLine to figure out where they are... - */ - if (px == 0 || py == 0) -/*-->*/ return; - - if (x1 == x2 || y1 == y2) { + }) + + /* + * NOTE: this early return used to be before we wrote the picture, but + * that messes up people who embed postscript in pictures and use + * StdLine to figure out where they are... + */ + if (px == 0 || py == 0) + /*-->*/ return; + + if (x1 == x2 || y1 == y2) { /* rectangle */ if (x2 < x1) - SWAP(x1, x2); + SWAP(x1, x2); if (y2 < y1) - SWAP(y1, y2); + SWAP(y1, y2); if (PORT_PEN_VIS (thePort) >= 0) { - SetRect(&r, x1, y1, x2 + px, y2 + py); - PAUSERECORDING; - StdRect(paint, &r); - RESUMERECORDING; + SetRect(&r, x1, y1, x2 + px, y2 + py); + PAUSERECORDING; + StdRect(paint, &r); + RESUMERECORDING; } if (PORT_REGION_SAVE_X (thePort) && y1 == y2 && x1 != x2) { - rp.p = (RgnPtr) ALLOCA(SMALLRGN + 5 * sizeof(INTEGER)); - (rp.p)->rgnBBox.top = CW(y1); - (rp.p)->rgnBBox.left = CW(x1); - (rp.p)->rgnBBox.bottom = CW(y2); - (rp.p)->rgnBBox.right = CW(x1); - (rp.p)->rgnSize = CWC(SMALLRGN + 5 * sizeof(INTEGER)); - oip = (INTEGER *) ((char *)rp.p + SMALLRGN); - *oip++ = CW(y1); - *oip++ = CW(x1); - *oip++ = CW(x2); - *oip++ = RGNSTOPX; - *oip++ = RGNSTOPX; - rp.p = RM(rp.p); - XorRgn (&rp, - (RgnHandle) PORT_REGION_SAVE (thePort), - (RgnHandle) PORT_REGION_SAVE (thePort)); + rp.p = (RgnPtr) ALLOCA(SMALLRGN + 5 * sizeof(INTEGER)); + (rp.p)->rgnBBox.top = CW(y1); + (rp.p)->rgnBBox.left = CW(x1); + (rp.p)->rgnBBox.bottom = CW(y2); + (rp.p)->rgnBBox.right = CW(x1); + (rp.p)->rgnSize = CWC(SMALLRGN + 5 * sizeof(INTEGER)); + oip = (INTEGER *) ((char *)rp.p + SMALLRGN); + *oip++ = CW(y1); + *oip++ = CW(x1); + *oip++ = CW(x2); + *oip++ = RGNSTOPX; + *oip++ = RGNSTOPX; + rp.p = RM(rp.p); + XorRgn (&rp, + (RgnHandle) PORT_REGION_SAVE (thePort), + (RgnHandle) PORT_REGION_SAVE (thePort)); } ALLOCAEND -/*-->*/ return; - } else if (y1 > y2) { + /*-->*/ return; + } else if (y1 > y2) { SWAP(y1, y2); SWAP(x1, x2); - } - - dy = y2 - y1; - dx = ABS(x2 - x1); - - if (PORT_REGION_SAVE_X (thePort)) { + } + + dy = y2 - y1; + dx = ABS(x2 - x1); + + if (PORT_REGION_SAVE_X (thePort)) { /* size allocated below is overkill */ rp.p = (RgnPtr) ALLOCA(SMALLRGN + (dy + 1) * sizeof(INTEGER) * 6 + - sizeof(INTEGER)); + sizeof(INTEGER)); (rp.p)->rgnBBox.top = CW(y1); (rp.p)->rgnBBox.left = CW(MIN(x1, x2)); (rp.p)->rgnBBox.bottom = CW(y2); (rp.p)->rgnBBox.right = CW(MAX(x1, x2)); - + if (dy >= dx) - if (x2 > x1) + if (x2 > x1) op = scrdydxx2x1(y1, x1, dy, dx, (INTEGER *)rp.p + 5); - else + else op = scrdydxx1x2(y1, x1, dy, dx, (INTEGER *)rp.p + 5); - else - if (x2 > x1) - op = scrdxdyx2x1(y1, x1, dy, dx, (INTEGER *)rp.p + 5); - else - op = scrdxdyx1x2(y1, x1+1, dy, dx, (INTEGER *)rp.p + 5); + else + if (x2 > x1) + op = scrdxdyx2x1(y1, x1, dy, dx, (INTEGER *)rp.p + 5); + else + op = scrdxdyx1x2(y1, x1+1, dy, dx, (INTEGER *)rp.p + 5); *op++ = RGNSTOPX; (rp.p)->rgnSize = CW((char *) op - (char *) rp.p); rp.p = RM(rp.p); XorRgn (&rp, - (RgnHandle) PORT_REGION_SAVE (thePort), - (RgnHandle) PORT_REGION_SAVE (thePort)); - } - - if (PORT_PEN_VIS (thePort) < 0) { + (RgnHandle) PORT_REGION_SAVE (thePort), + (RgnHandle) PORT_REGION_SAVE (thePort)); + } + + if (PORT_PEN_VIS (thePort) < 0) { ALLOCAEND -/*-->*/ return; - } - - rp.p = (RgnPtr) ALLOCA(SMALLRGN + (dy + py + 1) * sizeof(LONGINT) * 4 + - 3 * 2 * sizeof(LONGINT)); - /* Cx(rp->rgnSize) gets filled in later */ - (rp.p)->rgnBBox.top = CW(y1); - (rp.p)->rgnBBox.left = CW(MIN(x1, x2)); - (rp.p)->rgnBBox.bottom = CW(y2 + py); - (rp.p)->rgnBBox.right = CW(MAX(x1, x2) + px); - op = destpoints = (INTEGER *) ALLOCA(MAXNPOINTS(dy) * sizeof(INTEGER)); - op2 = destpoints2 = (INTEGER *) ALLOCA(MAXNPOINTS(dy) * sizeof(INTEGER)); - - if (dy >= dx) { + /*-->*/ return; + } + + rp.p = (RgnPtr) ALLOCA(SMALLRGN + (dy + py + 1) * sizeof(LONGINT) * 4 + + 3 * 2 * sizeof(LONGINT)); + /* Cx(rp->rgnSize) gets filled in later */ + (rp.p)->rgnBBox.top = CW(y1); + (rp.p)->rgnBBox.left = CW(MIN(x1, x2)); + (rp.p)->rgnBBox.bottom = CW(y2 + py); + (rp.p)->rgnBBox.right = CW(MAX(x1, x2) + px); + op = destpoints = (INTEGER *) ALLOCA(MAXNPOINTS(dy) * sizeof(INTEGER)); + op2 = destpoints2 = (INTEGER *) ALLOCA(MAXNPOINTS(dy) * sizeof(INTEGER)); + + if (dy >= dx) { if (x2 > x1) { - if (py > 1) { + if (py > 1) { *op2++ = y1; *op2++ = x1; - } - scodydxx2x1(y1, x1+px, dy, dx, &op, &op2, py-1, -px); + } + scodydxx2x1(y1, x1+px, dy, dx, &op, &op2, py-1, -px); } else { - if (py > 1) { + if (py > 1) { *op2++ = y1; *op2++ = x1+px; - } - scodydxx1x2(y1, x1, dy, dx, &op, &op2, py-1, px); + } + scodydxx1x2(y1, x1, dy, dx, &op, &op2, py-1, px); } - + *op++ = y2+py; *op++ = r32767; - + *op2++ = y2+py; *op2++ = r32767; - + *op = r32767; *op2 = r32767; - - } else { + + } else { if (x2 > x1) { - *op2++ = y1; - *op2++ = x1; - - scodxdyx2x1(y1, x1+px-1, dy, dx, &op, &op2, py, -(px-1)); - - op[-1] = x2+px; - - *op++ = y2 + py; - *op++ = r32767; - - op2[-1] = r32767; - - *op = r32767; - *op2 = r32767; + *op2++ = y1; + *op2++ = x1; + + scodxdyx2x1(y1, x1+px-1, dy, dx, &op, &op2, py, -(px-1)); + + op[-1] = x2+px; + + *op++ = y2 + py; + *op++ = r32767; + + op2[-1] = r32767; + + *op = r32767; + *op2 = r32767; } else { - *op2++ = y1; - *op2++ = x1+px; - - scodxdyx1x2(y1, x1+1, dy, dx, &op, &op2, py, px-1); - - op[-1] = x2; - - *op++ = y2 + py; - *op++ = r32767; - - op2[-1] = r32767; - - *op = r32767; - *op2 = r32767; + *op2++ = y1; + *op2++ = x1+px; + + scodxdyx1x2(y1, x1+1, dy, dx, &op, &op2, py, px-1); + + op[-1] = x2; + + *op++ = y2 + py; + *op++ = r32767; + + op2[-1] = r32767; + + *op = r32767; + *op2 = r32767; } - } - gui_assert((op - destpoints + 1) <= ((dy+3)*2 + 1)); - gui_assert((op2 - destpoints2 + 1) <= ((dy+3)*2 + 1)); - regionify1(destpoints, destpoints2, rp.p); - - rh = NewRgn (); - SectRect (&PORT_BOUNDS (thePort), &PORT_RECT (thePort), &r); - RectRgn (rh, &r); - SectRgn (rh, PORT_VIS_REGION (thePort), rh); - SectRgn (rh, PORT_CLIP_REGION (thePort), rh); - rp.p = RM (rp.p); - SectRgn (&rp, rh, rh); - - if (GWorld_p (thePort)) - LockPixels (CPORT_PIXMAP (thePort)); - - { - INTEGER adjusted_mode; - - adjusted_mode = PORT_PEN_MODE (thePort); - if (adjusted_mode < blend) - adjusted_mode = adjusted_mode % 0x40 | 8; - ROMlib_blt_pn (rh, adjusted_mode); - } - /* ROMlib_bltrgn (rh, thePort->pnPat, Cx(thePort->pnMode) % 0x40 | 8, - (Rect *) 0, (Rect *) 0); */ - - if (GWorld_p (thePort)) - UnlockPixels (CPORT_PIXMAP (thePort)); - - DisposeRgn (rh); - ALLOCAEND + } + gui_assert((op - destpoints + 1) <= ((dy+3)*2 + 1)); + gui_assert((op2 - destpoints2 + 1) <= ((dy+3)*2 + 1)); + regionify1(destpoints, destpoints2, rp.p); + + rh = NewRgn (); + SectRect (&PORT_BOUNDS (thePort), &PORT_RECT (thePort), &r); + RectRgn (rh, &r); + SectRgn (rh, PORT_VIS_REGION (thePort), rh); + SectRgn (rh, PORT_CLIP_REGION (thePort), rh); + rp.p = RM (rp.p); + SectRgn (&rp, rh, rh); + + if (GWorld_p (thePort)) + LockPixels (CPORT_PIXMAP (thePort)); + + { + INTEGER adjusted_mode; + + adjusted_mode = PORT_PEN_MODE (thePort); + if (adjusted_mode < blend) + adjusted_mode = adjusted_mode % 0x40 | 8; + ROMlib_blt_pn (rh, adjusted_mode); + } + /* ROMlib_bltrgn (rh, thePort->pnPat, Cx(thePort->pnMode) % 0x40 | 8, + (Rect *) 0, (Rect *) 0); */ + + if (GWorld_p (thePort)) + UnlockPixels (CPORT_PIXMAP (thePort)); + + DisposeRgn (rh); + ALLOCAEND } diff --git a/src/qStdOval.c b/src/qStdOval.cpp similarity index 98% rename from src/qStdOval.c rename to src/qStdOval.cpp index bde2ce83..3de85414 100644 --- a/src/qStdOval.c +++ b/src/qStdOval.cpp @@ -16,6 +16,8 @@ char ROMlib_rcsid_qStdOval[] = #include "rsys/cquick.h" #include "rsys/picture.h" +using namespace Executor; + P2(PUBLIC pascal trap, void, StdOval, GrafVerb, v, Rect *, rp) { Rect r; diff --git a/src/qStdPic.c b/src/qStdPic.cpp similarity index 98% rename from src/qStdPic.c rename to src/qStdPic.cpp index 773b226e..150675a7 100644 --- a/src/qStdPic.c +++ b/src/qStdPic.cpp @@ -19,6 +19,8 @@ char ROMlib_rcsid_qStdPic[] = #include "rsys/print.h" #include "rsys/text.h" +using namespace Executor; + P3(PUBLIC pascal trap, void, StdComment, INTEGER, kind, INTEGER, size, Handle, hand) { diff --git a/src/qStdPoly.c b/src/qStdPoly.cpp similarity index 96% rename from src/qStdPoly.c rename to src/qStdPoly.cpp index 607beee1..079dc9ef 100644 --- a/src/qStdPoly.c +++ b/src/qStdPoly.cpp @@ -19,6 +19,12 @@ char ROMlib_rcsid_qStdPoly[] = #include "rsys/cquick.h" #include "rsys/picture.h" +using namespace Executor; + +namespace Executor { + PRIVATE void polyrgn(PolyHandle, RgnHandle); +} + A2(PRIVATE, void, polyrgn, PolyHandle, ph, RgnHandle, rh) { Point *pp, *ep; diff --git a/src/qStdRRect.c b/src/qStdRRect.cpp similarity index 99% rename from src/qStdRRect.c rename to src/qStdRRect.cpp index b53331df..bec54a85 100644 --- a/src/qStdRRect.c +++ b/src/qStdRRect.cpp @@ -17,6 +17,8 @@ char ROMlib_rcsid_qStdRRect[] = #include "rsys/cquick.h" #include "rsys/picture.h" +using namespace Executor; + #define TERM (*ip++ = RGNSTOPX) #define ADD4(y, x1, x2) \ diff --git a/src/qStdRect.c b/src/qStdRect.cpp similarity index 98% rename from src/qStdRect.c rename to src/qStdRect.cpp index 3820deb0..0e715c2c 100644 --- a/src/qStdRect.c +++ b/src/qStdRect.cpp @@ -17,6 +17,8 @@ char ROMlib_rcsid_qStdRect[] = #include "rsys/cquick.h" #include "rsys/picture.h" +using namespace Executor; + P2(PUBLIC pascal trap, void, StdRect, GrafVerb, v, Rect *, rp) { RgnHandle rh, rh2; diff --git a/src/qStdRgn.c b/src/qStdRgn.cpp similarity index 97% rename from src/qStdRgn.c rename to src/qStdRgn.cpp index 411bf63e..e16bbaf2 100644 --- a/src/qStdRgn.c +++ b/src/qStdRgn.cpp @@ -30,18 +30,18 @@ char ROMlib_rcsid_qStdRgn[] = #include "rsys/srcblt.h" #include "rsys/dirtyrect.h" -PUBLIC WriteWhenType ROMlib_when = WriteInBltrgn; +using namespace Executor; +PUBLIC WriteWhenType Executor::ROMlib_when = WriteInBltrgn; void -ROMlib_WriteWhen (WriteWhenType when) +Executor::ROMlib_WriteWhen (WriteWhenType when) { ROMlib_when = when; } - void -ROMlib_blt_rgn_update_dirty_rect +Executor::ROMlib_blt_rgn_update_dirty_rect (RgnHandle rh, int16 mode, boolean_t tile_src_p, int bpp, const PixMap *src_pm, PixMap *dst_pm, @@ -64,7 +64,7 @@ ROMlib_blt_rgn_update_dirty_rect { if (bpp == 1) { - PixMap *new_src_pm = alloca (sizeof *new_src_pm); + PixMap *new_src_pm = (PixMap*)alloca (sizeof *new_src_pm); int baseaddr_size, height, row_bytes; uint8 *new_bits, *s, *d; int y; @@ -233,7 +233,7 @@ ROMlib_blt_rgn_update_dirty_rect } -const int ROMlib_log2[] = +const int Executor::ROMlib_log2[] = { -1, 0, @@ -245,7 +245,7 @@ const int ROMlib_log2[] = }; -const uint32 ROMlib_pixel_tile_scale[6] = +const uint32 Executor::ROMlib_pixel_tile_scale[6] = { 0xFFFFFFFF, 0x55555555, @@ -255,7 +255,7 @@ const uint32 ROMlib_pixel_tile_scale[6] = 0x00000001, }; -const uint32 ROMlib_pixel_size_mask[6] = +const uint32 Executor::ROMlib_pixel_size_mask[6] = { 0x00000001, 0x00000003, @@ -420,7 +420,7 @@ blt_pixpat_to_pixmap_simple_mode (RgnHandle rh, INTEGER mode, { warning_unexpected ("xdata handle NULL_STRING"); xh = (xdata_handle_t) NewHandle (sizeof (xdata_t)); - HxX (xh, raw_pat_bits_mem) = RM (NULL); + HxX (xh, raw_pat_bits_mem) = (Ptr)RM (NULL); src->patXData = (Handle) RM (xh); xdata_valid_p = FALSE; handle_size_wrong_p = FALSE; @@ -672,8 +672,8 @@ theport_bpp (void) } -inline void -ROMlib_blt_pn (RgnHandle rh, INTEGER mode) +PUBLIC void +Executor::ROMlib_blt_pn (RgnHandle rh, INTEGER mode) { int bpp = theport_bpp (); diff --git a/src/qStdText.c b/src/qStdText.cpp similarity index 97% rename from src/qStdText.c rename to src/qStdText.cpp index 2bdb38d2..9a3e4383 100644 --- a/src/qStdText.c +++ b/src/qStdText.cpp @@ -23,6 +23,8 @@ char ROMlib_rcsid_qStdText[] = #include "rsys/safe_alloca.h" +using namespace Executor; + #undef ALLOCABEGIN #if !defined(NDEBUG) @@ -34,7 +36,12 @@ char ROMlib_rcsid_qStdText[] = #undef ALLOCA #define ALLOCA(n) SAFE_alloca(n) -#include "ultable.c" +namespace Executor { +#include "ultable.ctable" + PRIVATE void charblit(BitMap * fbmp, BitMap * tbmp, + Rect * srect, Rect * drect, INTEGER firsttime); + +} A5(PRIVATE, void, charblit, BitMap *, fbmp, BitMap *, tbmp, /* INTERNAL */ Rect *, srect, Rect *, drect, INTEGER, firsttime) @@ -236,7 +243,7 @@ A5(PRIVATE, void, charblit, BitMap *, fbmp, BitMap *, tbmp, /* INTERNAL */ */ PUBLIC LONGINT -text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, +Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, FontInfo *finfop, INTEGER *charlocp, text_helper_action_t action) { Point num, den; @@ -596,7 +603,7 @@ text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, stylemap2 = stylemap; stylemap3 = stylemap; stylemap2.baseAddr = stylemap.baseAddr; - stylemap3.baseAddr = RM((Ptr) ALLOCA(nbytes)); + stylemap3.baseAddr = (Ptr)RM( ALLOCA(nbytes)); #if 0 BlockMove(MR(stylemap2.baseAddr), MR(stylemap3.baseAddr), (Size) nbytes); #else @@ -687,10 +694,10 @@ text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, return retval; } -PUBLIC boolean_t ROMlib_text_output_disabled_p; +PUBLIC boolean_t Executor::ROMlib_text_output_disabled_p; PUBLIC boolean_t -disable_text_printing (void) +Executor::disable_text_printing (void) { boolean_t retval; @@ -700,7 +707,7 @@ disable_text_printing (void) } PUBLIC void -set_text_printing (boolean_t state) +Executor::set_text_printing (boolean_t state) { ROMlib_text_output_disabled_p = state; } @@ -725,7 +732,7 @@ P4(PUBLIC pascal trap, void, StdText, INTEGER, n, Ptr, textbufp, #define FIXEDONEHALF (1L << 15) PUBLIC INTEGER -xStdTxMeas (INTEGER n, Byte *p, Point *nump, Point *denp, +Executor::xStdTxMeas (INTEGER n, Byte *p, Point *nump, Point *denp, FontInfo *finfop, INTEGER *charlocp) { INTEGER retval; diff --git a/src/qText.c b/src/qText.cpp similarity index 97% rename from src/qText.c rename to src/qText.cpp index a1d0972f..2a587b84 100644 --- a/src/qText.c +++ b/src/qText.cpp @@ -18,6 +18,8 @@ char ROMlib_rcsid_qText[] = #include "rsys/picture.h" #include "rsys/glue.h" +using namespace Executor; + P1(PUBLIC pascal trap, void, TextFont, INTEGER, f) { if (thePort) @@ -81,7 +83,7 @@ P3(PUBLIC pascal trap, void, DrawText, Ptr, tb, INTEGER, fb, INTEGER, bc) * with C strings. */ void -DrawText_c_string (char *string) +Executor::DrawText_c_string (char *string) { DrawText ((Ptr) string, 0, strlen (string)); } diff --git a/src/qt.c b/src/qt.cpp similarity index 99% rename from src/qt.c rename to src/qt.cpp index 954bf5d9..4c9d8c26 100644 --- a/src/qt.c +++ b/src/qt.cpp @@ -10,6 +10,8 @@ char ROMlib_rcsid_qt[] = #include "rsys/common.h" #include "QuickTime.h" +using namespace Executor; + #if defined (CYGWIN32) #define LIB_LOOKUP(lib, proc) \ diff --git a/src/rawpatblt.c b/src/rawpatblt.cpp similarity index 98% rename from src/rawpatblt.c rename to src/rawpatblt.cpp index 5a0eed3c..af6c6be3 100644 --- a/src/rawpatblt.c +++ b/src/rawpatblt.cpp @@ -18,7 +18,11 @@ char ROMlib_rcsid_rawpatblt[] = /* This macro is used in `rawpatstubs.c' */ #define NEXT_ROW (dst = (uint32 *) &row_base[s[1].offset]) -#include "rawpatstubs.c" +namespace Executor { +#include "rawpatstubs.ctable" +} + +using namespace Executor; /* Dummy table, not actually dereferenced. */ const void *xdblt_nop_table[1] = { NULL }; diff --git a/src/rawsrcblt.c b/src/rawsrcblt.cpp similarity index 98% rename from src/rawsrcblt.c rename to src/rawsrcblt.cpp index a4fc1fa4..bb2b4b8c 100644 --- a/src/rawsrcblt.c +++ b/src/rawsrcblt.cpp @@ -26,9 +26,12 @@ const void *srcblt_nop_table[1] = { NULL }; /* This macro is used in `rawsrcstubs.c' */ #define NEXT_ROW (src = (const uint32 *) &src_row_base[s[1].offset], \ dst = (uint32 *) &dst_row_base[s[1].offset]) - -#include "rawsrcstubs.c" +namespace Executor { +#include "rawsrcstubs.ctable" +} + +using namespace Executor; const void **srcblt_noshift_stubs[8] = { srcblt_copy_noshift_labels, diff --git a/src/redrawscreen.c b/src/redrawscreen.cpp similarity index 94% rename from src/redrawscreen.c rename to src/redrawscreen.cpp index ebb5d0f5..8d05ec7b 100644 --- a/src/redrawscreen.c +++ b/src/redrawscreen.cpp @@ -15,8 +15,10 @@ char ROMlib_rcsid_redrawscreen[] = #include "rsys/cquick.h" #include "rsys/vdriver.h" +using namespace Executor; + void -redraw_screen (void) +Executor::redraw_screen (void) { THEGDEVICE_SAVE_EXCURSION (MR (MainDevice), diff --git a/src/refresh.c b/src/refresh.cpp similarity index 96% rename from src/refresh.c rename to src/refresh.cpp index 516f527e..254c3e2d 100644 --- a/src/refresh.c +++ b/src/refresh.cpp @@ -20,6 +20,7 @@ char ROMlib_rcsid_refresh[] = #include "TimeMgr.h" #include "OSEvent.h" +using namespace Executor; static TMTask refresh_tm_task; @@ -63,7 +64,7 @@ A0 (PUBLIC, void, C_handle_refresh) void -dequeue_refresh_task (void) +Executor::dequeue_refresh_task (void) { /* Make sure refresh is off when the task isn't queued up, * so other drawing happens. @@ -76,15 +77,15 @@ dequeue_refresh_task (void) static boolean_t shadow_screen_invalid_p; void -set_refresh_rate (int new) +Executor::set_refresh_rate (int new1) { #if defined (VDRIVER_SUPPORTS_REAL_SCREEN_BLITS) int old_vis = host_set_cursor_visible (FALSE); #endif /* VDRIVER_SUPPORTS_REAL_SCREEN_BLITS */ static int last_refresh_set = 0; - if (new < 0) - new = 0; + if (new1 < 0) + new1 = 0; #if defined (VDRIVER_SUPPORTS_REAL_SCREEN_BLITS) if (!last_refresh_set && new) @@ -93,7 +94,7 @@ set_refresh_rate (int new) dirty_rect_update_screen (); #endif /* VDRIVER_SUPPORTS_REAL_SCREEN_BLITS */ - if (!last_refresh_set && new) + if (!last_refresh_set && new1) shadow_screen_invalid_p = TRUE; if (!refresh_tm_task_installed_p) @@ -109,7 +110,7 @@ set_refresh_rate (int new) PrimeTime ((QElemPtr) &refresh_tm_task, 400); } - ROMlib_refresh = last_refresh_set = new; + ROMlib_refresh = last_refresh_set = new1; #if defined (VDRIVER_SUPPORTS_REAL_SCREEN_BLITS) host_set_cursor_visible (old_vis); @@ -125,7 +126,7 @@ set_refresh_rate (int new) * data from screen to shadow, and returns TRUE. */ BOOLEAN -find_changed_rect_and_update_shadow (const uint32 *screen, uint32 *shadow, +Executor::find_changed_rect_and_update_shadow (const uint32 *screen, uint32 *shadow, long row_longs, long num_rows, int *top_long, int *left_long, int *bottom_long, int *right_long) diff --git a/src/resGet.c b/src/resGet.cpp similarity index 97% rename from src/resGet.c rename to src/resGet.cpp index f9e1929c..6556f14d 100644 --- a/src/resGet.c +++ b/src/resGet.cpp @@ -29,6 +29,15 @@ char ROMlib_rcsid_resGet[] = #include +namespace Executor { + PRIVATE INTEGER countmapresources(resmaphand, ResType); + PRIVATE Handle getindmapresource(resmaphand, ResType, + INTEGER *); + PRIVATE Handle getnamedmapresource(resmaphand, ResType, StringPtr); +} + +using namespace Executor; + P1(PUBLIC pascal trap, void, SetResLoad, BOOLEAN, load) { ResLoad = load; @@ -296,7 +305,7 @@ pseudo_get_rom_resource (ResType typ, INTEGER id) } #if defined (ULTIMA_III_HACK) -PUBLIC boolean_t ROMlib_ultima_iii_hack; +PUBLIC boolean_t Executor::ROMlib_ultima_iii_hack; #endif P2(PUBLIC pascal trap, Handle, GetResource, ResType, typ, INTEGER, id) diff --git a/src/resGetinfo.c b/src/resGetinfo.cpp similarity index 99% rename from src/resGetinfo.c rename to src/resGetinfo.cpp index de1c2a4a..eaa72250 100644 --- a/src/resGetinfo.c +++ b/src/resGetinfo.cpp @@ -19,6 +19,8 @@ char ROMlib_rcsid_resGetinfo[] = #define STEF_GetResInfoFix +using namespace Executor; + P1(PUBLIC pascal trap, INTEGER, UniqueID, ResType, typ) { static INTEGER startid = 0; diff --git a/src/resGettype.c b/src/resGettype.cpp similarity index 92% rename from src/resGettype.c rename to src/resGettype.cpp index 57fccb03..bb13a2ba 100644 --- a/src/resGettype.c +++ b/src/resGettype.cpp @@ -15,14 +15,19 @@ char ROMlib_rcsid_resGettype[] = #include "rsys/resource.h" #include "rsys/mman.h" -typedef ResType *restypeptr; -MAKE_HIDDEN(restypeptr); - -PRIVATE HIDDEN_restypeptr *ar = 0; - +namespace Executor { + typedef ResType *restypeptr; + MAKE_HIDDEN(restypeptr); + + PRIVATE HIDDEN_restypeptr *ar = 0; + PRIVATE INTEGER inserttypes(resmaphand, INTEGER, BOOLEAN); + PRIVATE INTEGER initar(INTEGER); +} #define ARRN_NOTINITTED (-1) #define ARRN_ALL (-2) +using namespace Executor; + PRIVATE INTEGER arrn = ARRN_NOTINITTED; A0(PUBLIC, void, ROMlib_invalar) /* INTERNAL */ diff --git a/src/resIMIV.c b/src/resIMIV.cpp similarity index 98% rename from src/resIMIV.c rename to src/resIMIV.cpp index 0aeef4c7..7c26bae0 100644 --- a/src/resIMIV.c +++ b/src/resIMIV.cpp @@ -15,6 +15,8 @@ char ROMlib_rcsid_resIMIV[] = #include "MemoryMgr.h" #include "rsys/resource.h" +using namespace Executor; + P1(PUBLIC pascal trap, LONGINT, MaxSizeRsrc, Handle, h) /* IMIV-16 */ { resmaphand map; diff --git a/src/resInit.c b/src/resInit.cpp similarity index 98% rename from src/resInit.c rename to src/resInit.cpp index 1c4cda4c..46332dc0 100644 --- a/src/resInit.c +++ b/src/resInit.cpp @@ -22,6 +22,8 @@ char ROMlib_rcsid_resInit[] = #include "rsys/version.h" #include "rsys/appearance.h" +using namespace Executor; + /* extracts an int32 from a string of the form [^(]*([0-9]*).* * () == 0, any invalid string == -1 */ diff --git a/src/resMisc.c b/src/resMisc.cpp similarity index 98% rename from src/resMisc.c rename to src/resMisc.cpp index 150749b3..d200e815 100644 --- a/src/resMisc.c +++ b/src/resMisc.cpp @@ -14,6 +14,8 @@ char ROMlib_rcsid_resMisc[] = #include "rsys/resource.h" #include "rsys/hook.h" +using namespace Executor; + A1(PUBLIC, INTEGER, ROMlib_setreserr, INTEGER, reserr) /* INTERNAL */ { ResErr = CW(reserr); diff --git a/src/resMod.c b/src/resMod.cpp similarity index 97% rename from src/resMod.c rename to src/resMod.cpp index c84f763e..73d7c0ea 100644 --- a/src/resMod.c +++ b/src/resMod.cpp @@ -19,6 +19,26 @@ char ROMlib_rcsid_resMod[] = #include "rsys/mman.h" #include "rsys/file.h" + +using namespace Executor; + +typedef res_sorttype_t *sorttypeptr; +MAKE_HIDDEN(sorttypeptr); +typedef HIDDEN_sorttypeptr *sorttypehand; + + +namespace Executor { + PRIVATE LONGINT addtype(resmaphand, ResType); + PRIVATE LONGINT addname(resmaphand, StringPtr); + PRIVATE OSErr writemap(resmaphand); + PRIVATE void fillst(sorttypehand, resref *, resref *); + PRIVATE void getdat(INTEGER, LONGINT, LONGINT, Handle *); + PRIVATE void putdat(INTEGER, LONGINT, LONGINT *, Handle); + PRIVATE LONGINT walkst(res_sorttype_t *, res_sorttype_t *, INTEGER, LONGINT); + PRIVATE void compactdata(resmaphand); + +} + P3(PUBLIC pascal trap, void, SetResInfo, Handle, res, INTEGER, id, StringPtr, name) { @@ -328,10 +348,6 @@ A2(PUBLIC, void, ROMlib_wr, resmaphand, map, resref *, rr) /* INTERNAL */ ROMlib_setreserr(noErr); } -typedef res_sorttype_t *sorttypeptr; -MAKE_HIDDEN(sorttypeptr); -typedef HIDDEN_sorttypeptr *sorttypehand; - A3(PRIVATE, void, fillst, sorttypehand, st, resref *, rp, resref *, rep) { res_sorttype_t *end = STARH(st), *sp; diff --git a/src/resOpen.c b/src/resOpen.cpp similarity index 96% rename from src/resOpen.c rename to src/resOpen.cpp index 773e8321..19948129 100644 --- a/src/resOpen.c +++ b/src/resOpen.cpp @@ -22,8 +22,10 @@ char ROMlib_rcsid_resOpen[] = #include "rsys/osevent.h" #include "rsys/prefs.h" +using namespace Executor; + PUBLIC void -HCreateResFile_helper (INTEGER vrefnum, LONGINT parid, Str255 name, +Executor::HCreateResFile_helper (INTEGER vrefnum, LONGINT parid, Str255 name, OSType creator, OSType type, ScriptCode script) { INTEGER f; @@ -76,7 +78,7 @@ P3(PUBLIC pascal trap, void, HCreateResFile, INTEGER, vrefnum, LONGINT, parid, #if defined(BINCOMPAT) -Handle ROMlib_mgetres(resmaphand map, resref *rr) +Handle Executor::ROMlib_mgetres(resmaphand map, resref *rr) { Handle retval; @@ -118,7 +120,7 @@ Handle ROMlib_mgetres(resmaphand map, resref *rr) #else -void ROMlib_mgetres2( resmaphand unused1, resref *unused2 ) +void Executor::ROMlib_mgetres2( resmaphand unused1, resref *unused2 ) { gui_abort(); } @@ -127,6 +129,10 @@ void ROMlib_mgetres2( resmaphand unused1, resref *unused2 ) #endif +namespace Executor { + PUBLIC pascal trap void C_dcmp_template(Ptr,Ptr,Ptr, Size); +} + P4 (PUBLIC pascal trap, void, dcmp_template, Ptr, source, Ptr, dest, Ptr, working, Size, len) { @@ -236,16 +242,15 @@ decompress_setup (INTEGER rn, int32 *dlenp, int32 *final_sizep, int32 *offsetp, PRIVATE Handle mgetres_helper (resmaphand map, resref *rr, int32 dlen, Handle retval) { - int32 dcmp_offset; - Handle dcmp_handle; - Ptr dcmp_workspace; - int32 uncompressed_size; + int32 dcmp_offset = 0; + Handle dcmp_handle = NULL; + Ptr dcmp_workspace = NULL; + int32 uncompressed_size = 0; Ptr xxx; OSErr err; - boolean_t compressed_p; - boolean_t done_p; + bool compressed_p; + bool done_p = false; - done_p = FALSE; compressed_p = (rr->ratr & resCompressed) && system_version >= 0x700; if (compressed_p) @@ -307,7 +312,7 @@ PRIVATE Handle mgetres_helper (resmaphand map, resref *rr, int32 dlen, state = hlock_return_orig_state (dcmp_handle); dcmp = (typeof (dcmp)) STARH (dcmp_handle); HLock (retval); - CToPascalCall (dcmp, CTOP_dcmp_template, + CToPascalCall (&dcmp, CTOP_dcmp_template, xxx, STARH (retval), dcmp_workspace, dlen); HUnlock (retval); @@ -332,7 +337,7 @@ PRIVATE Handle mgetres_helper (resmaphand map, resref *rr, int32 dlen, */ Handle -ROMlib_mgetres2 (resmaphand map, resref *rr) +Executor::ROMlib_mgetres2 (resmaphand map, resref *rr) { Handle retval; diff --git a/src/resPartial.c b/src/resPartial.cpp similarity index 98% rename from src/resPartial.c rename to src/resPartial.cpp index 89642dfe..9b2241fe 100644 --- a/src/resPartial.c +++ b/src/resPartial.cpp @@ -14,6 +14,8 @@ char ROMlib_rcsid_resPartial[] = #include "rsys/resource.h" #include "rsys/file.h" +using namespace Executor; + P4 (PUBLIC pascal trap, void, ReadPartialResource, Handle, res, int32, offset, Ptr, buffer, int32, count) { diff --git a/src/resSetcur.c b/src/resSetcur.cpp similarity index 98% rename from src/resSetcur.c rename to src/resSetcur.cpp index 6e28cd5f..c00fb3bf 100644 --- a/src/resSetcur.c +++ b/src/resSetcur.cpp @@ -13,6 +13,8 @@ char ROMlib_rcsid_resSetcur[] = #include "ResourceMgr.h" #include "rsys/resource.h" +using namespace Executor; + P0(PUBLIC pascal trap, INTEGER, CurResFile) { ROMlib_setreserr(noErr); diff --git a/src/rgbutil.c b/src/rgbutil.cpp similarity index 98% rename from src/rgbutil.c rename to src/rgbutil.cpp index 7f4f6b2c..d2309a99 100644 --- a/src/rgbutil.c +++ b/src/rgbutil.cpp @@ -13,6 +13,8 @@ char ROMlib_rcsid_rgbutil[] = #include "rsys/rgbutil.h" #include "rsys/cquick.h" +using namespace Executor; + /* This file contains routines useful for manipulating RGB pixels. * * `make_rgb_spec' fills in an rgb_spec_t structure with the appropriate @@ -202,7 +204,7 @@ rgbcolor_to_pixel (const rgb_spec_t *spec, void -make_rgb_spec (rgb_spec_t *rgb_spec, +Executor::make_rgb_spec (rgb_spec_t *rgb_spec, int bpp, boolean_t big_endian_p, uint32 xor_mask, int num_red_bits, int low_red_bit, diff --git a/src/romlib_stubs.c b/src/romlib_stubs.cpp similarity index 84% rename from src/romlib_stubs.c rename to src/romlib_stubs.cpp index 20067430..8b0b7c17 100644 --- a/src/romlib_stubs.c +++ b/src/romlib_stubs.cpp @@ -10,6 +10,14 @@ char ROMlib_rcsid_stubs[] = #include "rsys/common.h" #include "rsys/glue.h" +namespace Executor { + void ROMlib_printstring(unsigned char*); + void ROMlib_printostype(OSType); + void ROMlib_hook(LONGINT); + +} +using namespace Executor; + #if !defined(NDEBUG) && !defined(MSDOS) #undef putchar diff --git a/src/scrap.c b/src/scrap.cpp similarity index 98% rename from src/scrap.c rename to src/scrap.cpp index f4c4b690..13bf0182 100644 --- a/src/scrap.c +++ b/src/scrap.cpp @@ -28,6 +28,8 @@ char ROMlib_rcsid_scrap[] = #include "win_clip.h" #endif +using namespace Executor; + P0(PUBLIC pascal trap, PScrapStuff, InfoScrap) { if (Cx(ScrapState) < 0) @@ -35,6 +37,10 @@ P0(PUBLIC pascal trap, PScrapStuff, InfoScrap) return((PScrapStuff)&ScrapSize); } +namespace Executor { + PRIVATE OSErr cropen(INTEGER*); +} + A1(PRIVATE, OSErr, cropen, INTEGER *, fp) { OSErr retval; @@ -146,7 +152,7 @@ P3(PUBLIC pascal trap, LONGINT, PutScrap, LONGINT, len, ResType, rest, Ptr, p) if (retval != noErr) /*-->*/ return(retval); } -#if defined(X) || defined(NEXTSTEP) || defined (SDL) +#if defined(X) || defined(MACOSX_) || defined (SDL) PutScrapX(rest, len, (char *) p, CW (ScrapCount)); #endif /* defined(X) */ if (Cx(ScrapState) == 0) { @@ -253,7 +259,7 @@ P3(PUBLIC pascal trap, LONGINT, GetScrap, Handle, h, ResType, rest, h = temph; } -#if defined(X) || defined(NEXTSTEP) || defined (SDL) +#if defined(X) || defined(MACOSX_) || defined (SDL) s = GetScrapX(rest, (char **) h); if (s >= 0) { *off = 0; /* ack... could mess people up */ diff --git a/src/screen-dump.c b/src/screen-dump.cpp similarity index 98% rename from src/screen-dump.c rename to src/screen-dump.cpp index 022b0741..fc66b04f 100644 --- a/src/screen-dump.c +++ b/src/screen-dump.cpp @@ -26,6 +26,8 @@ char ROMlib_rcsid_screendump[] = #include "rsys/vdriver.h" #include "rsys/screen-dump.h" +using namespace Executor; + #define II_little_endian 0x4949 #define MM_big_endian 0x4D4D @@ -145,7 +147,7 @@ dump_indirect_pm (PixMap *pm) if ( (bpp != 8 && bpp != 4) || VDRIVER_BYPASS_INTERNAL_FBUF_P ()) { - tiff_pm = alloca (sizeof *tiff_pm); + tiff_pm = (PixMap*)alloca (sizeof *tiff_pm); /* compute the bpp of the pixmap that will be converted to a tif */ bpp = bpp <= 4 ? 4 : 8; @@ -154,7 +156,7 @@ dump_indirect_pm (PixMap *pm) TEMP_ALLOC_ALLOCATE (fbuf, temp_fbuf_bits, fbuf_size); row_bytes = (width * bpp + 31) / 32 * 4; - tiff_pm->baseAddr = RM (fbuf); + tiff_pm->baseAddr = (Ptr)RM (fbuf); tiff_pm->rowBytes = CW (row_bytes | PIXMAP_DEFAULT_ROW_BYTES); tiff_pm->bounds = pm->bounds; @@ -304,7 +306,7 @@ dump_fn_t dump_fns[] = }; void -do_dump_screen (void) +Executor::do_dump_screen (void) { GDHandle gd; PixMapHandle gd_pmh; diff --git a/src/script.c b/src/script.cpp similarity index 99% rename from src/script.c rename to src/script.cpp index 27b32e2c..0a5a100f 100644 --- a/src/script.c +++ b/src/script.cpp @@ -29,6 +29,8 @@ char ROMlib_rcsid_script[] = #include +using namespace Executor; + /* * NOTE: these are stubs to help me make FileMaker Pro go. */ @@ -89,6 +91,11 @@ P1(PUBLIC pascal trap, INTEGER, Font2Script, INTEGER, fontnum) * butchered Transliterate provided for Excel 3.0 */ +namespace Executor { + PRIVATE char upper(char); + PRIVATE char lower(char); +} + #define LOWERTOUPPEROFFSET 'A' - 'a' A1(PRIVATE, char, upper, char, ch) { @@ -870,7 +877,7 @@ P9(PUBLIC pascal trap, INTEGER, PixelToChar, warning_unimplemented ("poorly implemented"); - locs = alloca( sizeof(INTEGER) * (textLen + 1)); + locs = (INTEGER*)alloca( sizeof(INTEGER) * (textLen + 1)); swapped_numer.h = CW (numer.h); swapped_numer.v = CW (numer.v); diff --git a/src/segment.c b/src/segment.cpp similarity index 93% rename from src/segment.c rename to src/segment.cpp index a1219b5f..1c69d476 100644 --- a/src/segment.c +++ b/src/segment.cpp @@ -62,12 +62,15 @@ char ROMlib_rcsid_segment[] = #include "dosevents.h" #include "vga.h" #endif /* defined(MSDOS) */ - +namespace Executor { typedef finderinfo *finderinfoptr; MAKE_HIDDEN(finderinfoptr); typedef HIDDEN_finderinfoptr *finderinfohand; +} -PUBLIC int ROMlib_cacheheuristic = FALSE; +using namespace Executor; + +PUBLIC int Executor::ROMlib_cacheheuristic = FALSE; #if defined(ONLY_DESTROY_BETWEEN_CODE_SEGMENTS) @@ -302,46 +305,51 @@ colon_colon_copy (StringPtr dst, const char *src) * unsupported case and continue using the old code with non-netatalk naming. */ -#define MAC_LOCAL_FROM_UNIX_LOCAL(s) \ -({ \ - char *_s; \ - unsigned char *retval; \ - int len; \ +#define MAC_LOCAL_FROM_UNIX_LOCAL(s) \ +({ \ + char *_s; \ + unsigned char *retval; \ + int len; \ int count; \ char *next_slash; \ - \ - _s = (s); \ - len = strlen (_s); \ - retval = alloca (len + 2); \ + \ + _s = (s); \ + len = strlen (_s); \ + retval = (unsigned char*)alloca (len + 2);\ retval[1] = ':'; \ count = 1; \ - \ - do \ - { \ - int component_len, shrinkage; \ - \ - next_slash = strchr (_s, '/'); \ - if (next_slash) \ - component_len = next_slash - _s; \ - else \ - component_len = strlen (_s); \ - memcpy (retval+count+1, _s, component_len); \ - shrinkage = ROMlib_UNIX7_to_Mac ((char *) retval+count+1, \ + \ + do \ + { \ + int component_len, shrinkage; \ + \ + next_slash = strchr (_s, '/'); \ + if (next_slash) \ + component_len = next_slash - _s; \ + else \ + component_len = strlen (_s); \ + memcpy (retval+count+1, _s, component_len); \ + shrinkage = ROMlib_UNIX7_to_Mac ((char *) retval+count+1, \ component_len); \ - count += component_len - shrinkage; \ - if (next_slash) \ - { \ - _s += component_len + 1; /* skip the '/', too */ \ - retval[count+1] = ':'; \ - ++count; \ - } \ - } \ - while (next_slash); \ - \ - retval[0] = count; \ - retval; \ + count += component_len - shrinkage; \ + if (next_slash) { \ + \ + _s += component_len + 1; /* skip the '/', too */ \ + retval[count+1] = ':'; \ + ++count; \ + } \ + } \ + while (next_slash); \ + \ + retval[0] = count; \ + retval; \ }) +namespace Executor { + PRIVATE BOOLEAN argv_to_appfile(char*, AppFile *); + PUBLIC void ROMlib_seginit(LONGINT, char **); /* INTERNAL */ +} + A2(PRIVATE, BOOLEAN, argv_to_appfile, char *, uname, AppFile *, ap) { int namelen, pathlen; @@ -408,7 +416,7 @@ A2(PRIVATE, BOOLEAN, argv_to_appfile, char *, uname, AppFile *, ap) { totnamelen = strlen(uname); pathlen = totnamelen - sysnamelen + 2; /* count & NUL */ - path = alloca(pathlen); + path = (unsigned char*)alloca(pathlen); strcpy((char *) path+1, uname + sysnamelen); /* path has count and */ path[0] = pathlen - 2; /* is NUL terminated */ path[1] = ':'; @@ -426,7 +434,7 @@ A2(PRIVATE, BOOLEAN, argv_to_appfile, char *, uname, AppFile *, ap) { int len; len = strlen (uname); - path = alloca (len + 1); + path = (unsigned char*)alloca (len + 1); colon_colon_copy (path, uname); cinfo.hFileInfo.ioVRefNum = 0; wpb.ioNamePtr = RM(path); @@ -460,11 +468,11 @@ A2(PRIVATE, BOOLEAN, argv_to_appfile, char *, uname, AppFile *, ap) return retval; } -#if defined(NEXTSTEP) && defined(BINCOMPAT) -PUBLIC INTEGER ROMlib_acceptsanotherfile = TRUE; +#if defined(MACOSX_) && defined(BINCOMPAT) +PUBLIC INTEGER Executor::ROMlib_acceptsanotherfile = TRUE; #endif -PUBLIC int ROMlib_print; +PUBLIC int Executor::ROMlib_print; #if !defined (MSDOS) && !defined(CYGWIN32) #define PATH_SEPARATER ':' @@ -638,7 +646,7 @@ PRIVATE void execme(const char *toexec) } #endif /* defined(MSDOS) */ -PUBLIC int ROMlib_nobrowser = 0; +PUBLIC int Executor::ROMlib_nobrowser = 0; PRIVATE BOOLEAN valid_browser( void ) { @@ -769,7 +777,7 @@ P0(PUBLIC pascal trap, void, ExitToShell) autorepeatonX(); #endif /* X */ -#if defined(SUN) && !defined(X) && !defined(NEXTSTEP) +#if defined(SUN) && !defined(X) && !defined(MACOSX_) close(_windowfd); /* may be bad choice */ BlockMove(_savebits, _addr, (Size) _nb); #endif /* SUN && !defined */ @@ -834,7 +842,7 @@ P1(PUBLIC pascal trap, void, LoadSeg, INTEGER volatile, segno) unsigned short offbytes; INTEGER taboff, nentries, savenentries; short *ptr, *saveptr; -#if defined(NEXTSTEP) +#if defined(MACOSX_) if (ROMlib_appbit && !(ROMlib_appbit & ROMlib_whichapps)) ExitToShell(); #endif @@ -875,6 +883,10 @@ P1(PUBLIC pascal trap, void, LoadSeg, INTEGER volatile, segno) #define SEGNOOFP(p) (CW(((INTEGER *)p)[-1])) +namespace Executor { + PRIVATE void unpatch(Ptr, Ptr); +} + A2(PRIVATE, void, unpatch, Ptr, segstart, Ptr, p) { INTEGER *ip; diff --git a/src/serial.c b/src/serial.cpp similarity index 90% rename from src/serial.c rename to src/serial.cpp index 06f5d6ab..84a701af 100644 --- a/src/serial.c +++ b/src/serial.cpp @@ -16,9 +16,15 @@ char ROMlib_rcsid_serial[] = #include "rsys/common.h" -#if defined (MACOSX) -#warning "No serial support for now" -#else /* !defined (MACOSX) */ +#if defined (MACOSX_) +#warning bad serial support right now +//TODO: this seems to use sgtty functions instead of termios. +#include +#include +#include +#include +#include +#endif /* !defined (MACOSX) */ #include "Serial.h" #include "DeviceMgr.h" @@ -42,10 +48,12 @@ char ROMlib_rcsid_serial[] = #include #endif -#if defined (LINUX) +#if defined (LINUX) || defined (MACOSX_) #include #endif +using namespace Executor; + #if defined (__alpha) || defined (LINUX) #define TERMIO /* #define MSDOS ick! */ @@ -213,6 +221,14 @@ hidden, *hiddenp; MAKE_HIDDEN(hiddenp); typedef HIDDEN_hiddenp *hiddenh; +namespace Executor { + PRIVATE DCtlPtr otherdctl(ParmBlkPtr); + PRIVATE OSErr serset(LONGINT fd, INTEGER param); + PRIVATE OSErr serxhshake(LONGINT fd, SerShk *sershkp); + PRIVATE OSErr setbaud(LONGINT fd, INTEGER baud); + PRIVATE OSErr flow(LONGINT fd, LONGINT flag); + PRIVATE OSErr ctlbrk(LONGINT fd, INTEGER flag); +} A1(PRIVATE, DCtlPtr, otherdctl, ParmBlkPtr, pbp) { @@ -220,23 +236,23 @@ A1(PRIVATE, DCtlPtr, otherdctl, ParmBlkPtr, pbp) h = 0; switch (CW(pbp->cntrlParam.ioCRefNum)) { - case AINREFNUM: - h = GetDCtlEntry(AOUTREFNUM); - break; - case AOUTREFNUM: - h = GetDCtlEntry(AINREFNUM); - break; - case BINREFNUM: - h = GetDCtlEntry(BOUTREFNUM); - break; - case BOUTREFNUM: - h = GetDCtlEntry(BINREFNUM); - break; + case AINREFNUM: + h = GetDCtlEntry(AOUTREFNUM); + break; + case AOUTREFNUM: + h = GetDCtlEntry(AINREFNUM); + break; + case BINREFNUM: + h = GetDCtlEntry(BOUTREFNUM); + break; + case BOUTREFNUM: + h = GetDCtlEntry(BINREFNUM); + break; } return h ? STARH(h) : 0; } -#if defined (LINUX) || defined (NEXTSTEP) +#if defined (LINUX) || defined (MACOSX_) /* * NOTE: Currently we're using cufa and cufb; we really should @@ -249,37 +265,37 @@ PRIVATE char *specialname(ParmBlkPtr pbp, const char **lockfilep, char *retval; switch (CW(pbp->cntrlParam.ioCRefNum)) { - case AINREFNUM: - case AOUTREFNUM: + case AINREFNUM: + case AOUTREFNUM: #if defined (NEXTSTEP) - retval = "/dev/cufa"; - *lockfilep = "/usr/spool/uucp/LCK/LCK..cufa"; - *tempfilep = "/usr/spool/uucp/LCK/etempcufa"; + retval = "/dev/cufa"; + *lockfilep = "/usr/spool/uucp/LCK/LCK..cufa"; + *tempfilep = "/usr/spool/uucp/LCK/etempcufa"; #elif defined (LINUX) - retval = "/dev/cua0"; - *lockfilep = 0; /* for now */ - *tempfilep = 0; /* for now */ + retval = "/dev/cua0"; + *lockfilep = 0; /* for now */ + *tempfilep = 0; /* for now */ #endif - break; - case BINREFNUM: - case BOUTREFNUM: + break; + case BINREFNUM: + case BOUTREFNUM: #if defined (NEXTSTEP) - retval = "/dev/cufb"; - *lockfilep = "/usr/spool/uucp/LCK/LCK..cufb"; - *tempfilep = "/usr/spool/uucp/LCK/etempcufa"; + retval = "/dev/cufb"; + *lockfilep = "/usr/spool/uucp/LCK/LCK..cufb"; + *tempfilep = "/usr/spool/uucp/LCK/etempcufa"; #elif defined (LINUX) - retval = "/dev/cua1"; - *lockfilep = 0; - *tempfilep = 0; + retval = "/dev/cua1"; + *lockfilep = 0; + *tempfilep = 0; #endif - break; - default: - *lockfilep = 0; - retval = 0; + break; + default: + *lockfilep = 0; + retval = 0; } return retval; } -#endif /* defined (LINUX) || defined (NEXTSTEP) */ +#endif /* defined (LINUX) || defined (MACOSX_) */ typedef void (*compfuncp)( void ); @@ -313,7 +329,7 @@ void callcomp(ParmBlkPtr pbp, compfuncp comp, OSErr err) #define SERIALDEBUG -#if defined (LINUX) || defined (NEXTSTEP) +#if defined (LINUX) || defined (MACOSX_) PRIVATE const char *lockname; #endif @@ -321,9 +337,9 @@ A2(PUBLIC, OSErr, ROMlib_serialopen, ParmBlkPtr, pbp, /* INTERNAL */ DCtlPtr, dcp) { OSErr err; - auto DCtlPtr otherp; /* auto due to old compiler bug */ + DCtlPtr otherp; /* auto due to old compiler bug */ hiddenh h; -#if defined (LINUX) || defined (NEXTSTEP) +#if defined (LINUX) || defined (MACOSX_) const char *devname, *tempname; LONGINT fd, ourpid, theirpid, newfd, oumask; #endif @@ -337,7 +353,7 @@ A2(PUBLIC, OSErr, ROMlib_serialopen, ParmBlkPtr, pbp, /* INTERNAL */ *STARH(h) = *STARH((hiddenh) (long) MR(otherp->dCtlStorage)); dcp->dCtlFlags |= CWC(OPENBIT); } else { -#if defined (LINUX) || defined (NEXTSTEP) +#if defined (LINUX) || defined (MACOSX_) err = permErr; if ((devname = specialname(pbp, &lockname, &tempname))) { oumask = umask(0); @@ -371,7 +387,7 @@ A2(PUBLIC, OSErr, ROMlib_serialopen, ParmBlkPtr, pbp, /* INTERNAL */ } #endif if (err == noErr) { -#if defined (LINUX) || defined (NEXTSTEP) +#if defined (LINUX) || defined (MACOSX_) HxX(h, fd) = ROMlib_priv_open(devname, O_BINARY|O_RDWR); if (HxX(h, fd) < 0) err = HxX(h, fd); /* error return piggybacked */ @@ -394,7 +410,7 @@ A2(PUBLIC, OSErr, ROMlib_serialopen, ParmBlkPtr, pbp, /* INTERNAL */ (CW(pbp->cntrlParam.ioCRefNum) == AINREFNUM || CW(pbp->cntrlParam.ioCRefNum) == AOUTREFNUM) ? CW(SPPortA) : CW(SPPortB)); -#if defined (LINUX) || defined (NEXTSTEP) +#if defined (LINUX) || defined (MACOSX_) } #endif } @@ -433,7 +449,7 @@ A2(PUBLIC, OSErr, ROMlib_serialprime, ParmBlkPtr, pbp, /* INTERNAL */ else { /* this may have to be changed since we aren't looking for parity and framing errors */ -#if defined (LINUX) || defined (NEXTSTEP) +#if defined (LINUX) || defined (MACOSX_) pbp->ioParam.ioActCount = CL(read(HxX(h, fd), buf, req_count)); #elif defined (MSDOS) || defined (CYGWIN32) pbp->ioParam.ioActCount = CL(serial_bios_read(HxX(h, fd), buf, @@ -458,7 +474,7 @@ A2(PUBLIC, OSErr, ROMlib_serialprime, ParmBlkPtr, pbp, /* INTERNAL */ (LONGINT) req_count, (LONGINT) (unsigned char) buf[0]); #endif -#if defined (LINUX) || defined (NEXTSTEP) +#if defined (LINUX) || defined (MACOSX_) pbp->ioParam.ioActCount = CL(write(HxX(h, fd), buf, req_count)); #elif defined (MSDOS) || defined (CYGWIN32) @@ -748,7 +764,7 @@ A2(PRIVATE, OSErr, setbaud, LONGINT, fd, INTEGER, baud) static INTEGER rates[] = { 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, - 38400, 32767, + (INTEGER)38400, (INTEGER)32767, }, *ip; OSErr err; @@ -959,7 +975,7 @@ A2(PUBLIC, OSErr, ROMlib_serialstatus, ParmBlkPtr, pbp, /* INTERNAL */ h = (hiddenh) MR(dcp->dCtlStorage); switch (CW(pbp->cntrlParam.csCode)) { case SERGETBUF: -#if defined (LINUX) || defined (NEXTSTEP) +#if defined (LINUX) || defined (MACOSX_) if (ioctl(HxX(h, fd), FIONREAD, &n) < 0) #else if (serial_bios_fionread(HxX(h, fd), &n) < 0) @@ -974,7 +990,7 @@ A2(PUBLIC, OSErr, ROMlib_serialstatus, ParmBlkPtr, pbp, /* INTERNAL */ } break; case SERSTATUS: -#if defined (LINUX) || defined (NEXTSTEP) +#if defined (LINUX) || defined (MACOSX_) if (ioctl(HxX(h, fd), FIONREAD, &n) < 0) #else if (serial_bios_fionread (HxX(h, fd), &n) < 0) @@ -1003,7 +1019,7 @@ A2(PUBLIC, OSErr, ROMlib_serialstatus, ParmBlkPtr, pbp, /* INTERNAL */ PRIVATE void restorecloseanddispose(hiddenh h) { -#if defined (LINUX) || defined (NEXTSTEP) +#if defined (LINUX) || defined (MACOSX_) #if defined(TERMIO) ioctl(HxX(h, fd), TCSETAW, &HxX(h, state)); #else @@ -1035,4 +1051,3 @@ A2(PUBLIC, OSErr, ROMlib_serialclose, ParmBlkPtr, pbp, /* INTERNAL */ #endif DOCOMPLETION(pbp, err); } -#endif /* !defined (MACOSX) */ diff --git a/src/setuid.c b/src/setuid.cpp similarity index 89% rename from src/setuid.c rename to src/setuid.cpp index ed4954d7..1e0620af 100644 --- a/src/setuid.c +++ b/src/setuid.cpp @@ -18,14 +18,16 @@ char ROMlib_rcsid_setuid[] = #include "rsys/common.h" #include "rsys/setuid.h" -void ROMlib_setuid( LONGINT uid ) +using namespace Executor; + +void ROMlib_setuid( int uid ) { #if !defined(MSDOS) && !defined (CYGWIN32) setuid(uid); #endif } -void ROMlib_seteuid( LONGINT uid ) +void ROMlib_seteuid( int uid ) { #if !defined(MSDOS) && !defined (CYGWIN32) seteuid(uid); diff --git a/src/shutdown.c b/src/shutdown.cpp similarity index 97% rename from src/shutdown.c rename to src/shutdown.cpp index 0e4a84c7..8c9210da 100644 --- a/src/shutdown.c +++ b/src/shutdown.cpp @@ -15,6 +15,8 @@ char ROMlib_rcsid_shutdown[] = #include "rsys/segment.h" +using namespace Executor; + P0 (PUBLIC pascal trap, void, ShutDwnPower) { ROMlib_exit = TRUE; diff --git a/src/sigio_multiplex.c b/src/sigio_multiplex.cpp similarity index 92% rename from src/sigio_multiplex.c rename to src/sigio_multiplex.cpp index 3e35aa69..d5bedd7d 100644 --- a/src/sigio_multiplex.c +++ b/src/sigio_multiplex.cpp @@ -9,13 +9,14 @@ char ROMlib_rcsid_sigio_multiplex[] = #include "rsys/common.h" -#if defined (LINUX) || defined (NEXTSTEP) || defined (MACOSX) +#if defined (LINUX) || defined (MACOSX_) || defined (MACOSX_) #include #include #include #include "rsys/sigio_multiplex.h" +using namespace Executor; /* a simple sigio multiplexor */ @@ -69,7 +70,7 @@ sigio_multiplex_hdlr (int signo) void sigio_multiplex_install_handler (int fd, sigio_hdlr_t hdlr) { - sigio_hdlrs = realloc (sigio_hdlrs, (sizeof *sigio_hdlrs + sigio_hdlrs = (sigio_hdlr_record_t*)realloc (sigio_hdlrs, (sizeof *sigio_hdlrs * (n_sigio_hdlrs + 1))); sigio_hdlrs[n_sigio_hdlrs].fd = fd; sigio_hdlrs[n_sigio_hdlrs].hdlr = hdlr; @@ -120,4 +121,4 @@ sigio_multiplex_remove_handler (int fd, sigio_hdlr_t hdlr) warning_unexpected ("fd, hdlr pair not found"); } -#endif /* LINUX || NEXTSTEP */ +#endif /* LINUX || MACOSX_ */ diff --git a/src/slash.c b/src/slash.cpp similarity index 99% rename from src/slash.c rename to src/slash.cpp index 8342498f..8630855a 100644 --- a/src/slash.c +++ b/src/slash.cpp @@ -17,6 +17,9 @@ char ROMlib_rcsid_slash[] = #include "rsys/common.h" #include "rsys/lockunlock.h" +#include "rsys/slash.h" + +using namespace Executor; #if defined(MSDOS) || defined (CYGWIN32) @@ -25,7 +28,6 @@ char ROMlib_rcsid_slash[] = #include "win_stat.h" #endif -#include "rsys/slash.h" #define DOUBLE_SLASH_REMOVE(str) \ ({ \ diff --git a/src/snth5.c b/src/snth5.cpp similarity index 95% rename from src/snth5.c rename to src/snth5.cpp index 9610ee22..6a4423c9 100644 --- a/src/snth5.c +++ b/src/snth5.cpp @@ -11,6 +11,8 @@ char ROMlib_rcsid_snth5[] = #include "SoundMgr.h" #include "rsys/soundopts.h" +using namespace Executor; + /* * It's not really clear how an actual synthesizer is expected to work * with the Sound Manager's queues. In this implementation we start @@ -23,7 +25,7 @@ typedef pascal void (*callbackfp)(SndChannelPtr, SndCommand *); P3(PUBLIC pascal, BOOLEAN, snth5, SndChannelPtr, chanp, SndCommand *, cmdp, ModifierStubPtr, mp) { -#if defined(NEXTSTEP) +#if defined(MACOSX_) soundbuffer_t *bufp; BOOLEAN done; static BOOLEAN beenhere = 0; @@ -62,7 +64,7 @@ P3(PUBLIC pascal, BOOLEAN, snth5, SndChannelPtr, chanp, SndCommand *, cmdp, #if 0 printf("CB"); fflush(stdout); #endif - CToPascalCall(MR(chanp->callBack), CTOP_StuffHex, chanp, cmdp); + CToPascalCall((void*)MR(chanp->callBack), CTOP_StuffHex, chanp, cmdp); break; case syncCmd: /* TODO */ diff --git a/src/sound.c b/src/sound.cpp similarity index 97% rename from src/sound.c rename to src/sound.cpp index 7e087747..d4e9dd29 100644 --- a/src/sound.c +++ b/src/sound.cpp @@ -19,9 +19,10 @@ char ROMlib_rcsid_sound[] = #include "rsys/blockinterrupts.h" #include "rsys/mman.h" +using namespace Executor; /* TRUE when we want to pretend this host has no sound support. */ -boolean_t sound_disabled_p; +bool Executor::sound_disabled_p; /* * TODO: The flag values below are just ctm guesses. We need to run @@ -52,9 +53,9 @@ A1(PUBLIC, void, SetSoundVol, INTEGER, vol) } #endif -PUBLIC int ROMlib_PretendSound = soundpretend; +PUBLIC int Executor::ROMlib_PretendSound = soundpretend; -static inline boolean_t +static inline bool qfull_p (SndChannelPtr chanp) { return ((CW (chanp->qTail) == CW (chanp->qHead) - 1 || @@ -62,7 +63,7 @@ qfull_p (SndChannelPtr chanp) && CW (chanp->qTail) == CW (chanp->qLength) - 1))); } -static inline boolean_t +static inline bool qempty_p (SndChannelPtr chanp) { /* TetrisMax sometimes does something with a 0-length queue under @@ -218,7 +219,7 @@ resample (uint8 *inbuf, uint8 *orig_outbuf, unsigned int insize, * ignore the resampled waveform anyway, but it makes the "real" * sound and "dummy" sound cases more similar. Is it worth it? */ - outbuf = orig_outbuf ?: alloca (outsize); + outbuf = orig_outbuf ?: (uint8*)alloca (outsize); step = snd_fixed_div (infreq, outfreq); @@ -266,9 +267,9 @@ resample (uint8 *inbuf, uint8 *orig_outbuf, unsigned int insize, } } -PUBLIC int ROMlib_get_snd_cmds (Handle sndh, SndCommand **cmdsp) +PUBLIC int Executor::ROMlib_get_snd_cmds (Handle sndh, SndCommand **cmdsp) { - void *p; + Ptr p; int format; int num_formats; int retval; @@ -317,7 +318,7 @@ P3(PUBLIC, pascal trap OSErr, SndPlay, SndChannelPtr, chanp, Handle, sndh, BOOLEAN, async) { OSErr retval; - void *resp; + Ptr resp; SndCommand *cmds; int num_commands, i, format; boolean_t need_allocate; @@ -358,7 +359,7 @@ P3(PUBLIC, pascal trap OSErr, SndPlay, SndChannelPtr, chanp, Handle, sndh, { HIDDEN_SndChannelPtr foo; - foo.p = CLC (0); + foo.p = (SndChannelPtr)CLC (0); SndNewChannel (&foo, sampledSynth, 0, 0); chanp = MR (foo.p); } @@ -398,7 +399,7 @@ P3(PUBLIC, pascal trap OSErr, SndPlay, SndChannelPtr, chanp, Handle, sndh, return retval; } -HIDDEN_SndChannelPtr allchans; +HIDDEN_SndChannelPtr Executor::allchans; P4(PUBLIC pascal trap, OSErr, SndNewChannel, HIDDEN_SndChannelPtr *, chanpp, INTEGER, synth, LONGINT, init, ProcPtr, userroutinep) @@ -516,13 +517,13 @@ static void dumpcmd(SndCommand *cmdp) typedef pascal BOOLEAN (*snthfp)(SndChannelPtr, SndCommand *, ModifierStubPtr); -BOOLEAN callasynth(SndChannelPtr chanp, SndCommand *cmdp, ModifierStubPtr mp) +static BOOLEAN callasynth(SndChannelPtr chanp, SndCommand *cmdp, ModifierStubPtr mp) { /* * NOTE: when we support sound, we'll have to check for known P_routines * to avoid invoking syn68k on our own stuff. */ - return CToPascalCall(MR(mp->code), CTOP_SectRect, chanp, cmdp, mp); + return CToPascalCall((void*)MR(mp->code), CTOP_SectRect, chanp, cmdp, mp); } #if defined(OLD_BROKEN_NEXTSTEP_SOUND) @@ -562,7 +563,7 @@ earlier (snd_time t1, snd_time t2) } #endif -static inline unsigned long +static inline unsigned int snd_duration (SoundHeaderPtr hp) { return CL (hp->length); @@ -619,7 +620,7 @@ do_current_command (SndChannelPtr chanp, struct hunger_info info) case callBackCmd: warning_sound_log ("callBackCmd"); cmd = chanp->cmdInProg; - CToPascalCall (MR (chanp->callBack), CTOP_SetCTitle, + CToPascalCall ((void*)MR (chanp->callBack), CTOP_SetCTitle, chanp, &cmd); CMD_DONE (chanp); break; @@ -694,13 +695,13 @@ do_current_db (SndChannelPtr chanp, struct hunger_info info) CL (dbp->dbUserInfo[0]), CL (dbp->dbUserInfo[1])); #endif - CToPascalCall (MR (dbhp->dbhDoubleBack), CTOP_SetCTitle, + CToPascalCall ((void*)MR (dbhp->dbhDoubleBack), CTOP_SetCTitle, chanp, dbp); } } syn68k_addr_t -sound_callback (syn68k_addr_t interrupt_addr, void *unused) +Executor::sound_callback (syn68k_addr_t interrupt_addr, void *unused) { struct hunger_info info; SndChannelPtr chanp; diff --git a/src/soundIMVI.c b/src/soundIMVI.cpp similarity index 98% rename from src/soundIMVI.c rename to src/soundIMVI.cpp index 38dd5b80..3716769d 100644 --- a/src/soundIMVI.c +++ b/src/soundIMVI.cpp @@ -20,6 +20,9 @@ char ROMlib_rcsid_soundIMVI[] = #include "rsys/sounddriver.h" #include "rsys/blockinterrupts.h" #include "rsys/prefs.h" +#include "rsys/soundopts.h" + +using namespace Executor; P1(PUBLIC, pascal trap void, SndGetSysBeepState, INTEGER *, statep) { @@ -122,13 +125,13 @@ PRIVATE struct */ void -clear_pending_sounds (void) +Executor::clear_pending_sounds (void) { call_back_info.headp = NULL; call_back_info.busy = FALSE; - if (sound_driver.sound_clear_pending) + if (sound_driver->HasSoundClearPending()) SOUND_CLEAR_PENDING (); - allchans.p = CLC (0); + allchans.p = (SndChannelPtr)CLC (0); } @@ -195,7 +198,7 @@ A0 (PUBLIC, void, C_sound_timer_handler) start_playing (call_back_info.chanp, call_back_info.headp, current_buffer ^ 1); dbp->dbFlags &= CLC (~dbBufferReady); - CToPascalCall (pp, CTOP_SetCTitle, call_back_info.chanp, dbp); + CToPascalCall (&pp, CTOP_SetCTitle, call_back_info.chanp, dbp); } } diff --git a/src/sounddriver.c b/src/sounddriver.c deleted file mode 100644 index f2560a3f..00000000 --- a/src/sounddriver.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright 1996 by Abacus Research and - * Development, Inc. All rights reserved. - */ - -#if !defined (OMIT_RCSID_STRINGS) -char ROMlib_rcsid_sounddriver[] = - "$Id: sounddriver.c 63 2004-12-24 18:19:43Z ctm $"; -#endif - -#include "rsys/common.h" -#include "rsys/sounddriver.h" -#include "rsys/soundfake.h" - -/* This is the current sound driver. */ -sound_driver_t sound_driver; - -typedef boolean_t (*sound_init_func) (sound_driver_t *); - -static sound_init_func sound_driver_init_funcs[] = -{ -#if defined (SOUND_SDL) - sound_sdl_init, -#endif - -#if defined (SOUND_LINUX) - sound_linux_init, -#endif - -#if defined (SOUND_DJGPP) - sound_djgpp_init, -#endif - - /* This should always initialize successfully. */ - sound_fake_init, -}; - - -void -sound_init (void) -{ - boolean_t found_one_p; - int i; - - /* Try all available sound drivers and keep the first one that works. */ - found_one_p = FALSE; - for (i = 0; !found_one_p && i < (int) NELEM (sound_driver_init_funcs); i++) - if ((sound_driver_init_funcs[i]) (&sound_driver)) - found_one_p = TRUE; - - /* At least the fake sound driver must always match! */ - gui_assert (found_one_p); -} diff --git a/src/sounddriver.cpp b/src/sounddriver.cpp new file mode 100644 index 00000000..7b8cd3e1 --- /dev/null +++ b/src/sounddriver.cpp @@ -0,0 +1,56 @@ +/* Copyright 1996 by Abacus Research and + * Development, Inc. All rights reserved. + */ + +#if !defined (OMIT_RCSID_STRINGS) +char ROMlib_rcsid_sounddriver[] = + "$Id: sounddriver.c 63 2004-12-24 18:19:43Z ctm $"; +#endif + +#include "rsys/common.h" +#include "rsys/sounddriver.h" +#include "rsys/soundfake.h" + +#ifdef Sound_MACOSX_ +#include "SoundOSX.h" +#endif + +using namespace Executor; + +/* This is the current sound driver. */ +class SoundDriver *Executor::sound_driver; + +int Executor::ROMlib_SND_RATE = 22255; + +void +Executor::sound_init (void) +{ + bool found_one_p = false; + + /* Try all available sound drivers and keep the first one that works. */ + do { +#ifdef Sound_MACOSX_ + SoundOSX *sndOSX = new SoundOSX; + if (!sndOSX->sound_init()) { + delete sndOSX; + } else { + found_one_p = true; + sound_driver = (class SoundDriver*)sndOSX; + break; + } +#endif + + SoundFake *sndFake = new SoundFake; + if (!sndFake->sound_init()) { + delete sndFake; + } else { + found_one_p = true; + sound_driver = (class SoundDriver*)sndFake; + break; + } + + } while (0); + + /* At least the fake sound driver must always match! */ + gui_assert (found_one_p); +} diff --git a/src/soundfake.c b/src/soundfake.c deleted file mode 100644 index 8a40890a..00000000 --- a/src/soundfake.c +++ /dev/null @@ -1,185 +0,0 @@ -/* Copyright 1995, 1996 by Abacus Research and - * Development, Inc. All rights reserved. - */ - -#if !defined (OMIT_RCSID_STRINGS) -char ROMlib_rcsid_soundfake[] = - "$Id: soundfake.c 63 2004-12-24 18:19:43Z ctm $"; -#endif - -#include "rsys/common.h" -#include "rsys/sounddriver.h" -#include "rsys/m68kint.h" -#include - -/* This driver "goes through the motions" of playing a sound without - * actually interacting with any sound hardware. The intent is to - * allow systems with and without sound hardware to be indistinguishable - * from the perspective of the program being emulated. For example, - * this driver should cause callbacks to get called at the right times, - * etc. - */ - -#define LOGBUFSIZE 11 -#define FAKE_BUF_SIZE (1U << LOGBUFSIZE) -#define NUM_FAKE_BUFS 4U - -#define MSECS_FOR_BUFFER_TO_PLAY ((FAKE_BUF_SIZE * 1000L) / SND_RATE) - -static snd_time t1; - -/* # of fake buffers currently enqueued. */ -static int num_fake_buffers_enqueued; - -static syn68k_addr_t fake_sound_callback; - -/* Set to TRUE when we're shutting down, and don't want any new sound - * to creep in. - */ -static boolean_t no_more_sound_p; - -static TMTask fake_sound_tm_task; - -static boolean_t -sound_fake_works_p (sound_driver_t *s) -{ - return !no_more_sound_p; -} - -static void -sound_fake_hunger_start (sound_driver_t *s) -{ - t1 += FAKE_BUF_SIZE; -} - -static struct hunger_info -sound_fake_get_hunger_info (sound_driver_t *s) -{ - struct hunger_info info; - - info.buf = NULL; /* no buffer at all */ - info.bufsize = NUM_FAKE_BUFS * FAKE_BUF_SIZE; - info.t2 = t1 + FAKE_BUF_SIZE; - info.t3 = info.t2 + FAKE_BUF_SIZE; - info.t4 = info.t3; - - return info; -} - -static void -sound_fake_clear_pending (sound_driver_t *s) -{ - fake_sound_tm_task.tmCount = CLC (-1); - num_fake_buffers_enqueued = 0; -} - -static void -_note_sound_interrupt (void) -{ - if (!no_more_sound_p && num_fake_buffers_enqueued < 2) - sound_callback (0, NULL); -} - -/* Installs a time manager task to call back at the requested time. */ -static void -set_up_tm_task (void) -{ - fake_sound_tm_task.tmAddr = (ProcPtr) CL ((uint32) fake_sound_callback); - InsTime ((QElemPtr) &fake_sound_tm_task); - PrimeTime ((QElemPtr) &fake_sound_tm_task, MSECS_FOR_BUFFER_TO_PLAY); -} - -static void -sound_fake_hunger_finish (sound_driver_t *s) -{ - ++num_fake_buffers_enqueued; - if (num_fake_buffers_enqueued > (int) NUM_FAKE_BUFS) - warning_unexpected ("Too many fake sound buffers got enqueued; this " - "should not be possible."); - - /* If we're the only sound enqueued, we need to add a time manager task - * to give us a callback when appropriate. - */ - if (num_fake_buffers_enqueued == 1) - set_up_tm_task (); - - _note_sound_interrupt (); /* request even more sound if appropriate. */ -} - -static syn68k_addr_t -handle_fake_sound_callback (syn68k_addr_t addr, void *junk) -{ - if (num_fake_buffers_enqueued > 0) - --num_fake_buffers_enqueued; - - if (!no_more_sound_p && num_fake_buffers_enqueued > 0) - { - M68kReg saved_regs[16]; - CCRElement saved_ccnz, saved_ccn, saved_ccc, saved_ccv, saved_ccx; - - /* Save the 68k registers and cc bits away. */ - memcpy (saved_regs, &cpu_state.regs, sizeof saved_regs); - saved_ccnz = cpu_state.ccnz; - saved_ccn = cpu_state.ccn; - saved_ccc = cpu_state.ccc; - saved_ccv = cpu_state.ccv; - saved_ccx = cpu_state.ccx; - - set_up_tm_task (); - _note_sound_interrupt (); - - memcpy (&cpu_state.regs, saved_regs, sizeof saved_regs); - cpu_state.ccnz = saved_ccnz; - cpu_state.ccn = saved_ccn; - cpu_state.ccc = saved_ccc; - cpu_state.ccv = saved_ccv; - cpu_state.ccx = saved_ccx; - } - - return POPADDR (); -} - -void -sound_fake_go (sound_driver_t *s) -{ - _note_sound_interrupt (); -} - -void -sound_fake_stop (sound_driver_t *s) -{ -} - -static void -sound_fake_shutdown (sound_driver_t *s) -{ - no_more_sound_p = TRUE; /* No more callbacks, etc. */ - num_fake_buffers_enqueued = 0; -} - -static boolean_t -sound_fake_silent_p (sound_driver_t *s) -{ - return TRUE; -} - -boolean_t -sound_fake_init (sound_driver_t *s) -{ - fake_sound_callback = callback_install (handle_fake_sound_callback, NULL); - no_more_sound_p = FALSE; - num_fake_buffers_enqueued = 0; - - s->sound_init = sound_fake_init; - s->sound_shutdown = sound_fake_shutdown; - s->sound_works_p = sound_fake_works_p; - s->sound_silent_p = sound_fake_silent_p; - s->sound_hunger_finish = sound_fake_hunger_finish; - s->sound_go = sound_fake_go; - s->sound_stop = sound_fake_stop; - s->sound_hunger_start = sound_fake_hunger_start; - s->sound_get_hunger_info = sound_fake_get_hunger_info; - s->sound_clear_pending = sound_fake_clear_pending; - - return TRUE; -} diff --git a/src/soundfake.cpp b/src/soundfake.cpp new file mode 100644 index 00000000..82de5145 --- /dev/null +++ b/src/soundfake.cpp @@ -0,0 +1,151 @@ +/* Copyright 1995, 1996 by Abacus Research and + * Development, Inc. All rights reserved. + */ + +#if !defined (OMIT_RCSID_STRINGS) +char ROMlib_rcsid_soundfake[] = + "$Id: soundfake.c 63 2004-12-24 18:19:43Z ctm $"; +#endif + +#include "rsys/common.h" +#include "rsys/sounddriver.h" +#include "rsys/soundfake.h" +#include "rsys/m68kint.h" +#include "TimeMgr.h" + +using namespace Executor; + +/* This driver "goes through the motions" of playing a sound without + * actually interacting with any sound hardware. The intent is to + * allow systems with and without sound hardware to be indistinguishable + * from the perspective of the program being emulated. For example, + * this driver should cause callbacks to get called at the right times, + * etc. + */ + +#define LOGBUFSIZE 11 +#define FAKE_BUF_SIZE (1U << LOGBUFSIZE) +#define NUM_FAKE_BUFS 4U + +#define MSECS_FOR_BUFFER_TO_PLAY ((FAKE_BUF_SIZE * 1000L) / SND_RATE) + +bool SoundFake::sound_works() +{ + return !no_more_sound_p; +} + +void SoundFake::HungerStart() +{ + t1 += FAKE_BUF_SIZE; +} + +struct hunger_info SoundFake::GetHungerInfo() +{ + struct hunger_info info; + + info.buf = NULL; /* no buffer at all */ + info.bufsize = NUM_FAKE_BUFS * FAKE_BUF_SIZE; + info.t2 = t1 + FAKE_BUF_SIZE; + info.t3 = info.t2 + FAKE_BUF_SIZE; + info.t4 = info.t3; + + return info; +} + +void SoundFake::sound_clear_pending() +{ + fake_sound_tm_task.tmCount = CLC (-1); + num_fake_buffers_enqueued = 0; +} + +void SoundFake::NoteSoundInterrupt(void) +{ + if (!no_more_sound_p && num_fake_buffers_enqueued < 2) + sound_callback (0, NULL); +} + +/* Installs a time manager task to call back at the requested time. */ +void SoundFake::set_up_tm_task(void) +{ + fake_sound_tm_task.tmAddr = (ProcPtr) CL ((uint32) fake_sound_callback); + InsTime ((QElemPtr) &fake_sound_tm_task); + PrimeTime ((QElemPtr) &fake_sound_tm_task, MSECS_FOR_BUFFER_TO_PLAY); +} + +void SoundFake::HungerFinish() +{ + ++num_fake_buffers_enqueued; + if (num_fake_buffers_enqueued > (int) NUM_FAKE_BUFS) + warning_unexpected ("Too many fake sound buffers got enqueued; this " + "should not be possible."); + + /* If we're the only sound enqueued, we need to add a time manager task + * to give us a callback when appropriate. + */ + if (num_fake_buffers_enqueued == 1) + set_up_tm_task (); + + NoteSoundInterrupt(); /* request even more sound if appropriate. */ +} + +syn68k_addr_t SoundFake::handle_fake_sound_callback (syn68k_addr_t addr, void *ourself) +{ + SoundFake* ourSelfUn = (SoundFake*)ourself; + if (ourSelfUn->num_fake_buffers_enqueued > 0) + --ourSelfUn->num_fake_buffers_enqueued; + + if (!ourSelfUn->no_more_sound_p && ourSelfUn->num_fake_buffers_enqueued > 0) + { + M68kReg saved_regs[16]; + CCRElement saved_ccnz, saved_ccn, saved_ccc, saved_ccv, saved_ccx; + + /* Save the 68k registers and cc bits away. */ + memcpy (saved_regs, &cpu_state.regs, sizeof saved_regs); + saved_ccnz = cpu_state.ccnz; + saved_ccn = cpu_state.ccn; + saved_ccc = cpu_state.ccc; + saved_ccv = cpu_state.ccv; + saved_ccx = cpu_state.ccx; + + ourSelfUn->set_up_tm_task (); + ourSelfUn->NoteSoundInterrupt(); + + memcpy (&cpu_state.regs, saved_regs, sizeof saved_regs); + cpu_state.ccnz = saved_ccnz; + cpu_state.ccn = saved_ccn; + cpu_state.ccc = saved_ccc; + cpu_state.ccv = saved_ccv; + cpu_state.ccx = saved_ccx; + } + + return POPADDR (); +} + +void SoundFake::sound_go () +{ + NoteSoundInterrupt (); +} + +void SoundFake::sound_stop () +{ +} + +void SoundFake::sound_shutdown () +{ + no_more_sound_p = true; /* No more callbacks, etc. */ + num_fake_buffers_enqueued = 0; +} + +bool SoundFake::sound_silent() +{ + return true; +} + +bool SoundFake::sound_init() +{ + fake_sound_callback = callback_install (handle_fake_sound_callback, this); + no_more_sound_p = FALSE; + num_fake_buffers_enqueued = 0; + + return true; +} diff --git a/src/splash.c b/src/splash.cpp similarity index 100% rename from src/splash.c rename to src/splash.cpp diff --git a/src/srcblt.c b/src/srcblt.cpp similarity index 99% rename from src/srcblt.c rename to src/srcblt.cpp index 6de3ca5d..d59beda1 100644 --- a/src/srcblt.c +++ b/src/srcblt.cpp @@ -15,6 +15,10 @@ char ROMlib_rcsid_srcblt[] = #include "rsys/prefs.h" #include "rsys/host.h" +#warning This seems unsafe... + +using namespace Executor; + int srcblt_log2_bpp asm ("_srcblt_log2_bpp"); const INTEGER *srcblt_rgn_start asm ("_srcblt_rgn_start"); diff --git a/src/stdfile-OSX.cpp b/src/stdfile-OSX.cpp new file mode 100644 index 00000000..bde0a48e --- /dev/null +++ b/src/stdfile-OSX.cpp @@ -0,0 +1,17 @@ +// +// stdfile-OSX.cpp +// CocoaExecutor +// +// Created by C.W. Betts on 7/30/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#include +#include "rsys/common.h" +#include "stdfile-OSX.h" + + +void MacBridge::ResolveRF() +{ + +} \ No newline at end of file diff --git a/src/stdfile-OSX.h b/src/stdfile-OSX.h new file mode 100644 index 00000000..c81d21c6 --- /dev/null +++ b/src/stdfile-OSX.h @@ -0,0 +1,18 @@ +// +// stdfile-OSX.h +// CocoaExecutor +// +// Created by C.W. Betts on 7/30/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#ifndef __CocoaExecutor__stdfile_OSX__ +#define __CocoaExecutor__stdfile_OSX__ + +#include "FileMgr.h" + +namespace MacBridge { + void ResolveRF(); +} + +#endif /* defined(__CocoaExecutor__stdfile_OSX__) */ diff --git a/src/stdfile.c b/src/stdfile.cpp similarity index 94% rename from src/stdfile.c rename to src/stdfile.cpp index 076d8ce1..9dbb6736 100644 --- a/src/stdfile.c +++ b/src/stdfile.cpp @@ -64,7 +64,7 @@ char ROMlib_rcsid_stdfile[] = #include "rsys/osevent.h" -PUBLIC int nodrivesearch_p = FALSE; +PUBLIC int Executor::nodrivesearch_p = FALSE; #if defined (MSDOS) || defined (CYGWIN32) #include "dosdisk.h" @@ -75,6 +75,31 @@ PUBLIC int nodrivesearch_p = FALSE; #include "rsys/print.h" #include "rsys/system_error.h" +using namespace Executor; + +typedef pascal BOOLEAN (*filtp)(DialogPtr dp, EventRecord *evp, INTEGER *ith); + +#define CALLFILTERPROC(dp, evt, ith, fp) \ +ROMlib_CALLFILTERPROC((dp), (evt), (ith), (filtp) (fp)) + +typedef pascal BOOLEAN (*custom_filtp)(DialogPtr dp, EventRecord *evp, + INTEGER *ith, UNIV Ptr data); + +#define CALL_NEW_FILTER_PROC(dp, evt, ith, data, fp) \ +ROMlib_CALL_NEW_FILTER_PROC((dp), (evt), (ith), (data), \ +(custom_filtp) (fp)) + +typedef pascal BOOLEAN (*filefiltp)( ParmBlkPtr pbp ); + +#define CALLFILEFILT(pbp, fp) ROMlib_CALLFILEFILT((pbp), (filefiltp)(fp)) + + +typedef pascal BOOLEAN (*custom_file_filtp) (ParmBlkPtr pbp, UNIV Ptr data); + +#define CALL_CUSTOM_FILE_FILT(pbp, data, fp) \ +ROMlib_CALL_CUSTOM_FILE_FILT ((pbp), (data), (custom_file_filtp) (fp)) + + typedef union { SFReply *oreplyp; @@ -130,6 +155,40 @@ typedef struct { UNIV Ptr mydata; } fltype; +namespace Executor { + PRIVATE INTEGER movealert(INTEGER); + PRIVATE void drawminiicon(INTEGER); + PRIVATE void drawinboxwithicon(StringPtr, Rect*, INTEGER); + PRIVATE void safeflflip(fltype *, INTEGER); + PRIVATE void flupdate(fltype *, INTEGER, INTEGER); + PRIVATE void flscroll(fltype *, INTEGER, INTEGER); + PRIVATE StringPtr getdiskname(BOOLEAN *, boolean_t *); + PRIVATE void drawjobberattop(DialogPeek); + PRIVATE LONGINT getdirid(StringPtr); + PRIVATE void settype(fltype *, INTEGER); + PRIVATE INTEGER flwhich(fltype *, Point); + PRIVATE void flmouse(fltype *, Point, ControlHandle); + PRIVATE void getcurname(fltype *); + static inline BOOLEAN ROMlib_CALLFILTERPROC(DialogPtr, EventRecord *, INTEGER*, filtp); + PRIVATE void flfinit(fltype *); + PRIVATE void flinsert(fltype *, StringPtr, INTEGER); + PRIVATE int typeinarray(OSType, INTEGER, SFTypeList); + PRIVATE LONGINT stdfcmp(char *, char *); + static inline BOOLEAN ROMlib_CALLFILEFILT(ParmBlkPtr, filefiltp); + PRIVATE void flfill(fltype *); + PRIVATE void realcd(DialogPeek, LONGINT); + PRIVATE LONGINT getparent(LONGINT); + PRIVATE BOOLEAN moveuponedir(DialogPtr); + PRIVATE void flinit(fltype *, Rect *, ControlHandle); + PRIVATE void stdfflip(Rect *, INTEGER, INTEGER); + PRIVATE BOOLEAN trackdirs(DialogPeek); + PRIVATE BOOLEAN ejected(HParmBlkPtr); + PRIVATE void bumpsavedisk(DialogPtr, BOOLEAN); + PRIVATE void transformsfpdialog(DialogPtr, Point *, Rect *, BOOLEAN); + PRIVATE void doeject(DialogPtr); + PRIVATE OSType gettypeX(StringPtr, INTEGER, LONGINT); +} + A1(PRIVATE, INTEGER, movealert, INTEGER, id) { Handle h; @@ -184,7 +243,7 @@ A3(PRIVATE, void, drawinboxwithicon, StringPtr, str, Rect *, rp, INTEGER, icon) { Rect r; INTEGER width, strlen, strwidths[255], lengthavail, *widp; - static char *ellipsis = "\003..."; + static const char *ellipsis = "\003..."; /* * Note: the ellipsis code is a bit shabby, not truncating at a character @@ -243,7 +302,7 @@ A2(PRIVATE, void, safeflflip, fltype *, f, INTEGER, sel) A3(PRIVATE, void, flupdate, fltype *, f, INTEGER, st, INTEGER, n) { INTEGER i; - struct flinfostr *ip; + fltype::flinfostr *ip; INTEGER sel = f->flsel; INTEGER fltop; Rect r; @@ -344,8 +403,7 @@ P2 (PUBLIC, pascal void, ROMlib_stdftrack, ControlHandle, sh, INTEGER, part) from = GetCtlValue (sh); pg = CTLFL(sh)->flnmlin - 1; - switch (part) - { + switch (part) { case inUpButton: SetCtlValue(sh, from-1); break; @@ -369,7 +427,7 @@ PRIVATE LONGINT lastkeydowntime = 0; PRIVATE Str255 prefix = { 0 }; PRIVATE char **holdstr; -PUBLIC void ROMlib_init_stdfile(void) +PUBLIC void Executor::ROMlib_init_stdfile(void) { cachedvrn = 32767; savesel = -1; @@ -563,11 +621,6 @@ A3(PRIVATE, void, flmouse, fltype *, f, Point, p, ControlHandle, ch) } while (!GetNextEvent(mUpMask, &evt)); } -typedef pascal BOOLEAN (*filtp)(DialogPtr dp, EventRecord *evp, INTEGER *ith); - -#define CALLFILTERPROC(dp, evt, ith, fp) \ - ROMlib_CALLFILTERPROC((dp), (evt), (ith), (filtp) (fp)) - A4(static inline, BOOLEAN, ROMlib_CALLFILTERPROC, DialogPtr, dp, EventRecord *, evtp, INTEGER, *ith, filtp, fp) { @@ -578,7 +631,7 @@ A4(static inline, BOOLEAN, ROMlib_CALLFILTERPROC, DialogPtr, dp, SetWRefCon (dp, TICK("stdf")); ROMlib_hook(stdfile_filtnumber); HOOKSAVEREGS(); - retval = CToPascalCall(fp, CTOP_SectRect, dp, evtp, ith); + retval = CToPascalCall(&fp, CTOP_SectRect, dp, evtp, ith); HOOKRESTOREREGS(); SetWRefCon (dp, save_ref_con); return retval; @@ -591,13 +644,6 @@ P4 (PUBLIC pascal trap, BOOLEAN, unused_stdfile, DialogPtr, dp, EventRecord *, } #endif -typedef pascal BOOLEAN (*custom_filtp)(DialogPtr dp, EventRecord *evp, - INTEGER *ith, UNIV Ptr data); - -#define CALL_NEW_FILTER_PROC(dp, evt, ith, data, fp) \ - ROMlib_CALL_NEW_FILTER_PROC((dp), (evt), (ith), (data), \ - (custom_filtp) (fp)) - PRIVATE BOOLEAN ROMlib_CALL_NEW_FILTER_PROC (DialogPtr dp, EventRecord *evtp, INTEGER *ith, UNIV Ptr data, custom_filtp fp) @@ -609,7 +655,7 @@ ROMlib_CALL_NEW_FILTER_PROC (DialogPtr dp, EventRecord *evtp, INTEGER *ith, SetWRefCon (dp, TICK("stdf")); ROMlib_hook(stdfile_filtnumber); HOOKSAVEREGS(); - retval = CToPascalCall(fp, CTOP_unused_stdfile, dp, evtp, ith, data); + retval = Executor::CToPascalCall(&fp, CTOP_unused_stdfile, dp, evtp, ith, data); HOOKRESTOREREGS(); SetWRefCon (dp, save_ref_con); return retval; @@ -659,13 +705,13 @@ A1(PRIVATE, void, flfinit, fltype *, fp) A3(PRIVATE, void, flinsert, fltype *, f, StringPtr, p, INTEGER, micon) { - struct flinfostr finfo; + fltype::flinfostr finfo; finfo.floffs = GetHandleSize((Handle) f->flstrs); finfo.flicns = micon; PtrAndHand((Ptr) p, (Handle) f->flstrs, (LONGINT)U(p[0])+1); PtrAndHand((Ptr) &finfo, (Handle) f->flinfo, - (LONGINT)sizeof(struct flinfostr)); + (LONGINT)sizeof(fltype::flinfostr)); ++f->flnmfil; } @@ -685,21 +731,22 @@ A3(PRIVATE, int, typeinarray, OSType, ft, INTEGER, numt, SFTypeList, tl) /* ip1 and ip2 would really be "void *" in ANSI C */ -A2(PRIVATE, LONGINT, stdfcmp, char *, ip1, char *, ip2) +static LONGINT stdfcmpC(const void *ip1, const void *ip2) { - struct flinfostr *fp1, *fp2; + fltype::flinfostr *fp1 = (fltype::flinfostr *) ip1; + fltype::flinfostr *fp2 = (fltype::flinfostr *) ip2; LONGINT retval; - fp1 = (struct flinfostr *) ip1; - fp2 = (struct flinfostr *) ip2; retval = ROMlib_strcmp((StringPtr) (MR(*holdstr) + fp1->floffs), (StringPtr) (MR(*holdstr) + fp2->floffs)); return retval; } -typedef pascal BOOLEAN (*filefiltp)( ParmBlkPtr pbp ); -#define CALLFILEFILT(pbp, fp) ROMlib_CALLFILEFILT((pbp), (filefiltp)(fp)) +A2(PRIVATE, LONGINT, stdfcmp, char *, ip1, char *, ip2) +{ + return stdfcmpC(ip1, ip2); +} A2(static inline, BOOLEAN, ROMlib_CALLFILEFILT, ParmBlkPtr, pbp, filefiltp, fp) { @@ -707,16 +754,11 @@ A2(static inline, BOOLEAN, ROMlib_CALLFILEFILT, ParmBlkPtr, pbp, filefiltp, fp) ROMlib_hook(stdfile_filefiltnumber); HOOKSAVEREGS(); - retval = CToPascalCall(fp, CTOP_SystemEvent, pbp); + retval = CToPascalCall(&fp, CTOP_SystemEvent, pbp); HOOKRESTOREREGS(); return retval; } -typedef pascal BOOLEAN (*custom_file_filtp) (ParmBlkPtr pbp, UNIV Ptr data); - -#define CALL_CUSTOM_FILE_FILT(pbp, data, fp) \ - ROMlib_CALL_CUSTOM_FILE_FILT ((pbp), (data), (custom_file_filtp) (fp)) - PRIVATE BOOLEAN ROMlib_CALL_CUSTOM_FILE_FILT (ParmBlkPtr pbp, UNIV Ptr data, custom_file_filtp fp) @@ -725,7 +767,7 @@ ROMlib_CALL_CUSTOM_FILE_FILT (ParmBlkPtr pbp, UNIV Ptr data, ROMlib_hook(stdfile_filefiltnumber); HOOKSAVEREGS(); - retval = CToPascalCall(fp, CTOP_GetAuxCtl, pbp, data); + retval = CToPascalCall(&fp, CTOP_GetAuxCtl, pbp, data); HOOKRESTOREREGS(); return retval; } @@ -815,7 +857,7 @@ A1(PRIVATE, void, flfill, fltype *, f) if (f->flnmfil > 0) { holdstr = f->flstrs; - qsort(MR(*f->flinfo), f->flnmfil, sizeof(**f->flinfo), (void *) stdfcmp); + ::qsort(MR(*f->flinfo), f->flnmfil, sizeof(**f->flinfo), stdfcmpC); if (!(MR(*f->flinfo)[0].flicns&GRAYBIT) && !f->flgraynondirs) { f->flsel = 0; settype(f, 0); @@ -949,7 +991,7 @@ PRIVATE BOOLEAN findparent(INTEGER *vrefp, LONGINT *diridp) if (!vcbp->vcbCTRef) { namelen = strlen(((VCBExtra *) vcbp)->unixname); if (namelen != 1 + SLASH_CHAR_OFFSET) { /* i.e. "/" */ - namecpy = alloca(namelen + 1); + namecpy = (char*)alloca(namelen + 1); strcpy(namecpy, ((VCBExtra *) vcbp)->unixname); slashp = strrchr(namecpy, '/'); if (slashp == namecpy + SLASH_CHAR_OFFSET) { @@ -989,7 +1031,7 @@ A1(PRIVATE, BOOLEAN, moveuponedir, DialogPtr, dp) BOOLEAN keyarrow(fltype *fl, INTEGER incr) /* -1: up, 1: down */ { INTEGER nsel, oldval, newval; - struct flinfostr *flp; + fltype::flinfostr *flp; /* * If there's no selection we start at the top or bottom, depending on * whether we're going down or p @@ -1105,7 +1147,7 @@ P3(PUBLIC, pascal INTEGER, ROMlib_stdffilt, DialogPeek, dp, INTEGER t; fltype *fl; INTEGER opentoken; - struct flinfostr *flp, *flep; + fltype::flinfostr *flp, *flep; INTEGER nsel, fltop; INTEGER part; INTEGER retval, retval2; @@ -1127,11 +1169,11 @@ P3(PUBLIC, pascal INTEGER, ROMlib_stdffilt, DialogPeek, dp, oldticks = -1000; *ith = CW(opentoken); retval = -1; -#if !defined(NEXTSTEP) +//#if !defined(MACOSX_) HiliteControl(h.p, inButton); Delay((LONGINT)5, (LONGINT *) 0); HiliteControl(h.p, 0); -#endif +//#endif } break; case ASCIIUPARROW: @@ -1278,16 +1320,15 @@ A3(PRIVATE, void, flinit, fltype *, f, Rect *, r, ControlHandle, sh) f->flsel = -1; savezone = TheZone; TheZone = SysZone; - f->flinfo = (struct flinfostr **) NewHandle((Size)0); + f->flinfo = (fltype::flinfostr **) NewHandle((Size)0); f->flstrs = (char **) NewHandle((Size)0); TheZone = savezone; } A3(PRIVATE, void, stdfflip, Rect *, rp, INTEGER, n, INTEGER, height) { - INTEGER savetop; - - savetop = rp->top; + INTEGER savetop = rp->top; + rp->top = CW(CW(rp->top) + (n * height + 1)); rp->bottom = CW(CW(rp->top) + height - 2); InvertRect(rp); @@ -1397,7 +1438,7 @@ A1(PRIVATE, BOOLEAN, trackdirs, DialogPeek, dp) /* Allocate potentially large temporary pixmap space. */ TEMP_ALLOC_ALLOCATE (save_bits_mem, temp_save_bits, CW (bounds->bottom) * row_bytes); - PIXMAP_BASEADDR_X (save_bits) = RM (save_bits_mem); + PIXMAP_BASEADDR_X (save_bits) = (Ptr)RM (save_bits_mem); WRAPPER_SET_PIXMAP_X (wrapper, RM (save_bits)); CopyBits (PORT_BITS_FOR_COPY (thePort), wrapper, @@ -1556,9 +1597,8 @@ PRIVATE boolean_t single_tree_fs_p(HParmBlkPtr pb) #if defined(MSDOS) || defined (CYGWIN32) return FALSE; #else - HVCB *vcbp; - - vcbp = ROMlib_vcbbyvrn(CW(pb->volumeParam.ioVRefNum)); + HVCB *vcbp = ROMlib_vcbbyvrn(CW(pb->volumeParam.ioVRefNum)); + return vcbp && !vcbp->vcbCTRef; #endif } @@ -1677,7 +1717,7 @@ fd_of (int i) #endif -PUBLIC void futzwithdosdisks( void ) +PUBLIC void Executor::futzwithdosdisks( void ) { #if defined (MSDOS) || defined (LINUX) || defined(CYGWIN32) int i, fd; @@ -1853,10 +1893,10 @@ ROMlib_CALLDHOOK (fltype *fl, INTEGER ihit, DialogPtr dp, dialog_hook_u dhu) { case original_sf: case new_sf: - retval = CToPascalCall (dhu.odh, CTOP_Alert, ihit, dp); + retval = CToPascalCall (&dhu.odh, CTOP_Alert, ihit, dp); break; case new_custom_sf: - retval = CToPascalCall (dhu.cdh, CTOP_unused_stdfile_2, ihit, dp, + retval = CToPascalCall (&dhu.cdh, CTOP_unused_stdfile_2, ihit, dp, fl->mydata); break; default: @@ -1986,14 +2026,14 @@ unixcore (StringPtr namep, INTEGER *vrefnump, LONGINT *diridp) #if 0 vcbp = ROMlib_vcbbyvrn(vrefnum); #else - pbr.ioParam.ioNamePtr = CLC(0); + pbr.ioParam.ioNamePtr = (StringPtr)CLC(0); pbr.ioParam.ioVRefNum = CW(vrefnum); vcbp = ROMlib_breakoutioname(&pbr, &templ, &tempcp, (BOOLEAN *) 0, TRUE); free (tempcp); #endif if (vcbp && !vcbp->vcbCTRef) { - pb.ioParam.ioNamePtr = CLC(0); + pb.ioParam.ioNamePtr = (StringPtr)CLC(0); pb.ioParam.ioVRefNum = pbr.ioParam.ioVRefNum; err = ROMlib_nami(&pb, *diridp, NoIndex, &pathname, &filename, &endname, FALSE, &vcbp2, &sbuf); @@ -2002,7 +2042,7 @@ unixcore (StringPtr namep, INTEGER *vrefnump, LONGINT *diridp) VCBExtra *vcbextrap; namelen = endname - pathname - 1; - newname = alloca(namelen + 1 + namep[0] + 1); + newname = (char*)alloca(namelen + 1 + namep[0] + 1); strncpy(newname, pathname, namelen); newname[namelen] = '/'; strncpy(newname + namelen + 1, (char *) namep+1, namep[0]); @@ -2161,32 +2201,30 @@ getditext (DialogPtr dp, INTEGER item, StringPtr text) PRIVATE void report_new_folder_failure (OSErr err) { - char *message; + char *message = (char*)alloca (256); Str255 str; - - switch (err) - { + + switch (err) { default: - message = alloca (256); sprintf (message, "Error #%d occurred; you may not be able to create a new folder.", err); break; case dupFNErr: - message = "That name is already taken; please use another name."; + snprintf(message, 256, "That name is already taken; please use another name."); break; case dirFulErr: - message = "This directory is full; you may not be able to create a new folder."; + snprintf(message, 256, "This directory is full; you may not be able to create a new folder."); break; case dskFulErr: - message = "This disk is full; you may not be able to create a new folder."; + snprintf(message, 256, "This disk is full; you may not be able to create a new folder."); break; case permErr: case wrPermErr: - message = "Filesystem permissions prevent the creation of a new folder."; + snprintf(message, 256, "Filesystem permissions prevent the creation of a new folder."); break; case vLckdErr: - message = "This volume is locked; you can not create a new folder."; + snprintf(message, 256, "This volume is locked; you can not create a new folder."); break; - } + } str255_from_c_string (str, message); ParamText (str, 0, 0, 0); NoteAlert (GENERIC_COMPLAINT_ID, (ProcPtr) 0); @@ -2290,7 +2328,7 @@ PUBLIC void spfcommon(Point p, StringPtr prompt, StringPtr name, if (is_normal_dlgid (getorput, dig) && host_has_spfcommon ()) { host_spf_reply_block reply; char *c_prompt; - char *local_name = "currently ignored"; + const char *local_name = "currently ignored"; c_prompt = cstring_from_str255 (prompt); #if 0 @@ -2300,7 +2338,7 @@ PUBLIC void spfcommon(Point p, StringPtr prompt, StringPtr name, #endif reply_valid = host_spfcommon (&reply, c_prompt, local_name, &fp, &filef, numt, tl, getorput, flavor, activeList, - activateproc, yourdatap); + &activateproc, yourdatap); free (c_prompt); if (reply_valid) rep_from_host_reply_block (&rep, &reply); diff --git a/src/stdmbdf.c b/src/stdmbdf.c deleted file mode 100644 index 34891cbe..00000000 --- a/src/stdmbdf.c +++ /dev/null @@ -1,653 +0,0 @@ -/* Copyright 1990, 1995 by Abacus Research and - * Development, Inc. All rights reserved. - */ - -#if !defined (OMIT_RCSID_STRINGS) -char ROMlib_rcsid_stdmbdf[] = - "$Id: stdmbdf.c 87 2005-05-25 01:57:33Z ctm $"; -#endif - -/* - * Checked for HLock and HUnlock by ctm on Fri May 10 18:31:31 MDT 1991 - */ - -#include "rsys/common.h" -#include "QuickDraw.h" -#include "CQuickDraw.h" -#include "MenuMgr.h" -#include "WindowMgr.h" -#include "MemoryMgr.h" -#include "ToolboxUtil.h" -#include "FontMgr.h" - -#include "rsys/cquick.h" -#include "rsys/menu.h" -#include "rsys/wind.h" -#include "rsys/image.h" -#include "rsys/executor.h" - -/* apple image */ -#include "apple.c" - -enum { APPLE_CHAR = 0x14, INFINITY_CHAR = 0xB0 }; - -/* - * NOTE: if sixbyteoffset == 0 then realhilite does the entire menubar - */ - -static void -draw_menu_title (muelem *elt, - int last_menu_p, - int hilite_p, - int16 muright) -{ - int gray_title_p, dither_title_p = FALSE; - RGBColor title_color, bar_color; - MenuHandle muhandle; - char *title; - Rect dstr; - - muhandle = MR (elt->muhandle); - - menu_bar_color (&bar_color); - menu_title_color (MI_ID (muhandle), &title_color); - - dstr.top = CW (hilite_p ? 1 : 0); - dstr.bottom = CW (CW (MBarHeight) - 1); - dstr.left = elt->muleft; - dstr.right = last_menu_p ? CW (muright) : elt[1].muleft; - - RGBForeColor (hilite_p ? &bar_color : &title_color); - RGBBackColor (hilite_p ? &title_color : &bar_color); - - EraseRect (&dstr); - - title = (char *) MI_DATA (muhandle); - -#if defined (COLOR_APPLE_MENU_ICON) - gd = CL (MainDevice); - if (*title == 1 - && title[1] == '\024' - && PIXMAP_PIXEL_SIZE (GD_PMAP (gd)) > 2) - { - /* draw the color apple */ - dstr = apple->bounds; - OffsetRect (&dstr, - CW (elt->muleft) + MENULEFT - 6, 1); - - RGBForeColor (&ROMlib_black_rgb_color); - RGBBackColor (&ROMlib_white_rgb_color); - - image_update_ctab (apple, hilite_p ? &title_color : &bar_color, 0); - image_copy (apple, TRUE, - &dstr, srcCopy); - } - else -#endif /* COLOR_APPLE_MENU_ICON */ - { - gray_title_p = ! (MI_ENABLE_FLAGS_X (muhandle) & CLC (1)); - if (gray_title_p) - { - dither_title_p = !AVERAGE_COLOR (&bar_color, &title_color, 0x8000, - &title_color); - RGBForeColor (&title_color); - } - PORT_TX_MODE_X (thePort) = srcCopy; - MoveTo (CW (elt->muleft) + MENULEFT - 3, 14); - if (ROMlib_AppleChar && title[0] == 1 && title[1] == APPLE_CHAR) - { - title[1] = (char) ROMlib_AppleChar; - DrawString ((StringPtr) title); - title[1] = APPLE_CHAR; - } - else - DrawString ((StringPtr) title); - if (dither_title_p) - { - PenPat (gray); - PenMode (notPatBic); - PaintRect (&dstr); - PenMode (patCopy); - PenPat (black); - } - /* resent the fg/bk colors */ - RGBForeColor (&ROMlib_black_rgb_color); - RGBBackColor (&ROMlib_white_rgb_color); - } -} - -static void -realhilite (int16 offset, highstate h) -{ - muelem *mp; - - /* NOTE: right now we aren't paying attention to h, and we are blindly - inverting whatever we're supposed to. When we do color this - will be unacceptable, and if we appear to have menu highliting - bugs then we should probably check this out. */ - - if (offset >= 0) - { - if (offset > 0) - { - mp = (muelem *) ((char *) STARH (MR (MenuList)) + offset); - - draw_menu_title (mp, - offset == Hx (MENULIST, muoff), - h == HILITE, - Hx (MENULIST, muright)); - } - else - { - RGBColor bar_color; - int mbar_height; - menulist *menulistp; - muelem *mp, *mpend; - Rect r; - - /* toggle the entire menu bar */ - mbar_height = CW (MBarHeight); - - r = PORT_RECT (MR (wmgr_port)); - r.bottom = CW (mbar_height - 1); - - if (h == HILITE) - menu_title_color (0, &bar_color); - else - menu_bar_color (&bar_color); - RGBBackColor (&bar_color); - - EraseRect (&r); - - PenSize (1, 1); - MoveTo (CW (r.left), mbar_height - 1); - LineTo (CW (r.right) - 1, mbar_height - 1); - - HLock (MR (MenuList)); - menulistp = STARH (MENULIST); - mpend = menulistp->mulist + CW (menulistp->muoff) / sizeof (muelem); - for (mp = menulistp->mulist; mp != mpend; mp++) - draw_menu_title (mp, mp == mpend - 1, - h == HILITE, CW (menulistp->muright)); - HUnlock (MR (MenuList)); - } - } -} - -static void -mbdf_draw (int32 draw_p) -{ - RGBColor bar_color; - menulist *menulistp; - muelem *mp, *mpend; - Rect r; - - r = PORT_RECT (MR (wmgr_port)); - r.bottom = CW (CW (MBarHeight) - 1); - ClipRect (&r); - - menu_bar_color (&bar_color); - RGBBackColor (&bar_color); - EraseRect (&r); - - PenSize (1, 1); - MoveTo (CW (r.left), CW (MBarHeight) - 1); - LineTo (CW (r.right) - 1, CW (MBarHeight) - 1); - if (draw_p == DRAWMENUBAR) - { - /* draw titles */ - r.bottom = CW (CW (r.bottom) - 1); - - PORT_TX_FACE_X (MR (wmgr_port)) = (Style) CB (0); - PORT_TX_FONT_X (MR (wmgr_port)) = SysFontFam; - - HLock (MR (MenuList)); - menulistp = STARH (MENULIST); - mpend = menulistp->mulist + CW (menulistp->muoff) / sizeof (muelem); - for (mp = menulistp->mulist; mp != mpend; mp++) - draw_menu_title (mp, mp == mpend - 1, FALSE, CW (menulistp->muright)); - HUnlock (MR (MenuList)); - - /* highlite title if necessary */ - if (TheMenu) - realhilite (ROMlib_mentosix (CW (TheMenu)), HILITE); - - /* set ClipRgn to full open */ - ClipRect (&PORT_RECT (MR (wmgr_port))); - } - - /* resent the fg/bk colors */ - RGBForeColor (&ROMlib_black_rgb_color); - RGBBackColor (&ROMlib_white_rgb_color); -} - -A1(PRIVATE, LONGINT, hit, LONGINT, mousept) -{ - Point p; - muelem *mp, *mpend; - mbdfentry *mbdfp, *mbdfep; - - p.h = LoWord(mousept); - p.v = HiWord(mousept); - - if (p.v < CW(MBarHeight)) { - mpend = HxX(MENULIST, mulist) + Hx(MENULIST, muoff) / sizeof(muelem); - for (mp = HxX(MENULIST, mulist); mp != mpend && CW(mp->muleft) <= p.h; mp++) - ; - if (mp == HxX(MENULIST, mulist) || p.h > Hx(MENULIST, muright)) -/*-->*/ return NOTHITINMBAR; - else -/*-->*/ return (char *) (mp-1) - (char *) STARH(MR (MenuList)); - } else { - mbdfep = (mbdfentry *) STARH(MR (MBSaveLoc)); - for (mbdfp = (mbdfentry *) - ((char *) mbdfep + CW(((mbdfheader *)mbdfep)->lastMBSave)); - mbdfp != mbdfep && !PtInRect(p, &mbdfp->mbRectSave); mbdfp--) - ; - if (mbdfp == mbdfep) -/*-->*/ return NOTHIT; - else -/*-->*/ return CW(mbdfp->mbMLOffset); - } -} - -A1(PRIVATE, void, calc, LONGINT, offset) -{ - MenuHandle mh; - INTEGER left, titsize; - muelem *mp, *mep, *firstmp; - menulist *menulistp; - - PORT_TX_FACE_X (MR (wmgr_port)) = (Style) CB (0); - PORT_TX_FONT_X (MR (wmgr_port)) = SysFontFam; - - HLock(MR (MenuList)); - menulistp = STARH(MENULIST); - firstmp = menulistp->mulist; - if (offset == 0) - mp = firstmp; - else - mp = (muelem *) ((char *) menulistp + offset); - if (mp == firstmp) - left = MENULEFT; - else { - mh = MR(mp[-1].muhandle); - HLock((Handle) mh); - titsize = StringWidth(HxX(mh, menuData)) + SLOP; - HUnlock((Handle) mh); - left = CW(mp[-1].muleft) + titsize; - } - for (mep = (muelem *) ((char *)menulistp + CW(menulistp->muoff)) + 1; - mp < mep ; mp++) { - mp->muleft = CW(left); - mh = MR(mp->muhandle); - HLock((Handle) mh); - titsize = StringWidth(HxX(mh, menuData)) + SLOP; - HUnlock((Handle) mh); - left += titsize; - } - menulistp->muright = CW(left); - HUnlock(MR (MenuList)); -} - -static void -init () -{ - if (!MBSaveLoc) - { - MBSaveLoc = RM(NewHandle((Size) MBDFSTRUCTBYTES)); - HxX(MBSAVELOC, mbCustomStorage) = (Handle) CLC (0); - } - HxX (MBSAVELOC, lastMBSave) = CLC (0); - - -} - -A0(PRIVATE, void, dispose) -{ -} - -static void -mbdfhilite (int32 hilitestate) -{ - int16 loword; - - loword = LoWord(hilitestate); - switch (HiWord (hilitestate)) - { - case 0: - realhilite (loword, HILITE); - break; - case 1: - realhilite (loword, RESTORE); - break; - } -} - -A0(PRIVATE, void, height) -{ - FontInfo fi; - - GetFontInfo(&fi); - MBarHeight = CW(CW(fi.ascent) + CW(fi.descent) + CW(fi.leading) + 4); -} - -static void -save (int16 offset, Rect *rect) -{ - GDHandle gd; - PixMapHandle gd_pixmap; - muelem *mup; - mbdfentry *mep; - Rect save_rect; - Ptr p; - - gd = MR (TheGDevice); - gd_pixmap = GD_PMAP (gd); - -#define FAIL goto failure -#define DONE goto done -#define DO_BLOCK_WITH_FAILURE(try_block, fail_block) \ - { \ - { try_block } \ - goto done; \ - failure: \ - { fail_block } \ - /* fall through */ \ - done:; \ - } - - LOCK_HANDLE_EXCURSION_1 - (MR (MBSaveLoc), - { - int current_mb_save; - - current_mb_save = Hx (MBSAVELOC, lastMBSave) + sizeof (mbdfentry); - HxX (MBSAVELOC, lastMBSave) = CW (current_mb_save); - mep = (mbdfentry *) ((char *) STARH (MBSAVELOC) + current_mb_save); - - mep->mbRectSave = *rect; - - DO_BLOCK_WITH_FAILURE - ({ - PixMapHandle save_pmh; - int gd_bpp; - int row_bytes; - - Rect *bounds; - int height; - int width; - - save_pmh = NewPixMap (); - if (save_pmh == NULL) - FAIL; - - mep->mbMenuDir = CWC (MBRIGHTDIR); - mep->mbMLOffset = CW (offset); - mup = (muelem *) ((char *) STARH (MR (MenuList)) + offset); - mep->mbMLHandle = mup->muhandle; - mep->mbReserved = CLC (0); - save_rect.top = CW (CW (rect->top) - 1); - save_rect.left = CW (CW (rect->left) - 1); - save_rect.bottom = CW (CW (rect->bottom) + 2); - save_rect.right = CW (CW (rect->right) + 2); - - bounds = &PIXMAP_BOUNDS (save_pmh); - - *bounds = save_rect; - /* long align the left boundary */ - bounds->left = CW (CW (save_rect.left) & ~31); - bounds->right = CW (MIN (CW (bounds->right), - CW (PORT_BOUNDS(thePort).right))); - - height = RECT_HEIGHT (bounds); - width = RECT_WIDTH (bounds); - - gd_bpp = PIXMAP_PIXEL_SIZE (gd_pixmap); - - ROMlib_copy_ctab (PIXMAP_TABLE (gd_pixmap), - PIXMAP_TABLE (save_pmh)); - - pixmap_set_pixel_fields (STARH (save_pmh), gd_bpp); - - row_bytes = ((width * gd_bpp + 31) / 32) * 4; - PIXMAP_SET_ROWBYTES_X (save_pmh, CW (row_bytes)); - - p = NewPtr (height * row_bytes); - if (MemErr != CWC (noErr)) - { - DisposPixMap (save_pmh); - FAIL; - } - PIXMAP_BASEADDR_X (save_pmh) = RM (p); - - { - WRAPPER_PIXMAP_FOR_COPY (wrapper); - - WRAPPER_SET_PIXMAP_X (wrapper, - RM (save_pmh)); - - CopyBits (PORT_BITS_FOR_COPY (thePort), wrapper, - &save_rect, &save_rect, srcCopy, NULL); - } - - mep->mbBitsSave = (Handle) RM (save_pmh); - }, - { - mep->mbBitsSave = NULL; - }); - }); - - /* Erase to white -- colored backgrounds can be drawn by individual - mdefs. If we erase this to the ostensible background color, MacClade - will get a black background on its custom Tool menu. */ - - RGBForeColor (&ROMlib_white_rgb_color); - PaintRect (rect); - - PenNormal (); - RGBForeColor (&ROMlib_black_rgb_color); - - save_rect.right = CW (CW (save_rect.right) - 1); - save_rect.bottom = CW (CW (save_rect.bottom) - 1); - FrameRect (&save_rect); - - MoveTo (CW (save_rect.right), CW (save_rect.top) + 3); - LineTo (CW (save_rect.right), CW (save_rect.bottom)); - MoveTo (CW (save_rect.left) + 3, CW (save_rect.bottom)); - LineTo (CW (save_rect.right), CW (save_rect.bottom)); - - ClipRect (rect); -} - -static void -restore (void) -{ - LOCK_HANDLE_EXCURSION_1 - (MR (MBSaveLoc), - { - mbdfentry *mep; - PixMapHandle save_pmh; - Rect save_rect; - - mep = (mbdfentry *) ((char *) STARH (MBSAVELOC) - + Hx (MBSAVELOC, lastMBSave)); - save_rect = mep->mbRectSave; - save_rect.top = CW (CW (save_rect.top) - 1); - save_rect.left = CW (CW (save_rect.left) - 1); - save_rect.bottom = CW (CW (save_rect.bottom) + 2); - save_rect.right = CW (CW (save_rect.right) + 2); - - save_pmh = (PixMapHandle) MR (mep->mbBitsSave); - - if (save_pmh == NULL) - { - RgnHandle rh; - - rh = NewRgn (); - RectRgn (rh, &save_rect); - PaintBehind ((WindowPeek) FrontWindow (), rh); - DisposeRgn (rh); - } - else - { - { - WRAPPER_PIXMAP_FOR_COPY (wrapper); - - WRAPPER_SET_PIXMAP_X (wrapper, RM (save_pmh)); - CopyBits (wrapper, PORT_BITS_FOR_COPY (thePort), - &save_rect, &save_rect, srcCopy, NULL); - } - - DisposPtr (PIXMAP_BASEADDR (save_pmh)); - DisposPixMap (save_pmh); - } - - mep->mbBitsSave = NULL; - HxX (MBSAVELOC, lastMBSave) - = CW (Hx (MBSAVELOC, lastMBSave) - sizeof (mbdfentry)); - }); -} - -A1(PRIVATE, Rect *, getrect, LONGINT, offset) -{ - INTEGER hiword; - static Rect r; - MenuHandle mh; - muelem *mp; - INTEGER dh, dv; - - hiword = HiWord(offset); - mp = (muelem *) ((char *) STARH(MR (MenuList)) + LoWord(offset)); - mh = MR(mp->muhandle); - if (Hx(mh, menuWidth) == -1 || Hx(mh, menuHeight) == -1) - CalcMenuSize(mh); - if (hiword) { /* hierarchical */ - /* note 7 and 5 below are guesses */ - r.top = CW(MAX(Hx(MBSAVELOC, mbItemRect.top), CW(MBarHeight)+7)); - r.left = CW(Hx(MBSAVELOC, mbItemRect.right) - 5); - r.bottom = CW(CW(r.top) + Hx(mh, menuHeight)); - r.right = CW(CW(r.left) + Hx(mh, menuWidth)); - } else { /* regular */ - r.top = MBarHeight; - r.left = mp->muleft; - r.bottom = CW(CW(r.top) + Hx(mh, menuHeight)); - r.right = CW(CW(r.left) + Hx(mh, menuWidth)); - } - dh = CW(screenBitsX.bounds.right) - 10 - CW(r.right); - if (dh > 0) - dh = 0; - dv = CW(screenBitsX.bounds.bottom) - 10 - CW(r.bottom); - if (dv > 0) - dv = 0; - OffsetRect(&r, dh, dv); - return &r; -} - -A1(PRIVATE, mbdfentry *, offtomep, LONGINT, offset) -{ - mbdfentry *mbdfp, *mbdfep; - - mbdfep = (mbdfentry *) STARH(MR (MBSaveLoc)); - for (mbdfp = (mbdfentry *) - ((char *) mbdfep + CW(((mbdfheader *)mbdfep)->lastMBSave)); - mbdfp != mbdfep && CW(mbdfp->mbMLOffset) != offset; mbdfp--) - ; - return mbdfp == mbdfep ? 0 : mbdfp; -} - -A1(PRIVATE, void, savealt, LONGINT, offset) -{ - mbdfentry *mep; - - mep = offtomep(offset); - mep->mbTopScroll = TopMenuItem; - mep->mbBotScroll = AtMenuBottom; -} - -A1(PRIVATE, void, resetalt, LONGINT, offset) -{ - mbdfentry *mep; - - mep = offtomep(offset); - TopMenuItem = mep->mbTopScroll; - AtMenuBottom = mep->mbBotScroll; -} - -A1(PRIVATE, RgnHandle, menurgn, RgnHandle, rgn) -{ - Rect r; - - if (CW(MBarHeight) <= 0) - height(); - r = PORT_RECT (MR (wmgr_port)); - r.bottom = MBarHeight; - RectRgn(rgn, &r); - SectRgn(rgn, MR(GrayRgn), rgn); - return rgn; -} - -P4 (PUBLIC, pascal int32, mbdf0, int16, sel, int16, mess, - int16, param1, int32, param2) -{ - int32 retval; - HIDDEN_GrafPtr saveport; - - retval = 0; - if (mess != mbInit) /* fun w/ Word 6 */ - { - GetPort(&saveport); - saveport.p = MR(saveport.p); - SetPort(MR(wmgr_port)); - } - - switch (mess) - { - case mbDraw: - mbdf_draw (param2); - break; - case mbHit: - retval = hit(param2); - break; - case mbCalc: - calc(param2); - break; - case mbInit: - init(); - break; - case mbDispose: - dispose(); - break; - case mbHilite: - ClipRect(&PORT_RECT (MR (wmgr_port))); /* full open */ - mbdfhilite(param2); - break; - case mbHeight: - height(); - break; - case mbSave: - ClipRect (&PORT_RECT (MR (wmgr_port))); /* full open */ - save(param1, (Rect *) SYN68K_TO_US(param2)); - break; - case mbRestore: - ClipRect (&PORT_RECT (MR (wmgr_port))); /* full open */ - restore(); - break; - case mbRect: - retval = (LONGINT) US_TO_SYN68K(getrect(param2)); - break; - case mbSaveAlt: - savealt(param2); - break; - case mbResetAlt: - resetalt(param2); - break; - case mbMenuRgn: - retval = (LONGINT) - US_TO_SYN68K(menurgn((RgnHandle) US_TO_SYN68K(param2))); - break; - } - if (mess != mbInit) - SetPort(saveport.p); - return retval; -} diff --git a/src/stdmbdf.cpp b/src/stdmbdf.cpp new file mode 100644 index 00000000..59db13bf --- /dev/null +++ b/src/stdmbdf.cpp @@ -0,0 +1,668 @@ +/* Copyright 1990, 1995 by Abacus Research and + * Development, Inc. All rights reserved. + */ + +#if !defined (OMIT_RCSID_STRINGS) +char ROMlib_rcsid_stdmbdf[] = +"$Id: stdmbdf.c 87 2005-05-25 01:57:33Z ctm $"; +#endif + +/* + * Checked for HLock and HUnlock by ctm on Fri May 10 18:31:31 MDT 1991 + */ + +#include "rsys/common.h" +#include "QuickDraw.h" +#include "CQuickDraw.h" +#include "MenuMgr.h" +#include "WindowMgr.h" +#include "MemoryMgr.h" +#include "ToolboxUtil.h" +#include "FontMgr.h" + +#include "rsys/cquick.h" +#include "rsys/menu.h" +#include "rsys/wind.h" +#include "rsys/image.h" +#include "rsys/executor.h" + +/* apple image */ +namespace Executor { +#include "apple.cmap" +} +using namespace Executor; + +enum { APPLE_CHAR = 0x14, INFINITY_CHAR = 0xB0 }; + +/* + * NOTE: if sixbyteoffset == 0 then realhilite does the entire menubar + */ + +static void +draw_menu_title (muelem *elt, + int last_menu_p, + int hilite_p, + int16 muright) +{ + int gray_title_p, dither_title_p = FALSE; + RGBColor title_color, bar_color; + MenuHandle muhandle; + char *title; + Rect dstr; + + muhandle = MR (elt->muhandle); + + menu_bar_color (&bar_color); + menu_title_color (MI_ID (muhandle), &title_color); + + dstr.top = CW (hilite_p ? 1 : 0); + dstr.bottom = CW (CW (MBarHeight) - 1); + dstr.left = elt->muleft; + dstr.right = last_menu_p ? CW (muright) : elt[1].muleft; + + RGBForeColor (hilite_p ? &bar_color : &title_color); + RGBBackColor (hilite_p ? &title_color : &bar_color); + + EraseRect (&dstr); + + title = (char *) MI_DATA (muhandle); + +#if defined (COLOR_APPLE_MENU_ICON) + gd = CL (MainDevice); + if (*title == 1 + && title[1] == '\024' + && PIXMAP_PIXEL_SIZE (GD_PMAP (gd)) > 2) + { + /* draw the color apple */ + dstr = apple->bounds; + OffsetRect (&dstr, + CW (elt->muleft) + MENULEFT - 6, 1); + + RGBForeColor (&ROMlib_black_rgb_color); + RGBBackColor (&ROMlib_white_rgb_color); + + image_update_ctab (apple, hilite_p ? &title_color : &bar_color, 0); + image_copy (apple, TRUE, + &dstr, srcCopy); + } + else +#endif /* COLOR_APPLE_MENU_ICON */ + { + gray_title_p = ! (MI_ENABLE_FLAGS_X (muhandle) & CLC (1)); + if (gray_title_p) + { + dither_title_p = !AVERAGE_COLOR (&bar_color, &title_color, 0x8000, + &title_color); + RGBForeColor (&title_color); + } + PORT_TX_MODE_X (thePort) = srcCopy; + MoveTo (CW (elt->muleft) + MENULEFT - 3, 14); + if (ROMlib_AppleChar && title[0] == 1 && title[1] == APPLE_CHAR) + { + title[1] = (char) ROMlib_AppleChar; + DrawString ((StringPtr) title); + title[1] = APPLE_CHAR; + } + else + DrawString ((StringPtr) title); + if (dither_title_p) + { + PenPat (gray); + PenMode (notPatBic); + PaintRect (&dstr); + PenMode (patCopy); + PenPat (black); + } + /* resent the fg/bk colors */ + RGBForeColor (&ROMlib_black_rgb_color); + RGBBackColor (&ROMlib_white_rgb_color); + } +} + +static void +realhilite (int16 offset, highstate h) +{ + muelem *mp; + + /* NOTE: right now we aren't paying attention to h, and we are blindly + inverting whatever we're supposed to. When we do color this + will be unacceptable, and if we appear to have menu highliting + bugs then we should probably check this out. */ + + if (offset >= 0) + { + if (offset > 0) + { + mp = (muelem *) ((char *) STARH (MR (MenuList)) + offset); + + draw_menu_title (mp, + offset == Hx (MENULIST, muoff), + h == HILITE, + Hx (MENULIST, muright)); + } + else + { + RGBColor bar_color; + int mbar_height; + menulist *menulistp; + muelem *mp, *mpend; + Rect r; + + /* toggle the entire menu bar */ + mbar_height = CW (MBarHeight); + + r = PORT_RECT (MR (wmgr_port)); + r.bottom = CW (mbar_height - 1); + + if (h == HILITE) + menu_title_color (0, &bar_color); + else + menu_bar_color (&bar_color); + RGBBackColor (&bar_color); + + EraseRect (&r); + + PenSize (1, 1); + MoveTo (CW (r.left), mbar_height - 1); + LineTo (CW (r.right) - 1, mbar_height - 1); + + HLock (MR (MenuList)); + menulistp = STARH (MENULIST); + mpend = menulistp->mulist + CW (menulistp->muoff) / sizeof (muelem); + for (mp = menulistp->mulist; mp != mpend; mp++) + draw_menu_title (mp, mp == mpend - 1, + h == HILITE, CW (menulistp->muright)); + HUnlock (MR (MenuList)); + } + } +} + +static void +mbdf_draw (int32 draw_p) +{ + RGBColor bar_color; + menulist *menulistp; + muelem *mp, *mpend; + Rect r; + + r = PORT_RECT (MR (wmgr_port)); + r.bottom = CW (CW (MBarHeight) - 1); + ClipRect (&r); + + menu_bar_color (&bar_color); + RGBBackColor (&bar_color); + EraseRect (&r); + + PenSize (1, 1); + MoveTo (CW (r.left), CW (MBarHeight) - 1); + LineTo (CW (r.right) - 1, CW (MBarHeight) - 1); + if (draw_p == DRAWMENUBAR) + { + /* draw titles */ + r.bottom = CW (CW (r.bottom) - 1); + + PORT_TX_FACE_X (MR (wmgr_port)) = (Style) CB (0); + PORT_TX_FONT_X (MR (wmgr_port)) = SysFontFam; + + HLock (MR (MenuList)); + menulistp = STARH (MENULIST); + mpend = menulistp->mulist + CW (menulistp->muoff) / sizeof (muelem); + for (mp = menulistp->mulist; mp != mpend; mp++) + draw_menu_title (mp, mp == mpend - 1, FALSE, CW (menulistp->muright)); + HUnlock (MR (MenuList)); + + /* highlite title if necessary */ + if (TheMenu) + realhilite (ROMlib_mentosix (CW (TheMenu)), HILITE); + + /* set ClipRgn to full open */ + ClipRect (&PORT_RECT (MR (wmgr_port))); + } + + /* resent the fg/bk colors */ + RGBForeColor (&ROMlib_black_rgb_color); + RGBBackColor (&ROMlib_white_rgb_color); +} + +namespace Executor { + PRIVATE LONGINT hit(LONGINT); + PRIVATE void calc(LONGINT offset); + PRIVATE void dispose(); + PRIVATE void height(); + PRIVATE Rect * getrect(LONGINT); + PRIVATE mbdfentry * offtomep(LONGINT); + PRIVATE void savealt(LONGINT); + PRIVATE void resetalt(LONGINT); + PRIVATE RgnHandle menurgn(RgnHandle); +} + +A1(PRIVATE, LONGINT, hit, LONGINT, mousept) +{ + Point p; + muelem *mp, *mpend; + mbdfentry *mbdfp, *mbdfep; + + p.h = LoWord(mousept); + p.v = HiWord(mousept); + + if (p.v < CW(MBarHeight)) { + mpend = HxX(MENULIST, mulist) + Hx(MENULIST, muoff) / sizeof(muelem); + for (mp = HxX(MENULIST, mulist); mp != mpend && CW(mp->muleft) <= p.h; mp++) + ; + if (mp == HxX(MENULIST, mulist) || p.h > Hx(MENULIST, muright)) + /*-->*/ return NOTHITINMBAR; + else + /*-->*/ return (char *) (mp-1) - (char *) STARH(MR (MenuList)); + } else { + mbdfep = (mbdfentry *) STARH(MR (MBSaveLoc)); + for (mbdfp = (mbdfentry *) + ((char *) mbdfep + CW(((mbdfheader *)mbdfep)->lastMBSave)); + mbdfp != mbdfep && !PtInRect(p, &mbdfp->mbRectSave); mbdfp--) + ; + if (mbdfp == mbdfep) + /*-->*/ return NOTHIT; + else + /*-->*/ return CW(mbdfp->mbMLOffset); + } +} + +A1(PRIVATE, void, calc, LONGINT, offset) +{ + MenuHandle mh; + INTEGER left, titsize; + muelem *mp, *mep, *firstmp; + menulist *menulistp; + + PORT_TX_FACE_X (MR (wmgr_port)) = (Style) CB (0); + PORT_TX_FONT_X (MR (wmgr_port)) = SysFontFam; + + HLock(MR (MenuList)); + menulistp = STARH(MENULIST); + firstmp = menulistp->mulist; + if (offset == 0) + mp = firstmp; + else + mp = (muelem *) ((char *) menulistp + offset); + if (mp == firstmp) + left = MENULEFT; + else { + mh = MR(mp[-1].muhandle); + HLock((Handle) mh); + titsize = StringWidth(HxX(mh, menuData)) + SLOP; + HUnlock((Handle) mh); + left = CW(mp[-1].muleft) + titsize; + } + for (mep = (muelem *) ((char *)menulistp + CW(menulistp->muoff)) + 1; + mp < mep ; mp++) { + mp->muleft = CW(left); + mh = MR(mp->muhandle); + HLock((Handle) mh); + titsize = StringWidth(HxX(mh, menuData)) + SLOP; + HUnlock((Handle) mh); + left += titsize; + } + menulistp->muright = CW(left); + HUnlock(MR (MenuList)); +} + +static void +init () +{ + if (!MBSaveLoc) + { + MBSaveLoc = RM(NewHandle((Size) MBDFSTRUCTBYTES)); + HxX(MBSAVELOC, mbCustomStorage) = (Handle) CLC (0); + } + HxX (MBSAVELOC, lastMBSave) = CLC (0); + + +} + +A0(PRIVATE, void, dispose) +{ +} + +static void +mbdfhilite (int32 hilitestate) +{ + int16 loword; + + loword = LoWord(hilitestate); + switch (HiWord (hilitestate)) + { + case 0: + realhilite (loword, HILITE); + break; + case 1: + realhilite (loword, RESTORE); + break; + } +} + +A0(PRIVATE, void, height) +{ + FontInfo fi; + + GetFontInfo(&fi); + MBarHeight = CW(CW(fi.ascent) + CW(fi.descent) + CW(fi.leading) + 4); +} + +static void +save (int16 offset, Rect *rect) +{ + GDHandle gd; + PixMapHandle gd_pixmap; + muelem *mup; + mbdfentry *mep; + Rect save_rect; + Ptr p; + + gd = MR (TheGDevice); + gd_pixmap = GD_PMAP (gd); + +#define FAIL goto failure +#define DONE goto done +#define DO_BLOCK_WITH_FAILURE(try_block, fail_block) \ +{ \ +{ try_block } \ +goto done; \ +failure: \ +{ fail_block } \ +/* fall through */ \ +done:; \ +} + + LOCK_HANDLE_EXCURSION_1 + (MR (MBSaveLoc), + { + int current_mb_save; + + current_mb_save = Hx (MBSAVELOC, lastMBSave) + sizeof (mbdfentry); + HxX (MBSAVELOC, lastMBSave) = CW (current_mb_save); + mep = (mbdfentry *) ((char *) STARH (MBSAVELOC) + current_mb_save); + + mep->mbRectSave = *rect; + + DO_BLOCK_WITH_FAILURE + ({ + PixMapHandle save_pmh; + int gd_bpp; + int row_bytes; + + Rect *bounds; + int height; + int width; + + save_pmh = NewPixMap (); + if (save_pmh == NULL) + FAIL; + + mep->mbMenuDir = CWC (MBRIGHTDIR); + mep->mbMLOffset = CW (offset); + mup = (muelem *) ((char *) STARH (MR (MenuList)) + offset); + mep->mbMLHandle = mup->muhandle; + mep->mbReserved = CLC (0); + save_rect.top = CW (CW (rect->top) - 1); + save_rect.left = CW (CW (rect->left) - 1); + save_rect.bottom = CW (CW (rect->bottom) + 2); + save_rect.right = CW (CW (rect->right) + 2); + + bounds = &PIXMAP_BOUNDS (save_pmh); + + *bounds = save_rect; + /* long align the left boundary */ + bounds->left = CW (CW (save_rect.left) & ~31); + bounds->right = CW (MIN (CW (bounds->right), + CW (PORT_BOUNDS(thePort).right))); + + height = RECT_HEIGHT (bounds); + width = RECT_WIDTH (bounds); + + gd_bpp = PIXMAP_PIXEL_SIZE (gd_pixmap); + + ROMlib_copy_ctab (PIXMAP_TABLE (gd_pixmap), + PIXMAP_TABLE (save_pmh)); + + pixmap_set_pixel_fields (STARH (save_pmh), gd_bpp); + + row_bytes = ((width * gd_bpp + 31) / 32) * 4; + PIXMAP_SET_ROWBYTES_X (save_pmh, CW (row_bytes)); + + p = NewPtr (height * row_bytes); + if (MemErr != CWC (noErr)) + { + DisposPixMap (save_pmh); + FAIL; + } + PIXMAP_BASEADDR_X (save_pmh) = RM (p); + + { + WRAPPER_PIXMAP_FOR_COPY (wrapper); + + WRAPPER_SET_PIXMAP_X (wrapper, + RM (save_pmh)); + + CopyBits (PORT_BITS_FOR_COPY (thePort), wrapper, + &save_rect, &save_rect, srcCopy, NULL); + } + + mep->mbBitsSave = (Handle) RM (save_pmh); + }, + { + mep->mbBitsSave = NULL; + }); + }); + + /* Erase to white -- colored backgrounds can be drawn by individual + mdefs. If we erase this to the ostensible background color, MacClade + will get a black background on its custom Tool menu. */ + + RGBForeColor (&ROMlib_white_rgb_color); + PaintRect (rect); + + PenNormal (); + RGBForeColor (&ROMlib_black_rgb_color); + + save_rect.right = CW (CW (save_rect.right) - 1); + save_rect.bottom = CW (CW (save_rect.bottom) - 1); + FrameRect (&save_rect); + + MoveTo (CW (save_rect.right), CW (save_rect.top) + 3); + LineTo (CW (save_rect.right), CW (save_rect.bottom)); + MoveTo (CW (save_rect.left) + 3, CW (save_rect.bottom)); + LineTo (CW (save_rect.right), CW (save_rect.bottom)); + + ClipRect (rect); +} + +static void +restore (void) +{ + LOCK_HANDLE_EXCURSION_1 + (MR (MBSaveLoc), + { + mbdfentry *mep; + PixMapHandle save_pmh; + Rect save_rect; + + mep = (mbdfentry *) ((char *) STARH (MBSAVELOC) + + Hx (MBSAVELOC, lastMBSave)); + save_rect = mep->mbRectSave; + save_rect.top = CW (CW (save_rect.top) - 1); + save_rect.left = CW (CW (save_rect.left) - 1); + save_rect.bottom = CW (CW (save_rect.bottom) + 2); + save_rect.right = CW (CW (save_rect.right) + 2); + + save_pmh = (PixMapHandle) MR (mep->mbBitsSave); + + if (save_pmh == NULL) + { + RgnHandle rh; + + rh = NewRgn (); + RectRgn (rh, &save_rect); + PaintBehind ((WindowPeek) FrontWindow (), rh); + DisposeRgn (rh); + } + else + { + { + WRAPPER_PIXMAP_FOR_COPY (wrapper); + + WRAPPER_SET_PIXMAP_X (wrapper, RM (save_pmh)); + CopyBits (wrapper, PORT_BITS_FOR_COPY (thePort), + &save_rect, &save_rect, srcCopy, NULL); + } + + DisposPtr (PIXMAP_BASEADDR (save_pmh)); + DisposPixMap (save_pmh); + } + + mep->mbBitsSave = NULL; + HxX (MBSAVELOC, lastMBSave) + = CW (Hx (MBSAVELOC, lastMBSave) - sizeof (mbdfentry)); + }); +} + +A1(PRIVATE, Rect *, getrect, LONGINT, offset) +{ + INTEGER hiword; + static Rect r; + MenuHandle mh; + muelem *mp; + INTEGER dh, dv; + + hiword = HiWord(offset); + mp = (muelem *) ((char *) STARH(MR (MenuList)) + LoWord(offset)); + mh = MR(mp->muhandle); + if (Hx(mh, menuWidth) == -1 || Hx(mh, menuHeight) == -1) + CalcMenuSize(mh); + if (hiword) { /* hierarchical */ + /* note 7 and 5 below are guesses */ + r.top = CW(MAX(Hx(MBSAVELOC, mbItemRect.top), CW(MBarHeight)+7)); + r.left = CW(Hx(MBSAVELOC, mbItemRect.right) - 5); + r.bottom = CW(CW(r.top) + Hx(mh, menuHeight)); + r.right = CW(CW(r.left) + Hx(mh, menuWidth)); + } else { /* regular */ + r.top = MBarHeight; + r.left = mp->muleft; + r.bottom = CW(CW(r.top) + Hx(mh, menuHeight)); + r.right = CW(CW(r.left) + Hx(mh, menuWidth)); + } + dh = CW(screenBitsX.bounds.right) - 10 - CW(r.right); + if (dh > 0) + dh = 0; + dv = CW(screenBitsX.bounds.bottom) - 10 - CW(r.bottom); + if (dv > 0) + dv = 0; + OffsetRect(&r, dh, dv); + return &r; +} + +A1(PRIVATE, mbdfentry *, offtomep, LONGINT, offset) +{ + mbdfentry *mbdfp, *mbdfep; + + mbdfep = (mbdfentry *) STARH(MR (MBSaveLoc)); + for (mbdfp = (mbdfentry *) + ((char *) mbdfep + CW(((mbdfheader *)mbdfep)->lastMBSave)); + mbdfp != mbdfep && CW(mbdfp->mbMLOffset) != offset; mbdfp--) + ; + return mbdfp == mbdfep ? 0 : mbdfp; +} + +A1(PRIVATE, void, savealt, LONGINT, offset) +{ + mbdfentry *mep; + + mep = offtomep(offset); + mep->mbTopScroll = TopMenuItem; + mep->mbBotScroll = AtMenuBottom; +} + +A1(PRIVATE, void, resetalt, LONGINT, offset) +{ + mbdfentry *mep; + + mep = offtomep(offset); + TopMenuItem = mep->mbTopScroll; + AtMenuBottom = mep->mbBotScroll; +} + +A1(PRIVATE, RgnHandle, menurgn, RgnHandle, rgn) +{ + Rect r; + + if (CW(MBarHeight) <= 0) + height(); + r = PORT_RECT (MR (wmgr_port)); + r.bottom = MBarHeight; + RectRgn(rgn, &r); + SectRgn(rgn, MR(GrayRgn), rgn); + return rgn; +} + +P4 (PUBLIC, pascal int32, mbdf0, int16, sel, int16, mess, + int16, param1, int32, param2) +{ + int32 retval; + HIDDEN_GrafPtr saveport; + + retval = 0; + if (mess != mbInit) /* fun w/ Word 6 */ + { + GetPort(&saveport); + saveport.p = MR(saveport.p); + SetPort(MR(wmgr_port)); + } + + switch (mess) + { + case mbDraw: + mbdf_draw (param2); + break; + case mbHit: + retval = hit(param2); + break; + case mbCalc: + calc(param2); + break; + case mbInit: + init(); + break; + case mbDispose: + dispose(); + break; + case mbHilite: + ClipRect(&PORT_RECT (MR (wmgr_port))); /* full open */ + mbdfhilite(param2); + break; + case mbHeight: + height(); + break; + case mbSave: + ClipRect (&PORT_RECT (MR (wmgr_port))); /* full open */ + save(param1, (Rect *) SYN68K_TO_US(param2)); + break; + case mbRestore: + ClipRect (&PORT_RECT (MR (wmgr_port))); /* full open */ + restore(); + break; + case mbRect: + retval = (LONGINT) US_TO_SYN68K(getrect(param2)); + break; + case mbSaveAlt: + savealt(param2); + break; + case mbResetAlt: + resetalt(param2); + break; + case mbMenuRgn: + retval = (LONGINT) + US_TO_SYN68K(menurgn((RgnHandle) US_TO_SYN68K(param2))); + break; + } + if (mess != mbInit) + SetPort(saveport.p); + return retval; +} diff --git a/src/stdmdef.c b/src/stdmdef.cpp similarity index 95% rename from src/stdmdef.c rename to src/stdmdef.cpp index 99a86b7d..e0b04666 100644 --- a/src/stdmdef.c +++ b/src/stdmdef.cpp @@ -24,6 +24,8 @@ char ROMlib_rcsid_stdmdef[] = #include "rsys/custom.h" +using namespace Executor; + static Rect *current_menu_rect; #define TOP_ARROW_P() \ @@ -54,7 +56,7 @@ typedef enum /* return true if there is an icon */ void -cleanup_icon_info (icon_info_t *info) +Executor::cleanup_icon_info (icon_info_t *info) { if (info->icon && info->color_icon_p) @@ -64,7 +66,7 @@ cleanup_icon_info (icon_info_t *info) } int -get_icon_info (mextp item_info, icon_info_t *info, int need_icon_p) +Executor::get_icon_info (mextp item_info, icon_info_t *info, int need_icon_p) { Handle h = NULL; @@ -138,7 +140,7 @@ get_icon_info (mextp item_info, icon_info_t *info, int need_icon_p) /* See IMV-236 */ -PRIVATE BOOLEAN iskeyequiv(struct tableentry *tp) +PRIVATE BOOLEAN iskeyequiv(struct table::tableentry *tp) { BOOLEAN retval; @@ -153,7 +155,7 @@ PRIVATE BOOLEAN iskeyequiv(struct tableentry *tp) void size_menu (MenuHandle mh, tablePtr tablep) { - struct tableentry *tp, *ep; + struct table::tableentry *tp, *ep; int16 width, height, actual_height, max_height; width = height = actual_height = 0; @@ -191,7 +193,7 @@ draw_right_arrow (Rect *menu_rect, MenuHandle mh, int item, int invert_p) { Rect dst_rect; BitMap arrow_bitmap; - static char right_arrow_bits[] = + static const unsigned char right_arrow_bits[] = { image_bits (10000000), image_bits (11000000), @@ -230,7 +232,7 @@ draw_arrow (Rect *menu_rect, MenuHandle mh, arrowtype arrdir) Rect dst_rect, erase_rect; int top_of_item; RGBColor bk_color, title_color; - char up_arrow_bits[] = + unsigned char up_arrow_bits[] = { image_bits (00000100), image_bits (00000000), image_bits (00001110), image_bits (00000000), @@ -239,7 +241,7 @@ draw_arrow (Rect *menu_rect, MenuHandle mh, arrowtype arrdir) image_bits (01111111), image_bits (11000000), image_bits (11111111), image_bits (11100000), }; - char down_arrow_bits[] = + unsigned char down_arrow_bits[] = { image_bits (11111111), image_bits (11100000), image_bits (01111111), image_bits (11000000), @@ -293,6 +295,12 @@ draw_arrow (Rect *menu_rect, MenuHandle mh, arrowtype arrdir) RGBBackColor (&ROMlib_white_rgb_color); } +namespace Executor { + PRIVATE void erasearrow(Rect*, tablePtr, BOOLEAN); + PRIVATE void popuprect(MenuHandle, Rect *, Point, + INTEGER *, tablePtr); +} + A3(PRIVATE, void, erasearrow, Rect *, rp, tablePtr, tablep, BOOLEAN, upordown) { Rect r; @@ -311,7 +319,7 @@ A3(PRIVATE, void, erasearrow, Rect *, rp, tablePtr, tablep, BOOLEAN, upordown) } static void -draw_item (Rect *rp, struct tableentry *tp, int32 bit, int item, MenuHandle mh, +draw_item (Rect *rp, struct table::tableentry *tp, int32 bit, int item, MenuHandle mh, int invert_p) { RGBColor bk_color, mark_color, title_color, command_color; @@ -486,7 +494,7 @@ draw_item (Rect *rp, struct tableentry *tp, int32 bit, int item, MenuHandle mh, static void draw_menu (MenuHandle mh, Rect *rp, tablePtr tablep) { - struct tableentry *tp, *ep; + struct table::tableentry *tp, *ep; int16 topcutoff, bottomcutoff; if (CW (TopMenuItem) < CW(rp->top)) @@ -521,7 +529,7 @@ draw_menu (MenuHandle mh, Rect *rp, tablePtr tablep) static void fliprect (Rect *rp, int16 i, tablePtr tablep, Rect *flipr) { - struct tableentry *tp; + struct table::tableentry *tp; tp = &tablep->entry[i-1]; flipr->left = rp->left; @@ -536,7 +544,7 @@ doupdown (MenuHandle mh, Rect *rp, tablePtr tablep, BOOLEAN upordown, { INTEGER offset; Rect scrollr, updater, rtmp; - struct tableentry *tp, *ep; + struct table::tableentry *tp, *ep; RgnHandle updatergn; LONGINT bit; @@ -623,7 +631,7 @@ void choose_menu (MenuHandle mh, Rect *rp, Point p, int16 *itemp, tablePtr tablep) { int32 nitem; - struct tableentry *tp, *ep; + struct table::tableentry *tp, *ep; Rect valid_rect, clip_rect; INTEGER menu_id; @@ -695,7 +703,7 @@ choose_menu (MenuHandle mh, Rect *rp, Point p, int16 *itemp, tablePtr tablep) A5 (PRIVATE, void, popuprect, MenuHandle, mh, Rect *, rp, Point, p, INTEGER *, itemp, tablePtr, tablep) { - struct tableentry *tp; + struct table::tableentry *tp; INTEGER vmax; if (Hx(mh, menuWidth) == -1 || Hx(mh, menuHeight) == -1) @@ -727,7 +735,7 @@ P5(PUBLIC, pascal void, mdef0, INTEGER, mess, MenuHandle, mh, Rect *, rp, INTEGER count, v; tableHandle th; tablePtr tp; - struct tableentry *tabp; + struct table::tableentry *tabp; HIDDEN_GrafPtr saveport; GetPort(&saveport); @@ -753,8 +761,8 @@ P5(PUBLIC, pascal void, mdef0, INTEGER, mess, MenuHandle, mh, Rect *, rp, *sp; sp += (unsigned char) *sp + SIZEOFMEXT, count++) ; - th = (tableHandle) NewHandle ((Size) sizeof (table) + - count * sizeof (struct tableentry)); + th = (tableHandle) NewHandle((Size) sizeof (table) + + count * sizeof (struct table::tableentry)); HLock((Handle) th); tp = MR(*th); tp->lasttick = TickCount(); diff --git a/src/string.c b/src/string.cpp similarity index 68% rename from src/string.c rename to src/string.cpp index d98460ec..9b1c42ba 100644 --- a/src/string.c +++ b/src/string.cpp @@ -12,8 +12,10 @@ char ROMlib_rcsid_string[] = #include "MemoryMgr.h" +using namespace Executor; + void -str255_from_c_string (Str255 str255, const char *c_stringp) +Executor::str255_from_c_string (Str255 str255, const char *c_stringp) { int len; @@ -26,7 +28,7 @@ str255_from_c_string (Str255 str255, const char *c_stringp) char * -pstr_index_after (StringPtr p, char c, int i) +Executor::pstr_index_after (StringPtr p, char c, int i) { StringPtr ep; @@ -42,7 +44,7 @@ pstr_index_after (StringPtr p, char c, int i) return NULL; } -PRIVATE void strNassign (Str63 new, const StringPtr old, int n) +PRIVATE void strNassign (Str63 new1, const StringPtr old, int n) { int old_length, new_length; @@ -57,24 +59,24 @@ PRIVATE void strNassign (Str63 new, const StringPtr old, int n) new_length = n; } - new[0] = new_length; - memcpy (new + 1, old + 1, new_length); + new1[0] = new_length; + memcpy (new1 + 1, old + 1, new_length); } void -str63assign (Str63 new, const StringPtr old) +Executor::str63assign (Str63 new1, const StringPtr old) { - strNassign (new, old, 63); + strNassign (new1, old, 63); } void -str31assign (Str63 new, const StringPtr old) +Executor::str31assign (Str63 new1, const StringPtr old) { - strNassign (new, old, 31); + strNassign (new1, old, 31); } PUBLIC StringHandle -stringhandle_from_c_string (const char *c_stringp) +Executor::stringhandle_from_c_string (const char *c_stringp) { int len; StringHandle retval; diff --git a/src/suffix_maps.cpp b/src/suffix_maps.cpp new file mode 100644 index 00000000..0181d9e6 --- /dev/null +++ b/src/suffix_maps.cpp @@ -0,0 +1,250 @@ +/* Copyright 2000 by Abacus Research and + * Development, Inc. All rights reserved. + */ + +#if !defined (OMIT_RCSID_STRINGS) +char ROMlib_rcsid_suffix_maps[] = + "$Id: suffix_maps.c 63 2004-12-24 18:19:43Z ctm $"; +#endif + +#include "rsys/common.h" + +#include "rsys/suffix_maps.h" +#include "rsys/file.h" + +#include + +using namespace Executor; + +/* + * This file contains the routines needed to create mappings from file + * suffixes to (Creator, Type) pairs. When a file is created with a suffix + * that is in the list, the normal % file won't be created. When the file's + * creator and type is queried, the creator and type from the list will be + * read. + */ + +typedef struct suffix_entry +{ + char *suffix; + uint32 creator; + uint32 type; + const char *application; + struct suffix_entry *next; +} +suffix_entry_t; + +PRIVATE suffix_entry_t *suffix_head; + +PRIVATE boolean_t +str_to_hex (const char *str, uint32 *valp) +{ + boolean_t retval; + int len; + + len = strlen (str); + retval = (str[0] == '0' && + (str[1] == 'x' || str[1] == 'X') && + len >= 3 && + len <= 10); + + if (retval) + { + uint32 val; + + val = 0; + for (str += 2; retval && *str; ++str) + if (isxdigit (*str)) + val = (val << 4) | ROMlib_fromhex (*str); + else + retval = FALSE; + *valp = val; + } + return retval; +} + +PUBLIC void +ROMlib_add_suffix_quad (const char *suffixp, const char *creator_hexp, + const char *type_hexp, const char *applicationp) +{ + uint32 creator; + uint32 type; + + if (str_to_hex (creator_hexp, &creator) && + str_to_hex (type_hexp, &type)) + { + suffix_entry_t *new1 = (suffix_entry_t *)malloc (sizeof *new1); + if (new1) { + new1->suffix = strdup (suffixp); + if (!new1->suffix) + free (new1); + else + { + new1->creator = creator; + new1->type = type; + new1->application = strdup (applicationp); + new1->next = suffix_head; + suffix_head = new1; + } + } + } +} + +PRIVATE suffix_entry_t ** +find_suffixpp (const char *suffix) +{ + suffix_entry_t **retval; + + retval = &suffix_head; + + while (*retval && strcasecmp ((*retval)->suffix, suffix) != 0) + retval = &(*retval)->next; + + return retval; +} + +/* + * Best match is (creator, 'APPL') + * next best is (creator, type) + * next best is (creator, X) + * worst is (X, type) + */ + +PUBLIC const char * +ROMlib_find_best_creator_type_match (uint32 creator, uint32 type) +{ + enum { no_match, type_match, creator_match, both_match, appl_match } match; + suffix_entry_t **pp; + const char *retval; + + retval = NULL; + for (match = no_match, pp = &suffix_head; + match != appl_match && *pp; + pp = &(*pp)->next) + { + if (*(*pp)->application) + { + if ((*pp)->creator == creator) + { + if ((*pp)->type == TICK("APPL")) + { + retval = (*pp)->application; + match = appl_match; + } + else if (match < both_match && (*pp)->type == type) + { + retval = (*pp)->application; + match = both_match; + } + else if (match < creator_match) + { + retval = (*pp)->application; + match = creator_match; + } + } + else if ((*pp)->type == type && match < type_match) + { + retval = (*pp)->application; + match = type_match; + } + } + } + + return retval; +} + +PRIVATE boolean_t +filename_suffix_match (const char *suffix, int len, const char *filename) +{ + boolean_t retval; + int suffix_len; + + suffix_len = strlen (suffix); + retval = (len >= suffix_len && + strncasecmp (suffix, filename + len - suffix_len, suffix_len) + == 0); + return retval; +} + +PRIVATE suffix_entry_t ** +find_filenamepp (int len, const char *filename) +{ + suffix_entry_t **retval; + + retval = &suffix_head; + + while (*retval && !filename_suffix_match ((*retval)->suffix, len, filename)) + retval = &(*retval)->next; + + return retval; +} + +PUBLIC boolean_t +ROMlib_creator_and_type_from_suffix (const char *suffix, uint32 *creatorp, + uint32 *typep) +{ + boolean_t retval; + suffix_entry_t **pp; + + pp = find_suffixpp (suffix); + if (!*pp) + retval = FALSE; + else + { + retval = TRUE; + if (creatorp) + *creatorp = (*pp)->creator; + if (typep) + *typep = (*pp)->type; + } + return retval; +} + +PUBLIC boolean_t +ROMlib_creator_and_type_from_filename (int len, const char *filename, + uint32 *creatorp, uint32 *typep) +{ + boolean_t retval; + suffix_entry_t **pp; + + pp = find_filenamepp (len, filename); + if (!*pp) + retval = FALSE; + else + { + retval = TRUE; + if (creatorp) + *creatorp = (*pp)->creator; + if (typep) + *typep = (*pp)->type; + } + return retval; +} + +PRIVATE void +release_entry (suffix_entry_t *to_release) +{ + free (to_release->suffix); + free (to_release); +} + +PUBLIC boolean_t +ROMlib_delete_suffix (const char *suffix) +{ + boolean_t retval; + suffix_entry_t **pp; + + pp = find_suffixpp (suffix); + if (!*pp) + retval = FALSE; + else + { + suffix_entry_t *to_release; + + retval = TRUE; + to_release = *pp; + *pp = (*pp)->next; + release_entry (to_release); + } + return retval; +} diff --git a/src/syncint.c b/src/syncint.c deleted file mode 100644 index d3c8831c..00000000 --- a/src/syncint.c +++ /dev/null @@ -1,633 +0,0 @@ -/* Copyright 1995, 1996 by Abacus Research and - * Development, Inc. All rights reserved. - */ - -#if !defined (OMIT_RCSID_STRINGS) -char ROMlib_rcsid_syncint[] = - "$Id: syncint.c 97 2005-06-22 20:08:38Z ctm $"; -#endif - -#include "rsys/common.h" - -/* We only have synchronous interrupts under syn68k. */ -#if defined (SYN68K) - -#include "rsys/syncint.h" -#include "rsys/blockinterrupts.h" - -#if defined (CYGWIN32) -#include "win_queue.h" -#include "rsys/m68kint.h" -#endif - -#if defined (MSDOS) - -#include -#include -#include "dpmilock.h" -#include "dosmem.h" -#include "dpmicall.h" -#include "rmint70.h" - -#define BIOS_SET_EVENT_WAIT 0x8300 -#define BIOS_CLEAR_EVENT_WAIT 0x8301 - - -#define TIMER_INT_NUM 0x70 -#define WATCHDOG_INT_NUM 0x08 - -/* This is the old timer interrupt handler. These cannot be static - * because they are used by the interrupt asm code. - */ -__dpmi_paddr old_watchdog_handler; -__dpmi_paddr old_pm_timer_handler; -__dpmi_raddr old_rm_timer_handler; - -uint16 rm_timer_handler_sel; - -/* Here's our new one. */ -static __dpmi_paddr new_watchdog_handler; -static __dpmi_paddr new_pm_timer_handler; -static __dpmi_raddr new_rm_timer_handler; - -/* TRUE if we shouldn't get concerned if the 1024 Hz clock isn't - * working well, e.g. during disk accesses. - */ -static boolean_t expect_slow_clock_p; - -/* These variables are referenced in our interrupt handlers. */ -volatile uint32 watchdog_last_elapsed_1024 = -1; -volatile uint32 slow_clock_count; -uint8 use_bios_timer_p = TRUE; - -#define ELAPSED_1024_OFFSET 0 -#define ELAPSED_1024_OFFSET_STR "0" -#define REMAINING_1024_OFFSET 4 -#define REMAINING_1024_OFFSET_STR "4" - -void -_dummy_timer_asm_function_ (void) -{ - /* We put this asm in a dummy function so we can pass it "arguments" - * to let it reference cpu_state fields. - */ - asm ( - /* We maintain two distinct timer interrupts: "timer" and "watchdog". - * "timer" is a 1024 Hz interrupt which the BIOS sometimes turns off. - * "watchdog" is an 18.2 Hz interrupt that checks to see if "timer" - * has been turned off. If it has, it sets things up so that - * "timer" will get turned back on. This solution should be fairly - * robust, although if "timer" gets turned off often then we'll - * appear to "lose time". - * - * If use_bios_p is FALSE, then we exclusively use the 18.2 Hz - * timer. This may work around some problems with various BIOSes - * and DPMI providers, although we're not sure. - */ - "\n" - ".text\n\t" - ".align 4,0x90\n" - "_timer_handler_data_start:\n" - "_handle_watchdog_tick:\n\t" - - /* Save stuff we're about to clobber. */ - "pushfl\n\t" - "pushal\n\t" - "pushl %%ds\n\t" - "pushl %%es\n\t" - "pushl %%fs\n\t" - "pushl %%gs\n\t" - - /* Set up %ds for protected mode memory. */ - ".byte 0x2E\n\t" /* %cs: prefix, for gas botch. */ - QUOTED_DATA16 "movw _dos_pm_interrupt_ds,%%ds\n\t" - - /* See if any virtual mouse interrupts are pending. */ - "call _dosevq_note_mouse_interrupt\n\t" - - /* Fetch elapsed 1024ths of a second. */ - "movzwl _rm_timer_handler_sel,%%eax\n\t" - "testl %%eax,%%eax\n\t" - "jz 1f\n\t" /* zero selector? bail! */ - QUOTED_DATA16 "movw %%ax,%%fs\n\t" - ".byte 0x64\n\t" /* %fs: prefix */ - "movl " ELAPSED_1024_OFFSET_STR ",%%eax\n\t" - - /* See if we care about the 1024Hz BIOS timer. */ - "cmpb $0,_use_bios_timer_p\n\t" - "jz 3f\n\t" - - /* See if the 1024Hz timer is still running. */ - "cmpl %%eax,_watchdog_last_elapsed_1024\n\t" - "jz 4f\n\t" - - /* See if it's running, but very slowly (for WinNT) */ - "pushl %%eax\n\t" - "subl _watchdog_last_elapsed_1024,%%eax\n\t" - "cmpl $28,%%eax\n\t" /* We should get about 56 ticks here. */ - "popl %%eax\n\t" - - "jnge 4f\n\t" /* too slow? */ - - /* Clock is moving quickly enough this time. */ - "movl $0,_slow_clock_count\n\t" /* start "slow count" over */ - "jmp 1f\n" - - "4:\n\t" - - /* Note that the clock has not advanced quickly enough here. */ - "incl _slow_clock_count\n\t" - - /* Indicate a watchdog interrupt. */ - "movb $1,%1\n" - "movl %3,%2\n\t" - - "3:\n\t" - - /* Increment the 1024 Hz clock by 1/18.2 of a second. */ - "addl $56,%%eax\n\t" - ".byte 0x64\n\t" /* %fs: prefix */ - "movl " REMAINING_1024_OFFSET_STR ",%%ebx\n\t" - ".byte 0x64\n\t" /* %fs: prefix */ - "movl %%eax," ELAPSED_1024_OFFSET_STR "\n\t" - "cmpl $0x80000000,%%ebx\n\t" - "je 1f\n\t" - "subl $56,%%ebx\n\t" - "jnle 8f\n\t" - "movb $1,%0\n\t" - "movl %3,%2\n\t" - "movl $0x80000000,%%ebx\n" - - "8:\n\t" - ".byte 0x64\n\t" /* %fs: prefix */ - "movl %%ebx," REMAINING_1024_OFFSET_STR "\n\t" - - /* Restore everything we clobbered. */ - "1:\n\t" - "movl %%eax,_watchdog_last_elapsed_1024\n\t" - "popl %%gs\n\t" - "popl %%fs\n\t" - "popl %%es\n\t" - "popl %%ds\n\t" - "popal\n\t" - "popfl\n\t" - - ".byte 0x2E\n\t" /* %cs: prefix, for gas botch. */ - "ljmp _old_watchdog_handler\n\t" - "iret\n\t" /* Not sure why this is necessary, but djgpp does it. */ - - /* This is the timer interrupt handler. It executes the - * equivalent of this C code: - * - * ++elapsed_1024; - * r1024 = remaining_1024; - * if (r1024 > 0) - * { - * --r1024; - * remaining_1024 = r1024; - * if (r1024 <= 0) - * { - * SET_INTERRUPT_STATUS (INTERRUPT_STATUS_CHANGED); - * } - * } - */ - - ".align 4,0xcf\n" - "_handle_timer_tick:\n\t" - - /* Save stuff we're about to clobber. */ - "pushfl\n\t" - "pushl %%eax\n\t" - "pushl %%ds\n\t" - "pushl %%fs\n\t" - - /* Set up %%ds for protected mode. */ - ".byte 0x2E\n\t" /* %cs: prefix, for gas botch. */ - QUOTED_DATA16 "movw _dos_pm_interrupt_ds,%%ds\n\t" - - /* Set up %fs appropriately. */ - "movzwl _rm_timer_handler_sel,%%eax\n\t" - "testl %%eax,%%eax\n\t" - "je 2f\n\t" /* bail if selector is zero */ - QUOTED_DATA16 "movw %%ax,%%fs\n\t" - - /* Increment elapsed_1024, and decrement remaining_1024 - * (if appropriate). If remaining_1024 hits zero, then set - * the interrupt_status_changed bit. - */ - ".byte 0x64\n\t" /* %fs prefix */ - "movl " REMAINING_1024_OFFSET_STR ",%%eax\n\t" - ".byte 0x64\n\t" /* %fs prefix */ - "incl " ELAPSED_1024_OFFSET_STR "\n\t" - "cmpl $0x80000000,%%eax\n\t" /* countdown not running? */ - "je 2f\n\t" - "subl $1,%%eax\n\t" /* decl doesn't set carry */ - "jnle 7f\n\t" - "movb $1,%0\n\t" - "movl %3,%2\n\t" - "movl $0x80000000,%%eax\n" - - "7:\n\t" - ".byte 0x64\n\t" /* %fs prefix */ - "movl %%eax," REMAINING_1024_OFFSET_STR "\n" - - "2:\n\t" - -#if 1 - /* Reset real-time clock timer (docs are extremely shaky here). */ - "movb $0x0C,%%al\n\t" - "outb %%al,$0x70\n\t" - "inb $0x71,%%al\n\t" - - /* Indicate end-of-interrupt to the interrupt controller. */ - "movb $0x20,%%al\n\t" - "outb %%al,$0xA0\n\t" /* Needed since INT 0x70 is IRQ 8 */ - "outb %%al,$0x20\n\t" - - /* Restore the stuff we changed. */ - "popl %%fs\n\t" - "popl %%ds\n\t" - "popl %%eax\n\t" - "popfl\n\t" - - "sti\n\t" - "iret\n" -#else - - /* This is old code you could use if you wanted to chain the - * interrupt. - */ - - /* Restore the stuff we changed. */ - "popl %%fs\n\t" - "popl %%ds\n\t" - "popl %%eax\n\t" - "popfl\n\t" - - /* Chain on to the next interrupt handler. */ - ".byte 0x2E\n\t" /* %cs: prefix, for gas botch. */ - "ljmp _old_pm_timer_handler\n\t" - "iret\n" /* Not sure why this is necessary, but djgpp does it. */ -#endif - - "_timer_handler_data_end:\n" - ".text" - - : "=m" (cpu_state.interrupt_pending[M68K_TIMER_PRIORITY]), - "=m" (cpu_state.interrupt_pending[M68K_WATCHDOG_PRIORITY]), - "=m" (cpu_state.interrupt_status_changed) - : "g" (INTERRUPT_STATUS_CHANGED)); -} - - -/* Trick the C compiler so it knows about some of these asm symbols. */ -extern char handle_timer_tick, handle_watchdog_tick; -extern char timer_handler_data_start, timer_handler_data_end; - - -uint32 -fetch_elapsed_1024 (void) -{ - uint32 retval; - - if (rm_timer_handler_sel) - retval = _farpeekl (rm_timer_handler_sel, ELAPSED_1024_OFFSET); - else - retval = 0; - - return retval; -} - - -void -set_elapsed_1024 (uint32 v) -{ - if (rm_timer_handler_sel) - _farpokel (rm_timer_handler_sel, ELAPSED_1024_OFFSET, v); -} - - -static void -syncint_shutdown (void) -{ - BLOCK_VIRTUAL_INTERRUPTS_EXCURSION - ({ - __dpmi_regs regs; - - /* Clear any pending interrupt. */ - syncint_post (0); - - __dpmi_set_protected_mode_interrupt_vector (WATCHDOG_INT_NUM, - &old_watchdog_handler); - __dpmi_set_protected_mode_interrupt_vector (TIMER_INT_NUM, - &old_pm_timer_handler); - __dpmi_set_real_mode_interrupt_vector (TIMER_INT_NUM, - &old_rm_timer_handler); - - /* Turn off the BIOS event wait, in case anyone else wants it. */ - dpmi_zero_regs (®s); - regs.x.ax = BIOS_CLEAR_EVENT_WAIT; - __dpmi_int (0x15, ®s); - - - /* THIS HAS BEEN DISABLED. - * Freeing this memory causes Executor to crash on exit under - * WinNT. It's not clear why; we've already reset all the - * interrupt vectors and no one should be using this memory once - * rm_timer_handler_sel is zero. - */ - if (0 && rm_timer_handler_sel != 0) - { - uint16 sel; - sel = rm_timer_handler_sel; - rm_timer_handler_sel = 0; /* just in case of any race condition */ - __dpmi_free_dos_memory (sel); - } - }); -} - - -/* This routine starts int 0x70 going by turning on a dummy BIOS - * event wait. - */ -static syn68k_addr_t -restart_timer (syn68k_addr_t interrupt_addr, void *unused) -{ - if (use_bios_timer_p) - { - __dpmi_regs regs; - - /* See if we've gotten two seconds worth of sluggish 1024 Hz clock - * ticks in a row. If so, disable that clock and just use the - * 18 Hz clock. This seems to be needed for WinNT. - */ - if (!expect_slow_clock_p && slow_clock_count > 36) /* 18 Hz * 2 == 36 */ - { - use_bios_timer_p = FALSE; - __dpmi_set_protected_mode_interrupt_vector (TIMER_INT_NUM, - &old_pm_timer_handler); - __dpmi_set_real_mode_interrupt_vector (TIMER_INT_NUM, - &old_rm_timer_handler); - warning_unexpected ("1024 Hz timer is unreliable. Switching " - "to 18 Hz timer. elapsed_1024 = %lu", - (unsigned long) fetch_elapsed_1024 ()); - } - else - { - /* Start the clock running by turning on a bogus event wait that - * we never want to finish. - */ - dpmi_zero_regs (®s); - regs.x.ax = BIOS_SET_EVENT_WAIT; - regs.x.cx = 0x7FFF; - regs.x.dx = 0xFFFF; - regs.x.es = 0x40; /* Use the MSB of the BIOS countdown address, */ - regs.x.bx = 0x9C + 3; /* since setting that bit is harmless. */ - if (dpmi_int_check_carry (0x15, ®s)) - { - /* It won't let us set the 1024 timer! Let's not be rude and - * clear it; that may be causing problems under Windows. We'll - * just let the 18.2 Hz watchdog limp along and keep trying to - * start the clock. - */ - } - } - } - - return MAGIC_RTE_ADDRESS; -} - - -/* Sets a flag indicating whether a slow 1024 Hz clock is acceptable - * (i.e. we shouldn't turn it off if it seems to be misbehaving). - */ -boolean_t -set_expect_slow_clock (boolean_t will_be_slow_p) -{ - boolean_t old; - - old = expect_slow_clock_p; - if (expect_slow_clock_p != will_be_slow_p) - { - if (!will_be_slow_p) - slow_clock_count = 0; - expect_slow_clock_p = will_be_slow_p; - } - return old; -} - - -/* Sets up real-mode memory and handler used for timer stuff. */ -static void -set_up_rm_timer_stuff (void) -{ - int sel, seg; - - seg = __dpmi_allocate_dos_memory ((&rm_int_70_handler_end - - &rm_int_70_handler_start + 15) / 16, - &sel); - if (seg != -1) - { - rm_timer_handler_sel = sel; - - rm_int_70_chain_address = old_rm_timer_handler; - rm_int_70_seg = seg; - - /* Copy the timer handler to DOS memory. */ - movedata (dos_pm_ds, (unsigned) &rm_int_70_handler_start, - sel, 0, - &rm_int_70_handler_end - &rm_int_70_handler_start); - - if (use_bios_timer_p) - { - /* Make it so that the timer doesn't reflect to us from real - * mode, which would require a mode switch. Sandmann thinks - * that setting the RM vector after we set the PM vector - * will cause RM interrupts not to get reflected to PM. - * We're doing this as a test because mode switches from RM to - * PM during disk accesses seem to cause trouble on some - * machines. - */ - new_rm_timer_handler.segment = seg; - new_rm_timer_handler.offset16 = (&rm_int_70_handler_code_start - - &rm_int_70_handler_start); - __dpmi_set_real_mode_interrupt_vector (TIMER_INT_NUM, - &new_rm_timer_handler); - } - } -} - - -int -syncint_init (void) -{ - static char beenhere = FALSE; - syn68k_addr_t watchdog_callback; - - /* Guard against getting called multiple times. */ - if (beenhere) - return TRUE; - beenhere = TRUE; - - /* Wire down our timer interrupt handler so it won't get paged out. */ - dpmi_lock_memory (&timer_handler_data_start, - &timer_handler_data_end - &timer_handler_data_start); - dpmi_lock_memory (&rm_timer_handler_sel, sizeof rm_timer_handler_sel); - dpmi_lock_memory (&old_watchdog_handler, sizeof old_watchdog_handler); - dpmi_lock_memory (&old_pm_timer_handler, sizeof old_pm_timer_handler); - dpmi_lock_memory (&old_rm_timer_handler, sizeof old_rm_timer_handler); - dpmi_lock_memory ((void *)&use_bios_timer_p, sizeof use_bios_timer_p); - dpmi_lock_memory ((void *)&slow_clock_count, sizeof slow_clock_count); - dpmi_lock_memory ((void *)&watchdog_last_elapsed_1024, - sizeof watchdog_last_elapsed_1024); - - /* Set up the m68k trap vector for the watchdog interrupt. */ - watchdog_callback = callback_install (restart_timer, NULL); - *(syn68k_addr_t *)SYN68K_TO_US(M68K_WATCHDOG_VECTOR * 4) = CL (watchdog_callback); - - /* Fetch the old interrupt handlers. */ - __dpmi_get_real_mode_interrupt_vector (TIMER_INT_NUM, &old_rm_timer_handler); - __dpmi_get_protected_mode_interrupt_vector (TIMER_INT_NUM, - &old_pm_timer_handler); - __dpmi_get_protected_mode_interrupt_vector (WATCHDOG_INT_NUM, - &old_watchdog_handler); - - /* Set up real-mode timer memory. */ - set_up_rm_timer_stuff (); - - if (use_bios_timer_p) - { - new_pm_timer_handler.offset32 = (unsigned long) &handle_timer_tick; - new_pm_timer_handler.selector = dos_pm_cs; - __dpmi_set_protected_mode_interrupt_vector (TIMER_INT_NUM, - &new_pm_timer_handler); - - /* Start the 1024 Hz clock running. */ - restart_timer (0, NULL); - } - - /* Install the new watchdog interrupt handler. */ - new_watchdog_handler.offset32 = (unsigned long) &handle_watchdog_tick; - new_watchdog_handler.selector = dos_pm_cs; - __dpmi_set_protected_mode_interrupt_vector (WATCHDOG_INT_NUM, - &new_watchdog_handler); - - atexit (syncint_shutdown); - return TRUE; -} - - -/* Posting a delay of 0 will clear any pending interrupt. */ -void -syncint_post (unsigned long usecs) -{ - long new; - - if (rm_timer_handler_sel) - { - if (usecs == 0) - new = 0x80000000; /* magic value meaning timer is stopped. */ - else - { - /* Convert usecs to 1024ths of a second, rounding up. */ - new = (usecs * 16 + 15624) / 15625;/* 16 / 15625 == 1024 / 1000000 */ - if (new <= 0) - new = 1; - } - - _farpokel (rm_timer_handler_sel, REMAINING_1024_OFFSET, new); - } -} - -#else /* !MSDOS */ - - -#if defined (SDL) - -static Uint32 -handle_sdltimer_tick (Uint32 n) -{ - // fprintf (stderr, "T"); - // fflush (stderr); -#if defined (CYGWIN32) - win_queue(&cpu_state.interrupt_pending[M68K_EVENT_PRIORITY]); -#endif - cpu_state.interrupt_pending[M68K_TIMER_PRIORITY] = TRUE; - SET_INTERRUPT_STATUS (INTERRUPT_STATUS_CHANGED); - // SDL_mutexP (ROMlib_shouldbeawake_mutex); - SDL_CondSignal (ROMlib_shouldbeawake_cond); - // SDL_mutexV (ROMlib_shouldbeawake_mutex); - -#if !defined (SDL_TIMER_FIXED) -#warning returning 1 here to work around SDL timer bug(s) - return 1; -#endif - - return 0; -} - -#else - -static void -handle_itimer_tick (int n) -{ - cpu_state.interrupt_pending[M68K_TIMER_PRIORITY] = TRUE; - SET_INTERRUPT_STATUS (INTERRUPT_STATUS_CHANGED); -} - -#endif - -int -syncint_init (void) -{ -#if defined (SDL) - - return (SDL_Init(SDL_INIT_TIMER) == 0); - -#else /* !SDL */ - -#if !defined(USE_BSD_SIGNALS) - - struct sigaction s; - - s.sa_handler = handle_itimer_tick; - sigemptyset(&s.sa_mask); - s.sa_flags = 0; - s.sa_restorer = NULL; - return (sigaction (SIGALRM, &s, NULL) == 0); - -#else - struct sigvec s; - - s.sv_handler = handle_itimer_tick; - s.sv_mask = 0; - s.sv_flags = 0; - return sigvec (SIGALRM, &s, NULL) == 0; -#endif - -#endif -} - - -/* Posting a delay of 0 will clear any pending interrupt. */ -void -syncint_post (unsigned long usecs) -{ -#if defined (SDL) - // fprintf (stderr, "P(%ul)", usecs); - // fflush (stderr); - SDL_SetTimer(usecs/1000, handle_sdltimer_tick); -#else - struct itimerval t; - - t.it_value.tv_sec = usecs / 1000000; - t.it_value.tv_usec = usecs % 1000000; - t.it_interval.tv_sec = 0; - t.it_interval.tv_usec = 0; - setitimer (ITIMER_REAL, &t, NULL); -#endif -} - -#endif /* !MSDOS */ - -#endif /* SYN68K */ diff --git a/src/syncint.cpp b/src/syncint.cpp new file mode 100644 index 00000000..4acb8f29 --- /dev/null +++ b/src/syncint.cpp @@ -0,0 +1,106 @@ +/* Copyright 1995, 1996 by Abacus Research and + * Development, Inc. All rights reserved. + */ + +#if !defined (OMIT_RCSID_STRINGS) +char ROMlib_rcsid_syncint[] = + "$Id: syncint.c 97 2005-06-22 20:08:38Z ctm $"; +#endif + +#include "rsys/common.h" + +/* We only have synchronous interrupts under syn68k. */ +#if defined (SYN68K) + +#include "rsys/syncint.h" +#include "rsys/blockinterrupts.h" + +using namespace Executor; + +#if defined (SDL) + +static Uint32 +handle_sdltimer_tick (Uint32 n) +{ + // fprintf (stderr, "T"); + // fflush (stderr); +#if defined (CYGWIN32) + win_queue(&cpu_state.interrupt_pending[M68K_EVENT_PRIORITY]); +#endif + cpu_state.interrupt_pending[M68K_TIMER_PRIORITY] = TRUE; + SET_INTERRUPT_STATUS (INTERRUPT_STATUS_CHANGED); + // SDL_mutexP (ROMlib_shouldbeawake_mutex); + SDL_CondSignal (ROMlib_shouldbeawake_cond); + // SDL_mutexV (ROMlib_shouldbeawake_mutex); + +#if !defined (SDL_TIMER_FIXED) +#warning returning 1 here to work around SDL timer bug(s) + return 1; +#endif + + return 0; +} + +#else + +static void +handle_itimer_tick (int n) +{ + cpu_state.interrupt_pending[M68K_TIMER_PRIORITY] = TRUE; + SET_INTERRUPT_STATUS (INTERRUPT_STATUS_CHANGED); +} + +int +Executor::syncint_init (void) +{ +#if defined (SDL) + + return (SDL_Init(SDL_INIT_TIMER) == 0); + +#else /* !SDL */ + +#if !defined(USE_BSD_SIGNALS) + + struct sigaction s; + + s.sa_handler = handle_itimer_tick; + sigemptyset(&s.sa_mask); + s.sa_flags = 0; + s.sa_restorer = NULL; + return (sigaction (SIGALRM, &s, NULL) == 0); + +#else + struct sigvec s; + + s.sv_handler = handle_itimer_tick; + s.sv_mask = 0; + s.sv_flags = 0; + return sigvec (SIGALRM, &s, NULL) == 0; +#endif + +#endif +} + + +/* Posting a delay of 0 will clear any pending interrupt. */ +void +Executor::syncint_post (unsigned long usecs) +{ +#if defined (SDL) + // fprintf (stderr, "P(%ul)", usecs); + // fflush (stderr); + SDL_SetTimer(usecs/1000, handle_sdltimer_tick); +#else + struct itimerval t; + + t.it_value.tv_sec = usecs / 1000000; + t.it_value.tv_usec = usecs % 1000000; + t.it_interval.tv_sec = 0; + t.it_interval.tv_usec = 0; + setitimer (ITIMER_REAL, &t, NULL); +#endif +} + +#endif /* !MSDOS */ + +#endif /* SYN68K */ diff --git a/src/syserr.c b/src/syserr.cpp similarity index 96% rename from src/syserr.c rename to src/syserr.cpp index c75c0852..f00f3435 100644 --- a/src/syserr.c +++ b/src/syserr.cpp @@ -33,6 +33,8 @@ char ROMlib_rcsid_syserr[] = #include "rsys/options.h" #include "rsys/syserr.h" +using namespace Executor; + PRIVATE myalerttab_t myalerttab = { CWC(8), @@ -111,6 +113,16 @@ PRIVATE myalerttab_t myalerttab = { char syserr_msg[256]; +namespace Executor { + PRIVATE INTEGER *findid(INTEGER); +PRIVATE void drawtextstring(INTEGER id, INTEGER offsetx, + INTEGER offsety); + PRIVATE void drawicon(INTEGER id, + INTEGER offsetx, INTEGER offsety); + PRIVATE void dobuttons(INTEGER id, INTEGER offsetx, + INTEGER offsety, BOOLEAN demo_button_p); +} + A1(PRIVATE, INTEGER *, findid, INTEGER, id) { int i; diff --git a/src/system_error.c b/src/system_error.cpp similarity index 97% rename from src/system_error.c rename to src/system_error.cpp index ae98e24a..3683e8b1 100644 --- a/src/system_error.c +++ b/src/system_error.cpp @@ -25,6 +25,8 @@ char ROMlib_rcsid_system_error[] = #include "rsys/osevent.h" #include "rsys/options.h" +using namespace Executor; + #define N_BUTTONS (3) /* sanity defines */ @@ -44,6 +46,8 @@ char ROMlib_rcsid_system_error[] = retval; \ }) +#pragma pack(push, 2) + struct button { ControlHandle ctl; @@ -57,15 +61,16 @@ struct button int index; }; -static struct button buttons[3]; +static struct button buttons[3] = {0}; -static WindowPtr msg_window; +static WindowPtr msg_window = nullptr; static const char *message; static int default_button; static Rect message_rect; +#pragma pack(pop) static struct button * event_loop (void) @@ -167,7 +172,7 @@ int_sqrt (int x) } int -system_error (const char *_message, int _default_button, +Executor::system_error (const char *_message, int _default_button, const char *button0, const char *button1, const char *button2, system_error_callback_t func0, system_error_callback_t func1, diff --git a/src/teAccess.c b/src/teAccess.cpp similarity index 98% rename from src/teAccess.c rename to src/teAccess.cpp index 2a2ac1ec..549712f6 100644 --- a/src/teAccess.c +++ b/src/teAccess.cpp @@ -20,6 +20,8 @@ char ROMlib_rcsid_teAccess[] = #include "rsys/cquick.h" #include "rsys/mman.h" +using namespace Executor; + P3 (PUBLIC pascal trap, void, TESetText, Ptr, p, LONGINT, length, TEHandle, teh) { TE_SLAM (teh); diff --git a/src/teDisplay.c b/src/teDisplay.cpp similarity index 98% rename from src/teDisplay.c rename to src/teDisplay.cpp index c5dea65c..aeb96ef0 100644 --- a/src/teDisplay.c +++ b/src/teDisplay.cpp @@ -20,6 +20,7 @@ char ROMlib_rcsid_teDisplay[] = #include "rsys/tesave.h" #include "rsys/region.h" +using namespace Executor; P2 (PUBLIC pascal trap, void, TESetJust, INTEGER, j, TEHandle, teh) { diff --git a/src/teEdit.c b/src/teEdit.cpp similarity index 97% rename from src/teEdit.c rename to src/teEdit.cpp index de39e25a..304c3aa6 100644 --- a/src/teEdit.c +++ b/src/teEdit.cpp @@ -24,8 +24,11 @@ char ROMlib_rcsid_teEdit[] = #include "rsys/arrowkeys.h" #include "rsys/notmac.h" #include "rsys/osevent.h" +#include "rsys/text.h" -void +using namespace Executor; + +static void tedoinserttext (TEHandle te, int16 hlen, int16 len, int16 start, Ptr ptr) { @@ -48,7 +51,7 @@ tedoinserttext (TEHandle te, int16 hlen, int16 len, } void -ROMlib_teremovestyleinfo (TEStyleHandle te_style, +Executor::ROMlib_teremovestyleinfo (TEStyleHandle te_style, int16 start, int16 end) { StyleRun *runs, *start_run, *prev_run; @@ -207,7 +210,7 @@ te_style_insert_runs (TEStyleHandle te_style, } void -ROMlib_teinsertstyleinfo (TEHandle te, +Executor::ROMlib_teinsertstyleinfo (TEHandle te, int16 start, int16 len, StScrpHandle scrap) { StScrpHandle null_scrap; @@ -255,7 +258,7 @@ ROMlib_teinsertstyleinfo (TEHandle te, } scrap_n_styles = SCRAP_N_STYLES (scrap); - new_runs = alloca ((scrap_n_styles + 1) * sizeof *new_runs); + new_runs = (StyleRun*)alloca ((scrap_n_styles + 1) * sizeof *new_runs); for (i = 0; i < scrap_n_styles; i ++) { ScrpSTElement *scrap_elt; @@ -286,10 +289,10 @@ ROMlib_teinsertstyleinfo (TEHandle te, DisposHandle ((Handle) scrap); } -PUBLIC int ROMlib_forward_del_p = FALSE; +PUBLIC int Executor::ROMlib_forward_del_p = FALSE; void -ROMlib_tedoitall (TEHandle teh, Ptr ptr, /* INTERNAL */ +Executor::ROMlib_tedoitall (TEHandle teh, Ptr ptr, /* INTERNAL */ int16 len, boolean_t insert, StScrpHandle styleh) { INTEGER start, stop, sellen, hlen, nchar; @@ -666,7 +669,7 @@ P1 (PUBLIC pascal trap, void, TECopy, TEHandle, te) HSetState ((Handle) te_style, te_style_flags); } TEScrpLength = CW (len); -#if defined(X) || defined(NEXTSTEP) || defined(SDL) +#if defined(X) || defined(MACOSX_) || defined(SDL) /* ### should this lock `TEScrpHandle'? */ PutScrapX (TICK("TEXT"), CW (TEScrpLength), (char *) STARH (MR (TEScrpHandle)), CW(ScrapCount)); @@ -683,7 +686,7 @@ P1(PUBLIC pascal trap, void, TECut, TEHandle, teh) P1(PUBLIC pascal trap, void, TEPaste, TEHandle, teh) { -#if defined(X) || defined(NEXTSTEP) || defined(SDL) +#if defined(X) || defined(MACOSX_) || defined(SDL) Size s; s = GetScrapX (TICK("TEXT"), (char **) MR (TEScrpHandle)); diff --git a/src/teIMIV.c b/src/teIMIV.cpp similarity index 99% rename from src/teIMIV.c rename to src/teIMIV.cpp index d5b99b10..c6b2a861 100644 --- a/src/teIMIV.c +++ b/src/teIMIV.cpp @@ -18,6 +18,8 @@ char ROMlib_rcsid_teIMIV[] = #include "rsys/cquick.h" #include "rsys/mman.h" +using namespace Executor; + P3 (PUBLIC pascal trap, void, TEPinScroll, int16, dh, /* IMIV-57 */ int16, dv, TEHandle, te) { diff --git a/src/teIMV.c b/src/teIMV.cpp similarity index 97% rename from src/teIMV.c rename to src/teIMV.cpp index 020f57f5..669bbbf1 100644 --- a/src/teIMV.c +++ b/src/teIMV.cpp @@ -24,14 +24,16 @@ char ROMlib_rcsid_teIMV[] = #include "rsys/tesave.h" #include "rsys/hook.h" +using namespace Executor; + void -generic_elt_copy (generic_elt_t *dst, generic_elt_t *src) +Executor::generic_elt_copy (generic_elt_t *dst, generic_elt_t *src) { *dst = *src; } void -generic_elt_calc_height_ascent (generic_elt_t *elt) +Executor::generic_elt_calc_height_ascent (generic_elt_t *elt) { int16 savesize, savefont; Style saveface; @@ -54,7 +56,7 @@ generic_elt_calc_height_ascent (generic_elt_t *elt) } boolean_t -adjust_attrs (TextStyle *orig_attrs, TextStyle *new_attrs, +Executor::adjust_attrs (TextStyle *orig_attrs, TextStyle *new_attrs, TextStyle *dst_attrs, TextStyle *continuous_attrs, int16 mode) { @@ -102,7 +104,7 @@ adjust_attrs (TextStyle *orig_attrs, TextStyle *new_attrs, such run exists, create it */ int16 -make_style_run_at (TEStyleHandle te_style, int16 sel) +Executor::make_style_run_at (TEStyleHandle te_style, int16 sel) { int run_index; @@ -157,7 +159,7 @@ make_style_run_at (TEStyleHandle te_style, int16 sel) the returned style by one */ int16 -get_style_index (TEStyleHandle te_style, TextStyle *attrs, int incr_count_p) +Executor::get_style_index (TEStyleHandle te_style, TextStyle *attrs, int incr_count_p) { /* these hold the swapped cached height, ascent for the style we are searching for */ @@ -223,7 +225,7 @@ get_style_index (TEStyleHandle te_style, TextStyle *attrs, int incr_count_p) /* decrease the reference count of style at `style_index' by one */ void -release_style_index (TEStyleHandle te_style, int16 style_index) +Executor::release_style_index (TEStyleHandle te_style, int16 style_index) { STHandle style_table; STElement *st_elt; @@ -240,7 +242,7 @@ release_style_index (TEStyleHandle te_style, int16 style_index) appropriately */ void -stabilize_style_info (TEStyleHandle te_style) +Executor::stabilize_style_info (TEStyleHandle te_style) { STHandle style_table; STElement *st_elt; @@ -251,7 +253,7 @@ stabilize_style_info (TEStyleHandle te_style) n_styles = TE_STYLE_N_STYLES (te_style); style_table = TE_STYLE_STYLE_TABLE (te_style); - index_map = alloca (n_styles * sizeof *index_map); + index_map = (int16*)alloca (n_styles * sizeof *index_map); for (i = 0; i < n_styles; i ++) index_map[i] = CW (i); @@ -339,7 +341,7 @@ combine_run_with_next (TEStyleHandle te_style, int16 run_index) } void -te_style_combine_runs (TEStyleHandle te_style) +Executor::te_style_combine_runs (TEStyleHandle te_style) { int16 current_run_index, n_runs; @@ -902,7 +904,7 @@ P5 (PUBLIC pascal trap, void, TEReplaceStyle, int16, mode, { int16 new_style_index; - TextStyle *new_attrs = alloca (sizeof *new_attrs); + TextStyle *new_attrs = (TextStyle*)alloca (sizeof *new_attrs); adjust_attrs (ST_ELT_TO_ATTR (style), replacement_attrs, new_attrs, NULL, mode); diff --git a/src/teInit.c b/src/teInit.cpp similarity index 98% rename from src/teInit.c rename to src/teInit.cpp index e95a584f..5c12e057 100644 --- a/src/teInit.c +++ b/src/teInit.cpp @@ -22,6 +22,8 @@ char ROMlib_rcsid_teInit[] = #include "rsys/mman.h" #include "rsys/tesave.h" +using namespace Executor; + P0 (PUBLIC pascal trap, void, TEInit) { TEScrpHandle = RM (NewHandle (0)); diff --git a/src/teInsert.c b/src/teInsert.cpp similarity index 98% rename from src/teInsert.c rename to src/teInsert.cpp index fddaf361..c67ddf5f 100644 --- a/src/teInsert.c +++ b/src/teInsert.cpp @@ -27,8 +27,10 @@ char ROMlib_rcsid_teInsert[] = #include "rsys/region.h" #include "rsys/text.h" +using namespace Executor; + int16 -ROMlib_StyleTextWidth (TEPtr tep, +Executor::ROMlib_StyleTextWidth (TEPtr tep, int16 start, int16 count) { Handle hText; @@ -116,7 +118,7 @@ ROMlib_StyleTextWidth (TEPtr tep, } void -te_char_to_point (const TEPtr tep, int16 sel, Point *p) +Executor::te_char_to_point (const TEPtr tep, int16 sel, Point *p) { SignedByte hText_flags; Handle hText; @@ -234,7 +236,7 @@ togglecaret (TEHandle teh, int16 sel, boolean_t paint_p) } PUBLIC void -ROMlib_recompute_caret (TEHandle te) +Executor::ROMlib_recompute_caret (TEHandle te) { int16 state; @@ -244,7 +246,7 @@ ROMlib_recompute_caret (TEHandle te) } void -ROMlib_togglelite (TEHandle te) +Executor::ROMlib_togglelite (TEHandle te) { int16 state; @@ -256,7 +258,7 @@ ROMlib_togglelite (TEHandle te) } void -ROMlib_tesave (tesave *t, TEHandle teh) +Executor::ROMlib_tesave (tesave *t, TEHandle teh) { TEPtr tp; @@ -298,7 +300,7 @@ ROMlib_tesave (tesave *t, TEHandle teh) } void -ROMlib_terestore (tesave *t) +Executor::ROMlib_terestore (tesave *t) { SetPenState (&t->_tpstate); @@ -413,7 +415,7 @@ te_draw (TEPtr tep, view_rect = &TEP_VIEW_RECT (tep); vis_rect = &RGN_BBOX (PORT_VIS_REGION (thePort)); - clip_rect = alloca (sizeof *clip_rect); + clip_rect = (Rect*)alloca (sizeof *clip_rect); #if 0 #warning this code appears to cause trouble with TTSs logbook @@ -500,14 +502,14 @@ te_draw (TEPtr tep, /* allocate bogo runs/styles */ n_runs = 1; - runs = alloca (sizeof *runs * 2); + runs = (StyleRun*)alloca (sizeof *runs * 2); RUN_START_CHAR_X (&runs[0]) = CWC (0); RUN_STYLE_INDEX_X (&runs[0]) = CWC (0); RUN_START_CHAR_X (&runs[1]) = CW (TEP_LENGTH (tep) + 1); RUN_STYLE_INDEX_X (&runs[1]) = CWC (-1); n_styles = 1; - styles = alloca (sizeof *styles); + styles = (STElement*)alloca (sizeof *styles); ST_ELT_FACE (styles) = TEP_TX_FACE (tep); @@ -856,6 +858,10 @@ double_click_p (TEHandle te, int16 cl) typedef BOOLEAN (*cliklooptype) (void); +namespace Executor { + static inline BOOLEAN CALLCLIKOK(TEHandle); +} + A1 (static inline, BOOLEAN, CALLCLIKOK, TEHandle, teh) { BOOLEAN retval; diff --git a/src/teMisc.c b/src/teMisc.cpp similarity index 97% rename from src/teMisc.c rename to src/teMisc.cpp index c6716b7c..d2b04804 100644 --- a/src/teMisc.c +++ b/src/teMisc.cpp @@ -26,12 +26,14 @@ char ROMlib_rcsid_teMisc[] = #include "rsys/hook.h" #include "rsys/text.h" +using namespace Executor; + int16 nextbreak (TEHandle teh, int16 off, int16 len, int16 max_width); #if ERROR_SUPPORTED_P (ERROR_TEXT_EDIT_SLAM) void -ROMlib_sledgehammer_te (TEHandle te) +Executor::ROMlib_sledgehammer_te (TEHandle te) { int16 n_lines; int16 width; @@ -77,7 +79,7 @@ ROMlib_sledgehammer_te (TEHandle te) * (int) sizeof *TE_STYLE_RUNS ((TEStyleHandle) NULL)))); n_styles = TE_STYLE_N_STYLES (te_style); - style_count_vec = alloca (n_styles * sizeof *style_count_vec); + style_count_vec = (int16*)alloca (n_styles * sizeof *style_count_vec); memset (style_count_vec, 0, n_styles * sizeof *style_count_vec); for (i = 0; i < n_runs; i ++) { @@ -266,7 +268,7 @@ nextbreak (TEHandle teh, int16 off, int16 len, } /* return the `run' index that contains the current character */ -int16 te_char_to_run_index (TEStyleHandle te_style, int16 sel) +int16 Executor::te_char_to_run_index (TEStyleHandle te_style, int16 sel) { StyleRun *current_run; int16 n_runs; @@ -301,7 +303,7 @@ int16 te_char_to_run_index (TEStyleHandle te_style, int16 sel) } /* return the line number that contains character index `sel' */ -int16 te_char_to_lineno (TEPtr te, int16 sel) +int16 Executor::te_char_to_lineno (TEPtr te, int16 sel) { int16 n_lines; int16 *line_starts; @@ -442,7 +444,7 @@ te_set_line_starts_allocation (TEHandle te, int n_lines) /* recalculate the various text edit tables associated with `te' after `nadded' characters are to be added (or deleted) at `sel' */ void -ROMlib_caltext (TEHandle te, +Executor::ROMlib_caltext (TEHandle te, int16 sel, int16 n_added, int16 *first_changed_out, int16 *last_changed_out) { @@ -607,7 +609,7 @@ P3 (PUBLIC pascal trap, int16, TEFeatureFlag, } int16 -ROMlib_call_TEDoText (TEPtr tp, int16 first, int16 last, int16 what) +Executor::ROMlib_call_TEDoText (TEPtr tp, int16 first, int16 last, int16 what) { register int16 myd0; diff --git a/src/teScrap.c b/src/teScrap.cpp similarity index 97% rename from src/teScrap.c rename to src/teScrap.cpp index ac396016..bf90f251 100644 --- a/src/teScrap.c +++ b/src/teScrap.cpp @@ -17,6 +17,8 @@ char ROMlib_rcsid_teScrap[] = #include "rsys/cquick.h" #include "rsys/mman.h" +using namespace Executor; + A0(PUBLIC, OSErr, TEFromScrap) { int32 l, m; diff --git a/src/tempmem.c b/src/tempmem.cpp similarity index 98% rename from src/tempmem.c rename to src/tempmem.cpp index 79e490c2..3626de55 100644 --- a/src/tempmem.c +++ b/src/tempmem.cpp @@ -12,6 +12,8 @@ char ROMlib_rcsid_tempmem[] = #include "MemoryMgr.h" #include "rsys/mman.h" +using namespace Executor; + /* #define TEMP_MEM_FAIL */ #define paramErr (-50) diff --git a/src/think.c b/src/think.cpp similarity index 86% rename from src/think.c rename to src/think.cpp index 54016d79..bddc0a49 100644 --- a/src/think.c +++ b/src/think.cpp @@ -11,10 +11,13 @@ char ROMlib_rcsid_think[] = #include "rsys/common.h" #include "MemoryMgr.h" +#include "ThinkC.h" + +using namespace Executor; A1(PUBLIC, StringPtr, CtoPstr, char *, str) { - register Size len; + Size len; len = strlen((char *) str); BlockMove((Ptr) str, (Ptr) (str+1), len); @@ -24,7 +27,7 @@ A1(PUBLIC, StringPtr, CtoPstr, char *, str) A1(PUBLIC, char *, PtoCstr, StringPtr, str) { - register Size len; + Size len; len = str[0]; BlockMove((Ptr) (str+1), (Ptr) str, len); @@ -42,13 +45,13 @@ P1(PUBLIC pascal trap, void, DebugStr, StringPtr, p) fprintf(stderr, "\n"); } -PUBLIC void CDebugStr( StringPtr p ) +PUBLIC void Executor::CDebugStr( StringPtr p ) { char *pstr; LONGINT n; n = strlen((char *) p); - pstr = alloca(n + 1); + pstr = (char*)alloca(n + 1); pstr[0] = n; BlockMove((Ptr) p, (Ptr) pstr+1, n); } diff --git a/src/time.c b/src/time.cpp similarity index 97% rename from src/time.c rename to src/time.cpp index a19761ae..5dd1168d 100644 --- a/src/time.c +++ b/src/time.cpp @@ -28,6 +28,8 @@ char ROMlib_rcsid_time[] = #include "m68k-stack.h" #endif +using namespace Executor; + #if defined (SYSV) LONGINT setitimer (which, value, ovalue) /* TODO */ @@ -39,14 +41,14 @@ setitimer (which, value, ovalue) /* TODO */ } #endif /* SYSV */ -PUBLIC QHdr ROMlib_timehead; +PUBLIC QHdr Executor::ROMlib_timehead; /* Actual time at which Executor started running, GMT. */ PUBLIC struct timeval ROMlib_start_time; #if defined (SYN68K) /* Current state of virtual interrupt enabling. */ -PUBLIC virtual_int_state_t _virtual_interrupts_blocked = FALSE; +PUBLIC virtual_int_state_t Executor::_virtual_interrupts_blocked = FALSE; #endif /* Msecs during last interrupt. */ @@ -281,6 +283,9 @@ A3 (PRIVATE, LONGINT, catchalarm, LONGINT, volatile signo, #endif } +namespace Executor { + PRIVATE void ROMlib_PrimeTime(QElemPtr, LONGINT); +} A2 (PRIVATE, void, ROMlib_PrimeTime, QElemPtr, taskp, LONGINT, count) { diff --git a/src/toolevent.c b/src/toolevent.cpp similarity index 96% rename from src/toolevent.c rename to src/toolevent.cpp index 8fa27f0b..f3fe615e 100644 --- a/src/toolevent.c +++ b/src/toolevent.cpp @@ -51,11 +51,16 @@ char ROMlib_rcsid_toolevent[] = #include "rsys/release.h" #include "rsys/custom.h" #include "rsys/toolevent.h" +#include "rsys/nextprint.h" + +#include + +using namespace Executor; /* #define EVENTTRACE */ #if defined(EVENTTRACE) -LONGINT eventstate = 0; +LONGINT Executor::eventstate = 0; #define TRACE(n) (eventstate = (n)) #else /* !defined(EVENTTRACE) */ #define TRACE(n) @@ -63,17 +68,21 @@ LONGINT eventstate = 0; PRIVATE BOOLEAN ROMlib_alarmonmbar = FALSE; -PUBLIC int ROMlib_delay = 0; /* number of ticks to wait when we - haven't gotten anything interesting */ +PUBLIC int Executor::ROMlib_delay = 0; /* number of ticks to wait when we + * haven't gotten anything interesting */ #define ALARMSICN -16385 -PUBLIC BOOLEAN ROMlib_beepedonce = FALSE; +PUBLIC BOOLEAN Executor::ROMlib_beepedonce = FALSE; + +namespace Executor { + PRIVATE void ROMlib_togglealarm(); +} A0(PRIVATE, void, ROMlib_togglealarm) { Handle alarmh; - static unsigned char hard_coded_alarm[] = + static const unsigned char hard_coded_alarm[] = { 0xFB, 0xBE, /* XXXXX XXX XXXXX */ 0x84, 0x42, /* X X X X */ @@ -219,7 +228,7 @@ P3(PUBLIC pascal trap, LONGINT, KeyTrans, Ptr, mapp, unsigned short, code, return ascii; } -PUBLIC void ROMlib_circledefault(DialogPtr dp) +PUBLIC void Executor::ROMlib_circledefault(DialogPtr dp) { INTEGER type; HIDDEN_Handle h; @@ -239,7 +248,7 @@ PUBLIC void ROMlib_circledefault(DialogPtr dp) SetPort(saveport); } -PUBLIC void dofloppymount( void ) +PUBLIC void Executor::dofloppymount( void ) { #if !defined(MSDOS) && !defined(LINUX) && !defined (CYGWIN32) SysBeep(5); @@ -250,11 +259,7 @@ PUBLIC void dofloppymount( void ) PRIVATE void doscreendumptoprinter( void ) { -#if defined(NEXTSTEP) - /* TODO */ -#else /* !defined(NEXTSTEP) */ SysBeep(5); -#endif /* !defined(NEXTSTEP) */ } typedef enum { SETSTATE, CLEARSTATE, FLIPSTATE } modstate_t; @@ -412,7 +417,7 @@ INTEGER getedittext(DialogPtr dp, INTEGER itemno) #define C_STRING_FROM_SYSTEM_VERSION() \ ({ \ char *retval; \ - retval = alloca (9); \ + retval = (char*)alloca (9); \ sprintf (retval, "%d.%d.%d", \ (system_version >> 8) & 0xF, \ (system_version >> 4) & 0xF, \ @@ -518,9 +523,8 @@ update_string_from_edit_text (char **strp, DialogPtr dp, INTEGER itemno) GetIText(h.p, str); if (*strp) free (*strp); - *strp = malloc (str[0] + 1); - if (*strp) - { + *strp = (char*)malloc (str[0] + 1); + if (*strp) { memcpy (*strp, str+1, str[0]); (*strp)[str[0]] = 0; } @@ -632,7 +636,7 @@ saveprefvalues (char *savefilename, LONGINT locationx, LONGINT locationy) fprintf (fp, "BitsPerPixel = %d;\n", PIXMAP_PIXEL_SIZE (GD_PMAP (MR (MainDevice)))); -#if 0 && defined(NEXTSTEP) +#if 0 && defined(MACOSX_) fprintf(fp, "ScreenSize = { %ld, %ld };\n", (long) curr_width, (long) curr_height); fprintf(fp, "MacSize = { %ld, %ld };\n", (long) orig_width, (long) orig_height); #endif @@ -891,14 +895,20 @@ PRIVATE void doquitreallyquits( void ) ROMlib_exit = !ROMlib_exit; } +extern void ROMlib_updateworkspace( void ); + +namespace Executor { + PRIVATE BOOLEAN doevent(INTEGER, EventRecord*, BOOLEAN); +} + A3(PRIVATE, BOOLEAN, doevent, INTEGER, em, EventRecord *, evt, BOOLEAN, remflag) /* no DA support */ { BOOLEAN retval; LONGINT now; -#if defined(NEXTSTEP) +#if defined(MACOSX_) struct sockaddr sockname; - LONGINT addrlen; + socklen_t addrlen; char device[DEVNAMELEN]; LONGINT ns, nread; #endif @@ -1048,9 +1058,9 @@ A3(PRIVATE, BOOLEAN, doevent, INTEGER, em, EventRecord *, evt, */ if (!retval && remflag && (em & diskMask)) { TRACE(26); -#if defined(NEXTSTEP) +#if defined(MACOSX_) addrlen = sizeof(sockname); - if ((ns = accept(ROMlib_sock, &sockname, (void *) &addrlen)) >= 0) { + if ((ns = accept(ROMlib_sock, &sockname, &addrlen)) >= 0) { fcntl(ns, F_SETFL, 0); /* turn off FNDELAY */ nread = read(ns, device, sizeof(device)); ROMlib_updateworkspace(); @@ -1059,7 +1069,7 @@ A3(PRIVATE, BOOLEAN, doevent, INTEGER, em, EventRecord *, evt, retval = TRUE; } else { gui_assert(errno == EWOULDBLOCK); -#endif /* defined(NEXTSTEP) */ +#endif /* defined(MACOSX_) */ if (!beenhere) { TRACE(26); beenhere = 1; @@ -1070,9 +1080,9 @@ A3(PRIVATE, BOOLEAN, doevent, INTEGER, em, EventRecord *, evt, retval = TRUE; } } -#if defined(NEXTSTEP) +#if defined(MACOSX_) } -#endif /* defined(NEXTSTEP) */ +#endif /* defined(MACOSX_) */ } if (!retval && (em & updateMask)) { TRACE(28); @@ -1264,7 +1274,7 @@ A0(PUBLIC, LONGINT, GetCaretTime) #define SANE_DEBUGGING #if defined (SANE_DEBUGGING) -int sane_debugging_on = 0; /* Leave this off and let the person doing the +static int sane_debugging_on = 0; /* Leave this off and let the person doing the debugging turn it on if he/she wants. If this is set to non-zero, it breaks code. Not a very nice thing to do. */ @@ -1276,7 +1286,7 @@ sendsuspendevent (void) Point p; if ( -#if defined (NEXTSTEP) || defined (OPENSTEP) +#if defined (MACOSX_) || defined (MACOSX_) printstate == __idle && #endif (size_info.size_flags & SZacceptSuspendResumeEvents) @@ -1307,7 +1317,7 @@ sendresumeevent (boolean_t cvtclip) Point p; if ( -#if defined (NEXTSTEP) || defined (OPENSTEP) +#if defined (MACOSX_) || defined (MACOSX_) printstate == __idle && #endif (size_info.size_flags & SZacceptSuspendResumeEvents) @@ -1373,7 +1383,7 @@ post_helper (INTEGER code, uint8 raw, uint8 mapped, INTEGER mods) } PUBLIC void -ROMlib_send_quit (void) +Executor::ROMlib_send_quit (void) { post_helper (keyDown, MKV_CLOVER, 0 , 0); post_helper (keyDown, MKV_q , 'q', cmdKey); diff --git a/src/toolmath.c b/src/toolmath.cpp similarity index 98% rename from src/toolmath.c rename to src/toolmath.cpp index 81280291..902e5898 100644 --- a/src/toolmath.c +++ b/src/toolmath.cpp @@ -14,6 +14,8 @@ char ROMlib_rcsid_toolmath[] = #include #include +using namespace Executor; + P1(PUBLIC pascal trap, Fract, FracSqrt, Fract, x) /* IMIV-64 */ { Extended z; diff --git a/src/toolutil.c b/src/toolutil.cpp similarity index 94% rename from src/toolutil.c rename to src/toolutil.cpp index 75edc38f..7aae4026 100644 --- a/src/toolutil.c +++ b/src/toolutil.cpp @@ -26,6 +26,21 @@ char ROMlib_rcsid_toolutil[] = #include "rsys/next.h" /* for ROMlib_info */ #include "rsys/string.h" #include "rsys/mman_private.h" +#include "rsys/resource.h" +#include "rsys/toolutil.h" +#include + +using namespace Executor; + +namespace Executor { + PRIVATE Fixed minvert(Fixed); + PRIVATE int cmpstrings(char *p, char *ep, char *p1, LONGINT len); + PUBLIC trap void R_Fix2X(void *dummyretpc, Fixed x, + extended80 *ret); + PUBLIC trap void R_Frac2X(void *dummyretpc, Fract x, + extended80 * ret); +} + P2(PUBLIC pascal trap, Fixed, FixRatio, INTEGER, n, INTEGER, d) { @@ -96,29 +111,30 @@ A2(PUBLIC, Handle, ROMlib_getrestid, ResType, rest, /* INTERNAL */ return retval; } -PUBLIC StringHandle ROMlib_phoney_name_string; +PUBLIC StringHandle Executor::ROMlib_phoney_name_string; PRIVATE StringHandle get_phoney_name_resource (void) { + using namespace std; if (!ROMlib_phoney_name_string) { - char *name = ""; -#if defined (linux) || defined (MACOSX) - name = getlogin (); - if (!name) - name = getenv ("LOGNAME"); - if (!name) + string name = ""; +#if defined (linux) || defined (MACOSX_) + name = string(getlogin()); + if (!name.length()) + name = string(getenv("LOGNAME")); + if (!name.length()) name = ""; #endif int len; - len = strlen (name); + len = name.length(); ROMlib_phoney_name_string = (StringHandle) NewHandleSys (len+1); if (ROMlib_phoney_name_string) { HSetRBit ((Handle) ROMlib_phoney_name_string); - str255_from_c_string (STARH (ROMlib_phoney_name_string), name); + str255_from_c_string (STARH (ROMlib_phoney_name_string), name.c_str()); } } return ROMlib_phoney_name_string; @@ -294,7 +310,7 @@ do { \ void -unpack_int16_bits (HIDDEN_Ptr *sp, HIDDEN_Ptr *dp, INTEGER len) +Executor::unpack_int16_bits (HIDDEN_Ptr *sp, HIDDEN_Ptr *dp, INTEGER len) { /* This is used when unpacking 16 bpp PICT bitmaps. */ UNPACK_BITS_BODY (int16); @@ -456,7 +472,7 @@ A1(PRIVATE, Fixed, minvert, Fixed, f) /* wants postive number */ } PRIVATE Fixed sloptab[46] = { - 0x80000001, 0x00394a30, 0x001ca2d7, 0x001314bd, 0x000e4cf5, + static_cast(0x80000001), 0x00394a30, 0x001ca2d7, 0x001314bd, 0x000e4cf5, 0x000b6e17, 0x000983ad, 0x000824f3, 0x00071d88, 0x00065051, 0x0005abd9, 0x00052501, 0x00046462, 0x000454db, 0x000402c2, 0x0003bb68, 0x00037cc7, 0x00034556, 0x000313e3, 0x0002e77a, @@ -471,7 +487,7 @@ PRIVATE Fixed sloptab[46] = { P1(PUBLIC pascal trap, Fixed, SlopeFromAngle, INTEGER, a) { int sign, recip; - auto Fixed retval; /* cc -a problems */ + Fixed retval; /* cc -a problems */ if (a < 0) a -= 360 * ((a / 360) - 1); @@ -494,7 +510,7 @@ P1(PUBLIC pascal trap, Fixed, SlopeFromAngle, INTEGER, a) retval = minvert(retval); if (sign == -1) retval = -retval; - return(retval); + return retval; } P1(PUBLIC pascal trap, INTEGER, AngleFromSlope, Fixed, s) diff --git a/src/trapname.c b/src/trapname.cpp similarity index 99% rename from src/trapname.c rename to src/trapname.cpp index 69c3d893..c74d77c6 100644 --- a/src/trapname.c +++ b/src/trapname.cpp @@ -9,6 +9,8 @@ char ROMlib_rcsid_trapname[] = "$Id: trapname.c 63 2004-12-24 18:19:43Z ctm $"; #include "rsys/common.h" #include "rsys/trapname.h" +using namespace Executor; + #if !defined (NDEBUG) /* Returns the trap name for the given trap number. For convenience, the diff --git a/src/uniquefile.c b/src/uniquefile.cpp similarity index 75% rename from src/uniquefile.c rename to src/uniquefile.cpp index 8ee02f7f..c417a073 100644 --- a/src/uniquefile.c +++ b/src/uniquefile.cpp @@ -11,6 +11,7 @@ char ROMlib_rcsid_uniquefile[] = #include "rsys/uniquefile.h" #include "rsys/file.h" +using namespace Executor; /* This function fills in RESULT with the pathname for a unique file * of a specified form. RESULT will be a 0-terminated Pascal string. @@ -22,44 +23,44 @@ char ROMlib_rcsid_uniquefile[] = */ boolean_t -unique_file_name (const char *template, const char *default_template, +Executor::unique_file_name (const char *template1, const char *default_template, Str255 result) { static const char suff[] = "0123456789abcdefghijklmnopqrstuvwxyz"; const char *try_suff; - char *try; + char *try1; char *replace; struct stat sbuf; time_t oldest_time; - /* The template string must have a '*'. */ - if (!template || !strchr (template, '*')) - template = default_template; + /* The template1 string must have a '*'. */ + if (!template1 || !strchr (template1, '*')) + template1 = default_template; /* Default to an empty string. */ result[0] = 0; result[1] = '\0'; /* Make sure the resulting string won't be too long. */ - if (strlen (template) + 1 >= 255) + if (strlen (template1) + 1 >= 255) return FALSE; - try = copystr (template); + try1 = copystr (template1); - if (try) + if (try1) { /* Try to find a unique file name. If we fail, choose the oldest. */ oldest_time = 0; - replace = strrchr (try, '*'); + replace = strrchr (try1, '*'); for (try_suff = suff; *try_suff; try_suff++) { *replace = *try_suff; - if (Ustat (try, &sbuf) != 0 && errno == ENOENT) + if (Ustat (try1, &sbuf) != 0 && errno == ENOENT) { /* If this file name isn't taken, grab it !*/ - strcpy ((char *) result + 1, try); + strcpy ((char *) result + 1, try1); result[0] = strlen ((char *) result + 1); - free (try); + free (try1); return TRUE; } } diff --git a/src/unix_like.c b/src/unix_like.cpp similarity index 94% rename from src/unix_like.c rename to src/unix_like.cpp index 5f676c36..f1f0617b 100644 --- a/src/unix_like.c +++ b/src/unix_like.cpp @@ -7,7 +7,7 @@ * Eventually everything should be rejiggered to use the GNU build system. */ -#if defined (LINUX) || defined (MACOSX) +#if defined (LINUX) || defined (MACOSX_) #include #include @@ -30,7 +30,9 @@ #include #include -#if defined (MACOSX) +using namespace Executor; + +#if defined (MACOSX_) // The code in here should work for Mac OS X as well as Linux, although // in Mac OS X they use MAP_ANON instead of MAP_ANONYMOUS #warning "Fix this, the code isn't Linux specific" @@ -125,7 +127,7 @@ guess_good_memory_settings (void) boolean_t -os_init (void) +Executor::os_init (void) { guess_good_memory_settings (); #if defined (SDL) @@ -135,7 +137,7 @@ os_init (void) } PUBLIC int -ROMlib_lockunlockrange (int fd, uint32 begin, uint32 count, lockunlock_t op) +Executor::ROMlib_lockunlockrange (int fd, uint32 begin, uint32 count, lockunlock_t op) { int retval; struct flock flock; @@ -201,7 +203,7 @@ ROMlib_launch_native_app (int n_filenames, char **filenames) { char **v; - v = alloca (sizeof *v * (n_filenames + 1)); + v = (char**)alloca (sizeof *v * (n_filenames + 1)); memcpy (v, filenames, n_filenames * sizeof *v); v[n_filenames] = 0; if (fork () == 0) @@ -268,13 +270,13 @@ _dbm_nextkey (datum *datump, DBM *db) *datump = dbm_nextkey (db); } -PUBLIC boolean_t host_has_spfcommon (void) +PUBLIC boolean_t Executor::host_has_spfcommon (void) { return false; } PUBLIC boolean_t -host_spfcommon (host_spf_reply_block *replyp, const char *prompt, +Executor::host_spfcommon (host_spf_reply_block *replyp, const char *prompt, const char *incoming_filename, void *fp, void *filef, int numt, void *tl, getorput_t getorput, sf_flavor_t flavor, void *activeList, void *activateproc, void *yourdatap) @@ -291,7 +293,7 @@ mmap_lowglobals (void) { caddr_t addr; - addr = mmap ((caddr_t) PAGE_ZERO_START, + addr = (caddr_t)mmap ((caddr_t) PAGE_ZERO_START, PAGE_ZERO_SIZE, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_FIXED | MAP_PRIVATE, -1, 0); @@ -299,7 +301,7 @@ mmap_lowglobals (void) } } -#if !defined (MACOSX) +#if !defined (MACOSX_) #if !defined (powerpc) && !defined (__ppc__) PRIVATE caddr_t @@ -359,7 +361,7 @@ mmap_conflict (void *start, size_t length) stop = (char *) start + length; old_segv_handler = signal (SIGSEGV, segv_handler); - for (addr = start; addr < stop; addr += page_size) + for (addr = (char*)start; addr < stop; addr += page_size) { ++n_pages; if (sigsetjmp (segv_return, 1) != 0) @@ -387,12 +389,10 @@ mmap_conflict (void *start, size_t length) * emulation isn't an issue, we really shouldn't care. */ +#if !defined(MACOSX_) void * mmap_permanent_memory (unsigned long amount_wanted) { -#if defined(MACOSX) - return NULL; -#else caddr_t addr_got; caddr_t badness_start; @@ -425,7 +425,7 @@ mmap_permanent_memory (unsigned long amount_wanted) addr_got = NULL; else { - addr_got = mmap (addr_wanted, amount_wanted, PROT_READ | PROT_WRITE, + addr_got = (caddr_t)mmap (addr_wanted, amount_wanted, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_FIXED | MAP_PRIVATE, -1, 0); if (addr_got == (caddr_t) -1) addr_got = NULL; @@ -461,7 +461,7 @@ mmap_permanent_memory (unsigned long amount_wanted) #endif return addr_got; -#endif } +#endif #endif /* defined (LINUX) || defined (MACOSX) */ diff --git a/src/vbl.c b/src/vbl.cpp similarity index 98% rename from src/vbl.c rename to src/vbl.cpp index 6faee4ca..5aefc26f 100644 --- a/src/vbl.c +++ b/src/vbl.cpp @@ -26,6 +26,7 @@ char ROMlib_rcsid_vbl[] = #include "rsys/soundopts.h" #include "rsys/prefs.h" +using namespace Executor; typedef enum { @@ -37,7 +38,7 @@ typedef enum } clockstatus_t; -PUBLIC int ROMlib_clock = CLOCKOFF; +PUBLIC int Executor::ROMlib_clock = CLOCKOFF; /* * ROMlib_vcatch is called by the time manager, hence it doesn't need to diff --git a/src/version.c b/src/version.cpp similarity index 99% rename from src/version.c rename to src/version.cpp index d25788d2..a0d2cc4f 100644 --- a/src/version.c +++ b/src/version.cpp @@ -15,6 +15,8 @@ char ROMlib_rcsid_version[] = #include "ResourceMgr.h" #include "MemoryMgr.h" +using namespace Executor; + /* A simple version number like "1.99q" */ const char ROMlib_executor_version[] = EXECUTOR_VERSION; diff --git a/src/vgavdriver.c b/src/vgavdriver.cpp similarity index 99% rename from src/vgavdriver.c rename to src/vgavdriver.cpp index 61212930..cdd3284a 100644 --- a/src/vgavdriver.c +++ b/src/vgavdriver.cpp @@ -28,6 +28,7 @@ char ROMlib_rcsid_vgavdriver[] = #include "rsys/dirtyrect.h" #include "rsys/autorefresh.h" +using namespace Executor; #if defined (VGA_SCREEN_NEEDS_FAR_PTR) # define VGA_IF_SEL(x) x diff --git a/src/virtualint.c b/src/virtualint.cpp similarity index 65% rename from src/virtualint.c rename to src/virtualint.cpp index 8f057855..2bdc0d54 100644 --- a/src/virtualint.c +++ b/src/virtualint.cpp @@ -12,31 +12,18 @@ char ROMlib_rcsid_virtualint[] = #if defined (SYN68K) #include "rsys/blockinterrupts.h" +using namespace Executor; void -do_virtual_interrupt (void) +Executor::do_virtual_interrupt (void) { syn68k_addr_t pc; -#if defined (MSDOS) - volatile unsigned short saved_es; - - asm volatile ("movw %%es,%0\n\t" - "pushl %%ds\n\t" - "popl %%es\n\t" - "cld" - : "=m" (saved_es)); -#endif pc = interrupt_process_any_pending (MAGIC_EXIT_EMULATOR_ADDRESS); if (pc != MAGIC_EXIT_EMULATOR_ADDRESS) { interpret_code (hash_lookup_code_and_create_if_needed (pc)); } - -#if defined (MSDOS) - asm volatile ("movw %0,%%es" - : : "m" (saved_es)); -#endif } #endif /* SYN68K */ diff --git a/src/windColor.c b/src/windColor.cpp similarity index 87% rename from src/windColor.c rename to src/windColor.cpp index 058ccb60..5f4507c1 100644 --- a/src/windColor.c +++ b/src/windColor.cpp @@ -19,13 +19,15 @@ char ROMlib_rcsid_windColor[] = #include "rsys/cquick.h" #include "rsys/wind.h" +using namespace Executor; + /* return a pointer to the auxilary window record associated with `w' */ -AuxWinHandle default_aux_win = NULL; +AuxWinHandle Executor::default_aux_win = NULL; -#define BLACK_RGB { CWC (0), CWC (0), CWC (0), } -#define WHITE_RGB { CWC (0xFFFF), CWC (0xFFFF), CWC (0xFFFF), } +static const RGBColor BLACK_RGB = { CWC (0), CWC (0), CWC (0), }; +static const RGBColor WHITE_RGB = { CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF), }; /* bw window colortable */ const ColorSpec default_bw_win_ctab[] = @@ -45,10 +47,10 @@ const ColorSpec default_bw_win_ctab[] = { CWC (wTingeDark), BLACK_RGB }, }; -#define LT_BLUISH_RGB { CWC (0xCCCC), CWC (0xCCCC), CWC (0xFFFF) } -#define DK_BLUISH_RGB { CWC (0x3333), CWC (0x3333), CWC (0x6666) } +static const RGBColor LT_BLUISH_RGB = { CWC ((unsigned short)0xCCCC), CWC ((unsigned short)0xCCCC), CWC ((unsigned short)0xFFFF) }; +static const RGBColor DK_BLUISH_RGB = { CWC ((unsigned short)0x3333), CWC ((unsigned short)0x3333), CWC ((unsigned short)0x6666) }; /* the default `bluish' window color table */ -const ColorSpec default_color_win_ctab[] = +const ColorSpec Executor::default_color_win_ctab[] = { { CWC (wContentColor), WHITE_RGB }, { CWC (wFrameColor), BLACK_RGB }, @@ -67,7 +69,7 @@ const ColorSpec default_color_win_ctab[] = #undef DK_BLUISH_RGB #undef LT_BLUISH_RGB -#define GRAY_RGB { CWC (0x8888), CWC (0x8888), CWC (0x8888) } +static const RGBColor GRAY_RGB = { CWC ((unsigned short)0x8888), CWC ((unsigned short)0x8888), CWC ((unsigned short)0x8888) }; /* stolen from the default colortable excel tries to install */ const ColorSpec default_system6_color_win_ctab[] = @@ -83,7 +85,7 @@ const ColorSpec default_system6_color_win_ctab[] = #undef BLACK_RGB void -wind_color_init (void) +Executor::wind_color_init (void) { /* initalize the default window colortable */ ZONE_SAVE_EXCURSION @@ -102,7 +104,7 @@ wind_color_init (void) } AuxWinHandle * -lookup_aux_win (WindowPtr w) +Executor::lookup_aux_win (WindowPtr w) { AuxWinHandle *t; diff --git a/src/windDisplay.c b/src/windDisplay.cpp similarity index 99% rename from src/windDisplay.c rename to src/windDisplay.cpp index 39e6c481..afefab59 100644 --- a/src/windDisplay.c +++ b/src/windDisplay.cpp @@ -19,6 +19,8 @@ char ROMlib_rcsid_windDisplay[] = #include "rsys/wind.h" #include "rsys/glue.h" +using namespace Executor; + P2(PUBLIC pascal trap, void, SetWTitle, WindowPtr, w, StringPtr, t) { if (!w) diff --git a/src/windDocdef.c b/src/windDocdef.cpp similarity index 98% rename from src/windDocdef.c rename to src/windDocdef.cpp index ec82c989..72734a12 100644 --- a/src/windDocdef.c +++ b/src/windDocdef.cpp @@ -19,11 +19,14 @@ char ROMlib_rcsid_windDocdef[] = #include "rsys/image.h" -#include "zoom.c" -#include "go_away.c" -#include "active.c" -#include "ractive.c" -#include "grow.c" +using namespace Executor; + +namespace Executor { +#include "zoom.cmap" +#include "go_away.cmap" +#include "active.cmap" +#include "ractive.cmap" +#include "grow.cmap" #if 1 @@ -47,7 +50,7 @@ PUBLIC BOOLEAN ROMlib_window_zoomed(WindowPeek wp) #define WINDOW_ZOOMED(w) (ROMlib_window_zoomed(w)) #endif - +} /* `color_p' is TRUE if the current call to the window definition function is for a while to be drawn in color */ static int color_p; @@ -88,12 +91,12 @@ static RGBColor *window_colors; #define frame_shadow frame RGBColor * -validate_colors_for_window (GrafPtr w) +Executor::validate_colors_for_window (GrafPtr w) { static RGBColor color_window_colors[19]; /* just make the unused color something noticable */ -#define UNUSED { CWC (0xFFFF), CWC (0), CWC (0) } -#define WHITE { CWC (0xFFFF), CWC (0xFFFF), CWC (0xFFFF) } +#define UNUSED { CWC ((unsigned short)0xFFFF), CWC (0), CWC (0) } +#define WHITE { CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF), CWC ((unsigned short)0xFFFF) } #define BLACK { CWC (0), CWC (0), CWC (0) } static RGBColor bw_window_colors[19] = { diff --git a/src/windInit.c b/src/windInit.cpp similarity index 98% rename from src/windInit.c rename to src/windInit.cpp index fe86175e..d3b5edaa 100644 --- a/src/windInit.c +++ b/src/windInit.cpp @@ -41,9 +41,11 @@ char ROMlib_rcsid_windInit[] = #include "rsys/options.h" #include "rsys/launch.h" -PUBLIC BOOLEAN ROMlib_dirtyvariant = FALSE; +using namespace Executor; -boolean_t system_file_version_skew_p; +PUBLIC BOOLEAN Executor::ROMlib_dirtyvariant = FALSE; + +boolean_t Executor::system_file_version_skew_p; static void exit_executor (void) @@ -53,7 +55,7 @@ exit_executor (void) } #if !defined (MSDOS) -PRIVATE char *reinstall = "System and %System"; +PRIVATE std::string reinstall = "System and %System"; #else PRIVATE char *reinstall = "EXSYSTEM.HFV"; #endif @@ -80,7 +82,7 @@ P0 (PUBLIC pascal trap, void, InitWindows) fprintf (stderr, "Can't open System file.\n" "This is very bad. You will have to reinstall %s" " before\n" - "Executor will work again.\n", reinstall); + "Executor will work again.\n", reinstall.c_str()); ROMlib_exit = TRUE; ExitToShell (); } @@ -328,7 +330,7 @@ P1(PUBLIC pascal trap, void, SetDeskCPat, PixPatHandle, ph) PaintOne((WindowPeek) 0, MR(GrayRgn)); } -void +static void ROMlib_new_window_common (WindowPeek w, int allocated_p, int cwindow_p, Rect *bounds, StringPtr title, BOOLEAN visible_p, @@ -344,7 +346,7 @@ ROMlib_new_window_common (WindowPeek w, title = (StringPtr) ""; /* thank MS Word for pointing this out */ if (!behind) { - WINDOW_NEXT_WINDOW_X (w) = CLC (0); + WINDOW_NEXT_WINDOW_X (w) = (WindowPeek)CLC (0); if (WindowList) { for (t_w = MR (WindowList); @@ -447,8 +449,8 @@ ROMlib_new_window_common (WindowPeek w, }); TextFont (applFont); - WINDOW_CONTROL_LIST_X (w) = CWC (0); - WINDOW_PIC_X (w) = CWC (0); + WINDOW_CONTROL_LIST_X (w) = (ControlHandle)CWC (0); + WINDOW_PIC_X (w) = (PicHandle)CWC (0); WINDOW_REF_CON_X (w) = CL (ref_con); WINDCALL ((WindowPtr) w, wNew, 0); if (WINDOW_VISIBLE_X (w)) diff --git a/src/windMisc.c b/src/windMisc.cpp similarity index 98% rename from src/windMisc.c rename to src/windMisc.cpp index 93b3b313..a6477e2a 100644 --- a/src/windMisc.c +++ b/src/windMisc.cpp @@ -25,6 +25,8 @@ char ROMlib_rcsid_windMisc[] = #include "rsys/evil.h" #include "rsys/executor.h" +using namespace Executor; + PRIVATE boolean_t is_window_ptr (WindowPeek w) { @@ -441,7 +443,7 @@ P1(PUBLIC pascal trap, INTEGER, GetWVariant, WindowPtr, w) /* IMV-208 */ void -CALLDRAGHOOK (void) +Executor::CALLDRAGHOOK (void) { if (DragHook) { LONGINT saved0, saved1, saved2, saved3, @@ -472,7 +474,7 @@ CALLDRAGHOOK (void) void -WINDCALLDESKHOOK (void) +Executor::WINDCALLDESKHOOK (void) { LONGINT saved0, saved1, saved2, saved3, savea0, savea1, savea2, savea3; ROMlib_hook(wind_deskhooknumber); @@ -497,11 +499,11 @@ WINDCALLDESKHOOK (void) } #if defined (EVIL_ILLUSTRATOR_7_HACK) -PUBLIC BOOLEAN ROMlib_evil_illustrator_7_hack = FALSE; +PUBLIC BOOLEAN Executor::ROMlib_evil_illustrator_7_hack = FALSE; #endif int32 -ROMlib_windcall (WindowPtr wind, int16 mess, int32 param) +Executor::ROMlib_windcall (WindowPtr wind, int16 mess, int32 param) { Handle defproc; int32 retval; diff --git a/src/windMouse.c b/src/windMouse.cpp similarity index 97% rename from src/windMouse.c rename to src/windMouse.cpp index 89ac60ec..de262033 100644 --- a/src/windMouse.c +++ b/src/windMouse.cpp @@ -20,6 +20,8 @@ char ROMlib_rcsid_windMouse[] = #include "rsys/wind.h" #include "rsys/menu.h" +using namespace Executor; + #if !defined (No_STEF_zoommods) /* WINDOW_ZOOMED returns TRUE if w is currently in stdState (big) */ @@ -62,6 +64,12 @@ P2(PUBLIC pascal trap, INTEGER, FindWindow, Point, p, HIDDEN_WindowPtr *, wpp) return retval; } +namespace Executor { + PRIVATE BOOLEAN xTrackBox(WindowPtr wp, Point pt, + INTEGER part); + +} + A3(PRIVATE, BOOLEAN, xTrackBox, WindowPtr, wp, Point, pt, INTEGER, part) /* IMIV-50 */ { diff --git a/src/windSize.c b/src/windSize.cpp similarity index 99% rename from src/windSize.c rename to src/windSize.cpp index 62abdc53..338e9305 100644 --- a/src/windSize.c +++ b/src/windSize.cpp @@ -21,6 +21,8 @@ char ROMlib_rcsid_windSize[] = #include "rsys/cquick.h" #include "rsys/wind.h" +using namespace Executor; + /* * Note, the code below probably be rewritten to use XorRgn as much * as possible and probably have only one CalcVisBehind diff --git a/src/windUpdate.c b/src/windUpdate.cpp similarity index 97% rename from src/windUpdate.c rename to src/windUpdate.cpp index 0dbfc413..2cd06630 100644 --- a/src/windUpdate.c +++ b/src/windUpdate.cpp @@ -15,6 +15,8 @@ char ROMlib_rcsid_windUpdate[] = #include "rsys/cquick.h" #include "rsys/wind.h" +using namespace Executor; + P1(PUBLIC pascal trap, void, InvalRect, Rect *, r) { if (thePort) @@ -74,7 +76,7 @@ P1(PUBLIC pascal trap, void, ValidRgn, RgnHandle, r) CW (PORT_BOUNDS (thePort).top)); } -PUBLIC int ROMlib_emptyvis = 0; +PUBLIC int Executor::ROMlib_emptyvis = 0; P1(PUBLIC pascal trap, void, BeginUpdate, WindowPtr, w) { diff --git a/src/xdata.c b/src/xdata.cpp similarity index 97% rename from src/xdata.c rename to src/xdata.cpp index b8f25a95..ce76769f 100644 --- a/src/xdata.c +++ b/src/xdata.cpp @@ -18,8 +18,10 @@ char ROMlib_rcsid_xdata[] = #include "rsys/vdriver.h" +using namespace Executor; + boolean_t -update_xdata_if_needed (xdata_handle_t xh, PixPat *pixpat, +Executor::update_xdata_if_needed (xdata_handle_t xh, PixPat *pixpat, PixMap *dest) { xdata_t *x; @@ -103,7 +105,7 @@ raw_bits_for_pattern (const Pattern pattern, PixMap *target, pattern_pixmap_tmpl.baseAddr = RM ((Ptr) &pattern[0]); fg_bk_ctab = validate_fg_bk_ctab (); pattern_pixmap_tmpl.pmTable = RM (ROMlib_bw_ctab); - conv_table = alloca (CTAB_STORAGE_FOR_SIZE (1)); + conv_table = (CTabPtr)alloca (CTAB_STORAGE_FOR_SIZE (1)); conv_table->ctSeed = CTAB_SEED_X (fg_bk_ctab); conv_table->ctFlags = CWC (0); conv_table->ctSize = CWC (1); @@ -440,7 +442,7 @@ xdata_for_raw_data (PixMap *target, xdata_t *x, uint32 *raw_bits, xdata_handle_t -xdata_for_pixpat_with_space (PixPat *pixpat, PixMap *target, +Executor::xdata_for_pixpat_with_space (PixPat *pixpat, PixMap *target, xdata_handle_t xh) { uint32 *raw_bits; @@ -479,7 +481,7 @@ xdata_for_pixpat_with_space (PixPat *pixpat, PixMap *target, xdata_handle_t -xdata_for_pattern (const Pattern pattern, PixMap *target) +Executor::xdata_for_pattern (const Pattern pattern, PixMap *target) { xdata_handle_t xh; @@ -502,7 +504,7 @@ xdata_for_pattern (const Pattern pattern, PixMap *target) void -xdata_free (xdata_handle_t xh) +Executor::xdata_free (xdata_handle_t xh) { boolean_t xdata_valid_p; diff --git a/src/xdblt.c b/src/xdblt.cpp similarity index 98% rename from src/xdblt.c rename to src/xdblt.cpp index c3b0e211..e8776f54 100644 --- a/src/xdblt.c +++ b/src/xdblt.cpp @@ -27,6 +27,7 @@ char ROMlib_rcsid_xdblt[] = #include "rsys/host.h" #include "rsys/autorefresh.h" +using namespace Executor; /* Holds the four-byte pattern value, for "short & narrow" patterns. */ uint32 xdblt_pattern_value asm ("_xdblt_pattern_value"); @@ -89,13 +90,13 @@ const uint32 xdblt_mask_array[32] asm ("_xdblt_mask_array") = /* Since we map all modes to one of { copy, or, xor, and }, sometimes we * need to flip the pattern bits. This table tells us when to do that. */ -static const uint32 flip_mask_for_mode[8] = { 0, 0, 0, ~0, ~0, ~0, ~0, 0 }; +static const uint32 flip_mask_for_mode[8] = { 0, 0, 0, ~(uint32)0, ~(uint32)0, ~(uint32)0, ~(uint32)0, 0 }; /* This macro rotates the specified 32 bit value right by the given * number of bits and modifies the input value. It can only be called * if 0 < count < 32; otherwise, the result is undefined. */ -#if defined (i386) +#if defined (__x86_64__) #define RORL(count, n) \ asm ("rorl %%cl,%0" : "=g" (n) : "c" (count), "0" (n) : "cc"); #elif defined (mc68000) @@ -194,7 +195,7 @@ INTEGER phony_special_region[7] = * are 0 or ~0 at any bpp, 0xA1A1A1A1 at 8bpp, 0x55555555 at 2bpp, etc. */ boolean_t -xdblt_xdata_norgb_norotate (RgnHandle rh, int mode, +Executor::xdblt_xdata_norgb_norotate (RgnHandle rh, int mode, int pat_x_rotate_count, int pat_y_rotate_count, xdata_t *x, PixMap *dst) { @@ -315,7 +316,7 @@ ind_mode_to_rgb_mode[8] = boolean_t -xdblt_xdata_short_narrow (RgnHandle rh, int mode, +Executor::xdblt_xdata_short_narrow (RgnHandle rh, int mode, int pat_x_rotate_count, int pat_y_rotate_count, xdata_t *x, PixMap *dst) { @@ -432,7 +433,7 @@ rotate_and_flip_xdata (xdata_t *x, int xrot, uint32 flip_mask) * byte order. */ - scratch = alloca (x->byte_size); + scratch = (uint8*)alloca (x->byte_size); e = (uint8 *) xdblt_pattern_end; bs = xrot >> 3; @@ -487,7 +488,7 @@ rotate_and_flip_xdata (xdata_t *x, int xrot, uint32 flip_mask) boolean_t -xdblt_xdata_complex (RgnHandle rh, int mode, +Executor::xdblt_xdata_complex (RgnHandle rh, int mode, int pat_x_rotate_count, int pat_y_rotate_count, xdata_t *x, PixMap *dst) { @@ -760,7 +761,7 @@ canonicalize_pat_value_for_mode (uint32 v, int mode, uint32 fg_color, boolean_t -xdblt_pattern (RgnHandle rh, int mode, +Executor::xdblt_pattern (RgnHandle rh, int mode, int pat_x_rotate_count, int pat_y_rotate_count, const Pattern pattern, PixMap *dst, uint32 fg_color, uint32 bk_color) From 64993912f82fbd89657d6ecbab8ee2660b51aa8d Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sun, 3 Aug 2014 17:04:27 -0600 Subject: [PATCH 004/390] Get it to actually build and link. --- CocoaExecutor.xcodeproj/project.pbxproj | 47 +++++++++++++------------ src/makerawblt.pl | 2 +- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/CocoaExecutor.xcodeproj/project.pbxproj b/CocoaExecutor.xcodeproj/project.pbxproj index f992d273..992669ff 100644 --- a/CocoaExecutor.xcodeproj/project.pbxproj +++ b/CocoaExecutor.xcodeproj/project.pbxproj @@ -2593,12 +2593,13 @@ files = ( ); inputPaths = ( - "$(SRCROOT)/CocoaExecutor/Templates/pat-blitters.tmpl", - "$(SRCROOT)/CocoaExecutor/Templates/src-blitters.tmpl", + "$(SRCROOT)/src/pat-blitters.tmpl", + "$(SRCROOT)/src/src-blitters.tmpl", "${TARGET_BUILD_DIR}/mkexpandtables", "${TARGET_BUILD_DIR}/mksspairtable", "${TARGET_BUILD_DIR}/mkultable", "${TARGET_BUILD_DIR}/mkseedtables", + "$(SRCROOT)/src/makerawblt.pl", ); name = "Generate Tables"; outputPaths = ( @@ -2611,7 +2612,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "${TARGET_BUILD_DIR}/mkseedtables > \"${DERIVED_FILE_DIR}/seedtables.ctable\"\n${TARGET_BUILD_DIR}/mkultable > \"${DERIVED_FILE_DIR}/ultable.ctable\"\n${TARGET_BUILD_DIR}/mksspairtable > \"${DERIVED_FILE_DIR}/sspairtable.ctable\"\n${TARGET_BUILD_DIR}/mkexpandtables > \"${DERIVED_FILE_DIR}/expandtables.ctable\"\n\nperl CocoaExecutor/makerawblt.pl < CocoaExecutor/Templates/pat-blitters.tmpl >\"${DERIVED_FILE_DIR}\"/rawpatstubs.ctable\nperl CocoaExecutor/makerawblt.pl < CocoaExecutor/Templates/src-blitters.tmpl >\"${DERIVED_FILE_DIR}\"/rawsrcstubs.ctable"; + shellScript = "${TARGET_BUILD_DIR}/mkseedtables > \"${DERIVED_FILE_DIR}/seedtables.ctable\"\n${TARGET_BUILD_DIR}/mkultable > \"${DERIVED_FILE_DIR}/ultable.ctable\"\n${TARGET_BUILD_DIR}/mksspairtable > \"${DERIVED_FILE_DIR}/sspairtable.ctable\"\n${TARGET_BUILD_DIR}/mkexpandtables > \"${DERIVED_FILE_DIR}/expandtables.ctable\"\n\nperl src/makerawblt.pl < src/pat-blitters.tmpl >\"${DERIVED_FILE_DIR}\"/rawpatstubs.ctable\nperl src/makerawblt.pl < src/src-blitters.tmpl >\"${DERIVED_FILE_DIR}\"/rawsrcstubs.ctable"; }; /* End PBXShellScriptBuildPhase section */ @@ -3087,7 +3088,7 @@ "DEBUG=1", "$(inherited)", ); - INFOPLIST_FILE = rsys/Info.plist; + INFOPLIST_FILE = src/include/rsys/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; @@ -3111,7 +3112,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_VERSION = A; - INFOPLIST_FILE = rsys/Info.plist; + INFOPLIST_FILE = src/include/rsys/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; @@ -3216,19 +3217,19 @@ CLANG_ENABLE_OBJC_ARC = NO; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "CocoaExecutor/CocoaExecutor-Prefix.pch"; + GCC_PREFIX_HEADER = "OSX-only/CocoaExecutor/CocoaExecutor-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( Sound_MACOSX_, _DARWIN_NO_64_BIT_INODE, "$(inherited)", ); HEADER_SEARCH_PATHS = ( - syn68k, + "OSX-only/syn68k", "$(inherited)", ); - INFOPLIST_FILE = "CocoaExecutor/CocoaExecutor-Info.plist"; + INFOPLIST_FILE = "OSX-only/CocoaExecutor/CocoaExecutor-Info.plist"; PRODUCT_NAME = NeoClassic; - USER_HEADER_SEARCH_PATHS = CocoaExecutor; + USER_HEADER_SEARCH_PATHS = "OSX-only/CocoaExecutor src/include"; WRAPPER_EXTENSION = app; }; name = Debug; @@ -3241,20 +3242,20 @@ CLANG_ENABLE_OBJC_ARC = NO; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "CocoaExecutor/CocoaExecutor-Prefix.pch"; + GCC_PREFIX_HEADER = "OSX-only/CocoaExecutor/CocoaExecutor-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( Sound_MACOSX_, _DARWIN_NO_64_BIT_INODE, "$(inherited)", ); HEADER_SEARCH_PATHS = ( - syn68k, + "OSX-only/syn68k", "$(inherited)", ); - INFOPLIST_FILE = "CocoaExecutor/CocoaExecutor-Info.plist"; + INFOPLIST_FILE = "OSX-only/CocoaExecutor/CocoaExecutor-Info.plist"; LLVM_LTO = NO; PRODUCT_NAME = NeoClassic; - USER_HEADER_SEARCH_PATHS = CocoaExecutor; + USER_HEADER_SEARCH_PATHS = "OSX-only/CocoaExecutor src/include"; WRAPPER_EXTENSION = app; }; name = Release; @@ -3276,7 +3277,7 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = ( - syn68k, + "OSX-only/syn68k", "$(inherited)", ); INFOPLIST_FILE = "CocoaExecutorTests/CocoaExecutorTests-Info.plist"; @@ -3300,7 +3301,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "CocoaExecutor/CocoaExecutor-Prefix.pch"; HEADER_SEARCH_PATHS = ( - syn68k, + "OSX-only/syn68k", "$(inherited)", ); INFOPLIST_FILE = "CocoaExecutorTests/CocoaExecutorTests-Info.plist"; @@ -3320,12 +3321,12 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = ( - syn68k, + "OSX-only/syn68k", "$(inherited)", ); ONLY_ACTIVE_ARCH = NO; PRODUCT_NAME = "$(TARGET_NAME)"; - USER_HEADER_SEARCH_PATHS = CocoaExecutor; + USER_HEADER_SEARCH_PATHS = "OSX-only/CocoaExecutor src/include"; }; name = Debug; }; @@ -3334,12 +3335,12 @@ buildSettings = { ARCHS = "$(NATIVE_ARCH_ACTUAL)"; HEADER_SEARCH_PATHS = ( - syn68k, + "OSX-only/syn68k", "$(inherited)", ); ONLY_ACTIVE_ARCH = NO; PRODUCT_NAME = "$(TARGET_NAME)"; - USER_HEADER_SEARCH_PATHS = CocoaExecutor; + USER_HEADER_SEARCH_PATHS = "OSX-only/CocoaExecutor src/include"; }; name = Release; }; @@ -3463,7 +3464,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; HEADER_SEARCH_PATHS = ( - syn68k, + "OSX-only/syn68k", "$(inherited)", ); MTL_ENABLE_DEBUG_INFO = YES; @@ -3479,7 +3480,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; HEADER_SEARCH_PATHS = ( - syn68k, + "OSX-only/syn68k", "$(inherited)", ); MTL_ENABLE_DEBUG_INFO = NO; @@ -3499,7 +3500,7 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = ( - syn68k, + "OSX-only/syn68k", "$(inherited)", ); MTL_ENABLE_DEBUG_INFO = YES; @@ -3518,7 +3519,7 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = ( - syn68k, + "OSX-only/syn68k", "$(inherited)", ); MTL_ENABLE_DEBUG_INFO = NO; diff --git a/src/makerawblt.pl b/src/makerawblt.pl index 65a8b1c4..40b90828 100755 --- a/src/makerawblt.pl +++ b/src/makerawblt.pl @@ -226,7 +226,7 @@ sub process_mode { $this_label_array .= " \&\&$mask_label,\n"; $this_label_array .= " \&\&done,\n"; - $this_label_array .= " $prefix" . "_func_$func_number,\n"; + $this_label_array .= " (void*) $prefix" . "_func_$func_number,\n"; if (defined ($label_arrays_seen{$this_label_array})) { $index = $label_arrays_seen{$this_label_array}; From ff414e9ef7ed9bf447841e1d290e7aa77621726f Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Mon, 4 Aug 2014 14:38:32 -0600 Subject: [PATCH 005/390] Initial Mac bridge to the Speech Synthesis methods. --- CocoaExecutor.xcodeproj/project.pbxproj | 12 ++ src/SpeechManager-MacBridge.cpp | 247 ++++++++++++++++++++++++ src/SpeechManager-MacBridge.h | 66 +++++++ src/SpeechManager.cpp | 243 +++++++++++++++++++++++ src/include/SpeechManager.h | 108 +++++++++++ 5 files changed, 676 insertions(+) create mode 100644 src/SpeechManager-MacBridge.cpp create mode 100644 src/SpeechManager-MacBridge.h create mode 100644 src/SpeechManager.cpp create mode 100644 src/include/SpeechManager.h diff --git a/CocoaExecutor.xcodeproj/project.pbxproj b/CocoaExecutor.xcodeproj/project.pbxproj index 992669ff..793841b7 100644 --- a/CocoaExecutor.xcodeproj/project.pbxproj +++ b/CocoaExecutor.xcodeproj/project.pbxproj @@ -463,6 +463,8 @@ 559AF4A5198AC9AB00DE8472 /* rsys.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 556062F21988679400D6F0B2 /* rsys.framework */; }; 559AF4B5198AE0F400DE8472 /* mkexpandtables.c in Sources */ = {isa = PBXBuildFile; fileRef = 559AF4B4198AE0F400DE8472 /* mkexpandtables.c */; }; 559AF4B8198AF72B00DE8472 /* segment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B991E1987FCBE00ADF159 /* segment.cpp */; }; + 559D530D198FFA44009E479A /* SpeechManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 559D530B198FFA44009E479A /* SpeechManager.cpp */; }; + 559D5311198FFAE1009E479A /* SpeechManager-MacBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 559D530F198FFAE1009E479A /* SpeechManager-MacBridge.cpp */; }; 55A742A2198D79DD00F1A8A5 /* SoundOSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55A742A0198D79DD00F1A8A5 /* SoundOSX.cpp */; }; 55A742A8198D819E00F1A8A5 /* FileDouble-OSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55A742A6198D819E00F1A8A5 /* FileDouble-OSX.cpp */; }; 55A742AB198DB05100F1A8A5 /* emustubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98851987FCBD00ADF159 /* emustubs.cpp */; }; @@ -1171,6 +1173,10 @@ 559AF4A1198AC90F00DE8472 /* stub.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stub.c; sourceTree = ""; }; 559AF4AD198AE03000DE8472 /* mkexpandtables */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mkexpandtables; sourceTree = BUILT_PRODUCTS_DIR; }; 559AF4B4198AE0F400DE8472 /* mkexpandtables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mkexpandtables.c; sourceTree = ""; }; + 559D530B198FFA44009E479A /* SpeechManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechManager.cpp; sourceTree = ""; }; + 559D530E198FFA6A009E479A /* SpeechManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechManager.h; sourceTree = ""; }; + 559D530F198FFAE1009E479A /* SpeechManager-MacBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "SpeechManager-MacBridge.cpp"; sourceTree = ""; }; + 559D5310198FFAE1009E479A /* SpeechManager-MacBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SpeechManager-MacBridge.h"; sourceTree = ""; }; 55A742A0198D79DD00F1A8A5 /* SoundOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SoundOSX.cpp; sourceTree = ""; }; 55A742A1198D79DD00F1A8A5 /* SoundOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoundOSX.h; sourceTree = ""; }; 55A742A6198D819E00F1A8A5 /* FileDouble-OSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "FileDouble-OSX.cpp"; sourceTree = ""; }; @@ -1306,6 +1312,7 @@ 5500AB611985B31E00FF62C0 /* Executor-Mac headers */ = { isa = PBXGroup; children = ( + 559D530E198FFA6A009E479A /* SpeechManager.h */, 5500AB621985B31E00FF62C0 /* ADB.h */, 5500AB631985B31E00FF62C0 /* AliasMgr.h */, 5500AB641985B31E00FF62C0 /* AppleEvents.h */, @@ -2086,6 +2093,9 @@ 558B99481987FCBE00ADF159 /* virtualint.cpp */, 551EE33A198D5E1E004A3A41 /* Window Sources */, 557F30D419898513009873EB /* CBridge.cpp */, + 559D530B198FFA44009E479A /* SpeechManager.cpp */, + 559D5310198FFAE1009E479A /* SpeechManager-MacBridge.h */, + 559D530F198FFAE1009E479A /* SpeechManager-MacBridge.cpp */, ); indentWidth = 2; name = "Executor-Mac sources"; @@ -2879,6 +2889,7 @@ 558B9A221987FCBF00ADF159 /* snth5.cpp in Sources */, 558B996B1987FCBF00ADF159 /* ctlMouse.cpp in Sources */, 558B9A3A1987FCBF00ADF159 /* teScrap.cpp in Sources */, + 559D530D198FFA44009E479A /* SpeechManager.cpp in Sources */, 556E0562198584DE00FC4362 /* zoom.map in Sources */, 558B99AC1987FCBF00ADF159 /* image_inits.cpp in Sources */, 558B9A311987FCBF00ADF159 /* teAccess.cpp in Sources */, @@ -2898,6 +2909,7 @@ 558B99821987FCBF00ADF159 /* dump.cpp in Sources */, 558B9A371987FCBF00ADF159 /* teInsert.cpp in Sources */, 556E0558198584DE00FC4362 /* arrow_down_inactive.map in Sources */, + 559D5311198FFAE1009E479A /* SpeechManager-MacBridge.cpp in Sources */, 558B9A081987FCBF00ADF159 /* qText.cpp in Sources */, 558B9A381987FCBF00ADF159 /* teMisc.cpp in Sources */, 553B0B6C19888B690041B809 /* hfsHelper.cpp in Sources */, diff --git a/src/SpeechManager-MacBridge.cpp b/src/SpeechManager-MacBridge.cpp new file mode 100644 index 00000000..14b81a6a --- /dev/null +++ b/src/SpeechManager-MacBridge.cpp @@ -0,0 +1,247 @@ +// +// SpeechManager-MacBridge.cpp +// CocoaExecutor +// +// Created by C.W. Betts on 8/4/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#include +#include "rsys/common.h" +#include "MemoryMgr.h" +#include "SpeechManager-MacBridge.h" + +Executor::NumVersion MacBridge::SpeechManagerVersion (void) +{ + ::NumVersion theVers = ::SpeechManagerVersion(); + return theVers.majorRev << 24 | theVers.minorAndBugRev << 16 | theVers.stage << 8 | theVers.nonRelRev; +} + +int16 MacBridge::SpeechBusy (void) +{ + SInt16 toRet = ::SpeechBusy(); + return CW(toRet); +} + +int16 MacBridge::SpeechBusySystemWide(void) +{ + SInt16 toRet = ::SpeechBusySystemWide(); + return CW(toRet); +} + +Executor::OSErr MacBridge::CountVoices (int16 *numVoices) +{ + if (!numVoices) { + return CW((Executor::OSErr)paramErr); + } + SInt16 voiceCount = 0; + ::OSErr toRet = ::CountVoices(&voiceCount); + + *numVoices = CW(voiceCount); + return CW(toRet); + return noErr; + +} + +Executor::OSErr MacBridge::DisposeSpeechChannel (Executor::SpeechChannel chan) +{ + return noErr; + +} + +Executor::OSErr MacBridge::SpeakString (Executor::Str255 textToBeSpoken) +{ + ::OSErr toRet = ::SpeakString(textToBeSpoken); + + return CW(toRet); +} + +Executor::OSErr MacBridge::StopSpeech (Executor::SpeechChannel chan) +{ + ::OSErr toRet = ::StopSpeech((::SpeechChannel)chan); + + return CW(toRet); + +} + +Executor::OSErr MacBridge::ContinueSpeech (Executor::SpeechChannel chan) +{ + ::OSErr toRet = ::StopSpeech((::SpeechChannel)chan); + + return CW(toRet); +} + +static inline void MacVoiceSpecToExecutorVoiceSpec(Executor::VoiceSpec* ExecutorVoice, ::VoiceSpec *MacVoice) +{ + ExecutorVoice->creator = CL(MacVoice->creator); + ExecutorVoice->id = CL(MacVoice->id); +} + +Executor::OSErr MacBridge::GetIndVoice (int16 index, Executor::VoiceSpec *voice) +{ + ::VoiceSpec macVoice = {0}; + if (!voice) { + return CW((Executor::OSErr)paramErr); + } + ::OSErr toRet = ::GetIndVoice(CW(index), &macVoice); + + MacVoiceSpecToExecutorVoiceSpec(voice, &macVoice); + + return CW(toRet); +} + +Executor::OSErr MacBridge::NewSpeechChannel (Executor::VoiceSpec *voice, Executor::SpeechChannel *chan) +{ + return noErr; + +} + +Executor::OSErr MacBridge::StopSpeechAt (Executor::SpeechChannel chan, int32 whereToStop) +{ + ::OSErr toRet = ::StopSpeechAt((::SpeechChannel)chan, CL(whereToStop)); + + return CW(toRet); +} + +Executor::OSErr MacBridge::PauseSpeechAt (Executor::SpeechChannel chan, int32 whereToPause) +{ + ::OSErr toRet = ::PauseSpeechAt((::SpeechChannel)chan, CL(whereToPause)); + + return CW(toRet); +} + +Executor::OSErr MacBridge::SetSpeechRate(Executor::SpeechChannel chan, Executor::Fixed rate) +{ + ::OSErr toRet = ::SetSpeechRate((::SpeechChannel)chan, CL(rate)); + + return CW(toRet); +} + +PUBLIC Executor::OSErr MacBridge::GetSpeechRate (Executor::SpeechChannel chan, Executor::Fixed *rate) +{ + if (!rate) { + return CW((Executor::OSErr)paramErr); + } + ::OSErr toRet; + ::Fixed ourFixed = CL(*rate); + toRet = ::GetSpeechRate((::SpeechChannel)chan, &ourFixed); + *rate = CL(ourFixed); + + return CW(toRet); +} + +Executor::OSErr MacBridge::SetSpeechPitch (Executor::SpeechChannel chan, Executor::Fixed pitch) +{ + ::OSErr toRet = ::SetSpeechPitch((::SpeechChannel)chan, CL(pitch)); + + return CW(toRet); +} + +Executor::OSErr MacBridge::GetSpeechPitch (Executor::SpeechChannel chan, Executor::Fixed *pitch) +{ + if (!pitch) { + return CW((Executor::OSErr)paramErr); + } + ::OSErr toRet; + ::Fixed ourFixed = CL(*pitch); + toRet = ::GetSpeechRate((::SpeechChannel)chan, &ourFixed); + *pitch = CL(ourFixed); + + return CW(toRet); +} + +#undef NewHandle + +Executor::OSErr MacBridge::UseDictionary (Executor::SpeechChannel chan, Executor::Handle dictionary) +{ + ::Size ExecSize = CL(Executor::GetHandleSize(dictionary)); + ::Handle nativeHandle = ::NewHandle(ExecSize); + memcpy(*nativeHandle, dictionary->p, ExecSize); + + ::OSErr toRet = ::UseDictionary((::SpeechChannel)chan, nativeHandle); + + ::DisposeHandle(nativeHandle); + + return CW(toRet); + +} + +Executor::OSErr MacBridge::MakeVoiceSpec (Executor::OSType creator, Executor::OSType id, Executor::VoiceSpec *voice) +{ + if (!voice) { + return CW((Executor::OSErr)paramErr); + } + ::VoiceSpec nativeSpec = {0}; + ::OSErr toRet = ::MakeVoiceSpec(CL(creator), CL(id), &nativeSpec); + MacVoiceSpecToExecutorVoiceSpec(voice, &nativeSpec); + + return CW(toRet); +} + +Executor::OSErr MacBridge::GetVoiceDescription ( + const Executor::VoiceSpec *voice, + Executor::VoiceDescription *info, + Executor::LONGINT infoLength + ) +{ + return noErr; + +} + +Executor::OSErr MacBridge::GetVoiceInfo (const Executor::VoiceSpec *voice, Executor::OSType selector, void *voiceInfo) +{ + // TODO: handle different data types + ::OSErr toRet = ::GetVoiceInfo((const ::VoiceSpec*)voice, CL(selector), voiceInfo); + + return CW(toRet); +} + +Executor::OSErr MacBridge::SpeakText (Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes) +{ + ::OSErr toRet = ::SpeakText((::SpeechChannel)chan, textBuf, CL(textBytes)); + + return CW(toRet); +} + +Executor::OSErr MacBridge::SetSpeechInfo ( + Executor::SpeechChannel chan, + Executor::OSType selector, + const void *speechInfo + ) +{ + // TODO: handle different data types + ::OSErr toRet = ::SetSpeechInfo((::SpeechChannel)chan, CL(selector), speechInfo); + + return CW(toRet); +} + +Executor::OSErr MacBridge::GetSpeechInfo ( + Executor::SpeechChannel chan, + Executor::OSType selector, + void *speechInfo + ) +{ + // TODO: handle different data types + ::OSErr toRet = ::GetSpeechInfo((::SpeechChannel)chan, CL(selector), speechInfo); + + return CW(toRet); +} + +Executor::OSErr MacBridge::SpeakBuffer ( + Executor::SpeechChannel chan, + const void *textBuf, + Executor::ULONGINT textBytes, + int32 controlFlags + ) +{ + ::OSErr toRet = ::SpeakBuffer((::SpeechChannel)chan, textBuf, CL(textBytes), CL(controlFlags)); + + return CW(toRet); +} + +Executor::OSErr MacBridge::TextToPhonemes (Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes, Executor::Handle phonemeBuf, Executor::LONGINT *phonemeBytes) +{ + return noErr; +} + + diff --git a/src/SpeechManager-MacBridge.h b/src/SpeechManager-MacBridge.h new file mode 100644 index 00000000..18eeab0c --- /dev/null +++ b/src/SpeechManager-MacBridge.h @@ -0,0 +1,66 @@ +// +// SpeechManager-MacBridge.h +// CocoaExecutor +// +// Created by C.W. Betts on 8/4/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#ifndef __CocoaExecutor__SpeechManager_MacBridge__ +#define __CocoaExecutor__SpeechManager_MacBridge__ + +#include "SpeechManager.h" + +namespace MacBridge { + PUBLIC Executor::NumVersion SpeechManagerVersion (void); + PUBLIC int16 SpeechBusy (void); + PUBLIC int16 SpeechBusySystemWide(void); + PUBLIC Executor::OSErr CountVoices (int16 *numVoices); + PUBLIC Executor::OSErr DisposeSpeechChannel (Executor::SpeechChannel chan); + PUBLIC Executor::OSErr SpeakString (Executor::Str255 textToBeSpoken); + + PUBLIC Executor::OSErr StopSpeech (Executor::SpeechChannel chan); + PUBLIC Executor::OSErr ContinueSpeech (Executor::SpeechChannel chan); + + PUBLIC Executor::OSErr GetIndVoice (int16 index, Executor::VoiceSpec *voice); + PUBLIC Executor::OSErr NewSpeechChannel (Executor::VoiceSpec *voice, Executor::SpeechChannel *chan); + PUBLIC Executor::OSErr StopSpeechAt (Executor::SpeechChannel chan, int32 whereToStop); + PUBLIC Executor::OSErr PauseSpeechAt (Executor::SpeechChannel chan, int32 whereToPause); + PUBLIC Executor::OSErr SetSpeechRate(Executor::SpeechChannel chan, Executor::Fixed rate); + PUBLIC Executor::OSErr GetSpeechRate (Executor::SpeechChannel chan, Executor::Fixed *rate); + PUBLIC Executor::OSErr SetSpeechPitch (Executor::SpeechChannel chan, Executor::Fixed pitch); + PUBLIC Executor::OSErr GetSpeechPitch (Executor::SpeechChannel chan, Executor::Fixed *pitch); + PUBLIC Executor::OSErr UseDictionary (Executor::SpeechChannel chan, Executor::Handle dictionary); + PUBLIC Executor::OSErr MakeVoiceSpec (Executor::OSType creator, Executor::OSType id, Executor::VoiceSpec *voice); + PUBLIC Executor::OSErr GetVoiceDescription ( + const Executor::VoiceSpec *voice, + Executor::VoiceDescription *info, + Executor::LONGINT infoLength + ); + PUBLIC Executor::OSErr GetVoiceInfo ( + const Executor::VoiceSpec *voice, + Executor::OSType selector, + void *voiceInfo + ); + PUBLIC Executor::OSErr SpeakText (Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes); + PUBLIC Executor::OSErr SetSpeechInfo ( + Executor::SpeechChannel chan, + Executor::OSType selector, + const void *speechInfo + ); + PUBLIC Executor::OSErr GetSpeechInfo ( + Executor::SpeechChannel chan, + Executor::OSType selector, + void *speechInfo + ); + PUBLIC Executor::OSErr SpeakBuffer ( + Executor::SpeechChannel chan, + const void *textBuf, + Executor::ULONGINT textBytes, + int32 controlFlags + ); + PUBLIC Executor::OSErr TextToPhonemes (Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes, Executor::Handle phonemeBuf, Executor::LONGINT *phonemeBytes); + +} + +#endif /* defined(__CocoaExecutor__SpeechManager_MacBridge__) */ diff --git a/src/SpeechManager.cpp b/src/SpeechManager.cpp new file mode 100644 index 00000000..df90a956 --- /dev/null +++ b/src/SpeechManager.cpp @@ -0,0 +1,243 @@ +// +// SpeechManager.cpp +// CocoaExecutor +// +// Created by C.W. Betts on 8/4/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#include "rsys/common.h" +#include "SpeechManager.h" +#include "rsys/error.h" + +#ifdef MACOSX_ +#include "SpeechManager-MacBridge.h" +#endif + +using namespace Executor; + +P0(PUBLIC pascal, NumVersion, SpeechManagerVersion) +{ +#ifdef MACOSX_ + return MacBridge::SpeechManagerVersion(); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P0(PUBLIC pascal, int16, SpeechBusy) +{ +#ifdef MACOSX_ + return MacBridge::SpeechBusy(); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P0(PUBLIC pascal, int16, SpeechBusySystemWide) +{ +#ifdef MACOSX_ + return MacBridge::SpeechBusySystemWide(); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P1(PUBLIC pascal, OSErr, CountVoices, int16 *, numVoices) +{ +#ifdef MACOSX_ + return MacBridge::CountVoices(numVoices); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P1(PUBLIC pascal, OSErr, DisposeSpeechChannel, SpeechChannel, chan) +{ +#ifdef MACOSX_ + return MacBridge::DisposeSpeechChannel(chan); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P1(PUBLIC pascal, OSErr, SpeakString, Str255, textToBeSpoken) +{ +#ifdef MACOSX_ + return MacBridge::SpeakString(textToBeSpoken); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P1(PUBLIC pascal, OSErr, StopSpeech, SpeechChannel, chan) +{ +#ifdef MACOSX_ + return MacBridge::StopSpeech(chan); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P1(PUBLIC pascal, OSErr, ContinueSpeech, SpeechChannel, chan) +{ +#ifdef MACOSX_ + return MacBridge::ContinueSpeech(chan); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P2(PUBLIC pascal, OSErr, GetIndVoice, int16, index, VoiceSpec *, voice) +{ +#ifdef MACOSX_ + return MacBridge::GetIndVoice(index, voice); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P2(PUBLIC pascal, OSErr, NewSpeechChannel, VoiceSpec *, voice, SpeechChannel *,chan) +{ +#ifdef MACOSX_ + return MacBridge::NewSpeechChannel(voice, chan); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P2(PUBLIC pascal, OSErr, StopSpeechAt, SpeechChannel, chan, int32, whereToStop) +{ +#ifdef MACOSX_ + return MacBridge::StopSpeechAt(chan, whereToStop); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P2(PUBLIC pascal, OSErr, PauseSpeechAt, SpeechChannel, chan, int32, whereToPause) +{ +#ifdef MACOSX_ + return MacBridge::PauseSpeechAt(chan, whereToPause); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P2(PUBLIC pascal, OSErr, SetSpeechRate, SpeechChannel, chan, Fixed, rate) +{ +#ifdef MACOSX_ + return MacBridge::SetSpeechRate(chan, rate); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P2(PUBLIC pascal, OSErr, GetSpeechRate, SpeechChannel, chan, Fixed *,rate) +{ +#ifdef MACOSX_ + return MacBridge::GetSpeechRate(chan, rate); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P2(PUBLIC pascal, OSErr, SetSpeechPitch, SpeechChannel, chan, Fixed, pitch) +{ +#ifdef MACOSX_ + return MacBridge::SetSpeechPitch(chan, pitch); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P2(PUBLIC pascal, OSErr, GetSpeechPitch, SpeechChannel, chan, Fixed *,pitch) +{ +#ifdef MACOSX_ + return MacBridge::GetSpeechPitch(chan, pitch); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P2(PUBLIC pascal, OSErr, UseDictionary, SpeechChannel, chan, Handle, dictionary) +{ +#ifdef MACOSX_ + return MacBridge::UseDictionary(chan, dictionary); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P3(PUBLIC pascal, OSErr, MakeVoiceSpec, OSType, creator, OSType, id, VoiceSpec *,voice) +{ +#ifdef MACOSX_ + return MacBridge::MakeVoiceSpec(creator, id, voice); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P3(PUBLIC pascal, OSErr, GetVoiceDescription, const VoiceSpec *,voice, VoiceDescription *,info, LONGINT, infoLength) +{ +#ifdef MACOSX_ + return MacBridge::GetVoiceDescription(voice, info, infoLength); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P3(PUBLIC pascal, OSErr, GetVoiceInfo, const VoiceSpec *,voice, OSType, selector, void *,voiceInfo) +{ +#ifdef MACOSX_ + return MacBridge::GetVoiceInfo(voice, selector, voiceInfo); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P3(PUBLIC pascal, OSErr, SpeakText, SpeechChannel, chan, const void *,textBuf, ULONGINT, textBytes) +{ +#ifdef MACOSX_ + return MacBridge::SpeakText(chan, textBuf, textBytes); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P3(PUBLIC pascal, OSErr, SetSpeechInfo, SpeechChannel, chan, OSType, selector, const void *, speechInfo) +{ +#ifdef MACOSX_ + return MacBridge::SetSpeechInfo(chan, selector, speechInfo); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P3(PUBLIC pascal, OSErr, GetSpeechInfo, SpeechChannel, chan, OSType, selector, void *, speechInfo) +{ +#ifdef MACOSX_ + return MacBridge::GetSpeechInfo(chan, selector, speechInfo); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P4(PUBLIC pascal, OSErr, SpeakBuffer, SpeechChannel, chan, const void *, textBuf, ULONGINT, textBytes, int32, controlFlags) +{ +#ifdef MACOSX_ + return MacBridge::SpeakBuffer(chan, textBuf, textBytes, controlFlags); +#else + warning_unimplemented (NULL_STRING); +#endif +} + +P5(PUBLIC pascal, OSErr, TextToPhonemes, SpeechChannel, chan, const void *,textBuf, ULONGINT, textBytes, Handle, phonemeBuf, LONGINT *,phonemeBytes) +{ +#ifdef MACOSX_ + return MacBridge::TextToPhonemes(chan, textBuf, textBytes, phonemeBuf, phonemeBytes); +#else + warning_unimplemented (NULL_STRING); +#endif +} + diff --git a/src/include/SpeechManager.h b/src/include/SpeechManager.h new file mode 100644 index 00000000..8dab0ca2 --- /dev/null +++ b/src/include/SpeechManager.h @@ -0,0 +1,108 @@ +// +// SpeechManager.h +// CocoaExecutor +// +// Created by C.W. Betts on 8/4/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#ifndef __CocoaExecutor__SpeechManager__ +#define __CocoaExecutor__SpeechManager__ + +#include "SoundMgr.h" +#include "FileMgr.h" + +namespace Executor { +#pragma pack(push, 2) + typedef struct VoiceSpec { + OSType creator; + OSType id; + } VoiceSpec, *VoiceSpecPtr; + + + typedef struct VoiceFileInfo { + FSSpec fileSpec; + short resID; + } VoiceFileInfo; + + typedef struct SpeechStatusInfo { + Boolean outputBusy; + Boolean outputPaused; + long inputBytesLeft; + short phonemeCode; + } SpeechStatusInfo; + + typedef struct VoiceDescription { + int32 length; + VoiceSpec voice; + int32 version; + Str63 name; + Str255 comment; + int16 gender; + int16 age; + int16 script; + int16 language; + int16 region; + int32 reserved[4]; + } VoiceDescription; + + typedef struct SpeechChannelRecord { + LONGINT data[1]; + } SpeechChannelRecord, *SpeechChannel; + + typedef struct PhonemeInfo { + short opcode; + Str15 phStr; + Str31 exampleStr; + short hiliteStart; + short hiliteEnd; + } PhonemeInfo; + + typedef struct PhonemeDescriptor { + short phonemeCount; + PhonemeInfo thePhonemes[1]; + } PhonemeDescriptor; + + typedef struct SpeechXtndData { + OSType synthCreator; + Byte synthData[2]; + } SpeechXtndData; + + typedef struct DelimiterInfo { + Byte startDelimiter[2]; + Byte endDelimiter[2]; + } DelimiterInfo; + + +#pragma pack(pop) + + PUBLIC pascal NumVersion C_SpeechManagerVersion (void); + PUBLIC pascal int16 C_SpeechBusy (void); + PUBLIC pascal int16 C_SpeechBusySystemWide(void); + PUBLIC pascal OSErr C_CountVoices (int16 *numVoices); + PUBLIC pascal OSErr C_DisposeSpeechChannel (SpeechChannel chan); + PUBLIC pascal OSErr C_SpeakString (Str255 textToBeSpoken); + + PUBLIC pascal OSErr C_StopSpeech (SpeechChannel chan); + PUBLIC pascal OSErr C_ContinueSpeech (SpeechChannel chan); + + PUBLIC pascal OSErr C_GetIndVoice (int16 index, VoiceSpec *voice); + PUBLIC pascal OSErr C_NewSpeechChannel (VoiceSpec *voice, SpeechChannel *chan); + PUBLIC pascal OSErr C_StopSpeechAt (SpeechChannel chan, int32 whereToStop); + PUBLIC pascal OSErr C_PauseSpeechAt (SpeechChannel chan, int32 whereToPause); + PUBLIC pascal OSErr C_SetSpeechRate(SpeechChannel chan, Fixed rate); + PUBLIC pascal OSErr C_GetSpeechRate (SpeechChannel chan, Fixed *rate); + PUBLIC pascal OSErr C_SetSpeechPitch (SpeechChannel chan, Fixed pitch); + PUBLIC pascal OSErr C_GetSpeechPitch (SpeechChannel chan, Fixed *pitch); + PUBLIC pascal OSErr C_UseDictionary (SpeechChannel chan, Handle dictionary); + PUBLIC pascal OSErr C_MakeVoiceSpec (OSType creator, OSType id, VoiceSpec *voice); + PUBLIC pascal OSErr C_GetVoiceDescription (const VoiceSpec *voice, VoiceDescription *info, LONGINT infoLength); + PUBLIC pascal OSErr C_GetVoiceInfo (const VoiceSpec *voice, OSType selector, void *voiceInfo); + PUBLIC pascal OSErr C_SpeakText (SpeechChannel chan, const void *textBuf, ULONGINT textBytes); + PUBLIC pascal OSErr C_SetSpeechInfo (SpeechChannel chan, OSType selector, const void *speechInfo); + PUBLIC pascal OSErr C_GetSpeechInfo (SpeechChannel chan, OSType selector, void *speechInfo); + PUBLIC pascal OSErr C_SpeakBuffer (SpeechChannel chan, const void *textBuf, ULONGINT textBytes, int32 controlFlags); + PUBLIC pascal OSErr C_TextToPhonemes (SpeechChannel chan, const void *textBuf, ULONGINT textBytes, Handle phonemeBuf, LONGINT *phonemeBytes); +} + +#endif /* defined(__CocoaExecutor__SpeechManager__) */ From 46b1fb3c843a07eb426cae07ad4e7036eb96fddd Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Mon, 4 Aug 2014 15:52:14 -0600 Subject: [PATCH 006/390] Some changes to the byte-swapping. --- OSX-only/CocoaExecutor/host-arch-config.h | 2 +- src/include/rsys/byteswap.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OSX-only/CocoaExecutor/host-arch-config.h b/OSX-only/CocoaExecutor/host-arch-config.h index 8b5424e2..6c6721d7 100644 --- a/OSX-only/CocoaExecutor/host-arch-config.h +++ b/OSX-only/CocoaExecutor/host-arch-config.h @@ -7,7 +7,7 @@ /* TODO: only do these if the compiler supports it, check to see if we can get a better swap16 w/o using builtin_bswap32 */ -#define swap16(v) ((uint16_t) (__builtin_bswap32 ((int32_t) (v)) >> 16)) +#define swap16(v) ((uint16_t) (__builtin_bswap16 ((int16_t)(v)))) #define swap32(v)((uint32_t) __builtin_bswap32 ((int32_t)(v))) diff --git a/src/include/rsys/byteswap.h b/src/include/rsys/byteswap.h index e444c4ad..9dd7412c 100644 --- a/src/include/rsys/byteswap.h +++ b/src/include/rsys/byteswap.h @@ -31,7 +31,7 @@ #else /* !defined (BIGENDIAN) */ -#define CW(n) ((typeof (n)) (long) swap16 ((unsigned short) (long) (n))) +#define CW(n) ((typeof (n)) swap16 ((unsigned short)(n))) #define CL(n) ((typeof (n)) swap32 ((unsigned int) ((n)|0))) #if 0 From e60b885974d56994785fdac9061176ad1a5fa21e Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Mon, 4 Aug 2014 18:52:21 -0600 Subject: [PATCH 007/390] Change some package stuff. --- OSX-only/CocoaExecutor/config.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OSX-only/CocoaExecutor/config.h b/OSX-only/CocoaExecutor/config.h index 99b785bb..c69064fb 100644 --- a/OSX-only/CocoaExecutor/config.h +++ b/OSX-only/CocoaExecutor/config.h @@ -83,19 +83,19 @@ #define PACKAGE "executorosx" /* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "computers57@hotmail.com" +#define PACKAGE_BUGREPORT "maddthesane@gmail.com" /* Define to the full name of this package. */ -#define PACKAGE_NAME "CocoaExecutor" +#define PACKAGE_NAME "NeoClassic" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "executor 2.1.17" +#define PACKAGE_STRING "executor 2.2.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "executor" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.1.17" +#define PACKAGE_VERSION "2.2.0" /* The size of `char *', as computed by sizeof. */ #define SIZEOF_CHAR_P 4 @@ -104,7 +104,7 @@ /* #undef STDC_HEADERS */ /* Version number of package */ -#define VERSION "2.1.17" +#define VERSION "2.2.0" /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ From 05d68fc9d04cf212f42157af977de5602184eeea Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Mon, 4 Aug 2014 18:54:38 -0600 Subject: [PATCH 008/390] Use pragma pack instead of the PACKED attribute. --- src/include/FileMgr.h | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/src/include/FileMgr.h b/src/include/FileMgr.h index d87663fb..48770634 100644 --- a/src/include/FileMgr.h +++ b/src/include/FileMgr.h @@ -152,7 +152,9 @@ enum diffVolErr = -1303, }; -typedef struct PACKED { +#pragma pack(push, 2) + +typedef struct { OSType fdType; OSType fdCreator; uint16_t fdFlags; @@ -160,21 +162,21 @@ typedef struct PACKED { uint16_t fdFldr; } FInfo; -typedef struct PACKED { +typedef struct { uint16_t fdIconID; uint16_t fdUnused[4]; uint16_t fdComment; LONGINT fdPutAway; } FXInfo; -typedef struct PACKED { +typedef struct { Rect frRect; uint16_t frFlags; Point frLocation; uint16_t frView; } DInfo; -typedef struct PACKED { +typedef struct { Point frScroll; LONGINT frOpenChain; uint16_t frUnused; @@ -199,7 +201,7 @@ typedef enum { PACKED_MEMBER(StringPtr, ioNamePtr); \ INTEGER ioVRefNum -typedef struct PACKED { +typedef struct { COMMONFSQUEUEDEFS; INTEGER ioRefNum; SignedByte ioVersNum; @@ -212,7 +214,7 @@ typedef struct PACKED { LONGINT ioPosOffset; } ioParam; -typedef struct PACKED { +typedef struct { COMMONFSQUEUEDEFS; INTEGER ioFRefNum; SignedByte ioFVersNum; @@ -232,7 +234,7 @@ typedef struct PACKED { LONGINT ioFlMdDat; } fileParam; -typedef struct PACKED { +typedef struct { COMMONFSQUEUEDEFS; LONGINT filler2; INTEGER ioVolIndex; @@ -250,7 +252,7 @@ typedef struct PACKED { uint16_t ioVFrBlk; } volumeParam; -typedef struct PACKED { +typedef struct { COMMONFSQUEUEDEFS; INTEGER ioCRefNum; INTEGER csCode; @@ -265,7 +267,7 @@ typedef union { } ParamBlockRec; typedef ParamBlockRec *ParmBlkPtr; -typedef struct PACKED { +typedef struct { COMMONFSQUEUEDEFS; INTEGER ioRefNum; SignedByte ioVersNum; @@ -278,7 +280,7 @@ typedef struct PACKED { LONGINT ioPosOffset; } HIoParam; -typedef struct PACKED { +typedef struct { COMMONFSQUEUEDEFS; INTEGER ioFRefNum; SignedByte ioFVersNum; @@ -298,7 +300,7 @@ typedef struct PACKED { LONGINT ioFlMdDat; } HFileParam; -typedef struct PACKED { +typedef struct { COMMONFSQUEUEDEFS; LONGINT pfiller2; INTEGER ioVolIndex; @@ -344,7 +346,7 @@ typedef enum { hfileInfo, dirInfo } CInfoType; SignedByte ioFlAttrib; \ SignedByte ioACUser -typedef struct PACKED { +typedef struct { COMMONCINFODEFS; FInfo ioFlFndrInfo; LONGINT ioDirID; @@ -362,7 +364,7 @@ typedef struct PACKED { LONGINT ioFlClpSiz; } HFileInfo; -typedef struct PACKED { +typedef struct { COMMONCINFODEFS; DInfo ioDrUsrWds; LONGINT ioDrDirID; @@ -381,7 +383,7 @@ typedef union { } CInfoPBRec; typedef CInfoPBRec *CInfoPBPtr; -typedef struct PACKED { +typedef struct { COMMONFSQUEUEDEFS; LONGINT filler1; PACKED_MEMBER(StringPtr, ioNewName); @@ -392,7 +394,7 @@ typedef struct PACKED { } CMovePBRec; typedef CMovePBRec *CMovePBPtr; -typedef struct PACKED { +typedef struct { COMMONFSQUEUEDEFS; uint16_t filler1; INTEGER ioWDIndex; @@ -403,7 +405,7 @@ typedef struct PACKED { } WDPBRec; typedef WDPBRec *WDPBPtr; -typedef struct PACKED { +typedef struct { COMMONFSQUEUEDEFS; INTEGER ioRefNum; uint16_t filler; @@ -421,7 +423,7 @@ typedef struct PACKED { } FCBPBRec; typedef FCBPBRec *FCBPBPtr; -typedef struct PACKED { +typedef struct { PACKED_MEMBER(QElemPtr, qLink); /* 0 */ INTEGER qType; /* 4 */ uint16_t vcbFlags; /* 6 */ @@ -472,7 +474,7 @@ typedef struct PACKED { typedef VCB *VCBPtr; MAKE_HIDDEN(VCBPtr); -typedef struct PACKED { +typedef struct { PACKED_MEMBER(QElemPtr, qLink); INTEGER qType; INTEGER dQDrive; @@ -485,7 +487,7 @@ typedef struct PACKED { /* data types introduced by the new high level file system dispatch traps */ -struct PACKED FSSpec +struct FSSpec { INTEGER vRefNum; LONGINT parID; @@ -512,6 +514,8 @@ extern INTEGER FSFCBLen; #define DefVCBPtr (DefVCBPtr_H.p) #define WDCBsPtr (WDCBsPtr_H.p) +#pragma pack(pop) + extern OSErr FSOpen( StringPtr filen, INTEGER vrn, INTEGER *rn ); extern OSErr OpenRF( StringPtr filen, INTEGER vrn, INTEGER *rn ); extern OSErr FSRead( INTEGER rn, LONGINT *count, Ptr buffp ); From 097c9c9e09b491091edf58e69d0fa05873426c48 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Mon, 4 Aug 2014 19:38:45 -0600 Subject: [PATCH 009/390] =?UTF-8?q?I=20didn=E2=80=99t=20implement=20a=20fe?= =?UTF-8?q?w=20functions=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SpeechManager-MacBridge.cpp | 39 ++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/src/SpeechManager-MacBridge.cpp b/src/SpeechManager-MacBridge.cpp index 14b81a6a..8ac80863 100644 --- a/src/SpeechManager-MacBridge.cpp +++ b/src/SpeechManager-MacBridge.cpp @@ -8,13 +8,27 @@ #include #include "rsys/common.h" +#include "rsys/hfs.h" #include "MemoryMgr.h" #include "SpeechManager-MacBridge.h" Executor::NumVersion MacBridge::SpeechManagerVersion (void) { +#if 0 + //The NumVersion struct on OS X is Endian-safe, so we can do this. +#pragma pack(push, 2) + union ourNumVers { + ::NumVersion MacVers; + Executor::NumVersion ExecutorVers; + } ourNumVersn; +#pragma pack(pop) + + ourNumVersn.MacVers = ::SpeechManagerVersion(); + return ourNumVersn.ExecutorVers; +#else ::NumVersion theVers = ::SpeechManagerVersion(); return theVers.majorRev << 24 | theVers.minorAndBugRev << 16 | theVers.stage << 8 | theVers.nonRelRev; +#endif } int16 MacBridge::SpeechBusy (void) @@ -32,7 +46,7 @@ int16 MacBridge::SpeechBusySystemWide(void) Executor::OSErr MacBridge::CountVoices (int16 *numVoices) { if (!numVoices) { - return CW((Executor::OSErr)paramErr); + return CWC((Executor::OSErr)paramErr); } SInt16 voiceCount = 0; ::OSErr toRet = ::CountVoices(&voiceCount); @@ -45,8 +59,9 @@ Executor::OSErr MacBridge::CountVoices (int16 *numVoices) Executor::OSErr MacBridge::DisposeSpeechChannel (Executor::SpeechChannel chan) { - return noErr; + ::OSErr toRet = ::DisposeSpeechChannel((::SpeechChannel)chan); + return CW(toRet); } Executor::OSErr MacBridge::SpeakString (Executor::Str255 textToBeSpoken) @@ -81,7 +96,7 @@ Executor::OSErr MacBridge::GetIndVoice (int16 index, Executor::VoiceSpec *voice) { ::VoiceSpec macVoice = {0}; if (!voice) { - return CW((Executor::OSErr)paramErr); + return CWC((Executor::OSErr)paramErr); } ::OSErr toRet = ::GetIndVoice(CW(index), &macVoice); @@ -120,7 +135,7 @@ Executor::OSErr MacBridge::SetSpeechRate(Executor::SpeechChannel chan, Executor: PUBLIC Executor::OSErr MacBridge::GetSpeechRate (Executor::SpeechChannel chan, Executor::Fixed *rate) { if (!rate) { - return CW((Executor::OSErr)paramErr); + return CWC((Executor::OSErr)paramErr); } ::OSErr toRet; ::Fixed ourFixed = CL(*rate); @@ -140,7 +155,7 @@ Executor::OSErr MacBridge::SetSpeechPitch (Executor::SpeechChannel chan, Executo Executor::OSErr MacBridge::GetSpeechPitch (Executor::SpeechChannel chan, Executor::Fixed *pitch) { if (!pitch) { - return CW((Executor::OSErr)paramErr); + return CWC((Executor::OSErr)paramErr); } ::OSErr toRet; ::Fixed ourFixed = CL(*pitch); @@ -163,7 +178,6 @@ Executor::OSErr MacBridge::UseDictionary (Executor::SpeechChannel chan, Executor ::DisposeHandle(nativeHandle); return CW(toRet); - } Executor::OSErr MacBridge::MakeVoiceSpec (Executor::OSType creator, Executor::OSType id, Executor::VoiceSpec *voice) @@ -241,7 +255,16 @@ Executor::OSErr MacBridge::SpeakBuffer ( Executor::OSErr MacBridge::TextToPhonemes (Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes, Executor::Handle phonemeBuf, Executor::LONGINT *phonemeBytes) { - return noErr; -} + ::Size ExecSize = CL(Executor::GetHandleSize(phonemeBuf)); + ::Handle nativeHandle = ::NewHandle(ExecSize); + long tempPhonemes = CL(*phonemeBytes); + Executor::LONGINT intPhonemes; + memcpy(*nativeHandle, phonemeBuf->p, ExecSize); + ::OSErr toRet = ::TextToPhonemes((::SpeechChannel)chan, textBuf, CL(textBytes), nativeHandle, &tempPhonemes); + intPhonemes = tempPhonemes; + *phonemeBytes = CL(intPhonemes); + ::DisposeHandle(nativeHandle); + return CW(toRet); +} From 26a11dd9b746347fc4128449b8fde947f6c2b3b6 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Mon, 4 Aug 2014 19:39:18 -0600 Subject: [PATCH 010/390] Implement the enum soVoiceFile swapping in MacBridge::GetVoiceInfo. --- src/SpeechManager-MacBridge.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/SpeechManager-MacBridge.cpp b/src/SpeechManager-MacBridge.cpp index 8ac80863..fa33e2b9 100644 --- a/src/SpeechManager-MacBridge.cpp +++ b/src/SpeechManager-MacBridge.cpp @@ -207,6 +207,34 @@ Executor::OSErr MacBridge::GetVoiceInfo (const Executor::VoiceSpec *voice, Execu // TODO: handle different data types ::OSErr toRet = ::GetVoiceInfo((const ::VoiceSpec*)voice, CL(selector), voiceInfo); + switch (selector) { + case CLC(soVoiceFile): + { + //TODO: error checking + unsigned char cLocation[PATH_MAX] = {0}; + ::VoiceFileInfo *theFile = (::VoiceFileInfo*)voiceInfo; + ::FSSpec tmpSpec = theFile->fileSpec; + ::FSRef tmpRef = {0}; + ::CFURLRef tmpURL = NULL; + ::FSpMakeFSRef(&tmpSpec, &tmpRef); + tmpURL = ::CFURLCreateFromFSRef(kCFAllocatorDefault, &tmpRef); + ::CFStringRef fileName = CFURLCopyLastPathComponent(tmpURL); + ::CFURLGetFileSystemRepresentation(tmpURL, false, cLocation, sizeof(cLocation)); + Executor::Str255 strName = {0}; + CFStringGetPascalString(fileName, strName, sizeof(strName), kCFStringEncodingMacRoman); + Executor::HVCB *customPart = Executor::ROMlib_vcbbybiggestunixname((const char*)cLocation); + Executor::FSSpecPtr tmpSpecPtr = (Executor::FSSpecPtr)&theFile->fileSpec; + Executor::C_FSMakeFSSpec(customPart->vcbDrvNum, customPart->vcbDirIDM, strName, tmpSpecPtr); + + theFile->resID = CW(theFile->resID); + ::CFRelease(tmpURL); + ::CFRelease(fileName); + } + break; + + default: + break; + } return CW(toRet); } From f997f3b6f84a96fbb3090926392731305ca2ced6 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Tue, 5 Aug 2014 14:57:08 -0600 Subject: [PATCH 011/390] Use C++ templates for some byte swapping. --- CocoaExecutor.xcodeproj/project.pbxproj | 2 +- OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm | 29 +- .../NeXT Classes/NEXTkeyboard.cpp | 3 +- .../CocoaExecutor/NeXT Classes/NEXTprint.mm | 18 +- src/AE.cpp | 22 +- src/AE_desc.cpp | 67 ++-- src/AE_hdlr.cpp | 43 +-- src/PSprint.mm | 195 +++++----- src/SpeechManager-MacBridge.cpp | 134 ++++--- src/SpeechManager-MacBridge.h | 52 +-- src/aboutbox.cpp | 11 +- src/adb.cpp | 7 +- src/alias.cpp | 41 ++- src/appearance.cpp | 9 +- src/cfm.cpp | 19 +- src/commtool.cpp | 7 +- src/ctlArrows.cpp | 107 +++--- src/ctlInit.cpp | 13 +- src/ctlMisc.cpp | 3 +- src/ctlMouse.cpp | 23 +- src/ctlPopup.cpp | 59 +-- src/ctlSet.cpp | 11 +- src/ctlSize.cpp | 25 +- src/ctlStddef.cpp | 53 +-- src/dcmaketables.cpp | 6 +- src/desk.cpp | 27 +- src/device.cpp | 210 +++++------ src/dialAlert.cpp | 25 +- src/dialCreate.cpp | 31 +- src/dialDispatch.cpp | 3 +- src/dialHandle.cpp | 45 +-- src/dialInit.cpp | 3 +- src/dialItem.cpp | 27 +- src/dialManip.cpp | 49 +-- src/diskinit.cpp | 13 +- src/dump.cpp | 229 ++++++------ src/emustubs.cpp | 87 ++--- src/emutrap.cpp | 12 +- src/executor.cpp | 15 +- src/fileAccess.cpp | 91 ++--- src/fileCreate.cpp | 13 +- src/fileDouble.cpp | 38 +- src/fileHighlevel.cpp | 53 +-- src/fileInfo.cpp | 61 +-- src/fileMisc.cpp | 37 +- src/fileVolumes.cpp | 37 +- src/float4.cpp | 51 +-- src/float5.cpp | 3 +- src/float7.cpp | 27 +- src/floatnext.cpp | 17 +- src/font.cpp | 97 ++--- src/gensplash.cpp | 42 +-- src/gestalt.cpp | 7 +- src/hfsBtree.cpp | 343 ++++++++--------- src/hfsChanging.cpp | 23 +- src/hfsCreate.cpp | 13 +- src/hfsFile.cpp | 189 +++++----- src/hfsHelper.cpp | 37 +- src/hfsHier.cpp | 29 +- src/hfsMisc.cpp | 45 +-- src/hfsVolume.cpp | 89 ++--- src/hfsWorkingdir.cpp | 41 ++- src/hfsXbar.cpp | 49 +-- src/hle.cpp | 11 +- src/icon.cpp | 23 +- src/image.cpp | 23 +- src/include/MacTypes.h | 4 +- src/include/rsys/common.h | 39 ++ src/interfacelib.cpp | 122 +++--- src/iu.cpp | 43 +-- src/iv-stubs.cpp | 25 +- src/launch.cpp | 69 ++-- src/listAccess.cpp | 71 ++-- src/listAddDel.cpp | 79 ++-- src/listCreate.cpp | 37 +- src/listDisplay.cpp | 41 ++- src/listMouse.cpp | 149 ++++---- src/listOps.cpp | 73 ++-- src/listStdLDEF.cpp | 4 +- src/main.cpp | 15 +- src/menu.cpp | 107 +++--- src/menuV.cpp | 7 +- src/mixed_mode.cpp | 2 +- src/mman.cpp | 19 +- src/mmansubr.cpp | 11 +- src/notify.cpp | 3 +- src/osevent.cpp | 43 +-- src/osutil.cpp | 35 +- src/pef_hash.cpp | 27 +- src/prError.cpp | 5 +- src/prLowLevel.cpp | 45 +-- src/prPrinting.cpp | 9 +- src/prRecords.cpp | 21 +- src/process.cpp | 19 +- src/qBit.cpp | 31 +- src/qCConv.cpp | 83 ++--- src/qCGrafPort.cpp | 25 +- src/qColor.cpp | 23 +- src/qColorMgr.cpp | 75 ++-- src/qColorPicker.cpp | 141 +++---- src/qColorutil.cpp | 7 +- src/qCursor.cpp | 37 +- src/qGDevice.cpp | 27 +- src/qGWorld.cpp | 29 +- src/qGrafport.cpp | 17 +- src/qIMIV.cpp | 33 +- src/qIMV.cpp | 33 +- src/qIMVI.cpp | 15 +- src/qIMVxfer.cpp | 51 +-- src/qMisc.cpp | 55 +-- src/qPaletteMgr.cpp | 57 +-- src/qPen.cpp | 31 +- src/qPicstuff.cpp | 87 ++--- src/qPict2.cpp | 27 +- src/qPicture.cpp | 23 +- src/qPixMapConv.cpp | 33 +- src/qPoint.cpp | 21 +- src/qPoly.cpp | 25 +- src/qRect.cpp | 61 +-- src/qRegion.cpp | 187 +++++----- src/qRegular.cpp | 5 +- src/qScale.cpp | 7 +- src/qStdArc.cpp | 19 +- src/qStdBits.cpp | 77 ++-- src/qStdLine.cpp | 73 ++-- src/qStdOval.cpp | 15 +- src/qStdPic.cpp | 11 +- src/qStdPoly.cpp | 15 +- src/qStdRRect.cpp | 59 +-- src/qStdRect.cpp | 7 +- src/qStdRgn.cpp | 65 ++-- src/qStdText.cpp | 199 +++++----- src/qText.cpp | 21 +- src/rawpatblt.cpp | 5 +- src/rawsrcblt.cpp | 5 +- src/resGet.cpp | 9 +- src/resGetinfo.cpp | 5 +- src/resInit.cpp | 5 +- src/resMisc.cpp | 11 +- src/resMod.cpp | 79 ++-- src/resOpen.cpp | 33 +- src/resPartial.cpp | 3 +- src/resSetcur.cpp | 3 +- src/rgbutil.cpp | 11 +- src/scrap.cpp | 51 +-- src/screen-dump.cpp | 13 +- src/script.cpp | 99 ++--- src/segment.cpp | 33 +- src/serial.cpp | 67 ++-- src/sound.cpp | 161 ++------ src/soundIMVI.cpp | 13 +- src/soundfake.cpp | 3 +- src/splash.cpp | 24 +- src/srcblt.cpp | 33 +- src/stdfile.cpp | 347 +++++++++--------- src/stdmbdf.cpp | 121 +++--- src/stdmdef.cpp | 201 +++++----- src/syserr.cpp | 75 ++-- src/system_error.cpp | 27 +- src/teAccess.cpp | 17 +- src/teDisplay.cpp | 3 +- src/teEdit.cpp | 87 ++--- src/teIMIV.cpp | 15 +- src/teIMV.cpp | 57 +-- src/teInit.cpp | 7 +- src/teInsert.cpp | 71 ++-- src/teMisc.cpp | 21 +- src/teScrap.cpp | 9 +- src/time.cpp | 9 +- src/toolevent.cpp | 49 +-- src/toolutil.cpp | 21 +- src/vbl.cpp | 11 +- src/version.cpp | 3 +- src/vgavdriver.cpp | 16 +- src/windColor.cpp | 9 +- src/windDisplay.cpp | 19 +- src/windDocdef.cpp | 241 ++++++------ src/windInit.cpp | 27 +- src/windMisc.cpp | 33 +- src/windMouse.cpp | 19 +- src/windSize.cpp | 71 ++-- src/windUpdate.cpp | 29 +- src/xdata.cpp | 15 +- src/xdblt.cpp | 43 +-- 184 files changed, 4321 insertions(+), 4173 deletions(-) diff --git a/CocoaExecutor.xcodeproj/project.pbxproj b/CocoaExecutor.xcodeproj/project.pbxproj index 793841b7..c2934fc3 100644 --- a/CocoaExecutor.xcodeproj/project.pbxproj +++ b/CocoaExecutor.xcodeproj/project.pbxproj @@ -954,7 +954,7 @@ 558B98751987FCBD00ADF159 /* default_ctab_values.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = default_ctab_values.cpp; sourceTree = ""; }; 558B98761987FCBD00ADF159 /* desk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = desk.cpp; sourceTree = ""; }; 558B98771987FCBD00ADF159 /* desperate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = desperate.cpp; sourceTree = ""; }; - 558B98781987FCBD00ADF159 /* device.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = device.cpp; sourceTree = ""; }; + 558B98781987FCBD00ADF159 /* device.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = device.cpp; sourceTree = ""; usesTabs = 0; }; 558B98791987FCBD00ADF159 /* dialAlert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialAlert.cpp; sourceTree = ""; }; 558B987A1987FCBD00ADF159 /* dialCreate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialCreate.cpp; sourceTree = ""; }; 558B987B1987FCBD00ADF159 /* dialDispatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dialDispatch.cpp; sourceTree = ""; }; diff --git a/OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm b/OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm index f2b8e787..0a7555b6 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm +++ b/OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm @@ -29,6 +29,7 @@ #include "ResourceMgr.h" using namespace Executor; +using namespace ByteSwap; PUBLIC keyboard_enum_t Executor::ROMlib_keyboard_type; @@ -372,8 +373,8 @@ #endif /* SANE_DEBUGGING */ ) { - p.h = CW(MouseLocation.h); - p.v = CW(MouseLocation.v); + p.h = BigEndianValue(MouseLocation.h); + p.v = BigEndianValue(MouseLocation.v); ROMlib_PPostEvent(osEvt, SUSPENDRESUMEBITS|SUSPEND|CONVERTCLIPBOARD, (HIDDEN_EvQElPtr *) 0, TickCount(), p, ROMlib_mods); } @@ -396,8 +397,8 @@ what = SUSPENDRESUMEBITS | RESUME; if (cvtclip) what |= CONVERTCLIPBOARD; - p.h = CW(MouseLocation.h); - p.v = CW(MouseLocation.v); + p.h = BigEndianValue(MouseLocation.h); + p.v = BigEndianValue(MouseLocation.v); ROMlib_PPostEvent(osEvt, what, (HIDDEN_EvQElPtr *) 0, TickCount(), p, ROMlib_mods); } @@ -407,8 +408,8 @@ { Point p; - p.h = CW(MouseLocation.h); - p.v = CW(MouseLocation.v); + p.h = BigEndianValue(MouseLocation.h); + p.v = BigEndianValue(MouseLocation.v); ROMlib_PPostEvent(keyDown, 0x0863, /* 0x63 == 'c' */ (HIDDEN_EvQElPtr *) 0, TickCount(), p, cmdKey|btnState); ROMlib_PPostEvent(keyUp, 0x0863, @@ -419,8 +420,8 @@ { Point p; - p.h = CW(MouseLocation.h); - p.v = CW(MouseLocation.v); + p.h = BigEndianValue(MouseLocation.h); + p.v = BigEndianValue(MouseLocation.v); ROMlib_PPostEvent(keyDown, 0x0976, /* 0x76 == 'v' */ (HIDDEN_EvQElPtr *) 0, TickCount(), p, cmdKey|btnState); ROMlib_PPostEvent(keyUp, 0x0976, @@ -430,8 +431,8 @@ PRIVATE void pinmouse(INTEGER *hp, INTEGER *vp, BOOLEAN swap) { if (swap) { - *hp = CW(*hp); - *vp = CW(*vp); + *hp = BigEndianValue(*hp); + *vp = BigEndianValue(*vp); } if (*hp < 0) @@ -445,15 +446,15 @@ PRIVATE void pinmouse(INTEGER *hp, INTEGER *vp, BOOLEAN swap) *vp = vdriver_height - 1; if (swap) { - *hp = CW(*hp); - *vp = CW(*vp); + *hp = BigEndianValue(*hp); + *vp = BigEndianValue(*vp); } } A1(PUBLIC, void, ROMlib_updatemouselocation, NSEvent *, neventp) /* INTERNAL */ { - MouseLocation.h = CW ([neventp locationInWindow].x); - MouseLocation.v = CW (vdriver_height - [neventp locationInWindow].y); + MouseLocation.h = BigEndianValue ([neventp locationInWindow].x); + MouseLocation.v = BigEndianValue (vdriver_height - [neventp locationInWindow].y); pinmouse(&MouseLocation.h, &MouseLocation.v, TRUE); } diff --git a/OSX-only/CocoaExecutor/NeXT Classes/NEXTkeyboard.cpp b/OSX-only/CocoaExecutor/NeXT Classes/NEXTkeyboard.cpp index fe49feff..f0ff98c8 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/NEXTkeyboard.cpp +++ b/OSX-only/CocoaExecutor/NeXT Classes/NEXTkeyboard.cpp @@ -13,13 +13,12 @@ keyboard_enum_t Executor::ROMlib_get_keyboard_type( void ) { NXEventHandle handle; NXEventSystemDevice dev[NX_EVS_DEVICE_MAX]; - unsigned int cnt, i; + unsigned int cnt = NX_EVS_DEVICE_INFO_COUNT, i; int interface, id; keyboard_enum_t retval; if ( (handle = NXOpenEventStatus()) == 0 ) return no_keyboard; - cnt = NX_EVS_DEVICE_INFO_COUNT; NXEventSystemInfo( handle, NX_EVS_DEVICE_INFO, (int *)dev, &cnt ); NXCloseEventStatus( handle ); interface = -1; diff --git a/OSX-only/CocoaExecutor/NeXT Classes/NEXTprint.mm b/OSX-only/CocoaExecutor/NeXT Classes/NEXTprint.mm index 6c4cdbf2..d2f0aaa2 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/NEXTprint.mm +++ b/OSX-only/CocoaExecutor/NeXT Classes/NEXTprint.mm @@ -21,6 +21,8 @@ */ namespace Executor { +using namespace ByteSwap; + void ROMlib_newFont(char *font, float txSize) { [[NSFont fontWithName:[NSString stringWithCString:font encoding:NSMacOSRomanStringEncoding] size:txSize] set]; @@ -31,8 +33,8 @@ void ROMlib_updatenextpagerect(comRect *rp) NSSize new_paper_size; virtual_int_state_t block = block_virtual_ints(); - new_paper_size.height = CW(rp->bottom) - CW(rp->top); - new_paper_size.width = CW(rp->right) - CW(rp->left); + new_paper_size.height = BigEndianValue(rp->bottom) - BigEndianValue(rp->top); + new_paper_size.width = BigEndianValue(rp->right) - BigEndianValue(rp->left); [[NSPrintInfo sharedPrintInfo] setPaperSize:new_paper_size]; restore_virtual_ints(block); } @@ -54,17 +56,17 @@ void ROMlib_updatemacpagerect(comRect *paperp, comRect *page1p, CGFloat scaling_factor; new_size = [[NSPrintInfo sharedPrintInfo] paperSize]; - paperp->top = CW(0 - HALFINCH); - paperp->left = CW(0 - HALFINCH); + paperp->top = BigEndianValue(0 - HALFINCH); + paperp->left = BigEndianValue(0 - HALFINCH); scaling_factor = printer_scaling_factor (); - paperp->bottom = CW(new_size.height * (1 / scaling_factor) - HALFINCH); - paperp->right = CW(new_size.width * (1 / scaling_factor) - HALFINCH); + paperp->bottom = BigEndianValue(new_size.height * (1 / scaling_factor) - HALFINCH); + paperp->right = BigEndianValue(new_size.width * (1 / scaling_factor) - HALFINCH); page1p->top = page2p->top = 0; page1p->left = page2p->left = 0; - page1p->bottom = page2p->bottom = CW(CW(paperp->bottom) - HALFINCH); - page1p->right = page2p->right = CW(CW(paperp->right) - HALFINCH); + page1p->bottom = page2p->bottom = BigEndianValue(BigEndianValue(paperp->bottom) - HALFINCH); + page1p->right = page2p->right = BigEndianValue(BigEndianValue(paperp->right) - HALFINCH); restore_virtual_ints(block); } } diff --git a/src/AE.cpp b/src/AE.cpp index 1751149a..9f82f9ed 100644 --- a/src/AE.cpp +++ b/src/AE.cpp @@ -35,7 +35,9 @@ boolean_t send_application_open_aevt_p; AEDesc * desc_out); } + using namespace Executor; +using namespace ByteSwap; /* dispatching apple events */ @@ -78,7 +80,7 @@ P1 (PUBLIC pascal trap, OSErr, AEProcessAppleEvent, if (err != bufferIsSmall) AE_RETURN_ERROR (errAEEventNotHandled); - evt_data = NewHandle (CL (evt_data_size)); + evt_data = NewHandle (BigEndianValue (evt_data_size)); if (MemError () != noErr) AE_RETURN_ERROR (MemError ()); @@ -108,7 +110,7 @@ P1 (PUBLIC pascal trap, OSErr, AEProcessAppleEvent, AEDisposeDesc (evt); AE_RETURN_ERROR (err); } - event_class = CL (event_class); + BigEndianInPlace (event_class); err = AEGetAttributePtr (evt, keyEventIDAttr, typeType, &dummy_type, @@ -118,7 +120,7 @@ P1 (PUBLIC pascal trap, OSErr, AEProcessAppleEvent, AEDisposeDesc (evt); AE_RETURN_ERROR (err); } - event_id = CL (event_id); + event_id = BigEndianValue (event_id); err = AEGetEventHandler (event_class, event_id, &hdlr, &refcon, FALSE); if (err != noErr) @@ -131,7 +133,7 @@ P1 (PUBLIC pascal trap, OSErr, AEProcessAppleEvent, } } hdlr = MR (hdlr); - refcon = CL (refcon); + refcon = BigEndianValue (refcon); { AppleEvent *reply = (AppleEvent*)alloca (sizeof *reply); @@ -185,8 +187,8 @@ P7 (PUBLIC pascal trap, OSErr, AESend, /* ### not sure what error we should return here */ AE_RETURN_ERROR (errAEEventNotHandled); - target_type = CL (target_type); - target_size = CL (target_size); + target_type = BigEndianValue (target_type); + target_size = BigEndianValue (target_size); if (err != noErr) AE_RETURN_ERROR (err); @@ -432,7 +434,7 @@ P5 (PUBLIC pascal trap, OSErr, AECoercePtr, /* swap things to a normal state */ coercion_hdlr = MR (coercion_hdlr); - refcon = CL (refcon); + BigEndianInPlace (refcon); if (is_desc_hdlr_p) { @@ -482,7 +484,7 @@ parse_evt (const AppleEvent *evtp, AEDesc *desc_out) LONGINT n; retval = AECountItems (&d, &n); - n = CL (n); + n = BigEndianValue (n); if (retval == noErr) { Handle h; @@ -496,7 +498,7 @@ parse_evt (const AppleEvent *evtp, AEDesc *desc_out) LONGINT l; p->magic = CLC (APP_PARAMS_MAGIC); - p->n_fsspec = CW (n); + p->n_fsspec = BigEndianValue (n); for (l = 1; retval == noErr && l <= n; ++l) { AEDesc d2; @@ -566,7 +568,7 @@ P3 (PUBLIC pascal trap, OSErr, AECoerceDesc, /* swap things to a normal state */ coercion_hdlr = MR (coercion_hdlr); - refcon = CL (refcon); + refcon = BigEndianValue (refcon); if (is_desc_hdlr_p) { diff --git a/src/AE_desc.cpp b/src/AE_desc.cpp index 6f3228c5..a23561a9 100644 --- a/src/AE_desc.cpp +++ b/src/AE_desc.cpp @@ -16,6 +16,7 @@ char ROMlib_rcsid_AE_desc[] = #include "rsys/apple_events.h" using namespace Executor; +using namespace ByteSwap; #define LIST_CLASS_P(desc) \ ( DESC_TYPE_X (desc) == CLC (typeAEList) \ @@ -64,7 +65,7 @@ get_subdesc_info (Handle aggr_desc_h, subdesc_info_t *info, info->base_offset = (offsetof (ae_header_t, target) /* type, key, size */ + 12 - + CL (inline_target_desc->size) + + BigEndianValue (inline_target_desc->size) /* two unknown longs */ + 8); } @@ -101,7 +102,7 @@ desc_offset (Handle aggr_desc_h, int index, subdesc_info_t *info, else desc = (inline_desc_t *) t; - t += (CL (desc->size) + t += (BigEndianValue (desc->size) /* inline key desc header size */ + info->inline_desc_header_size); } @@ -188,7 +189,7 @@ aggr_desc_get_addr (Handle aggr_desc_h, if (index == info.count + 1) old_size = 0; else - old_size = CL (inline_desc->size) + info.inline_desc_header_size; + old_size = BigEndianValue (inline_desc->size) + info.inline_desc_header_size; if (delete_p) new_size = 0; @@ -204,7 +205,7 @@ aggr_desc_get_addr (Handle aggr_desc_h, SetHandleSize (aggr_desc_h, aggr_desc_size + diff); if (MemErr != CWC (noErr)) - AE_RETURN_ERROR (CW (MemErr)); + AE_RETURN_ERROR (BigEndianValue (MemErr)); aggr_desc_p = (char *) STARH (aggr_desc_h); if (aggr_desc_size < offset + old_size) abort (); @@ -223,7 +224,7 @@ aggr_desc_get_addr (Handle aggr_desc_h, aggr_desc_size - offset - old_size); SetHandleSize (aggr_desc_h, aggr_desc_size - diff); if (MemErr != CWC (noErr)) - AE_RETURN_ERROR (CW (MemErr)); + AE_RETURN_ERROR (BigEndianValue (MemErr)); aggr_desc_p = (char *) STARH (aggr_desc_h); } memset (aggr_desc_p + offset, '\000', new_size); @@ -240,7 +241,7 @@ aggr_desc_get_addr (Handle aggr_desc_h, if (attribute_p) { PARAM_OFFSET_X (aggr_desc_h) - = CL (PARAM_OFFSET (aggr_desc_h) - old_size + new_size); + = BigEndianValue (PARAM_OFFSET (aggr_desc_h) - old_size + new_size); } if (! delete_p) @@ -248,22 +249,22 @@ aggr_desc_get_addr (Handle aggr_desc_h, if (index == info.count + 1) { info.count ++; - *(info.count_p) = CL (info.count); + *(info.count_p) = BigEndianValue (info.count); } - inline_desc->size = CL (*size_return); + inline_desc->size = BigEndianValue (*size_return); } else { info.count --; - *(info.count_p) = CL (info.count); + *(info.count_p) = BigEndianValue (info.count); } } if (! delete_p) { *addr_return = (aggr_desc_p + offset); - *size_return = CL (inline_desc->size); + *size_return = BigEndianValue (inline_desc->size); } AE_RETURN_ERROR (noErr); @@ -286,13 +287,13 @@ find_key_index (Handle aggr_desc_h, int32 keyword, boolean_t attribute_p, inline_key_desc = (inline_key_desc_t *) t; - if (CL (inline_key_desc->key) == keyword) + if (BigEndianValue (inline_key_desc->key) == keyword) { *index_return = count; return TRUE; } - t += (CL (inline_key_desc->size) + t += (BigEndianValue (inline_key_desc->size) /* inline key desc header size */ + 12); } @@ -344,7 +345,7 @@ aggr_put_nth_desc (Handle aggr_handle, return FALSE; } - inline_desc->type = CL (in_desc_type); + inline_desc->type = BigEndianValue (in_desc_type); memcpy (inline_desc->data, STARH (in_desc_data), size); *out_failcode = noErr; @@ -377,7 +378,7 @@ aggr_get_nth_desc (Handle aggr_handle, LOCK_HANDLE_EXCURSION_1 (aggr_handle, { - err = AECreateDesc (CL (inline_out_desc->type), + err = AECreateDesc (BigEndianValue (inline_out_desc->type), (Ptr) inline_out_desc->data, size, out_desc); }); @@ -395,7 +396,7 @@ aggr_get_nth_desc (Handle aggr_handle, LOCK_HANDLE_EXCURSION_1 (aggr_handle, { - err = AECreateDesc (CL (inline_out_desc->type), + err = AECreateDesc (BigEndianValue (inline_out_desc->type), (Ptr) inline_out_desc->data, size, out_desc); }); @@ -438,8 +439,8 @@ aggr_put_key_desc (Handle aggr_handle, if (err != noErr) return FALSE; - inline_key_desc->key = CL (keyword); - inline_key_desc->type = CL (in_desc_type); + inline_key_desc->key = BigEndianValue (keyword); + inline_key_desc->type = BigEndianValue (in_desc_type); memcpy (inline_key_desc->data, STARH (in_desc_data), size); return TRUE; @@ -474,8 +475,8 @@ aggr_get_key_desc (Handle aggr_handle, LOCK_HANDLE_EXCURSION_1 (aggr_handle, { - err = AECreateDesc (CL (target->type), - (Ptr) target->data, CL (target->size), + err = AECreateDesc (BigEndianValue (target->type), + (Ptr) target->data, BigEndianValue (target->size), out_desc); }); if (err != noErr) @@ -526,7 +527,7 @@ aggr_get_key_desc (Handle aggr_handle, LOCK_HANDLE_EXCURSION_1 (aggr_handle, { - err = AECreateDesc (CL (inline_key_desc->type), + err = AECreateDesc (BigEndianValue (inline_key_desc->type), (Ptr) inline_key_desc->data, size, out_desc); }); @@ -581,7 +582,7 @@ ae_desc_to_ptr (descriptor_t *desc, memcpy (data, STARH (desc_data), copy_size); - *size_out = CL (copy_size); + *size_out = BigEndianValue (copy_size); } #if 0 @@ -619,7 +620,7 @@ dump_union_desc (union desc *foo, boolean_t key_pair_p) (type >> 0) & 0xFF); ae_desc_to_ptr (desc, (Ptr) data, 1024, &size); - size = CL (size); + size = BigEndianValue (size); switch (type) { @@ -703,13 +704,13 @@ P6 (PUBLIC pascal trap, OSErr, AECreateAppleEvent, event_data = (ae_header_t *)alloca (event_size); memset (event_data, '\000', event_size); - event_data->param_offset = CL (event_size + 2); + event_data->param_offset = BigEndianValue (event_size + 2); - event_data->event_class = CL (event_class); - event_data->event_id = CL (event_id); + event_data->event_class = BigEndianValue (event_class); + event_data->event_id = BigEndianValue (event_id); - event_data->target.size = CL (target_size); - event_data->target.type = CL (target_type); + event_data->target.size = BigEndianValue (target_size); + event_data->target.type = BigEndianValue (target_type); memcpy (&event_data->target.data[0], STARH (target_data), target_size); { @@ -757,7 +758,7 @@ P4 (PUBLIC pascal trap, OSErr, AECreateDesc, memset (STARH (h), 0, data_size); } - DESC_TYPE_X (desc_out) = CL (type); + DESC_TYPE_X (desc_out) = BigEndianValue (type); DESC_DATA_X (desc_out) = RM (h); AE_RETURN_ERROR (noErr); @@ -805,7 +806,7 @@ P4 (PUBLIC pascal trap, OSErr, AECreateList, memset (&header, '\000', sizeof header); - header.attribute_count = CL (type); + header.attribute_count = BigEndianValue (type); header.param_offset = CLC (0x18); AE_RETURN_ERROR (AECreateDesc (type, @@ -825,7 +826,7 @@ P2 (PUBLIC pascal trap, OSErr, AECountItems, if (err != noErr) AE_RETURN_ERROR (err); - *count_out = CL (info.count); + *count_out = BigEndianValue (info.count); AE_RETURN_ERROR (noErr); } @@ -930,7 +931,7 @@ P4 (PUBLIC pascal trap, OSErr, AESizeOfNthItem, AE_RETURN_ERROR (errAEIllegalIndex); *type_out = DESC_TYPE_X (desc); - *size_out = CL (GetHandleSize ((Handle) DESC_DATA (desc))); + *size_out = BigEndianValue (GetHandleSize ((Handle) DESC_DATA (desc))); AE_RETURN_ERROR (noErr); } @@ -1040,7 +1041,7 @@ P4 (PUBLIC pascal trap, OSErr, AESizeOfKeyDesc, AE_RETURN_ERROR (errAEDescNotFound); *type_out = DESC_TYPE_X (desc); - *size_out = CL (GetHandleSize ((Handle) DESC_DATA (desc))); + *size_out = BigEndianValue (GetHandleSize ((Handle) DESC_DATA (desc))); AE_RETURN_ERROR (noErr); } @@ -1154,7 +1155,7 @@ P4 (PUBLIC pascal trap, OSErr, AESizeOfAttribute, AE_RETURN_ERROR (errAEDescNotFound); *type_out = DESC_TYPE_X (desc); - *size_out = CL (GetHandleSize ((Handle) DESC_DATA (desc))); + *size_out = BigEndianValue (GetHandleSize ((Handle) DESC_DATA (desc))); AE_RETURN_ERROR (noErr); } diff --git a/src/AE_hdlr.cpp b/src/AE_hdlr.cpp index 116cb0e0..488efb99 100644 --- a/src/AE_hdlr.cpp +++ b/src/AE_hdlr.cpp @@ -17,6 +17,7 @@ char ROMlib_rcsid_AE_hdlr[] = #include "rsys/mman.h" using namespace Executor; +using namespace ByteSwap; #define hdlr_table(system_p, class) \ ({ \ @@ -130,14 +131,14 @@ hdlr_table_elt (AE_hdlr_table_h table, { n_elts ++; - AE_TABLE_N_ELTS_X (table) = CL (n_elts); + AE_TABLE_N_ELTS_X (table) = BigEndianValue (n_elts); SetHandleSize ((Handle) table, (sizeof (AE_hdlr_table_t) + n_elts * sizeof (AE_hdlr_table_elt_t))); if (MemErr != CWC (noErr)) - AE_RETURN_ERROR (CW (MemErr)); + AE_RETURN_ERROR (BigEndianValue (MemErr)); elts = AE_TABLE_ELTS (table); elt = &elts[n_elts - 1]; @@ -170,7 +171,7 @@ P5 (PUBLIC pascal trap, OSErr, _AE_hdlr_table_alloc, first argument */ table = (AE_hdlr_table_h) NewHandleClear (52); if (MemErr != CWC (noErr)) - AE_RETURN_ERROR (CW (MemErr)); + AE_RETURN_ERROR (BigEndianValue (MemErr)); AE_TABLE_N_ALLOCATED_BYTES_X (table) = CLC (52); AE_TABLE_N_ELTS_X (table) = CLC (0); @@ -200,7 +201,7 @@ P3 (PUBLIC pascal trap, OSErr, _AE_hdlr_delete, memmove (&elts[elt_offset + 1], &elts[elt_offset], (n_elts - elt_offset - 1) * sizeof *elts); - AE_TABLE_N_ELTS_X (table) = CL (n_elts - 1); + AE_TABLE_N_ELTS_X (table) = BigEndianValue (n_elts - 1); AE_RETURN_ERROR (noErr); } @@ -257,11 +258,11 @@ P5 (PUBLIC pascal trap, OSErr, AEInstallEventHandler, table = hdlr_table (system_handler_p, event); - selector.sel0 = CL (event_class); - selector.sel1 = CL (event_id); + selector.sel0 = BigEndianValue (event_class); + selector.sel1 = BigEndianValue (event_id); hdlr.fn = RM (hdlr_fn); - hdlr.refcon = CL (refcon); + hdlr.refcon = BigEndianValue (refcon); err = hdlr_table_elt (table, &selector, &hdlr, TRUE, &elt); if (err != noErr) @@ -306,8 +307,8 @@ P5 (PUBLIC pascal trap, OSErr, AEGetEventHandler, table = hdlr_table (system_handler_p, event); - selector.sel0 = CL (event_class); - selector.sel1 = CL (event_id); + selector.sel0 = BigEndianValue (event_class); + selector.sel1 = BigEndianValue (event_id); err = hdlr_table_elt (table, &selector, NULL, FALSE, &elt); if (err != noErr) @@ -360,11 +361,11 @@ P6 (PUBLIC pascal trap, OSErr, AEInstallCoercionHandler, table = hdlr_table (system_handler_p, coercion); - selector.sel0 = CL (from_type); - selector.sel1 = CL (to_type); + selector.sel0 = BigEndianValue (from_type); + selector.sel1 = BigEndianValue (to_type); hdlr.fn = RM (hdlr_fn); - hdlr.refcon = CL (refcon); + hdlr.refcon = BigEndianValue (refcon); err = hdlr_table_elt (table, &selector, &hdlr, TRUE, &elt); if (err != noErr) @@ -391,8 +392,8 @@ P6 (PUBLIC pascal trap, OSErr, AEGetCoercionHandler, table = hdlr_table (system_handler_p, coercion); - selector.sel0 = CL (from_type); - selector.sel1 = CL (to_type); + selector.sel0 = BigEndianValue (from_type); + selector.sel1 = BigEndianValue (to_type); err = hdlr_table_elt (table, &selector, NULL, FALSE, &elt); if (err != noErr) @@ -451,11 +452,11 @@ P3 (PUBLIC pascal trap, OSErr, AEInstallSpecialHandler, table = hdlr_table (system_handler_p, special); - selector.sel0 = CL (function_class); - selector.sel1 = CL (k_special_sel1); + selector.sel0 = BigEndianValue (function_class); + selector.sel1 = BigEndianValue (k_special_sel1); hdlr.fn = RM (hdlr_fn); - hdlr.refcon = CL (-1); + hdlr.refcon = BigEndianValue (-1); err = hdlr_table_elt (table, &selector, &hdlr, TRUE, &elt); if (err != noErr) @@ -478,8 +479,8 @@ P3 (PUBLIC pascal trap, OSErr, AEGetSpecialHandler, table = hdlr_table (system_handler_p, special); - selector.sel0 = CL (function_class); - selector.sel1 = CL (k_special_sel1); + selector.sel0 = BigEndianValue (function_class); + selector.sel1 = BigEndianValue (k_special_sel1); err = hdlr_table_elt (table, &selector, NULL, FALSE, &elt); if (err != noErr) @@ -500,8 +501,8 @@ P3 (PUBLIC pascal trap, OSErr, AERemoveSpecialHandler, table = hdlr_table (system_handler_p, special); - selector.sel0 = CL (function_class); - selector.sel1 = CL (k_special_sel1); + selector.sel0 = BigEndianValue (function_class); + selector.sel1 = BigEndianValue (k_special_sel1); /* #### fail if `hdlr' is not the currently installed handler? */ AE_RETURN_ERROR (_AE_hdlr_delete (table, 0, &selector)); diff --git a/src/PSprint.mm b/src/PSprint.mm index 5e22a270..9daa1039 100644 --- a/src/PSprint.mm +++ b/src/PSprint.mm @@ -35,6 +35,7 @@ #include using namespace Executor; +using namespace ByteSwap; typedef struct { @@ -594,8 +595,8 @@ static void dumpimage( unsigned char *p, int numrows, int numbytes, { 1.0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, }; - gray_fore = mac_old_color_to_ps_gray (CL (thePortp->fgColor)); - gray_back = mac_old_color_to_ps_gray (CL (thePortp->bkColor)); + gray_fore = mac_old_color_to_ps_gray (BigEndianValue (thePortp->fgColor)); + gray_back = mac_old_color_to_ps_gray (BigEndianValue (thePortp->bkColor)); pl = (uint32 *) patp; pat_is_black = ((gray_fore == 0 && gray_back == 0) || @@ -612,8 +613,8 @@ static void dumpimage( unsigned char *p, int numrows, int numbytes, long fg, bk; const char *fgs, *bks; - fg = CL (thePortp->fgColor); - bk = CL (thePortp->bkColor); + fg = BigEndianValue (thePortp->fgColor); + bk = BigEndianValue (thePortp->bkColor); if (fg == whiteColor) fgs = "white"; else if (fg == blackColor) @@ -685,7 +686,7 @@ static void doimage(LONGINT verb, comRect *rp, comGrafPtr thePortp) short pnMode; TEMP_ALLOC_DECL (temp_alloc_space); - pnMode = CW (thePortp->pnMode); + pnMode = BigEndianValue (thePortp->pnMode); switch (verb) { default: case paintVerb: @@ -711,28 +712,28 @@ static void doimage(LONGINT verb, comRect *rp, comGrafPtr thePortp) PSsetgray(gray_val); PSfill(); } else { - PSmoveto(CW(rp->left), CW(rp->bottom)); - PSlineto(CW(rp->left), CW(rp->top)); - PSlineto(CW(rp->right), CW(rp->top)); - PSlineto(CW(rp->right), CW(rp->bottom)); + PSmoveto(BigEndianValue(rp->left), BigEndianValue(rp->bottom)); + PSlineto(BigEndianValue(rp->left), BigEndianValue(rp->top)); + PSlineto(BigEndianValue(rp->right), BigEndianValue(rp->top)); + PSlineto(BigEndianValue(rp->right), BigEndianValue(rp->bottom)); PSclosepath(); - PSmoveto(CW(rp->left)-1, CW(rp->bottom)+1); - PSlineto(CW(rp->right)+1, CW(rp->bottom)+1); - PSlineto(CW(rp->right)+1, CW(rp->top)-1); - PSlineto(CW(rp->left)-1, CW(rp->top)-1); + PSmoveto(BigEndianValue(rp->left)-1, BigEndianValue(rp->bottom)+1); + PSlineto(BigEndianValue(rp->right)+1, BigEndianValue(rp->bottom)+1); + PSlineto(BigEndianValue(rp->right)+1, BigEndianValue(rp->top)-1); + PSlineto(BigEndianValue(rp->left)-1, BigEndianValue(rp->top)-1); PSclip(); - rowbytes = ((CW(rp->right) - CW(rp->left)) * 72 + 72 * 8 - 1)/ 72 / 8; - numrows = ((CW(rp->bottom) - CW(rp->top)) * 72 + 71) / 72; + rowbytes = ((BigEndianValue(rp->right) - BigEndianValue(rp->left)) * 72 + 72 * 8 - 1)/ 72 / 8; + numrows = ((BigEndianValue(rp->bottom) - BigEndianValue(rp->top)) * 72 + 71) / 72; if (rowbytes > 0 && numrows > 0) { numbytesneeded = rowbytes * numrows; TEMP_ALLOC_ALLOCATE (bytes, temp_alloc_space, numbytesneeded); - toshift = (CW(rp->left) - CW(thePortp->portBits.bounds.left)) & 7; + toshift = (BigEndianValue(rp->left) - BigEndianValue(thePortp->portBits.bounds.left)) & 7; for (i = 0; i < 8; ++i) pat[i] = (patp[i] << toshift) | (patp[i]>>(8 - toshift)); p = bytes; - for (i = CW(rp->top) - CW(thePortp->portBits.bounds.top); - i < CW(rp->top) + numrows - CW(thePortp->portBits.bounds.top); + for (i = BigEndianValue(rp->top) - BigEndianValue(thePortp->portBits.bounds.top); + i < BigEndianValue(rp->top) + numrows - BigEndianValue(thePortp->portBits.bounds.top); ++i) { c = pat[i&7]; @@ -741,7 +742,7 @@ static void doimage(LONGINT verb, comRect *rp, comGrafPtr thePortp) for (j = rowbytes; --j >= 0;) *p++ = c; } - PStranslate(CW(rp->left), CW(rp->top)); + PStranslate(BigEndianValue(rp->left), BigEndianValue(rp->top)); #if !defined(DONTSENDBIGARRAYS) PSsendchararray((char *) bytes, numbytesneeded); #endif /* DONTSENDBIGARRAYS */ @@ -861,8 +862,8 @@ you back to the intial (unbounded) clip path */ (rp->top != CWC (-32767) && rp->top != CWC (-32768)) || rp->right != CWC (32767) || rp->bottom != CWC (32767)) - PSrectclip (CW (rp->left), CW (rp->top), - CW (rp->right) - CW(rp->left), CW (rp->bottom) - CW (rp->top)); + PSrectclip (BigEndianValue (rp->left), BigEndianValue (rp->top), + BigEndianValue (rp->right) - BigEndianValue(rp->left), BigEndianValue (rp->bottom) - BigEndianValue (rp->top)); restore_virtual_ints (block); } @@ -884,8 +885,8 @@ static void commonupdate(comGrafPtr thePortp) if (thePortp->portBits.bounds.top != printport.portBits.bounds.top || thePortp->portBits.bounds.left != printport.portBits.bounds.left) { - dx = CW(printport.portBits.bounds.left) - CW(thePortp->portBits.bounds.left); - dy = CW(printport.portBits.bounds.top) - CW(thePortp->portBits.bounds.top); + dx = BigEndianValue(printport.portBits.bounds.left) - BigEndianValue(thePortp->portBits.bounds.left); + dy = BigEndianValue(printport.portBits.bounds.top) - BigEndianValue(thePortp->portBits.bounds.top); PStranslate(dx, dy); printport.portBits.bounds = thePortp->portBits.bounds; } @@ -900,7 +901,7 @@ static void commonupdate(comGrafPtr thePortp) if (thePortp->pnLoc.h != printport.pnLoc.h || thePortp->pnLoc.v != printport.pnLoc.v) { - PSmoveto(CW(thePortp->pnLoc.h), CW(thePortp->pnLoc.v)); + PSmoveto(BigEndianValue(thePortp->pnLoc.h), BigEndianValue(thePortp->pnLoc.v)); printport.pnLoc = thePortp->pnLoc; } @@ -1260,11 +1261,11 @@ void NeXTSetText(StringPtr fname, LONGINT txFace, LONGINT txSize, PRIVATE void SmartGetFontName (comGrafPtr thePortp, StringPtr fname) { - C_GetFontName (CW (thePortp->txFont), fname); + C_GetFontName (BigEndianValue (thePortp->txFont), fname); if (!fname[0]) - C_GetFontName (CW (ApFontID), fname); + C_GetFontName (BigEndianValue (ApFontID), fname); if (!fname[0]) - C_GetFontName (CW (SysFontFam), fname); + C_GetFontName (BigEndianValue (SysFontFam), fname); } /* @@ -1284,8 +1285,8 @@ static void txupdate(comGrafPtr thePortp) thePortp->txSize != printport.txSize || thePortp->spExtra != printport.spExtra) { SmartGetFontName(thePortp, fname); - NeXTSetText(fname, thePortp->txFace, CW(thePortp->txSize), - CL(thePortp->spExtra)); + NeXTSetText(fname, thePortp->txFace, BigEndianValue(thePortp->txSize), + BigEndianValue(thePortp->spExtra)); printport.txFont = thePortp->txFont; printport.txFace = thePortp->txFace; printport.txSize = thePortp->txSize; @@ -1299,7 +1300,7 @@ void pnupdate(comGrafPtr thePortp) #if 0 if (thePortp->pnSize.h != printport.pnSize.h || thePortp->pnSize.v != printport.pnSize.v) { - NeXTSetWidth(CW(thePortp->pnSize)); + NeXTSetWidth(BigEndianValue(thePortp->pnSize)); printport.pnSize = thePortp->pnSize; } #endif @@ -1328,18 +1329,18 @@ void pnupdate(comGrafPtr thePortp) froma = -90 + starta + arca; toa = -90 + starta; } - midx = ((float)CW(rp->left) + CW(rp->right ))/2; - midy = ((float)CW(rp->top) + CW(rp->bottom))/2; - xdiam = CW(rp->right) - CW(rp->left); - ydiam = CW(rp->bottom) - CW(rp->top); + midx = ((float)BigEndianValue(rp->left) + BigEndianValue(rp->right ))/2; + midy = ((float)BigEndianValue(rp->top) + BigEndianValue(rp->bottom))/2; + xdiam = BigEndianValue(rp->right) - BigEndianValue(rp->left); + ydiam = BigEndianValue(rp->bottom) - BigEndianValue(rp->top); PStranslate(midx, (midy)); PSnewpath(); PSscale(1, ydiam/xdiam); PSarc(0, 0, xdiam/2, froma, toa); if (verb == frameVerb) { - psh = CW(thePortp->pnSize.h); - psv = CW(thePortp->pnSize.v); + psh = BigEndianValue(thePortp->pnSize.h); + psv = BigEndianValue(thePortp->pnSize.v); if (ydiam > (2 * psv) && xdiam > (2 * psh)) { PSscale(1, xdiam/ydiam * (ydiam - 2*psv) / (xdiam - 2*psh)); PSarcn(0, 0, xdiam/2 - psh, toa, froma); @@ -1412,10 +1413,10 @@ void pnupdate(comGrafPtr thePortp) indexed_color_p = FALSE; block = block_virtual_ints (); commonupdate(thePortp); - srcwidth = CW(srcrp->right) - CW(srcrp->left); - srcheight = CW(srcrp->bottom) - CW(srcrp->top); - dstwidth = CW(dstrp->right) - CW(dstrp->left); - dstheight = CW(dstrp->bottom) - CW(dstrp->top); + srcwidth = BigEndianValue(srcrp->right) - BigEndianValue(srcrp->left); + srcheight = BigEndianValue(srcrp->bottom) - BigEndianValue(srcrp->top); + dstwidth = BigEndianValue(dstrp->right) - BigEndianValue(dstrp->left); + dstheight = BigEndianValue(dstrp->bottom) - BigEndianValue(dstrp->top); if (srcwidth && srcheight && dstwidth && dstheight) /* put in for output */ { /* from Tex-Edit 2.5 */ /* see the comment at the grestore below */ @@ -1427,7 +1428,7 @@ void pnupdate(comGrafPtr thePortp) if (srcbmp->rowBytes & CWC(0x8000)) { srcpmp = (comPixMap *) srcbmp; - pixelsize = CW(srcpmp->pixelSize); + pixelsize = BigEndianValue(srcpmp->pixelSize); if (pixelsize != 1 && mode != srcCopy) /*-->*/ goto DONE; direct_color_p = pixelsize > 8; @@ -1439,11 +1440,11 @@ void pnupdate(comGrafPtr thePortp) srcpmp = 0; pixelsize = 1; } - rowbytes = CW(srcbmp->rowBytes) & ROWMASK; + rowbytes = BigEndianValue(srcbmp->rowBytes) & ROWMASK; - PStranslate(CW(dstrp->left), CW(dstrp->top)); + PStranslate(BigEndianValue(dstrp->left), BigEndianValue(dstrp->top)); baseaddr = (unsigned char *)MR(srcbmp->baseAddr) - + (CW(srcrp->top) - CW(srcbmp->bounds.top)) * (LONGINT) rowbytes; + + (BigEndianValue(srcrp->top) - BigEndianValue(srcbmp->bounds.top)) * (LONGINT) rowbytes; /* NOTE: now that we don't send big arrays, I believe that doing the transformation below is a memory waste... Shouldn't we @@ -1467,7 +1468,7 @@ void pnupdate(comGrafPtr thePortp) matrix[1] = 0; matrix[2] = 0; matrix[3] = 1 / scaley; - matrix[4] = CW(srcrp->left) - CW(srcbmp->bounds.left); + matrix[4] = BigEndianValue(srcrp->left) - BigEndianValue(srcbmp->bounds.left); matrix[5] = 0; numbytes = ((int) srcwidth * pixelsize + 7) / 8; @@ -1533,15 +1534,15 @@ void pnupdate(comGrafPtr thePortp) unsigned char g; unsigned char b; - if (CW (ctab[i].value) != i && !has_warned_p) + if (BigEndianValue (ctab[i].value) != i && !has_warned_p) { warning_unexpected ("value = %d, i = %d", - CW (ctab[i].value), i); + BigEndianValue (ctab[i].value), i); has_warned_p = TRUE; } - r = CW (ctab[i].rgb.red ) >> 8; - g = CW (ctab[i].rgb.green) >> 8; - b = CW (ctab[i].rgb.blue ) >> 8; + r = BigEndianValue (ctab[i].rgb.red ) >> 8; + g = BigEndianValue (ctab[i].rgb.green) >> 8; + b = BigEndianValue (ctab[i].rgb.blue ) >> 8; DPSPrintf (DPSGetCurrentContext (), "%02x%02x%02x%c", r, g, b, (i % 8) == 7 ? '\n' : ' '); } @@ -1590,9 +1591,9 @@ void pnupdate(comGrafPtr thePortp) block = block_virtual_ints (); pnupdate(thePortp); - if (CW(thePortp->pnSize.h) || CW(thePortp->pnSize.v)) { - fromh = CW(thePortp->pnLoc.h); - fromv = CW(thePortp->pnLoc.v); + if (BigEndianValue(thePortp->pnSize.h) || BigEndianValue(thePortp->pnSize.v)) { + fromh = BigEndianValue(thePortp->pnLoc.h); + fromv = BigEndianValue(thePortp->pnLoc.v); toh = to.h; tov = to.v; @@ -1604,24 +1605,24 @@ void pnupdate(comGrafPtr thePortp) fromv = tov; tov = temp; } - psh = CW(thePortp->pnSize.h); - psv = CW(thePortp->pnSize.v); - r.right = CW(toh + psh); - r.left = CW(fromh); + psh = BigEndianValue(thePortp->pnSize.h); + psv = BigEndianValue(thePortp->pnSize.v); + r.right = BigEndianValue(toh + psh); + r.left = BigEndianValue(fromh); PSgsave(); PSnewpath(); PSmoveto(fromh, fromv); if (fromv < tov) { - r.top = CW(fromv); - r.bottom = CW(tov + psv); + r.top = BigEndianValue(fromv); + r.bottom = BigEndianValue(tov + psv); PSlineto(fromh + psh, fromv); PSlineto(toh + psh, tov); PSlineto(toh + psh, tov + psv); PSlineto(toh, tov + psv); PSlineto(fromh, fromv + psv); } else { - r.top = CW(tov); - r.bottom = CW(fromv + psv); + r.top = BigEndianValue(tov); + r.bottom = BigEndianValue(fromv + psv); PSlineto(toh, tov); PSlineto(toh + psh, tov); PSlineto(toh + psh, tov + psv); @@ -1662,19 +1663,19 @@ void pnupdate(comGrafPtr thePortp) block = block_virtual_ints (); pnupdate(thePortp); pp = MR(*ph)->polyPoints; - ep = (comPoint *) ((char *)MR(*ph) + CW((MR(*ph))->polySize)); - firstp.h = CW(pp[0].h); - firstp.v = CW(pp[0].v); + ep = (comPoint *) ((char *)MR(*ph) + BigEndianValue((MR(*ph))->polySize)); + firstp.h = BigEndianValue(pp[0].h); + firstp.v = BigEndianValue(pp[0].v); thePortp->pnLoc = pp[0]; - if (CW(ep[-1].h) == firstp.h && CW(ep[-1].v) == firstp.v) + if (BigEndianValue(ep[-1].h) == firstp.h && BigEndianValue(ep[-1].v) == firstp.v) ep--; if (ep > pp) { if (verb == frameVerb) { PSmoveto(firstp.h, firstp.v); for (++pp; pp < ep; pp++) { - pt.h = CW(pp[0].h); - pt.v = CW(pp[0].v); + pt.h = BigEndianValue(pp[0].h); + pt.v = BigEndianValue(pp[0].v); NeXTPrLine(pt, thePortp); thePortp->pnLoc = pp[0]; } @@ -1684,7 +1685,7 @@ void pnupdate(comGrafPtr thePortp) PSnewpath(); PSmoveto(firstp.h, firstp.v); for (++pp; pp < ep; pp++) { - PSlineto(CW(pp->h), CW(pp->v)); + PSlineto(BigEndianValue(pp->h), BigEndianValue(pp->v)); } PSlineto(firstp.h, firstp.v); PSclosepath(); @@ -1711,29 +1712,29 @@ void pnupdate(comGrafPtr thePortp) block = block_virtual_ints (); pnupdate(thePortp); sfactor = (float)height/width; - midy = ((float)CW(rp->top) + CW(rp->bottom))/2; + midy = ((float)BigEndianValue(rp->top) + BigEndianValue(rp->bottom))/2; PSgsave(); PSnewpath(); PSscale(1, sfactor); - PSmoveto(CW(rp->left), midy/sfactor); - rl = CW(rp->left); - rr = CW(rp->right); - rt = CW(rp->top)/sfactor; - rb = CW(rp->bottom)/sfactor; + PSmoveto(BigEndianValue(rp->left), midy/sfactor); + rl = BigEndianValue(rp->left); + rr = BigEndianValue(rp->right); + rt = BigEndianValue(rp->top)/sfactor; + rb = BigEndianValue(rp->bottom)/sfactor; PSarct(rl, rb, rr, rb, (float)width / 2); PSarct(rr, rb, rr, rt, (float)width / 2); PSarct(rr, rt, rl, rt, (float)width / 2); PSarct(rl, rt, rl, rb, (float)width / 2); PSclosepath(); if (verb == frameVerb) { - psh = CW(thePortp->pnSize.h); - psv = CW(thePortp->pnSize.v); + psh = BigEndianValue(thePortp->pnSize.h); + psv = BigEndianValue(thePortp->pnSize.v); sfactor2 = ((float)height - 2*psv) / (width - 2*psh) / sfactor; - rl = CW(rp->left) + psh; - rr = CW(rp->right) - psh; - rt = CW(rp->top) + psv/sfactor2; - rb = CW(rp->bottom) - psv/sfactor2; + rl = BigEndianValue(rp->left) + psh; + rr = BigEndianValue(rp->right) - psh; + rt = BigEndianValue(rp->top) + psv/sfactor2; + rb = BigEndianValue(rp->bottom) - psv/sfactor2; PSscale(1, sfactor2); PSmoveto(rl, midy/sfactor); @@ -1763,18 +1764,18 @@ void pnupdate(comGrafPtr thePortp) pnupdate(thePortp); PSgsave(); PSnewpath(); - PSmoveto(CW(rp->left) , CW(rp->top)); - PSlineto(CW(rp->left) , CW(rp->bottom)); - PSlineto(CW(rp->right), CW(rp->bottom)); - PSlineto(CW(rp->right), CW(rp->top)); + PSmoveto(BigEndianValue(rp->left) , BigEndianValue(rp->top)); + PSlineto(BigEndianValue(rp->left) , BigEndianValue(rp->bottom)); + PSlineto(BigEndianValue(rp->right), BigEndianValue(rp->bottom)); + PSlineto(BigEndianValue(rp->right), BigEndianValue(rp->top)); PSclosepath(); if (verb == frameVerb) { - psh = CW(thePortp->pnSize.h); - psv = CW(thePortp->pnSize.v); - PSmoveto(CW(rp->left) + psh, CW(rp->top) + psv); - PSlineto(CW(rp->right) - psh, CW(rp->top) + psv); - PSlineto(CW(rp->right) - psh, CW(rp->bottom) - psv); - PSlineto(CW(rp->left) + psh, CW(rp->bottom) - psv); + psh = BigEndianValue(thePortp->pnSize.h); + psv = BigEndianValue(thePortp->pnSize.v); + PSmoveto(BigEndianValue(rp->left) + psh, BigEndianValue(rp->top) + psv); + PSlineto(BigEndianValue(rp->right) - psh, BigEndianValue(rp->top) + psv); + PSlineto(BigEndianValue(rp->right) - psh, BigEndianValue(rp->bottom) - psv); + PSlineto(BigEndianValue(rp->left) + psh, BigEndianValue(rp->bottom) - psv); PSclosepath(); } PSclip(); @@ -1804,7 +1805,7 @@ void pnupdate(comGrafPtr thePortp) (Ptr) p, &num, &den, NULL); restore_virtual_ints (block); RESTOREA5; - return (float) retval * CW (num.h) / CW (den.h); + return (float) retval * BigEndianValue (num.h) / BigEndianValue (den.h); } static int numspacesin(const char *str) @@ -1846,9 +1847,9 @@ static void dopsunderline(comGrafPtr thePortp, short total, substitute_font_if_needed (&font, 0, &need_to_free); PSgsave(); PSnewpath(); - PSsendfloat(CW(thePortp->pnLoc.h)); - PSsendfloat(CW(thePortp->pnLoc.v)); - PSsendfloat(CW(thePortp->txSize)); + PSsendfloat(BigEndianValue(thePortp->pnLoc.h)); + PSsendfloat(BigEndianValue(thePortp->pnLoc.v)); + PSsendfloat(BigEndianValue(thePortp->txSize)); PSsendchararray(font, strlen(font)); if (need_to_free) free (font); @@ -2128,8 +2129,8 @@ static void doashow(char *translated, LONGINT n, int i, short total) { PSgsave (); DPSPrintf (DPSGetCurrentContext (), "initclip\n"); - PStranslate (CW (thePortp->pnLoc.h) + rotation.center_x, - CW (thePortp->pnLoc.v) + rotation.center_y); + PStranslate (BigEndianValue (thePortp->pnLoc.h) + rotation.center_x, + BigEndianValue (thePortp->pnLoc.v) + rotation.center_y); PSrotate (rotation.angle); PSmoveto (-rotation.center_x, -rotation.center_y); } @@ -2167,7 +2168,7 @@ static void doashow(char *translated, LONGINT n, int i, short total) substitute_fonts_p && (thePortp->txFont == CWC (geneva)), translated, n); - thePortp->pnLoc.h = CW(CW(thePortp->pnLoc.h) + total); + thePortp->pnLoc.h = BigEndianValue(BigEndianValue(thePortp->pnLoc.h) + total); printport.pnLoc.h = thePortp->pnLoc.h; } if (rotation.rotated_p) diff --git a/src/SpeechManager-MacBridge.cpp b/src/SpeechManager-MacBridge.cpp index fa33e2b9..1bb34b2d 100644 --- a/src/SpeechManager-MacBridge.cpp +++ b/src/SpeechManager-MacBridge.cpp @@ -12,6 +12,8 @@ #include "MemoryMgr.h" #include "SpeechManager-MacBridge.h" +using namespace ByteSwap; + Executor::NumVersion MacBridge::SpeechManagerVersion (void) { #if 0 @@ -34,13 +36,15 @@ Executor::NumVersion MacBridge::SpeechManagerVersion (void) int16 MacBridge::SpeechBusy (void) { SInt16 toRet = ::SpeechBusy(); - return CW(toRet); + + return BigEndianValue(toRet); } int16 MacBridge::SpeechBusySystemWide(void) { SInt16 toRet = ::SpeechBusySystemWide(); - return CW(toRet); + + return BigEndianValue(toRet); } Executor::OSErr MacBridge::CountVoices (int16 *numVoices) @@ -51,31 +55,29 @@ Executor::OSErr MacBridge::CountVoices (int16 *numVoices) SInt16 voiceCount = 0; ::OSErr toRet = ::CountVoices(&voiceCount); - *numVoices = CW(voiceCount); - return CW(toRet); - return noErr; - + *numVoices = BigEndianValue(voiceCount); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::DisposeSpeechChannel (Executor::SpeechChannel chan) { ::OSErr toRet = ::DisposeSpeechChannel((::SpeechChannel)chan); - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::SpeakString (Executor::Str255 textToBeSpoken) { ::OSErr toRet = ::SpeakString(textToBeSpoken); - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::StopSpeech (Executor::SpeechChannel chan) { ::OSErr toRet = ::StopSpeech((::SpeechChannel)chan); - return CW(toRet); + return BigEndianValue(toRet); } @@ -83,13 +85,13 @@ Executor::OSErr MacBridge::ContinueSpeech (Executor::SpeechChannel chan) { ::OSErr toRet = ::StopSpeech((::SpeechChannel)chan); - return CW(toRet); + return BigEndianValue(toRet); } static inline void MacVoiceSpecToExecutorVoiceSpec(Executor::VoiceSpec* ExecutorVoice, ::VoiceSpec *MacVoice) { - ExecutorVoice->creator = CL(MacVoice->creator); - ExecutorVoice->id = CL(MacVoice->id); + ExecutorVoice->creator = BigEndianValue(MacVoice->creator); + ExecutorVoice->id = BigEndianValue(MacVoice->id); } Executor::OSErr MacBridge::GetIndVoice (int16 index, Executor::VoiceSpec *voice) @@ -98,58 +100,64 @@ Executor::OSErr MacBridge::GetIndVoice (int16 index, Executor::VoiceSpec *voice) if (!voice) { return CWC((Executor::OSErr)paramErr); } - ::OSErr toRet = ::GetIndVoice(CW(index), &macVoice); + ::OSErr toRet = ::GetIndVoice(BigEndianValue(index), &macVoice); MacVoiceSpecToExecutorVoiceSpec(voice, &macVoice); - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::NewSpeechChannel (Executor::VoiceSpec *voice, Executor::SpeechChannel *chan) { - return noErr; + ::VoiceSpec macVoice = {.creator = (OSType)BigEndianValue(voice->creator), + .id = (OSType)BigEndianValue(voice->id)}; + ::OSErr toRet = ::NewSpeechChannel(&macVoice, (::SpeechChannel*)chan); + + MacVoiceSpecToExecutorVoiceSpec(voice, &macVoice); + + return BigEndianValue(toRet); } Executor::OSErr MacBridge::StopSpeechAt (Executor::SpeechChannel chan, int32 whereToStop) { - ::OSErr toRet = ::StopSpeechAt((::SpeechChannel)chan, CL(whereToStop)); + ::OSErr toRet = ::StopSpeechAt((::SpeechChannel)chan, BigEndianValue(whereToStop)); - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::PauseSpeechAt (Executor::SpeechChannel chan, int32 whereToPause) { - ::OSErr toRet = ::PauseSpeechAt((::SpeechChannel)chan, CL(whereToPause)); + ::OSErr toRet = ::PauseSpeechAt((::SpeechChannel)chan, BigEndianValue(whereToPause)); - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::SetSpeechRate(Executor::SpeechChannel chan, Executor::Fixed rate) { - ::OSErr toRet = ::SetSpeechRate((::SpeechChannel)chan, CL(rate)); + ::OSErr toRet = ::SetSpeechRate((::SpeechChannel)chan, BigEndianValue(rate)); - return CW(toRet); + return BigEndianValue(toRet); } -PUBLIC Executor::OSErr MacBridge::GetSpeechRate (Executor::SpeechChannel chan, Executor::Fixed *rate) +Executor::OSErr MacBridge::GetSpeechRate (Executor::SpeechChannel chan, Executor::Fixed *rate) { if (!rate) { return CWC((Executor::OSErr)paramErr); } ::OSErr toRet; - ::Fixed ourFixed = CL(*rate); + ::Fixed ourFixed = BigEndianValue(*rate); toRet = ::GetSpeechRate((::SpeechChannel)chan, &ourFixed); - *rate = CL(ourFixed); + *rate = BigEndianValue(ourFixed); - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::SetSpeechPitch (Executor::SpeechChannel chan, Executor::Fixed pitch) { - ::OSErr toRet = ::SetSpeechPitch((::SpeechChannel)chan, CL(pitch)); + ::OSErr toRet = ::SetSpeechPitch((::SpeechChannel)chan, BigEndianValue(pitch)); - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::GetSpeechPitch (Executor::SpeechChannel chan, Executor::Fixed *pitch) @@ -158,18 +166,18 @@ Executor::OSErr MacBridge::GetSpeechPitch (Executor::SpeechChannel chan, Executo return CWC((Executor::OSErr)paramErr); } ::OSErr toRet; - ::Fixed ourFixed = CL(*pitch); + ::Fixed ourFixed = BigEndianValue(*pitch); toRet = ::GetSpeechRate((::SpeechChannel)chan, &ourFixed); - *pitch = CL(ourFixed); + *pitch = BigEndianValue(ourFixed); - return CW(toRet); + return BigEndianValue(toRet); } #undef NewHandle Executor::OSErr MacBridge::UseDictionary (Executor::SpeechChannel chan, Executor::Handle dictionary) { - ::Size ExecSize = CL(Executor::GetHandleSize(dictionary)); + ::Size ExecSize = BigEndianValue(Executor::GetHandleSize(dictionary)); ::Handle nativeHandle = ::NewHandle(ExecSize); memcpy(*nativeHandle, dictionary->p, ExecSize); @@ -177,26 +185,25 @@ Executor::OSErr MacBridge::UseDictionary (Executor::SpeechChannel chan, Executor ::DisposeHandle(nativeHandle); - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::MakeVoiceSpec (Executor::OSType creator, Executor::OSType id, Executor::VoiceSpec *voice) { if (!voice) { - return CW((Executor::OSErr)paramErr); + return CWC((Executor::OSErr)paramErr); } ::VoiceSpec nativeSpec = {0}; - ::OSErr toRet = ::MakeVoiceSpec(CL(creator), CL(id), &nativeSpec); + ::OSErr toRet = ::MakeVoiceSpec(BigEndianValue(creator), BigEndianValue(id), &nativeSpec); MacVoiceSpecToExecutorVoiceSpec(voice, &nativeSpec); - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::GetVoiceDescription ( const Executor::VoiceSpec *voice, Executor::VoiceDescription *info, - Executor::LONGINT infoLength - ) + Executor::LONGINT infoLength) { return noErr; @@ -205,7 +212,7 @@ Executor::OSErr MacBridge::GetVoiceDescription ( Executor::OSErr MacBridge::GetVoiceInfo (const Executor::VoiceSpec *voice, Executor::OSType selector, void *voiceInfo) { // TODO: handle different data types - ::OSErr toRet = ::GetVoiceInfo((const ::VoiceSpec*)voice, CL(selector), voiceInfo); + ::OSErr toRet = ::GetVoiceInfo((const ::VoiceSpec*)voice, BigEndianValue(selector), voiceInfo); switch (selector) { case CLC(soVoiceFile): @@ -213,6 +220,7 @@ Executor::OSErr MacBridge::GetVoiceInfo (const Executor::VoiceSpec *voice, Execu //TODO: error checking unsigned char cLocation[PATH_MAX] = {0}; ::VoiceFileInfo *theFile = (::VoiceFileInfo*)voiceInfo; + //OS X's and Executor's FSSpecs WILL point to different files. ::FSSpec tmpSpec = theFile->fileSpec; ::FSRef tmpRef = {0}; ::CFURLRef tmpURL = NULL; @@ -221,28 +229,46 @@ Executor::OSErr MacBridge::GetVoiceInfo (const Executor::VoiceSpec *voice, Execu ::CFStringRef fileName = CFURLCopyLastPathComponent(tmpURL); ::CFURLGetFileSystemRepresentation(tmpURL, false, cLocation, sizeof(cLocation)); Executor::Str255 strName = {0}; - CFStringGetPascalString(fileName, strName, sizeof(strName), kCFStringEncodingMacRoman); + CFStringGetPascalString(fileName, strName, sizeof(strName) - 1, kCFStringEncodingMacRoman); Executor::HVCB *customPart = Executor::ROMlib_vcbbybiggestunixname((const char*)cLocation); Executor::FSSpecPtr tmpSpecPtr = (Executor::FSSpecPtr)&theFile->fileSpec; Executor::C_FSMakeFSSpec(customPart->vcbDrvNum, customPart->vcbDirIDM, strName, tmpSpecPtr); - theFile->resID = CW(theFile->resID); + theFile->resID = BigEndianValue(theFile->resID); ::CFRelease(tmpURL); ::CFRelease(fileName); + } + break; + + case CLC(soVoiceDescription): + { + Executor::VoiceSpec exVSpec = {0}; + ::VoiceDescription* voiDesc = (::VoiceDescription*)voiceInfo; + voiDesc->length = BigEndianValue(voiDesc->length); + MacVoiceSpecToExecutorVoiceSpec(&exVSpec, &voiDesc->voice); + memcpy(&voiDesc->voice, &exVSpec, sizeof(exVSpec)); + voiDesc->version = BigEndianValue(voiDesc->version); + voiDesc->gender = BigEndianValue(voiDesc->gender); + voiDesc->age = BigEndianValue(voiDesc->age); + voiDesc->script = BigEndianValue(voiDesc->script); + voiDesc->language = BigEndianValue(voiDesc->language); + voiDesc->region = BigEndianValue(voiDesc->region); + //voiDesc->voice.creator + } break; default: break; } - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::SpeakText (Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes) { - ::OSErr toRet = ::SpeakText((::SpeechChannel)chan, textBuf, CL(textBytes)); + ::OSErr toRet = ::SpeakText((::SpeechChannel)chan, textBuf, BigEndianValue(textBytes)); - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::SetSpeechInfo ( @@ -252,9 +278,9 @@ Executor::OSErr MacBridge::SetSpeechInfo ( ) { // TODO: handle different data types - ::OSErr toRet = ::SetSpeechInfo((::SpeechChannel)chan, CL(selector), speechInfo); + ::OSErr toRet = ::SetSpeechInfo((::SpeechChannel)chan, BigEndianValue(selector), speechInfo); - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::GetSpeechInfo ( @@ -264,9 +290,9 @@ Executor::OSErr MacBridge::GetSpeechInfo ( ) { // TODO: handle different data types - ::OSErr toRet = ::GetSpeechInfo((::SpeechChannel)chan, CL(selector), speechInfo); + ::OSErr toRet = ::GetSpeechInfo((::SpeechChannel)chan, BigEndianValue(selector), speechInfo); - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::SpeakBuffer ( @@ -276,23 +302,23 @@ Executor::OSErr MacBridge::SpeakBuffer ( int32 controlFlags ) { - ::OSErr toRet = ::SpeakBuffer((::SpeechChannel)chan, textBuf, CL(textBytes), CL(controlFlags)); + ::OSErr toRet = ::SpeakBuffer((::SpeechChannel)chan, textBuf, BigEndianValue(textBytes), BigEndianValue(controlFlags)); - return CW(toRet); + return BigEndianValue(toRet); } Executor::OSErr MacBridge::TextToPhonemes (Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes, Executor::Handle phonemeBuf, Executor::LONGINT *phonemeBytes) { - ::Size ExecSize = CL(Executor::GetHandleSize(phonemeBuf)); + ::Size ExecSize = BigEndianValue(Executor::GetHandleSize(phonemeBuf)); ::Handle nativeHandle = ::NewHandle(ExecSize); - long tempPhonemes = CL(*phonemeBytes); + long tempPhonemes = BigEndianValue(*phonemeBytes); Executor::LONGINT intPhonemes; memcpy(*nativeHandle, phonemeBuf->p, ExecSize); - ::OSErr toRet = ::TextToPhonemes((::SpeechChannel)chan, textBuf, CL(textBytes), nativeHandle, &tempPhonemes); + ::OSErr toRet = ::TextToPhonemes((::SpeechChannel)chan, textBuf, BigEndianValue(textBytes), nativeHandle, &tempPhonemes); intPhonemes = tempPhonemes; - *phonemeBytes = CL(intPhonemes); + *phonemeBytes = BigEndianValue(intPhonemes); ::DisposeHandle(nativeHandle); - return CW(toRet); + return BigEndianValue(toRet); } diff --git a/src/SpeechManager-MacBridge.h b/src/SpeechManager-MacBridge.h index 18eeab0c..c5e8014b 100644 --- a/src/SpeechManager-MacBridge.h +++ b/src/SpeechManager-MacBridge.h @@ -11,55 +11,57 @@ #include "SpeechManager.h" +#define __private_extern __attribute__((visibility("hidden"))) + namespace MacBridge { - PUBLIC Executor::NumVersion SpeechManagerVersion (void); - PUBLIC int16 SpeechBusy (void); - PUBLIC int16 SpeechBusySystemWide(void); - PUBLIC Executor::OSErr CountVoices (int16 *numVoices); - PUBLIC Executor::OSErr DisposeSpeechChannel (Executor::SpeechChannel chan); - PUBLIC Executor::OSErr SpeakString (Executor::Str255 textToBeSpoken); + __private_extern Executor::NumVersion SpeechManagerVersion (void); + __private_extern int16 SpeechBusy (void); + __private_extern int16 SpeechBusySystemWide(void); + __private_extern Executor::OSErr CountVoices (int16 *numVoices); + __private_extern Executor::OSErr DisposeSpeechChannel (Executor::SpeechChannel chan); + __private_extern Executor::OSErr SpeakString (Executor::Str255 textToBeSpoken); - PUBLIC Executor::OSErr StopSpeech (Executor::SpeechChannel chan); - PUBLIC Executor::OSErr ContinueSpeech (Executor::SpeechChannel chan); + __private_extern Executor::OSErr StopSpeech (Executor::SpeechChannel chan); + __private_extern Executor::OSErr ContinueSpeech (Executor::SpeechChannel chan); - PUBLIC Executor::OSErr GetIndVoice (int16 index, Executor::VoiceSpec *voice); - PUBLIC Executor::OSErr NewSpeechChannel (Executor::VoiceSpec *voice, Executor::SpeechChannel *chan); - PUBLIC Executor::OSErr StopSpeechAt (Executor::SpeechChannel chan, int32 whereToStop); - PUBLIC Executor::OSErr PauseSpeechAt (Executor::SpeechChannel chan, int32 whereToPause); - PUBLIC Executor::OSErr SetSpeechRate(Executor::SpeechChannel chan, Executor::Fixed rate); - PUBLIC Executor::OSErr GetSpeechRate (Executor::SpeechChannel chan, Executor::Fixed *rate); - PUBLIC Executor::OSErr SetSpeechPitch (Executor::SpeechChannel chan, Executor::Fixed pitch); - PUBLIC Executor::OSErr GetSpeechPitch (Executor::SpeechChannel chan, Executor::Fixed *pitch); - PUBLIC Executor::OSErr UseDictionary (Executor::SpeechChannel chan, Executor::Handle dictionary); - PUBLIC Executor::OSErr MakeVoiceSpec (Executor::OSType creator, Executor::OSType id, Executor::VoiceSpec *voice); - PUBLIC Executor::OSErr GetVoiceDescription ( + __private_extern Executor::OSErr GetIndVoice (int16 index, Executor::VoiceSpec *voice); + __private_extern Executor::OSErr NewSpeechChannel (Executor::VoiceSpec *voice, Executor::SpeechChannel *chan); + __private_extern Executor::OSErr StopSpeechAt (Executor::SpeechChannel chan, int32 whereToStop); + __private_extern Executor::OSErr PauseSpeechAt (Executor::SpeechChannel chan, int32 whereToPause); + __private_extern Executor::OSErr SetSpeechRate(Executor::SpeechChannel chan, Executor::Fixed rate); + __private_extern Executor::OSErr GetSpeechRate (Executor::SpeechChannel chan, Executor::Fixed *rate); + __private_extern Executor::OSErr SetSpeechPitch (Executor::SpeechChannel chan, Executor::Fixed pitch); + __private_extern Executor::OSErr GetSpeechPitch (Executor::SpeechChannel chan, Executor::Fixed *pitch); + __private_extern Executor::OSErr UseDictionary (Executor::SpeechChannel chan, Executor::Handle dictionary); + __private_extern Executor::OSErr MakeVoiceSpec (Executor::OSType creator, Executor::OSType id, Executor::VoiceSpec *voice); + __private_extern Executor::OSErr GetVoiceDescription ( const Executor::VoiceSpec *voice, Executor::VoiceDescription *info, Executor::LONGINT infoLength ); - PUBLIC Executor::OSErr GetVoiceInfo ( + __private_extern Executor::OSErr GetVoiceInfo ( const Executor::VoiceSpec *voice, Executor::OSType selector, void *voiceInfo ); - PUBLIC Executor::OSErr SpeakText (Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes); - PUBLIC Executor::OSErr SetSpeechInfo ( + __private_extern Executor::OSErr SpeakText (Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes); + __private_extern Executor::OSErr SetSpeechInfo ( Executor::SpeechChannel chan, Executor::OSType selector, const void *speechInfo ); - PUBLIC Executor::OSErr GetSpeechInfo ( + __private_extern Executor::OSErr GetSpeechInfo ( Executor::SpeechChannel chan, Executor::OSType selector, void *speechInfo ); - PUBLIC Executor::OSErr SpeakBuffer ( + __private_extern Executor::OSErr SpeakBuffer ( Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes, int32 controlFlags ); - PUBLIC Executor::OSErr TextToPhonemes (Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes, Executor::Handle phonemeBuf, Executor::LONGINT *phonemeBytes); + __private_extern Executor::OSErr TextToPhonemes (Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes, Executor::Handle phonemeBuf, Executor::LONGINT *phonemeBytes); } diff --git a/src/aboutbox.cpp b/src/aboutbox.cpp index 996224b7..47eb175a 100644 --- a/src/aboutbox.cpp +++ b/src/aboutbox.cpp @@ -56,6 +56,7 @@ char ROMlib_rcsid_aboutbox[] = #define COPYRIGHT_STRING_2 "All rights reserved." using namespace Executor; +using namespace ByteSwap; static struct { const char *name;char *text; ControlHandle ctl; } about_box_buttons[] = { { LICENSE_BUTTON_NAME, NULL /* generated on the fly from licensetext.c */, @@ -511,10 +512,10 @@ create_about_box () /* Set up the rectangle enclosing each button. */ r.top = CWC (ABOUT_BOX_HEIGHT - 30); r.bottom = CWC (ABOUT_BOX_HEIGHT - 30 + BUTTON_HEIGHT); - r.left = CW ((b * ABOUT_BOX_WIDTH / NELEM (about_box_buttons)) + r.left = BigEndianValue ((b * ABOUT_BOX_WIDTH / NELEM (about_box_buttons)) + (ABOUT_BOX_WIDTH / NELEM (about_box_buttons) - BUTTON_WIDTH) / 2); - r.right = CW (CW (r.left) + BUTTON_WIDTH); + r.right = BigEndianValue (BigEndianValue (r.left) + BUTTON_WIDTH); str255_from_c_string (str, about_box_buttons[b].name); about_box_buttons[b].ctl = NewControl (about_box, &r, str, TRUE, 0, @@ -601,7 +602,7 @@ draw_status_info (boolean_t executor_p) #define MB (1024 * 1024U) gestalt_success_p = (C_GestaltTablesOnly (gestaltLogicalRAMSize, &total_ram) == noErr); - total_ram = CL (total_ram); + total_ram = BigEndianValue (total_ram); if (gestalt_success_p) sprintf (total_ram_string, "%s%u.%02u MB", ram_tag, total_ram / MB, (total_ram % MB) * 100 / MB); @@ -661,7 +662,7 @@ event_loop (boolean_t executor_p) TEIdle (about_te); - switch (CW (evt.what)) { + switch (BigEndianValue (evt.what)) { case updateEvt: BeginUpdate (about_box); PenNormal (); @@ -692,7 +693,7 @@ event_loop (boolean_t executor_p) { char ch; - ch = CL (evt.message) & 0xFF; + ch = BigEndianValue (evt.message) & 0xFF; switch (ch) { case '\r': case NUMPAD_ENTER: diff --git a/src/adb.cpp b/src/adb.cpp index b5c7c9e1..b2abc78c 100644 --- a/src/adb.cpp +++ b/src/adb.cpp @@ -43,6 +43,7 @@ char ROMlib_rcsid_adb[] = */ using namespace Executor; +using namespace ByteSwap; PUBLIC void Executor::ADBReInit (void) @@ -150,7 +151,7 @@ call_patched_adb_vector (char *message) save_a0 = EM_A0; EM_D0 = SPOOFED_MOUSE_ADDR << 4; /* based on Apeiron's code */ EM_A0 = (unsigned long) US_TO_SYN68K(message); - CALL_EMULATOR ((syn68k_addr_t) CL ((long) adb_service_procp)); + CALL_EMULATOR ((syn68k_addr_t) BigEndianValue ((long) adb_service_procp)); EM_D0 = save_d0; EM_A0 = save_a0; } @@ -189,8 +190,8 @@ Executor::adb_apeiron_hack (boolean_t deltas_p, ...) boolean_t button_is_down; char message[3]; - x = CW (MouseLocation.h); - y = CW (MouseLocation.v); + x = BigEndianValue (MouseLocation.h); + y = BigEndianValue (MouseLocation.v); button_is_down = !(ROMlib_mods & btnState); /* begin code for PegLeg */ diff --git a/src/alias.cpp b/src/alias.cpp index 7e2de42e..fdf82fd4 100644 --- a/src/alias.cpp +++ b/src/alias.cpp @@ -28,6 +28,7 @@ char ROMlib_rcsid_alias[] = #define paramErr (-50) using namespace Executor; +using namespace ByteSwap; /* NOTE: if we want to be more like the Mac, we should have a 'fld#',0 resource that will have in it: type, four bytes of 0, pascal string, @@ -78,8 +79,8 @@ get_sys_vref_and_dirid (INTEGER *sys_vrefp, LONGINT *sys_diridp) err = PBGetWDInfo (&wdp, FALSE); if (err == noErr) { - *sys_vrefp = CW (wdp.ioWDVRefNum); - *sys_diridp = CL (wdp.ioWDDirID); + *sys_vrefp = BigEndianValue (wdp.ioWDVRefNum); + *sys_diridp = BigEndianValue (wdp.ioWDDirID); } return err; } @@ -111,7 +112,7 @@ try_to_find (INTEGER vref, const char *str, INTEGER *vrefp, LONGINT *diridp) { warning_trace_info ("ino = %ld, ufs.ino = %ld", (long) ST_INO (sbuf), (long) vcbextrap->u.ufs.ino); - if (vref != CW (vcbp->vcbVRefNum)) + if (vref != BigEndianValue (vcbp->vcbVRefNum)) err = fnfErr; else { @@ -142,7 +143,7 @@ look_for_volume (const char *vol_name, INTEGER *vrefp, LONGINT *diridp) retval = PBGetVInfo (&pbr, FALSE); if (retval == noErr) { - *vrefp = CW (pbr.volumeParam.ioVRefNum); + *vrefp = BigEndianValue (pbr.volumeParam.ioVRefNum); *diridp = 2; } return retval; @@ -160,7 +161,7 @@ last_chance_tmp_vref_and_dirid (INTEGER vref, INTEGER *tmp_vrefp, OSErr retval; HParamBlockRec pb = {0}; - pb.volumeParam.ioVRefNum = CW (vref); + pb.volumeParam.ioVRefNum = BigEndianValue (vref); retval = PBHGetVInfo (&pb, FALSE); if (retval == noErr) { static const unsigned char *top_level_names[] = { @@ -184,7 +185,7 @@ last_chance_tmp_vref_and_dirid (INTEGER vref, INTEGER *tmp_vrefp, hpb.dirInfo.ioDrDirID = CLC (2); err = PBGetCatInfo (&hpb, FALSE); if (err == noErr && (hpb.hFileInfo.ioFlAttrib & ATTRIB_ISADIR)) - *tmp_diridp = CL (hpb.dirInfo.ioDrDirID); + *tmp_diridp = BigEndianValue (hpb.dirInfo.ioDrDirID); } if (err != noErr) *tmp_diridp = CLC (2); @@ -261,14 +262,14 @@ test_directory (INTEGER vref, LONGINT dirid, const char *sub_dirp, str255_from_c_string (file_name, sub_dirp); cpb.hFileInfo.ioNamePtr = (StringPtr) RM ((Ptr) file_name); - cpb.hFileInfo.ioVRefNum = CW (vref); + cpb.hFileInfo.ioVRefNum = BigEndianValue (vref); cpb.hFileInfo.ioFDirIndex = CWC (0); - cpb.hFileInfo.ioDirID = CL (dirid); + cpb.hFileInfo.ioDirID = BigEndianValue (dirid); err = PBGetCatInfo (&cpb, FALSE); if (err == noErr && !(cpb.hFileInfo.ioFlAttrib & ATTRIB_ISADIR)) err = dupFNErr; if (err == noErr) - *new_idp = CL (cpb.dirInfo.ioDrDirID); + *new_idp = BigEndianValue (cpb.dirInfo.ioDrDirID); return err; } @@ -301,8 +302,8 @@ P5 (PUBLIC pascal trap, OSErr, FindFolder, retval = create_directory (sys_vref, sys_dirid, sub_dir, &new_id); if (retval == noErr) { - *foundVRefNum = CW (sys_vref); - *foundDirID = CL (new_id); + *foundVRefNum = BigEndianValue (sys_vref); + *foundDirID = BigEndianValue (new_id); } } } @@ -319,8 +320,8 @@ P5 (PUBLIC pascal trap, OSErr, FindFolder, { /* NOTE: IMVI 9-44 tells us to not create System Folder if it doesn't already exist */ - *foundVRefNum = CW (sys_vref); - *foundDirID = CL (sys_dirid); + *foundVRefNum = BigEndianValue (sys_vref); + *foundDirID = BigEndianValue (sys_dirid); } } break; @@ -340,8 +341,8 @@ P5 (PUBLIC pascal trap, OSErr, FindFolder, warning_unimplemented ("Didn't attempt to create folder"); if (retval == noErr) { - *foundVRefNum = CW (tmp_vref); - *foundDirID = CL (tmp_dirid); + *foundVRefNum = BigEndianValue (tmp_vref); + *foundDirID = BigEndianValue (tmp_dirid); } } break; @@ -493,14 +494,14 @@ parse2 (AliasHandle ah, const void *addrs[], int count) headp = (alias_head_t *) STARH (ah); partp = (INTEGER *) (&headp[1]); - ep = (INTEGER *) ((char *) headp + MIN (size, CW (headp->length))); + ep = (INTEGER *) ((char *) headp + MIN (size, BigEndianValue (headp->length))); memset (addrs, 0, count * sizeof addrs[0]); for (; partp < ep && *partp != CWC (-1); - partp = (INTEGER *) ((char *) partp + EVENUP (4 + CW (partp[1])))) + partp = (INTEGER *) ((char *) partp + EVENUP (4 + BigEndianValue (partp[1])))) { int part; - part = CW (*partp); + part = BigEndianValue (*partp); if (part < count) addrs[part] = partp + 1; } @@ -641,9 +642,9 @@ assemble_pieces (AliasHandle *ahp, alias_head_t *headp, INTEGER n_pieces, ...) void *p; tag = va_arg (va, int); - tag_x = CW (tag); + tag_x = BigEndianValue (tag); length = va_arg (va, int); - length_x = CW (length); + length_x = BigEndianValue (length); p = va_arg (va, void *); memcpy (op, &tag_x, sizeof tag_x); op += sizeof tag_x; diff --git a/src/appearance.cpp b/src/appearance.cpp index 1c843a51..16b16b2e 100644 --- a/src/appearance.cpp +++ b/src/appearance.cpp @@ -21,6 +21,7 @@ char ROMlib_rcsid_appearance[] = #include "rsys/options.h" using namespace Executor; +using namespace ByteSwap; PRIVATE appearance_t appearance = appearance_sys7; @@ -186,7 +187,7 @@ silently_replace_resources (INTEGER master_file_rn, INTEGER from_file_rn) INTEGER res_num, res_num_max; GetIndTypeRN (from_file_rn, &type, type_num); - type = CL (type); + type = BigEndianValue (type); res_num_max = CountResourcesRN (from_file_rn, type); for (res_num = 1; res_num <= res_num_max; ++res_num) { @@ -197,7 +198,7 @@ silently_replace_resources (INTEGER master_file_rn, INTEGER from_file_rn) h = GetIndResourceRN (from_file_rn, type, res_num); GetResInfo (h, &id, &t, name); - id = CW (id); + id = BigEndianValue (id); LoadResource (h); DetachResource (h); AddResourceRN (master_file_rn, h, type, id, name); @@ -215,10 +216,10 @@ Executor::ROMlib_set_appearance (void) if (appearance < 0 || appearance >= NELEM (res_filenames)) appearance = (appearance_t)0; - res_file = OpenRFPerm (res_filenames[appearance], CW (BootDrive), fsRdPerm); + res_file = OpenRFPerm (res_filenames[appearance], BigEndianValue (BootDrive), fsRdPerm); if (res_file != CWC (-1)) { - silently_replace_resources (CW (SysMap), res_file); + silently_replace_resources (BigEndianValue (SysMap), res_file); CloseResFile (res_file); } else if (appearance != 0) diff --git a/src/cfm.cpp b/src/cfm.cpp index 51ca499e..bda54e89 100644 --- a/src/cfm.cpp +++ b/src/cfm.cpp @@ -35,6 +35,7 @@ #include "ppc_stubs.h" using namespace Executor; +using namespace ByteSwap; typedef enum { @@ -84,7 +85,7 @@ try_to_get_memory (void **addrp, syn68k_addr_t default_syn_address, uint32 total_size, int alignment) { OSErr retval; -#if !defined(linux) +#if !(defined(linux) || defined(MACOSX_)) retval = paramErr; #else void *default_address; @@ -378,7 +379,7 @@ repeatedly_relocate (uint32 count, uint8 **relocAddressp, uint32 val) p = (uint32 *) *relocAddressp; while (count-- > 0) { - *p = CL (CL (*p) + val); + *p = BigEndianValue (BigEndianValue (*p) + val); ++p; } *relocAddressp = (uint8 *) p; @@ -474,15 +475,15 @@ check_vanddir (INTEGER vref, LONGINT dirid, int descend_count, Str63 library, retval = fragLibNotFound; pb.hFileInfo.ioNamePtr = RM (&s[0]); - pb.hFileInfo.ioVRefNum = CW (vref); + pb.hFileInfo.ioVRefNum = BigEndianValue (vref); err = noErr; errcount = 0; for (dirindex = 1; retval != noErr && err != fnfErr && errcount != 3; dirindex++) { - pb.hFileInfo.ioFDirIndex = CW (dirindex); - pb.hFileInfo.ioDirID = CL (dirid); + pb.hFileInfo.ioFDirIndex = BigEndianValue (dirindex); + pb.hFileInfo.ioDirID = BigEndianValue (dirid); err = PBGetCatInfo(&pb, FALSE); if (err) { @@ -499,7 +500,7 @@ check_vanddir (INTEGER vref, LONGINT dirid, int descend_count, Str63 library, { if (descend_count > 0) { - retval = check_vanddir (vref, CL (pb.hFileInfo.ioDirID), + retval = check_vanddir (vref, BigEndianValue (pb.hFileInfo.ioDirID), descend_count-1, library, arch, loadflags, cidp, mainaddrp, errName); @@ -940,7 +941,7 @@ begin_closure (uint32 n_libs, PEFImportedLibrary_t *libs, OSErr err; retval = (typeof (retval)) NewPtr (sizeof *retval + n_libs * sizeof (lib_t)); - N_LIBS_X (retval) = CL (n_libs); + N_LIBS_X (retval) = BigEndianValue (n_libs); #warning eventually need to worry about errors @@ -1438,13 +1439,13 @@ try_to_mmap_file (FSSpecPtr fsp, LONGINT offset, LONGINT length, retval = noErr; /* canonicalize fsp to make sure */ - vref = CW (fsp->vRefNum); + vref = BigEndianValue (fsp->vRefNum); if (ISWDNUM (vref) || pstr_index_after (fsp->name, ':', 0)) { FSSpecPtr newfsp; newfsp = alloca (sizeof *newfsp); - retval = FSMakeFSSpec (vref, CL (fsp->parID), fsp->name, newfsp); + retval = FSMakeFSSpec (vref, BigEndianValue (fsp->parID), fsp->name, newfsp); if (retval == noErr) fsp = newfsp; } diff --git a/src/commtool.cpp b/src/commtool.cpp index 1067ffcc..20d11215 100644 --- a/src/commtool.cpp +++ b/src/commtool.cpp @@ -18,6 +18,7 @@ char ROMlib_rcsid_commtool[] = #include "rsys/mman.h" using namespace Executor; +using namespace ByteSwap; PUBLIC INTEGER Executor::CRMGetCRMVersion (void) @@ -52,7 +53,7 @@ Executor::CRMInstall (QElemPtr qp) CRMRecPtr prevp; prevp = (CRMRecPtr) MR (commtool_head.qTail); - ((CRMRecPtr)qp)->crmDeviceID = CL (CL (prevp->crmDeviceID) + 1); + ((CRMRecPtr)qp)->crmDeviceID = BigEndianValue (BigEndianValue (prevp->crmDeviceID) + 1); } Enqueue (qp, &commtool_head); @@ -76,11 +77,11 @@ Executor::CRMSearch (QElemPtr qp) CRMRecPtr p; LONGINT min; - min = CL (((CRMRecPtr)qp)->crmDeviceID) + 1; + min = BigEndianValue (((CRMRecPtr)qp)->crmDeviceID) + 1; block = block_virtual_ints (); for (p = (CRMRecPtr) MR (commtool_head.qHead); - p && CL (p->crmDeviceID) < min; + p && BigEndianValue (p->crmDeviceID) < min; p = (CRMRecPtr) MR (p->qLink)) ; restore_virtual_ints (block); diff --git a/src/ctlArrows.cpp b/src/ctlArrows.cpp index ece79c1c..9f372f06 100644 --- a/src/ctlArrows.cpp +++ b/src/ctlArrows.cpp @@ -23,6 +23,7 @@ char ROMlib_rcsid_ctlArrows[] = #include "rsys/wind.h" using namespace Executor; +using namespace ByteSwap; namespace Executor { #include "arrow_up_active.cmap" @@ -174,7 +175,7 @@ validate_colors_for_control (ControlHandle ctl) int index; c_ctab_entry = &c_ctab_table[i]; - index = CW (c_ctab_entry->value); + index = BigEndianValue (c_ctab_entry->value); if (index >= 0 && index < NELEM (ctl_ctab_colors)) ctl_ctab_colors[index] = c_ctab_entry->rgb; } @@ -307,16 +308,16 @@ draw_arrow (ControlHandle ctl, int part) if (vert_p) { if (part == inUpButton) - r.bottom = CW (CW (r.top) + width); + r.bottom = BigEndianValue (BigEndianValue (r.top) + width); else - r.top = CW (CW (r.bottom) - width); + r.top = BigEndianValue (BigEndianValue (r.bottom) - width); } else { if (part == inUpButton) - r.right = CW (CW (r.left) + height); + r.right = BigEndianValue (BigEndianValue (r.left) + height); else - r.left = CW (CW (r.right) - height); + r.left = BigEndianValue (BigEndianValue (r.right) - height); } active_p = (CTL_HILITE (ctl) == part); @@ -340,17 +341,17 @@ draw_page (ControlHandle ctl) width = RECT_WIDTH (&r); if (SB_VERT_P (height, width)) { - r.top = CW (CW (r.top) + width); - r.bottom = CW (CW (r.bottom) - width); - r.left = CW (CW (r.left) + 1); - r.right = CW (CW (r.right) - 1); + r.top = BigEndianValue (BigEndianValue (r.top) + width); + r.bottom = BigEndianValue (BigEndianValue (r.bottom) - width); + r.left = BigEndianValue (BigEndianValue (r.left) + 1); + r.right = BigEndianValue (BigEndianValue (r.right) - 1); } else { - r.left = CW (CW (r.left) + height); - r.right = CW (CW (r.right) - height); - r.top = CW (CW (r.top) + 1); - r.bottom = CW (CW (r.bottom) - 1); + r.left = BigEndianValue (BigEndianValue (r.left) + height); + r.right = BigEndianValue (BigEndianValue (r.right) - height); + r.top = BigEndianValue (BigEndianValue (r.top) + 1); + r.bottom = BigEndianValue (BigEndianValue (r.bottom) - 1); } /* page_{fg, bk} colors are dependent on whether or not the sb is @@ -381,22 +382,22 @@ thumb_rect (ControlHandle ctl, Rect *thumb_rect_out) if (SB_VERT_P (height, width)) { thumb_rect_out->top - = CW ((short) (CW (r.top) + width + = BigEndianValue ((short) (BigEndianValue (r.top) + width + ((val - min) * ((LONGINT) height - 3 * width) / diff))); - thumb_rect_out->bottom = CW (CW (thumb_rect_out->top) + width); - thumb_rect_out->left = CW (CW (r.left) + 1); - thumb_rect_out->right = CW (CW (r.right) - 1); + thumb_rect_out->bottom = BigEndianValue (BigEndianValue (thumb_rect_out->top) + width); + thumb_rect_out->left = BigEndianValue (BigEndianValue (r.left) + 1); + thumb_rect_out->right = BigEndianValue (BigEndianValue (r.right) - 1); } else { thumb_rect_out->left - = CW ((short) (CW (r.left) + height + = BigEndianValue ((short) (BigEndianValue (r.left) + height + ((val - min) * ((LONGINT) width - 3 * height) / diff))); - thumb_rect_out->right = CW (CW (thumb_rect_out->left) + height); - thumb_rect_out->top = CW (CW (r.top) + 1); - thumb_rect_out->bottom = CW (CW (r.bottom) - 1); + thumb_rect_out->right = BigEndianValue (BigEndianValue (thumb_rect_out->left) + height); + thumb_rect_out->top = BigEndianValue (BigEndianValue (r.top) + 1); + thumb_rect_out->bottom = BigEndianValue (BigEndianValue (r.bottom) - 1); } } else @@ -422,8 +423,8 @@ LocalToGlobalRect (Rect *rp) PRIVATE void GlobalToLocalRgn (RgnHandle rgn) { - OffsetRgn (rgn, CW (PORT_BOUNDS (thePort).left), - CW (PORT_BOUNDS (thePort).top)); + OffsetRgn (rgn, BigEndianValue (PORT_BOUNDS (thePort).left), + BigEndianValue (PORT_BOUNDS (thePort).top)); } typedef struct @@ -457,15 +458,15 @@ draw_thumb (ControlHandle ctl) { dst_rect.top = new_thumb.top; dst_rect.bottom = new_thumb.bottom; - dst_rect.left = CW (CW (new_thumb.left) - 1); - dst_rect.right = CW (CW (new_thumb.right) + 1); + dst_rect.left = BigEndianValue (BigEndianValue (new_thumb.left) - 1); + dst_rect.right = BigEndianValue (BigEndianValue (new_thumb.right) + 1); } else { dst_rect.left = new_thumb.left; dst_rect.right = new_thumb.right; - dst_rect.top = CW (CW (new_thumb.top) - 1); - dst_rect.bottom = CW (CW (new_thumb.bottom) + 1); + dst_rect.top = BigEndianValue (BigEndianValue (new_thumb.top) - 1); + dst_rect.bottom = BigEndianValue (BigEndianValue (new_thumb.bottom) + 1); } /* if the old_thumb rect is empty, ie., the thumb was not @@ -557,22 +558,22 @@ where (ControlHandle ctl, Point p) width = RECT_WIDTH (&r); if (SB_VERT_P (height, width)) { - if (p.v <= CW (r.top) + width) + if (p.v <= BigEndianValue (r.top) + width) return inUpButton; - else if (p.v >= CW (r.bottom) - width) + else if (p.v >= BigEndianValue (r.bottom) - width) return inDownButton; - else if (p.v < CW (thumbr.top)) + else if (p.v < BigEndianValue (thumbr.top)) return inPageUp; else return inPageDown; } else { - if (p.h <= CW (r.left) + height) + if (p.h <= BigEndianValue (r.left) + height) return inUpButton; - else if (p.h >= CW (r.right) - height) + else if (p.h >= BigEndianValue (r.right) - height) return inDownButton; - else if (p.h < CW (thumbr.left)) + else if (p.h < BigEndianValue (thumbr.left)) return inPageUp; else return inPageDown; @@ -597,10 +598,10 @@ P4 (PUBLIC pascal, void, new_pos_ctl, INTEGER, depth, INTEGER, flags, r = CTL_RECT (ctl); - top = CW (r.top); - left = CW (r.left); - bottom = CW (r.bottom); - right = CW (r.right); + top = BigEndianValue (r.top); + left = BigEndianValue (r.left); + bottom = BigEndianValue (r.bottom); + right = BigEndianValue (r.right); height = bottom - top; width = right - left; @@ -615,8 +616,8 @@ P4 (PUBLIC pascal, void, new_pos_ctl, INTEGER, depth, INTEGER, flags, if (SB_VERT_P (height, width)) { a = top + width; - thumb_top = CW (thumbr.top) + HiWord (p) - a; - CTL_VALUE_X (ctl) = CW (min + (thumb_top + thumb_top = BigEndianValue (thumbr.top) + HiWord (p) - a; + CTL_VALUE_X (ctl) = BigEndianValue (min + (thumb_top * ((LONGINT) max - min + 1) / (bottom - a - (2 * width) + 1))); if (CTL_VIS_X (ctl) == 255) @@ -625,8 +626,8 @@ P4 (PUBLIC pascal, void, new_pos_ctl, INTEGER, depth, INTEGER, flags, else { a = left + height; - thumb_left = CW (thumbr.left) + LoWord(p) - a; - CTL_VALUE_X (ctl) = CW (min + (thumb_left + thumb_left = BigEndianValue (thumbr.left) + LoWord(p) - a; + CTL_VALUE_X (ctl) = BigEndianValue (min + (thumb_left * ((LONGINT) max - min + 1) / (right - a - (2 * height) + 1))); if (CTL_VIS_X (ctl) == 255) @@ -821,29 +822,29 @@ P4 (PUBLIC pascal, LONGINT, cdef16, /* IMI-328 */ break; case thumbCntl: pl = (struct lsastr *) param; - p.v = CW (pl->limitRect.top); - p.h = CW (pl->limitRect.left); + p.v = BigEndianValue (pl->limitRect.top); + p.h = BigEndianValue (pl->limitRect.left); pl->slopRect = pl->limitRect = CTL_RECT (c); thumbr = HxX (CTL_DATA (c), rgnBBox); GlobalToLocalRect (&thumbr); rp = &thumbr; - height = CW (pl->slopRect.bottom) - CW (pl->slopRect.top); - width = CW (pl->slopRect.right) - CW (pl->slopRect.left); + height = BigEndianValue (pl->slopRect.bottom) - BigEndianValue (pl->slopRect.top); + width = BigEndianValue (pl->slopRect.right) - BigEndianValue (pl->slopRect.left); if (SB_VERT_P (height, width)) { pl->axis = CWC (vAxisOnly); - pl->limitRect.top = CW (CW (pl->limitRect.top) - + (width - (CW (rp->top) - p.v))); - pl->limitRect.bottom = CW (CW (pl->limitRect.bottom) - - (width - (p.v - CW (rp->bottom)) - 1)); + pl->limitRect.top = BigEndianValue (BigEndianValue (pl->limitRect.top) + + (width - (BigEndianValue (rp->top) - p.v))); + pl->limitRect.bottom = BigEndianValue (BigEndianValue (pl->limitRect.bottom) + - (width - (p.v - BigEndianValue (rp->bottom)) - 1)); } else { pl->axis = CWC (hAxisOnly); - pl->limitRect.left = CW (CW (pl->limitRect.left) - + height - (CW (rp->left) - p.h)); - pl->limitRect.right = CW (CW (pl->limitRect.right) - - height - (p.h - CW (rp->right)) - 1); + pl->limitRect.left = BigEndianValue (BigEndianValue (pl->limitRect.left) + + height - (BigEndianValue (rp->left) - p.h)); + pl->limitRect.right = BigEndianValue (BigEndianValue (pl->limitRect.right) + - height - (p.h - BigEndianValue (rp->right)) - 1); } InsetRect (&pl->slopRect, -20, -20); break; diff --git a/src/ctlInit.cpp b/src/ctlInit.cpp index 82a3af84..41229423 100644 --- a/src/ctlInit.cpp +++ b/src/ctlInit.cpp @@ -24,6 +24,7 @@ char ROMlib_rcsid_ctlInit[] = #include "rsys/resource.h" using namespace Executor; +using namespace ByteSwap; PUBLIC BOOLEAN Executor::ROMlib_cdef0_is_rectangular = FALSE; @@ -69,7 +70,7 @@ P9(PUBLIC pascal trap, ControlHandle, NewControl, WindowPtr, wst, Rect *, r, acNext, RM (tmp), acOwner, RM (retval), acCTable, (CCTabHandle) RM (GetResource (TICK("cctb"), 0)), - acFlags, CW (procid & 0x0F), + acFlags, BigEndianValue (procid & 0x0F), acReserved, CLC (0), acRefCon, CLC (0)); str255assign (CTL_TITLE (retval), title); @@ -87,12 +88,12 @@ P9(PUBLIC pascal trap, ControlHandle, NewControl, WindowPtr, wst, Rect *, r, contrlOwner, RM (wst), contrlVis, vis ? 255 : 0, contrlHilite, 0, - contrlValue, CW (value), - contrlMin, CW (min), - contrlMax, CW (max), + contrlValue, BigEndianValue (value), + contrlMin, BigEndianValue (min), + contrlMax, BigEndianValue (max), contrlData, CLC_NULL, contrlAction, CLC_NULL, - contrlRfCon, CL (rc)); + contrlRfCon, BigEndianValue (rc)); WINDOW_CONTROL_LIST_X (wst) = RM (retval); @@ -128,7 +129,7 @@ P2(PUBLIC pascal trap, ControlHandle, GetNewControl, /* IMI-321 */ (StringPtr) ((char *) &HxX(wh, _crect) + 22), /* _ctitle */ Hx(wh, _cvisible) ? 255 : 0, Hx(wh, _cvalue), Hx(wh, _cmin), Hx(wh, _cmax), Hx(wh, _cprocid), - CL(*(LONGINT *)((char *)&HxX(wh, _crect) + 18))); /* _crefcon */ + BigEndianValue(*(LONGINT *)((char *)&HxX(wh, _crect) + 18))); /* _crefcon */ if (ctab_res_h) SetCtlColor (retval, (CCTabHandle) ctab_res_h); return retval; diff --git a/src/ctlMisc.cpp b/src/ctlMisc.cpp index fce0427a..4edf7da1 100644 --- a/src/ctlMisc.cpp +++ b/src/ctlMisc.cpp @@ -24,6 +24,7 @@ char ROMlib_rcsid_ctlMisc[] = macros */ using namespace Executor; +using namespace ByteSwap; AuxCtlHandle Executor::default_aux_ctl; @@ -106,7 +107,7 @@ Executor::lookup_aux_ctl (ControlHandle ctl) P2(PUBLIC pascal trap, void, SetCRefCon, ControlHandle, c, /* IMI-327 */ LONGINT, data) { - HxX(c, contrlRfCon) = CL(data); + HxX(c, contrlRfCon) = BigEndianValue(data); } P1(PUBLIC pascal trap, LONGINT, GetCRefCon, ControlHandle, c) /* IMI-327 */ diff --git a/src/ctlMouse.cpp b/src/ctlMouse.cpp index ca26b1ca..3e91b40d 100644 --- a/src/ctlMouse.cpp +++ b/src/ctlMouse.cpp @@ -34,6 +34,7 @@ char ROMlib_rcsid_ctlMouse[] = */ using namespace Executor; +using namespace ByteSwap; INTEGER find_control_helper (Point p, ControlHandle c, @@ -115,8 +116,8 @@ P3 (PUBLIC pascal trap, INTEGER, TrackControl, /* IMI-323 */ if (!partstart) { GetMouse (&p); - p.h = CW (p.h); - p.v = CW (p.v); + BigEndianInPlace(p.h); + BigEndianInPlace(p.v); partstart = inpart = TestControl (c, p); } @@ -146,8 +147,8 @@ P3 (PUBLIC pascal trap, INTEGER, TrackControl, /* IMI-323 */ while (!GetOSEvent(mUpMask, &ev)) { GlobalToLocal(&ev.where); - whereunswapped.h = CW(ev.where.h); - whereunswapped.v = CW(ev.where.v); + whereunswapped.h = BigEndianValue(ev.where.h); + whereunswapped.v = BigEndianValue(ev.where.v); inpart = TestControl(c, whereunswapped); CTLCALL(c, autoTrack, inpart); } @@ -165,8 +166,8 @@ P3 (PUBLIC pascal trap, INTEGER, TrackControl, /* IMI-323 */ Quicken. */ if (!CTLCALL (c, dragCntl, partstart)) { - thumb._tlimit.left = CW(p.h); - thumb._tlimit.top = CW(p.v); + thumb._tlimit.left = BigEndianValue(p.h); + thumb._tlimit.top = BigEndianValue(p.v); CTLCALL(c, thumbCntl, (LONGINT) (long) &thumb); rh = NewRgn(); @@ -174,7 +175,7 @@ P3 (PUBLIC pascal trap, INTEGER, TrackControl, /* IMI-323 */ PATASSIGN(DragPattern, ltGray); l = DragTheRgn(rh, p, &thumb._tlimit, &thumb._tslop, - CW(thumb._taxis), a); + BigEndianValue(thumb._taxis), a); if ((uint32) l != 0x80008000) { CTLCALL(c, posCntl, l); @@ -193,8 +194,8 @@ P3 (PUBLIC pascal trap, INTEGER, TrackControl, /* IMI-323 */ while (!OSEventAvail(mUpMask, &ev) && StillDown()) { GlobalToLocal(&ev.where); - whereunswapped.h = CW(ev.where.h); - whereunswapped.v = CW(ev.where.v); + whereunswapped.h = BigEndianValue(ev.where.h); + whereunswapped.v = BigEndianValue(ev.where.v); inpart = TestControl(c, whereunswapped); if (inpart && inpart != partstart) inpart = 0; @@ -208,8 +209,8 @@ P3 (PUBLIC pascal trap, INTEGER, TrackControl, /* IMI-323 */ } GetOSEvent(mUpMask, &ev); GlobalToLocal(&ev.where); - whereunswapped.h = CW(ev.where.h); - whereunswapped.v = CW(ev.where.v); + whereunswapped.h = BigEndianValue(ev.where.h); + whereunswapped.v = BigEndianValue(ev.where.v); if (HxX(c, contrlHilite)) { HxX(c, contrlHilite) = 0; diff --git a/src/ctlPopup.cpp b/src/ctlPopup.cpp index c7540210..457df8fa 100644 --- a/src/ctlPopup.cpp +++ b/src/ctlPopup.cpp @@ -23,6 +23,7 @@ char ROMlib_rcsid_ctlPopup[] = #include "rsys/menu.h" using namespace Executor; +using namespace ByteSwap; #if 0 /* It's not clear why Cotton had all these global variables, but it is clear that in at least one case he was using one @@ -58,7 +59,7 @@ init (ControlHandle ctl) HandToHand (&hh); flags = CTL_VALUE (ctl); - POPUP_MENU_ID_X (data) = CW (mid); + POPUP_MENU_ID_X (data) = BigEndianValue (mid); POPUP_MENU_X (data) = RM ((MenuHandle) hh.p); } /* private fields */ @@ -70,7 +71,7 @@ init (ControlHandle ctl) CTL_ACTION_X (ctl) = (ProcPtr) CLC (-1); CTL_VALUE_X (ctl) = CWC (1); CTL_MIN_X (ctl) = CWC (1); - CTL_MAX_X (ctl) = CW (CountMItems (mh)); + CTL_MAX_X (ctl) = BigEndianValue (CountMItems (mh)); CheckItem (mh, 1, TRUE); } @@ -171,10 +172,10 @@ draw (ControlHandle ctl, draw_state_t draw_state, } ctl_rect = &CTL_RECT (ctl); - top = CW (ctl_rect->top); - left = CW (ctl_rect->left); - bottom = CW (ctl_rect->bottom); - right = CW (ctl_rect->right); + top = BigEndianValue (ctl_rect->top); + left = BigEndianValue (ctl_rect->left); + bottom = BigEndianValue (ctl_rect->bottom); + right = BigEndianValue (ctl_rect->right); title = CTL_TITLE (ctl); @@ -190,10 +191,10 @@ draw (ControlHandle ctl, draw_state_t draw_state, } GetFontInfo (&font_info); - ascent = CW (font_info.ascent); + ascent = BigEndianValue (font_info.ascent); height = ( ascent - + CW (font_info.descent) - + CW (font_info.leading)); + + BigEndianValue (font_info.descent) + + BigEndianValue (font_info.leading)); title_width = POPUP_TITLE_WIDTH (data); icon_p = get_icon_info (item_info, &icon_info, TRUE); @@ -240,7 +241,7 @@ draw (ControlHandle ctl, draw_state_t draw_state, erase_rect.left = ctl_rect->left; erase_rect.bottom = ctl_rect->bottom; if (title_only_p) - erase_rect.right = CW (left + title_width); + erase_rect.right = BigEndianValue (left + title_width); else erase_rect.right = ctl_rect->right; EraseRect (&erase_rect); @@ -258,10 +259,10 @@ draw (ControlHandle ctl, draw_state_t draw_state, then should probably hilite from `center - icon_info.height / 2' to `center + icon_info.height / 2' */ - t_rect.top = CW (baseline - ascent); - t_rect.left = CW (left); - t_rect.bottom = CW (baseline - ascent + height); - t_rect.right = CW (left + title_width); + t_rect.top = BigEndianValue (baseline - ascent); + t_rect.left = BigEndianValue (left); + t_rect.bottom = BigEndianValue (baseline - ascent + height); + t_rect.right = BigEndianValue (left + title_width); PenMode (patCopy); EraseRect (&t_rect); @@ -303,10 +304,10 @@ draw (ControlHandle ctl, draw_state_t draw_state, RGBForeColor (&ROMlib_black_rgb_color); RGBBackColor (&ROMlib_white_rgb_color); - t_rect.top = CW (draw_top); - t_rect.left = CW (item_left - 1); - t_rect.bottom = CW (draw_bottom - 1); - t_rect.right = CW (right - 1); + t_rect.top = BigEndianValue (draw_top); + t_rect.left = BigEndianValue (item_left - 1); + t_rect.bottom = BigEndianValue (draw_bottom - 1); + t_rect.right = BigEndianValue (right - 1); EraseRect (&t_rect); @@ -330,10 +331,10 @@ draw (ControlHandle ctl, draw_state_t draw_state, if (icon_p) { - t_rect.top = CW (center - icon_info.height / 2); - t_rect.left = CW (item_left); - t_rect.bottom = CW (CW (t_rect.top) + (icon_info.height - ICON_PAD)); - t_rect.right = CW (CW (t_rect.left) + (icon_info.width - ICON_PAD)); + t_rect.top = BigEndianValue (center - icon_info.height / 2); + t_rect.left = BigEndianValue (item_left); + t_rect.bottom = BigEndianValue (BigEndianValue (t_rect.top) + (icon_info.height - ICON_PAD)); + t_rect.right = BigEndianValue (BigEndianValue (t_rect.left) + (icon_info.width - ICON_PAD)); if (icon_info.color_icon_p) PlotCIcon (&t_rect, (CIconHandle) icon_info.icon); @@ -407,10 +408,10 @@ draw (ControlHandle ctl, draw_state_t draw_state, arrow_bitmap.rowBytes = CWC (2); SetRect (&arrow_bitmap.bounds, 0, 0, /* right, bottom */ 11, 6); - dst_rect.top = CW (center - 3); - dst_rect.left = CW (right - 22); - dst_rect.bottom = CW (center - 3 + /* arrows are `6' tall */ 6); - dst_rect.right = CW (right - 22 + dst_rect.top = BigEndianValue (center - 3); + dst_rect.left = BigEndianValue (right - 22); + dst_rect.bottom = BigEndianValue (center - 3 + /* arrows are `6' tall */ 6); + dst_rect.right = BigEndianValue (right - 22 + /* arrows are `11' wide */ 11); CopyBits (&arrow_bitmap, PORT_BITS_FOR_COPY (thePort), &arrow_bitmap.bounds, &dst_rect, srcCopy, NULL); @@ -515,13 +516,13 @@ P4 (PUBLIC pascal, int32, cdef1008, TRUE, TRUE, &top, &left); port_bounds = &PORT_BOUNDS (CTL_OWNER (ctl)); - top -= CW (port_bounds->top); - left -= CW (port_bounds->left); + top -= BigEndianValue (port_bounds->top); + left -= BigEndianValue (port_bounds->left); CalcMenuSize (mh); value = PopUpMenuSelect (mh, top, left, orig_value); if (value) - CTL_VALUE_X (ctl) = CW (value); + CTL_VALUE_X (ctl) = BigEndianValue (value); draw (ctl, draw_state, window_font, window_size, window_font_p, FALSE, FALSE, NULL, NULL); diff --git a/src/ctlSet.cpp b/src/ctlSet.cpp index da40b8d8..3776c4ee 100644 --- a/src/ctlSet.cpp +++ b/src/ctlSet.cpp @@ -17,6 +17,7 @@ char ROMlib_rcsid_ctlSet[] = #include "rsys/ctl.h" using namespace Executor; +using namespace ByteSwap; P2(PUBLIC pascal trap, void, SetCtlValue, ControlHandle, c, /* IMI-326 */ INTEGER, v) @@ -30,7 +31,7 @@ P2(PUBLIC pascal trap, void, SetCtlValue, ControlHandle, c, /* IMI-326 */ else if (v > Hx(c, contrlMax)) HxX(c, contrlValue) = HxX(c, contrlMax); else - HxX(c, contrlValue) = CW(v); + HxX(c, contrlValue) = BigEndianValue(v); CTLCALL (c, drawCntl, ALLINDICATORS); }); @@ -50,9 +51,9 @@ P2(PUBLIC pascal trap, void, SetCtlMin, ControlHandle, c, /* IMI-326 */ (c, { SetPort(HxP(c, contrlOwner)); - HxX(c, contrlMin) = CW(v); + HxX(c, contrlMin) = BigEndianValue(v); if (Hx(c, contrlValue) < v) - HxX(c, contrlValue) = CW(v); + HxX(c, contrlValue) = BigEndianValue(v); CTLCALL(c, drawCntl, ALLINDICATORS); }); } @@ -73,9 +74,9 @@ P2(PUBLIC pascal trap, void, SetCtlMax, ControlHandle, c, /* IMI-327 */ if (v < Hx(c, contrlMin)) v = Hx(c, contrlMin); - HxX(c, contrlMax) = CW(v); + HxX(c, contrlMax) = BigEndianValue(v); if (Hx(c, contrlValue) > v) - HxX(c, contrlValue) = CW(v); + HxX(c, contrlValue) = BigEndianValue(v); CTLCALL(c, drawCntl, ALLINDICATORS); }); } diff --git a/src/ctlSize.cpp b/src/ctlSize.cpp index 89507e04..a6056397 100644 --- a/src/ctlSize.cpp +++ b/src/ctlSize.cpp @@ -19,26 +19,27 @@ char ROMlib_rcsid_ctlSize[] = #include "rsys/ctl.h" using namespace Executor; +using namespace ByteSwap; P3(PUBLIC pascal trap, void, MoveControl, ControlHandle, c, /* IMI-325 */ INTEGER, h, INTEGER, v) { if (Hx(c, contrlVis)) { HideControl(c); - HxX(c, contrlRect.right) = CW(Hx(c, contrlRect.right) + HxX(c, contrlRect.right) = BigEndianValue(Hx(c, contrlRect.right) + h - Hx(c, contrlRect.left)); - HxX(c, contrlRect.bottom) = CW(Hx(c, contrlRect.bottom) + HxX(c, contrlRect.bottom) = BigEndianValue(Hx(c, contrlRect.bottom) + v - Hx(c, contrlRect.top)); - HxX(c, contrlRect.left) = CW(h); - HxX(c, contrlRect.top) = CW(v); + HxX(c, contrlRect.left) = BigEndianValue(h); + HxX(c, contrlRect.top) = BigEndianValue(v); ShowControl(c); } else { - HxX(c, contrlRect.right) = CW(Hx(c, contrlRect.right) + + HxX(c, contrlRect.right) = BigEndianValue(Hx(c, contrlRect.right) + h - Hx(c, contrlRect.left)); - HxX(c, contrlRect.bottom) = CW(Hx(c, contrlRect.bottom) + + HxX(c, contrlRect.bottom) = BigEndianValue(Hx(c, contrlRect.bottom) + v - Hx(c, contrlRect.top)); - HxX(c, contrlRect.left) = CW(h); - HxX(c, contrlRect.top) = CW(v); + HxX(c, contrlRect.left) = BigEndianValue(h); + HxX(c, contrlRect.top) = BigEndianValue(v); } } @@ -71,11 +72,11 @@ P3(PUBLIC pascal trap, void, SizeControl, ControlHandle, c, /* IMI-326 */ { if (Hx(c, contrlVis)) { HideControl(c); - HxX(c, contrlRect.right) = CW(Hx(c, contrlRect.left) + width); - HxX(c, contrlRect.bottom) = CW(Hx(c, contrlRect.top) + height); + HxX(c, contrlRect.right) = BigEndianValue(Hx(c, contrlRect.left) + width); + HxX(c, contrlRect.bottom) = BigEndianValue(Hx(c, contrlRect.top) + height); ShowControl(c); } else { - HxX(c, contrlRect.right) = CW(Hx(c, contrlRect.left) + width); - HxX(c, contrlRect.bottom) = CW(Hx(c, contrlRect.top) + height); + HxX(c, contrlRect.right) = BigEndianValue(Hx(c, contrlRect.left) + width); + HxX(c, contrlRect.bottom) = BigEndianValue(Hx(c, contrlRect.top) + height); } } diff --git a/src/ctlStddef.cpp b/src/ctlStddef.cpp index 3125775b..e2c82b00 100644 --- a/src/ctlStddef.cpp +++ b/src/ctlStddef.cpp @@ -21,6 +21,7 @@ char ROMlib_rcsid_ctlStddef[] = #include "rsys/cquick.h" using namespace Executor; +using namespace ByteSwap; enum { @@ -63,7 +64,7 @@ validate_colors_for_control (ControlHandle ctl) int j; for (j = 0; j < def_ctl_ctab_size; j ++) - if (CW (def_ctl_ctab_table[j].value) == i) + if (BigEndianValue (def_ctl_ctab_table[j].value) == i) ctl_ctab_colors[i] = def_ctl_ctab_table[j].rgb; } } @@ -85,18 +86,18 @@ validate_colors_for_control (ControlHandle ctl) ColorSpec *c_ctab_entry; c_ctab_entry = &c_ctab_table[i]; - if (CW (c_ctab_entry->value) >= n_ctl_colors) + if (BigEndianValue (c_ctab_entry->value) >= n_ctl_colors) { /* don't make so much noise; our own default control color table will set off this warning */ #if 0 warning_unexpected ("control color table with index `%d' > %d or < 0; ignored", - CW (c_ctab_entry->value), n_ctl_colors); + BigEndianValue (c_ctab_entry->value), n_ctl_colors); #endif continue; } - ctl_ctab_colors[CW (c_ctab_entry->value)] = c_ctab_entry->rgb; + ctl_ctab_colors[BigEndianValue (c_ctab_entry->value)] = c_ctab_entry->rgb; } } @@ -191,7 +192,7 @@ drawlabel (StringPtr str, Rect *rp, justenum just) temp->bytec = i - temp->firstb; if (just == justmiddle) { - mid = (CW(rp->left) + CW(rp->right)) / 2; + mid = (BigEndianValue(rp->left) + BigEndianValue(rp->right)) / 2; for (i = 0; i < nlines; i++) infop[i].left = mid - TextWidth ((Ptr) str, infop[i].firstb, infop[i].bytec) / 2; @@ -199,11 +200,11 @@ drawlabel (StringPtr str, Rect *rp, justenum just) else { for (i = 0; i < nlines; i++) - infop[i].left = CW(rp->left); + infop[i].left = BigEndianValue(rp->left); } - incr = CW(fi.ascent) + CW(fi.descent) + CW(fi.leading); - top = (CW(rp->top) + CW(rp->bottom)) / 2 - - (nlines * incr - CW(fi.leading) + 1) / 2 + CW(fi.ascent); + incr = BigEndianValue(fi.ascent) + BigEndianValue(fi.descent) + BigEndianValue(fi.leading); + top = (BigEndianValue(rp->top) + BigEndianValue(rp->bottom)) / 2 - + (nlines * incr - BigEndianValue(fi.leading) + 1) / 2 + BigEndianValue(fi.ascent); for (i = 0; i < nlines; i++, top += incr) { MoveTo(infop[i].left, top); @@ -246,8 +247,8 @@ draw_push (ControlHandle c, int16 part) Rect r; r = CTL_RECT (c); - h = CW (r.right) - CW(r.left); - v = (CW (r.bottom) - CW (r.top)) / 2; + h = BigEndianValue (r.right) - BigEndianValue(r.left); + v = (BigEndianValue (r.bottom) - BigEndianValue (r.top)) / 2; if (h > v) h = v; save = PORT_CLIP_REGION_X (CTL_OWNER (c)); @@ -290,7 +291,7 @@ add_title (ControlHandle c) PORT_CLIP_REGION_X (control_owner) = RM (NewRgn ()); r = CTL_RECT (c); RectRgn (PORT_CLIP_REGION (control_owner), &r); - r.left = CW (CW (r.left) + 16); + r.left = BigEndianValue (BigEndianValue (r.left) + 16); drawlabel (CTL_TITLE (c), &r, justleft); DisposeRgn (PORT_CLIP_REGION (control_owner)); PORT_CLIP_REGION_X (control_owner) = save; @@ -304,14 +305,14 @@ draw_check (ControlHandle c, int16 part) if (!part) { r = CTL_RECT (c); - r.right = CW (CW (r.right) - 2); + r.right = BigEndianValue (BigEndianValue (r.right) - 2); EraseRect (&r); add_title (c); } - r.left = CW (CW (CTL_RECT (c).left) + 2); - r.top = CW ((CW (CTL_RECT (c).top) + CW (CTL_RECT (c).bottom)) / 2 - 6); - r.bottom = CW (CW (r.top) + 12); - r.right = CW (CW (r.left) + 12); + r.left = BigEndianValue (BigEndianValue (CTL_RECT (c).left) + 2); + r.top = BigEndianValue ((BigEndianValue (CTL_RECT (c).top) + BigEndianValue (CTL_RECT (c).bottom)) / 2 - 6); + r.bottom = BigEndianValue (BigEndianValue (r.top) + 12); + r.right = BigEndianValue (BigEndianValue (r.left) + 12); EraseRect (&r); RGBForeColor (¤t_control_colors[frame_color]); @@ -322,10 +323,10 @@ draw_check (ControlHandle c, int16 part) if (CTL_VALUE (c)) { PenSize (1, 1); - MoveTo (CW (r.left) + 1, CW (r.top) + 1); - LineTo (CW (r.right) - 2, CW (r.bottom) - 2); - MoveTo (CW (r.right) - 2, CW (r.top) + 1); - LineTo (CW (r.left) + 1, CW (r.bottom) - 2); + MoveTo (BigEndianValue (r.left) + 1, BigEndianValue (r.top) + 1); + LineTo (BigEndianValue (r.right) - 2, BigEndianValue (r.bottom) - 2); + MoveTo (BigEndianValue (r.right) - 2, BigEndianValue (r.top) + 1); + LineTo (BigEndianValue (r.left) + 1, BigEndianValue (r.bottom) - 2); } } @@ -337,14 +338,14 @@ draw_radio (ControlHandle c, int16 part) if (!part) { r = CTL_RECT (c); - r.right = CW (CW (r.right) - 2); + r.right = BigEndianValue (BigEndianValue (r.right) - 2); EraseRect (&r); add_title (c); } - r.left = CW (CW (CTL_RECT (c).left) + 2); - r.top = CW ((CW (CTL_RECT (c).top) + CW (CTL_RECT (c).bottom)) / 2 - 6); - r.bottom = CW (CW (r.top) + 12); - r.right = CW (CW (r.left) + 12); + r.left = BigEndianValue (BigEndianValue (CTL_RECT (c).left) + 2); + r.top = BigEndianValue ((BigEndianValue (CTL_RECT (c).top) + BigEndianValue (CTL_RECT (c).bottom)) / 2 - 6); + r.bottom = BigEndianValue (BigEndianValue (r.top) + 12); + r.right = BigEndianValue (BigEndianValue (r.left) + 12); EraseRect (&r); if (CTL_HILITE (c) == inCheckBox) diff --git a/src/dcmaketables.cpp b/src/dcmaketables.cpp index 399a4646..eeb20c83 100644 --- a/src/dcmaketables.cpp +++ b/src/dcmaketables.cpp @@ -11,6 +11,8 @@ char ROMlib_rcsid_dcmaketables[] = #include "rsys/depthconv.h" #include "rsys/cquick.h" +using namespace ByteSwap; + namespace Executor { /* This file contains routines to construct lookup tables used for @@ -153,7 +155,7 @@ maketable_ ## bpp1 ## _ ## bpp2 (void *d, const uint32 *map) \ new1 |= (v & ((1UL << bpp2) - 1)) << l; \ if (l == 0) \ { \ - dst[0] = dst[3] = CW (new1); \ + dst[0] = dst[3] = BigEndianValue (new1); \ dst[1] = dst[2] = CWC (0); \ dst += 4; \ l = 16 - bpp2; \ @@ -449,7 +451,7 @@ depthconv_make_ind_to_rgb_table (void *table_space, unsigned in_bpp, * to counteract the byte swap that will happen later when * the raw table is built. */ - raw_map[i] = (out_bpp == 16) ? CW (v) : CL (v); + raw_map[i] = (out_bpp == 16) ? BigEndianValue (v) : BigEndianValue (v); } } diff --git a/src/desk.cpp b/src/desk.cpp index 89f49573..13b85c76 100644 --- a/src/desk.cpp +++ b/src/desk.cpp @@ -28,6 +28,7 @@ char ROMlib_rcsid_desk[] = #include "rsys/aboutbox.h" using namespace Executor; +using namespace ByteSwap; P1(PUBLIC pascal trap, INTEGER, OpenDeskAcc, Str255, acc) /* IMI-440 */ { @@ -43,7 +44,7 @@ P1(PUBLIC pascal trap, INTEGER, OpenDeskAcc, Str255, acc) /* IMI-440 */ } if (OpenDriver(acc, &retval) == noErr) { - retval = CW(retval); + retval = BigEndianValue(retval); dctlh = GetDCtlEntry(retval); if (dctlh) { @@ -75,8 +76,8 @@ P2(PUBLIC pascal trap, void, SystemClick, EventRecord *, evp, WindowPtr, wp) LONGINT templ; if (wp) { - p.h = CW(evp->where.h); - p.v = CW(evp->where.v); + p.h = BigEndianValue(evp->where.h); + p.v = BigEndianValue(evp->where.v); if (PtInRgn (p, WINDOW_STRUCT_REGION (wp))) { pointaslong = ((LONGINT)p.v << 16)|(unsigned short)p.h; @@ -91,10 +92,10 @@ P2(PUBLIC pascal trap, void, SystemClick, EventRecord *, evp, WindowPtr, wp) SelectWindow(wp); break; case wInDrag: - bounds.top = CW (CW (MBarHeight) + 4); - bounds.left = CW (CW (GD_BOUNDS (MR (TheGDevice)).left) + 4); - bounds.bottom = CW (CW (GD_BOUNDS (MR (TheGDevice)).bottom) - 4); - bounds.right = CW (CW (GD_BOUNDS (MR (TheGDevice)).right) - 4); + bounds.top = BigEndianValue (BigEndianValue (MBarHeight) + 4); + bounds.left = BigEndianValue (BigEndianValue (GD_BOUNDS (MR (TheGDevice)).left) + 4); + bounds.bottom = BigEndianValue (BigEndianValue (GD_BOUNDS (MR (TheGDevice)).bottom) - 4); + bounds.right = BigEndianValue (BigEndianValue (GD_BOUNDS (MR (TheGDevice)).right) - 4); DragWindow(wp, p, &bounds); break; case wInGoAway: @@ -107,7 +108,7 @@ P2(PUBLIC pascal trap, void, SystemClick, EventRecord *, evp, WindowPtr, wp) ROMlib_hook(desk_deskhooknumber); EM_D0 = -1; EM_A0 = (LONGINT) (long) US_TO_SYN68K(evp); - CALL_EMULATOR((syn68k_addr_t) (long) CL((long) DeskHook)); + CALL_EMULATOR((syn68k_addr_t) (long) BigEndianValue((long) DeskHook)); } } } @@ -135,12 +136,12 @@ P0(PUBLIC pascal trap, void, SystemTask) DCtlHandle dctlh; INTEGER i; - for (i = 0; i < CW(UnitNtryCnt); ++i) { + for (i = 0; i < BigEndianValue(UnitNtryCnt); ++i) { dctlh = MR(MR(UTableBase)[i].p); if ((HxX(dctlh, dCtlFlags) & CWC(NEEDTIMEBIT)) && TickCount() >= Hx(dctlh, dCtlCurTicks)) { Control(itorn(i), accRun, (Ptr) 0); - HxX(dctlh, dCtlCurTicks) = CL(Hx(dctlh, dCtlCurTicks) + + HxX(dctlh, dCtlCurTicks) = BigEndianValue(Hx(dctlh, dCtlCurTicks) + Hx(dctlh, dCtlDelay)); } } @@ -187,7 +188,7 @@ P1(PUBLIC pascal trap, BOOLEAN, SystemEvent, EventRecord *, evp) rn = WINDOW_KIND (wp); if ((retval = rn < 0)) { dctlh = rntodctlh(rn); - if (Hx(dctlh, dCtlEMask) & (1 << CW(evp->what))) { + if (Hx(dctlh, dCtlEMask) & (1 << BigEndianValue(evp->what))) { templ = (LONGINT) (long) RM(evp); Control(rn, accEvent, (Ptr) &templ); } @@ -205,10 +206,10 @@ P1(PUBLIC pascal trap, void, SystemMenu, LONGINT, menu) INTEGER i; DCtlHandle dctlh; - for (i = 0; i < CW(UnitNtryCnt); ++i) { + for (i = 0; i < BigEndianValue(UnitNtryCnt); ++i) { dctlh = MR(MR(UTableBase)[i].p); if (HxX(dctlh, dCtlMenu) == MBarEnable) { - menu = CL(menu); + menu = BigEndianValue(menu); Control(itorn(i), accMenu, (Ptr) &menu); /*-->*/ break; } diff --git a/src/device.cpp b/src/device.cpp index dc1b798a..daf0de5c 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -24,6 +24,7 @@ char ROMlib_rcsid_device[] = #include "rsys/serial.h" using namespace Executor; +using namespace ByteSwap; /* * NOTE: The device manager now executes "native code" and code read @@ -45,7 +46,7 @@ A4(PUBLIC, OSErr, ROMlib_dispatch, ParmBlkPtr, p, /* INTERNAL */ typedef OSErr (*devfp_t)(ParmBlkPtr, DCtlPtr); devfp_t procp; - devicen = -CW(p->cntrlParam.ioCRefNum) - 1; + devicen = -BigEndianValue(p->cntrlParam.ioCRefNum) - 1; if (devicen < 0 || devicen >= NDEVICES) retval = badUnitErr; else if (UTableBase == (DCtlHandlePtr) (long) CLC(0xFFFFFFFF) || @@ -53,7 +54,7 @@ A4(PUBLIC, OSErr, ROMlib_dispatch, ParmBlkPtr, p, /* INTERNAL */ retval = unitEmptyErr; else { HLock((Handle) h); - p->ioParam.ioTrap = CW(trapn); + p->ioParam.ioTrap = BigEndianValue(trapn); if (async) p->ioParam.ioTrap |= CWC(asyncTrpBit); else @@ -157,7 +158,7 @@ A4(PUBLIC, OSErr, ROMlib_dispatch, ParmBlkPtr, p, /* INTERNAL */ } if (routine < Close) - retval = CW(p->ioParam.ioResult); /* see II-193 */ + retval = BigEndianValue(p->ioParam.ioResult); /* see II-193 */ } } fs_err_hook (retval); @@ -208,8 +209,8 @@ A3(PUBLIC, OSErr, Control, INTEGER, rn, INTEGER, code, OSErr err; pb.cntrlParam.ioVRefNum = 0; - pb.cntrlParam.ioCRefNum = CW(rn); - pb.cntrlParam.csCode = CW(code); + pb.cntrlParam.ioCRefNum = BigEndianValue(rn); + pb.cntrlParam.csCode = BigEndianValue(code); if (param) BlockMove(param, (Ptr) pb.cntrlParam.csParam, (Size) sizeof(pb.cntrlParam.csParam)); @@ -224,8 +225,8 @@ A3(PUBLIC, OSErr, Status, INTEGER, rn, INTEGER, code, Ptr, param) /* IMII-179 */ OSErr retval; pb.cntrlParam.ioVRefNum = 0; - pb.cntrlParam.ioCRefNum = CW(rn); - pb.cntrlParam.csCode = CW(code); + pb.cntrlParam.ioCRefNum = BigEndianValue(rn); + pb.cntrlParam.csCode = BigEndianValue(code); retval = PBStatus(&pb, FALSE); if (param) BlockMove((Ptr) pb.cntrlParam.csParam, param, @@ -239,7 +240,7 @@ A1(PUBLIC, OSErr, KillIO, INTEGER, rn) /* IMII-179 */ ParamBlockRec pb; OSErr err; - pb.cntrlParam.ioCRefNum = CW(rn); + pb.cntrlParam.ioCRefNum = BigEndianValue(rn); err = PBKillIO(&pb, FALSE); fs_err_hook (err); return err; @@ -290,103 +291,103 @@ A2(PUBLIC, OSErr, ROMlib_driveropen, ParmBlkPtr, pbp, /* INTERNAL */ ramdriverhand ramdh; ResType typ; BOOLEAN alreadyopen; - + ZONE_SAVE_EXCURSION - (SysZone, - { - err = noErr; + (SysZone, + { + err = noErr; - if ((ramdh = - (ramdriverhand) GetNamedResource(TICK("DRVR"), - MR(pbp->ioParam.ioNamePtr)))) { - LoadResource((Handle) ramdh); - GetResInfo((Handle) ramdh, &devicen, &typ, (StringPtr) 0); - devicen = CW(devicen); - h = MR(MR(UTableBase)[devicen].p); - alreadyopen = h && (HxX(h, dCtlFlags) & CWC(DRIVEROPENBIT)); - if (!h && !(h = MR(MR(UTableBase)[devicen].p = - RM((DCtlHandle) NewHandle(sizeof(DCtlEntry)))))) - err = MemError(); - else if (!alreadyopen) { - memset((char *) STARH(h), 0, sizeof(DCtlEntry)); - HxX(h, dCtlDriver) = (umacdriverptr) RM(ramdh); - HxX(h, dCtlFlags) = HxX(ramdh, drvrFlags) | CWC(RAMBASEDBIT); - HxX(h, dCtlRefNum) = CW(- (devicen + 1)); - HxX(h, dCtlDelay) = HxX(ramdh, drvrDelay); - HxX(h, dCtlEMask) = HxX(ramdh, drvrEMask); - HxX(h, dCtlMenu) = HxX(ramdh, drvrMenu); - if (HxX(h, dCtlFlags) & CWC(NEEDTIMEBIT)) - HxX(h, dCtlCurTicks) = CL(TickCount() + Hx(h, dCtlDelay)); - else - HxX(h, dCtlCurTicks) = CLC(0x7FFFFFFF); - /* - * NOTE: this code doesn't check to see if something is already open. - * TODO: fix this - */ - pbp->cntrlParam.ioCRefNum = HxX(h, dCtlRefNum); - err = ROMlib_dispatch(pbp, a, Open, 0); - } else - { - pbp->cntrlParam.ioCRefNum = HxX(h, dCtlRefNum); - err = noErr; - } - } else { - - dip = 0; - if (ROMlib_otherdrivers) { - for (dip = ROMlib_otherdrivers; dip->open && - !EqualString(dip->name, MR(pbp->ioParam.ioNamePtr), FALSE, TRUE); - dip++) - ; - if (!dip->open) - dip = 0; - } - if (!dip) { - for (dip = knowndrivers, edip = dip + NELEM(knowndrivers); - dip != edip && - !EqualString(dip->name, MR(pbp->ioParam.ioNamePtr), FALSE, TRUE); - dip++) - ; - if (dip == edip) - dip = 0; - } - if (dip) { - devicen = -dip->refnum -1; - if (devicen < 0 || devicen >= NDEVICES) - err = badUnitErr; - else if (MR(UTableBase)[devicen].p) - err = noErr; /* note: if we choose to support desk */ - /* accessories, we will have to */ - /* check to see if this is one and */ - /* call the open routine if it is */ - else { - if (!(h = MR(MR(UTableBase)[devicen].p = - RM((DCtlHandle) NewHandle(sizeof(DCtlEntry)))))) - err = MemError(); - else { - memset((char *) STARH(h), 0, sizeof(DCtlEntry)); - up = (umacdriverptr) NewPtr(sizeof(umacdriver)); - if (!(HxX(h, dCtlDriver) = RM(up))) - err = MemError(); - else { - up->udrvrOpen = (ProcPtr) RM(dip->open); - up->udrvrPrime = (ProcPtr) RM(dip->prime); - up->udrvrCtl = (ProcPtr) RM(dip->ctl); - up->udrvrStatus = (ProcPtr) RM(dip->status); - up->udrvrClose = (ProcPtr) RM(dip->close); - str255assign(up->udrvrName, dip->name); - err = noErr; - } - } - } - if (err == noErr) { - pbp->cntrlParam.ioCRefNum = CW(dip->refnum); - err = ROMlib_dispatch(pbp, a, Open, 0); - } - } else - err = dInstErr; - } - }); + if ((ramdh = + (ramdriverhand) GetNamedResource(TICK("DRVR"), + MR(pbp->ioParam.ioNamePtr)))) { + LoadResource((Handle) ramdh); + GetResInfo((Handle) ramdh, &devicen, &typ, (StringPtr) 0); + BigEndianInPlace(devicen); + h = MR(MR(UTableBase)[devicen].p); + alreadyopen = h && (HxX(h, dCtlFlags) & CWC(DRIVEROPENBIT)); + if (!h && !(h = MR(MR(UTableBase)[devicen].p = + RM((DCtlHandle) NewHandle(sizeof(DCtlEntry)))))) + err = MemError(); + else if (!alreadyopen) { + memset((char *) STARH(h), 0, sizeof(DCtlEntry)); + HxX(h, dCtlDriver) = (umacdriverptr) RM(ramdh); + HxX(h, dCtlFlags) = HxX(ramdh, drvrFlags) | CWC(RAMBASEDBIT); + HxX(h, dCtlRefNum) = BigEndianValue(- (devicen + 1)); + HxX(h, dCtlDelay) = HxX(ramdh, drvrDelay); + HxX(h, dCtlEMask) = HxX(ramdh, drvrEMask); + HxX(h, dCtlMenu) = HxX(ramdh, drvrMenu); + if (HxX(h, dCtlFlags) & CWC(NEEDTIMEBIT)) + HxX(h, dCtlCurTicks) = BigEndianValue(TickCount() + Hx(h, dCtlDelay)); + else + HxX(h, dCtlCurTicks) = CLC(0x7FFFFFFF); + /* + * NOTE: this code doesn't check to see if something is already open. + * TODO: fix this + */ + pbp->cntrlParam.ioCRefNum = HxX(h, dCtlRefNum); + err = ROMlib_dispatch(pbp, a, Open, 0); + } else + { + pbp->cntrlParam.ioCRefNum = HxX(h, dCtlRefNum); + err = noErr; + } + } else { + + dip = 0; + if (ROMlib_otherdrivers) { + for (dip = ROMlib_otherdrivers; dip->open && + !EqualString(dip->name, MR(pbp->ioParam.ioNamePtr), FALSE, TRUE); + dip++) + ; + if (!dip->open) + dip = 0; + } + if (!dip) { + for (dip = knowndrivers, edip = dip + NELEM(knowndrivers); + dip != edip && + !EqualString(dip->name, MR(pbp->ioParam.ioNamePtr), FALSE, TRUE); + dip++) + ; + if (dip == edip) + dip = 0; + } + if (dip) { + devicen = -dip->refnum -1; + if (devicen < 0 || devicen >= NDEVICES) + err = badUnitErr; + else if (MR(UTableBase)[devicen].p) + err = noErr; /* note: if we choose to support desk */ + /* accessories, we will have to */ + /* check to see if this is one and */ + /* call the open routine if it is */ + else { + if (!(h = MR(MR(UTableBase)[devicen].p = + RM((DCtlHandle) NewHandle(sizeof(DCtlEntry)))))) + err = MemError(); + else { + memset((char *) STARH(h), 0, sizeof(DCtlEntry)); + up = (umacdriverptr) NewPtr(sizeof(umacdriver)); + if (!(HxX(h, dCtlDriver) = RM(up))) + err = MemError(); + else { + up->udrvrOpen = (ProcPtr) RM(dip->open); + up->udrvrPrime = (ProcPtr) RM(dip->prime); + up->udrvrCtl = (ProcPtr) RM(dip->ctl); + up->udrvrStatus = (ProcPtr) RM(dip->status); + up->udrvrClose = (ProcPtr) RM(dip->close); + str255assign(up->udrvrName, dip->name); + err = noErr; + } + } + } + if (err == noErr) { + pbp->cntrlParam.ioCRefNum = BigEndianValue(dip->refnum); + err = ROMlib_dispatch(pbp, a, Open, 0); + } + } else + err = dInstErr; + } + }); fs_err_hook (err); return err; } @@ -410,9 +411,8 @@ A1(PUBLIC, OSErr, CloseDriver, INTEGER, rn) /* IMII-178 */ ParamBlockRec pb; OSErr err; - pb.cntrlParam.ioCRefNum = CW(rn); + pb.cntrlParam.ioCRefNum = BigEndianValue(rn); err = PBClose(&pb, FALSE); fs_err_hook (err); return err; } - diff --git a/src/dialAlert.cpp b/src/dialAlert.cpp index 5677309c..91d41aba 100644 --- a/src/dialAlert.cpp +++ b/src/dialAlert.cpp @@ -25,6 +25,7 @@ char ROMlib_rcsid_dialAlert[] = #include "rsys/dial.h" using namespace Executor; +using namespace ByteSwap; int16 alert_extra_icon_id = -32768; @@ -52,7 +53,7 @@ P2 (PUBLIC pascal trap, INTEGER, Alert, INTEGER, id, /* IMI-418 */ if (id != Cx(ANumber)) { - ANumber = CW(id); + ANumber = BigEndianValue(id); ACount = 0; } ah = (alth) GetResource(TICK("ALRT"), id); @@ -63,9 +64,9 @@ P2 (PUBLIC pascal trap, INTEGER, Alert, INTEGER, id, /* IMI-418 */ } LoadResource((Handle) ah); - n = (Hx(ah, altstag) >> (4 * CW(ACount))) & 0xF; - ACount = CW(CW(ACount) + 1); - if (CW(ACount) > 3) + n = (Hx(ah, altstag) >> (4 * BigEndianValue(ACount))) & 0xF; + ACount = BigEndianValue(BigEndianValue(ACount) + 1); + if (BigEndianValue(ACount) > 3) ACount = CWC(3); BEEP(n & 3); if (! (n & 4)) @@ -138,7 +139,7 @@ P2 (PUBLIC pascal trap, INTEGER, Alert, INTEGER, id, /* IMI-418 */ Handle icon_item_h; icon_item_h = NewHandle (sizeof icon_item_template); - icon_item_template.res_id = CW (alert_extra_icon_id); + icon_item_template.res_id = BigEndianValue (alert_extra_icon_id); memcpy (STARH (icon_item_h), &icon_item_template, sizeof icon_item_template); @@ -168,13 +169,13 @@ P2 (PUBLIC pascal trap, INTEGER, Alert, INTEGER, id, /* IMI-418 */ else FrameRect(&r); } - dp->aDefItem = CW(defbut); + dp->aDefItem = BigEndianValue(defbut); ModalDialog (fp, &hit); }); HSetState (DIALOG_ITEMS (dp), flags); DisposDialog ((DialogPtr) dp); }); - return CW (hit); + return BigEndianValue (hit); } P2 (PUBLIC pascal trap, INTEGER, StopAlert, INTEGER, id, /* IMI-419 */ @@ -228,18 +229,18 @@ A2(PRIVATE, void, lockditl, INTEGER, id, BOOLEAN, flag) itmp ip; if((ih = lockres(TICK("DITL"), id, flag))) { - nitem = CW(*MR(*(INTEGER **)ih)); + nitem = BigEndianValue(*MR(*(INTEGER **)ih)); ip = (itmp)((INTEGER *) STARH(ih) + 1); while (nitem-- >= 0) { if ((CB(ip->itmtype) & RESCTL) == RESCTL) { - h = lockres(TICK("CNTL"), CW(*(INTEGER *)(&(ip->itmlen)+1)), + h = lockres(TICK("CNTL"), BigEndianValue(*(INTEGER *)(&(ip->itmlen)+1)), flag); - procid = CW(*MR(*(INTEGER **)h)) + 8; + procid = BigEndianValue(*MR(*(INTEGER **)h)) + 8; lockres(TICK("CDEF"), procid >> 4, flag); } else if (CB(ip->itmtype) & iconItem) - lockres(TICK("ICON"), CW(*(INTEGER *)(&(ip->itmlen)+1)), flag); + lockres(TICK("ICON"), BigEndianValue(*(INTEGER *)(&(ip->itmlen)+1)), flag); else if (CB(ip->itmtype) & picItem) - lockres(TICK("PICT"), CW(*(INTEGER *)(&(ip->itmlen)+1)), flag); + lockres(TICK("PICT"), BigEndianValue(*(INTEGER *)(&(ip->itmlen)+1)), flag); BUMPIP(ip); } } diff --git a/src/dialCreate.cpp b/src/dialCreate.cpp index baae3fa4..b8887e42 100644 --- a/src/dialCreate.cpp +++ b/src/dialCreate.cpp @@ -31,6 +31,7 @@ char ROMlib_rcsid_dialCreate[] = #include "rsys/host.h" using namespace Executor; +using namespace ByteSwap; #define _PtrToHand(ptr, hand, len) \ ((void) \ @@ -58,7 +59,7 @@ Executor::dialog_create_item (DialogPeek dp, itmp dst, itmp src, /* many items have a resource id at the beginning of the resource data */ - res_id = CW (*data); + res_id = BigEndianValue (*data); if (CB (dst->itmtype) & ctrlItem) { @@ -67,11 +68,11 @@ Executor::dialog_create_item (DialogPeek dp, itmp dst, itmp src, ControlHandle ctl; r = dst->itmr; - if (CW (r.left) > 8192) + if (BigEndianValue (r.left) > 8192) { visible_p = FALSE; - r.left = CW (CW (r.left) - 16384); - r.right = CW (CW (r.right) - 16384); + r.left = BigEndianValue (BigEndianValue (r.left) - 16384); + r.right = BigEndianValue (BigEndianValue (r.right) - 16384); } if ((CB (dst->itmtype) & resCtrl) == resCtrl) @@ -87,7 +88,7 @@ Executor::dialog_create_item (DialogPeek dp, itmp dst, itmp src, top = ctl_rect->top; left = ctl_rect->left; if (r.top != top || r.left != left) - MoveControl (ctl, CW (r.left), CW (r.top)); + MoveControl (ctl, BigEndianValue (r.left), BigEndianValue (r.top)); } } else @@ -126,8 +127,8 @@ Executor::dialog_create_item (DialogPeek dp, itmp dst, itmp src, CCTabHandle color_table; - color_table_bytes = CW (ctl_color_info->data); - color_table_offset = CW (ctl_color_info->offset); + color_table_bytes = BigEndianValue (ctl_color_info->data); + color_table_offset = BigEndianValue (ctl_color_info->offset); color_table_base = ((char *) item_color_info + color_table_offset); @@ -233,10 +234,10 @@ ROMlib_new_dialog_common (DialogPtr dp, { Rect newr; - TextFont (CW (DlgFont)); + TextFont (BigEndianValue (DlgFont)); newr.top = newr.left = CWC (0); - newr.bottom = CW (CW (bounds->bottom) - CW (bounds->top)); - newr.right = CW (CW (bounds->right) - CW (bounds->left)); + newr.bottom = BigEndianValue (BigEndianValue (bounds->bottom) - BigEndianValue (bounds->top)); + newr.right = BigEndianValue (BigEndianValue (bounds->right) - BigEndianValue (bounds->left)); InvalRect (&newr); WINDOW_KIND_X (dp) = CWC (dialogKind); @@ -279,7 +280,7 @@ ROMlib_new_dialog_common (DialogPtr dp, ip = (INTEGER *) STARH (items); itp = (itmp) (ip + 1); - i = CW (*ip); + i = BigEndianValue (*ip); item_no = 1; while (i-- >= 0) { @@ -357,9 +358,9 @@ Executor::dialog_compute_rect (Rect *dialog_rect, Rect *dst_rect, parent_rect = &PORT_RECT (parent); - top = CW (parent_rect->top) + 16; - left = ( ( CW (parent_rect->left) - + CW (parent_rect->right)) / 2 + top = BigEndianValue (parent_rect->top) + 16; + left = ( ( BigEndianValue (parent_rect->left) + + BigEndianValue (parent_rect->right)) / 2 + dialog_width / 2); SetRect (dst_rect, @@ -448,7 +449,7 @@ P1(PUBLIC pascal trap, void, CloseDialog, DialogPtr, dp) /* IMI-413 */ { /* #### should `items' be locked? */ ip = (INTEGER *) STARH (items); - i = CW(*ip); + i = BigEndianValue(*ip); itp = (itmp)(ip + 1); while (i-- >= 0) { diff --git a/src/dialDispatch.cpp b/src/dialDispatch.cpp index 04b6430b..98bdd1df 100644 --- a/src/dialDispatch.cpp +++ b/src/dialDispatch.cpp @@ -14,6 +14,7 @@ char ROMlib_rcsid_dialDispatch[] = #include "DialogMgr.h" using namespace Executor; +using namespace ByteSwap; /* traps from the DialogDispatch trap */ @@ -34,7 +35,7 @@ P2 (PUBLIC pascal trap, OSErr, SetDialogDefaultItem, DialogPtr, dialog, dp = (DialogPeek) dialog; - dp->aDefItem = CW (new_item); + dp->aDefItem = BigEndianValue (new_item); warning_unimplemented ("no specs"); return noErr; } diff --git a/src/dialHandle.cpp b/src/dialHandle.cpp index bfce4697..399fae32 100644 --- a/src/dialHandle.cpp +++ b/src/dialHandle.cpp @@ -38,6 +38,7 @@ char ROMlib_rcsid_dialHandle[] = #include "rsys/osevent.h" using namespace Executor; +using namespace ByteSwap; P3(PUBLIC pascal, BOOLEAN, ROMlib_myfilt, DialogPeek, dp, EventRecord *, evt, INTEGER *, ith) /* IMI-415 */ @@ -50,7 +51,7 @@ P3(PUBLIC pascal, BOOLEAN, ROMlib_myfilt, DialogPeek, dp, EventRecord *, evt, if (Cx(evt->what) == keyDown && ((Cx(evt->message) & 0xFF) == '\r' || (Cx(evt->message) & 0xFF) == NUMPAD_ENTER)) { - ip = ROMlib_dpnotoip(dp, CW(*ith = dp->aDefItem), &flags); + ip = ROMlib_dpnotoip(dp, BigEndianValue(*ith = dp->aDefItem), &flags); if (ip && (CB(ip->itmtype) & ctrlItem)) { c = (ControlHandle) MR(ip->itmhand); if (Hx(c, contrlVis) && U(Hx(c, contrlHilite)) != INACTIVE) { @@ -168,7 +169,7 @@ P2 (PUBLIC pascal trap, void, ModalDialog, ProcPtr, fp, /* IMI-415 */ dp = (DialogPeek) FrontWindow (); if (dp->window.windowKind != CWC (dialogKind) && - CW (dp->window.windowKind) >= 0) + BigEndianValue (dp->window.windowKind) >= 0) *item = CWC (-1); else { @@ -186,10 +187,10 @@ P2 (PUBLIC pascal trap, void, ModalDialog, ProcPtr, fp, /* IMI-415 */ if (idle) TEIdle (idle); GetNextEvent (DIALOGEVTS, &evt); - whereunswapped.h = CW (evt.where.h); - whereunswapped.v = CW (evt.where.v); + whereunswapped.h = BigEndianValue (evt.where.h); + whereunswapped.v = BigEndianValue (evt.where.v); - mousedown_p = (CW (evt.what) == mouseDown); + mousedown_p = (BigEndianValue (evt.what) == mouseDown); /* dummy initializations to keep gcc happy */ temp_wp = NULL; @@ -246,7 +247,7 @@ P2 (PUBLIC pascal trap, void, ModalDialog, ProcPtr, fp, /* IMI-415 */ dp = (DialogPeek) FrontWindow (); if (dp->window.windowKind != CWC (dialogKind) && - CW (dp->window.windowKind) >= 0) + BigEndianValue (dp->window.windowKind) >= 0) *item = CWC (-1); else { @@ -264,10 +265,10 @@ P2 (PUBLIC pascal trap, void, ModalDialog, ProcPtr, fp, /* IMI-415 */ if (idle) TEIdle (idle); GetNextEvent (DIALOGEVTS, &evt); - whereunswapped.h = CW (evt.where.h); - whereunswapped.v = CW (evt.where.v); + whereunswapped.h = BigEndianValue (evt.where.h); + whereunswapped.v = BigEndianValue (evt.where.v); - mousedown_p = (CW (evt.what) == mouseDown); + mousedown_p = (BigEndianValue (evt.what) == mouseDown); /* dummy initializations to keep gcc happy */ temp_wp = NULL; @@ -314,8 +315,8 @@ P1(PUBLIC pascal trap, BOOLEAN, IsDialogEvent, /* IMI-416 */ if (dp && dp->window.windowKind == CWC(dialogKind)) { if (dp->editField != -1) TEIdle(MR(dp->textH)); - p.h = CW(evt->where.h); - p.v = CW(evt->where.v); + p.h = BigEndianValue(evt->where.h); + p.v = BigEndianValue(evt->where.v); /*-->*/ return evt->what != CWC(mouseDown) || (FindWindow(p, &wp) == inContent && MR(wp.p) == (WindowPtr) dp); } @@ -343,8 +344,8 @@ Executor::get_item_style_info (DialogPtr dp, int item_no, uint16 flags; int style_info_offset; - flags = CW (item_color_info->data); - style_info_offset = CW (item_color_info->offset); + flags = BigEndianValue (item_color_info->data); + style_info_offset = BigEndianValue (item_color_info->offset); *style_info = *(item_style_info_t *) ((char *) items_color_info + style_info_offset); @@ -352,7 +353,7 @@ Executor::get_item_style_info (DialogPtr dp, int item_no, { char *font_name; - font_name = (char *) items_color_info + CW (style_info->font); + font_name = (char *) items_color_info + BigEndianValue (style_info->font); GetFNum ((StringPtr) font_name, &style_info->font); } @@ -378,11 +379,11 @@ Executor::ROMlib_drawiptext (DialogPtr dp, itmp ip, int item_no) restore_draw_state_p = TRUE; if (flags & TEdoFont) - TextFont (CW (style_info.font)); + TextFont (BigEndianValue (style_info.font)); if (flags & TEdoFace) TextFace (CB (style_info.face)); if (flags & TEdoSize) - TextSize (CW (style_info.size)); + TextSize (BigEndianValue (style_info.size)); if (flags & TEdoColor) RGBForeColor (&style_info.foreground); #if 1 @@ -588,8 +589,8 @@ P3 (PUBLIC pascal trap, BOOLEAN, DialogSelect, /* IMI-417 */ gp = thePort; SetPort((GrafPtr) dp); GlobalToLocal(&localp); - localp.h = CW(localp.h); - localp.v = CW(localp.v); + localp.h = BigEndianValue(localp.h); + localp.v = BigEndianValue(localp.v); SetPort(gp); intp = (INTEGER *) STARH(MR(dp->items)); iend = Cx(*intp) + 2; @@ -620,7 +621,7 @@ P3 (PUBLIC pascal trap, BOOLEAN, DialogSelect, /* IMI-417 */ } if (itemenabled) { - *itemp = CW(i); + *itemp = BigEndianValue(i); retval = TRUE; break; } @@ -640,14 +641,14 @@ P3 (PUBLIC pascal trap, BOOLEAN, DialogSelect, /* IMI-417 */ default: TEKey (c, DIALOG_TEXTH (dp)); } - *itemp = CW(CW(dp->editField)+1); - ip = ROMlib_dpnotoip(dp, CW(*itemp), &flags); + *itemp = BigEndianValue(BigEndianValue(dp->editField)+1); + ip = ROMlib_dpnotoip(dp, BigEndianValue(*itemp), &flags); if (ip) retval = !(CB(ip->itmtype) & itemDisable); else { warning_unexpected ("couldn't resolve editField -- dp = %p, " - "CW (*itemp) = %d", dp, CW (*itemp)); + "BigEndianValue (*itemp) = %d", dp, BigEndianValue (*itemp)); retval = FALSE; } HSetState(MR(((DialogPeek) dp)->items), flags); diff --git a/src/dialInit.cpp b/src/dialInit.cpp index c4556b3f..9a01d1a3 100644 --- a/src/dialInit.cpp +++ b/src/dialInit.cpp @@ -20,6 +20,7 @@ char ROMlib_rcsid_dialInit[] = #include "rsys/mman.h" using namespace Executor; +using namespace ByteSwap; P1(PUBLIC, pascal void, ROMlib_mysound, INTEGER, i) { @@ -61,5 +62,5 @@ P1 (PUBLIC pascal trap, void, InitDialogs, ProcPtr, rp) /* IMI-411 */ A1(PUBLIC, void, SetDAFont, INTEGER, i) /* IMI-412 */ { - DlgFont = CW(i); + DlgFont = BigEndianValue(i); } diff --git a/src/dialItem.cpp b/src/dialItem.cpp index 22aa0fd9..40062f4d 100644 --- a/src/dialItem.cpp +++ b/src/dialItem.cpp @@ -18,6 +18,7 @@ char ROMlib_rcsid_dialItem[] = #include "rsys/mman.h" using namespace Executor; +using namespace ByteSwap; #define _GetDItem(dp, item_no, item_type, item_h, item_rect) \ ({ \ @@ -53,8 +54,8 @@ Executor::AppendDITL (DialogPtr dp, Handle new_items_h, DITLMethod method) _GetDItem (dp, method, &item_type, &item_h, &item_rect); resize_p = FALSE; - base_pt.v = CW (item_rect.top); - base_pt.h = CW (item_rect.left); + base_pt.v = BigEndianValue (item_rect.top); + base_pt.h = BigEndianValue (item_rect.left); } else { @@ -69,12 +70,12 @@ Executor::AppendDITL (DialogPtr dp, Handle new_items_h, DITLMethod method) case appendDITLRight: resize_p = TRUE; base_pt.v = 0; - base_pt.h = CW (dp_port_rect->right); + base_pt.h = BigEndianValue (dp_port_rect->right); break; case appendDITLBottom: resize_p = TRUE; - base_pt.v = CW (dp_port_rect->bottom); + base_pt.v = BigEndianValue (dp_port_rect->bottom); base_pt.h = 0; break; } @@ -92,7 +93,7 @@ Executor::AppendDITL (DialogPtr dp, Handle new_items_h, DITLMethod method) int i; base_itemp = (char *) STARH (items_h); - item_count = CW (*(int16 *) base_itemp) + 1; + item_count = BigEndianValue (*(int16 *) base_itemp) + 1; itemp = (itmp) ((int16 *) STARH (items_h) + 1); for (i = 0; i < item_count; i ++) @@ -125,14 +126,14 @@ Executor::AppendDITL (DialogPtr dp, Handle new_items_h, DITLMethod method) int i; base_itemp = (char *) STARH (items_h); - item_count = CW (*(int16 *) base_itemp) + 1; + item_count = BigEndianValue (*(int16 *) base_itemp) + 1; base_new_itemp = (char *) STARH (new_items_h); new_itemp = (itmp) ((int16 *) STARH (new_items_h) + 1); - new_item_count = CW (*(int16 *) base_new_itemp) + 1; + new_item_count = BigEndianValue (*(int16 *) base_new_itemp) + 1; /* update the count for the new items */ - *(int16 *) base_itemp = CW (item_count + new_item_count - 1); + *(int16 *) base_itemp = BigEndianValue (item_count + new_item_count - 1); THEPORT_SAVE_EXCURSION (dp, @@ -151,8 +152,8 @@ Executor::AppendDITL (DialogPtr dp, Handle new_items_h, DITLMethod method) InvalRect (&itemp->itmr); - width = MAX (width, CW (itemp->itmr.left)); - height = MAX (height, CW (itemp->itmr.bottom)); + width = MAX (width, BigEndianValue (itemp->itmr.left)); + height = MAX (height, BigEndianValue (itemp->itmr.bottom)); BUMPIP (new_itemp); } @@ -186,7 +187,7 @@ Executor::ShortenDITL (DialogPtr dp, int16 n_items) { base_itemp = (char *) STARH (item_h); itemp = (itmp) ((int16 *) STARH (item_h) + 1); - count = CW (*(int16 *) base_itemp) + 1; + count = BigEndianValue (*(int16 *) base_itemp) + 1; if (count < n_items) n_items = count; @@ -261,7 +262,7 @@ Executor::ShortenDITL (DialogPtr dp, int16 n_items) } } } - *(int16 *) base_itemp = CW (first_item_to_dispose - 1); + *(int16 *) base_itemp = BigEndianValue (first_item_to_dispose - 1); }); SetHandleSize ((Handle) item_h, item_h_size); @@ -274,7 +275,7 @@ Executor::CountDITL (DialogPtr dp) int16 count; items = DIALOG_ITEMS (dp); - count = CW (*(int16 *) STARH (items)) + 1; + count = BigEndianValue (*(int16 *) STARH (items)) + 1; return count; } diff --git a/src/dialManip.cpp b/src/dialManip.cpp index 409dbd1a..95ec32dd 100644 --- a/src/dialManip.cpp +++ b/src/dialManip.cpp @@ -23,6 +23,7 @@ char ROMlib_rcsid_dialManip[] = #include "rsys/mman.h" using namespace Executor; +using namespace ByteSwap; namespace Executor { PRIVATE itmp htoip(Handle h, @@ -61,7 +62,7 @@ A3 (PUBLIC, itmp, ROMlib_dpnotoip, DialogPeek, dp, /* INTERNAL */ items = DIALOG_ITEMS (dp); *flags = hlock_return_orig_state (items); intp = (INTEGER *) STARH (items); - if (itemno <= 0 || itemno > CW (*intp) + 1) + if (itemno <= 0 || itemno > BigEndianValue (*intp) + 1) retval = 0; else { @@ -93,7 +94,7 @@ A4 (PRIVATE, itmp, htoip, Handle, h, ip = (int16 *) STARH (items); retval = (itmp) (ip + 1); - for (i = CW (*ip) + 1, nop = 1; i --; BUMPIP (retval)) + for (i = BigEndianValue (*ip) + 1, nop = 1; i --; BUMPIP (retval)) { if (MR (retval->itmhand) == h) { @@ -119,14 +120,14 @@ P5(PUBLIC pascal trap, void, GetDItem, DialogPtr, dp, /* IMI-421 */ if (ip) { if (itype) - *itype = CW((INTEGER) ip->itmtype); + *itype = BigEndianValue((INTEGER) ip->itmtype); else { /* test on Mac shows unconditional write of *itype */ /* of course this is very rude, but that's what the Mac did when we tested it. Perhaps they've fixed that now and we too should fix it. ARGH! */ - *(INTEGER *) (US_TO_SYN68K(itype)) = CW((INTEGER) ip->itmtype); + *(INTEGER *) (US_TO_SYN68K(itype)) = BigEndianValue((INTEGER) ip->itmtype); } if (item) /* We didn't test what happens when item is 0 on Mac */ (*item).p = ip->itmhand; @@ -159,7 +160,7 @@ settexth (DialogPeek dp, itmp ip, int item_no) item_text_h = ITEM_H (ip); length = GetHandleSize (item_text_h); - TEP_LENGTH_X (tep) = CW (length); + TEP_LENGTH_X (tep) = BigEndianValue (length); /* this is not a leak, always a duplicate */ TEP_HTEXT_X (tep) = RM (item_text_h); @@ -181,11 +182,11 @@ settexth (DialogPeek dp, itmp ip, int item_no) if (get_item_style_info ((DialogPtr) dp, item_no, &flags, &style_info)) { if (flags & TEdoFont) - te_style_font = CW (style_info.font); + te_style_font = BigEndianValue (style_info.font); if (flags & TEdoFace) te_style_face = CB (style_info.face); if (flags & TEdoSize) - te_style_size = CW (style_info.size); + te_style_size = BigEndianValue (style_info.size); if (flags & TEdoColor) te_style_color = style_info.foreground; @@ -217,7 +218,7 @@ settexth (DialogPeek dp, itmp ip, int item_no) TE_STYLE_SIZE_FOR_N_RUNS (1)); HxX (te_style, runs[0].startChar) = CWC (0); HxX (te_style, runs[0].styleIndex) = CWC (0); - HxX (te_style, runs[1].startChar) = CW (length + 1); + HxX (te_style, runs[1].startChar) = BigEndianValue (length + 1); HxX (te_style, runs[1].styleIndex) = CWC (-1); style_table = TE_STYLE_STYLE_TABLE (te_style); SetHandleSize ((Handle) style_table, @@ -227,8 +228,8 @@ settexth (DialogPeek dp, itmp ip, int item_no) tx_size_save_x = PORT_TX_SIZE_X (current_port); tx_face_save = PORT_TX_FACE (current_port); - PORT_TX_FONT_X (current_port) = CW (te_style_font); - PORT_TX_SIZE_X (current_port) = CW (te_style_size); + PORT_TX_FONT_X (current_port) = BigEndianValue (te_style_font); + PORT_TX_SIZE_X (current_port) = BigEndianValue (te_style_size); PORT_TX_FACE (current_port) = CB (te_style_face); GetFontInfo (&finfo); @@ -240,19 +241,19 @@ settexth (DialogPeek dp, itmp ip, int item_no) HASSIGN_7 (style_table, stCount, CWC (1), - stFont, CW (te_style_font), + stFont, BigEndianValue (te_style_font), stFace, te_style_face, - stSize, CW (te_style_size), + stSize, BigEndianValue (te_style_size), stColor, te_style_color, - stHeight, CW (CW (finfo.ascent) - + CW (finfo.descent) - + CW (finfo.leading)), + stHeight, BigEndianValue (BigEndianValue (finfo.ascent) + + BigEndianValue (finfo.descent) + + BigEndianValue (finfo.leading)), stAscent, finfo.ascent); } else { - TEP_TX_FONT_X (tep) = CW (te_style_font); - TEP_TX_SIZE_X (tep) = CW (te_style_size); + TEP_TX_FONT_X (tep) = BigEndianValue (te_style_font); + TEP_TX_SIZE_X (tep) = BigEndianValue (te_style_size); TEP_TX_FACE (tep) = CB (te_style_face); } } @@ -263,7 +264,7 @@ settexth (DialogPeek dp, itmp ip, int item_no) if (WINDOW_VISIBLE_X (dp)) TEActivate (te); - DIALOG_EDIT_FIELD_X (dp) = CW (item_no - 1); + DIALOG_EDIT_FIELD_X (dp) = BigEndianValue (item_no - 1); DIALOG_EDIT_OPEN_X (dp) = CW (! (ITEM_TYPE (ip) & itemDisable)); } @@ -423,11 +424,11 @@ P2 (PUBLIC pascal trap, void, HideDItem, DialogPtr, dp, /* IMIV-59 */ SignedByte flags; ip = ROMlib_dpnotoip((DialogPeek) dp, item, &flags); - if (ip && CW (ip->itmr.left) < 8192) + if (ip && BigEndianValue (ip->itmr.left) < 8192) { r = ip->itmr; - ip->itmr.left = CW (CW (ip->itmr.left) + 16384); - ip->itmr.right = CW (CW (ip->itmr.right) + 16384); + ip->itmr.left = BigEndianValue (BigEndianValue (ip->itmr.left) + 16384); + ip->itmr.right = BigEndianValue (BigEndianValue (ip->itmr.right) + 16384); if (CB (ip->itmtype) & editText) { InsetRect (&r, -3, -3); @@ -465,10 +466,10 @@ P2 (PUBLIC pascal trap, void, ShowDItem, DialogPtr, dp, /* IMIV-59 */ SignedByte flags; ip = ROMlib_dpnotoip ((DialogPeek) dp, item, &flags); - if (ip && CW (ip->itmr.left) > 8192) + if (ip && BigEndianValue (ip->itmr.left) > 8192) { - ip->itmr.left = CW (CW (ip->itmr.left) - 16384); - ip->itmr.right = CW (CW (ip->itmr.right) - 16384); + ip->itmr.left = BigEndianValue (BigEndianValue (ip->itmr.left) - 16384); + ip->itmr.right = BigEndianValue (BigEndianValue (ip->itmr.right) - 16384); r = ip->itmr; if (CB (ip->itmtype) & editText) { diff --git a/src/diskinit.cpp b/src/diskinit.cpp index 41c7fce1..cc18567a 100644 --- a/src/diskinit.cpp +++ b/src/diskinit.cpp @@ -21,6 +21,7 @@ char ROMlib_rcsid_diskinit[] = #include "rsys/blockinterrupts.h" using namespace Executor; +using namespace ByteSwap; P0(PUBLIC pascal trap, void, DILoad) { @@ -76,17 +77,17 @@ raw_read_write (func_t func, our_file_info_t *op, LONGINT *lengthp, ParamBlockRec pbr; check_virtual_interrupt (); - pbr.ioParam.ioVRefNum = CW (op->vref); - pbr.ioParam.ioRefNum = CW (op->dref); + pbr.ioParam.ioVRefNum = BigEndianValue (op->vref); + pbr.ioParam.ioRefNum = BigEndianValue (op->dref); pbr.ioParam.ioBuffer = (Ptr) RM (buf); - pbr.ioParam.ioReqCount = CL (*lengthp); + pbr.ioParam.ioReqCount = BigEndianValue (*lengthp); pbr.ioParam.ioPosMode = CWC (fsFromStart); - pbr.ioParam.ioPosOffset = CL (op->pos); + pbr.ioParam.ioPosOffset = BigEndianValue (op->pos); retval = func (&pbr, FALSE); if (retval == noErr) { - *lengthp = CL (pbr.ioParam.ioActCount); - op->pos += CL (pbr.ioParam.ioActCount); + *lengthp = BigEndianValue (pbr.ioParam.ioActCount); + op->pos += BigEndianValue (pbr.ioParam.ioActCount); } return retval; } diff --git a/src/dump.cpp b/src/dump.cpp index 0f3ea193..612c5dee 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -47,17 +47,17 @@ char ROMlib_rcsid_dump[] = #define deref(x) (*(x)) #define Cx(x) (x) -#define CW(x) (x) +#define BigEndianValue(x) (x) #define CWC(x) (x) -#define CL(x) (x) +#define BigEndianValue(x) (x) #define CLC(x) (x) #define theCPort ((CGrafPtr) thePort) #define CGrafPort_p(port) (((char *)(port))[6] & 0xC0) #define ROWBYTES_VALUE_BITS (0x3FFF) -#define RECT_HEIGHT(r) (CW ((r)->bottom) - CW ((r)->top)) -#define RECT_WIDTH(r) (CW ((r)->right) - CW ((r)->left)) +#define RECT_HEIGHT(r) (BigEndianValue ((r)->bottom) - BigEndianValue ((r)->top)) +#define RECT_WIDTH(r) (BigEndianValue ((r)->right) - BigEndianValue ((r)->left)) /* window accessors */ #define WINDOW_PORT(wp) (&((WindowPeek) (wp))->port) @@ -110,11 +110,11 @@ char ROMlib_rcsid_dump[] = #define DIALOG_EDIT_OPEN_X(dialog) (((DialogPeek) (dialog))->editOpen) #define DIALOG_ADEF_ITEM_X(dialog) (((DialogPeek) (dialog))->aDefItem) -#define DIALOG_ITEMS(dialog) (CL (DIALOG_ITEMS_X (dialog))) -#define DIALOG_TEXTH(dialog) (CL (DIALOG_TEXTH_X (dialog))) -#define DIALOG_EDIT_FIELD(dialog) (CW (DIALOG_EDIT_FIELD_X (dialog))) -#define DIALOG_EDIT_OPEN(dialog) (CW (DIALOG_EDIT_OPEN_X (dialog))) -#define DIALOG_ADEF_ITEM(dialog) (CW (DIALOG_ADEF_ITEM_X (dialog))) +#define DIALOG_ITEMS(dialog) (BigEndianValue (DIALOG_ITEMS_X (dialog))) +#define DIALOG_TEXTH(dialog) (BigEndianValue (DIALOG_TEXTH_X (dialog))) +#define DIALOG_EDIT_FIELD(dialog) (BigEndianValue (DIALOG_EDIT_FIELD_X (dialog))) +#define DIALOG_EDIT_OPEN(dialog) (BigEndianValue (DIALOG_EDIT_OPEN_X (dialog))) +#define DIALOG_ADEF_ITEM(dialog) (BigEndianValue (DIALOG_ADEF_ITEM_X (dialog))) enum pixpat_pattern_types { @@ -140,6 +140,7 @@ enum pixpat_pattern_types #include using namespace Executor; +using namespace ByteSwap; FILE *Executor::o_fp = NULL; @@ -250,9 +251,9 @@ void Executor::dump_rect (Rect *r) { iprintf ((o_fp, "%s(Rect *%p) {\n", field_name.c_str(), r)); indent += 2; - iprintf ((o_fp, "top 0x%x; left 0x%x;\n", CW (r->top), CW (r->left))); + iprintf ((o_fp, "top 0x%x; left 0x%x;\n", BigEndianValue (r->top), BigEndianValue (r->left))); iprintf ((o_fp, "bottom 0x%x; right 0x%x; }\n", - CW (r->bottom), CW (r->right))); indent -= 2; + BigEndianValue (r->bottom), BigEndianValue (r->right))); indent -= 2; fflush (o_fp); } @@ -269,7 +270,7 @@ void Executor::dump_point (Point x) { iprintf ((o_fp, "%s(Point) { v 0x%x; h 0x%x; }\n", - field_name.c_str(), CW (x.v), CW (x.h))); + field_name.c_str(), BigEndianValue (x.v), BigEndianValue (x.h))); fflush (o_fp); } @@ -286,10 +287,10 @@ Executor::dump_bitmap_data (BitMap *x, int depth, Rect *rect) if (!rect) rect = &x->bounds; - row_bytes = CW (x->rowBytes) & ROWBYTES_VALUE_BITS; + row_bytes = BigEndianValue (x->rowBytes) & ROWBYTES_VALUE_BITS; addr = (char *) - &MR (x->baseAddr)[(CW (rect->top) - CW (x->bounds.top)) * row_bytes - + ((CW (rect->left) - CW (x->bounds.left)) + &MR (x->baseAddr)[(BigEndianValue (rect->top) - BigEndianValue (x->bounds.top)) * row_bytes + + ((BigEndianValue (rect->left) - BigEndianValue (x->bounds.left)) * depth) / 8]; rows = RECT_HEIGHT (&x->bounds); bytes_per_row = (RECT_WIDTH (&x->bounds) * depth + 7) / 8; @@ -344,7 +345,7 @@ Executor::dump_bitmap (BitMap *x, Rect *rect) iprintf ((o_fp, "baseAddr %p;\n", MR (x->baseAddr))); if (dump_verbosity >= 3) dump_bitmap_data (x, 1, rect); - iprintf ((o_fp, "rowBytes 0x%hx;\n", (unsigned short) CW (x->rowBytes))); + iprintf ((o_fp, "rowBytes 0x%hx;\n", (unsigned short) BigEndianValue (x->rowBytes))); dump_field (dump_rect, &x->bounds, "bounds"); indent -= 2; iprintf ((o_fp, "}\n")); fflush (o_fp); @@ -396,7 +397,7 @@ void Executor::dump_grafport_real (GrafPtr x) { iprintf ((o_fp, "%s(GrafPort *%p) {\n", field_name.c_str(), x)); indent += 2; - iprintf ((o_fp, "device %d;\n", CW (x->device))); + iprintf ((o_fp, "device %d;\n", BigEndianValue (x->device))); dump_field (dump_bitmap_null_rect, &x->portBits, "portBits"); dump_field (dump_rect, &x->portRect, "portRect"); dump_field (dump_handle, MR (x->visRgn), "visRgn"); @@ -405,18 +406,18 @@ Executor::dump_grafport_real (GrafPtr x) dump_field (dump_pattern, x->fillPat, "fillPat"); dump_field (dump_point, x->pnLoc, "pnLoc"); dump_field (dump_point, x->pnSize, "pnSize"); - iprintf ((o_fp, "pnMode %d;\n", CW (x->pnMode))); + iprintf ((o_fp, "pnMode %d;\n", BigEndianValue (x->pnMode))); dump_field (dump_pattern, x->pnPat, "pnPat"); - iprintf ((o_fp, "pnVis %d;\n", CW (x->pnVis))); - iprintf ((o_fp, "txFont %d;\n", CW (x->txFont))); + iprintf ((o_fp, "pnVis %d;\n", BigEndianValue (x->pnVis))); + iprintf ((o_fp, "txFont %d;\n", BigEndianValue (x->txFont))); iprintf ((o_fp, "txFace %d;\n", x->txFace)); - iprintf ((o_fp, "txMode %d;\n", CW (x->txMode))); - iprintf ((o_fp, "txSize %d;\n", CW (x->txSize))); - iprintf ((o_fp, "spExtra %d;\n", CL (x->spExtra))); - iprintf ((o_fp, "fgColor 0x%x;\n", CL (x->fgColor))); - iprintf ((o_fp, "bkColor 0x%x;\n", CL (x->bkColor))); - iprintf ((o_fp, "colrBit %d;\n", CW (x->colrBit))); - iprintf ((o_fp, "patStretch %d;\n", CW (x->patStretch))); + iprintf ((o_fp, "txMode %d;\n", BigEndianValue (x->txMode))); + iprintf ((o_fp, "txSize %d;\n", BigEndianValue (x->txSize))); + iprintf ((o_fp, "spExtra %d;\n", BigEndianValue (x->spExtra))); + iprintf ((o_fp, "fgColor 0x%x;\n", BigEndianValue (x->fgColor))); + iprintf ((o_fp, "bkColor 0x%x;\n", BigEndianValue (x->bkColor))); + iprintf ((o_fp, "colrBit %d;\n", BigEndianValue (x->colrBit))); + iprintf ((o_fp, "patStretch %d;\n", BigEndianValue (x->patStretch))); dump_field (dump_handle, MR (x->picSave), "picSave"); dump_field (dump_handle, MR (x->rgnSave), "rgnSave"); dump_field (dump_handle, MR (x->polySave), "polySave"); @@ -442,9 +443,9 @@ Executor::dump_rgb_color (RGBColor *x) { iprintf ((o_fp, "%s(RGBColor) { red 0x%lx; green 0x%lx, blue 0x%lx; }\n", field_name.c_str(), - (long) CW (x->red), - (long) CW (x->green), - (long) CW (x->blue))); + (long) BigEndianValue (x->red), + (long) BigEndianValue (x->green), + (long) BigEndianValue (x->blue))); fflush (o_fp); } @@ -454,21 +455,21 @@ Executor::dump_ctab (CTabHandle ctab) CTabPtr x = deref (ctab); iprintf ((o_fp, "%s(ColorTable **%p) {\n", field_name.c_str(), ctab)); indent += 2; - iprintf ((o_fp, "ctSeed 0x%x;\n", CL (x->ctSeed))); - iprintf ((o_fp, "ctFlags 0x%x;\n", CW (x->ctFlags))); - iprintf ((o_fp, "ctSize %d;\n", CW (x->ctSize))); + iprintf ((o_fp, "ctSeed 0x%x;\n", BigEndianValue (x->ctSeed))); + iprintf ((o_fp, "ctFlags 0x%x;\n", BigEndianValue (x->ctFlags))); + iprintf ((o_fp, "ctSize %d;\n", BigEndianValue (x->ctSize))); if (dump_verbosity >= 2) { int i; iprintf ((o_fp, "ctTable\n")); - for (i = 0; i <= CW (x->ctSize); i ++) + for (i = 0; i <= BigEndianValue (x->ctSize); i ++) { iprintf ((o_fp, "%d:[0x%x] { 0x%lx, 0x%lx, 0x%lx }\n", - i, CW (x->ctTable[i].value), - (long) CW (x->ctTable[i].rgb.red), - (long) CW (x->ctTable[i].rgb.green), - (long) CW (x->ctTable[i].rgb.blue))); + i, BigEndianValue (x->ctTable[i].value), + (long) BigEndianValue (x->ctTable[i].rgb.red), + (long) BigEndianValue (x->ctTable[i].rgb.green), + (long) BigEndianValue (x->ctTable[i].rgb.blue))); } indent -= 2; iprintf ((o_fp, "}\n")); } @@ -485,8 +486,8 @@ Executor::dump_itab (ITabHandle itab) ITabPtr x = deref (itab); iprintf ((o_fp, "%s(ITab **%p) {\n", field_name.c_str(), itab)); indent += 2; - iprintf ((o_fp, "iTabSeed 0x%x;\n", CL (x->iTabSeed))); - iprintf ((o_fp, "iTabRes %d;\n", CW (x->iTabRes))); + iprintf ((o_fp, "iTabSeed 0x%x;\n", BigEndianValue (x->iTabSeed))); + iprintf ((o_fp, "iTabRes %d;\n", BigEndianValue (x->iTabRes))); /* we always omit the inverse table... */ iprintf ((o_fp, "[iTTable field omitted]; }\n")); indent -= 2; @@ -522,7 +523,7 @@ Executor::dump_pixpat (PixPatHandle pixpat) iprintf ((o_fp, "[pat{Map, Data} field omitted]; }\n")); } dump_field (dump_handle, MR (x->patXData), "patXData"); - iprintf ((o_fp, "patXValid %d;\n", CW (x->patXValid))); + iprintf ((o_fp, "patXValid %d;\n", BigEndianValue (x->patXValid))); if (dump_verbosity && x->patXMap && !x->patXValid) @@ -545,20 +546,20 @@ dump_pixmap_ptr (PixMapPtr x, Rect *rect) { if (!rect) rect = &x->bounds; - dump_bitmap_data ((BitMap *) x, CW (x->pixelSize), rect); + dump_bitmap_data ((BitMap *) x, BigEndianValue (x->pixelSize), rect); } - iprintf ((o_fp, "rowBytes 0x%hx;\n", (unsigned short) CW (x->rowBytes))); + iprintf ((o_fp, "rowBytes 0x%hx;\n", (unsigned short) BigEndianValue (x->rowBytes))); dump_field (dump_rect, &x->bounds, "bounds"); - iprintf ((o_fp, "pmVersion 0x%x;\n", CW (x->pmVersion))); - iprintf ((o_fp, "packType 0x%x;\n", CW (x->packType))); - iprintf ((o_fp, "packSize 0x%x;\n", CW (x->packSize))); + iprintf ((o_fp, "pmVersion 0x%x;\n", BigEndianValue (x->pmVersion))); + iprintf ((o_fp, "packType 0x%x;\n", BigEndianValue (x->packType))); + iprintf ((o_fp, "packSize 0x%x;\n", BigEndianValue (x->packSize))); iprintf ((o_fp, "hRes 0x%x, vRes 0x%x;\n", - CW (x->hRes), CW (x->vRes))); - iprintf ((o_fp, "pixelType 0x%x;\n", CW (x->pixelType))); - iprintf ((o_fp, "pixelSize %d;\n", CW (x->pixelSize))); - iprintf ((o_fp, "cmpCount %d;\n", CW (x->cmpCount))); - iprintf ((o_fp, "cmpSize %d;\n", CW (x->cmpSize))); - iprintf ((o_fp, "planeBytes 0x%x;\n", CL (x->planeBytes))); + BigEndianValue (x->hRes), BigEndianValue (x->vRes))); + iprintf ((o_fp, "pixelType 0x%x;\n", BigEndianValue (x->pixelType))); + iprintf ((o_fp, "pixelSize %d;\n", BigEndianValue (x->pixelSize))); + iprintf ((o_fp, "cmpCount %d;\n", BigEndianValue (x->cmpCount))); + iprintf ((o_fp, "cmpSize %d;\n", BigEndianValue (x->cmpSize))); + iprintf ((o_fp, "planeBytes 0x%x;\n", BigEndianValue (x->planeBytes))); if (dump_verbosity && x->pmTable) dump_field (dump_ctab, MR (x->pmTable), "pmTable"); @@ -586,20 +587,20 @@ Executor::dump_pixmap (PixMapHandle pixmap, Rect *rect) { if (!rect) rect = &x->bounds; - dump_bitmap_data ((BitMap *) x, CW (x->pixelSize), rect); + dump_bitmap_data ((BitMap *) x, BigEndianValue (x->pixelSize), rect); } - iprintf ((o_fp, "rowBytes 0x%hx;\n", (unsigned short) CW (x->rowBytes))); + iprintf ((o_fp, "rowBytes 0x%hx;\n", (unsigned short) BigEndianValue (x->rowBytes))); dump_field (dump_rect, &x->bounds, "bounds"); - iprintf ((o_fp, "pmVersion 0x%x;\n", CW (x->pmVersion))); - iprintf ((o_fp, "packType 0x%x;\n", CW (x->packType))); - iprintf ((o_fp, "packSize 0x%x;\n", CW (x->packSize))); + iprintf ((o_fp, "pmVersion 0x%x;\n", BigEndianValue (x->pmVersion))); + iprintf ((o_fp, "packType 0x%x;\n", BigEndianValue (x->packType))); + iprintf ((o_fp, "packSize 0x%x;\n", BigEndianValue (x->packSize))); iprintf ((o_fp, "hRes 0x%x, vRes 0x%x;\n", - CW (x->hRes), CW (x->vRes))); - iprintf ((o_fp, "pixelType 0x%x;\n", CW (x->pixelType))); - iprintf ((o_fp, "pixelSize %d;\n", CW (x->pixelSize))); - iprintf ((o_fp, "cmpCount %d;\n", CW (x->cmpCount))); - iprintf ((o_fp, "cmpSize %d;\n", CW (x->cmpSize))); - iprintf ((o_fp, "planeBytes 0x%x;\n", CL (x->planeBytes))); + BigEndianValue (x->hRes), BigEndianValue (x->vRes))); + iprintf ((o_fp, "pixelType 0x%x;\n", BigEndianValue (x->pixelType))); + iprintf ((o_fp, "pixelSize %d;\n", BigEndianValue (x->pixelSize))); + iprintf ((o_fp, "cmpCount %d;\n", BigEndianValue (x->cmpCount))); + iprintf ((o_fp, "cmpSize %d;\n", BigEndianValue (x->cmpSize))); + iprintf ((o_fp, "planeBytes 0x%x;\n", BigEndianValue (x->planeBytes))); if (dump_verbosity && x->pmTable) dump_field (dump_ctab, MR (x->pmTable), "pmTable"); @@ -645,16 +646,16 @@ void Executor::dump_cgrafport_real (CGrafPtr x) { iprintf ((o_fp, "%s(CGrafPort *%p) {\n", field_name.c_str(), x)); indent += 2; - iprintf ((o_fp, "device 0x%x;\n", CW (x->device))); + iprintf ((o_fp, "device 0x%x;\n", BigEndianValue (x->device))); if (dump_verbosity && x->portPixMap) dump_field (dump_pixmap_null_rect, MR (x->portPixMap), "portPixMap"); else dump_field (dump_handle, MR (x->portPixMap), "portPixMap"); - iprintf ((o_fp, "portVersion 0x%x;\n", CW (x->portVersion))); + iprintf ((o_fp, "portVersion 0x%x;\n", BigEndianValue (x->portVersion))); dump_field (dump_handle, MR (x->grafVars), "grafVars"); - iprintf ((o_fp, "chExtra %d;\n", CW (x->chExtra))); - iprintf ((o_fp, "pnLocHFrac 0x%x;\n", CW (x->pnLocHFrac))); + iprintf ((o_fp, "chExtra %d;\n", BigEndianValue (x->chExtra))); + iprintf ((o_fp, "pnLocHFrac 0x%x;\n", BigEndianValue (x->pnLocHFrac))); dump_field (dump_rect, &x->portRect, "portRect"); dump_field (dump_handle, MR (x->visRgn), "visRgn"); dump_field (dump_handle, MR (x->clipRgn), "clipRgn"); @@ -667,7 +668,7 @@ Executor::dump_cgrafport_real (CGrafPtr x) dump_field (dump_rgb_color, &x->rgbBkColor, "rgbBkColor"); dump_field (dump_point, x->pnLoc, "pnLoc"); dump_field (dump_point, x->pnSize, "pnSize"); - iprintf ((o_fp, "pnMode %d;\n", CW (x->pnMode))); + iprintf ((o_fp, "pnMode %d;\n", BigEndianValue (x->pnMode))); if (dump_verbosity && x->pnPixPat) dump_field (dump_pixpat, MR (x->pnPixPat), "pnPixPat"); @@ -678,16 +679,16 @@ Executor::dump_cgrafport_real (CGrafPtr x) dump_field (dump_pixpat, MR (x->fillPixPat), "fillPixPat"); else dump_field (dump_handle, MR (x->fillPixPat), "fillPixPat"); - iprintf ((o_fp, "pnVis %d;\n", CW (x->pnVis))); - iprintf ((o_fp, "txFont %d;\n", CW (x->txFont))); + iprintf ((o_fp, "pnVis %d;\n", BigEndianValue (x->pnVis))); + iprintf ((o_fp, "txFont %d;\n", BigEndianValue (x->txFont))); iprintf ((o_fp, "txFace %d;\n", x->txFace)); - iprintf ((o_fp, "txMode %d;\n", CW (x->txMode))); - iprintf ((o_fp, "txSize %d;\n", CW (x->txSize))); - iprintf ((o_fp, "spExtra %d;\n", CL (x->spExtra))); - iprintf ((o_fp, "fgColor 0x%x;\n", CL (x->fgColor))); - iprintf ((o_fp, "bkColor 0x%x;\n", CL (x->bkColor))); - iprintf ((o_fp, "colrBit %d;\n", CW (x->colrBit))); - iprintf ((o_fp, "patStretch %x;\n", CW (x->patStretch))); + iprintf ((o_fp, "txMode %d;\n", BigEndianValue (x->txMode))); + iprintf ((o_fp, "txSize %d;\n", BigEndianValue (x->txSize))); + iprintf ((o_fp, "spExtra %d;\n", BigEndianValue (x->spExtra))); + iprintf ((o_fp, "fgColor 0x%x;\n", BigEndianValue (x->fgColor))); + iprintf ((o_fp, "bkColor 0x%x;\n", BigEndianValue (x->bkColor))); + iprintf ((o_fp, "colrBit %d;\n", BigEndianValue (x->colrBit))); + iprintf ((o_fp, "patStretch %x;\n", BigEndianValue (x->patStretch))); dump_field (dump_handle, MR (x->picSave), "picSave"); dump_field (dump_handle, MR (x->rgnSave), "rgnSave"); dump_field (dump_handle, MR (x->polySave), "polySave"); @@ -703,16 +704,16 @@ Executor::dump_gdevice (GDHandle gdev) SProcHndl proc; iprintf ((o_fp, "%s(GDevice **%p) {\n", field_name.c_str(), gdev)); indent += 2; - iprintf ((o_fp, "gdID 0x%x;\n", CW (x->gdID))); - iprintf ((o_fp, "gdType 0x%x;\n", CW (x->gdType))); + iprintf ((o_fp, "gdID 0x%x;\n", BigEndianValue (x->gdID))); + iprintf ((o_fp, "gdType 0x%x;\n", BigEndianValue (x->gdType))); if (dump_verbosity && x->gdITable) dump_field (dump_itab, MR (x->gdITable), "gdITable"); else dump_field (dump_handle, MR (x->gdITable), "gdITable"); - iprintf ((o_fp, "gdResPref 0x%x;\n", CW (x->gdResPref))); + iprintf ((o_fp, "gdResPref 0x%x;\n", BigEndianValue (x->gdResPref))); #if 0 - dump_field (dump_handle, CL (x->gdSearchProc), "gdSearchProc"); + dump_field (dump_handle, BigEndianValue (x->gdSearchProc), "gdSearchProc"); #else iprintf ((o_fp, "gdSearchProc %p;\n", MR (x->gdSearchProc))); for (proc = MR (x->gdSearchProc); proc; proc = HxP (proc, nxtSrch)) @@ -720,20 +721,20 @@ Executor::dump_gdevice (GDHandle gdev) proc, HxP (proc, nxtSrch), HxP (proc, srchProc))); #endif dump_field (dump_handle, MR (x->gdCompProc), "gdCompProc"); - iprintf ((o_fp, "gdFlags 0x%hx;\n", (unsigned short) CW (x->gdFlags))); + iprintf ((o_fp, "gdFlags 0x%hx;\n", (unsigned short) BigEndianValue (x->gdFlags))); if (dump_verbosity && x->gdPMap) dump_field (dump_pixmap_null_rect, MR (x->gdPMap), "gdPMap"); else dump_field (dump_handle, MR (x->gdPMap), "gdPMap"); - iprintf ((o_fp, "gdRefCon 0x%x;\n", CL (x->gdRefCon))); + iprintf ((o_fp, "gdRefCon 0x%x;\n", BigEndianValue (x->gdRefCon))); if (dump_verbosity && x->gdNextGD) dump_field (dump_gdevice, (GDHandle) MR (x->gdNextGD), "gdNextGD"); else dump_field (dump_handle, MR (x->gdNextGD), "gdNextGD"); dump_field (dump_rect, &x->gdRect, "gdRect"); - iprintf ((o_fp, "gdMode 0x%x;\n", CW (x->gdMode))); + iprintf ((o_fp, "gdMode 0x%x;\n", BigEndianValue (x->gdMode))); iprintf ((o_fp, "[CC, Reserved fields omitted]; }\n")); indent -= 2; fflush (o_fp); } @@ -771,34 +772,34 @@ Executor::dump_palette (PaletteHandle palette) iprintf ((o_fp, "%s(PaletteHandle **%p) {\n", field_name.c_str(), palette)); indent += 2; - iprintf ((o_fp, "pmEntries 0x%x;\n", CW (x->pmEntries))); + iprintf ((o_fp, "pmEntries 0x%x;\n", BigEndianValue (x->pmEntries))); if (pmWindow (x) && dump_verbosity >= 2 && 0) dump_grafport ((GrafPtr) MR (pmWindow (x))); else dump_field (dump_handle, MR (pmWindow (x)), "pmWindow"); - iprintf ((o_fp, "pmPrivate 0x%x\n", CW (pmPrivate (x)))); - iprintf ((o_fp, "pmDevices 0x%lx\n", (long) CL (pmDevices (x)))); + iprintf ((o_fp, "pmPrivate 0x%x\n", BigEndianValue (pmPrivate (x)))); + iprintf ((o_fp, "pmDevices 0x%lx\n", (long) BigEndianValue (pmDevices (x)))); iprintf ((o_fp, "pmSeeds 0x%lx\n", (long) MR (pmSeeds (x)))); if (dump_verbosity >= 2) { int i; iprintf ((o_fp, "pmInfo\n")); - for (i = 0; i < CW (x->pmEntries); i ++) + for (i = 0; i < BigEndianValue (x->pmEntries); i ++) { iprintf ((o_fp, "%3x { rgb { 0x%lx, 0x%lx, 0x%lx }\n", i, - (long) CW (x->pmInfo[i].ciRGB.red), - (long) CW (x->pmInfo[i].ciRGB.green), - (long) CW (x->pmInfo[i].ciRGB.blue))); + (long) BigEndianValue (x->pmInfo[i].ciRGB.red), + (long) BigEndianValue (x->pmInfo[i].ciRGB.green), + (long) BigEndianValue (x->pmInfo[i].ciRGB.blue))); iprintf ((o_fp, " usage 0x%x; tolerance 0x%x;\n", - CW (x->pmInfo[i].ciUsage), - CW (x->pmInfo[i].ciTolerance))); + BigEndianValue (x->pmInfo[i].ciUsage), + BigEndianValue (x->pmInfo[i].ciTolerance))); iprintf ((o_fp, " flags 0x%x; private 0x%lx; };\n", - CW (ciFlags (&x->pmInfo[i])), - (unsigned long) CL (ciPrivate (&x->pmInfo[i])))); + BigEndianValue (ciFlags (&x->pmInfo[i])), + (unsigned long) BigEndianValue (ciPrivate (&x->pmInfo[i])))); } indent -= 2; iprintf ((o_fp, "}\n")); } @@ -816,7 +817,7 @@ Executor::dump_ccrsr (CCrsrHandle ccrsr) iprintf ((o_fp, "%s(CCrsrHandle **%p) {\n", field_name.c_str(), ccrsr)); indent += 2; - iprintf ((o_fp, "crsrType 0x%hx;\n", CW (x->crsrType))); + iprintf ((o_fp, "crsrType 0x%hx;\n", BigEndianValue (x->crsrType))); if (x->crsrMap && dump_verbosity >= 1) dump_field (dump_pixmap_null_rect, MR (x->crsrMap), "crsrMap"); @@ -831,9 +832,9 @@ Executor::dump_ccrsr (CCrsrHandle ccrsr) int depth; /* dump the expanded pixel data */ - depth = CW (x->crsrXValid); + depth = BigEndianValue (x->crsrXValid); bm.baseAddr = RM (deref (MR (x->crsrXData))); - bm.rowBytes = CW (2 * depth); + bm.rowBytes = BigEndianValue (2 * depth); bm.bounds.top = bm.bounds.left = CWC (0); bm.bounds.bottom = CWC (16); bm.bounds.right = CWC (16); @@ -845,13 +846,13 @@ Executor::dump_ccrsr (CCrsrHandle ccrsr) } else dump_field (dump_handle, MR (x->crsrXData), "crsrXData"); - iprintf ((o_fp, "crsrXValid %d;\n", CW (x->crsrXValid))); + iprintf ((o_fp, "crsrXValid %d;\n", BigEndianValue (x->crsrXValid))); dump_field (dump_handle, MR (x->crsrXHandle), "crsrXHandle"); dump_field (dump_bits16, x->crsr1Data, "crsr1Data"); dump_field (dump_bits16, x->crsrMask, "crsrMask"); dump_field (dump_point, x->crsrHotSpot, "crsrHotSpot"); - iprintf ((o_fp, "crsrXTable %x\n", CW (x->crsrXTable))); - iprintf ((o_fp, "crsrID 0x%x; }\n", CW (x->crsrID))); indent -= 2; + iprintf ((o_fp, "crsrXTable %x\n", BigEndianValue (x->crsrXTable))); + iprintf ((o_fp, "crsrID 0x%x; }\n", BigEndianValue (x->crsrID))); indent -= 2; fflush (o_fp); } @@ -942,7 +943,7 @@ dump_dialog_items (DialogPeek dp) int i; item_data = (int16 *) STARH (DIALOG_ITEMS (dp)); - n_items = CW (*item_data); + n_items = BigEndianValue (*item_data); items = (itmp) &item_data[1]; fprintf (o_fp, "%d items:\n", n_items); for (i = 0; i < n_items; i ++) @@ -951,10 +952,10 @@ dump_dialog_items (DialogPeek dp) item = items; fprintf (o_fp, "item %d; type %d, hand %p, (%d, %d, %d, %d)\n", - i, CW ((int16) item->itmtype), + i, BigEndianValue ((int16) item->itmtype), MR (item->itmhand), - CW (item->itmr.top), CW (item->itmr.left), - CW (item->itmr.bottom), CW (item->itmr.right)); + BigEndianValue (item->itmr.top), BigEndianValue (item->itmr.left), + BigEndianValue (item->itmr.bottom), BigEndianValue (item->itmr.right)); BUMPIP (items); } } @@ -981,9 +982,9 @@ Executor::dump_aux_win (AuxWinHandle awh) iprintf ((o_fp, "awOwner %p;\n", MR (aw->awOwner))); dump_field (dump_ctab, MR (aw->awCTable), "awCTable"); dump_field (dump_handle, MR (aw->dialogCItem), "dialogCItem"); - iprintf ((o_fp, "awFlags 0x%lx;\n", (long) CL (aw->awFlags))); + iprintf ((o_fp, "awFlags 0x%lx;\n", (long) BigEndianValue (aw->awFlags))); iprintf ((o_fp, "awReserved 0x%lx;\n", (long) MR (aw->awReserved))); - iprintf ((o_fp, "awRefCon 0x%lx; }\n", (long) CL (aw->awRefCon))); + iprintf ((o_fp, "awRefCon 0x%lx; }\n", (long) BigEndianValue (aw->awRefCon))); indent -= 2; fflush (o_fp); @@ -1018,7 +1019,7 @@ Executor::dump_rgn (RgnHandle rgn) iprintf ((o_fp, "%s(RgnHandle **%p) {\n", field_name.c_str(), rgn)); indent += 2; x = deref (rgn); - iprintf ((o_fp, "rgnSize %d\n", CW (x->rgnSize))); + iprintf ((o_fp, "rgnSize %d\n", BigEndianValue (x->rgnSize))); dump_field (dump_rect, &x->rgnBBox, "rgnBBox"); iprintf ((o_fp, "[special data omitted]; }\n")); indent -= 2; fflush (o_fp); @@ -1181,7 +1182,7 @@ dump_te (TEHandle te) line_starts = TE_LINE_STARTS (te); for (i = 0; i <= n_lines; i ++) - iprintf ((o_fp, "lineStart[%d]: %d\n", i, CW (line_starts[i]))); + iprintf ((o_fp, "lineStart[%d]: %d\n", i, BigEndianValue (line_starts[i]))); } { @@ -1257,7 +1258,7 @@ CountResourcesRN (LONGINT type, INTEGER rn) INTEGER retval; MAP_SAVE_EXCURSION - (CW (rn), + (BigEndianValue (rn), { retval = Count1Resources (type); }); @@ -1271,7 +1272,7 @@ GetIndResourceRN (LONGINT type, INTEGER i, INTEGER rn) Handle retval; MAP_SAVE_EXCURSION - (CW (rn), + (BigEndianValue (rn), { retval = Get1IndResource (type, i); }); @@ -1283,7 +1284,7 @@ static void AddResourceRN (Handle h, LONGINT type, INTEGER id, Str255 name, INTEGER rn) { MAP_SAVE_EXCURSION - (CW (rn), + (BigEndianValue (rn), { AddResource (h, type, id, name); }); @@ -1304,11 +1305,11 @@ copy_resources (INTEGER new_rn, INTEGER old_rn, LONGINT type) Handle h; INTEGER id; Str255 name; - LONGINT ignored; + ULONGINT ignored; h = GetIndResourceRN (type, i, old_rn); GetResInfo (h, &id, &ignored, name); - id = CW (id); + id = BigEndianValue (id); DetachResource (h); AddResourceRN (h, type, id, name, new_rn); } diff --git a/src/emustubs.cpp b/src/emustubs.cpp index cf7200e1..a17bb8bc 100644 --- a/src/emustubs.cpp +++ b/src/emustubs.cpp @@ -67,6 +67,7 @@ char ROMlib_rcsid_emustubs[] = #include "rsys/mixed_mode.h" namespace Executor { + using namespace ByteSwap; #define PUBLIC #undef PRIVATE @@ -1790,20 +1791,20 @@ STUB (CommToolboxDispatch) arg_block = (comm_toolbox_dispatch_args_t *) SYN68K_TO_US(EM_A0); - selector = CW (arg_block->selector); + selector = BigEndianValue (arg_block->selector); switch (selector) { case 0x0402: AppendDITL (MR (arg_block->args.append_args.dp), MR (arg_block->args.append_args.new_items_h), - CW (arg_block->args.append_args.method)); + BigEndianValue (arg_block->args.append_args.method)); break; case 0x0403: EM_D0 = CountDITL (MR (arg_block->args.count_args.dp)); break; case 0x0404: ShortenDITL (MR (arg_block->args.shorten_args.dp), - CW (arg_block->args.shorten_args.n_items)); + BigEndianValue (arg_block->args.shorten_args.n_items)); break; case 1286: EM_D0 = CRMGetCRMVersion (); @@ -2436,7 +2437,7 @@ STUB(Gestalt) default: l = 0; EM_D0 = Gestalt(EM_D0, &l); - EM_A0 = CL (l); + EM_A0 = BigEndianValue (l); break; case 0xA3AD: if (EM_D0 == DONGLE_GESTALT) @@ -2508,70 +2509,70 @@ STUB (HGetState) STUB(HSetState) { HSetState ((Handle) SYN68K_TO_US_CHECK0(EM_A0), EM_D0); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (HLock) { HLock ((Handle) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (HUnlock) { HUnlock ((Handle) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (HPurge) { HPurge ((Handle) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (HNoPurge) { HNoPurge ((Handle) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (HSetRBit) { HSetRBit ((Handle) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (HClrRBit) { HClrRBit ((Handle) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (InitApplZone) { InitApplZone (); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (SetApplBase) { SetApplBase ((Ptr) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (MoreMasters) { MoreMasters (); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } @@ -2580,67 +2581,67 @@ STUB (InitZone) initzonehiddenargs_t *ip; ip = (initzonehiddenargs_t *) SYN68K_TO_US(EM_A0); - InitZone ((ProcPtr)MR (ip->pGrowZone), CW (ip->cMoreMasters), + InitZone ((ProcPtr)MR (ip->pGrowZone), BigEndianValue (ip->cMoreMasters), (Ptr)MR (ip->limitPtr), (THz)MR (ip->startPtr)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (SetZone) { SetZone ((THz) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (DisposHandle) { DisposHandle ((Handle) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (GetHandleSize) { EM_D0 = GetHandleSize ((Handle) SYN68K_TO_US_CHECK0(EM_A0)); - if (CW (MemErr) < 0) - EM_D0 = CW (MemErr); + if (BigEndianValue (MemErr) < 0) + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (SetHandleSize) { SetHandleSize ((Handle) SYN68K_TO_US_CHECK0(EM_A0), EM_D0); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (ReallocHandle) { ReallocHandle ((Handle) SYN68K_TO_US_CHECK0(EM_A0), EM_D0); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (DisposPtr) { DisposPtr ((Ptr) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (GetPtrSize) { EM_D0 = GetPtrSize ((Ptr) SYN68K_TO_US_CHECK0(EM_A0)); - if (CW (MemErr) < 0) - EM_D0 = CW (MemErr); + if (BigEndianValue (MemErr) < 0) + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (SetPtrSize) { SetPtrSize ((Ptr) SYN68K_TO_US_CHECK0(EM_A0), EM_D0); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } @@ -2659,14 +2660,14 @@ STUB (CompactMem) STUB (ResrvMem) { _ResrvMem_flags (EM_D0, SYS_P (EM_D1, 0xA040)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS(); } STUB (PurgeMem) { _PurgeMem_flags (EM_D0, SYS_P (EM_D1, 0xA04D)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } @@ -2675,21 +2676,21 @@ STUB (BlockMove) BlockMove_the_trap ((Ptr) SYN68K_TO_US_CHECK0(EM_A0), (Ptr) SYN68K_TO_US_CHECK0(EM_A1), EM_D0, !(EM_D1 & 0x200)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (MaxApplZone) { MaxApplZone (); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (MoveHHi) { MoveHHi ((Handle) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } @@ -2708,21 +2709,21 @@ STUB (StackSpace) STUB (SetApplLimit) { SetApplLimit ((Ptr) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (SetGrowZone) { SetGrowZone ((ProcPtr) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS(); } STUB (GetZone) { EM_A0 = (uint32) US_TO_SYN68K_CHECK0(GetZone ()); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } @@ -2730,7 +2731,7 @@ STUB (NewEmptyHandle) { EM_A0 = (uint32) US_TO_SYN68K_CHECK0(_NewEmptyHandle_flags (SYS_P (EM_D1, 0xA166))); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } @@ -2740,7 +2741,7 @@ STUB (NewHandle) EM_A0 = (uint32) US_TO_SYN68K_CHECK0(_NewHandle_flags (EM_D0, SYS_P (EM_D1, 0xA122), CLEAR_P (EM_D1, 0xA122))); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } @@ -2748,7 +2749,7 @@ STUB (HandleZone) { EM_A0 = (uint32) US_TO_SYN68K_CHECK0(HandleZone ((Handle) SYN68K_TO_US_CHECK0(EM_A0))); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } @@ -2757,7 +2758,7 @@ STUB (RecoverHandle) EM_A0 = (uint32) US_TO_SYN68K_CHECK0( _RecoverHandle_flags ((Ptr) SYN68K_TO_US_CHECK0(EM_A0), SYS_P (EM_D1, 0xA128))); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } @@ -2765,14 +2766,14 @@ STUB (NewPtr) { EM_A0 = (uint32) US_TO_SYN68K_CHECK0(_NewPtr_flags (EM_D0, SYS_P (EM_D1, 0xA11E), CLEAR_P (EM_D1, 0xA11E))); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } STUB (PtrZone) { EM_A0 = (uint32) US_TO_SYN68K_CHECK0(PtrZone ((Ptr) SYN68K_TO_US_CHECK0(EM_A0))); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } @@ -2795,7 +2796,7 @@ STUB (PurgeSpace) STUB (EmptyHandle) { EmptyHandle ((Handle) SYN68K_TO_US_CHECK0(EM_A0)); - EM_D0 = CW (MemErr); + EM_D0 = BigEndianValue (MemErr); RTS (); } @@ -3038,7 +3039,7 @@ STUB (modeswitch) retaddr = POPADDR (); rp = (RoutineDescriptor *)((char *)ignoreme); /* UGH! */ - n_routines = CW (rp->routineCount) + 1; + n_routines = BigEndianValue (rp->routineCount) + 1; for (i = 0; i < n_routines && rp->routineRecords[i].ISA != CBC (kPowerPCISA); ++i) @@ -3049,7 +3050,7 @@ STUB (modeswitch) return retaddr; } - procinfo = CL (rp->routineRecords[i].procInfo); + procinfo = BigEndianValue (rp->routineRecords[i].procInfo); convention = procinfo & 0xf; if (convention == kRegisterBased) diff --git a/src/emutrap.cpp b/src/emutrap.cpp index e4762ca7..0fd46aa4 100644 --- a/src/emutrap.cpp +++ b/src/emutrap.cpp @@ -362,7 +362,7 @@ CToRoutineDescriptorCall (const RoutineDescriptor *p, unsigned long long magic, case 2: { arg = (uint16) va_arg (ap, unsigned long); - arg = CW (arg); + arg = BigEndianValue (arg); procinfo |= STACK_ROUTINE_PARAMETER (n_args, kTwoByteCode); } break; @@ -372,15 +372,15 @@ CToRoutineDescriptorCall (const RoutineDescriptor *p, unsigned long long magic, #if defined (powerpc) arg = *(uint32 *)arg; #endif - arg = (CW ((uint16) arg) | - (CW (arg >> 16) << 16)); + arg = (BigEndianValue ((uint16) arg) | + (BigEndianValue (arg >> 16) << 16)); procinfo |= STACK_ROUTINE_PARAMETER (n_args, kFourByteCode); } break; case 4: { arg = (uint32) va_arg (ap, unsigned long); - arg = CL (arg); + arg = BigEndianValue (arg); procinfo |= STACK_ROUTINE_PARAMETER (n_args, kFourByteCode); } break; @@ -466,10 +466,10 @@ CToRoutineDescriptorCall (const RoutineDescriptor *p, unsigned long long magic, retval = CB (retval); break; case 2: - retval = CW (retval); + retval = BigEndianValue (retval); break; case 4: - retval = CL (retval); + retval = BigEndianValue (retval); break; case 5: retval = (long) SYN68K_TO_US_CHECK0_CHECKNEG1 (retval); diff --git a/src/executor.cpp b/src/executor.cpp index 289f3f8a..3b53c18b 100644 --- a/src/executor.cpp +++ b/src/executor.cpp @@ -59,6 +59,7 @@ char ROMlib_rcsid_executor[] = #define PUBLIC using namespace Executor; +using namespace ByteSwap; #define FASTALINETRAPS @@ -591,7 +592,7 @@ PUBLIC void Executor::executor_main( void ) SoundBase = RM(NewPtr(370 * sizeof(INTEGER))); #if 0 - memset(CL(SoundBase), 0, (LONGINT) 370 * sizeof(INTEGER)); + memset(BigEndianValue(SoundBase), 0, (LONGINT) 370 * sizeof(INTEGER)); #else /* !0 */ for (i = 0; i < 370; ++i) ((INTEGER *) MR(SoundBase))[i] = CWC (0x8000); /* reference 0 sound */ @@ -602,7 +603,7 @@ PUBLIC void Executor::executor_main( void ) ROM85 = CWC(0x3FFF); a5 = US_TO_SYN68K((LONGINT) &tmpA5); - CurrentA5 = (Ptr) CL(a5); + CurrentA5 = (Ptr) BigEndianValue(a5); InitGraf((Ptr) quickbytes + sizeof(quickbytes) - 4); InitFonts(); InitCRM (); @@ -624,7 +625,7 @@ PUBLIC void Executor::executor_main( void ) memcpy(FinderName+1, BROWSER_NAME, FinderName[0]); CountAppFiles(&mess, &count); - count = CW (count); + count = BigEndianValue (count); if (count > 0) GetAppFiles(1, &thefile); else @@ -661,8 +662,8 @@ PUBLIC void Executor::executor_main( void ) if (count > 0) { p = ROMlib_find_best_creator_type_match - (CL (hpb.hFileInfo.ioFlFndrInfo.fdCreator), - CL (hpb.hFileInfo.ioFlFndrInfo.fdType)); + (BigEndianValue (hpb.hFileInfo.ioFlFndrInfo.fdCreator), + BigEndianValue (hpb.hFileInfo.ioFlFndrInfo.fdType)); } else { @@ -708,11 +709,11 @@ PUBLIC void Executor::executor_main( void ) wdpb.ioVRefNum = hpb.hFileInfo.ioVRefNum; wdpb.ioWDDirID = hpb.hFileInfo.ioFlParID; - SFSaveDisk_Update (CW (hpb.hFileInfo.ioVRefNum), fName); + SFSaveDisk_Update (BigEndianValue (hpb.hFileInfo.ioVRefNum), fName); CurDirStore = hpb.hFileInfo.ioFlParID; wdpb.ioWDProcID = CLC (T('X','c','t','r')); wdpb.ioNamePtr = 0; PBOpenWD(&wdpb, FALSE); - exevrefnum = CW(wdpb.ioVRefNum); + exevrefnum = BigEndianValue(wdpb.ioVRefNum); Launch (CurApName, exevrefnum); } diff --git a/src/fileAccess.cpp b/src/fileAccess.cpp index 32c276fb..f51f5690 100644 --- a/src/fileAccess.cpp +++ b/src/fileAccess.cpp @@ -37,6 +37,7 @@ char ROMlib_rcsid_fileAccess[] = #endif using namespace Executor; +using namespace ByteSwap; namespace Executor { PRIVATE OSErr PBLockUnlockRange(ParmBlkPtr, BOOLEAN, lockunlock_t); @@ -142,12 +143,12 @@ A3(PUBLIC, OSErr, FSOpen, StringPtr, filen, INTEGER, vrn, /* IMIV-109 */ OSErr temp; pbr.ioParam.ioNamePtr = RM(filen); - pbr.ioParam.ioVRefNum = CW(vrn); + pbr.ioParam.ioVRefNum = BigEndianValue(vrn); pbr.ioParam.ioVersNum = 0; pbr.ioParam.ioPermssn = fsCurPerm; pbr.ioParam.ioMisc = 0; temp = PBOpen(&pbr, 0); - *rn = CW(pbr.ioParam.ioRefNum); + *rn = BigEndianValue(pbr.ioParam.ioRefNum); fs_err_hook (temp); return(temp); } @@ -159,12 +160,12 @@ A3(PUBLIC, OSErr, OpenRF, StringPtr, filen, INTEGER, vrn, /* IMIV-109 */ OSErr temp; pbr.ioParam.ioNamePtr = RM(filen); - pbr.ioParam.ioVRefNum = CW(vrn); + pbr.ioParam.ioVRefNum = BigEndianValue(vrn); pbr.ioParam.ioVersNum = 0; pbr.ioParam.ioPermssn = fsCurPerm; pbr.ioParam.ioMisc = 0; temp = PBOpenRF(&pbr, 0); - *rn = CW(pbr.ioParam.ioRefNum); + *rn = BigEndianValue(pbr.ioParam.ioRefNum); fs_err_hook (temp); return(temp); } @@ -175,12 +176,12 @@ A3(PUBLIC, OSErr, FSRead, INTEGER, rn, LONGINT *, count, /* IMIV-109 */ ParamBlockRec pbr; OSErr temp; - pbr.ioParam.ioRefNum = CW(rn); + pbr.ioParam.ioRefNum = BigEndianValue(rn); pbr.ioParam.ioBuffer = RM(buffp); - pbr.ioParam.ioReqCount = CL(*count); + pbr.ioParam.ioReqCount = BigEndianValue(*count); pbr.ioParam.ioPosMode = CWC(fsAtMark); temp = PBRead(&pbr, 0); - *count = CL(pbr.ioParam.ioActCount); + *count = BigEndianValue(pbr.ioParam.ioActCount); fs_err_hook (temp); return(temp); } @@ -204,12 +205,12 @@ A3(PUBLIC, OSErr, FSWrite, INTEGER, rn, LONGINT *, count, /* IMIV-110 */ ParamBlockRec pbr; OSErr temp; - pbr.ioParam.ioRefNum = CW(rn); + pbr.ioParam.ioRefNum = BigEndianValue(rn); pbr.ioParam.ioBuffer = RM(buffp); - pbr.ioParam.ioReqCount = CL(*count); + pbr.ioParam.ioReqCount = BigEndianValue(*count); pbr.ioParam.ioPosMode = CWC(fsAtMark); temp = PBWrite(&pbr, 0); - *count = CL(pbr.ioParam.ioActCount); + *count = BigEndianValue(pbr.ioParam.ioActCount); fs_err_hook (temp); return(temp); } @@ -232,9 +233,9 @@ A2(PUBLIC, OSErr, GetFPos, INTEGER, rn, LONGINT *, filep) /* IMIV-110 */ ParamBlockRec pbr; OSErr temp; - pbr.ioParam.ioRefNum = CW(rn); + pbr.ioParam.ioRefNum = BigEndianValue(rn); temp = PBGetFPos(&pbr, 0); - *filep = CL(pbr.ioParam.ioPosOffset); + *filep = BigEndianValue(pbr.ioParam.ioPosOffset); fs_err_hook (temp); return(temp); } @@ -245,8 +246,8 @@ A3(PUBLIC, OSErr, SetFPos, INTEGER, rn, INTEGER, posmode, /* IMIV-110 */ ParamBlockRec pbr; OSErr err; - pbr.ioParam.ioRefNum = CW(rn); - pbr.ioParam.ioPosMode = CW(posmode); + pbr.ioParam.ioRefNum = BigEndianValue(rn); + pbr.ioParam.ioPosMode = BigEndianValue(posmode); pbr.ioParam.ioPosOffset = Cx(possoff); err = PBSetFPos(&pbr, 0); fs_err_hook (err); @@ -260,7 +261,7 @@ A2(PUBLIC, OSErr, GetEOF, INTEGER, rn, LONGINT *, eof) /* IMIV-111 */ pbr.ioParam.ioRefNum = Cx(rn); temp = PBGetEOF(&pbr, 0); - *eof = CL(pbr.ioParam.ioMisc); + *eof = BigEndianValue(pbr.ioParam.ioMisc); fs_err_hook (temp); return(temp); } @@ -285,7 +286,7 @@ A2(PUBLIC, OSErr, Allocate, INTEGER, rn, LONGINT *, count) /* IMIV-112 */ pbr.ioParam.ioRefNum = Cx(rn); pbr.ioParam.ioReqCount = *count; temp = PBAllocate(&pbr, 0); - *count = CL(pbr.ioParam.ioActCount); + *count = BigEndianValue(pbr.ioParam.ioActCount); fs_err_hook (temp); return(temp); } @@ -298,7 +299,7 @@ A2(PUBLIC, OSErr, AllocContig, INTEGER, rn, LONGINT *, count) pbr.ioParam.ioRefNum = Cx(rn); pbr.ioParam.ioReqCount = *count; temp = PBAllocContig(&pbr, 0); - *count = CL(pbr.ioParam.ioActCount); + *count = BigEndianValue(pbr.ioParam.ioActCount); fs_err_hook (temp); return(temp); } @@ -598,7 +599,7 @@ A5(PUBLIC, VCB *, ROMlib_breakoutioname, ParmBlkPtr, pb, /* INTERNAL */ else if (v < 0) { if (ISWDNUM(v)) { wdp = WDNUMTOWDP(v); - *diridp = CL(wdp->dirid); + *diridp = BigEndianValue(wdp->dirid); retval = MR(wdp->vcbp); } else retval = ROMlib_vcbbyvrn(v); @@ -606,7 +607,7 @@ A5(PUBLIC, VCB *, ROMlib_breakoutioname, ParmBlkPtr, pb, /* INTERNAL */ if (!retval && (usedefault || (!pb->ioParam.ioNamePtr && !pb->ioParam.ioVRefNum))) { retval = MR(DefVCBPtr); - *diridp = CL(DefDirID); + *diridp = BigEndianValue(DefDirID); } } return retval; @@ -1068,7 +1069,7 @@ static int n = 0; *pprn = 2 + 94 * n++; return noErr; #endif - length =CW( *(short *)MR(FCBSPtr)); + length =BigEndianValue( *(short *)MR(FCBSPtr)); fcbp = (fcbrec *) ((short *)MR(FCBSPtr)+1); efcbp = (fcbrec *) ((char *)MR(FCBSPtr) + length); for (;fcbp < efcbp && fcbp->fdfnum; @@ -1114,7 +1115,7 @@ A4(PRIVATE, OSErr, PBOpenForkD, ParmBlkPtr, pb, BOOLEAN, a, err = getprn(&prn); if (err == noErr) { fp = (fcbrec *) (MR(FCBSPtr) + prn); - fp->fdfnum = CL((LONGINT) ST_INO(sbuf)); + fp->fdfnum = BigEndianValue((LONGINT) ST_INO(sbuf)); fp->fcfd = -1; fp->fcflags = 0; fp->fcbTypByt = 0; @@ -1132,7 +1133,7 @@ A4(PRIVATE, OSErr, PBOpenForkD, ParmBlkPtr, pb, BOOLEAN, a, if (ST_INO(sbuf) == vcbp->u.ufs.ino) /* the stat for us */ fp->fcparid = CLC (2); else - fp->fcparid = CL((LONGINT) ST_INO(sbuf)); + fp->fcparid = BigEndianValue((LONGINT) ST_INO(sbuf)); filename[save_index] = save_char; if (fork == ResourceFork) { newname = ROMlib_resname(pathname, filename, endname); @@ -1190,7 +1191,7 @@ A4(PRIVATE, OSErr, PBOpenForkD, ParmBlkPtr, pb, BOOLEAN, a, if (err == noErr) err = ROMlib_geteofostype(fp); fp->fcvptr = RM((VCB *) vcbp); - pb->ioParam.ioRefNum = CW(prn); + pb->ioParam.ioRefNum = BigEndianValue(prn); namelen = strlen (filename); namelen -= ROMlib_UNIX7_to_Mac (filename, namelen); namelen = MIN(namelen, 31); @@ -1226,7 +1227,7 @@ A2(PUBLIC, OSErr, ufsPBHOpen, HParmBlkPtr, pb, /* INTERNAL */ { OSErr err; - err = PBOpenForkD((ParmBlkPtr) pb, a, DataFork, CL(pb->fileParam.ioDirID)); + err = PBOpenForkD((ParmBlkPtr) pb, a, DataFork, BigEndianValue(pb->fileParam.ioDirID)); fs_err_hook (err); return err; } @@ -1281,7 +1282,7 @@ A2(PUBLIC, OSErr, ufsPBHOpenRF, HParmBlkPtr, pb, /* INTERNAL */ OSErr err; err = PBOpenForkD((ParmBlkPtr) pb, a, ResourceFork, - CL(pb->fileParam.ioDirID)); + BigEndianValue(pb->fileParam.ioDirID)); fs_err_hook (err); return err; } @@ -1385,14 +1386,14 @@ A3(PRIVATE, OSErr, PBLockUnlockRange, ParmBlkPtr, pb, BOOLEAN, a, cleanup = ROMlib_fd_remove_range; } - err = verify (fd, toseek, CL (pb->ioParam.ioReqCount)); + err = verify (fd, toseek, BigEndianValue (pb->ioParam.ioReqCount)); if (err == noErr && lseek(fd, toseek, L_SET) == -1) err = ROMlib_maperrno(); if (err == noErr) err = ROMlib_lockunlockrange (fd, toseek, - CL (pb->ioParam.ioReqCount), op); + BigEndianValue (pb->ioParam.ioReqCount), op); if (err == noErr) - err = cleanup (fd, toseek, CL (pb->ioParam.ioReqCount)); + err = cleanup (fd, toseek, BigEndianValue (pb->ioParam.ioReqCount)); lseek(fd, curseek, L_SET); } } @@ -1434,7 +1435,7 @@ pbsetfpos (ParmBlkPtr pb, boolean_t can_go_past_eof) forkoffset = FORKOFFSET(fp); err = pbfpos(pb, &toseek, can_go_past_eof); fd = fp->fcfd; - pb->ioParam.ioPosOffset = CL(lseek(fd, toseek, L_SET) - forkoffset); + pb->ioParam.ioPosOffset = BigEndianValue(lseek(fd, toseek, L_SET) - forkoffset); } fs_err_hook (err); return err; @@ -1487,8 +1488,8 @@ A2(PUBLIC, OSErr, ufsPBRead, ParmBlkPtr, pb, BOOLEAN, a) /* INTERNAL */ if (pb->ioParam.ioRefNum == 0x5003) { printf ("read IN mode = %d, offset = %5d, req = %5d\n", - CW (pb->ioParam.ioPosMode), - CL (pb->ioParam.ioPosOffset), CL (pb->ioParam.ioReqCount)); + BigEndianValue (pb->ioParam.ioPosMode), + BigEndianValue (pb->ioParam.ioPosOffset), BigEndianValue (pb->ioParam.ioReqCount)); } #endif @@ -1517,8 +1518,8 @@ A2(PUBLIC, OSErr, ufsPBRead, ParmBlkPtr, pb, BOOLEAN, a) /* INTERNAL */ pb->ioParam.ioActCount = 0; err = ioErr; } else { - pb->ioParam.ioActCount = CL(nread); - pb->ioParam.ioPosOffset = CL(lseek(fd, 0L, L_INCR) - + pb->ioParam.ioActCount = BigEndianValue(nread); + pb->ioParam.ioPosOffset = BigEndianValue(lseek(fd, 0L, L_INCR) - forkoffset); if (rc != Cx(pb->ioParam.ioReqCount)) err = eofErr; @@ -1530,9 +1531,9 @@ A2(PUBLIC, OSErr, ufsPBRead, ParmBlkPtr, pb, BOOLEAN, a) /* INTERNAL */ if (pb->ioParam.ioRefNum == 0x5003) { printf ("read OUT mode = %d, offset = %5d, req = %5d, act = %d, err = %d\n", - CW (pb->ioParam.ioPosMode), - CL (pb->ioParam.ioPosOffset), CL (pb->ioParam.ioReqCount), - CL (pb->ioParam.ioActCount), + BigEndianValue (pb->ioParam.ioPosMode), + BigEndianValue (pb->ioParam.ioPosOffset), BigEndianValue (pb->ioParam.ioReqCount), + BigEndianValue (pb->ioParam.ioActCount), err); } #endif @@ -1566,7 +1567,7 @@ A2(PUBLIC, OSErr, ufsPBWrite, ParmBlkPtr, pb, BOOLEAN, a) /* INTERNAL */ #endif /* SUN */ #endif /* WEHAVEENOUGHSWAPSPACETORUNSUNSGOOFYLITTLERPCTHINGYS */ if (err == noErr && Cx(pb->ioParam.ioPosOffset) + rc > Cx(fp->fcleof)) { - fp->fcleof = CL(CL(pb->ioParam.ioPosOffset) + rc); + fp->fcleof = BigEndianValue(BigEndianValue(pb->ioParam.ioPosOffset) + rc); err = ROMlib_seteof(fp); } if (err == noErr) { @@ -1576,8 +1577,8 @@ A2(PUBLIC, OSErr, ufsPBWrite, ParmBlkPtr, pb, BOOLEAN, a) /* INTERNAL */ err = ioErr; } else { err = noErr; - pb->ioParam.ioActCount = CL(nwrite); - pb->ioParam.ioPosOffset = CL(lseek(fd, 0L, L_INCR) - + pb->ioParam.ioActCount = BigEndianValue(nwrite); + pb->ioParam.ioPosOffset = BigEndianValue(lseek(fd, 0L, L_INCR) - forkoffset); if (Cx(pb->ioParam.ioPosOffset) > Cx(fp->fcleof)) { fp->fcleof = pb->ioParam.ioPosOffset; @@ -1606,7 +1607,7 @@ A2(PUBLIC, OSErr, ufsPBGetFPos, ParmBlkPtr, pb, /* INTERNAL */ fp = PRNTOFPERR(Cx(pb->ioParam.ioRefNum), &err); if (err == noErr) { forkoffset = FORKOFFSET(fp); - pb->ioParam.ioPosOffset = CL(lseek(fp->fcfd, 0L, L_INCR) - + pb->ioParam.ioPosOffset = BigEndianValue(lseek(fp->fcfd, 0L, L_INCR) - forkoffset); pb->ioParam.ioReqCount = pb->ioParam.ioActCount = pb->ioParam.ioPosMode = 0; @@ -1624,8 +1625,8 @@ A2(PUBLIC, OSErr, ufsPBSetFPos, ParmBlkPtr, pb, /* INTERNAL */ if (pb->ioParam.ioRefNum == 0x5003) { printf ("seek IN mode = %d, offset = %5d\n", - CW (pb->ioParam.ioPosMode), - CL (pb->ioParam.ioPosOffset)); + BigEndianValue (pb->ioParam.ioPosMode), + BigEndianValue (pb->ioParam.ioPosOffset)); } #endif @@ -1636,8 +1637,8 @@ A2(PUBLIC, OSErr, ufsPBSetFPos, ParmBlkPtr, pb, /* INTERNAL */ if (pb->ioParam.ioRefNum == 0x5003) { printf ("seek OUT mode = %d, offset = %5d, err = %d\n", - CW (pb->ioParam.ioPosMode), - CL (pb->ioParam.ioPosOffset), err); + BigEndianValue (pb->ioParam.ioPosMode), + BigEndianValue (pb->ioParam.ioPosOffset), err); } #endif return err; @@ -1677,7 +1678,7 @@ A2(PUBLIC, OSErr, ufsPBAllocate, ParmBlkPtr, pb, /* INTERNAL */ fp = PRNTOFPERR(Cx(pb->ioParam.ioRefNum), &err); if (err == noErr) { - fp->fcleof = CL(CL(fp->fcleof) + CL(pb->ioParam.ioReqCount)); + fp->fcleof = BigEndianValue(BigEndianValue(fp->fcleof) + BigEndianValue(pb->ioParam.ioReqCount)); err = ROMlib_seteof(fp); pb->ioParam.ioActCount = pb->ioParam.ioReqCount; } diff --git a/src/fileCreate.cpp b/src/fileCreate.cpp index a3f8e097..1be77b0c 100644 --- a/src/fileCreate.cpp +++ b/src/fileCreate.cpp @@ -22,6 +22,7 @@ char ROMlib_rcsid_fileCreate[] = #include "rsys/suffix_maps.h" using namespace Executor; +using namespace ByteSwap; A4(PUBLIC, OSErr, Create, StringPtr, filen, INTEGER, vrn, /* IMIV-112 */ OSType, creator, OSType, filtyp) @@ -31,15 +32,15 @@ A4(PUBLIC, OSErr, Create, StringPtr, filen, INTEGER, vrn, /* IMIV-112 */ LONGINT t; pbr.fileParam.ioNamePtr = RM(filen); - pbr.fileParam.ioVRefNum = CW(vrn); + pbr.fileParam.ioVRefNum = BigEndianValue(vrn); pbr.fileParam.ioFVersNum = 0; temp = PBCreate(&pbr, 0); if (temp != noErr) return(temp); - OSASSIGN(pbr.fileParam.ioFlFndrInfo.fdType, CL(filtyp)); - OSASSIGN(pbr.fileParam.ioFlFndrInfo.fdCreator, CL(creator)); + OSASSIGN(pbr.fileParam.ioFlFndrInfo.fdType, BigEndianValue(filtyp)); + OSASSIGN(pbr.fileParam.ioFlFndrInfo.fdCreator, BigEndianValue(creator)); pbr.fileParam.ioFlFndrInfo.fdFlags = 0; ZEROPOINT(pbr.fileParam.ioFlFndrInfo.fdLocation); pbr.fileParam.ioFlFndrInfo.fdFldr = 0; @@ -63,7 +64,7 @@ A2(PUBLIC, OSErr, FSDelete, StringPtr, filen, INTEGER, vrn) /* IMIV-113 */ ParamBlockRec pbr; pbr.fileParam.ioNamePtr = RM(filen); - pbr.fileParam.ioVRefNum = CW(vrn); + pbr.fileParam.ioVRefNum = BigEndianValue(vrn); pbr.fileParam.ioFVersNum = 0; return(PBDelete(&pbr, 0)); } @@ -95,7 +96,7 @@ A4(PRIVATE, OSErr, PBCreateForD, ParmBlkPtr, pb, BOOLEAN, a, if (fd >= 0) { dirid = 0; ROMlib_dbm_store(vcbp, pathname, &dirid, TRUE); - ((HParmBlkPtr) pb)->fileParam.ioDirID = CL(dirid); + ((HParmBlkPtr) pb)->fileParam.ioDirID = BigEndianValue(dirid); } } @@ -138,7 +139,7 @@ A4(PRIVATE, OSErr, PBCreateForD, ParmBlkPtr, pb, BOOLEAN, a, sizeof(newparam.fileParam.ioFlCrDat)); memset(&newparam.fileParam.ioFlMdDat, 0, sizeof(newparam.fileParam.ioFlMdDat)); - swapped_dir = CL(dir); + swapped_dir = BigEndianValue(dir); if (!ROMlib_creator_and_type_from_filename (strlen (pathname), pathname, NULL, NULL)) ROMlib_PBGetSetFInfoD(&newparam, FALSE, Set, &swapped_dir, FALSE); diff --git a/src/fileDouble.cpp b/src/fileDouble.cpp index 00864149..e7406187 100644 --- a/src/fileDouble.cpp +++ b/src/fileDouble.cpp @@ -15,14 +15,16 @@ char ROMlib_rcsid_fileDouble[] = #include "winfs.h" #endif -int Executor::afpd_conventions_p; -int Executor::netatalk_conventions_p; - -char Executor::apple_double_quote_char; -const char *Executor::apple_double_fork_prefix; -int Executor::apple_double_fork_prefix_length; +namespace Executor { +int afpd_conventions_p; +int netatalk_conventions_p; +char apple_double_quote_char; +const char *apple_double_fork_prefix; +int apple_double_fork_prefix_length; +} using namespace Executor; +using namespace ByteSwap; /* * Coded more or less up to the spec: APDA M0908LL/A @@ -244,7 +246,7 @@ A5(PRIVATE, BOOLEAN, getsetentry, GetOrSetType, gors, LONGINT, fd, *lengthp = 0x7FFFFFFF; /* unlimited */ } else if (lengthp) - *lengthp = CL(sdp[1].offset) - CL(sdp[0].offset); + *lengthp = BigEndianValue(sdp[1].offset) - BigEndianValue(sdp[0].offset); break; case Set: *sdp = *savesdp; @@ -274,7 +276,7 @@ A1(PUBLIC, LONGINT, ROMlib_FORKOFFSET, fcbrec *, fp) /* INTERNAL */ /*-->*/ return 0L; idwanted = IDWANTED(fp); if (getsetentry(Get, fp->fcfd, IDWANTED(fp), &d, NULL)) - return CL(d.offset); + return BigEndianValue(d.offset); else return RESOURCEPREAMBLE; } @@ -311,7 +313,7 @@ A1(PUBLIC, OSErr, ROMlib_seteof, fcbrec *, fp) /* INTERNAL */ gui_assert(0); /* TODO: We need to move stuff around. There are many things we could do */ } else if (leof < peof) { - d.length = CL(leof); + d.length = BigEndianValue(leof); getsetentry(Set, fd, idwanted, &d, NULL); } } else @@ -339,8 +341,8 @@ A1(PUBLIC, OSErr, ROMlib_seteof, fcbrec *, fp) /* INTERNAL */ ROMlib_fcblocks[i].fcvptr == fp->fcvptr && (ROMlib_fcblocks[i].fcflags & fcfisres) == (fp->fcflags & fcfisres)) { - ROMlib_fcblocks[i].fcleof = CL(leof); - ROMlib_fcblocks[i].fcPLen = CL(peof); + ROMlib_fcblocks[i].fcleof = BigEndianValue(leof); + ROMlib_fcblocks[i].fcPLen = BigEndianValue(peof); } } } @@ -393,7 +395,7 @@ A1(PUBLIC, OSErr, ROMlib_geteofostype, fcbrec *, fp) /* INTERNAL */ else fp->fcPLen = fp->fcleof = d.length; } else - fp->fcleof = fp->fcPLen = CL((int)sbuf.st_size); + fp->fcleof = fp->fcPLen = BigEndianValue((int)sbuf.st_size); if (err == noErr) { if (!getsetentry(Get, fd, Finder_Info_ID, &d, NULL) || (!getsetpiece(Get, fd, &d, (char *) &finfo, sizeof(finfo)))) @@ -402,7 +404,7 @@ A1(PUBLIC, OSErr, ROMlib_geteofostype, fcbrec *, fp) /* INTERNAL */ if (ROMlib_creator_and_type_from_filename (fp->fcname[0], (char *) fp->fcname+1, NULL, &type)) - fp->fcbFType = CL (type); + fp->fcbFType = BigEndianValue (type); else fp->fcbFType = TICKX("TEXT"); } @@ -446,7 +448,7 @@ fprintf(stderr, "%s(%d): open '%s' fails\n", __FILE__, __LINE__, rpathname); memset(datep, 0, sizeof(*datep)); memset(finfop, 0, sizeof(*finfop)); memset(fxinfop, 0, sizeof(*fxinfop)); - *lenp = CL((int)sbuf.st_size); + *lenp = BigEndianValue((int)sbuf.st_size); *rlenp = 0; break; case Set: @@ -467,9 +469,9 @@ fprintf(stderr, "%s(%d): open '%s' fails\n", __FILE__, __LINE__, rpathname); getsetpiece(Get, rfd, &d, (char *) datep, sizeof(*datep)); else { - datep->crdat = CL (UNIXTIMETOMACTIME (MIN (sbuf.st_ctime, sbuf.st_mtime))); - datep->moddat = CL (UNIXTIMETOMACTIME (sbuf.st_mtime)); - datep->accessdat = CL (UNIXTIMETOMACTIME (sbuf.st_atime)); + datep->crdat = BigEndianValue (UNIXTIMETOMACTIME (MIN (sbuf.st_ctime, sbuf.st_mtime))); + datep->moddat = BigEndianValue (UNIXTIMETOMACTIME (sbuf.st_mtime)); + datep->accessdat = BigEndianValue (UNIXTIMETOMACTIME (sbuf.st_atime)); datep->backupdat = 0; } @@ -484,7 +486,7 @@ fprintf(stderr, "%s(%d): open '%s' fails\n", __FILE__, __LINE__, rpathname); if (fxinfop) *fxinfop = sfinfo.fxinfo; - *lenp = CL((int)sbuf.st_size); + *lenp = BigEndianValue((int)sbuf.st_size); } if (getsetentry(Get, rfd, Resource_Fork_ID, &d, NULL)) *rlenp = d.length; diff --git a/src/fileHighlevel.cpp b/src/fileHighlevel.cpp index fce4aee8..5dc45a1e 100644 --- a/src/fileHighlevel.cpp +++ b/src/fileHighlevel.cpp @@ -26,6 +26,7 @@ char ROMlib_rcsid_fileHighlevel[] = #include "rsys/executor.h" using namespace Executor; +using namespace ByteSwap; /* * extract the last component of a name: @@ -84,7 +85,7 @@ P4 (PUBLIC pascal trap, OSErr, FSMakeFSSpec, str255assign (local_file_name, file_name); hpb.volumeParam.ioNamePtr = (StringPtr) RM ((Ptr) local_file_name); - hpb.volumeParam.ioVRefNum = CW (vRefNum); + hpb.volumeParam.ioVRefNum = BigEndianValue (vRefNum); if (file_name[0]) hpb.volumeParam.ioVolIndex = CLC (-1); else @@ -98,12 +99,12 @@ P4 (PUBLIC pascal trap, OSErr, FSMakeFSSpec, str255assign (local_file_name, file_name); cpb.hFileInfo.ioNamePtr = (StringPtr) RM ((Ptr) local_file_name); - cpb.hFileInfo.ioVRefNum = CW (vRefNum); + cpb.hFileInfo.ioVRefNum = BigEndianValue (vRefNum); if (file_name[0]) cpb.hFileInfo.ioFDirIndex = CWC (0); else cpb.hFileInfo.ioFDirIndex = CWC (-1); - cpb.hFileInfo.ioDirID = CL (dir_id); + cpb.hFileInfo.ioDirID = BigEndianValue (dir_id); retval = PBGetCatInfo (&cpb, FALSE); if (retval == noErr) { @@ -116,16 +117,16 @@ P4 (PUBLIC pascal trap, OSErr, FSMakeFSSpec, OSErr err; cpb.hFileInfo.ioNamePtr = (StringPtr)CLC (0); - cpb.hFileInfo.ioVRefNum = CW (vRefNum); + cpb.hFileInfo.ioVRefNum = BigEndianValue (vRefNum); cpb.hFileInfo.ioFDirIndex = CWC (-1); - cpb.hFileInfo.ioDirID = CL (dir_id); + cpb.hFileInfo.ioDirID = BigEndianValue (dir_id); err = PBGetCatInfo (&cpb, FALSE); if (err == noErr) { if (cpb.hFileInfo.ioFlAttrib & ATTRIB_ISADIR) { spec->vRefNum = hpb.volumeParam.ioVRefNum; - spec->parID = CL (dir_id); + spec->parID = BigEndianValue (dir_id); extract_name ((StringPtr) spec->name, file_name); } else @@ -174,18 +175,18 @@ get_fcb_info (FSSpecPtr fsp) retval = 0; swapped_vrefnum = fsp->vRefNum; - swapped_fnum = CL (get_file_num (fsp)); + swapped_fnum = BigEndianValue (get_file_num (fsp)); - fcbsptr = (char *) CL (FCBSPtr); - total_length = CW(*(short *)fcbsptr); - fcbp = (filecontrolblock *) ((short *)CL(FCBSPtr)+1); - efcbp = (filecontrolblock *) ((char *)CL(FCBSPtr) + total_length); - fcb_size = CW (FSFCBLen); + fcbsptr = (char *) BigEndianValue (FCBSPtr); + total_length = BigEndianValue(*(short *)fcbsptr); + fcbp = (filecontrolblock *) ((short *)BigEndianValue(FCBSPtr)+1); + efcbp = (filecontrolblock *) ((char *)BigEndianValue(FCBSPtr) + total_length); + fcb_size = BigEndianValue (FSFCBLen); for (;fcbp < efcbp; fcbp = (filecontrolblock *) ((char *)fcbp + fcb_size)) { HVCB *vptr; - vptr = CL (fcbp->fcbVPtr); + vptr = BigEndianValue (fcbp->fcbVPtr); if (vptr && vptr->vcbVRefNum == swapped_vrefnum && fcbp->fcbFlNum == swapped_fnum) { @@ -253,7 +254,7 @@ restore_fcb (const save_fcb_info_t *infop) { char *fcbsptr; - fcbsptr = (char *) CL (FCBSPtr); + fcbsptr = (char *) BigEndianValue (FCBSPtr); if (infop) { if (infop->refnum) @@ -292,7 +293,7 @@ create_temp_name (Str63 name, int i) err = GetCurrentProcess (&psn); if (err == noErr) sprintf ((char *) name+1, - "%x%x.%x", CL (psn.highLongOfPSN), CL (psn.lowLongOfPSN), i); + "%x%x.%x", BigEndianValue (psn.highLongOfPSN), BigEndianValue (psn.lowLongOfPSN), i); else sprintf ((char *) name+1, "%d.%x", err, i); name[0] = strlen ((char *) name+1); @@ -420,7 +421,7 @@ P4 (PUBLIC pascal trap, OSErr, FSpCreate, { OSErr retval; - retval = HCreate (CW (spec->vRefNum), CL (spec->parID), spec->name, + retval = HCreate (BigEndianValue (spec->vRefNum), BigEndianValue (spec->parID), spec->name, creator, file_type); return retval; } @@ -556,7 +557,7 @@ P4 (PUBLIC pascal trap, void, FSpCreateResFile, FSSpecPtr, spec, OSType, creator, OSType, file_type, ScriptCode, script) { - HCreateResFile_helper (CW (spec->vRefNum), CL (spec->parID), + HCreateResFile_helper (BigEndianValue (spec->vRefNum), BigEndianValue (spec->parID), spec->name, creator, file_type, script); } @@ -566,7 +567,7 @@ P2 (PUBLIC pascal trap, INTEGER, FSpOpenResFile, { INTEGER retval; - retval = HOpenResFile (CW (spec->vRefNum), CL (spec->parID), spec->name, + retval = HOpenResFile (BigEndianValue (spec->vRefNum), BigEndianValue (spec->parID), spec->name, perms); return retval; } @@ -582,8 +583,8 @@ Executor::HCreate (INTEGER vref, LONGINT dirid, Str255 name, OSType creator, OST OSErr retval; hpb.fileParam.ioNamePtr = RM (name); - hpb.fileParam.ioVRefNum = CW (vref); - hpb.fileParam.ioDirID = CL (dirid); + hpb.fileParam.ioVRefNum = BigEndianValue (vref); + hpb.fileParam.ioDirID = BigEndianValue (dirid); retval = PBHCreate (&hpb, FALSE); if (retval == noErr) { @@ -591,9 +592,9 @@ Executor::HCreate (INTEGER vref, LONGINT dirid, Str255 name, OSType creator, OST retval = PBHGetFInfo (&hpb, FALSE); if (retval == noErr) { - hpb.fileParam.ioFlFndrInfo.fdCreator = CL (creator); - hpb.fileParam.ioFlFndrInfo.fdType = CL (type); - hpb.fileParam.ioDirID = CL (dirid); + hpb.fileParam.ioFlFndrInfo.fdCreator = BigEndianValue (creator); + hpb.fileParam.ioFlFndrInfo.fdType = BigEndianValue (type); + hpb.fileParam.ioDirID = BigEndianValue (dirid); retval = PBHSetFInfo (&hpb, FALSE); } } @@ -608,12 +609,12 @@ Executor::HOpenRF (INTEGER vref, LONGINT dirid, Str255 name, SignedByte perm, OSErr retval; hpb.fileParam.ioNamePtr = RM (name); - hpb.fileParam.ioVRefNum = CW (vref); + hpb.fileParam.ioVRefNum = BigEndianValue (vref); hpb.ioParam.ioPermssn = CB (perm); hpb.ioParam.ioMisc = CLC (0); - hpb.fileParam.ioDirID = CL (dirid); + hpb.fileParam.ioDirID = BigEndianValue (dirid); retval = PBHOpenRF (&hpb, FALSE); if (retval == noErr) - *refp = CW (hpb.ioParam.ioRefNum); + *refp = BigEndianValue (hpb.ioParam.ioRefNum); return retval; } diff --git a/src/fileInfo.cpp b/src/fileInfo.cpp index c15a2ba2..f7e1c285 100644 --- a/src/fileInfo.cpp +++ b/src/fileInfo.cpp @@ -26,6 +26,7 @@ char ROMlib_rcsid_fileInfo[] = #include using namespace Executor; +using namespace ByteSwap; #if 0 #if defined (CYGWIN32) @@ -57,7 +58,7 @@ A3 (PUBLIC, OSErr, GetFInfo, StringPtr, filen, INTEGER, vrn, /* IMIV-113 */ OSErr temp; pbr.fileParam.ioNamePtr = RM (filen); - pbr.fileParam.ioVRefNum = CW (vrn); + pbr.fileParam.ioVRefNum = BigEndianValue (vrn); pbr.fileParam.ioFVersNum = 0; pbr.fileParam.ioFDirIndex = CWC (0); temp = PBGetFInfo (&pbr, 0); @@ -80,8 +81,8 @@ PUBLIC OSErr HGetFInfo (INTEGER vref, LONGINT dirid, Str255 name, memset (&pbr, 0, sizeof pbr); pbr.fileParam.ioNamePtr = RM (name); - pbr.fileParam.ioVRefNum = CW (vref); - pbr.fileParam.ioDirID = CL (dirid); + pbr.fileParam.ioVRefNum = BigEndianValue (vref); + pbr.fileParam.ioDirID = BigEndianValue (dirid); retval = PBHGetFInfo (&pbr, FALSE); if (retval == noErr) { @@ -103,7 +104,7 @@ A3(PUBLIC, OSErr, SetFInfo, StringPtr, filen, INTEGER, vrn, /* IMIV-114 */ LONGINT t; pbr.fileParam.ioNamePtr = RM(filen); - pbr.fileParam.ioVRefNum = CW(vrn); + pbr.fileParam.ioVRefNum = BigEndianValue(vrn); pbr.fileParam.ioFVersNum = 0; pbr.fileParam.ioFDirIndex = CWC (0); temp = PBGetFInfo(&pbr, 0); @@ -127,7 +128,7 @@ A2(PUBLIC, OSErr, SetFLock, StringPtr, filen, INTEGER, vrn) /* IMIV-114 */ ParamBlockRec pbr; pbr.fileParam.ioNamePtr = RM(filen); - pbr.fileParam.ioVRefNum = CW(vrn); + pbr.fileParam.ioVRefNum = BigEndianValue(vrn); pbr.fileParam.ioFVersNum = 0; return(PBSetFLock(&pbr, 0)); } @@ -137,7 +138,7 @@ A2(PUBLIC, OSErr, RstFLock, StringPtr, filen, INTEGER, vrn) /* IMIV-114 */ ParamBlockRec pbr; pbr.fileParam.ioNamePtr = RM(filen); - pbr.fileParam.ioVRefNum = CW(vrn); + pbr.fileParam.ioVRefNum = BigEndianValue(vrn); pbr.fileParam.ioFVersNum = 0; return(PBRstFLock(&pbr, 0)); } @@ -148,7 +149,7 @@ A3(PUBLIC, OSErr, Rename, StringPtr, filen, INTEGER, vrn, /* IMIV-114 */ ParamBlockRec pbr; pbr.ioParam.ioNamePtr = RM(filen); - pbr.ioParam.ioVRefNum = CW(vrn); + pbr.ioParam.ioVRefNum = BigEndianValue(vrn); pbr.ioParam.ioVersNum = 0; pbr.ioParam.ioMisc = RM((LONGINT) (long) newf); return(PBRename(&pbr, 0)); @@ -280,11 +281,11 @@ Executor::open_attrib_bits (LONGINT file_id, VCB *vcbp, INTEGER *refnump) *refnump = 0; for (i = 0; i < NFCB; i++) { - if (CL(ROMlib_fcblocks[i].fdfnum) == file_id + if (BigEndianValue(ROMlib_fcblocks[i].fdfnum) == file_id && MR(ROMlib_fcblocks[i].fcvptr) == vcbp) { if (*refnump == 0) - *refnump = CW(i * 94 + 2); + *refnump = BigEndianValue(i * 94 + 2); if (ROMlib_fcblocks[i].fcflags & fcfisres) retval |= ATTRIB_RESOPEN; else @@ -325,15 +326,15 @@ A5(PUBLIC, OSErr, ROMlib_PBGetSetFInfoD, ParmBlkPtr, pb, /* INTERNAL */ } if (op == Get) { - if (dodirs && (CW(pb->fileParam.ioFDirIndex) < 0)) + if (dodirs && (BigEndianValue(pb->fileParam.ioFDirIndex) < 0)) indext = IGNORENAME; /* IMIV-156 */ - else if (CW(pb->fileParam.ioFDirIndex) > 0) + else if (BigEndianValue(pb->fileParam.ioFDirIndex) > 0) indext = FDirIndex; else indext = NoIndex; } else indext = NoIndex; - if ((err = ROMlib_nami(pb, CL(*dir), indext, &pathname, &filename, &endname, + if ((err = ROMlib_nami(pb, BigEndianValue(*dir), indext, &pathname, &filename, &endname, !dodirs, &vcbp, &datasbuf)) != noErr) /*-->*/ goto theend; rpathname = ROMlib_resname(pathname, filename, endname); @@ -341,7 +342,7 @@ A5(PUBLIC, OSErr, ROMlib_PBGetSetFInfoD, ParmBlkPtr, pb, /* INTERNAL */ LONGINT file_num; file_num = ST_INO (datasbuf); - pb->fileParam.ioFlNum = CL (file_num); + pb->fileParam.ioFlNum = BigEndianValue (file_num); if (S_ISDIR (datasbuf.st_mode)) { LONGINT dirid; @@ -436,12 +437,12 @@ A5(PUBLIC, OSErr, ROMlib_PBGetSetFInfoD, ParmBlkPtr, pb, /* INTERNAL */ ((CInfoPBPtr) pb)->dirInfo.ioDrParID = CLC(1); } else { *dir = ((CInfoPBPtr) pb)->dirInfo.ioDrDirID = - CL((LONGINT) ST_INO (datasbuf)); + BigEndianValue((LONGINT) ST_INO (datasbuf)); if (ST_INO (parentsbuf) == vcbp->u.ufs.ino) ((CInfoPBPtr) pb)->dirInfo.ioDrParID = CLC(2); else ((CInfoPBPtr) pb)->dirInfo.ioDrParID = - CL((LONGINT) ST_INO (parentsbuf)); + BigEndianValue((LONGINT) ST_INO (parentsbuf)); } } else { /* actually what happens here doesn't really matter, since @@ -450,15 +451,15 @@ A5(PUBLIC, OSErr, ROMlib_PBGetSetFInfoD, ParmBlkPtr, pb, /* INTERNAL */ if (ST_INO (datasbuf) == vcbp->u.ufs.ino) { *dir = CLC(2); /* root directory number */ } else - *dir = CL((LONGINT) ST_INO (datasbuf)); - pb->fileParam.ioFlNum = CL((LONGINT) ST_INO (datasbuf)); + *dir = BigEndianValue((LONGINT) ST_INO (datasbuf)); + pb->fileParam.ioFlNum = BigEndianValue((LONGINT) ST_INO (datasbuf)); } } else { if (ST_INO (parentsbuf) == vcbp->u.ufs.ino) *dir = CLC(2); /* root directory number */ else - *dir = CL((LONGINT) ST_INO (parentsbuf)); - pb->fileParam.ioFlNum = CL((LONGINT) ST_INO (datasbuf)); + *dir = BigEndianValue((LONGINT) ST_INO (parentsbuf)); + pb->fileParam.ioFlNum = BigEndianValue((LONGINT) ST_INO (datasbuf)); if (dodirs) { ((CInfoPBPtr) pb)->hFileInfo.ioFlParID = *dir; ((CInfoPBPtr) pb)->hFileInfo.ioFlClpSiz = CLC(512); @@ -479,14 +480,14 @@ A5(PUBLIC, OSErr, ROMlib_PBGetSetFInfoD, ParmBlkPtr, pb, /* INTERNAL */ pathname, &creator, &type)) { - pb->fileParam.ioFlFndrInfo.fdCreator = CL (creator); - pb->fileParam.ioFlFndrInfo.fdType = CL (type); + pb->fileParam.ioFlFndrInfo.fdCreator = BigEndianValue (creator); + pb->fileParam.ioFlFndrInfo.fdType = BigEndianValue (type); } } - pb->fileParam.ioFlLgLen = CL(datasbuf.st_size); + pb->fileParam.ioFlLgLen = BigEndianValue(datasbuf.st_size); pb->fileParam.ioFlRLgLen = 0; pb->fileParam.ioFlCrDat = - CL(UNIXTIMETOMACTIME(datasbuf.st_ctime)); + BigEndianValue(UNIXTIMETOMACTIME(datasbuf.st_ctime)); if (dodirs) memset(&((CInfoPBPtr) pb)->hFileInfo.ioFlXFndrInfo, 0, sizeof(((CInfoPBPtr) pb)->hFileInfo.ioFlXFndrInfo)); @@ -505,7 +506,7 @@ A5(PUBLIC, OSErr, ROMlib_PBGetSetFInfoD, ParmBlkPtr, pb, /* INTERNAL */ pb->fileParam.ioFlVersNum = 0; pb->fileParam.ioFlStBlk = -1; /* NOT SUPPORTED */ pb->fileParam.ioFlRStBlk = -1; /* NOT SUPPORTED */ - pb->fileParam.ioFlMdDat = CL(UNIXTIMETOMACTIME( + pb->fileParam.ioFlMdDat = BigEndianValue(UNIXTIMETOMACTIME( MAX(resourcesbuf.st_mtime, datasbuf.st_mtime))); if (dodirs) ((CInfoPBPtr) pb)->hFileInfo.ioFlBkDat = 0; @@ -520,7 +521,7 @@ A5(PUBLIC, OSErr, ROMlib_PBGetSetFInfoD, ParmBlkPtr, pb, /* INTERNAL */ if (ROMlib_creator_and_type_from_filename (strlen (filename), filename, &creator, &type) - && finfo.fdType == CL (type) && finfo.fdCreator == CL (creator)) + && finfo.fdType == BigEndianValue (type) && finfo.fdCreator == BigEndianValue (creator)) err = noErr; else if ((err = ROMlib_hiddenbyname(Set, pathname, rpathname, &dateinfo, &finfo, @@ -534,7 +535,7 @@ A5(PUBLIC, OSErr, ROMlib_PBGetSetFInfoD, ParmBlkPtr, pb, /* INTERNAL */ accessupdatetimes[0].tv_sec = datasbuf.st_atime; accessupdatetimes[0].tv_usec = 0; accessupdatetimes[1].tv_sec = - MACTIMETOGUNIXTIME(CL(pb->fileParam.ioFlMdDat)); + MACTIMETOGUNIXTIME(BigEndianValue(pb->fileParam.ioFlMdDat)); accessupdatetimes[1].tv_usec = 0; Uutimes(pathname, accessupdatetimes); #endif /* MACBLITZ */ @@ -713,7 +714,7 @@ A2(PUBLIC, OSErr, ufsPBSetFLock, ParmBlkPtr, pb, /* INTERNAL */ A2(PUBLIC, OSErr, ufsPBHSetFLock, HParmBlkPtr, /* INTERNAL */ pb, BOOLEAN, a) { - return PBLockUnlock((ParmBlkPtr) pb, a, CL(pb->fileParam.ioDirID), Lock); + return PBLockUnlock((ParmBlkPtr) pb, a, BigEndianValue(pb->fileParam.ioDirID), Lock); } A2(PUBLIC, OSErr, ufsPBRstFLock, ParmBlkPtr, pb, /* INTERNAL */ @@ -725,7 +726,7 @@ A2(PUBLIC, OSErr, ufsPBRstFLock, ParmBlkPtr, pb, /* INTERNAL */ A2(PUBLIC, OSErr, ufsPBHRstFLock, HParmBlkPtr, pb, /* INTERNAL */ BOOLEAN, a) { - return PBLockUnlock((ParmBlkPtr) pb, a, CL(pb->fileParam.ioDirID), Unlock); + return PBLockUnlock((ParmBlkPtr) pb, a, BigEndianValue(pb->fileParam.ioDirID), Unlock); } A2(PUBLIC, OSErr, ufsPBSetFVers, ParmBlkPtr, pb, /* INTERNAL */ @@ -745,7 +746,7 @@ A2(PUBLIC, OSErr, ufsPBRename, ParmBlkPtr, pb, /* INTERNAL */ A2(PUBLIC, OSErr, ufsPBHRename, HParmBlkPtr, pb, /* INTERNAL */ BOOLEAN, a) { - return ROMlib_PBMoveOrRename((ParmBlkPtr) pb, a, CL(pb->fileParam.ioDirID), - CL(pb->fileParam.ioDirID), (char *) (long) MR(pb->ioParam.ioMisc), + return ROMlib_PBMoveOrRename((ParmBlkPtr) pb, a, BigEndianValue(pb->fileParam.ioDirID), + BigEndianValue(pb->fileParam.ioDirID), (char *) (long) MR(pb->ioParam.ioMisc), HRename); } diff --git a/src/fileMisc.cpp b/src/fileMisc.cpp index ee605412..e814f5fa 100644 --- a/src/fileMisc.cpp +++ b/src/fileMisc.cpp @@ -48,6 +48,7 @@ char ROMlib_rcsid_fileMisc[] = #include using namespace Executor; +using namespace ByteSwap; /* NOTE: calling most of the routines here is a sign that the user may be depending on the internal layout of things a bit too much */ @@ -104,7 +105,7 @@ A2(PUBLIC, OSErr, ufsPBGetFCBInfo, FCBPBPtr, pb, /* INTERNAL */ if (pb->ioNamePtr) str255assign(MR(pb->ioNamePtr), fp->fcname); pb->ioVRefNum = MR(fp->fcvptr)->vcbVRefNum; - pb->ioRefNum = CW(rn); + pb->ioRefNum = BigEndianValue(rn); pb->ioFCBFlNm = fp->fdfnum; pb->ioFCBFlags = (fp->fcflags << 8) | (unsigned char)fp->fcbTypByt; pb->ioFCBStBlk = 0; @@ -191,7 +192,7 @@ Executor::ROMlib_addtodq (ULONGINT drvsize, const char *devicename, INTEGER part dno = 0; for (dp = (DrvQEl *) MR(DrvQHdr.qHead); dp; dp = (DrvQEl *) MR(dp->qLink)) { dqp = (DrvQExtra *) ((char *)dp - sizeof(LONGINT)); - if (dqp->partition == CW(partition) && + if (dqp->partition == BigEndianValue(partition) && slashstrcmp((char *) dqp->devicename, devicename) == 0) { dno = Cx(dqp->dq.dQDrive); /*-->*/ break; @@ -211,21 +212,21 @@ Executor::ROMlib_addtodq (ULONGINT drvsize, const char *devicename, INTEGER part dno = ROMlib_ejdriveno++; } dqp = (DrvQExtra *) NewPtr(sizeof(DrvQExtra)); - dqp->flags = CL(1 << 7); /* is not single sided */ + dqp->flags = BigEndianValue(1 << 7); /* is not single sided */ if (flags & DRIVE_FLAGS_LOCKED) - dqp->flags = CL(CL(dqp->flags) | 1L << 31); + dqp->flags = BigEndianValue(BigEndianValue(dqp->flags) | 1L << 31); if (flags & DRIVE_FLAGS_FIXED) - dqp->flags = CL(CL(dqp->flags) | 8L << 16); + dqp->flags = BigEndianValue(BigEndianValue(dqp->flags) | 8L << 16); else - dqp->flags = CL(CL(dqp->flags) | 2); /* IMIV-181 says + dqp->flags = BigEndianValue(BigEndianValue(dqp->flags) | 2); /* IMIV-181 says it can be 1 or 2 */ /* dqp->dq.qLink will be set up when we Enqueue this baby */ - dqp->dq.dQDrvSz = CW(drvsize); - dqp->dq.dQDrvSz2 = CW(drvsize>>16); + dqp->dq.dQDrvSz = BigEndianValue(drvsize); + dqp->dq.dQDrvSz2 = BigEndianValue(drvsize>>16); dqp->dq.qType = CWC(1); - dqp->dq.dQDrive = CW(dno); - dqp->dq.dQRefNum = CW(drefnum); + dqp->dq.dQDrive = BigEndianValue(dno); + dqp->dq.dQRefNum = BigEndianValue(drefnum); dqp->dq.dQFSID = 0; if (!devicename) dqp->devicename = 0; @@ -234,7 +235,7 @@ Executor::ROMlib_addtodq (ULONGINT drvsize, const char *devicename, INTEGER part dqp->devicename = NewPtr(strl + 1); strcpy((char *) dqp->devicename, devicename); } - dqp->partition = CW(partition); + dqp->partition = BigEndianValue(partition); if (hfsp) dqp->hfs = *hfsp; else @@ -373,7 +374,7 @@ PRIVATE void ROMlib_automount_helper(char *path, char *aliasp) HVCB *vcbp; vcbp = - ROMlib_vcbbyvrn (CW (pb.ioParam.ioVRefNum)); + ROMlib_vcbbyvrn (BigEndianValue (pb.ioParam.ioVRefNum)); str255_from_c_string (vcbp->vcbVN, aliasp); /* hack in name */ /*-->*/ return; @@ -826,7 +827,7 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ savezone = TheZone; TheZone = SysZone; FCBSPtr = RM(NewPtr((Size) sizeof(fcbhidden))); - ((fcbhidden *)MR(FCBSPtr))->nbytes = CW(sizeof(fcbhidden)); + ((fcbhidden *)MR(FCBSPtr))->nbytes = BigEndianValue(sizeof(fcbhidden)); for (i = 0 ; i < NFCB ; i++) { ROMlib_fcblocks[i].fdfnum = 0; @@ -851,7 +852,7 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ WDCBsPtr = RM(NewPtr((Size) wdlen)); TheZone = savezone; memset (MR(WDCBsPtr), 0, wdlen); - *(INTEGER *)MR(WDCBsPtr) = CW(wdlen); + *(INTEGER *)MR(WDCBsPtr) = BigEndianValue(wdlen); ROMlib_ConfigurationFolder = copystr(getenv(CONFIGURATIONFOLDER)); ROMlib_SystemFolder = copystr(getenv(SYSTEMFOLDER)); @@ -986,9 +987,9 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ if (is_unix_path (ROMlib_DefaultFolder) && Ustat(ROMlib_DefaultFolder, &sbuf) == 0) { - CurDirStore = CL((LONGINT) ST_INO (sbuf)); + CurDirStore = BigEndianValue((LONGINT) ST_INO (sbuf)); vcbp = ROMlib_vcbbybiggestunixname(ROMlib_DefaultFolder); - SFSaveDisk = CW(-CW(vcbp->vcbVRefNum)); + SFSaveDisk = BigEndianValue(-BigEndianValue(vcbp->vcbVRefNum)); } if (is_unix_path (ROMlib_SystemFolder)) { if (Ustat(ROMlib_SystemFolder, &sbuf) < 0) { @@ -997,7 +998,7 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ } cpb.hFileInfo.ioNamePtr = RM((StringPtr) SYSMACNAME); cpb.hFileInfo.ioVRefNum = -1; - cpb.hFileInfo.ioDirID = CL((LONGINT) ST_INO (sbuf)); + cpb.hFileInfo.ioDirID = BigEndianValue((LONGINT) ST_INO (sbuf)); } else { sysnamelen = 1+strlen(ROMlib_SystemFolder)+1+strlen(SYSMACNAME+1)+1; sysname = (char*)alloca(sysnamelen); @@ -1167,7 +1168,7 @@ Executor::PRNTOFPERR (INTEGER prn, OSErr *errp) fcbrec *retval; OSErr err; - if (prn < 0 || prn >= CW(*(short *)MR(FCBSPtr)) || (prn % 94) != 2) { + if (prn < 0 || prn >= BigEndianValue(*(short *)MR(FCBSPtr)) || (prn % 94) != 2) { retval = 0; err = rfNumErr; } else { diff --git a/src/fileVolumes.cpp b/src/fileVolumes.cpp index 98d948de..033daf02 100644 --- a/src/fileVolumes.cpp +++ b/src/fileVolumes.cpp @@ -38,6 +38,7 @@ char ROMlib_rcsid_fileVolumes[] = #define RETURN(x) { err = (x); goto DONE; } using namespace Executor; +using namespace ByteSwap; /* * For now we just use 101 entries in our hash table, no matter what. @@ -421,7 +422,7 @@ PRIVATE BOOLEAN filesystems_match(rkey_t *keyp, VCBExtra *vcbp) BOOLEAN retval; namlen = strlen(vcbp->unixname); - if (namlen == CW(keyp->filesystemlen)) + if (namlen == BigEndianValue(keyp->filesystemlen)) retval = strncmp(vcbp->unixname, keyp->hostnameandroot + keyp->hostnamelen, namlen) == 0; else @@ -564,9 +565,9 @@ PRIVATE void readadbm(const char *dbmname, VCBExtra *vcbp) DBM_FETCH (&content, db, key); if (content.dsize) { contentp = (rcontent_t *) content.dptr; - dirid = CL(keyp->dirid); + dirid = BigEndianValue(keyp->dirid); hashinsert(vcbp, extractpathname(contentp), &dirid, - CL(contentp->parid), new1); + BigEndianValue(contentp->parid), new1); } } } @@ -600,14 +601,14 @@ PRIVATE void writeadbm(const char *dbmname, VCBExtra *vcbp, dirnamelen = strlen(deletep->dirname+1); key.dsize = sizeof(rkey_t) + ROMlib_hostnamelen + unamelen - 1; content.dsize = sizeof(rcontent_t) + dirnamelen - 1; - keyp->dirid = CL(deletep->dirid); - keyp->filesystemlen = CW(unamelen); + keyp->dirid = BigEndianValue(deletep->dirid); + keyp->filesystemlen = BigEndianValue(unamelen); keyp->hostnamelen = ROMlib_hostnamelen; dst = keyp->hostnameandroot; memcpy(dst, ROMlib_hostname, ROMlib_hostnamelen); dst += ROMlib_hostnamelen; memcpy(dst, vcbp->unixname, unamelen); - contentp->parid = CL(deletep->parid); + contentp->parid = BigEndianValue(deletep->parid); strcpy(contentp->path, deletep->dirname+1); dbm_store(db, key, content, DBM_REPLACE); keyp->hostnamelen = 0; @@ -683,7 +684,7 @@ A1(PUBLIC, OSErr, ufsPBMountVol, ParmBlkPtr, pb) /* INTERNAL */ strcpy(vp->unixname, ROMlib_volumename); vp->vcb.vcbDrvNum = pb->ioParam.ioVRefNum; --ROMlib_nextvrn; - vp->vcb.vcbVRefNum = CW(ROMlib_nextvrn); + vp->vcb.vcbVRefNum = BigEndianValue(ROMlib_nextvrn); vp->u.ufs.ino = ST_INO (sbuf); if (strcmp("/", ROMlib_volumename + SLASH_CHAR_OFFSET) == 0) { name = ROMlib_volumename; @@ -745,11 +746,11 @@ A4(PUBLIC, OSErr, GetVInfo, INTEGER, drv, StringPtr, voln, /* IMIV-107 */ OSErr temp; pbr.volumeParam.ioVolIndex = 0; - pbr.volumeParam.ioVRefNum = CW(drv); + pbr.volumeParam.ioVRefNum = BigEndianValue(drv); pbr.volumeParam.ioNamePtr = RM(voln); temp = PBGetVInfo(&pbr, 0); *vrn = pbr.volumeParam.ioVRefNum; - *freeb = CL(Cx(pbr.volumeParam.ioVFrBlk) * Cx(pbr.volumeParam.ioVAlBlkSiz)); + *freeb = BigEndianValue(Cx(pbr.volumeParam.ioVFrBlk) * Cx(pbr.volumeParam.ioVAlBlkSiz)); return(temp); } @@ -781,7 +782,7 @@ A2(PUBLIC, OSErr, SetVol, StringPtr, voln, INTEGER, vrn) /* IMIV-107 */ ParamBlockRec pbr; pbr.volumeParam.ioNamePtr = RM(voln); - pbr.volumeParam.ioVRefNum = CW(vrn); + pbr.volumeParam.ioVRefNum = BigEndianValue(vrn); return(PBSetVol(&pbr, 0)); } @@ -790,7 +791,7 @@ A2(PUBLIC, OSErr, FlushVol, StringPtr, voln, INTEGER, vrn) /* IMIV-108 */ ParamBlockRec pbr; pbr.ioParam.ioNamePtr = RM(voln); - pbr.ioParam.ioVRefNum = CW(vrn); + pbr.ioParam.ioVRefNum = BigEndianValue(vrn); return(PBFlushVol(&pbr, 0)); } @@ -799,7 +800,7 @@ A2(PUBLIC, OSErr, UnmountVol, StringPtr, voln, INTEGER, vrn) /* IMIV-108 */ ParamBlockRec pbr; pbr.ioParam.ioNamePtr = RM(voln); - pbr.ioParam.ioVRefNum = CW(vrn); + pbr.ioParam.ioVRefNum = BigEndianValue(vrn); return(PBUnmountVol(&pbr)); } @@ -808,7 +809,7 @@ A2(PUBLIC, OSErr, Eject, StringPtr, voln, INTEGER, vrn) /* IMIV-108 */ ParamBlockRec pbr; pbr.ioParam.ioNamePtr = RM(voln); - pbr.ioParam.ioVRefNum = CW(vrn); + pbr.ioParam.ioVRefNum = BigEndianValue(vrn); return(PBEject(&pbr)); } @@ -839,7 +840,7 @@ A4(PRIVATE, VCB *, findvcb, StringPtr, sp, INTEGER, vrn, BOOLEAN *, iswd, /*-->*/ return MR(DefVCBPtr); } if (vrn < 0) { - *vrnp = CW(vrn); + *vrnp = BigEndianValue(vrn); if (ISWDNUM(vrn)) { *iswd = TRUE; vcbptr = WDNUMTOWDP(vrn)->vcbp; @@ -960,18 +961,18 @@ A1(PRIVATE, VCB *, common, ParmBlkPtr, pb) pseudo_block_size = find_pseudo_block_size (sbuf.f_blocks, sbuf.f_bsize); - vcbp->vcbAlBlkSiz = CL (pseudo_block_size); + vcbp->vcbAlBlkSiz = BigEndianValue (pseudo_block_size); nm_al_blks = ((long long) sbuf.f_blocks * sbuf.f_bsize / pseudo_block_size); short_nm_al_blks = MIN (nm_al_blks, 65535); - vcbp->vcbNmAlBlks = CW (short_nm_al_blks); + vcbp->vcbNmAlBlks = BigEndianValue (short_nm_al_blks); effective_free_blocks = geteuid() ? sbuf.f_bavail : sbuf.f_bfree; free_bks = ((long long) effective_free_blocks * sbuf.f_bsize / pseudo_block_size); short_free_bks = MIN (free_bks, 65535); - vcbp->vcbFreeBks = CW (short_free_bks); - vcbp->vcbFilCnt = CL(sbuf.f_files); + vcbp->vcbFreeBks = BigEndianValue (short_free_bks); + vcbp->vcbFilCnt = BigEndianValue(sbuf.f_files); } if (pb->volumeParam.ioNamePtr) str255assign(MR(pb->volumeParam.ioNamePtr), vcbp->vcbVN); diff --git a/src/float4.cpp b/src/float4.cpp index 7b829032..d6e8586a 100644 --- a/src/float4.cpp +++ b/src/float4.cpp @@ -27,6 +27,7 @@ char ROMlib_rcsid_float4[] = #include "rsys/float_fcw.h" using namespace Executor; +using namespace ByteSwap; #if !defined (CYGWIN32) @@ -195,7 +196,7 @@ P_SAVED0D1A0A1_2 (PUBLIC pascal trap, void, ROMlib_Fsetenv, INTEGER *, * handling. */ - env = CW (*dp); + env = BigEndianValue (*dp); halts_enabled = env & 0x1F; env &= ~0x1F; @@ -309,7 +310,7 @@ P_SAVED0D1A0A1_2 (PUBLIC pascal trap, void, ROMlib_Fsetenv, INTEGER *, gui_abort (); #endif - warning_floating_point ("setenv(0x%04X)", (unsigned) (uint16) CW (*dp)); + warning_floating_point ("setenv(0x%04X)", (unsigned) (uint16) BigEndianValue (*dp)); } @@ -395,7 +396,7 @@ P_SAVED0D1A0A1_2 (PUBLIC pascal trap, void, ROMlib_Fgetenv, INTEGER *, env = (env & ~0x1F) | halts_enabled; /* Return the computed environment word. */ - *(unsigned short *) dp = CW(env); + *(unsigned short *) dp = BigEndianValue(env); warning_floating_point ("Returning 0x%04X", (unsigned) env); } @@ -447,7 +448,7 @@ P_SAVED0D1A0A1_2 (PUBLIC pascal trap, void, ROMlib_Ftestxcp, INTEGER *, warning_floating_point (NULL_STRING); /* Fetch the current environment. */ C_ROMlib_Fgetenv (&env, 0); - env = CW (env); + env = BigEndianValue (env); /* Clear dp's high byte. */ *dp &= CWC (0x00FF); @@ -477,7 +478,7 @@ P_SAVED0D1A0A1_3 (PUBLIC pascal trap, void, ROMlib_FscalbX, INTEGER *, DECLAREINOUT(); /* FIXME - may lose precision! */ - scale = CW(*(short *)sp); + scale = BigEndianValue(*(short *)sp); ieee_to_x80 (out = scalb (in = x80_to_ieee (dp), scale), dp); warning_floating_point ("scalb(" IEEE_T_FORMAT ", %d) == " IEEE_T_FORMAT "", @@ -580,10 +581,10 @@ do { \ dest op ( in1 = f32_to_ieee ((const f32_t *) sp)); \ break; \ case FI_OPERAND: \ - dest op (in1 = CW (*(short *) sp)); \ + dest op (in1 = BigEndianValue (*(short *) sp)); \ break; \ case FL_OPERAND: \ - dest op (in1 = CL (*(long *)(sp))); \ + dest op (in1 = BigEndianValue (*(long *)(sp))); \ break; \ case FC_OPERAND: \ dest op (in1 = comp_to_ieee ((const comp_t *) sp)); \ @@ -684,10 +685,10 @@ P_SAVED0D1A0A1_3 (PUBLIC pascal trap, void, ROMlib_FX2x, x80_t *, ieee_to_f32 (val, (f32_t *) dp); break; case FI_OPERAND: - *(short *)dp = CW( (signed short) rint (val)); + *(short *)dp = BigEndianValue( (signed short) rint (val)); break; case FL_OPERAND: - *(long *)dp = CL( (LONGINT) rint (val)); + *(long *)dp = BigEndianValue( (LONGINT) rint (val)); break; case FC_OPERAND: ieee_to_comp (val, (comp_t *) dp); @@ -721,10 +722,10 @@ P_SAVED1A0A1_3 (PUBLIC pascal trap, void, ROMlib_Fremx, void *, sp, n2 = f32_to_ieee ((const f32_t *) sp); break; case FI_OPERAND: - n2 = CW(*(short *)sp); + n2 = BigEndianValue(*(short *)sp); break; case FL_OPERAND: - n2 = CL(*(long *)sp); + n2 = BigEndianValue(*(long *)sp); break; case FC_OPERAND: n2 = comp_to_ieee ((const comp_t *) sp); @@ -787,10 +788,10 @@ P_SAVED0D1A0A1_3 (PUBLIC pascal trap, FCMP_RETURN_TYPE, ROMlib_Fcmpx, n2 = f32_to_ieee ((const f32_t *) sp); break; case FI_OPERAND: - n2 = CW(*(short *)sp); + n2 = BigEndianValue(*(short *)sp); break; case FL_OPERAND: - n2 = CL (* (long *)sp); + n2 = BigEndianValue (* (long *)sp); break; case FC_OPERAND: n2 = comp_to_ieee ((const comp_t *) sp); @@ -911,10 +912,10 @@ P_SAVED0D1A0A1_4 (PUBLIC pascal trap, void, ROMlib_Fx2dec, DecForm *, n = f32_to_ieee ((const f32_t *) sp); break; case FI_OPERAND: - n = CW (*(short *)sp); + n = BigEndianValue (*(short *)sp); break; case FL_OPERAND: - n = CL (*(long *)sp); + n = BigEndianValue (*(long *)sp); break; case FC_OPERAND: n = comp_to_ieee ((const comp_t *) sp); @@ -926,7 +927,7 @@ P_SAVED0D1A0A1_4 (PUBLIC pascal trap, void, ROMlib_Fx2dec, DecForm *, in = n; /* Fetch the number of digits they are interested in. */ - digits = CW (*(short *) (&sp2->digits)); + digits = BigEndianValue (*(short *) (&sp2->digits)); /* Compute sign. */ if (n < 0) @@ -1001,7 +1002,7 @@ P_SAVED0D1A0A1_4 (PUBLIC pascal trap, void, ROMlib_Fx2dec, DecForm *, if (c_string[0] == '\0') strcpy (c_string, "0"); - dp->exp = CW (exponent); + dp->exp = BigEndianValue (exponent); } /* See if the generated string is too LONGINT. */ @@ -1016,7 +1017,7 @@ P_SAVED0D1A0A1_4 (PUBLIC pascal trap, void, ROMlib_Fx2dec, DecForm *, old_len = strlen (c_string); c_string[SIGDIGLEN] = 0; new_len = SIGDIGLEN; - dp->exp = CW (CW (dp->exp) + old_len - new_len); + dp->exp = BigEndianValue (BigEndianValue (dp->exp) + old_len - new_len); } #endif @@ -1027,7 +1028,7 @@ P_SAVED0D1A0A1_4 (PUBLIC pascal trap, void, ROMlib_Fx2dec, DecForm *, warning_floating_point ("Fx2dec(" IEEE_T_FORMAT ", digits=%d) == %s%s * 10**%d", (IEEE_T_PRINT_CAST) in, digits, dp->sgn ? "-" : "", - c_string, CW (dp->exp)); + c_string, BigEndianValue (dp->exp)); } #if defined (CYGWIN32) @@ -1108,10 +1109,10 @@ P_SAVED0D1A0A1_3 (PUBLIC pascal trap, void, ROMlib_Fdec2x, Decimal *, ieee_to_f32 (n, (f32_t *) dp); break; case FI_OPERAND: - *(short *) dp = CW( (signed short) rint (n)); + *(short *) dp = BigEndianValue( (signed short) rint (n)); break; case FL_OPERAND: - *(long *) dp = CL( (LONGINT) rint (n)); + *(long *) dp = BigEndianValue( (LONGINT) rint (n)); break; case FC_OPERAND: ieee_to_comp (n, (comp_t *) dp); @@ -1123,7 +1124,7 @@ P_SAVED0D1A0A1_3 (PUBLIC pascal trap, void, ROMlib_Fdec2x, Decimal *, warning_floating_point ("Fdec2x(%s%.*s * 10**%d) == " IEEE_T_FORMAT "", sp->sgn ? "-" : "", (uint8) sp->sig[0], &sp->sig[1], - CW (sp->exp), (IEEE_T_PRINT_CAST) in); + BigEndianValue (sp->exp), (IEEE_T_PRINT_CAST) in); } @@ -1131,7 +1132,7 @@ P_SAVED0D1A0A1_3 (PUBLIC pascal trap, void, ROMlib_Fclassx, void *, sp, INTEGER *, dp, unsigned short, sel) { static const unsigned char eight_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; - unsigned short first_word = CW (*(unsigned short *)sp); + unsigned short first_word = BigEndianValue (*(unsigned short *)sp); warning_floating_point (NULL_STRING); @@ -1197,7 +1198,7 @@ P_SAVED0D1A0A1_3 (PUBLIC pascal trap, void, ROMlib_Fclassx, void *, #define S_NORMNUM_MASK 0x78000000 #define S_FRAC_MASK 0x07FFFFFF #define S_QNAN_MASK 0x04000000 - ULONGINT v = CL (*(uint32 *)sp); + ULONGINT v = BigEndianValue (*(uint32 *)sp); if ((v & S_INF_OR_NAN) == S_INF_OR_NAN) { if ((v & S_FRAC_MASK) == 0) @@ -1237,6 +1238,6 @@ P_SAVED0D1A0A1_3 (PUBLIC pascal trap, void, ROMlib_Fclassx, void *, * sign bit, we only need to check the first byte of the type. */ if (*(signed char *)sp < 0) - *dp = CW (0 - CW (*dp)); + *dp = BigEndianValue (0 - BigEndianValue (*dp)); } diff --git a/src/float5.cpp b/src/float5.cpp index dd29b5d8..419ef191 100644 --- a/src/float5.cpp +++ b/src/float5.cpp @@ -16,6 +16,7 @@ char ROMlib_rcsid_float5[] = #include "rsys/floatconv.h" using namespace Executor; +using namespace ByteSwap; P_SAVED0D1A0A1_1 (PUBLIC pascal trap, void, ROMlib_FlnX, x80_t *, dp) { @@ -103,7 +104,7 @@ P_SAVED0D1A0A1_2(PUBLIC pascal trap, void, ROMlib_Fxpwri, INTEGER *, sp, DECLAREIN2OUT(); /* FIXME - may lose precision! */ - ieee_to_x80 (out = pow (in1 = x80_to_ieee (dp), in2 = CW(*(short *)sp)), dp); + ieee_to_x80 (out = pow (in1 = x80_to_ieee (dp), in2 = BigEndianValue(*(short *)sp)), dp); warning_floating_point ("xpwri(%f, %f) == %f", (double) in1, (double) in2, (double) out); } diff --git a/src/float7.cpp b/src/float7.cpp index 4f87650a..3098dd79 100644 --- a/src/float7.cpp +++ b/src/float7.cpp @@ -15,6 +15,7 @@ char ROMlib_rcsid_float7[] = #include using namespace Executor; +using namespace ByteSwap; #define LOWER(x) ((x) | 0x20) /* converts to lower case if x is A-Z */ @@ -32,8 +33,8 @@ P3(PUBLIC pascal trap, void, ROMlib_Fdec2str, DecForm * volatile, sp2, char backwardsexp[MAXEXPSIZE]; warning_floating_point (NULL_STRING); - digits = CW (sp2->digits); - style = CW (sp2->style); + digits = BigEndianValue (sp2->digits); + style = BigEndianValue (sp2->style); switch(style & DECIMALTYPEMASK) { case FloatDecimal: @@ -54,7 +55,7 @@ P3(PUBLIC pascal trap, void, ROMlib_Fdec2str, DecForm * volatile, sp2, i = 1; } dp[i + 2] = 'e'; - exponent = CW (sp->exp) + sp->sig[0] - 1; + exponent = BigEndianValue (sp->exp) + sp->sig[0] - 1; if (exponent < 0) { dp[i+3] = '-'; exponent = -exponent; @@ -81,9 +82,9 @@ P3(PUBLIC pascal trap, void, ROMlib_Fdec2str, DecForm * volatile, sp2, beforedecimal = 0; sp->sig[0] = 0; } else { - beforedecimal = sp->sig[0] + CW (sp->exp); + beforedecimal = sp->sig[0] + BigEndianValue (sp->exp); } - afterdecimal = (-CW (sp->exp) > digits) ? -CW (sp->exp) : digits; + afterdecimal = (-BigEndianValue (sp->exp) > digits) ? -BigEndianValue (sp->exp) : digits; if (sp->sgn) { dp[1] = '-'; i = 1; @@ -149,7 +150,7 @@ P5(PUBLIC pascal trap, void, ROMlib_Fxstr2dec, Decstr volatile, sp2, { int index, expsgn, implicitexp; - index = CW (*sp); + index = BigEndianValue (*sp); warning_floating_point ("xstr2dec(\"%.*s\")", lastchar - index + 1, (const char *) sp2 + index); while (((sp2[index] == ' ')||(sp2[index] == '\t')) && (index <= lastchar)) @@ -183,7 +184,7 @@ P5(PUBLIC pascal trap, void, ROMlib_Fxstr2dec, Decstr volatile, sp2, dp2->sig[1] = 'N'; /*-->*/ goto abortlookahead; /* should I use a break or return instead? */ } - *sp = CW (index); /* The base is legit. Check exponent. */ + *sp = BigEndianValue (index); /* The base is legit. Check exponent. */ dp2->exp = CWC (0); if (LOWER(sp2[index]) == 'e') { index++; @@ -199,25 +200,25 @@ P5(PUBLIC pascal trap, void, ROMlib_Fxstr2dec, Decstr volatile, sp2, /*-->*/ goto abortlookahead; /* should I use a break or return instead? */ } while (isdigit(sp2[index]) && (index <= lastchar)) { - INTEGER newexp = CW (dp2->exp); + INTEGER newexp = BigEndianValue (dp2->exp); newexp *= 10; newexp += sp2[index] - '0'; - dp2->exp = CW (newexp); + dp2->exp = BigEndianValue (newexp); index++; } if (expsgn) - dp2->exp = CW (-1 * CW (dp2->exp)); + dp2->exp = BigEndianValue (-1 * BigEndianValue (dp2->exp)); } - *sp = CW (index); + *sp = BigEndianValue (index); abortlookahead: - dp2->exp = CW (CW (dp2->exp) + implicitexp - dp2->sig[0]); + dp2->exp = BigEndianValue (BigEndianValue (dp2->exp) + implicitexp - dp2->sig[0]); *dp = CB (!sp2[index] || (index > lastchar)); while (dp2->sig[0] > 1 && dp2->sig[1] == '0') /* gunch leading */ memmove(dp2->sig+1, dp2->sig+2, --dp2->sig[0]); /* zeros */ warning_floating_point ("xstr2dec returning %s%.*s * 10**%d", dp2->sgn ? "-" : "", - dp2->sig[0], dp2->sig + 1, CW (dp2->exp)); + dp2->sig[0], dp2->sig + 1, BigEndianValue (dp2->exp)); } diff --git a/src/floatnext.cpp b/src/floatnext.cpp index 22296a6f..2f328045 100644 --- a/src/floatnext.cpp +++ b/src/floatnext.cpp @@ -13,6 +13,7 @@ char ROMlib_rcsid_floatnext[] = #include "rsys/floatconv.h" using namespace Executor; +using namespace ByteSwap; /* Subtracts one from the given multi-byte big endian unsigned number. */ static void @@ -77,9 +78,9 @@ P_SAVED0D1A0A1_3 (PUBLIC pascal trap, void, ROMlib_FnextX, /* Determine the classes of both X and Y. */ ROMlib_Fclassx (x, &x_class_swapped, sel); - x_class = CW (x_class_swapped); + x_class = BigEndianValue (x_class_swapped); ROMlib_Fclassx (y, &y_class_swapped, sel); - y_class = CW (y_class_swapped); + y_class = BigEndianValue (y_class_swapped); normalize_x80_p = FALSE; /* default, avoid gcc warnings. */ @@ -102,13 +103,13 @@ P_SAVED0D1A0A1_3 (PUBLIC pascal trap, void, ROMlib_FnextX, byte_size = 4; break; case FI_OPERAND: - xv = CW (*(short *)x); - yv = CW (*(short *)y); + xv = BigEndianValue (*(short *)x); + yv = BigEndianValue (*(short *)y); byte_size = 2; break; case FL_OPERAND: - xv = CL(*(long *)x); - yv = CL(*(long *)y); + xv = BigEndianValue(*(long *)x); + yv = BigEndianValue(*(long *)y); byte_size = 4; break; case FC_OPERAND: @@ -191,10 +192,10 @@ P_SAVED0D1A0A1_3 (PUBLIC pascal trap, void, ROMlib_FnextX, result = f32_to_ieee ((const f32_t *) x); break; case FI_OPERAND: - result = CW (*(short *)x); + result = BigEndianValue (*(short *)x); break; case FL_OPERAND: - result = CL (*(long *)x); + result = BigEndianValue (*(long *)x); break; case FC_OPERAND: result = comp_to_ieee ((const comp_t *) x); diff --git a/src/font.cpp b/src/font.cpp index 05171a62..e9254e41 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -22,6 +22,7 @@ char ROMlib_rcsid_font[] = #include "rsys/glue.h" using namespace Executor; +using namespace ByteSwap; #define MAXTABLES 12 @@ -48,7 +49,7 @@ P0(PUBLIC pascal trap, void, InitFonts) /* IMI-222 */ TheZone = saveZone; beenhere = TRUE; } - ApFontID = CW(Cx(SPFont) + 1); + ApFontID = BigEndianValue(Cx(SPFont) + 1); SysFontSiz = CWC(12); SysFontFam = 0; #if 0 @@ -99,9 +100,9 @@ P2(PUBLIC pascal trap, void, GetFontName, INTEGER, fnum, /* IMI-223 */ ResType rest; if (fnum == systemFont) - fnum = CW(SysFontFam); + fnum = BigEndianValue(SysFontFam); else if (fnum == applFont) - fnum = CW(ApFontID); + fnum = BigEndianValue(ApFontID); SetResLoad(FALSE); h = GetResource(TICK("FONT"), FONTRESID(fnum, 0)); if (!h) @@ -147,7 +148,7 @@ P2(PUBLIC pascal trap, void, GetFNum, StringPtr, fnam, /* IMI-223 */ if (ResError()) *fnum = 0; else if (shift) - *fnum =CW( CW(*(unsigned short *) fnum) >> 7); + *fnum =BigEndianValue( BigEndianValue(*(unsigned short *) fnum) >> 7); SetResLoad(TRUE); } @@ -292,15 +293,15 @@ A0(PRIVATE, INTEGER *, findfondwidths) retval = 0; if (STARH((FHandle) MR(LastFOND))->ffFamID == WIDTHPTR->aFID && - (offset = CL(STARH((FHandle)MR(LastFOND))->ffWTabOff))) { + (offset = BigEndianValue(STARH((FHandle)MR(LastFOND))->ffWTabOff))) { bitsmatched = -1; want = Cx(WIDTHPTR->aFace); /* * NOTE: we add 3 to lastchar - firstchar to include the missing character * entry and what appears to be a zero entry located thereafter. */ - tabsize = (CW(STARH((FHandle)MR(LastFOND))->ffLastChar) - - CW(STARH((FHandle)MR(LastFOND))->ffFirstChar) + 3) + tabsize = (BigEndianValue(STARH((FHandle)MR(LastFOND))->ffLastChar) - + BigEndianValue(STARH((FHandle)MR(LastFOND))->ffFirstChar) + 3) * sizeof(INTEGER) + sizeof(INTEGER); numentriesminusone = (INTEGER *) ((char *) &STARH((FHandle)MR(LastFOND))->ffFlags + offset); @@ -349,7 +350,7 @@ PRIVATE void buildtabdata(howtobuild_t howtobuild, INTEGER extra, WIDTHPTR->usedFam = 0; /* don't really know what this should be */ widp = &fp->owTLoc + Cx(fp->owTLoc) + (lastchar - firstchar + 2); fixed_extra = FIXED(extra); - misswidth = FIXED8(CW(widp[lastchar - firstchar + 1])) + fixed_extra; + misswidth = FIXED8(BigEndianValue(widp[lastchar - firstchar + 1])) + fixed_extra; /* NOTE: this assumes missing characters have the missing width in the table. If this is wrong we need to look for missing characters @@ -357,23 +358,23 @@ PRIVATE void buildtabdata(howtobuild_t howtobuild, INTEGER extra, for (c = 0, p = WIDTHPTR->tabData, ep = p + 256; p < ep; c++) { if (c < firstchar || c > lastchar) - *p++ = CL(misswidth); + *p++ = BigEndianValue(misswidth); else - *p++ = CL(FIXED8(CW(*widp++)) + fixed_extra); + *p++ = BigEndianValue(FIXED8(BigEndianValue(*widp++)) + fixed_extra); } break; case FontInt: WIDTHPTR->usedFam = 0; widp = &fp->owTLoc + Cx(fp->owTLoc); - misswidth = FIXED((CW(widp[lastchar - firstchar + 1]) & 0xFF) + extra); + misswidth = FIXED((BigEndianValue(widp[lastchar - firstchar + 1]) & 0xFF) + extra); for (c = 0, p = WIDTHPTR->tabData, ep = p + 256; p < ep; c++) { if (c < firstchar || c > lastchar) - *p++ = CL(misswidth); + *p++ = BigEndianValue(misswidth); else { *p++ = (width = *widp++) == -1 ? - CL(misswidth) + BigEndianValue(misswidth) : - CL(FIXED((CW(width) & 0xFF) + extra)); + BigEndianValue(FIXED((BigEndianValue(width) & 0xFF) + extra)); } } break; @@ -382,20 +383,20 @@ PRIVATE void buildtabdata(howtobuild_t howtobuild, INTEGER extra, hOutputInverse = FixRatio(1<<8, Cx(WIDTHPTR->hOutput)); widp = fondwidthtable; fixed_extra = FIXED(extra); - misswidth = FIXED4 (CW (widp[lastchar - firstchar + 1])); + misswidth = FIXED4 (BigEndianValue (widp[lastchar - firstchar + 1])); misswidth = font_width_expand (misswidth, fixed_extra, hOutputInverse); for (c = 0, p = WIDTHPTR->tabData, ep = p + 256; p < ep; c++) { if (c < firstchar || c > lastchar) - *p++ = CL(misswidth); + *p++ = BigEndianValue(misswidth); else { - *p++ = CL(FixMul(FIXED4(CW(*widp)) + fixed_extra, + *p++ = BigEndianValue(FixMul(FIXED4(BigEndianValue(*widp)) + fixed_extra, hOutputInverse)); widp++; } } break; } - WIDTHPTR->tabData[' '] = CL(Cx(WIDTHPTR->tabData[' ']) + + WIDTHPTR->tabData[' '] = BigEndianValue(Cx(WIDTHPTR->tabData[' ']) + Cx(WIDTHPTR->sExtra)); } @@ -438,25 +439,25 @@ A1(PRIVATE, void, buildtable, INTEGER, extra) denomh = Cx(WIDTHPTR->inDenom.h); denomv = Cx(WIDTHPTR->inDenom.v); if (WIDTHPTR->fSize == WIDTHPTR->aSize) { - WIDTHPTR->hOutput = CW(FixRatio(numerh, denomh) >> 8); - WIDTHPTR->vOutput = CW(FixRatio(numerv, denomv) >> 8); + WIDTHPTR->hOutput = BigEndianValue(FixRatio(numerh, denomh) >> 8); + WIDTHPTR->vOutput = BigEndianValue(FixRatio(numerv, denomv) >> 8); WIDTHPTR->hFactor = WIDTHPTR->vFactor = CWC(256); } else if (Cx(WIDTHPTR->fSize) < Cx(WIDTHPTR->aSize) && FScaleDisable) { - WIDTHPTR->hOutput = CW(FixRatio(numerh, denomh) >> 8); - WIDTHPTR->vOutput = CW(FixRatio(numerv, denomv) >> 8); + WIDTHPTR->hOutput = BigEndianValue(FixRatio(numerh, denomh) >> 8); + WIDTHPTR->vOutput = BigEndianValue(FixRatio(numerv, denomv) >> 8); WIDTHPTR->hFactor = - WIDTHPTR->vFactor = CW(FixRatio(Cx(WIDTHPTR->aSize), + WIDTHPTR->vFactor = BigEndianValue(FixRatio(Cx(WIDTHPTR->aSize), Cx(WIDTHPTR->fSize)) >> 8); } else { tempfix = FixRatio(Cx(WIDTHPTR->aSize), Cx(WIDTHPTR->fSize)); - WIDTHPTR->hOutput = CW(FixMul(tempfix, FixRatio(numerh, denomh)) >> 8); - WIDTHPTR->vOutput = CW(FixMul(tempfix, FixRatio(numerv, denomv)) >> 8); + WIDTHPTR->hOutput = BigEndianValue(FixMul(tempfix, FixRatio(numerh, denomh)) >> 8); + WIDTHPTR->vOutput = BigEndianValue(FixMul(tempfix, FixRatio(numerv, denomv)) >> 8); WIDTHPTR->hFactor = WIDTHPTR->vFactor = CWC(256); } #if 0 /* WTF is going on here? */ - WIDTHPTR->style = CW(extra); + WIDTHPTR->style = BigEndianValue(extra); #endif buildtabdata(howtobuild, extra, fondwidthtable); @@ -564,7 +565,7 @@ A0(PRIVATE, INTEGER, closestface) /* no args, uses WIDTHPTR */ ip = &STARH((FHandle)MR(LastFOND))->ffVersion + 1; nmatch = -1; want = Cx(WIDTHPTR->aFace); - for (p = (fatabentry *) (ip + 1), ep = p + CW(*ip) + 1; + for (p = (fatabentry *) (ip + 1), ep = p + BigEndianValue(*ip) + 1; p < ep && Cx(p->size) <= size; p++) { if (!bestp) bestp = p; /* pick something */ @@ -603,7 +604,7 @@ at_least_one_fond_entry (INTEGER family) * TODO: NFNT below */ -#define AVAILABLE(x) (WIDTHPTR->fSize = CW((x)), WIDTHPTR->tabFont = \ +#define AVAILABLE(x) (WIDTHPTR->fSize = BigEndianValue((x)), WIDTHPTR->tabFont = \ RM(GetResource(TICK("FONT"), FONTRESID(family, (x))))) A1(PRIVATE, void, newwidthtable, FMInput *, fmip) @@ -681,25 +682,25 @@ A1(PRIVATE, void, newwidthtable, FMInput *, fmip) WIDTHPTR->tabFont = 0; while (!WIDTHPTR->tabFont && n_tried_sys_font < 2) { WIDTHPTR->fHand = RM((Handle) fh); - WIDTHPTR->fID = CW(family); + WIDTHPTR->fID = BigEndianValue(family); if (fh) { LastFOND = RM((FamRecHandle) fh); findclosestfond(fh, Cx(fmip->size), &powerof2, &lesser, &greater); if (powerof2 == Cx(fmip->size)) - WIDTHPTR->fSize = CW(powerof2); + WIDTHPTR->fSize = BigEndianValue(powerof2); else { if (FScaleDisable) - WIDTHPTR->fSize = lesser ? CW(lesser) : CW(greater); + WIDTHPTR->fSize = lesser ? BigEndianValue(lesser) : BigEndianValue(greater); else { if (powerof2) - WIDTHPTR->fSize = CW(powerof2); + WIDTHPTR->fSize = BigEndianValue(powerof2); else { if (!greater || (lesser && Cx(fmip->size) - lesser <= greater - Cx(fmip->size))) - WIDTHPTR->fSize = CW(lesser); + WIDTHPTR->fSize = BigEndianValue(lesser); else - WIDTHPTR->fSize = CW(greater); + WIDTHPTR->fSize = BigEndianValue(greater); } } } @@ -721,7 +722,7 @@ A1(PRIVATE, void, newwidthtable, FMInput *, fmip) if (!AVAILABLE(Cx(fmip->size))) { if (FScaleDisable) { findclosestfont(family, Cx(fmip->size), &lesser, &greater); - WIDTHPTR->fSize = lesser ? CW(lesser) : CW(greater); + WIDTHPTR->fSize = lesser ? BigEndianValue(lesser) : BigEndianValue(greater); WIDTHPTR->tabFont = RM(GetResource(TICK("FONT"), FONTRESID(family, Cx(WIDTHPTR->fSize)))); } else { @@ -730,9 +731,9 @@ A1(PRIVATE, void, newwidthtable, FMInput *, fmip) findclosestfont(family, Cx(fmip->size), &lesser, &greater); if (lesser && (Cx(fmip->size) - lesser <= greater - Cx(fmip->size))) - WIDTHPTR->fSize = CW(lesser); + WIDTHPTR->fSize = BigEndianValue(lesser); else - WIDTHPTR->fSize = CW(greater); + WIDTHPTR->fSize = BigEndianValue(greater); WIDTHPTR->tabFont = RM(GetResource(TICK("FONT"), FONTRESID(family, Cx(WIDTHPTR->fSize)))); } @@ -818,10 +819,10 @@ P1(PUBLIC pascal trap, FMOutPtr, FMSwapFont, FMInput *, fmip) /* IMI-223 */ ROMlib_fmo.ulThick = 0; ROMlib_fmo.shadow = 0; ROMlib_fmo.extra = 0; - ROMlib_fmo.numer.h = CW( + ROMlib_fmo.numer.h = BigEndianValue( (LONGINT) Cx(fmip->numer.h) * 256 * Cx(fmip->size) / Cx(fmip->denom.h) / Cx(WIDTHPTR->fSize)); - ROMlib_fmo.numer.v = CW( + ROMlib_fmo.numer.v = BigEndianValue( (LONGINT) Cx(fmip->numer.v) * 256 * Cx(fmip->size) / Cx(fmip->denom.v) / Cx(WIDTHPTR->fSize)); ROMlib_fmo.denom.h = CWC(256); @@ -855,11 +856,11 @@ P1(PUBLIC pascal trap, FMOutPtr, FMSwapFont, FMInput *, fmip) /* IMI-223 */ * characters. This will cause serious trouble when we allocate * too small a bitmap */ - ROMlib_fmo.ascent = CW(fp->ascent) + !!ROMlib_fmo.shadow; - ROMlib_fmo.descent = CW(fp->descent) + ROMlib_fmo.shadow; - ROMlib_fmo.widMax = CW(fp->widMax) + !!ROMlib_fmo.shadow + + ROMlib_fmo.ascent = BigEndianValue(fp->ascent) + !!ROMlib_fmo.shadow; + ROMlib_fmo.descent = BigEndianValue(fp->descent) + ROMlib_fmo.shadow; + ROMlib_fmo.widMax = BigEndianValue(fp->widMax) + !!ROMlib_fmo.shadow + ROMlib_fmo.shadow + ROMlib_fmo.bold; - ROMlib_fmo.leading = CW(fp->leading); + ROMlib_fmo.leading = BigEndianValue(fp->leading); } else { LoadResource(MR(ROMlib_fmo.fontHandle)); WidthPtr = (*MR(WidthTabHandle)).p; @@ -871,7 +872,7 @@ P1(PUBLIC pascal trap, FMOutPtr, FMSwapFont, FMInput *, fmip) /* IMI-223 */ return &ROMlib_fmo; } -#define SCALE(x) FixRatio(x * CW(fmop->numer.v), CW(fmop->denom.v)) +#define SCALE(x) FixRatio(x * BigEndianValue(fmop->numer.v), BigEndianValue(fmop->denom.v)) P1(PUBLIC pascal trap, void, FontMetrics, FMetricRec *, metrp) /* IMIV-32 */ { @@ -893,10 +894,10 @@ P1(PUBLIC pascal trap, void, FontMetrics, FMetricRec *, metrp) /* IMIV-32 */ /* TODO: check out thePort->device and use the FOND stuff if not going to the screen */ - metrp->ascent = CL(SCALE(Cx(fmop->ascent))); - metrp->descent = CL(SCALE(Cx(fmop->descent))); - metrp->leading = CL(SCALE(Cx(fmop->leading))); - metrp->widMax = CL(SCALE(Cx(fmop->widMax))); + metrp->ascent = BigEndianValue(SCALE(Cx(fmop->ascent))); + metrp->descent = BigEndianValue(SCALE(Cx(fmop->descent))); + metrp->leading = BigEndianValue(SCALE(Cx(fmop->leading))); + metrp->widMax = BigEndianValue(SCALE(Cx(fmop->widMax))); metrp->wTabHandle = (Handle) WidthTabHandle; } diff --git a/src/gensplash.cpp b/src/gensplash.cpp index 1bef6c5b..1878d93d 100644 --- a/src/gensplash.cpp +++ b/src/gensplash.cpp @@ -106,9 +106,9 @@ ppm_read_write_bits (int height, int width, int row_bytes, fscanf (fp, "%d %d %d", &red, &green, &blue); - color.red = CW ((red * 65535) / max_cmp_value); - color.green = CW ((green * 65535) / max_cmp_value); - color.blue = CW ((blue * 65535) / max_cmp_value); + color.red = BigEndianValue ((red * 65535) / max_cmp_value); + color.green = BigEndianValue ((green * 65535) / max_cmp_value); + color.blue = BigEndianValue ((blue * 65535) / max_cmp_value); pixel = (pixel << bpp) | color_pixel (&color); } @@ -248,13 +248,13 @@ output file `%s'\n", &top, &left, &bottom, &right); rect = &header.button_rects[i]; - rect->top = CW (top); - rect->left = CW (left); - rect->bottom = CW (bottom); - rect->right = CW (right); + rect->top = BigEndianValue (top); + rect->left = BigEndianValue (left); + rect->bottom = BigEndianValue (bottom); + rect->right = BigEndianValue (right); } - header.n_buttons = CW (n_buttons); + header.n_buttons = BigEndianValue (n_buttons); } init_color_buf (); @@ -265,9 +265,9 @@ output file `%s'\n", fscanf (paramfp, "bk_color %d %d %d", &red, &green, &blue); - color.red = CW (red); - color.green = CW (green); - color.blue = CW (blue); + color.red = BigEndianValue (red); + color.green = BigEndianValue (green); + color.blue = BigEndianValue (blue); header.bg_pixel = color_pixel (&color); } @@ -343,20 +343,20 @@ output file `%s'\n", ppm_read_write_bits (button_height, button_width, button_row_bytes, buttonfp, button_bits); - header.button_height = CW (button_height); - header.button_y = CW (splash_height - 12 - button_height); - header.button_x_byte = CW ((splash_width - 16 - button_width) + header.button_height = BigEndianValue (button_height); + header.button_y = BigEndianValue (splash_height - 12 - button_height); + header.button_x_byte = BigEndianValue ((splash_width - 16 - button_width) >> (3 - log2_bpp)); - header.button_row_bytes = CL (button_row_bytes); + header.button_row_bytes = BigEndianValue (button_row_bytes); - header.bpp = CL (bpp); - header.log2_bpp = CL (log2_bpp); + header.bpp = BigEndianValue (bpp); + header.log2_bpp = BigEndianValue (log2_bpp); - header.color_count = CL (1 << bpp); + header.color_count = BigEndianValue (1 << bpp); - header.color_offset = CL (sizeof header); - header.splash_bits_offset = CL (sizeof header + (sizeof *color_buf << bpp)); - header.button_bits_offset = CL (CL (header.splash_bits_offset) + header.color_offset = BigEndianValue (sizeof header); + header.splash_bits_offset = BigEndianValue (sizeof header + (sizeof *color_buf << bpp)); + header.button_bits_offset = BigEndianValue (BigEndianValue (header.splash_bits_offset) + splash_row_bytes * splash_height); retval = write (outfd, &header, sizeof header); diff --git a/src/gestalt.cpp b/src/gestalt.cpp index 1591e832..ac0601e5 100644 --- a/src/gestalt.cpp +++ b/src/gestalt.cpp @@ -21,6 +21,7 @@ char ROMlib_rcsid_gestalt[] = #include "rsys/vdriver.h" using namespace Executor; +using namespace ByteSwap; typedef struct { @@ -385,7 +386,7 @@ gestalt_helper(OSType selector, LONGINT *responsep, BOOLEAN searchlist, else { retval = noErr; - *responsep = CL (gep->value); + *responsep = BigEndianValue (gep->value); } } } @@ -396,7 +397,7 @@ gestalt_helper(OSType selector, LONGINT *responsep, BOOLEAN searchlist, (selector >> 16) & 0xFF, (selector >> 8) & 0xFF, (selector) & 0xFF, - CL (*responsep), + BigEndianValue (*responsep), retval); return retval; @@ -464,7 +465,7 @@ Executor::ROMlib_add_to_gestalt_list (OSType selector, OSErr retval, uint32 new_ entryp = (typeof (entryp)) ((char *) gestalt_listp + listp_size); entryp->selector = selector; entryp->retval = retval; - entryp->value = CL (new_value); + entryp->value = BigEndianValue (new_value); listp_size += sizeof *gestalt_listp; } } diff --git a/src/hfsBtree.cpp b/src/hfsBtree.cpp index 19d97de3..3bfb3b70 100644 --- a/src/hfsBtree.cpp +++ b/src/hfsBtree.cpp @@ -75,6 +75,7 @@ char ROMlib_rcsid_hfsBtree[] = #include "rsys/hfs_plus.h" using namespace Executor; +using namespace ByteSwap; #if 0 PUBLIC ULONGINT blockchecksum(void *blockp) @@ -100,17 +101,17 @@ PRIVATE void checkcache(short refnum) return; printf("\n"); - fcbp = (filecontrolblock *)((char *)CL(FCBSPtr) + refnum); - vcbp = CL(fcbp->fcbVPtr); - headp = (cachehead *) CL(vcbp->vcbCtlBuf); + fcbp = (filecontrolblock *)((char *)BigEndianValue(FCBSPtr) + refnum); + vcbp = BigEndianValue(fcbp->fcbVPtr); + headp = (cachehead *) BigEndianValue(vcbp->vcbCtlBuf); printf("headp = 0x%lx, nitems = %d, flink = 0x%lx, blink = 0x%lx\n", - headp, CW(headp->nitems), CL(headp->flink), CL(headp->blink)); - for (i = CW(headp->nitems), cachep = CL(headp->flink); --i >= -3; - cachep = CL(cachep->flink)) + headp, BigEndianValue(headp->nitems), BigEndianValue(headp->flink), BigEndianValue(headp->blink)); + for (i = BigEndianValue(headp->nitems), cachep = BigEndianValue(headp->flink); --i >= -3; + cachep = BigEndianValue(cachep->flink)) printf("0x%lx:0x%x ", cachep, cachep->flags); printf("\n\n"); - for (i = CW(headp->nitems), cachep = CL(headp->blink); --i >= -3; - cachep = CL(cachep->blink)) + for (i = BigEndianValue(headp->nitems), cachep = BigEndianValue(headp->blink); --i >= -3; + cachep = BigEndianValue(cachep->blink)) printf("0x%lx ", cachep); printf("\n"); } @@ -123,7 +124,7 @@ PUBLIC cacheentry *Executor::ROMlib_addrtocachep(Ptr addr, HVCB *vcbp) INTEGER i; headp = (cachehead *) MR(vcbp->vcbCtlBuf); - for (i = CW(headp->nitems), retval = MR(headp->flink); --i >= 0 && + for (i = BigEndianValue(headp->nitems), retval = MR(headp->flink); --i >= 0 && (addr < (Ptr) retval || addr > (Ptr) retval + sizeof(cacheentry)); retval = MR(retval->flink)) ; @@ -132,7 +133,7 @@ PUBLIC cacheentry *Executor::ROMlib_addrtocachep(Ptr addr, HVCB *vcbp) #define BTENTRY(btp, n) \ ((anykey *)((char *) (btp) + \ - CW(((short *)((char *)(btp) + PHYSBSIZE - sizeof(short)))[-(n)]))) + BigEndianValue(((short *)((char *)(btp) + PHYSBSIZE - sizeof(short)))[-(n)]))) #define BTOFFSET(btp, n) \ ((short *)((char *)(btp) + PHYSBSIZE - sizeof(short))-(n)) @@ -164,8 +165,8 @@ PUBLIC OSErr Executor::ROMlib_errortype(btparam *btpb) if (retval == dirNFErr) warning_trace_info ("catkeyp->ckrParID = %d, " "btpb->tofind.catk.ckrParID = %d", - CL (catkeyp->ckrParID), - CL (btpb->tofind.catk.ckrParID)); + BigEndianValue (catkeyp->ckrParID), + BigEndianValue (btpb->tofind.catk.ckrParID)); fs_err_hook (retval); return retval; } @@ -188,17 +189,17 @@ PRIVATE void checkbtp(btnode *btp) INTEGER i; char keylen; - flink = CL(btp->ndFLink); - blink = CL(btp->ndBLink); + flink = BigEndianValue(btp->ndFLink); + blink = BigEndianValue(btp->ndBLink); switch (btp->ndType) { case indexnode: if (btp->ndLevel > 5) warning_unexpected ("level(%d) > 5 on indexnode", btp->ndLevel); offsetp = BTOFFSET(btp, 0); expected = sizeof(btnode); - for (i = CW(btp->ndNRecs)+1; --i >= 0; --offsetp) { - if (CW(*offsetp) != expected) - if (CW(*offsetp) < expected) + for (i = BigEndianValue(btp->ndNRecs)+1; --i >= 0; --offsetp) { + if (BigEndianValue(*offsetp) != expected) + if (BigEndianValue(*offsetp) < expected) warning_unexpected ("unexpected offset"); else warning_unexpected ("curiously large offset"); @@ -218,9 +219,9 @@ PRIVATE void checkbtp(btnode *btp) warning_unexpected ("level != 1 on leafnode"); offsetp = BTOFFSET(btp, 0); expected = sizeof(btnode); - for (i = CW(btp->ndNRecs)+1; --i >= 0; --offsetp) { - if (CW(*offsetp) != expected) - if (CW(*offsetp) < expected) + for (i = BigEndianValue(btp->ndNRecs)+1; --i >= 0; --offsetp) { + if (BigEndianValue(*offsetp) != expected) + if (BigEndianValue(*offsetp) < expected) warning_unexpected ("unexpected offset"); else warning_unexpected ("curiously large offset\n"); @@ -262,7 +263,7 @@ PUBLIC BOOLEAN Executor::ROMlib_searchnode(btnode *btp, void *key, compfp fp, #if defined (CATFILEDEBUG) checkbtp(btp); #endif /* CATFILEDEBUG */ - high = CW(btp->ndNRecs)-1; + high = BigEndianValue(btp->ndNRecs)-1; totest = BTENTRY(btp, high); /* test last one by hand then use as sentinel */ switch ((*fp)(key, totest)) { case firstisless: @@ -344,7 +345,7 @@ PUBLIC OSErr Executor::ROMlib_putcache(cacheentry *cachep) BufTgDate = Time; #endif err = ROMlib_transphysblk (&((VCBExtra *)vcbp)->u.hfs, - CL(cachep->physblock) * PHYSBSIZE, 1, + BigEndianValue(cachep->physblock) * PHYSBSIZE, 1, (Ptr) cachep->buf, writing, (LONGINT *) 0); vcbsync(vcbp); } @@ -387,20 +388,20 @@ PUBLIC OSErr Executor::ROMlib_getcache(cacheentry **retpp, uint16 refnum, ULONGI ROMlib_index_cached = FALSE; fcbp = (filecontrolblock *)((char *)MR(FCBSPtr) + refnum); vcbp = MR(fcbp->fcbVPtr); - filenum = CL(fcbp->fcbFlNum); + filenum = BigEndianValue(fcbp->fcbFlNum); forkwanted = fcbp->fcbMdRByt & RESOURCEBIT ? resourcefork : datafork; headp = (cachehead *) MR(vcbp->vcbCtlBuf); - count = CW(headp->nitems); + count = BigEndianValue(headp->nitems); lastp = 0; lastdirtyp = 0; lastfreep = 0; #if 1 badnesscount = 0; #endif - for (retval = MR(headp->flink); --count >= 0 && (CL(retval->logblk) != logbno || - CW(retval->refnum) != refnum || MR(retval->vptr) != vcbp || - CL(retval->fileno) != filenum || retval->forktype != forkwanted); + for (retval = MR(headp->flink); --count >= 0 && (BigEndianValue(retval->logblk) != logbno || + BigEndianValue(retval->refnum) != refnum || MR(retval->vptr) != vcbp || + BigEndianValue(retval->fileno) != filenum || retval->forktype != forkwanted); retval = MR(retval->flink)) { if (!(retval->flags & CACHEBUSY)) { if (retval->flags & CACHEDIRTY) { @@ -438,9 +439,9 @@ PUBLIC OSErr Executor::ROMlib_getcache(cacheentry **retpp, uint16 refnum, ULONGI makefirst(headp, retval); if (count < 0) { retval->vptr = RM(vcbp); - retval->fileno = CL(filenum); - retval->refnum = CW(refnum); - retval->logblk = CL(logbno); + retval->fileno = BigEndianValue(filenum); + retval->refnum = BigEndianValue(refnum); + retval->logblk = BigEndianValue(logbno); retval->flags = CACHEBUSY; retval->forktype = forkwanted; @@ -451,7 +452,7 @@ PUBLIC OSErr Executor::ROMlib_getcache(cacheentry **retpp, uint16 refnum, ULONGI fs_err_hook (err); return err; } - retval->physblock = CL(physbyte / PHYSBSIZE); + retval->physblock = BigEndianValue(physbyte / PHYSBSIZE); if (!(flags&GETCACHENOREAD)) err = ROMlib_transphysblk(&((VCBExtra *)vcbp)->u.hfs, physbyte, 1, (Ptr) retval->buf, reading, @@ -482,7 +483,7 @@ PUBLIC void Executor::ROMlib_checkleaves(INTEGER refnum) if (err != noErr) warning_unexpected ("getcache error"); block0p = (btblock0 *) block0cachep->buf; - node = CL(block0p->firstleaf); + node = BigEndianValue(block0p->firstleaf); expectedblink = 0; while (node != 0) { err = ROMlib_getcache(&cachep, refnum, node, 0); @@ -492,12 +493,12 @@ PUBLIC void Executor::ROMlib_checkleaves(INTEGER refnum) #if defined (CATFILEDEBUG) checkbtp(btp); #endif /* CATFILEDEBUG */ - if (CL(btp->ndBLink) != expectedblink) + if (BigEndianValue(btp->ndBLink) != expectedblink) warning_unexpected ("bad blink"); expectedblink = node; - node = CL(btp->ndFLink); + node = BigEndianValue(btp->ndFLink); } - if (CL(block0p->lastleaf) != expectedblink) + if (BigEndianValue(block0p->lastleaf) != expectedblink) warning_unexpected ("bad block0p->blink"); } #endif /* CATFILEDEBUG */ @@ -511,7 +512,7 @@ PUBLIC OSErr Executor::ROMlib_cleancache(HVCB *vcbp) headp = (cachehead *) MR(vcbp->vcbCtlBuf); err = noErr; - for (i = CW(headp->nitems), cachep = (cacheentry *) (headp + 1); --i >= 0; + for (i = BigEndianValue(headp->nitems), cachep = (cacheentry *) (headp + 1); --i >= 0; ++cachep) { if (MR(cachep->vptr) == vcbp) cachep->flags &= ~CACHEBUSY; @@ -531,7 +532,7 @@ PUBLIC OSErr Executor::ROMlib_flushcachevcbp(HVCB *vcbp) err = noErr; if (headp) { - for (i = CW(headp->nitems), cachep = (cacheentry *) (headp + 1); + for (i = BigEndianValue(headp->nitems), cachep = (cacheentry *) (headp + 1); --i >= 0; ++cachep) { if (MR(cachep->vptr) == vcbp && (cachep->flags & CACHEDIRTY)) @@ -578,7 +579,7 @@ PUBLIC OSErr Executor::ROMlib_keyfind(btparam *btpb) btpb->leafindex = 0; return noErr; } - node = CL(((btblock0 *)cachep->buf)->root); + node = BigEndianValue(((btblock0 *)cachep->buf)->root); tep->logbno = 0; tep++->cachep = cachep; #if !defined (LETGCCWAIL) @@ -603,7 +604,7 @@ PUBLIC OSErr Executor::ROMlib_keyfind(btparam *btpb) found = ROMlib_searchnode((btnode *)cachep->buf, &btpb->tofind, btpb->fp, &btpb->foundp, (INTEGER *) &tep->after); if (type == indexnode) - node = CL(*(LONGINT *) DATAPFROMKEY(btpb->foundp)); + node = BigEndianValue(*(LONGINT *) DATAPFROMKEY(btpb->foundp)); else { btpb->leafindex = tep - btpb->trail; btpb->success = found; @@ -632,14 +633,14 @@ PUBLIC OSErr Executor::ROMlib_btnext(anykey **nextpp, anykey *keyp, HVCB *vcbp) cachep = ROMlib_addrtocachep((Ptr) keyp, vcbp); btp = (btnode *) cachep->buf; - for (i = CW(btp->ndNRecs); --i >= 0 && BTENTRY(btp, i) != keyp;) + for (i = BigEndianValue(btp->ndNRecs); --i >= 0 && BTENTRY(btp, i) != keyp;) ; if (i < 0) retval = 0; - else if (i < CW(btp->ndNRecs) - 1) + else if (i < BigEndianValue(btp->ndNRecs) - 1) retval = BTENTRY(btp, i+1); - else if ((node = CL(btp->ndFLink))) { - err = ROMlib_getcache(&cachep, CW(cachep->refnum), node, (cacheflagtype)0); + else if ((node = BigEndianValue(btp->ndFLink))) { + err = ROMlib_getcache(&cachep, BigEndianValue(cachep->refnum), node, (cacheflagtype)0); if (err != noErr) { fs_err_hook (err); @@ -672,15 +673,15 @@ PRIVATE OSErr MapBitSetOrClr(cacheentry *block0cachep, LONGINT bit, INTEGER nrecs, nmapnodes; OSErr err; - refnum = CW(block0cachep->refnum); + refnum = BigEndianValue(block0cachep->refnum); cachep = block0cachep; block0p = (btblock0 *) block0cachep->buf; - nnodes = CL(block0p->nnodes); + nnodes = BigEndianValue(block0p->nnodes); gui_assert(bit < nnodes); btp = (btnode *) block0p; done = FALSE; do { - nrecs = CW(btp->ndNRecs); + nrecs = BigEndianValue(btp->ndNRecs); mapstart = (unsigned char *) BTENTRY(btp, nrecs-1); mapend = (unsigned char *) BTENTRY(btp, nrecs); nmapnodes = (mapend - mapstart) * 8; @@ -694,7 +695,7 @@ PRIVATE OSErr MapBitSetOrClr(cacheentry *block0cachep, LONGINT bit, } else { if (btp->ndFLink) { bit -= nmapnodes; - err = ROMlib_getcache(&cachep, refnum, CL(btp->ndFLink), (cacheflagtype)0); + err = ROMlib_getcache(&cachep, refnum, BigEndianValue(btp->ndFLink), (cacheflagtype)0); if (err != noErr) { fs_err_hook (err); @@ -727,23 +728,23 @@ PRIVATE OSErr add_free_nodes(cacheentry *block0cachep, ULONGINT n_new_nodes) OSErr err; cacheentry *oldcachep; - refnum = CW(block0cachep->refnum); + refnum = BigEndianValue(block0cachep->refnum); block0p = (btblock0 *) block0cachep->buf; - nnodes = CL(block0p->nnodes); + nnodes = BigEndianValue(block0p->nnodes); first_free_node = nnodes; btp = (btnode *) block0p; oldcachep = block0cachep; done = FALSE; - block0p->nnodes = CL(nnodes + n_new_nodes); + block0p->nnodes = BigEndianValue(nnodes + n_new_nodes); do { - nrecs = CW(btp->ndNRecs); + nrecs = BigEndianValue(btp->ndNRecs); mapstart = (unsigned char *) BTENTRY(btp, nrecs-1); mapend = (unsigned char *) BTENTRY(btp, nrecs); nmapnodes = (mapend - mapstart) * 8; if (nnodes + n_new_nodes > nmapnodes) { if (btp->ndFLink) { nnodes -= nmapnodes; - err = ROMlib_getcache(&newcachep, refnum, CL(btp->ndFLink), (cacheflagtype)0); + err = ROMlib_getcache(&newcachep, refnum, BigEndianValue(btp->ndFLink), (cacheflagtype)0); if (err != noErr) { fs_err_hook (err); @@ -760,7 +761,7 @@ PRIVATE OSErr add_free_nodes(cacheentry *block0cachep, ULONGINT n_new_nodes) /*-->*/ return err; } newbtp = (btnode *) newcachep->buf; - btp->ndFLink = CL(first_free_node); + btp->ndFLink = BigEndianValue(first_free_node); memset((char *) newbtp, 0, PHYSBSIZE); newbtp->ndType = CB(mapnode); /* 2 */ newbtp->ndNRecs = CWC(1); @@ -776,7 +777,7 @@ PRIVATE OSErr add_free_nodes(cacheentry *block0cachep, ULONGINT n_new_nodes) } else done = TRUE; } while (!done); - block0p->nfreenodes = CL(CL(block0p->nfreenodes) + n_new_nodes); + block0p->nfreenodes = BigEndianValue(BigEndianValue(block0p->nfreenodes) + n_new_nodes); return noErr; } @@ -811,15 +812,15 @@ PRIVATE OSErr MapFindFirstBitAndSet(cacheentry *block0cachep, ULONGINT retval; ULONGINT n; - refnum = CW(block0cachep->refnum); + refnum = BigEndianValue(block0cachep->refnum); cachep = block0cachep; block0p = (btblock0 *) block0cachep->buf; - nnodes = CL(block0p->nnodes); + nnodes = BigEndianValue(block0p->nnodes); btp = (btnode *) block0p; done = FALSE; retval = 0; do { - nrecs = CW(btp->ndNRecs); + nrecs = BigEndianValue(btp->ndNRecs); mapstart = (unsigned char *) BTENTRY(btp, nrecs-1); mapend = (unsigned char *) BTENTRY(btp, nrecs); nmapnodes = (mapend - mapstart) * 8; @@ -832,7 +833,7 @@ PRIVATE OSErr MapFindFirstBitAndSet(cacheentry *block0cachep, } else { if (btp->ndFLink) { retval += nmapnodes; - err = ROMlib_getcache(&cachep, refnum, CL(btp->ndFLink), (cacheflagtype)0); + err = ROMlib_getcache(&cachep, refnum, BigEndianValue(btp->ndFLink), (cacheflagtype)0); if (err != noErr) { fs_err_hook (err); @@ -859,7 +860,7 @@ PRIVATE OSErr deletenode(cacheentry *todeletep) OSErr err; INTEGER refnum; - refnum = CW(todeletep->refnum); + refnum = BigEndianValue(todeletep->refnum); err = ROMlib_getcache(&block0cachep, refnum, 0L, GETCACHESAVE); if (err != noErr) { @@ -871,16 +872,16 @@ PRIVATE OSErr deletenode(cacheentry *todeletep) #if defined (CATFILEDEBUG) checkbtp(btp); #endif /* CATFILEDEBUG */ - node = CL(todeletep->logblk); + node = BigEndianValue(todeletep->logblk); #if 0 if (btp->ndType == leafnode) { #endif - flink = CL(btp->ndFLink); - blink = CL(btp->ndBLink); - if (CL(block0p->firstleaf) == node) - block0p->firstleaf = CL(flink); - if (CL(block0p->lastleaf) == node) - block0p->lastleaf = CL(blink); + flink = BigEndianValue(btp->ndFLink); + blink = BigEndianValue(btp->ndBLink); + if (BigEndianValue(block0p->firstleaf) == node) + block0p->firstleaf = BigEndianValue(flink); + if (BigEndianValue(block0p->lastleaf) == node) + block0p->lastleaf = BigEndianValue(blink); if (blink) { err = ROMlib_getcache(&linkcachep, refnum, blink, (cacheflagtype)0); if (err != noErr) @@ -889,7 +890,7 @@ PRIVATE OSErr deletenode(cacheentry *todeletep) return err; } linkbtp = (btnode *) linkcachep->buf; - linkbtp->ndFLink = CL(flink); + linkbtp->ndFLink = BigEndianValue(flink); linkcachep->flags |= CACHEDIRTY; } if (flink) { @@ -900,13 +901,13 @@ PRIVATE OSErr deletenode(cacheentry *todeletep) return err; } linkbtp = (btnode *) linkcachep->buf; - linkbtp->ndBLink = CL(blink); + linkbtp->ndBLink = BigEndianValue(blink); linkcachep->flags |= CACHEDIRTY; } #if 0 } #endif - block0p->nfreenodes = CL(CL(block0p->nfreenodes) + 1); + block0p->nfreenodes = BigEndianValue(BigEndianValue(block0p->nfreenodes) + 1); MapBitSetOrClr(block0cachep, node, FALSE); block0cachep->flags |= CACHEDIRTY; memset(todeletep->buf, 0, PHYSBSIZE); @@ -917,8 +918,8 @@ PRIVATE OSErr deletenode(cacheentry *todeletep) typedef enum { leavealone, doleft, doright } whichnodetype; #define FREESIZE(btp) \ - (((char *) (btp) + PHYSBSIZE - (CW((btp)->ndNRecs)+1)*sizeof(short)) - \ - (char *) BTENTRY((btp), CW((btp)->ndNRecs))) + (((char *) (btp) + PHYSBSIZE - (BigEndianValue((btp)->ndNRecs)+1)*sizeof(short)) - \ + (char *) BTENTRY((btp), BigEndianValue((btp)->ndNRecs))) #define SIZECUTOFF ((PHYSBSIZE - (int) sizeof(btnode)) / 2) @@ -941,21 +942,21 @@ PRIVATE OSErr merge(cacheentry *leftp, cacheentry *rightp) checkbtp(leftbtp); checkbtp(rightbtp); #endif - nrecs = CW(rightbtp->ndNRecs); + nrecs = BigEndianValue(rightbtp->ndNRecs); datastart = (char *) BTENTRY(rightbtp, 0); datastop = (char *) BTENTRY(rightbtp, nrecs); datasize = datastop - datastart; - memmove(BTENTRY(leftbtp, CW(leftbtp->ndNRecs)), datastart, datasize); + memmove(BTENTRY(leftbtp, BigEndianValue(leftbtp->ndNRecs)), datastart, datasize); - offsetp = BTOFFSET(leftbtp, CW(leftbtp->ndNRecs)); + offsetp = BTOFFSET(leftbtp, BigEndianValue(leftbtp->ndNRecs)); n = 0; for (i = nrecs, n = 0; --i >= 0; ++n) { - offsetp[-1] = CW(CW(offsetp[0]) + (char *) BTENTRY(rightbtp, n+1) - + offsetp[-1] = BigEndianValue(BigEndianValue(offsetp[0]) + (char *) BTENTRY(rightbtp, n+1) - (char *) BTENTRY(rightbtp, n)); --offsetp; } - leftbtp->ndNRecs = CW(CW(leftbtp->ndNRecs) + (nrecs)); + leftbtp->ndNRecs = BigEndianValue(BigEndianValue(leftbtp->ndNRecs) + (nrecs)); if (!(rightp->flags & CACHEBUSY)) warning_unexpected ("not busy"); if (!(leftp->flags & CACHEBUSY)) @@ -994,7 +995,7 @@ PRIVATE OSErr shuffle(cacheentry *leftp, cacheentry *rightp) if (leftfreesize < rightfreesize) { /* copy from left to right; almost the same code as below */ /* NOTE: if you find a bug here, look for a similar bug below */ - n = CW(leftbtp->ndNRecs) - 1; + n = BigEndianValue(leftbtp->ndNRecs) - 1; while (rightfreesize > SIZECUTOFF) { numtocopy++; recstart = (char *) BTENTRY(leftbtp, n); @@ -1004,28 +1005,28 @@ PRIVATE OSErr shuffle(cacheentry *leftp, cacheentry *rightp) rightfreesize -= sizeof(INTEGER) + recsize; --n; } - rightdatasize = (char *) BTENTRY(rightbtp, CW(rightbtp->ndNRecs)) - + rightdatasize = (char *) BTENTRY(rightbtp, BigEndianValue(rightbtp->ndNRecs)) - rightbtentry0; memmove(rightbtentry0+bytestoshift, rightbtentry0, rightdatasize); memmove(rightbtentry0, recstart, bytestoshift); - offsetp = BTOFFSET(rightbtp, CW(rightbtp->ndNRecs) + numtocopy); - for (i = CW(rightbtp->ndNRecs); --i >= 0;) { - offsetp[0] = CW(CW(offsetp[numtocopy]) + bytestoshift); + offsetp = BTOFFSET(rightbtp, BigEndianValue(rightbtp->ndNRecs) + numtocopy); + for (i = BigEndianValue(rightbtp->ndNRecs); --i >= 0;) { + offsetp[0] = BigEndianValue(BigEndianValue(offsetp[numtocopy]) + bytestoshift); ++offsetp; } offsetp = BTOFFSET(rightbtp, 0); ++n; for (i = numtocopy; --i >= 0;) { - offsetp[-1] = CW(CW(offsetp[0]) + (char *) BTENTRY(leftbtp, n+1) - + offsetp[-1] = BigEndianValue(BigEndianValue(offsetp[0]) + (char *) BTENTRY(leftbtp, n+1) - (char *) BTENTRY(leftbtp, n)); --offsetp; ++n; } - leftbtp ->ndNRecs = CW(CW(leftbtp ->ndNRecs) - (numtocopy)); - rightbtp->ndNRecs = CW(CW(rightbtp->ndNRecs) + (numtocopy)); + leftbtp ->ndNRecs = BigEndianValue(BigEndianValue(leftbtp ->ndNRecs) - (numtocopy)); + rightbtp->ndNRecs = BigEndianValue(BigEndianValue(rightbtp->ndNRecs) + (numtocopy)); } else { /* copy from right to left; almost the same code as above */ /* NOTE: if you find a bug here, look for a similar bug above */ @@ -1039,29 +1040,29 @@ PRIVATE OSErr shuffle(cacheentry *leftp, cacheentry *rightp) leftfreesize -= sizeof(INTEGER) + recsize; ++n; } - rightdatasize = (char *) BTENTRY(rightbtp, CW(rightbtp->ndNRecs)) - + rightdatasize = (char *) BTENTRY(rightbtp, BigEndianValue(rightbtp->ndNRecs)) - recend; - memmove(BTENTRY(leftbtp, CW(leftbtp->ndNRecs)), + memmove(BTENTRY(leftbtp, BigEndianValue(leftbtp->ndNRecs)), rightbtentry0, bytestoshift); memmove(rightbtentry0, recend, rightdatasize); - offsetp = BTOFFSET(leftbtp, CW(leftbtp->ndNRecs)); + offsetp = BTOFFSET(leftbtp, BigEndianValue(leftbtp->ndNRecs)); n = 0; for (i = numtocopy; --i >= 0;) { - offsetp[-1] = CW(CW(offsetp[0]) + (char *) BTENTRY(rightbtp, n+1) - + offsetp[-1] = BigEndianValue(BigEndianValue(offsetp[0]) + (char *) BTENTRY(rightbtp, n+1) - (char *) BTENTRY(rightbtp, n)); --offsetp; ++n; } offsetp = BTOFFSET(rightbtp, 1); - for (i = CW(rightbtp->ndNRecs) - numtocopy; --i >= 0;) { - offsetp[0] = CW(CW(offsetp[-numtocopy]) - bytestoshift); + for (i = BigEndianValue(rightbtp->ndNRecs) - numtocopy; --i >= 0;) { + offsetp[0] = BigEndianValue(BigEndianValue(offsetp[-numtocopy]) - bytestoshift); --offsetp; } - rightbtp->ndNRecs = CW(CW(rightbtp->ndNRecs) - (numtocopy)); - leftbtp ->ndNRecs = CW(CW(leftbtp->ndNRecs) + (numtocopy)); + rightbtp->ndNRecs = BigEndianValue(BigEndianValue(rightbtp->ndNRecs) - (numtocopy)); + leftbtp ->ndNRecs = BigEndianValue(BigEndianValue(leftbtp->ndNRecs) + (numtocopy)); } #if defined (CATFILEDEBUG) @@ -1119,7 +1120,7 @@ PRIVATE OSErr pullout(cacheentry *selfcachep, INTEGER selfindex, modrightkey = FALSE; *todeletep = -1; btp = (btnode *) selfcachep->buf; - if (selfindex < 0 || selfindex >= CW(btp->ndNRecs)) { + if (selfindex < 0 || selfindex >= BigEndianValue(btp->ndNRecs)) { warning_unexpected ("fried selfindex"); err = fsDSIntErr; fs_err_hook (err); @@ -1134,16 +1135,16 @@ PRIVATE OSErr pullout(cacheentry *selfcachep, INTEGER selfindex, selfcachep->flags |= CACHEDIRTY; startp = (char *) BTENTRY(btp, selfindex); stopp = (char *) BTENTRY(btp, selfindex+1); - freep = (char *) BTENTRY(btp, CW(btp->ndNRecs)); + freep = (char *) BTENTRY(btp, BigEndianValue(btp->ndNRecs)); memmove(startp, stopp, freep - stopp); - ntoadjust = CW(btp->ndNRecs) - selfindex; + ntoadjust = BigEndianValue(btp->ndNRecs) - selfindex; offsetp = BTOFFSET(btp, selfindex); adjust = stopp - startp; while (--ntoadjust >= 0) { - *offsetp = CW(CW(offsetp[-1]) - adjust); + *offsetp = BigEndianValue(BigEndianValue(offsetp[-1]) - adjust); --offsetp; } - btp->ndNRecs = CW(CW(btp->ndNRecs) - 1); + btp->ndNRecs = BigEndianValue(BigEndianValue(btp->ndNRecs) - 1); if (selfindex == 0) modselfkey = TRUE; @@ -1163,11 +1164,11 @@ PRIVATE OSErr pullout(cacheentry *selfcachep, INTEGER selfindex, checkbtp(parentbtp); #endif /* CATFILEDEBUG */ if (parentindex > 0) - left = CL(*(LONGINT *)DATAPFROMKEY(BTENTRY(parentbtp, parentindex-1))); + left = BigEndianValue(*(LONGINT *)DATAPFROMKEY(BTENTRY(parentbtp, parentindex-1))); else left = -1; - if (parentindex < CW(parentbtp->ndNRecs) - 1) - right = CL(*(LONGINT *)DATAPFROMKEY(BTENTRY(parentbtp, parentindex+1))); + if (parentindex < BigEndianValue(parentbtp->ndNRecs) - 1) + right = BigEndianValue(*(LONGINT *)DATAPFROMKEY(BTENTRY(parentbtp, parentindex+1))); else right = -1; } else { @@ -1175,7 +1176,7 @@ PRIVATE OSErr pullout(cacheentry *selfcachep, INTEGER selfindex, right = -1; } if (left >= 0) { - err = ROMlib_getcache(&leftcachep, CW(selfcachep->refnum), left, GETCACHESAVE); + err = ROMlib_getcache(&leftcachep, BigEndianValue(selfcachep->refnum), left, GETCACHESAVE); if (err != noErr) { fs_err_hook (err); @@ -1200,7 +1201,7 @@ PRIVATE OSErr pullout(cacheentry *selfcachep, INTEGER selfindex, } } if (!done && right >= 0) { - err = ROMlib_getcache(&rightcachep, CW(selfcachep->refnum), right, + err = ROMlib_getcache(&rightcachep, BigEndianValue(selfcachep->refnum), right, GETCACHESAVE); if (err != noErr) { @@ -1291,8 +1292,8 @@ PRIVATE OSErr maketrailentrybusy(trailentry *tep, uint16 refnum) HVCB *SWvcbp; SWvcbp = ((filecontrolblock *)((char *)MR(FCBSPtr) + refnum))->fcbVPtr; - if (CW(tep->cachep->refnum) != refnum || - CL(tep->cachep->logblk) != tep->logbno || tep->cachep->vptr != SWvcbp) + if (BigEndianValue(tep->cachep->refnum) != refnum || + BigEndianValue(tep->cachep->logblk) != tep->logbno || tep->cachep->vptr != SWvcbp) err = ROMlib_getcache(&tep->cachep, refnum, tep->logbno, GETCACHESAVE); else { err = noErr; @@ -1321,7 +1322,7 @@ PRIVATE OSErr deleteroot(cacheentry *oldrootp, cacheentry *block0cachep) /* update height, root */ block0p = (btblock0 *) block0cachep->buf; - block0p->height = CW(CW(block0p->height) - 1); + block0p->height = BigEndianValue(BigEndianValue(block0p->height) - 1); block0p->root = *(ULONGINT *) DATAPFROMKEY(BTENTRY((btnode *) oldrootp->buf, 0)); if (!(block0cachep->flags & CACHEBUSY)) @@ -1358,7 +1359,7 @@ PRIVATE OSErr updatenumentries(cacheentry *block0cachep, INTEGER adjust) btblock0 *block0p; block0p = (btblock0 *) block0cachep->buf; - block0p->numentries = CL(CL(block0p->numentries) + (adjust)); + block0p->numentries = BigEndianValue(BigEndianValue(block0p->numentries) + (adjust)); if (!(block0cachep->flags & CACHEBUSY)) warning_unexpected ("not busy"); block0cachep->flags |= CACHEDIRTY; @@ -1394,7 +1395,7 @@ PUBLIC OSErr Executor::ROMlib_btdelete(btparam *btpb) tep = btpb->trail + btpb->leafindex; selfindex = tep->after; done = FALSE; - refnum = CW(btpb->trail[0].cachep->refnum); + refnum = BigEndianValue(btpb->trail[0].cachep->refnum); if (((btblock0 *)btpb->trail[0].cachep->buf)->numentries == CLC(1)) { err = maketrailentrybusy(&btpb->trail[1], refnum); if (err != noErr) @@ -1502,7 +1503,7 @@ PUBLIC OSErr Executor::ROMlib_makecatparam(btparam *btpb, HVCB *vcbp, LONGINT di btpb->vcbp = vcbp; retval = ROMlib_makecatkey((catkey *) &btpb->tofind, dirid, namelen, namep); btpb->fp = ROMlib_catcompare; - btpb->refnum = CW(vcbp->vcbCTRef); + btpb->refnum = BigEndianValue(vcbp->vcbCTRef); btpb->leafindex = -1; fs_err_hook (retval); return retval; @@ -1555,32 +1556,32 @@ PRIVATE OSErr valenceadjust(btparam *btpb, INTEGER toadjust, filekind kind) } if (err == noErr) { err = ROMlib_makecatparam(&btparamblock, btpb->vcbp, - CL(btpb->tofind.catk.ckrParID), 0, (Ptr) 0); + BigEndianValue(btpb->tofind.catk.ckrParID), 0, (Ptr) 0); if (err == noErr) err = ROMlib_keyfind(&btparamblock); if (err == noErr && btparamblock.success) { thdp = (threadrec *) DATAPFROMKEY(btparamblock.foundp); - err = ROMlib_makecatkey((catkey *) &btparamblock.tofind, CL(thdp->thdParID), + err = ROMlib_makecatkey((catkey *) &btparamblock.tofind, BigEndianValue(thdp->thdParID), thdp->thdCName[0], (Ptr) thdp->thdCName+1); /* don't need to remake btparamblock */ if (err == noErr) err = ROMlib_keyfind(&btparamblock); if (err == noErr && btparamblock.success) { drp = (directoryrec *) DATAPFROMKEY(btparamblock.foundp); - drp->dirVal = CW(CW(drp->dirVal) + (toadjust)); + drp->dirVal = BigEndianValue(BigEndianValue(drp->dirVal) + (toadjust)); err = ROMlib_dirtyleaf(drp, btpb->vcbp); if (err == noErr) { - *countadj = CL(CL(*countadj) + (toadjust)); + *countadj = BigEndianValue(BigEndianValue(*countadj) + (toadjust)); if (drp->dirDirID == CLC(2)) { if (kind == directory) btpb->vcbp->vcbNmRtDirs = - CW(CW(btpb->vcbp->vcbNmRtDirs) + toadjust); + BigEndianValue(BigEndianValue(btpb->vcbp->vcbNmRtDirs) + toadjust); else btpb->vcbp->vcbNmFls = - CW(CW(btpb->vcbp->vcbNmFls) + toadjust); + BigEndianValue(BigEndianValue(btpb->vcbp->vcbNmFls) + toadjust); } - btpb->vcbp->vcbFlags |= CW(VCBDIRTY); + btpb->vcbp->vcbFlags |= BigEndianValue(VCBDIRTY); } } else { if (err == noErr) { @@ -1625,7 +1626,7 @@ PUBLIC OSErr Executor::ROMlib_dirdelete(btparam *btpb) LONGINT dirid; drp = (directoryrec *) DATAPFROMKEY(btpb->foundp); - dirid = CL(drp->dirDirID); + dirid = BigEndianValue(drp->dirDirID); err = ROMlib_filedelete(btpb, directory); if (err == noErr) { /* nuke the thread record */ err = ROMlib_makecatkey((catkey *) &btpb->tofind, dirid, 0, (Ptr) 0); @@ -1652,7 +1653,7 @@ PRIVATE OSErr savebusybuffers(HVCB *vcbp, saverec_t ***savehandlep) OSErr err; headp = (cachehead *) MR(vcbp->vcbCtlBuf); - count = CW(headp->nitems); + count = BigEndianValue(headp->nitems); retval = (saverec_t **) NewHandle((Size) 0); if (retval == 0) @@ -1664,8 +1665,8 @@ PRIVATE OSErr savebusybuffers(HVCB *vcbp, saverec_t ***savehandlep) cursize = 0; for (cachep = MR(headp->flink); --count >= 0; cachep = MR(cachep->flink)) { if (cachep->flags & CACHEBUSY) { - tempsaverec.refnum = CW(cachep->refnum); - tempsaverec.logbno = CL(cachep->logblk); + tempsaverec.refnum = BigEndianValue(cachep->refnum); + tempsaverec.logbno = BigEndianValue(cachep->logblk); SetHandleSize((Handle) retval, cursize + sizeof(tempsaverec)); memmove((char *) MR(*retval) + cursize, &tempsaverec, sizeof(tempsaverec)); @@ -1708,11 +1709,11 @@ PRIVATE OSErr getfreenode(cacheentry **newcachepp, cacheentry *block0cachep) filecontrolblock *fcbp; saverec_t **busysave; - refnum = CW(block0cachep->refnum); + refnum = BigEndianValue(block0cachep->refnum); block0p = (btblock0 *) block0cachep->buf; if (block0p->nfreenodes == CLC(0)) { fcbp = (filecontrolblock *) ((char *)MR(FCBSPtr) + refnum); - iop.ioRefNum = CW(refnum); + iop.ioRefNum = BigEndianValue(refnum); iop.ioReqCount = fcbp->fcbClmpSize; /* We never add more than one extra mapping page, so we need @@ -1725,7 +1726,7 @@ PRIVATE OSErr getfreenode(cacheentry **newcachepp, cacheentry *block0cachep) max_bytes_we_can_map = (MAP_PAGE_MAP_END - MAP_PAGE_MAP_BEGIN) * 8 * PHYSBSIZE; - if (CL (iop.ioReqCount) > max_bytes_we_can_map) + if (BigEndianValue (iop.ioReqCount) > max_bytes_we_can_map) iop.ioReqCount = CLC (max_bytes_we_can_map); } @@ -1742,7 +1743,7 @@ PRIVATE OSErr getfreenode(cacheentry **newcachepp, cacheentry *block0cachep) MR(fcbp->fcbVPtr)->vcbFlags |= CWC(VCBDIRTY); ROMlib_flushvcbp(MR(fcbp->fcbVPtr)); /* just setting DIRTY isn't safe */ err1 = restorebusybuffers(busysave); - if (err == noErr || (err == dskFulErr && CL(iop.ioActCount) > 0)) + if (err == noErr || (err == dskFulErr && BigEndianValue(iop.ioActCount) > 0)) err = err1; fcbp->fcbMdRByt = flags; if (err != noErr) @@ -1750,7 +1751,7 @@ PRIVATE OSErr getfreenode(cacheentry **newcachepp, cacheentry *block0cachep) fs_err_hook (err); return err; } - nblocksalloced = CL(iop.ioActCount) / PHYSBSIZE; + nblocksalloced = BigEndianValue(iop.ioActCount) / PHYSBSIZE; if (nblocksalloced <= 0) { warning_unexpected ("nblocksalloced <= 0"); err = fsDSIntErr; @@ -1770,7 +1771,7 @@ PRIVATE OSErr getfreenode(cacheentry **newcachepp, cacheentry *block0cachep) fs_err_hook (err); /*-->*/ return err; } - block0p->nfreenodes = CL(CL(block0p->nfreenodes) - 1); + block0p->nfreenodes = BigEndianValue(BigEndianValue(block0p->nfreenodes) - 1); if (!(block0cachep->flags & CACHEBUSY)) warning_unexpected ("not busy"); block0cachep->flags |= CACHEDIRTY; @@ -1790,7 +1791,7 @@ PRIVATE OSErr getnewnode(cacheentry **newcachepp, cacheentry *leftp) INTEGER refnum; ULONGINT newnode, leftnode, flink; - refnum = CW(leftp->refnum); + refnum = BigEndianValue(leftp->refnum); err = ROMlib_getcache(&block0cachep, refnum, 0L, GETCACHESAVE); if (err != noErr) { @@ -1801,24 +1802,24 @@ PRIVATE OSErr getnewnode(cacheentry **newcachepp, cacheentry *leftp) err = getfreenode(&newcachep, block0cachep); *newcachepp = newcachep; newbtp = (btnode *) newcachep->buf; - newnode = CL(newcachep->logblk); + newnode = BigEndianValue(newcachep->logblk); leftbtp = (btnode *) leftp->buf; #if defined (CATFILEDEBUG) checkbtp(leftbtp); #endif /* CATFILEDEBUG */ - memmove(newbtp, leftbtp, (sizeof(CL(leftbtp->ndFLink)) - + sizeof(CL(leftbtp->ndBLink)) + memmove(newbtp, leftbtp, (sizeof(BigEndianValue(leftbtp->ndFLink)) + + sizeof(BigEndianValue(leftbtp->ndBLink)) + sizeof(leftbtp->ndType) + sizeof(leftbtp->ndLevel))); - leftnode = CL(leftp->logblk); - if (CL(block0p->lastleaf) == leftnode) - block0p->lastleaf = CL(newnode); - leftbtp->ndFLink = CL(newnode); + leftnode = BigEndianValue(leftp->logblk); + if (BigEndianValue(block0p->lastleaf) == leftnode) + block0p->lastleaf = BigEndianValue(newnode); + leftbtp->ndFLink = BigEndianValue(newnode); if (!(leftp->flags & CACHEBUSY)) warning_unexpected ("not busy"); leftp->flags |= CACHEDIRTY; - newbtp->ndBLink = CL(leftnode); - if ((flink = CL(newbtp->ndFLink))) { + newbtp->ndBLink = BigEndianValue(leftnode); + if ((flink = BigEndianValue(newbtp->ndFLink))) { err = ROMlib_getcache(&linkcachep, refnum, flink, (cacheflagtype)0); if (err != noErr) { @@ -1826,7 +1827,7 @@ PRIVATE OSErr getnewnode(cacheentry **newcachepp, cacheentry *leftp) return err; } linkbtp = (btnode *) linkcachep->buf; - linkbtp->ndBLink = CL(newnode); + linkbtp->ndBLink = BigEndianValue(newnode); linkcachep->flags |= CACHEDIRTY; } if (!(block0cachep->flags & CACHEBUSY)) @@ -1869,7 +1870,7 @@ PRIVATE OSErr slipin(cacheentry *cachep, INTEGER after, anykey *keyp, #endif /* CATFILEDEBUG */ vcbp = MR(cachep->vptr); firstoffset = (short *)((char *)btp + PHYSBSIZE) - 1; - nrecs = CW(btp->ndNRecs); + nrecs = BigEndianValue(btp->ndNRecs); keysize = EVENUP(((catkey *)keyp)->ckrKeyLen + 1); datasize = EVENUP(datasize); sizeneeded = keysize + datasize + sizeof(INTEGER); @@ -1882,10 +1883,10 @@ PRIVATE OSErr slipin(cacheentry *cachep, INTEGER after, anykey *keyp, memmove(keylocp, keyp, keysize); memmove(keylocp + keysize, data, datasize); for (i = nrecs - after, offsetp = &firstoffset[-nrecs - 1]; --i >= 0;) { - offsetp[0] = CW(CW(offsetp[1]) + datasize + keysize); + offsetp[0] = BigEndianValue(BigEndianValue(offsetp[1]) + datasize + keysize); ++offsetp; } - btp->ndNRecs = CW(CW(btp->ndNRecs) + 1); + btp->ndNRecs = BigEndianValue(BigEndianValue(btp->ndNRecs) + 1); if (cachepp) *cachepp = 0; if (!(cachep->flags & CACHEBUSY)) @@ -1904,7 +1905,7 @@ PRIVATE OSErr slipin(cacheentry *cachep, INTEGER after, anykey *keyp, fs_err_hook (err); return err; } - newnode = CL(newcachep->logblk); + newnode = BigEndianValue(newcachep->logblk); newbtp = (btnode *) newcachep->buf; if (cachepp) *cachepp = newcachep; @@ -1933,11 +1934,11 @@ PRIVATE OSErr slipin(cacheentry *cachep, INTEGER after, anykey *keyp, offsetp = (INTEGER *) ((char *)newbtp + PHYSBSIZE); for (i = noffsets; --i >= 0;) { --offsetp; - *offsetp = CW(CW(*offsetp) - shim); + *offsetp = BigEndianValue(BigEndianValue(*offsetp) - shim); } - newbtp->ndNRecs = CW(noffsets - 1); - btp->ndNRecs = CW(newfirst); + newbtp->ndNRecs = BigEndianValue(noffsets - 1); + btp->ndNRecs = BigEndianValue(newfirst); #if defined (CATFILEDEBUG) checkbtp(btp); @@ -1987,8 +1988,8 @@ PRIVATE OSErr makenewroot(cacheentry *leftp, cacheentry *rightp, newbtp->ndFLink = 0; newbtp->ndBLink = 0; newbtp->ndType = indexnode; - block0p->height = CW(CW(block0p->height) + 1); - newbtp->ndLevel = CW(block0p->height); + block0p->height = BigEndianValue(BigEndianValue(block0p->height) + 1); + newbtp->ndLevel = BigEndianValue(block0p->height); leftbtp = (btnode *) leftp->buf; if (rightp) { rightbtp = (btnode *) rightp->buf; @@ -2007,22 +2008,22 @@ PRIVATE OSErr makenewroot(cacheentry *leftp, cacheentry *rightp, block0p->root = newcachep->logblk; block0cachep->flags |= CACHEDIRTY; offsetp = BTOFFSET(newbtp, 0); - keylen = EVENUP(CW(block0p->indexkeylen) + 1); - offsetp[ 0] = CW(sizeof(btnode)); + keylen = EVENUP(BigEndianValue(block0p->indexkeylen) + 1); + offsetp[ 0] = BigEndianValue(sizeof(btnode)); keydst = (char *) BTENTRY(newbtp, 0); memmove(keydst, BTENTRY(leftbtp, 0), keylen); *keydst = keylen - 1; *(ULONGINT *)(keydst + keylen) = leftp->logblk; if (rightp) { --offsetp; - offsetp[0] = CW(CW(offsetp[1]) + keylen + sizeof(ULONGINT)); + offsetp[0] = BigEndianValue(BigEndianValue(offsetp[1]) + keylen + sizeof(ULONGINT)); keydst = (char *) BTENTRY(newbtp, 1); memmove(keydst, BTENTRY(rightbtp, 0), keylen); *keydst = keylen-1; *(ULONGINT *)(keydst + keylen) = rightp->logblk; } --offsetp; - offsetp[0] = CW(CW(offsetp[1]) + keylen + sizeof(ULONGINT)); + offsetp[0] = BigEndianValue(BigEndianValue(offsetp[1]) + keylen + sizeof(ULONGINT)); #if defined (CATFILEDEBUG) checkbtp(newbtp); checkbtp(leftbtp); @@ -2065,7 +2066,7 @@ PRIVATE OSErr makefirstentry(btparam *btpb, char *datap, INTEGER datasize) memmove(keydst, &btpb->tofind, keylen); memmove(keydst+keylen, datap, datasize); --offsetp; - offsetp[0] = CW(CW(offsetp[1]) + keylen + EVENUP(datasize)); + offsetp[0] = BigEndianValue(BigEndianValue(offsetp[1]) + keylen + EVENUP(datasize)); if (!(leafp->flags & CACHEBUSY)) warning_unexpected ("not busy"); leafp->flags |= CACHEDIRTY; @@ -2073,9 +2074,9 @@ PRIVATE OSErr makefirstentry(btparam *btpb, char *datap, INTEGER datasize) block0p->height = CWC(1); block0p->root = leafp->logblk; block0p->numentries = CLC(1); - newnode = CL(leafp->logblk); - block0p->firstleaf = CL(newnode); - block0p->lastleaf = CL(newnode); + newnode = BigEndianValue(leafp->logblk); + block0p->firstleaf = BigEndianValue(newnode); + block0p->lastleaf = BigEndianValue(newnode); if (!(block0cachep->flags & CACHEBUSY)) warning_unexpected ("not busy"); block0cachep->flags |= CACHEDIRTY; @@ -2105,8 +2106,8 @@ PRIVATE OSErr btcreate(btparam *btpb, void *datap, INTEGER datasize) } block0p = (btblock0 *) block0cachep->buf; vcbp = MR(block0cachep->vptr); - potentialfree = CL(block0p->nfreenodes); - potentialfree += CW(vcbp->vcbFreeBks) * (CL(vcbp->vcbAlBlkSiz) / PHYSBSIZE); + potentialfree = BigEndianValue(block0p->nfreenodes); + potentialfree += BigEndianValue(vcbp->vcbFreeBks) * (BigEndianValue(vcbp->vcbAlBlkSiz) / PHYSBSIZE); /* @@ -2120,7 +2121,7 @@ PRIVATE OSErr btcreate(btparam *btpb, void *datap, INTEGER datasize) * I think in non-contrived situations this is EXTREMELY unlikely to occur. */ - if (potentialfree < (ULONGINT) CW(block0p->height) + 1) + if (potentialfree < (ULONGINT) BigEndianValue(block0p->height) + 1) { err = dskFulErr; fs_err_hook (err); @@ -2151,7 +2152,7 @@ PRIVATE OSErr btcreate(btparam *btpb, void *datap, INTEGER datasize) datatoinsertp = (char*)datap; sizetoinsert = datasize; done = FALSE; - refnum = CW(block0cachep->refnum); + refnum = BigEndianValue(block0cachep->refnum); while (!done) { err = maketrailentrybusy(tep, refnum); err = slipin(tep->cachep, tep->after, keytoinsertp, datatoinsertp, @@ -2180,7 +2181,7 @@ PRIVATE OSErr btcreate(btparam *btpb, void *datap, INTEGER datasize) #if 0 keylen = BTENTRY((btnode *)tep->cachep->buf, 0)->keylen; #else - keylen = CW(block0p->indexkeylen); + keylen = BigEndianValue(block0p->indexkeylen); #endif keytoinsertp = BTENTRY(newbtp, 0); if (keytoinsertp->keylen < keylen) { @@ -2258,7 +2259,7 @@ PUBLIC OSErr Executor::ROMlib_dircreate(btparam *btpb, directoryrec *data) if (err == noErr) { makethreadrec(&rec, ((catkey *) &btpb->tofind)->ckrParID, ((catkey *) &btpb->tofind)->ckrCName); - err = ROMlib_makecatkey((catkey *) &btpb->tofind, CL(data->dirDirID), 0, (Ptr) 0); + err = ROMlib_makecatkey((catkey *) &btpb->tofind, BigEndianValue(data->dirDirID), 0, (Ptr) 0); btpb->leafindex = -1; if (err == noErr) err = btcreate(btpb, &rec, sizeof(rec)); @@ -2278,7 +2279,7 @@ PUBLIC xtntkey *Executor::ROMlib_newextentrecord(filecontrolblock *fcbp, uint16 vcbp = MR(fcbp->fcbVPtr); forkwanted = fcbp->fcbMdRByt & RESOURCEBIT ? resourcefork : datafork; memset(&rec, 0, sizeof(rec)); - ROMlib_makextntparam(&btparamrec, vcbp, forkwanted, CL(fcbp->fcbFlNum), newabn); + ROMlib_makextntparam(&btparamrec, vcbp, forkwanted, BigEndianValue(fcbp->fcbFlNum), newabn); if ((err = btcreate(&btparamrec, rec, sizeof(rec))) != noErr) { warning_unexpected ("couldn't create new xtntrec"); return 0; @@ -2301,7 +2302,7 @@ PUBLIC OSErr Executor::ROMlib_btrename(btparam *btpb, StringPtr newnamep) newbtparam = *btpb; err = ROMlib_makecatkey((catkey *) &newbtparam.tofind, - CL(((catkey *) &btpb->tofind)->ckrParID), newnamep[0], + BigEndianValue(((catkey *) &btpb->tofind)->ckrParID), newnamep[0], (Ptr) newnamep+1); newbtparam.leafindex = -1; /* I don't think this line does anything */ /* useful, but I noticed it the day that */ @@ -2348,7 +2349,7 @@ PUBLIC OSErr Executor::ROMlib_btrename(btparam *btpb, StringPtr newnamep) err = ROMlib_btdelete(btpb); if (err == noErr && ((filerec *)datap)->cdrType == DIRTYPE) { err = ROMlib_makecatkey((catkey *) &newbtparam.tofind, - CL(((directoryrec *)datap)->dirDirID), 0, (Ptr) 0); + BigEndianValue(((directoryrec *)datap)->dirDirID), 0, (Ptr) 0); newbtparam.leafindex = -1; if (err == noErr) err = btlegitimize(&newbtparam); @@ -2379,12 +2380,12 @@ PUBLIC OSErr Executor::ROMlib_btcreateemptyfile(btparam *btpb) rec.cdrType = FILETYPE; rec.filFlags = STARTFLAGS; rec.filFlNum = vcbp->vcbNxtCNID; - vcbp->vcbNxtCNID = CL(CL(vcbp->vcbNxtCNID) + 1); + vcbp->vcbNxtCNID = BigEndianValue(BigEndianValue(vcbp->vcbNxtCNID) + 1); vcbp->vcbFlags |= CWC(VCBDIRTY); rec.filMdDat = rec.filCrDat = Time; err = ROMlib_filecreate(btpb, &rec, regular); #if defined (CATFILEDEBUG) - ROMlib_checkleaves(CW(vcbp->vcbCTRef)); + ROMlib_checkleaves(BigEndianValue(vcbp->vcbCTRef)); #endif /* CATFILEDEBUG */ fs_err_hook (err); return err; @@ -2401,7 +2402,7 @@ PUBLIC OSErr Executor::ROMlib_btcreateemptydir(btparam *btpb, LONGINT *newidp) rec.cdrType = DIRTYPE; rec.dirFlags = STARTFLAGS; *newidp = rec.dirDirID = vcbp->vcbNxtCNID; - vcbp->vcbNxtCNID = CL(CL(vcbp->vcbNxtCNID) + 1); + vcbp->vcbNxtCNID = BigEndianValue(BigEndianValue(vcbp->vcbNxtCNID) + 1); vcbp->vcbFlags |= CWC(VCBDIRTY); rec.dirMdDat = rec.dirCrDat = Time; err = ROMlib_dircreate(btpb, &rec); @@ -2439,7 +2440,7 @@ PUBLIC OSErr Executor::ROMlib_btpbindex (ioParam *pb, LONGINT dirid, HVCB **vcbp save_dirid = dirid; save_vRefNum = pb->ioVRefNum; } - new_count = CW(((fileParam *)pb)->ioFDirIndex); + new_count = BigEndianValue(((fileParam *)pb)->ioFDirIndex); if (ROMlib_index_cached && new_count >= save_count) count = new_count - save_count; else @@ -2457,7 +2458,7 @@ PUBLIC OSErr Executor::ROMlib_btpbindex (ioParam *pb, LONGINT dirid, HVCB **vcbp if (err == noErr) { if (!ROMlib_index_cached) { save_vcbp = btparamrec.vcbp; - save_dirid = CL(btparamrec.foundp->catk.ckrParID); /* Could have */ + save_dirid = BigEndianValue(btparamrec.foundp->catk.ckrParID); /* Could have */ /* changed due to */ /* Working Dir ID */ } @@ -2470,13 +2471,13 @@ PUBLIC OSErr Executor::ROMlib_btpbindex (ioParam *pb, LONGINT dirid, HVCB **vcbp save_cachep = btparamrec.trail[btparamrec.leafindex].cachep; save_index = btparamrec.trail[btparamrec.leafindex].after; } - refnum = CW(save_cachep->refnum); + refnum = BigEndianValue(save_cachep->refnum); btp = (btnode *) save_cachep->buf; for (done = count == 0; !done;) { - if (++save_index < CW(btp->ndNRecs)) { + if (++save_index < BigEndianValue(btp->ndNRecs)) { ; /* nothing to do here; bumping save_index was sufficient */ - } else if ((flink = CL(btp->ndFLink))) { + } else if ((flink = BigEndianValue(btp->ndFLink))) { save_cachep->flags &= ~CACHEBUSY; err = ROMlib_getcache(&save_cachep, refnum, flink, GETCACHESAVE); @@ -2488,7 +2489,7 @@ PUBLIC OSErr Executor::ROMlib_btpbindex (ioParam *pb, LONGINT dirid, HVCB **vcbp done = TRUE; save_entryp = BTENTRY(btp, save_index); if (save_dirid != 1 && - CL(save_entryp->catk.ckrParID) != save_dirid) + BigEndianValue(save_entryp->catk.ckrParID) != save_dirid) done = TRUE; else if (!done) { save_frp = (filerec *) DATAPFROMKEY(save_entryp); diff --git a/src/hfsChanging.cpp b/src/hfsChanging.cpp index c4293599..26e20597 100644 --- a/src/hfsChanging.cpp +++ b/src/hfsChanging.cpp @@ -14,6 +14,7 @@ char ROMlib_rcsid_hfsChanging[] = #include "rsys/hfs.h" using namespace Executor; +using namespace ByteSwap; typedef enum { GetOp, @@ -33,7 +34,7 @@ PRIVATE OSErr PBFInfoHelper(changeop op, fileParam *pb, LONGINT dirid, filekind kind; vcbp = 0; - if (op == GetOp && (CW(pb->ioFDirIndex) > 0)) + if (op == GetOp && (BigEndianValue(pb->ioFDirIndex) > 0)) err = ROMlib_btpbindex((ioParam *) pb, dirid, &vcbp, &frp, &catkeyp, TRUE); else { @@ -52,9 +53,9 @@ PRIVATE OSErr PBFInfoHelper(changeop op, fileParam *pb, LONGINT dirid, if (err == noErr) { switch (op) { case GetOp: - if (CW(pb->ioFDirIndex) > 0 && pb->ioNamePtr) + if (BigEndianValue(pb->ioFDirIndex) > 0 && pb->ioNamePtr) str255assign(MR(pb->ioNamePtr), catkeyp->ckrCName); - pb->ioFlAttrib = CB (open_attrib_bits (CL (frp->filFlNum), vcbp, + pb->ioFlAttrib = CB (open_attrib_bits (BigEndianValue (frp->filFlNum), vcbp, &pb->ioFRefNum)); pb->ioFlAttrib |= frp->filFlags & CB (INHERITED_FLAG_BITS); pb->ioFlVersNum = 0; @@ -103,7 +104,7 @@ PUBLIC OSErr Executor::hfsPBGetFInfo(ParmBlkPtr pb, BOOLEAN async) PUBLIC OSErr Executor::hfsPBHGetFInfo(HParmBlkPtr pb, BOOLEAN async) { - return PBFInfoHelper(GetOp, (fileParam *) pb, CL(pb->fileParam.ioDirID), async); + return PBFInfoHelper(GetOp, (fileParam *) pb, BigEndianValue(pb->fileParam.ioDirID), async); } PUBLIC OSErr Executor::hfsPBSetFInfo(ParmBlkPtr pb, BOOLEAN async) @@ -113,7 +114,7 @@ PUBLIC OSErr Executor::hfsPBSetFInfo(ParmBlkPtr pb, BOOLEAN async) PUBLIC OSErr Executor::hfsPBHSetFInfo(HParmBlkPtr pb, BOOLEAN async) { - return PBFInfoHelper(SetOp, (fileParam *) pb, CL(pb->fileParam.ioDirID), async); + return PBFInfoHelper(SetOp, (fileParam *) pb, BigEndianValue(pb->fileParam.ioDirID), async); } PUBLIC OSErr Executor::hfsPBSetFLock(ParmBlkPtr pb, BOOLEAN async) @@ -123,7 +124,7 @@ PUBLIC OSErr Executor::hfsPBSetFLock(ParmBlkPtr pb, BOOLEAN async) PUBLIC OSErr Executor::hfsPBHSetFLock(HParmBlkPtr pb, BOOLEAN async) { - return PBFInfoHelper(LockOp, (fileParam *) pb, CL(pb->fileParam.ioDirID), async); + return PBFInfoHelper(LockOp, (fileParam *) pb, BigEndianValue(pb->fileParam.ioDirID), async); } PUBLIC OSErr Executor::hfsPBRstFLock(ParmBlkPtr pb, BOOLEAN async) @@ -134,7 +135,7 @@ PUBLIC OSErr Executor::hfsPBRstFLock(ParmBlkPtr pb, BOOLEAN async) PUBLIC OSErr Executor::hfsPBHRstFLock(HParmBlkPtr pb, BOOLEAN async) { return PBFInfoHelper(UnlockOp, (fileParam *) pb, - CL (pb->fileParam.ioDirID), async); + BigEndianValue (pb->fileParam.ioDirID), async); } PUBLIC OSErr Executor::hfsPBSetFVers(ParmBlkPtr pb, BOOLEAN async) @@ -151,11 +152,11 @@ ROMlib_fcbrename (HVCB *vcbp, LONGINT swapped_parid, StringPtr oldnamep, HVCB *swapped_vcbp; swapped_vcbp = RM (vcbp); - length = CW(*(short *)MR(FCBSPtr)); + length = BigEndianValue(*(short *)MR(FCBSPtr)); fcbp = (filecontrolblock *) ((short *)MR(FCBSPtr)+1); efcbp = (filecontrolblock *) ((char *)MR(FCBSPtr) + length); for (;fcbp < efcbp; - fcbp = (filecontrolblock *) ((char *)fcbp + CW(FSFCBLen))) + fcbp = (filecontrolblock *) ((char *)fcbp + BigEndianValue(FSFCBLen))) { if (fcbp->fcbDirID == swapped_parid && fcbp->fcbVPtr == swapped_vcbp @@ -194,7 +195,7 @@ renamehelper(ioParam *pb, BOOLEAN async, LONGINT dirid, filekind kind) btparamrec.tofind.catk.ckrParID, (StringPtr) &btparamrec.tofind.catk.ckrCName[0], - (StringPtr) CL (pb->ioMisc)); + (StringPtr) BigEndianValue (pb->ioMisc)); } err1 = ROMlib_cleancache(btparamrec.vcbp); if (err1 == noErr) @@ -232,6 +233,6 @@ PUBLIC OSErr Executor::hfsPBRename(ParmBlkPtr pb, BOOLEAN async) PUBLIC OSErr Executor::hfsPBHRename(HParmBlkPtr pb, BOOLEAN async) { - return renamehelper((ioParam *) pb, async, CL(pb->fileParam.ioDirID), + return renamehelper((ioParam *) pb, async, BigEndianValue(pb->fileParam.ioDirID), (filekind)(regular|directory)); } diff --git a/src/hfsCreate.cpp b/src/hfsCreate.cpp index e5303f75..c8c0bed9 100644 --- a/src/hfsCreate.cpp +++ b/src/hfsCreate.cpp @@ -13,6 +13,7 @@ char ROMlib_rcsid_hfsCreate[] = #include "rsys/hfs.h" using namespace Executor; +using namespace ByteSwap; typedef enum { create, delete1 } createop; @@ -33,7 +34,7 @@ PRIVATE OSErr freeallblocks(HVCB *vcbp, filerec *frp) (LONGINT) sizeof(frp->filExtRec)); fcbp->fcbMdRByt = WRITEBIT; pbr.ioParam.ioMisc = 0; - pbr.ioParam.ioRefNum = CW((char *) fcbp - (char *) MR(FCBSPtr)); + pbr.ioParam.ioRefNum = BigEndianValue((char *) fcbp - (char *) MR(FCBSPtr)); retval = ROMlib_allochelper((ioParam *) &pbr, FALSE, seteof, FALSE); if (retval == noErr) { fcbp->fcbPLen = frp->filRPyLen; @@ -67,7 +68,7 @@ PRIVATE OSErr createhelper(ioParam *pb, BOOLEAN async, createop op, else { if (curkind == directory) { drp = (directoryrec *) DATAPFROMKEY(btparamrec.foundp); - err = ROMlib_dirbusy(CL(drp->dirDirID), vcbp); + err = ROMlib_dirbusy(BigEndianValue(drp->dirDirID), vcbp); if (err == noErr) { if (drp->dirVal != 0) @@ -79,7 +80,7 @@ PRIVATE OSErr createhelper(ioParam *pb, BOOLEAN async, createop op, err = ROMlib_dirdelete(&btparamrec); } else { frp = (filerec *) DATAPFROMKEY(btparamrec.foundp); - if (ROMlib_alreadyopen(vcbp, CL(frp->filFlNum), + if (ROMlib_alreadyopen(vcbp, BigEndianValue(frp->filFlNum), (SignedByte *) 0, 0, eitherbusy) != noErr) err = fBsyErr; #if 0 @@ -129,13 +130,13 @@ PUBLIC OSErr Executor::hfsPBCreate(ParmBlkPtr pb, BOOLEAN async) PUBLIC OSErr Executor::hfsPBHCreate(HParmBlkPtr pb, BOOLEAN async) { - return createhelper((ioParam *)pb, async, create, CL(pb->fileParam.ioDirID), + return createhelper((ioParam *)pb, async, create, BigEndianValue(pb->fileParam.ioDirID), regular); } PUBLIC OSErr Executor::hfsPBDirCreate(HParmBlkPtr pb, BOOLEAN async) { - return createhelper((ioParam *)pb, async, create, CL(pb->fileParam.ioDirID), + return createhelper((ioParam *)pb, async, create, BigEndianValue(pb->fileParam.ioDirID), directory); } @@ -147,6 +148,6 @@ PUBLIC OSErr Executor::hfsPBDelete(ParmBlkPtr pb, BOOLEAN async) PUBLIC OSErr Executor::hfsPBHDelete(HParmBlkPtr pb, BOOLEAN async) { - return createhelper((ioParam *)pb, async, delete1, CL(pb->fileParam.ioDirID), + return createhelper((ioParam *)pb, async, delete1, BigEndianValue(pb->fileParam.ioDirID), (filekind)(regular | directory)); } diff --git a/src/hfsFile.cpp b/src/hfsFile.cpp index 1c378dc6..34a68713 100644 --- a/src/hfsFile.cpp +++ b/src/hfsFile.cpp @@ -15,17 +15,18 @@ char ROMlib_rcsid_hfsFile[] = #include "rsys/hfs.h" using namespace Executor; +using namespace ByteSwap; PUBLIC filecontrolblock *Executor::ROMlib_getfreefcbp( void ) { short length; filecontrolblock *fcbp, *efcbp; - length = CW(*(short *)MR(FCBSPtr)); + length = BigEndianValue(*(short *)MR(FCBSPtr)); fcbp = (filecontrolblock *) ((short *)MR(FCBSPtr)+1); efcbp = (filecontrolblock *) ((char *)MR(FCBSPtr) + length); for (;fcbp < efcbp && Cx(fcbp->fcbFlNum); - fcbp = (filecontrolblock *) ((char *)fcbp + CW(FSFCBLen))) + fcbp = (filecontrolblock *) ((char *)fcbp + BigEndianValue(FSFCBLen))) ; return fcbp < efcbp ? fcbp : 0; } @@ -35,9 +36,9 @@ PUBLIC filecontrolblock *Executor::ROMlib_refnumtofcbp(uint16 refnum) uint16 len; filecontrolblock *retval; - if (refnum < sizeof(short) || refnum % CW(FSFCBLen) != sizeof(short)) + if (refnum < sizeof(short) || refnum % BigEndianValue(FSFCBLen) != sizeof(short)) return 0; - len = CW(*(uint16 *)MR(FCBSPtr)); + len = BigEndianValue(*(uint16 *)MR(FCBSPtr)); if (refnum >= len) return 0; retval = (filecontrolblock *)((char *)MR(FCBSPtr) + refnum); @@ -48,7 +49,7 @@ PUBLIC filecontrolblock *Executor::ROMlib_refnumtofcbp(uint16 refnum) PRIVATE LONGINT pbabsoffset(ioParam *pb, filecontrolblock *fcbp) { - switch (CW(pb->ioPosMode) & 0x3) { + switch (BigEndianValue(pb->ioPosMode) & 0x3) { case fsAtMark: return Cx(fcbp->fcbCrPs); case fsFromStart: @@ -106,9 +107,9 @@ PUBLIC compretval Executor::ROMlib_xtntcompare(void *firstp, void *secondp) else if (Cx(xp1->xkrFkType) > Cx(xp2->xkrFkType)) return firstisgreater; else { - if (CW(xp1->xkrFABN) < CW(xp2->xkrFABN)) + if (BigEndianValue(xp1->xkrFABN) < BigEndianValue(xp2->xkrFABN)) return firstisless; - else if (CW(xp1->xkrFABN) > CW(xp2->xkrFABN)) + else if (BigEndianValue(xp1->xkrFABN) > BigEndianValue(xp2->xkrFABN)) return firstisgreater; else return same; @@ -135,8 +136,8 @@ PUBLIC void Executor::ROMlib_makextntkey(xtntkey *keyp, forktype forkwanted, LON { keyp->xkrKeyLen = 7; keyp->xkrFkType = forkwanted; - keyp->xkrFNum = CL(flnum); - keyp->xkrFABN = CW(bno); + keyp->xkrFNum = BigEndianValue(flnum); + keyp->xkrFABN = BigEndianValue(bno); } PUBLIC void Executor::ROMlib_makextntparam(btparam *btpb, HVCB *vcbp, forktype forkwanted, @@ -158,7 +159,7 @@ PRIVATE xtntkey *fcbpbnotoxkeyp(filecontrolblock *fcbp, uint16 bno) forkwanted = fcbp->fcbMdRByt & RESOURCEBIT ? resourcefork : datafork; ROMlib_makextntparam(&btparamblock, MR(fcbp->fcbVPtr), forkwanted, - CL(fcbp->fcbFlNum), bno); + BigEndianValue(fcbp->fcbFlNum), bno); err = ROMlib_keyfind(&btparamblock); #if 0 ROMlib_cleancache(btparamblock.vcbp); @@ -191,7 +192,7 @@ PUBLIC LONGINT Executor::ROMlib_logtophys(filecontrolblock *fcbp, LONGINT absoff if (!xkeyp) return -1; retblock = xtntbnotophys((xtntdesc *) DATAPFROMKEY(xkeyp), - bno - CW(xkeyp->xkrFABN), &nphysalcontig); + bno - BigEndianValue(xkeyp->xkrFABN), &nphysalcontig); if (retblock == -1) return -1; } @@ -227,10 +228,10 @@ PRIVATE void setbits(HVCB *vcbp, ULONGINT bno, ULONGINT ntoset, unsigned char lo ULONGINT first_map_block, last_map_block; if (lookfor) - vcbp->vcbFreeBks = CW(CW(vcbp->vcbFreeBks) - (ntoset)); + vcbp->vcbFreeBks = BigEndianValue(BigEndianValue(vcbp->vcbFreeBks) - (ntoset)); else - vcbp->vcbFreeBks = CW(CW(vcbp->vcbFreeBks) + (ntoset)); - vcbp->vcbFlags |= CW(VCBDIRTY); + vcbp->vcbFreeBks = BigEndianValue(BigEndianValue(vcbp->vcbFreeBks) + (ntoset)); + vcbp->vcbFlags |= BigEndianValue(VCBDIRTY); /* bno -= Cx(vcbp->vcbAlBlSt); not sure about this */ ebno = bno + ntoset; cp = (unsigned char *) MR(vcbp->vcbMAdr) + bno / 8 + MADROFFSET; @@ -347,7 +348,7 @@ PRIVATE BOOLEAN fillextent(xtntdesc *xp, ULONGINT *nallocneededp, HVCB *vcbp, toextend = MIN(toextend, needed); needed -= toextend; setbits(vcbp, Cx(xp->blockstart) + Cx(xp->blockcount), toextend, 1); - xp->blockcount = CW(CW(xp->blockcount) + (toextend)); + xp->blockcount = BigEndianValue(BigEndianValue(xp->blockcount) + (toextend)); } ++xp; } @@ -362,34 +363,34 @@ PRIVATE BOOLEAN fillextent(xtntdesc *xp, ULONGINT *nallocneededp, HVCB *vcbp, * even in the best case it couldn't be more than the number you already * know about. */ - for (search = countbits(vcbp, 0, 1) /*Cx(vcbp->vcbAlBlSt)*/; max - search > CW(tmpxtnt[2].blockcount);) { + for (search = countbits(vcbp, 0, 1) /*Cx(vcbp->vcbAlBlSt)*/; max - search > BigEndianValue(tmpxtnt[2].blockcount);) { nfree = countbits(vcbp, search, 0); #if 0 if (nfree == 0) warning_unexpected ("nfree == 0"); #endif if (nfree >= needed) { - tmpxtnt[0].blockcount = CW(nfree); - tmpxtnt[0].blockstart = CW(search); + tmpxtnt[0].blockcount = BigEndianValue(nfree); + tmpxtnt[0].blockstart = BigEndianValue(search); break; } - if (nfree > CW(tmpxtnt[1].blockcount)) { - if (nfree > CW(tmpxtnt[0].blockcount)) { + if (nfree > BigEndianValue(tmpxtnt[1].blockcount)) { + if (nfree > BigEndianValue(tmpxtnt[0].blockcount)) { tmpxtnt[2].blockcount = tmpxtnt[1].blockcount; tmpxtnt[2].blockstart = tmpxtnt[1].blockstart; tmpxtnt[1].blockcount = tmpxtnt[0].blockcount; tmpxtnt[1].blockstart = tmpxtnt[0].blockstart; - tmpxtnt[0].blockcount = CW(nfree); - tmpxtnt[0].blockstart = CW(search); + tmpxtnt[0].blockcount = BigEndianValue(nfree); + tmpxtnt[0].blockstart = BigEndianValue(search); } else { tmpxtnt[2].blockcount = tmpxtnt[1].blockcount; tmpxtnt[2].blockstart = tmpxtnt[1].blockstart; - tmpxtnt[1].blockcount = CW(nfree); - tmpxtnt[1].blockstart = CW(search); + tmpxtnt[1].blockcount = BigEndianValue(nfree); + tmpxtnt[1].blockstart = BigEndianValue(search); } } else if (nfree > tmpxtnt[2].blockcount) { - tmpxtnt[2].blockcount = CW(nfree); - tmpxtnt[2].blockstart = CW(search); + tmpxtnt[2].blockcount = BigEndianValue(nfree); + tmpxtnt[2].blockstart = BigEndianValue(search); } search += nfree; search += countbits(vcbp, search, 1); @@ -397,13 +398,13 @@ PRIVATE BOOLEAN fillextent(xtntdesc *xp, ULONGINT *nallocneededp, HVCB *vcbp, tmpxp = tmpxtnt; while (needed > 0 && --nempty >= 0 && tmpxp->blockcount) { xp->blockstart = tmpxp->blockstart; - xp->blockcount = CW(MIN(CW(tmpxp->blockcount), needed)); + xp->blockcount = BigEndianValue(MIN(BigEndianValue(tmpxp->blockcount), needed)); #if 1 if (xp->blockcount == 0) warning_unexpected ("blockcount = 0"); #endif - needed -= CW(xp->blockcount); - setbits(vcbp, CW(xp->blockstart), CW(xp->blockcount), 1); + needed -= BigEndianValue(xp->blockcount); + setbits(vcbp, BigEndianValue(xp->blockstart), BigEndianValue(xp->blockcount), 1); ++xp; ++tmpxp; } @@ -416,23 +417,23 @@ PRIVATE BOOLEAN fillextent(xtntdesc *xp, ULONGINT *nallocneededp, HVCB *vcbp, PRIVATE void smokexpvcbp(ULONGINT tosmoke, xtntdesc *xp, HVCB *vcbp) { - if (tosmoke <= CW(xp[2].blockcount)) { - xp[2].blockcount = CW(CW(xp[2].blockcount) - (tosmoke)); - setbits(vcbp, CW(xp[2].blockstart) + CW(xp[2].blockcount), tosmoke, 0); + if (tosmoke <= BigEndianValue(xp[2].blockcount)) { + xp[2].blockcount = BigEndianValue(BigEndianValue(xp[2].blockcount) - (tosmoke)); + setbits(vcbp, BigEndianValue(xp[2].blockstart) + BigEndianValue(xp[2].blockcount), tosmoke, 0); } else { - setbits(vcbp, CW(xp[2].blockstart), CW(xp[2].blockcount), 0); - tosmoke -= CW(xp[2].blockcount); + setbits(vcbp, BigEndianValue(xp[2].blockstart), BigEndianValue(xp[2].blockcount), 0); + tosmoke -= BigEndianValue(xp[2].blockcount); xp[2].blockcount = CWC(0); - if (tosmoke <= CW(xp[1].blockcount)) { - xp[1].blockcount = CW(CW(xp[1].blockcount) - tosmoke); - setbits(vcbp, CW(xp[1].blockstart) + CW(xp[1].blockcount), + if (tosmoke <= BigEndianValue(xp[1].blockcount)) { + xp[1].blockcount = BigEndianValue(BigEndianValue(xp[1].blockcount) - tosmoke); + setbits(vcbp, BigEndianValue(xp[1].blockstart) + BigEndianValue(xp[1].blockcount), tosmoke, 0); } else { - setbits(vcbp, CW(xp[1].blockstart), CW(xp[1].blockcount), 0); - tosmoke -= CW(xp[1].blockcount); + setbits(vcbp, BigEndianValue(xp[1].blockstart), BigEndianValue(xp[1].blockcount), 0); + tosmoke -= BigEndianValue(xp[1].blockcount); xp[1].blockcount = CWC(0); - xp[0].blockcount = CW(CW(xp[0].blockcount) - tosmoke); - setbits(vcbp, CW(xp[0].blockstart) + CW(xp[0].blockcount), tosmoke, 0); + xp[0].blockcount = BigEndianValue(BigEndianValue(xp[0].blockcount) - tosmoke); + setbits(vcbp, BigEndianValue(xp[0].blockstart) + BigEndianValue(xp[0].blockcount), tosmoke, 0); } } } @@ -517,7 +518,7 @@ PUBLIC OSErr Executor::ROMlib_allochelper(ioParam *pb, BOOLEAN async, alloctype xp = fcbp->fcbExtRec; totallength = Cx(vcbp->vcbAlBlkSiz) * - (CW(xp[0].blockcount) + CW(xp[1].blockcount) + CW(xp[2].blockcount)); + (BigEndianValue(xp[0].blockcount) + BigEndianValue(xp[1].blockcount) + BigEndianValue(xp[2].blockcount)); if (needtoshrink) { if (neweof < totallength) { tosmoke = (totallength - neweof) / Cx(vcbp->vcbAlBlkSiz); @@ -535,9 +536,9 @@ PUBLIC OSErr Executor::ROMlib_allochelper(ioParam *pb, BOOLEAN async, alloctype } xp = (xtntdesc *) DATAPFROMKEY(xtkeyp); totallength = Cx(vcbp->vcbAlBlkSiz) * - (CW(xp[0].blockcount) + CW(xp[1].blockcount) + - CW(xp[2].blockcount)); - tosmoke = CW(xtkeyp->xkrFABN) * Cx(vcbp->vcbAlBlkSiz) + totallength + (BigEndianValue(xp[0].blockcount) + BigEndianValue(xp[1].blockcount) + + BigEndianValue(xp[2].blockcount)); + tosmoke = BigEndianValue(xtkeyp->xkrFABN) * Cx(vcbp->vcbAlBlkSiz) + totallength - neweof; savetype = Cx(xtkeyp->xkrFkType); if (tosmoke < totallength) { @@ -565,16 +566,16 @@ PUBLIC OSErr Executor::ROMlib_allochelper(ioParam *pb, BOOLEAN async, alloctype gui_assert(xtkeyp && Cx(xtkeyp->xkrFNum) == Cx(fcbp->fcbFlNum) && Cx(xtkeyp->xkrFkType) == savetype); xp = (xtntdesc *) DATAPFROMKEY(btparamrec.foundp); - setbits(vcbp, CW(xp[0].blockstart), CW(xp[0].blockcount), 0); - setbits(vcbp, CW(xp[1].blockstart), CW(xp[1].blockcount), 0); - setbits(vcbp, CW(xp[2].blockstart), CW(xp[2].blockcount), 0); - newabn = CW(btparamrec.tofind.xtntk.xkrFABN) + - CW(xp[0].blockcount) + CW(xp[1].blockcount) + - CW(xp[2].blockcount); + setbits(vcbp, BigEndianValue(xp[0].blockstart), BigEndianValue(xp[0].blockcount), 0); + setbits(vcbp, BigEndianValue(xp[1].blockstart), BigEndianValue(xp[1].blockcount), 0); + setbits(vcbp, BigEndianValue(xp[2].blockstart), BigEndianValue(xp[2].blockcount), 0); + newabn = BigEndianValue(btparamrec.tofind.xtntk.xkrFABN) + + BigEndianValue(xp[0].blockcount) + BigEndianValue(xp[1].blockcount) + + BigEndianValue(xp[2].blockcount); err = ROMlib_btdelete(&btparamrec); if (err != noErr) goto done; - btparamrec.tofind.xtntk.xkrFABN = CW(newabn); + btparamrec.tofind.xtntk.xkrFABN = BigEndianValue(newabn); err = ROMlib_keyfind(&btparamrec); if (err != noErr) goto done; @@ -601,7 +602,7 @@ PUBLIC OSErr Executor::ROMlib_allochelper(ioParam *pb, BOOLEAN async, alloctype goto done; } xp = (xtntdesc *) DATAPFROMKEY(xtkeyp); - newabn = CW(xtkeyp->xkrFABN); + newabn = BigEndianValue(xtkeyp->xkrFABN); if (fillextent(xp, &nallocneeded, vcbp, &newabn)) ROMlib_dirtyleaf((anykey *)xtkeyp, vcbp); } @@ -638,7 +639,7 @@ PUBLIC OSErr Executor::ROMlib_allochelper(ioParam *pb, BOOLEAN async, alloctype break; case allocany: case alloccontig: - pb->ioActCount = CL(neweof - Cx(fcbp->fcbPLen)); + pb->ioActCount = BigEndianValue(neweof - Cx(fcbp->fcbPLen)); break; default: warning_unexpected ("unknown allocator2"); @@ -646,7 +647,7 @@ PUBLIC OSErr Executor::ROMlib_allochelper(ioParam *pb, BOOLEAN async, alloctype fs_err_hook (err); PBRETURN(pb, err); } - fcbp->fcbPLen = CL(neweof); + fcbp->fcbPLen = BigEndianValue(neweof); fcbp->fcbMdRByt |= 0x80; if (err == noErr) @@ -680,7 +681,7 @@ PUBLIC OSErr Executor::hfsPBAllocContig(ParmBlkPtr pb, BOOLEAN async) return err; } -#define RETURN(x) do { pb->ioResult = CW(x); goto DONE; } while (0) +#define RETURN(x) do { pb->ioResult = BigEndianValue(x); goto DONE; } while (0) PRIVATE OSErr PBReadWrite(ioParam *pb, BOOLEAN async, accesstype rw) { @@ -720,7 +721,7 @@ PRIVATE OSErr PBReadWrite(ioParam *pb, BOOLEAN async, accesstype rw) fs_err_hook (err); RETURN(err); } - pb->ioPosOffset = CL(absoffset); + pb->ioPosOffset = BigEndianValue(absoffset); if (totransfer < 0) { err = paramErr; @@ -731,13 +732,13 @@ PRIVATE OSErr PBReadWrite(ioParam *pb, BOOLEAN async, accesstype rw) if (neweot > Cx(fcbp->fcbEOF)) { if (rw == reading) { totransfer = Cx(fcbp->fcbEOF) - absoffset; - pb->ioResult = CW(eofErr); + pb->ioResult = BigEndianValue(eofErr); } else { templ = (LONGINT) Cx(pb->ioMisc); #if defined(MAC) - pb->ioMisc = CL((Ptr) neweot); + pb->ioMisc = BigEndianValue((Ptr) neweot); #else /* !defined(MAC) */ - pb->ioMisc = CL((LONGINT) neweot); + pb->ioMisc = BigEndianValue((LONGINT) neweot); #endif /* !defined(MAC) */ PBSetEOF((ParmBlkPtr) pb, FALSE); if (pb->ioResult != CWC(noErr)) @@ -783,8 +784,8 @@ PRIVATE OSErr PBReadWrite(ioParam *pb, BOOLEAN async, accesstype rw) } } - pb->ioPosOffset = CL(CL(pb->ioPosOffset) + (ntocopy)); - pb->ioActCount = CL(CL(pb->ioActCount) + (ntocopy)); + pb->ioPosOffset = BigEndianValue(BigEndianValue(pb->ioPosOffset) + (ntocopy)); + pb->ioActCount = BigEndianValue(BigEndianValue(pb->ioActCount) + (ntocopy)); totransfer -= ntocopy; absoffset += PHYSBSIZE; physblock += PHYSBSIZE; @@ -809,7 +810,7 @@ PRIVATE OSErr PBReadWrite(ioParam *pb, BOOLEAN async, accesstype rw) if (((LONGINT)bufp & 3) == 0) { newerr = ROMlib_transphysblk (&vcbp->hfs, physblock, thisrun, bufp, rw, &actl); - actl = CL(actl); + actl = BigEndianValue(actl); if (rw == reading) ROMlib_destroy_blocks((syn68k_addr_t) US_TO_SYN68K(bufp), actl, TRUE); } else { @@ -825,7 +826,7 @@ PRIVATE OSErr PBReadWrite(ioParam *pb, BOOLEAN async, accesstype rw) (LONGINT) PHYSBSIZE * i, 1, (Ptr) tempbuf, rw, &actl2); - actl2 = CL(actl2); + actl2 = BigEndianValue(actl2); if (rw == reading) BlockMove((Ptr) tempbuf, (Ptr) bufp + (LONGINT) PHYSBSIZE * i, (Size) actl2); @@ -843,7 +844,7 @@ PRIVATE OSErr PBReadWrite(ioParam *pb, BOOLEAN async, accesstype rw) newerr = ROMlib_transphysblk (&((VCBExtra *) vcbp)->u.hfs, physblock, thisrun, bufp, rw, &actl); - actl = CL(actl); + actl = BigEndianValue(actl); if (ntoslide) { BlockMove(bufp, bufp + ntoslide, actl); switch (ntoslide) { @@ -863,8 +864,8 @@ PRIVATE OSErr PBReadWrite(ioParam *pb, BOOLEAN async, accesstype rw) ROMlib_destroy_blocks((syn68k_addr_t) (long) US_TO_SYN68K(bufp), actl, TRUE); #endif - pb->ioPosOffset = CL(CL(pb->ioPosOffset) + (actl)); - pb->ioActCount = CL(CL(pb->ioActCount) + (actl)); + pb->ioPosOffset = BigEndianValue(BigEndianValue(pb->ioPosOffset) + (actl)); + pb->ioActCount = BigEndianValue(BigEndianValue(pb->ioActCount) + (actl)); if (newerr != noErr) { fs_err_hook (newerr); @@ -910,8 +911,8 @@ PRIVATE OSErr PBReadWrite(ioParam *pb, BOOLEAN async, accesstype rw) RETURN(newerr); } } - pb->ioPosOffset = CL(CL(pb->ioPosOffset) + (totransfer)); - pb->ioActCount = CL(CL(pb->ioActCount) + (totransfer)); + pb->ioPosOffset = BigEndianValue(BigEndianValue(pb->ioPosOffset) + (totransfer)); + pb->ioActCount = BigEndianValue(BigEndianValue(pb->ioActCount) + (totransfer)); } fcbp->fcbCrPs = pb->ioPosOffset; DONE: @@ -920,9 +921,9 @@ PRIVATE OSErr PBReadWrite(ioParam *pb, BOOLEAN async, accesstype rw) else newerr = noErr; if (pb->ioResult == noErr) - pb->ioResult = CW(newerr); - fs_err_hook (CW (pb->ioResult)); - return CW(pb->ioResult); + pb->ioResult = BigEndianValue(newerr); + fs_err_hook (BigEndianValue (pb->ioResult)); + return BigEndianValue(pb->ioResult); } #undef RETURN @@ -961,7 +962,7 @@ PRIVATE OSErr dirtyfcbp(filecontrolblock *fcbp) refnum = (char *) fcbp - (char *) MR(FCBSPtr); vcbp = MR(fcbp->fcbVPtr); if ((catpos = Cx(fcbp->fcbCatPos))) { - err = Executor::ROMlib_getcache(&cachep, CW(MR(fcbp->fcbVPtr)->vcbCTRef), + err = Executor::ROMlib_getcache(&cachep, BigEndianValue(MR(fcbp->fcbVPtr)->vcbCTRef), catpos, (cacheflagtype)0); if (err != noErr) { @@ -977,7 +978,7 @@ PRIVATE OSErr dirtyfcbp(filecontrolblock *fcbp) btparamrec.vcbp = MR (fcbp->fcbVPtr); btparamrec.tofind.catk = key; btparamrec.fp = Executor::ROMlib_catcompare; - btparamrec.refnum = CW (MR (fcbp->fcbVPtr)->vcbCTRef); + btparamrec.refnum = BigEndianValue (MR (fcbp->fcbVPtr)->vcbCTRef); err = ROMlib_keyfind (&btparamrec); if (err == noErr) { @@ -1024,7 +1025,7 @@ PRIVATE OSErr dirtyfcbp(filecontrolblock *fcbp) cachep->flags |= CACHEDIRTY; } else if (refnum == Cx(vcbp->vcbXTRef) || refnum == Cx(vcbp->vcbCTRef)) { err = noErr; - vcbp->vcbFlags |= CW(VCBDIRTY); + vcbp->vcbFlags |= BigEndianValue(VCBDIRTY); } else { warning_unexpected ("no catpos (nor are we XTRef or CTRef)"); err = fsDSIntErr; @@ -1085,7 +1086,7 @@ PUBLIC OSErr Executor::ROMlib_makecatkey(catkey *keyp, LONGINT dirid, INTEGER na keyp->ckrKeyLen = namelen + 1 + sizeof(LONGINT) + 1; keyp->ckrResrv1 = 0; - keyp->ckrParID = CL(dirid); + keyp->ckrParID = BigEndianValue(dirid); keyp->ckrCName[0] = namelen; memmove(keyp->ckrCName+1, namep, (LONGINT) namelen); fs_err_hook (retval); @@ -1181,7 +1182,7 @@ PRIVATE OSErr findentry(LONGINT dirid, StringPtr name, btparam *btpb, if (colonp) { /* expect a directory */ switch (rectype) { case DIRTYPE: - dirid = CL(((directoryrec *)recp)->dirDirID); + dirid = BigEndianValue(((directoryrec *)recp)->dirDirID); break; case THREADTYPE: if (((catkey *) &btpb->tofind)->ckrCName[0]) { @@ -1190,7 +1191,7 @@ PRIVATE OSErr findentry(LONGINT dirid, StringPtr name, btparam *btpb, fs_err_hook (err); /*-->*/ return err; } - dirid = CL(((threadrec *)recp)->thdParID); + dirid = BigEndianValue(((threadrec *)recp)->thdParID); break; default: warning_unexpected ("unknown rectype1 in findentry"); @@ -1225,7 +1226,7 @@ PRIVATE OSErr findentry(LONGINT dirid, StringPtr name, btparam *btpb, *kindp = thread; /* we're done now */ else if ((ignorename || endp == namep) && (*kindp & directory)) { - dirid = CL(((threadrec *)recp)->thdParID); + dirid = BigEndianValue(((threadrec *)recp)->thdParID); if (ignorename || coloncoloncount == 1) { namep = ((threadrec *)recp)->thdCName+1; namelen = ((threadrec *)recp)->thdCName[0]; @@ -1295,7 +1296,7 @@ PUBLIC OSErr Executor::ROMlib_findvcbandfile(ioParam *pb, LONGINT dirid, btparam savep = pb->ioNamePtr; if (ignorename) pb->ioNamePtr = 0; - btpb->vcbp = ROMlib_findvcb(CW(pb->ioVRefNum), MR(pb->ioNamePtr), &dir, + btpb->vcbp = ROMlib_findvcb(BigEndianValue(pb->ioVRefNum), MR(pb->ioNamePtr), &dir, TRUE); pb->ioNamePtr = savep; if (dir == 0) @@ -1317,7 +1318,7 @@ PUBLIC OSErr Executor::ROMlib_findvcbandfile(ioParam *pb, LONGINT dirid, btparam && dir_prefixes_volume(MR(pb->ioNamePtr), btpb->vcbp->vcbVN)) dirid = 1; else - ROMlib_adjustdirid(&dirid, btpb->vcbp, CW(pb->ioVRefNum)); + ROMlib_adjustdirid(&dirid, btpb->vcbp, BigEndianValue(pb->ioVRefNum)); if (!ignorename && dirid == 2 && pb->ioNamePtr && MR(pb->ioNamePtr)[0] == 0 && (*kindp & directory)) @@ -1372,11 +1373,11 @@ PUBLIC OSErr Executor::ROMlib_alreadyopen(HVCB *vcbp, LONGINT flnum, SignedByte if (*permp == fsRdPerm) return noErr; busybit = busy == resourcebusy ? RESOURCEBIT : 0; - length = CW(*(short *)MR(FCBSPtr)); + length = BigEndianValue(*(short *)MR(FCBSPtr)); fcbp = (filecontrolblock *) ((short *)MR(FCBSPtr)+1); efcbp = (filecontrolblock *) ((char *)MR(FCBSPtr) + length); - for (;fcbp < efcbp; fcbp = (filecontrolblock *) ((char *)fcbp + CW(FSFCBLen))) - if (MR(fcbp->fcbVPtr) == vcbp && CL(fcbp->fcbFlNum) == flnum && + for (;fcbp < efcbp; fcbp = (filecontrolblock *) ((char *)fcbp + BigEndianValue(FSFCBLen))) + if (MR(fcbp->fcbVPtr) == vcbp && BigEndianValue(fcbp->fcbFlNum) == flnum && (busy == eitherbusy || (fcbp->fcbMdRByt & RESOURCEBIT) == busybit) && ((fcbp->fcbMdRByt & WRITEBIT) || permp == &temp)) @@ -1390,14 +1391,14 @@ PUBLIC OSErr Executor::ROMlib_alreadyopen(HVCB *vcbp, LONGINT flnum, SignedByte break; case fsWrPerm: case fsRdWrPerm: - *refnump = CW((char *) fcbp - (char *) MR(FCBSPtr)); + *refnump = BigEndianValue((char *) fcbp - (char *) MR(FCBSPtr)); err = opWrErr; fs_err_hook (err); return err; break; case fsRdWrShPerm: if (!(fcbp->fcbMdRByt & SHAREDBIT)) { - *refnump = CW((char *) fcbp - (char *) MR(FCBSPtr)); + *refnump = BigEndianValue((char *) fcbp - (char *) MR(FCBSPtr)); err = opWrErr; fs_err_hook (err); return err; @@ -1435,7 +1436,7 @@ PRIVATE OSErr PBOpenHelper(ioParam *pb, forktype ft, LONGINT dirid, BOOLEAN asyn } permssn = pb->ioPermssn; frp = (filerec *) DATAPFROMKEY(btparamrec.foundp); - err = ROMlib_alreadyopen(btparamrec.vcbp, CL(frp->filFlNum), &permssn, + err = ROMlib_alreadyopen(btparamrec.vcbp, BigEndianValue(frp->filFlNum), &permssn, &pb->ioRefNum, ft == resourcefork ? resourcebusy : databusy ); if (err != noErr) { @@ -1526,7 +1527,7 @@ PRIVATE OSErr PBOpenHelper(ioParam *pb, forktype ft, LONGINT dirid, BOOLEAN asyn fcbp->fcbCatPos = cachep->logblk; fcbp->fcbDirID = catkeyp->ckrParID; str255assign(fcbp->fcbCName, catkeyp->ckrCName); - pb->ioRefNum = CW((char *) fcbp - (char *) MR(FCBSPtr)); + pb->ioRefNum = BigEndianValue((char *) fcbp - (char *) MR(FCBSPtr)); PBRETURN(pb, noErr); } @@ -1552,7 +1553,7 @@ PUBLIC OSErr Executor::hfsPBHOpen(HParmBlkPtr pb, BOOLEAN async) { OSErr err; - err = PBOpenHelper((ioParam *) pb, datafork, CL(pb->fileParam.ioDirID), + err = PBOpenHelper((ioParam *) pb, datafork, BigEndianValue(pb->fileParam.ioDirID), async); fs_err_hook (err); return err; @@ -1562,7 +1563,7 @@ PUBLIC OSErr Executor::hfsPBHOpenRF(HParmBlkPtr pb, BOOLEAN async) { OSErr err; - err = PBOpenHelper((ioParam *) pb, resourcefork, CL(pb->fileParam.ioDirID), + err = PBOpenHelper((ioParam *) pb, resourcefork, BigEndianValue(pb->fileParam.ioDirID), async); fs_err_hook (err); return err; @@ -1591,7 +1592,7 @@ PUBLIC OSErr Executor::hfsPBGetFPos(ParmBlkPtr pb, BOOLEAN async) filecontrolblock *fcbp; OSErr err; - fcbp = ROMlib_refnumtofcbp(CW(pb->ioParam.ioRefNum)); + fcbp = ROMlib_refnumtofcbp(BigEndianValue(pb->ioParam.ioRefNum)); if (!fcbp) { err = rfNumErr; @@ -1612,7 +1613,7 @@ PUBLIC OSErr Executor::hfsPBSetFPos(ParmBlkPtr pb, BOOLEAN async) LONGINT newpos; OSErr retval; - fcbp = ROMlib_refnumtofcbp(CW(pb->ioParam.ioRefNum)); + fcbp = ROMlib_refnumtofcbp(BigEndianValue(pb->ioParam.ioRefNum)); if (!fcbp) { retval = rfNumErr; @@ -1627,7 +1628,7 @@ PUBLIC OSErr Executor::hfsPBSetFPos(ParmBlkPtr pb, BOOLEAN async) retval = eofErr; fcbp->fcbCrPs = fcbp->fcbEOF; } else - fcbp->fcbCrPs = CL(newpos); + fcbp->fcbCrPs = BigEndianValue(newpos); pb->ioParam.ioPosOffset = fcbp->fcbCrPs; fs_err_hook (retval); PBRETURN((ioParam *) pb, retval); @@ -1638,7 +1639,7 @@ PUBLIC OSErr Executor::hfsPBGetEOF(ParmBlkPtr pb, BOOLEAN async) filecontrolblock *fcbp; OSErr err; - fcbp = ROMlib_refnumtofcbp(CW(pb->ioParam.ioRefNum)); + fcbp = ROMlib_refnumtofcbp(BigEndianValue(pb->ioParam.ioRefNum)); if (!fcbp) { err = rfNumErr; diff --git a/src/hfsHelper.cpp b/src/hfsHelper.cpp index 98eec640..80218273 100644 --- a/src/hfsHelper.cpp +++ b/src/hfsHelper.cpp @@ -35,6 +35,7 @@ char ROMlib_rcsid_hfsHelper[] = #endif using namespace Executor; +using namespace ByteSwap; #if !defined(MAC) @@ -285,7 +286,7 @@ read_driver_block_size (LONGINT fd, LONGINT bsize, LONGINT maxbytes, { if (aligned_buf[0] == 0x45 && aligned_buf[1] == 0x52) { - retval = (unsigned short) CW (*(unsigned short *) &aligned_buf[2]); + retval = (unsigned short) BigEndianValue (*(unsigned short *) &aligned_buf[2]); warning_fs_log ("fd = 0x%x, block size = %d", fd, retval); } } @@ -334,9 +335,9 @@ Executor::try_to_mount_disk (const char *dname, LONGINT floppyfd, LONGINT *messp if (floppyfd < 0) /*-->*/return; - drivenum = CW(dqp->dq.dQDrive); + drivenum = BigEndianValue(dqp->dq.dQDrive); - pb.ioParam.ioVRefNum = CW(drivenum); + pb.ioParam.ioVRefNum = BigEndianValue(drivenum); foundmap = FALSE; first = TRUE; @@ -356,16 +357,16 @@ Executor::try_to_mount_disk (const char *dname, LONGINT floppyfd, LONGINT *messp dqp = ROMlib_addtodq (2048L * 2, dname, partition, OURHFSDREF, flags, &hfs); - drivenum = CW(dqp->dq.dQDrive); - pb.ioParam.ioVRefNum = CW(drivenum); + drivenum = BigEndianValue(dqp->dq.dQDrive); + pb.ioParam.ioVRefNum = BigEndianValue(drivenum); } - dqp->hfs.offset = hfs.offset + (CL (partp->pmPyPartStart) + dqp->hfs.offset = hfs.offset + (BigEndianValue (partp->pmPyPartStart) * driver_block_size); err = hfsPBMountVol(&pb, floppyfd, dqp->hfs.offset, bsize, maxbytes, flags, dqp); mess = ((LONGINT) err << 16) | drivenum; if (first) { - *messp = CL(mess); + *messp = BigEndianValue(mess); first = FALSE; } else PPostEvent(diskEvt, mess, (HIDDEN_EvQElPtr *) 0); @@ -388,17 +389,17 @@ Executor::try_to_mount_disk (const char *dname, LONGINT floppyfd, LONGINT *messp ++partition; dqp = ROMlib_addtodq (2048L * 2, dname, partition, OURHFSDREF, flags, &hfs); - drivenum = CW(dqp->dq.dQDrive); - pb.ioParam.ioVRefNum = CW(drivenum); + drivenum = BigEndianValue(dqp->dq.dQDrive); + pb.ioParam.ioVRefNum = BigEndianValue(drivenum); } dqp->hfs.offset = hfs.offset + - (CL (oldmapp->oldmapentry[i].pdStart) + (BigEndianValue (oldmapp->oldmapentry[i].pdStart) * driver_block_size); err = hfsPBMountVol(&pb, floppyfd, dqp->hfs.offset, bsize, maxbytes, flags, dqp); mess = ((LONGINT) err << 16) | drivenum; if (first) { - *messp = CL(mess); + *messp = BigEndianValue(mess); first = FALSE; } else PPostEvent(diskEvt, mess, (HIDDEN_EvQElPtr *) 0); @@ -445,7 +446,7 @@ Executor::try_to_mount_disk (const char *dname, LONGINT floppyfd, LONGINT *messp dqp->hfs.offset = offset; err = hfsPBMountVol(&pb, floppyfd, offset, bsize, maxbytes, flags, dqp); - *messp = CL(((LONGINT) err << 16) | drivenum); + *messp = BigEndianValue(((LONGINT) err << 16) | drivenum); } } } @@ -602,10 +603,10 @@ Executor::ROMlib_transphysblk (hfs_access_t *hfsp, LONGINT physblock, short nphy pb.ioVRefNum = vcbp->vcbDrvNum; pb.ioRefNum = vcbp->vcbDRefNum; - pb.ioBuffer = CL(bufp); - pb.ioReqCount = CL(PHYSBSIZE * (LONGINT nphysblocks)); - pb.ioPosMode = CW(fsFromStart); - pb.ioPosOffset = CL(physblock); + pb.ioBuffer = BigEndianValue(bufp); + pb.ioReqCount = BigEndianValue(PHYSBSIZE * (LONGINT nphysblocks)); + pb.ioPosMode = BigEndianValue(fsFromStart); + pb.ioPosOffset = BigEndianValue(physblock); err = rw == reading ? PBRead ((ParmBlkPtr) &pb, FALSE) : PBWrite((ParmBlkPtr) &pb, FALSE); if (actp) @@ -631,7 +632,7 @@ Executor::ROMlib_transphysblk (hfs_access_t *hfsp, LONGINT physblock, short nphy memmove(bufp, newbufp, (LONGINT) nphysblocks * PHYSBSIZE); #endif if (actp) - *actp = err != noErr ? 0 : CL((LONGINT) nphysblocks * PHYSBSIZE); + *actp = err != noErr ? 0 : BigEndianValue((LONGINT) nphysblocks * PHYSBSIZE); #endif @@ -667,7 +668,7 @@ PUBLIC void *Executor::ROMlib_indexqueue(QHdr *qp, short index) QElemPtr p; #if 0 - for (p = CL(qp->qHead); (--index > 0) && p; p = CL(p->qLink)) + for (p = BigEndianValue(qp->qHead); (--index > 0) && p; p = BigEndianValue(p->qLink)) ; #else for (p = MR(qp->qHead); (--index > 0) && p; p = MR(p->vcbQElem.qLink)) diff --git a/src/hfsHier.cpp b/src/hfsHier.cpp index 4229c3d6..52eb8ea8 100644 --- a/src/hfsHier.cpp +++ b/src/hfsHier.cpp @@ -15,6 +15,7 @@ char ROMlib_rcsid_hfsHier[] = #include "rsys/file.h" using namespace Executor; +using namespace ByteSwap; typedef enum { catGet, catSet } catop; @@ -33,8 +34,8 @@ PRIVATE OSErr cathelper(CInfoPBPtr pb, BOOLEAN async, catop op) BOOLEAN ignorename; vcbp = 0; - if (CW(pb->hFileInfo.ioFDirIndex) > 0 && op == catGet) { - err = ROMlib_btpbindex((ioParam *) pb, CL(pb->hFileInfo.ioDirID), &vcbp, &frp, + if (BigEndianValue(pb->hFileInfo.ioFDirIndex) > 0 && op == catGet) { + err = ROMlib_btpbindex((ioParam *) pb, BigEndianValue(pb->hFileInfo.ioDirID), &vcbp, &frp, &catkeyp, FALSE); if (err != noErr) goto done; @@ -53,14 +54,14 @@ PRIVATE OSErr cathelper(CInfoPBPtr pb, BOOLEAN async, catop op) break; } } else { - if (CW(pb->hFileInfo.ioFDirIndex) < 0) { + if (BigEndianValue(pb->hFileInfo.ioFDirIndex) < 0) { kind = directory; ignorename = TRUE; } else { kind = filekind(regular | directory); ignorename = FALSE; } - err = ROMlib_findvcbandfile((ioParam *) pb, CL(pb->hFileInfo.ioDirID), + err = ROMlib_findvcbandfile((ioParam *) pb, BigEndianValue(pb->hFileInfo.ioDirID), &btparamrec, &kind, ignorename); if (err != noErr) goto done; @@ -83,7 +84,7 @@ PRIVATE OSErr cathelper(CInfoPBPtr pb, BOOLEAN async, catop op) if (UPDATE_IONAMEPTR_P(*pbf)) str255assign(MR(pbf->ioNamePtr), catkeyp->ckrCName); pbf->ioACUser = 0; - pbf->ioFlAttrib = CB (open_attrib_bits (CL (frp->filFlNum), vcbp, + pbf->ioFlAttrib = CB (open_attrib_bits (BigEndianValue (frp->filFlNum), vcbp, &pbf->ioFRefNum)); pbf->ioFlAttrib |= frp->filFlags & CB (INHERITED_FLAG_BITS); memmove(&pbf->ioFlFndrInfo, &frp->filUsrWds, @@ -197,24 +198,24 @@ PRIVATE OSErr parentchild(HVCB *vcbp, catkey *parentcatp, btparam btparamrec; err = noErr; - parid = CL(parentdirp->dirDirID); - if (parid == CL(childdirp->dirDirID)) + parid = BigEndianValue(parentdirp->dirDirID); + if (parid == BigEndianValue(childdirp->dirDirID)) err = badMovErr; /* can't move into oneself */ else if (parentdirp->dirVal != 0) { /* no need to check if no children */ if (parid <= 2) /* automatic disqualification; can't move */ err = badMovErr; /* root directory */ else { - newid = CL(childcatp->ckrParID); + newid = BigEndianValue(childcatp->ckrParID); err = ROMlib_makecatparam(&btparamrec, vcbp, (LONGINT) 0, 0, (Ptr) 0); - ctref = CW(vcbp->vcbCTRef); + ctref = BigEndianValue(vcbp->vcbCTRef); while (err == noErr && newid > 2 && newid != parid) { - btparamrec.tofind.catk.ckrParID = CL(newid); + btparamrec.tofind.catk.ckrParID = BigEndianValue(newid); err = ROMlib_keyfind(&btparamrec); if (err == noErr && !btparamrec.success) { err = fsDSIntErr; warning_unexpected ("no success in parentchild"); } - newid = CL( + newid = BigEndianValue( ((threadrec *)DATAPFROMKEY(btparamrec.foundp))->thdParID); } if (err == noErr) @@ -237,7 +238,7 @@ PUBLIC OSErr Executor::hfsPBCatMove(CMovePBPtr pb, BOOLEAN async) BOOLEAN ignorename; srccurkind = (filekind)(regular | directory); - err = ROMlib_findvcbandfile((ioParam *) pb, CL(pb->ioDirID), &srcbtparam, + err = ROMlib_findvcbandfile((ioParam *) pb, BigEndianValue(pb->ioDirID), &srcbtparam, &srccurkind, FALSE); if (err == noErr) { err = ROMlib_writevcbp(srcbtparam.vcbp); @@ -245,7 +246,7 @@ PUBLIC OSErr Executor::hfsPBCatMove(CMovePBPtr pb, BOOLEAN async) iop.ioNamePtr = pb->ioNewName; dstcurkind = directory; ignorename = iop.ioNamePtr == 0; - err = ROMlib_findvcbandfile(&iop, CL(pb->ioNewDirID), &dstdirbtparam, &dstcurkind, + err = ROMlib_findvcbandfile(&iop, BigEndianValue(pb->ioNewDirID), &dstdirbtparam, &dstcurkind, ignorename); if (err == noErr) { if (srcbtparam.vcbp != dstdirbtparam.vcbp) @@ -253,7 +254,7 @@ PUBLIC OSErr Executor::hfsPBCatMove(CMovePBPtr pb, BOOLEAN async) else { dstdirdrp = (directoryrec *) DATAPFROMKEY(dstdirbtparam.foundp); dstbtparam = dstdirbtparam; - err = ROMlib_makecatkey((catkey *) &dstbtparam.tofind, CL(dstdirdrp->dirDirID), + err = ROMlib_makecatkey((catkey *) &dstbtparam.tofind, BigEndianValue(dstdirdrp->dirDirID), srcbtparam.foundp->catk.ckrCName[0], (Ptr) srcbtparam.foundp->catk.ckrCName+1); dstbtparam.leafindex = -1; diff --git a/src/hfsMisc.cpp b/src/hfsMisc.cpp index f8d6d66a..1c29dd86 100644 --- a/src/hfsMisc.cpp +++ b/src/hfsMisc.cpp @@ -15,6 +15,7 @@ char ROMlib_rcsid_hfsMisc[] = #include "rsys/file.h" using namespace Executor; +using namespace ByteSwap; #if defined (TESTFCB) PUBLIC void testfcb() @@ -23,24 +24,24 @@ PUBLIC void testfcb() filecontrolblock *fp; INTEGER i; - length = CW(*(short *)CL(FCBSPtr)); - fp = (filecontrolblock *)((short *)CL(FCBSPtr) + 1); + length = BigEndianValue(*(short *)BigEndianValue(FCBSPtr)); + fp = (filecontrolblock *)((short *)BigEndianValue(FCBSPtr) + 1); printf("length = %d, length / 94 = %d, length mod 94 = %d\n", length, length / 94, length % 94); for (i = 0; i < 40 && i < length / 94; i++, fp++) { printf("# %ld flags 0x%x vers %d sblk %d EOF %ld PLEN %ld mark %ld\n" "vptr 0x%lx pbuffer 0x%lx FlPos %d clmpsiz %ld BTCBPtr 0x%lx\n" "ext (%d %d) (%d %d) (%d %d) FNDR '%c%c%c%c' CatPos 0x%lx\n" - "parid %ld name %s\n", CL(fp->fcbFlNum), fp->fcbMdRByt, - fp->fcbTypByt, CW(fp->fcbSBlk), CL(fp->fcbEOF), CL(fp->fcbPLen), CL(fp->fcbCrPs), - CL(fp->fcbVPtr), CL(fp->fcbBfAdr), CW(fp->fcbFlPos), CL(fp->fcbClmpSize), - CL(fp->fcbBTCBPtr), - CW(fp->fcbExtRec[0].blockstart), CW(fp->fcbExtRec[0].blockcount), - CW(fp->fcbExtRec[1].blockstart), CW(fp->fcbExtRec[1].blockcount), - CW(fp->fcbExtRec[2].blockstart), CW(fp->fcbExtRec[2].blockcount), - (short) (CL(fp->fcbFType) >> 24), (short) (CL(fp->fcbFType) >> 16), - (short) CL(fp->fcbFType) >> 8, (short) CL(fp->fcbFType), - CL(fp->fcbCatPos), CL(fp->fcbDirID), fp->fcbCName+1); + "parid %ld name %s\n", BigEndianValue(fp->fcbFlNum), fp->fcbMdRByt, + fp->fcbTypByt, BigEndianValue(fp->fcbSBlk), BigEndianValue(fp->fcbEOF), BigEndianValue(fp->fcbPLen), BigEndianValue(fp->fcbCrPs), + BigEndianValue(fp->fcbVPtr), BigEndianValue(fp->fcbBfAdr), BigEndianValue(fp->fcbFlPos), BigEndianValue(fp->fcbClmpSize), + BigEndianValue(fp->fcbBTCBPtr), + BigEndianValue(fp->fcbExtRec[0].blockstart), BigEndianValue(fp->fcbExtRec[0].blockcount), + BigEndianValue(fp->fcbExtRec[1].blockstart), BigEndianValue(fp->fcbExtRec[1].blockcount), + BigEndianValue(fp->fcbExtRec[2].blockstart), BigEndianValue(fp->fcbExtRec[2].blockcount), + (short) (BigEndianValue(fp->fcbFType) >> 24), (short) (BigEndianValue(fp->fcbFType) >> 16), + (short) BigEndianValue(fp->fcbFType) >> 8, (short) BigEndianValue(fp->fcbFType), + BigEndianValue(fp->fcbCatPos), BigEndianValue(fp->fcbDirID), fp->fcbCName+1); } } #endif /* TESTFCB */ @@ -72,10 +73,10 @@ A2(PUBLIC trap, OSErrRET, PBGetFCBInfo, FCBPBPtr, pb, BOOLEAN, async) filecontrolblock *fcbp, *efcbp; INTEGER i; - if ((i = CW(pb->ioFCBIndx)) > 0) { + if ((i = BigEndianValue(pb->ioFCBIndx)) > 0) { fcbp = (filecontrolblock *) (MR(FCBSPtr) + sizeof(INTEGER)); - efcbp = (filecontrolblock *) (MR(FCBSPtr) + CW(*(INTEGER *)MR(FCBSPtr))); - if (CW(pb->ioVRefNum) < 0) { + efcbp = (filecontrolblock *) (MR(FCBSPtr) + BigEndianValue(*(INTEGER *)MR(FCBSPtr))); + if (BigEndianValue(pb->ioVRefNum) < 0) { for (;fcbp != efcbp; fcbp++) if (fcbp->fcbFlNum && MR(fcbp->fcbVPtr)->vcbVRefNum == pb->ioVRefNum && --i <= 0) @@ -83,7 +84,7 @@ A2(PUBLIC trap, OSErrRET, PBGetFCBInfo, FCBPBPtr, pb, BOOLEAN, async) } else if (pb->ioVRefNum == 0) { for (;fcbp != efcbp && (fcbp->fcbFlNum == 0 || --i > 0); fcbp++) ; - } else /* if (CW(pb->ioVRefNum) > 0 */ { + } else /* if (BigEndianValue(pb->ioVRefNum) > 0 */ { for (;fcbp != efcbp; fcbp++) if (fcbp->fcbFlNum && MR(fcbp->fcbVPtr)->vcbDrvNum == pb->ioVRefNum && --i <= 0) @@ -91,28 +92,28 @@ A2(PUBLIC trap, OSErrRET, PBGetFCBInfo, FCBPBPtr, pb, BOOLEAN, async) } if (fcbp == efcbp) PBRETURN(pb, fnOpnErr); - pb->ioRefNum = CW((char *) fcbp - (char *) MR(FCBSPtr)); + pb->ioRefNum = BigEndianValue((char *) fcbp - (char *) MR(FCBSPtr)); } else { - fcbp = ROMlib_refnumtofcbp(CW(pb->ioRefNum)); + fcbp = ROMlib_refnumtofcbp(BigEndianValue(pb->ioRefNum)); if (!fcbp) PBRETURN(pb, rfNumErr); } if (pb->ioNamePtr) str255assign(MR(pb->ioNamePtr), fcbp->fcbCName); pb->ioFCBFlNm = fcbp->fcbFlNum; - pb->ioFCBFlags = CW((fcbp->fcbMdRByt <<8) | (unsigned char) fcbp->fcbTypByt); + pb->ioFCBFlags = BigEndianValue((fcbp->fcbMdRByt <<8) | (unsigned char) fcbp->fcbTypByt); pb->ioFCBStBlk = fcbp->fcbSBlk; pb->ioFCBEOF = fcbp->fcbEOF; if (MR(fcbp->fcbVPtr)->vcbCTRef) { pb->ioFCBCrPs = fcbp->fcbCrPs; /* HFS */ pb->ioFCBPLen = fcbp->fcbPLen; } else { - pb->ioFCBCrPs = CL(lseek(((fcbrec *)fcbp)->fcfd, 0, L_INCR) - /* UFS */ - FORKOFFSET((fcbrec *) fcbp)); + pb->ioFCBCrPs = BigEndianValue((ULONGINT)(lseek(((fcbrec *)fcbp)->fcfd, 0, L_INCR) - /* UFS */ + FORKOFFSET((fcbrec *) fcbp))); pb->ioFCBPLen = fcbp->fcbEOF; } pb->ioFCBVRefNum = MR(fcbp->fcbVPtr)->vcbVRefNum; - if (CW(pb->ioFCBIndx) <= 0 || pb->ioVRefNum == 0) + if (BigEndianValue(pb->ioFCBIndx) <= 0 || pb->ioVRefNum == 0) pb->ioVRefNum = pb->ioFCBVRefNum; pb->ioFCBClpSiz = fcbp->fcbClmpSize; pb->ioFCBParID = fcbp->fcbDirID; diff --git a/src/hfsVolume.cpp b/src/hfsVolume.cpp index 16bc19a9..8a1c90cc 100644 --- a/src/hfsVolume.cpp +++ b/src/hfsVolume.cpp @@ -20,6 +20,7 @@ char ROMlib_rcsid_hfsVolume[] = #endif using namespace Executor; +using namespace ByteSwap; /* * TODO: support read and write count. This will make it possible to @@ -95,20 +96,20 @@ PRIVATE OSErr readvolumebitmap(HVCB *vcbp, volumeinfoPtr vp) words = (long *) vp; warning_fs_log ("sigword = 0x%02x (%08lx %08lx %08lx %08lx)", - CW (vp->drSigWord), CL (words[0]), CL (words[1]), - CL (words[2]), CL (words[3])); + BigEndianValue (vp->drSigWord), BigEndianValue (words[0]), BigEndianValue (words[1]), + BigEndianValue (words[2]), BigEndianValue (words[3])); } else { nphysrequired = NPHYSREQ(ROUNDUP8(Cx(vp->drNmAlBlks)) / 8); vcbp->vcbMAdr = RM(NewPtr_aligned_4(PHYSBSIZE * nphysrequired + MADROFFSET, 0)); - vcbp->vcbMLen = CW(nphysrequired + MADROFFSET); + vcbp->vcbMLen = BigEndianValue(nphysrequired + MADROFFSET); /*really add MADROFFSET?*/ if (!vcbp->vcbMAdr) err = MemError(); else err = ROMlib_transphysblk (&((VCBExtra *) vcbp)->u.hfs, - CW(vp->drVBMSt) * (ULONGINT) PHYSBSIZE, + BigEndianValue(vp->drVBMSt) * (ULONGINT) PHYSBSIZE, nphysrequired, MR(vcbp->vcbMAdr) + MADROFFSET, reading, (LONGINT *) 0); @@ -132,7 +133,7 @@ PRIVATE OSErr initcache(HVCB *vcbp) return MemError(); TheZone = savezone; headp = (cachehead *) MR(vcbp->vcbCtlBuf); - headp->nitems = CW(NCACHEENTRIES); + headp->nitems = BigEndianValue(NCACHEENTRIES); headp->flags = 0; headp->flink = RM((cacheentry *)(headp + 1)); headp->blink = RM(MR(headp->flink) + NCACHEENTRIES - 1); @@ -176,8 +177,8 @@ check_volume_size (volumeinfoPtr vp) unsigned short nmalblks; unsigned long dralblksiz; - nmalblks = CW (vp->drNmAlBlks); - dralblksiz = CL (vp->drAlBlkSiz); + nmalblks = BigEndianValue (vp->drNmAlBlks); + dralblksiz = BigEndianValue (vp->drAlBlkSiz); retval = ((long long) nmalblks * dralblksiz >= 2LL * 1024 * 1024 * 1024 ? paramErr : noErr); if (retval != noErr) @@ -211,7 +212,7 @@ PRIVATE OSErr readvolumeinfo(HVCB *vcbp) /* call once during mounting */ } #define VOLUMEINFOBACKUP(vcbp) \ - ((CW(vcbp->vcbNmAlBlks) * Cx(vcbp->vcbAlBlkSiz)) + \ + ((BigEndianValue(vcbp->vcbNmAlBlks) * Cx(vcbp->vcbAlBlkSiz)) + \ (Cx(vcbp->vcbAlBlSt) * PHYSBSIZE)) void Executor::vcbsync(HVCB *vcbp) @@ -264,7 +265,7 @@ OSErr Executor::ROMlib_flushvcbp(HVCB *vcbp) memmove(&vip->drCTExtRec, &fcbp->fcbExtRec, (LONGINT) sizeof(fcbp->fcbExtRec)); retval = writevolumeinfo(vcbp, p); - vcbp->vcbFlags &= CW(~VCBDIRTY); + vcbp->vcbFlags &= BigEndianValue(~VCBDIRTY); } } return retval; @@ -357,7 +358,7 @@ Executor::ROMlib_dqbydrive (short vrefnum) DrvQExtra *retval; short swapped_vrefnum; - swapped_vrefnum = CW (vrefnum); + swapped_vrefnum = BigEndianValue (vrefnum); retval = 0; for (dp = (DrvQEl *) MR (DrvQHdr.qHead); dp && (retval = (DrvQExtra *) ((char *) dp - sizeof(LONGINT)), @@ -404,13 +405,13 @@ PUBLIC HVCB *Executor::ROMlib_findvcb(short vrefnum, StringPtr name, LONGINT *di wdp = WDNUMTOWDP(vrefnum); vcbp = MR(wdp->vcbp); if (diridp) - *diridp = CL(wdp->dirid); + *diridp = BigEndianValue(wdp->dirid); } else vcbp = ROMlib_vcbbyvrn(vrefnum); } else if (usedefault || (!name && !vrefnum)) { vcbp = (HVCB *) MR(DefVCBPtr); if (diridp) - *diridp = CL(DefDirID); + *diridp = BigEndianValue(DefDirID); } } return vcbp; @@ -442,17 +443,17 @@ PRIVATE INTEGER openxtnt(LONGINT filnum, LONGINT clpsize, LONGINT filsize, xtntr fcbp = ROMlib_getfreefcbp(); if (fcbp) { - fcbp->fcbFlNum = CL(filnum); + fcbp->fcbFlNum = BigEndianValue(filnum); fcbp->fcbMdRByt = 0; fcbp->fcbTypByt = 0; fcbp->fcbSBlk = 0; - fcbp->fcbEOF = CL(filsize); - fcbp->fcbPLen = CL(filsize); + fcbp->fcbEOF = BigEndianValue(filsize); + fcbp->fcbPLen = BigEndianValue(filsize); fcbp->fcbCrPs = 0; fcbp->fcbVPtr = RM(vcbp); fcbp->fcbBfAdr = 0; fcbp->fcbFlPos = 0; - fcbp->fcbClmpSize = CL(clpsize); + fcbp->fcbClmpSize = BigEndianValue(clpsize); fcbp->fcbBTCBPtr = 0; memmove(fcbp->fcbExtRec, xtr, (LONGINT) sizeof(xtntrec)); fcbp->fcbFType = 0; @@ -485,7 +486,7 @@ Executor::hfsPBMountVol (ParmBlkPtr pb, LONGINT floppyfd, LONGINT offset, LONGIN "flags = 0x%x", floppyfd, offset, bsize, maxbytes, flags); saveZone = TheZone; TheZone = SysZone; - vcbp = ROMlib_vcbbydrive(CW(pb->volumeParam.ioVRefNum)); + vcbp = ROMlib_vcbbydrive(BigEndianValue(pb->volumeParam.ioVRefNum)); if (vcbp) err = volOnLinErr; else { @@ -521,37 +522,37 @@ Executor::hfsPBMountVol (ParmBlkPtr pb, LONGINT floppyfd, LONGINT offset, LONGIN } memmove(&vcbp->vcbSigWord, &vip->drSigWord, (LONGINT) 64); - nblocks = (CL(vcbp->vcbAlBlkSiz) / PHYSBSIZE) * - CW(vcbp->vcbNmAlBlks) + CW(vcbp->vcbAlBlSt) + 2; - dqp->dq.dQDrvSz = CW(nblocks); - dqp->dq.dQDrvSz2 = CW(nblocks >> 16); + nblocks = (BigEndianValue(vcbp->vcbAlBlkSiz) / PHYSBSIZE) * + BigEndianValue(vcbp->vcbNmAlBlks) + BigEndianValue(vcbp->vcbAlBlSt) + 2; + dqp->dq.dQDrvSz = BigEndianValue(nblocks); + dqp->dq.dQDrvSz2 = BigEndianValue(nblocks >> 16); dqp->dq.qType = 1; vcbp->vcbDrvNum = pb->volumeParam.ioVRefNum; - vcbp->vcbDRefNum = CW(drvtodref(Cx(pb->volumeParam.ioVRefNum))); + vcbp->vcbDRefNum = BigEndianValue(drvtodref(Cx(pb->volumeParam.ioVRefNum))); vcbp->vcbFSID = 0; if (!alreadythere) - vcbp->vcbVRefNum = CW(--ROMlib_nextvrn); + vcbp->vcbVRefNum = BigEndianValue(--ROMlib_nextvrn); vcbp->vcbDirIndex = 0; vcbp->vcbDirBlk = 0; vcbp->vcbFlags = 0; memmove(&vcbp->vcbVolBkUp, &vip->drVolBkUp, (LONGINT) 66); vcbp->vcbXTAlBlks = - CW(Cx(vip->drXTFlSize) / Cx(vip->drAlBlkSiz)); + BigEndianValue(Cx(vip->drXTFlSize) / Cx(vip->drAlBlkSiz)); vcbp->vcbCTAlBlks = - CW(Cx(vip->drCTFlSize) / Cx(vip->drAlBlkSiz)); + BigEndianValue(Cx(vip->drCTFlSize) / Cx(vip->drAlBlkSiz)); - vcbp->vcbXTRef = CW(openxtnt(XTNUM, Cx(vip->drXTClpSiz), + vcbp->vcbXTRef = BigEndianValue(openxtnt(XTNUM, Cx(vip->drXTClpSiz), Cx(vip->drXTFlSize), vip->drXTExtRec, vcbp)); - vcbp->vcbCTRef = CW(openxtnt(CTNUM, Cx(vip->drCTClpSiz), + vcbp->vcbCTRef = BigEndianValue(openxtnt(CTNUM, Cx(vip->drCTClpSiz), Cx(vip->drCTFlSize), vip->drCTExtRec, vcbp)); vcbp->vcbDirIDM = 0; vcbp->vcbOffsM = 0; vcbp->vcbAtrb = 0; if (flags & DRIVE_FLAGS_FIXED) - vcbp->vcbAtrb |= CW(VNONEJECTABLEBIT); + vcbp->vcbAtrb |= BigEndianValue(VNONEJECTABLEBIT); if (!vcbp->vcbCTRef) err = tmfoErr; @@ -582,7 +583,7 @@ Executor::hfsPBMountVol (ParmBlkPtr pb, LONGINT floppyfd, LONGINT offset, LONGIN flags |= DRIVE_FLAGS_LOCKED; } if (flags & DRIVE_FLAGS_LOCKED) - vcbp->vcbAtrb |= CW(VHARDLOCKBIT); + vcbp->vcbAtrb |= BigEndianValue(VHARDLOCKBIT); if (!alreadythere) Enqueue((QElemPtr) vcbp, &VCBQHdr); pb->volumeParam.ioVRefNum = vcbp->vcbVRefNum; @@ -602,7 +603,7 @@ Executor::hfsPBMountVol (ParmBlkPtr pb, LONGINT floppyfd, LONGINT offset, LONGIN PRIVATE void goofyclip(unsigned short *up) { - if (CW(*up) > 0x7C00) /* IMIV-130 */ + if (BigEndianValue(*up) > 0x7C00) /* IMIV-130 */ *up = CWC (0x7C00); } @@ -617,7 +618,7 @@ PRIVATE LONGINT getworkingdir(INTEGER vrefnum) if (ISWDNUM(vrefnum)) { wdp = WDNUMTOWDP(vrefnum); - retval = CL(wdp->dirid); + retval = BigEndianValue(wdp->dirid); } else retval = 0; return retval; @@ -677,13 +678,13 @@ PRIVATE OSErr commonGetVInfo(HVolumeParam *pb, BOOLEAN async, fstype fs) if (!vcbp) /*-->*/ PBRETURN(pb, nsvErr); - if (/*CW (pb->ioVolIndex) >= 0 &&*/ pb->ioNamePtr) + if (/*BigEndianValue (pb->ioVolIndex) >= 0 &&*/ pb->ioNamePtr) str255assign(MR(pb->ioNamePtr), (StringPtr) vcbp->vcbVN); pb->ioVCrDate = vcbp->vcbCrDate; pb->ioVAtrb = vcbp->vcbAtrb; if (workingdirnum) - pb->ioVNmFls = CW(getnmfls(vcbp, workingdirnum)); + pb->ioVNmFls = BigEndianValue(getnmfls(vcbp, workingdirnum)); else pb->ioVNmFls = vcbp->vcbNmFls; @@ -757,14 +758,14 @@ PUBLIC OSErr Executor::hfsPBSetVInfo(HParmBlkPtr pb, BOOLEAN async) MR(pb->volumeParam.ioNamePtr)); vcbp->vcbCrDate = pb->volumeParam.ioVCrDate; vcbp->vcbLsMod = pb->volumeParam.ioVLsMod; - vcbp->vcbAtrb = CW((Cx(vcbp->vcbAtrb) & ~ATRBMASK) | + vcbp->vcbAtrb = BigEndianValue((Cx(vcbp->vcbAtrb) & ~ATRBMASK) | (Cx(pb->volumeParam.ioVAtrb) & ATRBMASK)); vcbp->vcbClpSiz = pb->volumeParam.ioVClpSiz; vcbp->vcbVolBkUp = pb->volumeParam.ioVBkUp; vcbp->vcbVSeqNum = pb->volumeParam.ioVSeqNum; memmove(vcbp->vcbFndrInfo, pb->volumeParam.ioVFndrInfo, (LONGINT) 32); - vcbp->vcbFlags |= CW(VCBDIRTY); + vcbp->vcbFlags |= BigEndianValue(VCBDIRTY); err = noErr; } } else @@ -852,17 +853,17 @@ PRIVATE OSErr setvolhelper(volumeParam *pb, BOOLEAN aysnc, LONGINT dirid, newDefVCBPtr = RM(vcbp); newDefDirID = CLC(0); if (newdir > 2) { /* picked up working directory */ - newDefDirID = dirid ? CL(dirid) : CL(newdir); + newDefDirID = dirid ? BigEndianValue(dirid) : BigEndianValue(newdir); newDefVRefNum = pb->ioVRefNum; } else if (newdir == 1) { /* picked up by name */ - newDefDirID = CL(newdir); + newDefDirID = BigEndianValue(newdir); newDefVRefNum = vcbp->vcbVRefNum; } else { newDefVRefNum = pb->ioVRefNum; if (dirid == 0 && convertzeros) newDefDirID = CLC(2); else - newDefDirID = CL(dirid); + newDefDirID = BigEndianValue(dirid); } if (!convertzeros && pb->ioNamePtr) { /* this could change things */ @@ -872,7 +873,7 @@ PRIVATE OSErr setvolhelper(volumeParam *pb, BOOLEAN aysnc, LONGINT dirid, cpb.hFileInfo.ioNamePtr = pb->ioNamePtr; cpb.hFileInfo.ioVRefNum = pb->ioVRefNum; cpb.hFileInfo.ioFDirIndex = CWC (0); - cpb.hFileInfo.ioDirID = CL(dirid); + cpb.hFileInfo.ioDirID = BigEndianValue(dirid); /* * NOTE: the else case was added after seeing Excel 4 Installer do a setvol * to a file, presumably with the intent to set it to the parent id. @@ -930,12 +931,12 @@ PRIVATE void closeallvcbfiles(HVCB *vcbp) ioParam iopb; short length; - length = CW(*(short *)MR(FCBSPtr)); + length = BigEndianValue(*(short *)MR(FCBSPtr)); fcbp = (filecontrolblock *) ((short *)MR(FCBSPtr)+1); efcbp = (filecontrolblock *) ((char *)MR(FCBSPtr) + length); for (;fcbp < efcbp; fcbp = (filecontrolblock *) ((char *)fcbp + Cx(FSFCBLen))) if (fcbp->fcbFlNum && MR(fcbp->fcbVPtr) == vcbp) { - iopb.ioRefNum = CW((char *) fcbp - (char *) MR(FCBSPtr)); + iopb.ioRefNum = BigEndianValue((char *) fcbp - (char *) MR(FCBSPtr)); /* my */PBFlushFile((ParmBlkPtr) &iopb, FALSE); } } @@ -1009,7 +1010,7 @@ PUBLIC OSErr Executor::hfsPBOffLine(ParmBlkPtr pb) MR(pb->volumeParam.ioNamePtr), (LONGINT *) 0, FALSE); if (vcbp) { if (vcbp->vcbDrvNum) { - vcbp->vcbDRefNum = CW(-Cx(vcbp->vcbDrvNum)); + vcbp->vcbDRefNum = BigEndianValue(-Cx(vcbp->vcbDrvNum)); err = offlinehelper((volumeParam *) pb, vcbp); } else err = noErr; @@ -1033,7 +1034,7 @@ PUBLIC OSErr Executor::hfsPBEject(ParmBlkPtr pb) err = offlinehelper((volumeParam *) pb, vcbp); } else { if (Cx(vcbp->vcbDRefNum) < 0) /* offline */ - vcbp->vcbDRefNum = CW(Cx(vcbp->vcbDRefNum) * -1); + vcbp->vcbDRefNum = BigEndianValue(Cx(vcbp->vcbDRefNum) * -1); err = noErr; } } else @@ -1057,7 +1058,7 @@ PUBLIC OSErr Executor::ROMlib_pbvolrename(ioParam *pb, StringPtr newnamep) Str255 name_copy; str255assign (name_copy, MR (pb->ioNamePtr)); - hpb.volumeParam.ioNamePtr = (StringPtr) CL ((long) name_copy); + hpb.volumeParam.ioNamePtr = (StringPtr) BigEndianValue ((long) name_copy); hpb.volumeParam.ioVRefNum = pb->ioVRefNum; hpb.volumeParam.ioVolIndex = CWC(-1); err = /* my */PBHGetVInfo((HParmBlkPtr) &hpb, FALSE); diff --git a/src/hfsWorkingdir.cpp b/src/hfsWorkingdir.cpp index e5a280a8..9d5f6065 100644 --- a/src/hfsWorkingdir.cpp +++ b/src/hfsWorkingdir.cpp @@ -15,6 +15,7 @@ char ROMlib_rcsid_hfsWorkingdir[] = #include "MemoryMgr.h" using namespace Executor; +using namespace ByteSwap; /* * TODO: use this working directory stuff in ROMlib @@ -25,8 +26,8 @@ PUBLIC OSErr Executor::ROMlib_dirbusy(LONGINT dirid, HVCB *vcbp) #if defined(MAC) wdentry *wdp, *ewdp; - for (wdp = (wdentry *) (CL(WDCBsPtr) + sizeof(INTEGER)), - ewdp = (wdentry *) (CL(WDCBsPtr) + CW(*(INTEGER *)CL(WDCBsPtr))); + for (wdp = (wdentry *) (BigEndianValue(WDCBsPtr) + sizeof(INTEGER)), + ewdp = (wdentry *) (BigEndianValue(WDCBsPtr) + BigEndianValue(*(INTEGER *)BigEndianValue(WDCBsPtr))); wdp != ewdp; wdp++) ; return wdp == ewdp ? noErr : fBsyErr; @@ -45,18 +46,18 @@ PUBLIC OSErr Executor::ROMlib_mkwd(WDPBPtr pb, HVCB *vcbp, LONGINT dirid, LONGIN firstfreep = 0; for (wdp = (wdentry *) (MR(WDCBsPtr) + sizeof(INTEGER)), - ewdp = (wdentry *) (MR(WDCBsPtr) +CW(*(INTEGER *)MR(WDCBsPtr))); + ewdp = (wdentry *) (MR(WDCBsPtr) +BigEndianValue(*(INTEGER *)MR(WDCBsPtr))); wdp != ewdp; wdp++) { if (!firstfreep && !wdp->vcbp) firstfreep = wdp; - if (MR(wdp->vcbp) == vcbp && CL(wdp->dirid) == dirid && - CL(wdp->procid) == procid) { - pb->ioVRefNum = CW(WDPTOWDNUM(wdp)); + if (MR(wdp->vcbp) == vcbp && BigEndianValue(wdp->dirid) == dirid && + BigEndianValue(wdp->procid) == procid) { + pb->ioVRefNum = BigEndianValue(WDPTOWDNUM(wdp)); /*-->*/ return noErr; } } if (!firstfreep) { - n_wd_bytes = CW(*(INTEGER *) MR(WDCBsPtr)); + n_wd_bytes = BigEndianValue(*(INTEGER *) MR(WDCBsPtr)); new_n_wd_bytes = (n_wd_bytes - sizeof(INTEGER)) * 2 + sizeof(INTEGER); saveZone = TheZone; TheZone = SysZone; @@ -68,7 +69,7 @@ PUBLIC OSErr Executor::ROMlib_mkwd(WDPBPtr pb, HVCB *vcbp, LONGINT dirid, LONGIN BlockMove( MR(WDCBsPtr), newptr, n_wd_bytes); DisposPtr( MR(WDCBsPtr) ); WDCBsPtr = RM(newptr); - *(INTEGER *) newptr = CW(new_n_wd_bytes); + *(INTEGER *) newptr = BigEndianValue(new_n_wd_bytes); firstfreep = (wdentry *) (newptr + n_wd_bytes); retval = noErr; } @@ -76,9 +77,9 @@ PUBLIC OSErr Executor::ROMlib_mkwd(WDPBPtr pb, HVCB *vcbp, LONGINT dirid, LONGIN retval = noErr; if (retval == noErr) { firstfreep->vcbp = RM(vcbp); - firstfreep->dirid = CL(dirid); - firstfreep->procid = CL(procid); - pb->ioVRefNum = CW(WDPTOWDNUM(firstfreep)); + firstfreep->dirid = BigEndianValue(dirid); + firstfreep->procid = BigEndianValue(procid); + pb->ioVRefNum = BigEndianValue(WDPTOWDNUM(firstfreep)); retval = noErr; } return retval; @@ -105,10 +106,10 @@ PUBLIC OSErr Executor::hfsPBOpenWD(WDPBPtr pb, BOOLEAN async) namep = MR (pb->ioNamePtr); if (kind == directory && namep && namep[0]) dirid = - CL(((directoryrec *) DATAPFROMKEY(btparamrec.foundp))->dirDirID); + BigEndianValue(((directoryrec *) DATAPFROMKEY(btparamrec.foundp))->dirDirID); else - dirid = CL(pb->ioWDDirID); - retval = ROMlib_mkwd(pb, vcbp, dirid, CL(pb->ioWDProcID)); + dirid = BigEndianValue(pb->ioWDDirID); + retval = ROMlib_mkwd(pb, vcbp, dirid, BigEndianValue(pb->ioWDProcID)); PBRETURN(pb, retval); } @@ -143,7 +144,7 @@ PUBLIC OSErr Executor::hfsPBGetWDInfo(WDPBPtr pb, BOOLEAN async) if (Cx(pb->ioWDIndex) > 0) { i = Cx(pb->ioWDIndex); wdp = (wdentry *) (MR(WDCBsPtr) + sizeof(INTEGER)); - ewdp = (wdentry *) (MR(WDCBsPtr) + CW(*(INTEGER *)MR(WDCBsPtr))); + ewdp = (wdentry *) (MR(WDCBsPtr) + BigEndianValue(*(INTEGER *)MR(WDCBsPtr))); if (Cx(pb->ioVRefNum) < 0) { for (;wdp != ewdp; wdp++) if (wdp->vcbp && MR(wdp->vcbp)->vcbVRefNum == pb->ioVRefNum && --i <= 0) @@ -169,7 +170,7 @@ PUBLIC OSErr Executor::hfsPBGetWDInfo(WDPBPtr pb, BOOLEAN async) str255assign(MR(pb->ioNamePtr), (StringPtr) vcbp->vcbVN); pb->ioWDProcID = 0; pb->ioVRefNum = pb->ioWDVRefNum = vcbp->vcbVRefNum; - pb->ioWDDirID = CL((vcbp == MR(DefVCBPtr)) ? DefDirID : 2); + pb->ioWDDirID = BigEndianValue((vcbp == MR(DefVCBPtr)) ? DefDirID : 2); foundelsewhere = TRUE; } } @@ -198,7 +199,7 @@ Executor::GetWDInfo (INTEGER wd, INTEGER *vrefp, LONGINT *dirp, LONGINT *procp) WDPBRec wdp; memset (&wdp, 0, sizeof wdp); - wdp.ioVRefNum = CW (wd); + wdp.ioVRefNum = BigEndianValue (wd); retval = PBGetWDInfo (&wdp, FALSE); if (retval == noErr) { @@ -216,9 +217,9 @@ PUBLIC void Executor::ROMlib_adjustdirid(LONGINT *diridp, HVCB *vcbp, INTEGER vr if (*(ULONGINT *) diridp <= 1 && ISWDNUM(vrefnum)) { wdp = WDNUMTOWDP(vrefnum); if (MR(wdp->vcbp) == vcbp) - *diridp = CL(wdp->dirid); - } else if (*diridp == 0 && !vrefnum /* vcbp == CL(DefVCBPtr) */) - *diridp = CL(DefDirID); + *diridp = BigEndianValue(wdp->dirid); + } else if (*diridp == 0 && !vrefnum /* vcbp == BigEndianValue(DefVCBPtr) */) + *diridp = BigEndianValue(DefDirID); if (*diridp == 0) *diridp = 2; } diff --git a/src/hfsXbar.cpp b/src/hfsXbar.cpp index 4cda1eec..9aadd7b5 100644 --- a/src/hfsXbar.cpp +++ b/src/hfsXbar.cpp @@ -18,6 +18,7 @@ char ROMlib_rcsid_hfsXbar[] = #include "rsys/prefs.h" using namespace Executor; +using namespace ByteSwap; /* * TODO: pass the information gleaned by hfsvol and hfsfil into the @@ -31,7 +32,7 @@ void cachecheck(HVCB *vcbp) cachehead *headp; INTEGER i; - headp = (cachehead *) CL(vcbp->vcbCtlBuf); + headp = (cachehead *) BigEndianValue(vcbp->vcbCtlBuf); for (i = Cx(headp->nitems), cachep = Cx(headp->flink); --i >= 0; cachep = Cx(cachep->flink)) if (Cx(cachep->flags) & CACHEBUSY) @@ -165,7 +166,7 @@ A2(PUBLIC trap, OSErrRET, PBRead, ParmBlkPtr, pb, BOOLEAN, async) if (ROMlib_directdiskaccess) { dqp = ROMlib_dqbydrive(Cx(pb->ioParam.ioVRefNum)); if (!dqp) { - pb->ioParam.ioResult = CW(nsvErr); + pb->ioParam.ioResult = BigEndianValue(nsvErr); pb->ioParam.ioActCount = 0; } else { if (dqp->hfs.fd == -1) @@ -176,10 +177,10 @@ A2(PUBLIC trap, OSErrRET, PBRead, ParmBlkPtr, pb, BOOLEAN, async) pb->ioParam.ioActCount = 0; } else if (Cx(pb->ioParam.ioPosMode) != fsFromStart) { - pb->ioParam.ioResult = CW(paramErr); /* for now */ + pb->ioParam.ioResult = BigEndianValue(paramErr); /* for now */ pb->ioParam.ioActCount = 0; } else - pb->ioParam.ioResult = CW(ROMlib_transphysblk(&dqp->hfs, + pb->ioParam.ioResult = BigEndianValue(ROMlib_transphysblk(&dqp->hfs, Cx(pb->ioParam.ioPosOffset), Cx(pb->ioParam.ioReqCount) / PHYSBSIZE, MR(pb->ioParam.ioBuffer), reading, @@ -187,7 +188,7 @@ A2(PUBLIC trap, OSErrRET, PBRead, ParmBlkPtr, pb, BOOLEAN, async) } } else { - pb->ioParam.ioResult = CW(vLckdErr); + pb->ioParam.ioResult = BigEndianValue(vLckdErr); pb->ioParam.ioActCount = 0; } retval = Cx(pb->ioParam.ioResult); @@ -202,17 +203,17 @@ A2(PUBLIC trap, OSErrRET, PBRead, ParmBlkPtr, pb, BOOLEAN, async) ParamBlockRec pbr; pbr = *pb; - to_find = CW (pb->ioParam.ioPosMode) >> 8; + to_find = BigEndianValue (pb->ioParam.ioPosMode) >> 8; pbr.ioParam.ioPosMode &= CWC (0x7F); - buf = (char*)alloca (CL (pb->ioParam.ioReqCount)); + buf = (char*)alloca (BigEndianValue (pb->ioParam.ioReqCount)); pbr.ioParam.ioBuffer = (Ptr) RM (buf); retval = PBRead (&pbr, FALSE); pb->ioParam.ioActCount = pbr.ioParam.ioActCount; pb->ioParam.ioPosOffset = pbr.ioParam.ioPosOffset; - act_count = CL (pb->ioParam.ioActCount); + act_count = BigEndianValue (pb->ioParam.ioActCount); p_to_find = (char*)memchr (buf, to_find, act_count); if (to_find == '\r' && ROMlib_newlinetocr) @@ -241,7 +242,7 @@ A2(PUBLIC trap, OSErrRET, PBRead, ParmBlkPtr, pb, BOOLEAN, async) newpb.ioParam.ioRefNum = pb->ioParam.ioRefNum; newpb.ioParam.ioPosMode = CWC (fsFromMark); - newpb.ioParam.ioPosOffset = CL (- to_backup); + newpb.ioParam.ioPosOffset = BigEndianValue (- to_backup); newerr = PBSetFPos (&newpb, FALSE); if (newerr != noErr) warning_unexpected ("err = %d", newerr); @@ -251,10 +252,10 @@ A2(PUBLIC trap, OSErrRET, PBRead, ParmBlkPtr, pb, BOOLEAN, async) *p = '\r'; } memcpy (MR (pb->ioParam.ioBuffer), MR (pbr.ioParam.ioBuffer), - CL (pb->ioParam.ioActCount)); + BigEndianValue (pb->ioParam.ioActCount)); ROMlib_destroy_blocks ((syn68k_addr_t) (long) US_TO_SYN68K(MR (pb->ioParam.ioBuffer)), - CL (pb->ioParam.ioActCount), TRUE); + BigEndianValue (pb->ioParam.ioActCount), TRUE); } else { @@ -280,22 +281,22 @@ A2(PUBLIC trap, OSErrRET, PBWrite, ParmBlkPtr, pb, BOOLEAN, async) switch (Cx(pb->ioParam.ioRefNum)) { case OURHFSDREF: if (!ROMlib_directdiskaccess) - pb->ioParam.ioResult = CW(vLckdErr); + pb->ioParam.ioResult = BigEndianValue(vLckdErr); else { dqp = ROMlib_dqbydrive(Cx(pb->ioParam.ioVRefNum)); if (dqp && dqp->hfs.fd == -1) try_to_reopen (dqp); vcbp = ROMlib_vcbbydrive (Cx(pb->ioParam.ioVRefNum)); if (!dqp) - pb->ioParam.ioResult = CW(nsvErr); + pb->ioParam.ioResult = BigEndianValue(nsvErr); else if (vcbp && (Cx(vcbp->vcbAtrb) & VSOFTLOCKBIT)) - pb->ioParam.ioResult = CW(vLckdErr); + pb->ioParam.ioResult = BigEndianValue(vLckdErr); else if (vcbp && (Cx(vcbp->vcbAtrb) & VHARDLOCKBIT)) - pb->ioParam.ioResult = CW(wPrErr); + pb->ioParam.ioResult = BigEndianValue(wPrErr); else if (Cx(pb->ioParam.ioPosMode) != fsFromStart) - pb->ioParam.ioResult = CW(paramErr); /* for now */ + pb->ioParam.ioResult = BigEndianValue(paramErr); /* for now */ else - pb->ioParam.ioResult = CW(ROMlib_transphysblk(&dqp->hfs, + pb->ioParam.ioResult = BigEndianValue(ROMlib_transphysblk(&dqp->hfs, Cx(pb->ioParam.ioPosOffset), Cx(pb->ioParam.ioReqCount) / PHYSBSIZE, MR(pb->ioParam.ioBuffer), writing, @@ -310,7 +311,7 @@ A2(PUBLIC trap, OSErrRET, PBWrite, ParmBlkPtr, pb, BOOLEAN, async) #if 0 case SOUND_DRIVER_REF: p = (char *) Cx(pb->ioParam.ioBuffer); - if (CW(*(short *)p) == ffMode) { + if (BigEndianValue(*(short *)p) == ffMode) { n = Cx(pb->ioParam.ioReqCount); ROMlib_dosound(p + 4, n - 4, (void (*)(void)) 0); } @@ -413,7 +414,7 @@ A2(PUBLIC trap, OSErrRET, PBGetCatInfo, CInfoPBPtr, pb, BOOLEAN, async) BOOLEAN ishfs; StringPtr savep; - if (CW(pb->dirInfo.ioFDirIndex) < 0 && pb->hFileInfo.ioDirID == CLC (1)) + if (BigEndianValue(pb->dirInfo.ioFDirIndex) < 0 && pb->hFileInfo.ioDirID == CLC (1)) retval = -43; /* perhaps we should check for a valid volume first */ else @@ -516,7 +517,7 @@ A2(PUBLIC trap, OSErrRET, PBHGetFInfo, HParmBlkPtr, pb, BOOLEAN, async) StringPtr savep; savep = pb->ioParam.ioNamePtr; - if (CW(pb->fileParam.ioFDirIndex) > 0) /* IMIV-155, 156 */ + if (BigEndianValue(pb->fileParam.ioFDirIndex) > 0) /* IMIV-155, 156 */ pb->ioParam.ioNamePtr = 0; ishfs = hfsvol((ioParam *) pb); pb->ioParam.ioNamePtr = savep; @@ -705,7 +706,7 @@ A2(PUBLIC trap, OSErrRET, PBGetFInfo, ParmBlkPtr, pb, BOOLEAN, async) OSErr retval; savep = pb->ioParam.ioNamePtr; - if (CW(pb->fileParam.ioFDirIndex) > 0) /* IMIV-155, 156 */ + if (BigEndianValue(pb->fileParam.ioFDirIndex) > 0) /* IMIV-155, 156 */ pb->ioParam.ioNamePtr = 0; ishfs = hfsvol((ioParam *) pb); pb->ioParam.ioNamePtr = savep; @@ -837,7 +838,7 @@ A1(PUBLIC trap, OSErr, PBMountVol, ParmBlkPtr, pb) INTEGER vref; OSErr retval; - vref = CW(pb->ioParam.ioVRefNum); + vref = BigEndianValue(pb->ioParam.ioVRefNum); if (vref == 1 || vref == 2) retval = noErr; else @@ -886,7 +887,7 @@ A2(PUBLIC trap, OSErrRET, PBHGetVolParms, HParmBlkPtr, pb, BOOLEAN, async) if (vcbp) { infop = (getvolparams_info_t *) MR (pb->ioParam.ioBuffer); - rc = CL (pb->ioParam.ioReqCount); + rc = BigEndianValue (pb->ioParam.ioReqCount); nused = 0; if (roomfor (infop, vMVersion, rc)) { @@ -913,7 +914,7 @@ A2(PUBLIC trap, OSErrRET, PBHGetVolParms, HParmBlkPtr, pb, BOOLEAN, async) infop->vMForeignPrivID = CWC (2); /* fsUnixPriv + 1 */ nused += sizeof (infop->vMForeignPrivID); } - pb->ioParam.ioActCount = CL((LONGINT) nused); + pb->ioParam.ioActCount = BigEndianValue((LONGINT) nused); err = noErr; } else diff --git a/src/hle.cpp b/src/hle.cpp index 60ac7cb2..f6af5040 100644 --- a/src/hle.cpp +++ b/src/hle.cpp @@ -13,6 +13,7 @@ char ROMlib_rcsid_hle[] = #include "MemoryMgr.h" using namespace Executor; +using namespace ByteSwap; typedef struct hle_q_elt { @@ -92,12 +93,12 @@ P4 (PUBLIC pascal trap, OSErr, AcceptHighLevelEvent, /* #### *sender_id_return = ...; */ *refcon_return = current_hle_msg->userRefCon; - if (CL (*msg_buf_length_return) < CL (current_hle_msg->msgLength)) + if (BigEndianValue (*msg_buf_length_return) < BigEndianValue (current_hle_msg->msgLength)) retval = bufferIsSmall; if (retval == noErr) memcpy (msg_buf, (Ptr) MR (current_hle_msg->theMsgEvent.when), - CL (current_hle_msg->msgLength)); + BigEndianValue (current_hle_msg->msgLength)); *msg_buf_length_return = current_hle_msg->msgLength; @@ -174,9 +175,9 @@ P6 (PUBLIC pascal trap, OSErr, PostHighLevelEvent, hle_msg->theMsgEvent.when = (int32) RM (msg_buf_copy); hle_msg->theMsgEvent.modifiers = CWC (-1); - hle_msg->userRefCon = CL (refcon); - hle_msg->postingOptions = CL (post_options); - hle_msg->msgLength = CL (msg_length); + hle_msg->userRefCon = BigEndianValue (refcon); + hle_msg->postingOptions = BigEndianValue (post_options); + hle_msg->msgLength = BigEndianValue (msg_length); /* stick the new msg */ elt = (hle_q_elt_t *) NewPtr (sizeof *t); diff --git a/src/icon.cpp b/src/icon.cpp index 663d0dbe..f6b9ac8f 100644 --- a/src/icon.cpp +++ b/src/icon.cpp @@ -22,6 +22,7 @@ char ROMlib_rcsid_icon[] = #include "rsys/icon.h" using namespace Executor; +using namespace ByteSwap; #define ICON_RETURN_ERROR(error) \ ({ \ @@ -275,8 +276,8 @@ P1 (PUBLIC pascal trap, CIconHandle, GetCIcon, cicon_res = STARH (cicon_res_handle); height = RECT_HEIGHT (&cicon_res->iconPMap.bounds); - mask_data_size = CW (cicon_res->iconMask.rowBytes) * height; - bmap_data_size = CW (cicon_res->iconBMap.rowBytes) * height; + mask_data_size = BigEndianValue (cicon_res->iconMask.rowBytes) * height; + bmap_data_size = BigEndianValue (cicon_res->iconBMap.rowBytes) * height; new_size = sizeof(CIcon) - sizeof(INTEGER) + mask_data_size + bmap_data_size; cicon_handle = (CIconHandle) NewHandle (new_size); @@ -304,11 +305,11 @@ P1 (PUBLIC pascal trap, CIconHandle, GetCIcon, pmap_ctab_offset = bmap_data_offset + bmap_data_size; tmp_ctab = (CTabPtr) ((char *) &cicon_res->iconMaskData + pmap_ctab_offset); - pmap_ctab_size = sizeof (ColorTable) + (CW (tmp_ctab->ctSize) + pmap_ctab_size = sizeof (ColorTable) + (BigEndianValue (tmp_ctab->ctSize) * sizeof (ColorSpec)); pmap_data_offset = pmap_ctab_offset + pmap_ctab_size; - pmap_data_size = (CW (cicon->iconPMap.rowBytes) + pmap_data_size = (BigEndianValue (cicon->iconPMap.rowBytes) & ROWBYTES_VALUE_BITS) * height; cicon->iconMask.baseAddr = CLC_NULL; @@ -323,7 +324,7 @@ P1 (PUBLIC pascal trap, CIconHandle, GetCIcon, BlockMove ((Ptr) &cicon_res->iconMaskData + pmap_ctab_offset, (Ptr) STARH (color_table), pmap_ctab_size); - CTAB_SEED_X (color_table) = CL (GetCTSeed ()); + CTAB_SEED_X (color_table) = BigEndianValue (GetCTSeed ()); cicon->iconPMap.pmTable = RM (color_table); cicon->iconPMap.baseAddr = CLC_NULL; @@ -564,19 +565,19 @@ P4 (PUBLIC pascal trap, OSErr, PlotIconSuite, memset (&icon_rect, '\000', sizeof icon_rect); icon_size = (little_icon_p ? 16 : 32); - icon_rect.bottom = icon_rect.right = CW (icon_size); + icon_rect.bottom = icon_rect.right = BigEndianValue (icon_size); icon_pm.baseAddr = icon_data->p; - icon_pm.rowBytes = CW ( (icon_size * icon_bpp / 8) + icon_pm.rowBytes = BigEndianValue ( (icon_size * icon_bpp / 8) | PIXMAP_DEFAULT_ROW_BYTES); icon_pm.bounds = icon_rect; - icon_pm.pixelSize = icon_pm.cmpSize = CW (icon_bpp); + icon_pm.pixelSize = icon_pm.cmpSize = BigEndianValue (icon_bpp); icon_pm.cmpCount = CWC (1); icon_pm.pmTable = RM (color_table); mask_bm.baseAddr = (Ptr) RM ((char *) STARH (icon_mask) + icon_size * icon_size / 8); - mask_bm.rowBytes = CW (icon_size / 8); + mask_bm.rowBytes = BigEndianValue (icon_size / 8); mask_bm.bounds = icon_rect; CopyMask ((BitMap *) &icon_pm, &mask_bm, @@ -606,7 +607,7 @@ P1 (PUBLIC pascal trap, short, GetSuiteLabel, cotton_suite_layout_t *suitep; suitep = (cotton_suite_layout_t *) STARH (suite); - retval = CW (suitep->label); + retval = BigEndianValue (suitep->label); return retval; } @@ -617,7 +618,7 @@ P2 (PUBLIC pascal trap, OSErr, SetSuiteLabel, cotton_suite_layout_t *suitep; suitep = (cotton_suite_layout_t *) STARH (suite); - suitep->label = CW (label); + suitep->label = BigEndianValue (label); retval = noErr; return retval; diff --git a/src/image.cpp b/src/image.cpp index 3c1ac3c3..d0be523a 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -17,6 +17,7 @@ char ROMlib_rcsid_image[] = #include "rsys/image.h" using namespace Executor; +using namespace ByteSwap; #define MAX_ROWBYTES_FOR_WIDTH(w) ((((w) * 32 + 31) / 32) * 4) @@ -45,15 +46,15 @@ Executor::image_init (pixel_image_desc_t *image_desc) IMAGE_X_BITS_VALID (retval, i) = -1; PIXMAP_BASEADDR_X (bits) = (Ptr) RM (image_desc->bits[i].raw_bits); - PIXMAP_SET_ROWBYTES_X (bits, CW (image_desc->bits[i].row_bytes)); - bounds.top = CW (image_desc->bounds.top); - bounds.left = CW (image_desc->bounds.left); - bounds.bottom = CW (image_desc->bounds.bottom); - bounds.right = CW (image_desc->bounds.right); + PIXMAP_SET_ROWBYTES_X (bits, BigEndianValue (image_desc->bits[i].row_bytes)); + bounds.top = BigEndianValue (image_desc->bounds.top); + bounds.left = BigEndianValue (image_desc->bounds.left); + bounds.bottom = BigEndianValue (image_desc->bounds.bottom); + bounds.right = BigEndianValue (image_desc->bounds.right); retval->bounds = bounds; PIXMAP_BOUNDS (bits) = bounds; bpp = image_desc->bits[i].bpp; - PIXMAP_CMP_SIZE_X (bits) = PIXMAP_PIXEL_SIZE_X (bits) = CW (bpp); + PIXMAP_CMP_SIZE_X (bits) = PIXMAP_PIXEL_SIZE_X (bits) = BigEndianValue (bpp); if (i == 0) { /* the `zero' image is simply a 1bbp black and white image */ @@ -70,12 +71,12 @@ Executor::image_init (pixel_image_desc_t *image_desc) bits_ctab = PIXMAP_TABLE (bits); SetHandleSize ((Handle) bits_ctab, CTAB_STORAGE_FOR_SIZE ((1 << bpp) - 1)); - CTAB_SIZE_X (bits_ctab) = CW ((1 << bpp) - 1); + CTAB_SIZE_X (bits_ctab) = BigEndianValue ((1 << bpp) - 1); bits_ctab_table = CTAB_TABLE (bits_ctab); for (j = 0; j <= (1 << bpp) - 1; j ++) - bits_ctab_table[j].value = CW (j); + bits_ctab_table[j].value = BigEndianValue (j); CTAB_FLAGS_X (bits_ctab) = CWC (0); - CTAB_SEED_X (bits_ctab) = CL (GetCTSeed ()); + CTAB_SEED_X (bits_ctab) = BigEndianValue (GetCTSeed ()); } { @@ -89,7 +90,7 @@ Executor::image_init (pixel_image_desc_t *image_desc) p = NewPtr (x_row_bytes * height); memset (p, 0, x_row_bytes * height); PIXMAP_BASEADDR_X (x_bits) = RM (p); - PIXMAP_SET_ROWBYTES_X (x_bits, CW (x_row_bytes)); + PIXMAP_SET_ROWBYTES_X (x_bits, BigEndianValue (x_row_bytes)); } } @@ -189,5 +190,5 @@ Executor::image_update_ctab (pixel_image_t *image, const RGBColor *new_colors, } if (ctab_changed_p) - CTAB_SEED_X (bits_ctab) = CL (GetCTSeed ()); + CTAB_SEED_X (bits_ctab) = BigEndianValue (GetCTSeed ()); } diff --git a/src/include/MacTypes.h b/src/include/MacTypes.h index ca0a2720..577982d3 100644 --- a/src/include/MacTypes.h +++ b/src/include/MacTypes.h @@ -69,8 +69,8 @@ typedef double Extended; typedef LONGINT Size; typedef INTEGER OSErr; -typedef LONGINT OSType; -typedef LONGINT ResType; +typedef ULONGINT OSType; +typedef ULONGINT ResType; typedef LONGINT OSErrRET; /* for smashing d0 just like the Mac */ typedef LONGINT INTEGERRET; diff --git a/src/include/rsys/common.h b/src/include/rsys/common.h index c69896c1..3c447a2c 100644 --- a/src/include/rsys/common.h +++ b/src/include/rsys/common.h @@ -52,6 +52,45 @@ #endif #ifdef __cplusplus +namespace ByteSwap { +template < size_t size > +inline void sized_byteswap(char* data); + +template <> +inline void sized_byteswap< 2 >(char* data) +{ + uint16_t* ptr = reinterpret_cast(data); + *ptr = __builtin_bswap16(*ptr); +} + +template <> +inline void sized_byteswap< 4 >(char* data) +{ + uint32_t* ptr = reinterpret_cast(data); + *ptr = __builtin_bswap32(*ptr); +} + + template <> + inline void sized_byteswap< 8 >(char* data) + { + uint64_t* ptr = reinterpret_cast(data); + *ptr = __builtin_bswap64(*ptr); + } + + +template < typename T > +T BigEndianValue(T value) +{ + sized_byteswap< sizeof(T) >(reinterpret_cast(&value)); + return value; +} + + template < typename T > + void BigEndianInPlace(T &value) + { + sized_byteswap< sizeof(T) >(reinterpret_cast(&value)); + } +} namespace Executor { #endif typedef struct diff --git a/src/interfacelib.cpp b/src/interfacelib.cpp index f1d6f1d3..080d18b7 100644 --- a/src/interfacelib.cpp +++ b/src/interfacelib.cpp @@ -106,7 +106,7 @@ PRIVATE int32 LMGetLastSPExtra (void) { warning_trace_info (NULL_STRING); - return CW (LastSPExtra); + return BigEndianValue (LastSPExtra); } PRIVATE GDHandle @@ -134,14 +134,14 @@ PRIVATE INTEGER LMGetResErr (void) { warning_trace_info (NULL_STRING); - return CW (ResErr); + return BigEndianValue (ResErr); } PRIVATE INTEGER LMGetPrintErr (void) { warning_trace_info (NULL_STRING); - return CW (PrintErr); + return BigEndianValue (PrintErr); } PRIVATE Ptr @@ -155,7 +155,7 @@ PRIVATE uint32 LMGetCaretTime (void) { warning_trace_info (NULL_STRING); - return CL (CaretTime); + return BigEndianValue (CaretTime); } #if 0 @@ -178,7 +178,7 @@ PRIVATE INTEGER LMGetAtMenuBottom (void) { warning_trace_info (NULL_STRING); - return CW (AtMenuBottom); + return BigEndianValue (AtMenuBottom); } PRIVATE uint8 @@ -210,14 +210,14 @@ PRIVATE INTEGER LMGetTopMenuItem (void) { warning_trace_info (NULL_STRING); - return CW (TopMenuItem); + return BigEndianValue (TopMenuItem); } PRIVATE uint32 LMGetDoubleTime (void) { warning_trace_info (NULL_STRING); - return CL (DoubleTime); + return BigEndianValue (DoubleTime); } PRIVATE StringHandle @@ -245,7 +245,7 @@ PRIVATE int16 LMGetROM85 (void) { warning_trace_info (NULL_STRING); - return CW (ROM85); + return BigEndianValue (ROM85); } PRIVATE uint8 @@ -259,7 +259,7 @@ PRIVATE INTEGER LMGetScrHRes (void) { warning_trace_info (NULL_STRING); - return CW (ScrHRes); + return BigEndianValue (ScrHRes); } PRIVATE StringPtr @@ -273,7 +273,7 @@ PRIVATE INTEGER LMGetSysMap (void) { warning_trace_info (NULL_STRING); - return CW (SysMap); + return BigEndianValue (SysMap); } PRIVATE THz @@ -308,7 +308,7 @@ PRIVATE uint32 LMGetTicks (void) { warning_trace_info (NULL_STRING); - return CL (Ticks); + return BigEndianValue (Ticks); } PRIVATE uint8 @@ -343,7 +343,7 @@ PRIVATE INTEGER LMGetMBarHeight (void) { warning_trace_info (NULL_STRING); - return CW (MBarHeight); + return BigEndianValue (MBarHeight); } PRIVATE Handle @@ -357,35 +357,35 @@ PRIVATE INTEGER LMGetScrVRes (void) { warning_trace_info (NULL_STRING); - return CW (ScrVRes); + return BigEndianValue (ScrVRes); } PRIVATE void LMSetMenuDisable (int32 val) { warning_trace_info (NULL_STRING); - MenuDisable = CL (val); + MenuDisable = BigEndianValue (val); } PRIVATE void LMSetAtMenuBottom (INTEGER val) { warning_trace_info (NULL_STRING); - AtMenuBottom = CW (val); + AtMenuBottom = BigEndianValue (val); } PRIVATE void LMSetTopMenuItem (INTEGER val) { warning_trace_info (NULL_STRING); - TopMenuItem = CW (val); + TopMenuItem = BigEndianValue (val); } PRIVATE void LMSetSFSaveDisk (INTEGER val) { warning_trace_info (NULL_STRING); - SFSaveDisk = CW (val); + SFSaveDisk = BigEndianValue (val); } PRIVATE void @@ -420,7 +420,7 @@ PRIVATE void LMSetResErr (INTEGER val) { warning_trace_info (NULL_STRING); - ResErr = CW (val); + ResErr = BigEndianValue (val); } PRIVATE void @@ -434,21 +434,21 @@ PRIVATE void LMSetCurDirStore (INTEGER val) { warning_trace_info (NULL_STRING); - CurDirStore = CW (val); + CurDirStore = BigEndianValue (val); } PRIVATE INTEGER LMGetCurApRefNum (void) { warning_trace_info (NULL_STRING); - return CW (CurApRefNum); + return BigEndianValue (CurApRefNum); } PRIVATE LONGINT LMGetCurDirStore (void) { warning_trace_info (NULL_STRING); - return CL (CurDirStore); + return BigEndianValue (CurDirStore); } PRIVATE uint8 @@ -462,7 +462,7 @@ PRIVATE INTEGER LMGetSysFontSize (void) { warning_trace_info (NULL_STRING); - return CW (SysFontSiz); + return BigEndianValue (SysFontSiz); } PRIVATE INTEGER @@ -481,14 +481,14 @@ PRIVATE INTEGER LMGetSFSaveDisk (void) { warning_trace_info (NULL_STRING); - return CW (SFSaveDisk); + return BigEndianValue (SFSaveDisk); } PRIVATE INTEGER LMGetSysFontFam (void) { warning_trace_info (NULL_STRING); - return CW (SysFontFam); + return BigEndianValue (SysFontFam); } PRIVATE Handle @@ -502,14 +502,14 @@ PRIVATE void LMSetSysFontFam (INTEGER val) { warning_trace_info (NULL_STRING); - SysFontFam = CW (val); + SysFontFam = BigEndianValue (val); } PRIVATE void LMSetSysFontSize (INTEGER val) { warning_trace_info (NULL_STRING); - SysFontSiz = CW (val); + SysFontSiz = BigEndianValue (val); } PRIVATE WindowPtr @@ -523,14 +523,14 @@ PRIVATE INTEGER LMGetCurJTOffset (void) { warning_trace_info (NULL_STRING); - return CW (CurJTOffset); + return BigEndianValue (CurJTOffset); } PRIVATE INTEGER LMGetCurMap (void) { warning_trace_info (NULL_STRING); - return CW (CurMap); + return BigEndianValue (CurMap); } PRIVATE Ptr @@ -544,7 +544,7 @@ PRIVATE INTEGER LMGetFSFCBLen (void) { warning_trace_info (NULL_STRING); - return CW (FSFCBLen); + return BigEndianValue (FSFCBLen); } PRIVATE Handle @@ -566,7 +566,7 @@ PRIVATE INTEGER LMGetHWCfgFlags (void) { warning_trace_info (NULL_STRING); - return CW (SCSIFlags); + return BigEndianValue (SCSIFlags); } PRIVATE Byte @@ -587,21 +587,21 @@ PRIVATE INTEGER LMGetKeyThresh (void) { warning_trace_info (NULL_STRING); - return CW (KeyThresh); + return BigEndianValue (KeyThresh); } PRIVATE INTEGER LMGetSysEvtMask (void) { warning_trace_info (NULL_STRING); - return CW (SysEvtMask); + return BigEndianValue (SysEvtMask); } PRIVATE INTEGER LMGetTEScrpLength (void) { warning_trace_info (NULL_STRING); - return CW (TEScrpLength); + return BigEndianValue (TEScrpLength); } PRIVATE uint32 @@ -609,7 +609,7 @@ LMGetTime (void) { warning_trace_info (NULL_STRING); GetDateTime (&Time); - return CL (Time); + return BigEndianValue (Time); } PRIVATE WindowPeek @@ -623,14 +623,14 @@ PRIVATE INTEGER LMGetTESysJust (void) { warning_trace_info (NULL_STRING); - return CW (TESysJust); + return BigEndianValue (TESysJust); } PRIVATE INTEGER LMGetBootDrive (void) { warning_trace_info (NULL_STRING); - return CW (BootDrive); + return BigEndianValue (BootDrive); } PRIVATE Byte @@ -659,7 +659,7 @@ PRIVATE void LMSetTESysJust (INTEGER val) { warning_trace_info (NULL_STRING); - TESysJust = CW (val); + TESysJust = BigEndianValue (val); } PRIVATE void @@ -680,7 +680,7 @@ PRIVATE void LMSetCurMap (INTEGER val) { warning_trace_info (NULL_STRING); - CurMap = CW (val); + CurMap = BigEndianValue (val); } PRIVATE void @@ -702,14 +702,14 @@ LMSetLastSPExtra (LONGINT val) { warning_trace_info (NULL_STRING); warning_unimplemented ("val = 0x%x", val); - LastSPExtra = CL (val); + LastSPExtra = BigEndianValue (val); } PRIVATE void LMSetMBarHeight (INTEGER val) { warning_trace_info (NULL_STRING); - MBarHeight = CW (val); + MBarHeight = BigEndianValue (val); } PRIVATE void @@ -724,7 +724,7 @@ PRIVATE void LMSetTEScrpLength (INTEGER val) { warning_trace_info (NULL_STRING); - TEScrpLength = CW (val); + TEScrpLength = BigEndianValue (val); } PRIVATE void @@ -960,7 +960,7 @@ CloseWD (INTEGER wdref) WDPBRec pb; memset (&pb, 0, sizeof pb); - pb.ioVRefNum = CW (wdref); + pb.ioVRefNum = BigEndianValue (wdref); retval = PBCloseWD (&pb, FALSE); warning_trace_info ("retval = %d", retval); return retval; @@ -1008,8 +1008,8 @@ HRstFLock (INTEGER vref, LONGINT dirid, Str255 file) HParamBlockRec pb; memset (&pb, 0, sizeof pb); - pb.ioParam.ioVRefNum = CW (vref); - pb.fileParam.ioDirID = CL (dirid); + pb.ioParam.ioVRefNum = BigEndianValue (vref); + pb.fileParam.ioDirID = BigEndianValue (dirid); pb.ioParam.ioNamePtr = file; warning_trace_info (NULL_STRING); retval = PBHRstFLock (&pb, FALSE); @@ -1023,8 +1023,8 @@ HDelete (INTEGER vrefnum, LONGINT dirid, Str255 filename) HParamBlockRec pb; memset (&pb, 0, sizeof pb); - pb.ioParam.ioVRefNum = CW (vrefnum); - pb.fileParam.ioDirID = CL (dirid); + pb.ioParam.ioVRefNum = BigEndianValue (vrefnum); + pb.fileParam.ioDirID = BigEndianValue (dirid); pb.ioParam.ioNamePtr = filename; retval = PBHDelete (&pb, FALSE); warning_trace_info ("HDelete(%d, %d, %.*s) = %d", vrefnum, dirid, @@ -1039,8 +1039,8 @@ HOpenDF (INTEGER vref, LONGINT dirid, Str255 file, int8 perm, INTEGER *refp) HParamBlockRec pb; memset (&pb, 0, sizeof pb); - pb.ioParam.ioVRefNum = CW (vref); - pb.fileParam.ioDirID = CL (dirid); + pb.ioParam.ioVRefNum = BigEndianValue (vref); + pb.fileParam.ioDirID = BigEndianValue (dirid); pb.ioParam.ioNamePtr = file; pb.ioParam.ioPermssn = perm; warning_trace_info (NULL_STRING); @@ -2361,7 +2361,7 @@ SetCurrentA5 (void) uint32 retval; retval = (uint32) SYN68K_TO_US (EM_A5); - EM_A5 = (uint32) CL (CurrentA5); + EM_A5 = (uint32) BigEndianValue (CurrentA5); warning_trace_info ("old = 0x%x, new = 0x%x", retval, EM_A5); return retval; } @@ -2485,9 +2485,9 @@ OpenWD (INTEGER vref, LONGINT dirid, LONGINT procid, INTEGER *wdrefp) OSErr retval; memset (&wdpb, 0, sizeof wdpb); - wdpb.ioVRefNum = CW (vref); - wdpb.ioWDDirID = CL (dirid); - wdpb.ioWDProcID = CL (procid); + wdpb.ioVRefNum = BigEndianValue (vref); + wdpb.ioWDDirID = BigEndianValue (dirid); + wdpb.ioWDProcID = BigEndianValue (procid); retval = PBOpenWD (&wdpb, FALSE); if (retval == noErr) *wdrefp = wdpb.ioVRefNum; @@ -2502,8 +2502,8 @@ DirCreate (INTEGER vref, LONGINT parid, Str255 dirname, LONGINT *outdir) HParamBlockRec hpb; memset (&hpb, 0, sizeof hpb); - hpb.ioParam.ioVRefNum = CW (vref); - hpb.fileParam.ioDirID = CL (parid); + hpb.ioParam.ioVRefNum = BigEndianValue (vref); + hpb.fileParam.ioDirID = BigEndianValue (parid); hpb.ioParam.ioNamePtr = RM ((Ptr) dirname); retval = PBDirCreate (&hpb, FALSE); if (retval == noErr) @@ -2735,8 +2735,8 @@ HSetVol (StringPtr volName, INTEGER vref, LONGINT dirid) WDPBRec wdp; wdp.ioNamePtr = RM (volName); - wdp.ioVRefNum = CW (vref); - wdp.ioWDDirID = CL (dirid); + wdp.ioVRefNum = BigEndianValue (vref); + wdp.ioWDDirID = BigEndianValue (dirid); retval = PBHSetVol (&wdp, FALSE); warning_trace_info ("retval = %d", retval); return retval; @@ -2749,8 +2749,8 @@ HOpen (INTEGER vref, LONGINT dirid, Str255 filename, SignedByte perm, OSErr retval; HParamBlockRec hpb; - hpb.ioParam.ioVRefNum = CW (vref); - hpb.fileParam.ioDirID = CL (dirid); + hpb.ioParam.ioVRefNum = BigEndianValue (vref); + hpb.fileParam.ioDirID = BigEndianValue (dirid); hpb.ioParam.ioNamePtr = RM (filename); hpb.ioParam.ioPermssn = CB (perm); retval = PBHOpen (&hpb, FALSE); @@ -2768,8 +2768,8 @@ HSetFInfo (INTEGER vref, LONGINT dirid, Str255 filename, FInfo *finfop) OSErr retval; HParamBlockRec hpb; - hpb.ioParam.ioVRefNum = CW (vref); - hpb.fileParam.ioDirID = CL (dirid); + hpb.ioParam.ioVRefNum = BigEndianValue (vref); + hpb.fileParam.ioDirID = BigEndianValue (dirid); hpb.ioParam.ioNamePtr = RM (filename); hpb.fileParam.ioFlFndrInfo = *finfop; retval = PBHSetFInfo (&hpb, FALSE); @@ -2812,7 +2812,7 @@ MPPOpen_stub (void) PRIVATE void SetDialogFont (INTEGER font) { - DlgFont = CW (font); + DlgFont = BigEndianValue (font); warning_trace_info (NULL_STRING); } diff --git a/src/iu.cpp b/src/iu.cpp index 6b070662..f75cfb41 100644 --- a/src/iu.cpp +++ b/src/iu.cpp @@ -21,6 +21,7 @@ char ROMlib_rcsid_iu[] = #include using namespace Executor; +using namespace ByteSwap; /* * outl adds the characters in the four bytes of a longint to the place @@ -164,19 +165,19 @@ P4(PUBLIC pascal trap, void, IUDatePString, LONGINT, date, /* IMI-505 */ if (h && (int0p = (Intl0Ptr) STARH(h))) { switch (Cx(int0p->dateOrder)) { case mdy: - month(CW(dtr.month), int0p, Cx(int0p->dateSep), &op); - day (CW(dtr.day), int0p, Cx(int0p->dateSep), &op); - year (CW(dtr.year), int0p, 0, &op); + month(BigEndianValue(dtr.month), int0p, Cx(int0p->dateSep), &op); + day (BigEndianValue(dtr.day), int0p, Cx(int0p->dateSep), &op); + year (BigEndianValue(dtr.year), int0p, 0, &op); break; case dmy: - day (CW(dtr.day), int0p, Cx(int0p->dateSep), &op); - month(CW(dtr.month), int0p, Cx(int0p->dateSep), &op); - year (CW(dtr.year), int0p, 0, &op); + day (BigEndianValue(dtr.day), int0p, Cx(int0p->dateSep), &op); + month(BigEndianValue(dtr.month), int0p, Cx(int0p->dateSep), &op); + year (BigEndianValue(dtr.year), int0p, 0, &op); break; case ymd: - year (CW(dtr.year), int0p, Cx(int0p->dateSep), &op); - month(CW(dtr.month), int0p, Cx(int0p->dateSep), &op); - day (CW(dtr.day), int0p, 0, &op); + year (BigEndianValue(dtr.year), int0p, Cx(int0p->dateSep), &op); + month(BigEndianValue(dtr.month), int0p, Cx(int0p->dateSep), &op); + day (BigEndianValue(dtr.day), int0p, 0, &op); break; } } @@ -185,20 +186,20 @@ P4(PUBLIC pascal trap, void, IUDatePString, LONGINT, date, /* IMI-505 */ abbrev = form == longDate ? 0 : Cx(int1p->abbrLen); outl(Cx(int1p->st0), &op); if (!Cx(int1p->suppressDay)) { - outs(int1p->days[CW(dtr.dayOfWeek)-1], abbrev, &op); + outs(int1p->days[BigEndianValue(dtr.dayOfWeek)-1], abbrev, &op); outl(Cx(int1p->st1), &op); } if (Cx(int1p->lngDateFmt)) { - outs(int1p->months[CW(dtr.month)-1], abbrev, &op); + outs(int1p->months[BigEndianValue(dtr.month)-1], abbrev, &op); outl(Cx(int1p->st2), &op); - outn(CW(dtr.day), Cx(int1p->dayLeading0), &op); + outn(BigEndianValue(dtr.day), Cx(int1p->dayLeading0), &op); } else { - outn(CW(dtr.day), Cx(int1p->dayLeading0), &op); + outn(BigEndianValue(dtr.day), Cx(int1p->dayLeading0), &op); outl(Cx(int1p->st2), &op); - outs(int1p->months[CW(dtr.month)-1], abbrev, &op); + outs(int1p->months[BigEndianValue(dtr.month)-1], abbrev, &op); } outl(Cx(int1p->st3), &op); - outn(CW(dtr.year), FALSE, &op); + outn(BigEndianValue(dtr.year), FALSE, &op); outl(Cx(int1p->st4), &op); } } @@ -260,20 +261,20 @@ P4(PUBLIC pascal trap, void, IUTimePString, LONGINT, date, /* IMI-505 */ if (h && (int0p = (Intl0Ptr) STARH(h))) { Secs2Date(date, &dtr); if (int0p->timeCycle) - outn((CW(dtr.hour) % 12) == 0 ? 12 : CW(dtr.hour) % 12, + outn((BigEndianValue(dtr.hour) % 12) == 0 ? 12 : BigEndianValue(dtr.hour) % 12, Cx(int0p->timeFmt) & hrLeadingZ, &op); else - outn(CW(dtr.hour), Cx(int0p->timeFmt) & hrLeadingZ, &op); + outn(BigEndianValue(dtr.hour), Cx(int0p->timeFmt) & hrLeadingZ, &op); *op++ = int0p->timeSep; - outn(CW(dtr.minute), Cx(int0p->timeFmt) & minLeadingZ, &op); + outn(BigEndianValue(dtr.minute), Cx(int0p->timeFmt) & minLeadingZ, &op); if (secs) { *op++ = int0p->timeSep; - outn(CW(dtr.second), Cx(int0p->timeFmt) & secLeadingZ, &op); + outn(BigEndianValue(dtr.second), Cx(int0p->timeFmt) & secLeadingZ, &op); } /* IMI-499 is misleading about the timenSuff fields. The first four are used for AM, the second four for PM. Yes, that's dumb. But that's how the Mac works. Sigh. */ - if (!int0p->timeCycle && CW(dtr.hour) < 12) + if (!int0p->timeCycle && BigEndianValue(dtr.hour) < 12) for (ip = (char *) &int0p->time1Suff, ep = ip + 4; ip != ep && *ip;) *op++ = *ip++; @@ -281,7 +282,7 @@ P4(PUBLIC pascal trap, void, IUTimePString, LONGINT, date, /* IMI-505 */ for (ip = (char *) &int0p->time5Suff, ep = ip + 4; ip != ep && *ip;) *op++ = *ip++; - else if (CW(dtr.hour) < 12) + else if (BigEndianValue(dtr.hour) < 12) outl(Cx(int0p->mornStr), &op); else outl(Cx(int0p->eveStr), &op); diff --git a/src/iv-stubs.cpp b/src/iv-stubs.cpp index 3128ef10..01c1f7df 100644 --- a/src/iv-stubs.cpp +++ b/src/iv-stubs.cpp @@ -32,6 +32,7 @@ char ROMlib_rcsid_vi_stubs[] #include using namespace Executor; +using namespace ByteSwap; #define print_errno_error_message(call, msg) \ ({ \ @@ -68,9 +69,9 @@ send_image (int width, int height, color = &header.image_color_map[i]; color_spec = &CTAB_TABLE (ctab)[i]; - color->red = CW (color_spec->rgb.red); - color->green = CW (color_spec->rgb.green); - color->blue = CW (color_spec->rgb.blue); + color->red = BigEndianValue (color_spec->rgb.red); + color->green = BigEndianValue (color_spec->rgb.green); + color->blue = BigEndianValue (color_spec->rgb.blue); } /* connect to server, and send */ gethostname (hostname, 1024); @@ -125,8 +126,8 @@ dump_grafport_image (GrafPort *port) r = PORT_RECT (port); bounds = PORT_BOUNDS (port); OffsetRect (&bounds, - CW (r.left) - CW (bounds.left), - CW (r.top) - CW (bounds.top)); + BigEndianValue (r.left) - BigEndianValue (bounds.left), + BigEndianValue (r.top) - BigEndianValue (bounds.top)); SectRect (&r, &bounds, &r); dump_image (&port->portBits, &r); } @@ -148,7 +149,7 @@ dump_image (BitMap *bogo_bitmap, Rect *rect) height = RECT_HEIGHT (rect); /* destination must be 8bpp */ - depth = CW (pixmap->pixelSize); + depth = BigEndianValue (pixmap->pixelSize); if (depth != 8) { int map_width, map_height; @@ -162,7 +163,7 @@ dump_image (BitMap *bogo_bitmap, Rect *rect) map_row_bytes = ((width * 8 + 31) / 32) * 4; base_addr = (char*)alloca (map_row_bytes * height); - new_pixmap.rowBytes = CW (map_row_bytes); + new_pixmap.rowBytes = BigEndianValue (map_row_bytes); new_pixmap.baseAddr = RM ((Ptr) base_addr); new_pixmap.pixelSize = CWC (8); @@ -173,7 +174,7 @@ dump_image (BitMap *bogo_bitmap, Rect *rect) conv_table = (ColorTable*)alloca (CTAB_STORAGE_FOR_SIZE (1 << depth)); for (i = 0; i < (1 << depth); i ++) - conv_table->ctTable[i].value = CW (i); + conv_table->ctTable[i].value = BigEndianValue (i); convert_pixmap (pixmap, &new_pixmap, rect, conv_table); @@ -182,15 +183,15 @@ dump_image (BitMap *bogo_bitmap, Rect *rect) } else { - map_row_bytes = CW ((unsigned short) pixmap->rowBytes + map_row_bytes = BigEndianValue ((unsigned short) pixmap->rowBytes & ~ROWBYTES_FLAG_BITS_X); base_addr = MR ((char *) pixmap->baseAddr); } row_bytes = width; _base_addr - = &base_addr[(CW (rect->top) - CW (pixmap->bounds.top)) * map_row_bytes - + (CW (rect->left) - CW (pixmap->bounds.left))]; + = &base_addr[(BigEndianValue (rect->top) - BigEndianValue (pixmap->bounds.top)) * map_row_bytes + + (BigEndianValue (rect->left) - BigEndianValue (pixmap->bounds.left))]; send_image (width, height, map_row_bytes, row_bytes, _base_addr, @@ -208,7 +209,7 @@ dump_rgn_as_image (RgnHandle rh) bm.bounds = RGN_BBOX (rh); row_bytes = ((RECT_WIDTH (&bm.bounds) + 31) / 32) * 4; - bm.rowBytes = CW (row_bytes); + bm.rowBytes = BigEndianValue (row_bytes); baseaddr = (char*)alloca (row_bytes * RECT_HEIGHT (&bm.bounds)); bm.baseAddr = RM ((Ptr) baseaddr); memset (baseaddr, '\377', row_bytes * RECT_HEIGHT (&bm.bounds)); diff --git a/src/launch.cpp b/src/launch.cpp index bcb05017..6d479c61 100644 --- a/src/launch.cpp +++ b/src/launch.cpp @@ -88,6 +88,7 @@ char ROMlib_rcsid_launch[] = #include "rsys/appearance.h" using namespace Executor; +using namespace ByteSwap; PRIVATE boolean_t ppc_launch_p = FALSE; @@ -361,7 +362,7 @@ PRIVATE void beginexecutingat( LONGINT startpc ) EM_A2 = EM_D3; EM_A3 = 0; EM_A4 = 0; - EM_A5 = CL((LONGINT) CurrentA5); /* was smashed when we + EM_A5 = BigEndianValue((LONGINT) CurrentA5); /* was smashed when we initialized above */ EM_A6 = 0x1EF; @@ -388,9 +389,9 @@ PUBLIC void Executor::SFSaveDisk_Update (INTEGER vrefnum, Str255 filename) str255assign (save_name, filename); pbr.volumeParam.ioNamePtr = (StringPtr) RM ((long) save_name); pbr.volumeParam.ioVolIndex = CWC (-1); - pbr.volumeParam.ioVRefNum = CW (vrefnum); + pbr.volumeParam.ioVRefNum = BigEndianValue (vrefnum); PBGetVInfo (&pbr, FALSE); - SFSaveDisk = CW (-CW (pbr.volumeParam.ioVRefNum)); + SFSaveDisk = BigEndianValue (-BigEndianValue (pbr.volumeParam.ioVRefNum)); } PUBLIC uint32 Executor::ROMlib_version_long; @@ -419,7 +420,7 @@ Executor::ROMlib_find_cfrg (Handle cfrg, OSType arch, uint8 type, Str255 name) cfrgp = (cfrg_resource_t *) STARH (cfrg); cfirp = (cfir_t *) ((char *) cfrgp + sizeof *cfrgp); - desired_arch_x = CL (arch); + desired_arch_x = BigEndianValue (arch); type_x = CB (type); for (n_descripts = CFRG_N_DESCRIPTS (cfrgp); n_descripts > 0 && !cfrg_match (cfirp, desired_arch_x, type_x, name); @@ -527,11 +528,11 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, CInfoPBRec hpb; hpb.hFileInfo.ioNamePtr = RM(&fName[0]); - hpb.hFileInfo.ioVRefNum = CW(vRefNum); + hpb.hFileInfo.ioVRefNum = BigEndianValue(vRefNum); hpb.hFileInfo.ioFDirIndex = CWC (0); hpb.hFileInfo.ioDirID = 0; PBGetCatInfo(&hpb, FALSE); - wdpb.ioVRefNum = CW(vRefNum); + wdpb.ioVRefNum = BigEndianValue(vRefNum); wdpb.ioWDDirID = hpb.hFileInfo.ioFlParID; } else @@ -546,7 +547,7 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, wdpb.ioWDProcID = T('X','c','t','r'); wdpb.ioNamePtr = 0; PBOpenWD(&wdpb, FALSE); - ROMlib_exevrefnum = CW(wdpb.ioVRefNum); + ROMlib_exevrefnum = BigEndianValue(wdpb.ioVRefNum); ROMlib_exefname = CurApName; #if 0 /* I'm skeptical that this is correct */ @@ -554,7 +555,7 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, CloseResFile(CurMap); #endif SetVol((StringPtr) 0, ROMlib_exevrefnum); - CurApRefNum = CW(OpenResFile(ROMlib_exefname)); + CurApRefNum = BigEndianValue(OpenResFile(ROMlib_exefname)); /* setupsignals(); */ @@ -571,19 +572,19 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, BlockMove((Ptr) ROMlib_exeuname, (Ptr) ename+1, elen); ename[0] = elen; - ROMlib_creator = CL(finfo.fdCreator); + ROMlib_creator = BigEndianValue(finfo.fdCreator); #define LEMMINGSHACK #if defined(LEMMINGSHACK) { - if (finfo.fdCreator == CL(TICK("Psyg")) - || finfo.fdCreator == CL(TICK("Psod"))) + if (finfo.fdCreator == BigEndianValue(TICK("Psyg")) + || finfo.fdCreator == BigEndianValue(TICK("Psod"))) ROMlib_flushoften = TRUE; } #endif /* defined(LEMMINGSHACK) */ #if defined (ULTIMA_III_HACK) - ROMlib_ultima_iii_hack = (finfo.fdCreator == CL(TICK("Ult3"))); + ROMlib_ultima_iii_hack = (finfo.fdCreator == BigEndianValue(TICK("Ult3"))); #endif h = GetResource(T('v','e','r','s'), 2); @@ -613,7 +614,7 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, ROMlib_directdiskaccess = FALSE; ROMlib_clear_gestalt_list (); ParseConfigFile ((StringPtr) "\017ExecutorDefault", 0); - ParseConfigFile (ename, err == noErr ? CL(finfo.fdCreator) : 0); + ParseConfigFile (ename, err == noErr ? BigEndianValue(finfo.fdCreator) : 0); ROMlib_clockonoff(!ROMlib_noclock); if ((ROMlib_ScreenSize.first != INITIALPAIRVALUE || ROMlib_MacSize.first != INITIALPAIRVALUE)) @@ -657,9 +658,9 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, size_info_t *size_resource; size_resource = (size_info_t *) STARH (size_resource_h); - size_info.size_flags = CW (size_resource->size_flags); - size_info.preferred_size = CL (size_resource->preferred_size); - size_info.minimum_size = CL (size_resource->minimum_size); + size_info.size_flags = BigEndianValue (size_resource->size_flags); + size_info.preferred_size = BigEndianValue (size_resource->preferred_size); + size_info.minimum_size = BigEndianValue (size_resource->minimum_size); size_info.size_resource_present_p = TRUE; } else @@ -679,7 +680,7 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, == SZisHighLevelEventAware); } - h = GetResource(CL(finfo.fdCreator), 0); + h = GetResource(BigEndianValue(finfo.fdCreator), 0); if (h) { namelen = *MR(*(unsigned char **)h); namebuf = (char*)alloca(namelen+1); @@ -693,7 +694,7 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, lp = 0; /* just to shut GCC up */ jumplen = jumpoff = 0; /* just to shut GCC up */ a5 = (LONGINT) (long) US_TO_SYN68K (&tmpa5); - CurrentA5 = (Ptr) CL (a5); + CurrentA5 = (Ptr) BigEndianValue (a5); InitGraf ((Ptr) quickbytes + grafSize - 4); } else @@ -701,10 +702,10 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, HLock(code0); lp = (LONGINT *) STARH(code0); - abovea5 = CL(*lp++); - belowa5 = CL(*lp++); - jumplen = CL(*lp++); - jumpoff = CL(*lp++); + abovea5 = BigEndianValue(*lp++); + belowa5 = BigEndianValue(*lp++); + jumplen = BigEndianValue(*lp++); + jumpoff = BigEndianValue(*lp++); /* * NOTE: The stack initialization code that was here has been moved @@ -714,17 +715,17 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, #if defined(SYN68K) EM_A7 -= abovea5 + belowa5; - CurStackBase = (Ptr) CL(EM_A7); + CurStackBase = (Ptr) BigEndianValue(EM_A7); #else /* !defined(SYN68K) */ ROMlib_foolgcc = alloca(abovea5 + belowa5); CurStackBase - = CL(MAC_STACK_START + MAC_STACK_SIZE - (abovea5 + belowa5)); + = BigEndianValue(MAC_STACK_START + MAC_STACK_SIZE - (abovea5 + belowa5)); #endif /* !defined(SYN68K) */ CurrentA5 = RM(MR(CurStackBase) + belowa5); /* set CurrentA5 */ BufPtr = RM(MR(CurrentA5) + abovea5); - CurJTOffset = CW(jumpoff); - a5 = CL((LONGINT) CurrentA5); + CurJTOffset = BigEndianValue(jumpoff); + a5 = BigEndianValue((LONGINT) CurrentA5); } GetDateTime((LONGINT *) &Time); @@ -769,7 +770,7 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, ROMlib_uaf = 0; if (code0) - beginexecutingat(CL((LONGINT) CurrentA5) + CW(CurJTOffset) + 2); + beginexecutingat(BigEndianValue((LONGINT) CurrentA5) + BigEndianValue(CurJTOffset) + 2); else { FSSpec fs; @@ -1062,7 +1063,7 @@ PRIVATE void reset_low_globals(void) MBSaveLoc = 0; SysFontFam = 0; - SysVersion = CW (system_version); + SysVersion = BigEndianValue (system_version); FSFCBLen = CWC (94); /* @@ -1161,7 +1162,7 @@ PRIVATE void reset_low_globals(void) } SysEvtMask = CWC(~(1L<< keyUp)); /* EVERYTHING except keyUp */ SdVolume = 7; /* for Beebop 2 */ - CurrentA5 = (Ptr) CL (EM_A5); + CurrentA5 = (Ptr) BigEndianValue (EM_A5); } PRIVATE void reset_traps(void) @@ -1262,18 +1263,18 @@ PRIVATE void reinitialize_things(void) } } - length = CW(*(short *)MR(FCBSPtr)); + length = BigEndianValue(*(short *)MR(FCBSPtr)); fcbp = (filecontrolblock *) ((short *)MR(FCBSPtr)+1); efcbp = (filecontrolblock *) ((char *)MR(FCBSPtr) + length); for (;fcbp < efcbp; - fcbp = (filecontrolblock *) ((char *)fcbp + CW(FSFCBLen))) + fcbp = (filecontrolblock *) ((char *)fcbp + BigEndianValue(FSFCBLen))) { INTEGER rn; rn = (char *) fcbp - (char *) MR(FCBSPtr); if (fcbp->fcbCName[0] /* && rn != Param_ram_rn */ - && rn != CW (SysMap) + && rn != BigEndianValue (SysMap) && rn != special_fn) FSClose((char *) fcbp - (char *) MR(FCBSPtr)); } @@ -1312,7 +1313,7 @@ ROMlib_filename_from_fsspec (char **strp, FSSpec *fsp) memset (&pbr, 0, sizeof pbr); pbr.ioParam.ioVRefNum = fsp->vRefNum; pbr.ioParam.ioNamePtr = (StringPtr) RM ((Ptr) fsp->name); - retval = ROMlib_nami (&pbr, CL (fsp->parID), NoIndex, strp, &filename, + retval = ROMlib_nami (&pbr, BigEndianValue (fsp->parID), NoIndex, strp, &filename, &endname, FALSE, &vcbp, &sbuf); return retval; } @@ -1358,7 +1359,7 @@ Executor::NewLaunch (StringPtr fName_arg, INTEGER vRefNum_arg, LaunchParamBlockR if (lpbp->launchAppParameters) { ap = MR (lpbp->launchAppParameters); - n_filenames += CW (ap->n_fsspec); + n_filenames += BigEndianValue (ap->n_fsspec); } n_filename_bytes = n_filenames * sizeof *filenames; filenames = (char**)alloca (n_filename_bytes); diff --git a/src/listAccess.cpp b/src/listAccess.cpp index 0c2b0ae2..d591c0f8 100644 --- a/src/listAccess.cpp +++ b/src/listAccess.cpp @@ -17,6 +17,7 @@ char ROMlib_rcsid_listAccess[] = #include "rsys/hook.h" using namespace Executor; +using namespace ByteSwap; P4(PUBLIC pascal trap, void, LFind, INTEGER *, offsetp, /* IMIV-274 */ INTEGER *, lenp, Cell, cell, ListHandle, list) @@ -25,7 +26,7 @@ P4(PUBLIC pascal trap, void, LFind, INTEGER *, offsetp, /* IMIV-274 */ if ((ip = ROMlib_getoffp(cell, list))) { *offsetp = *ip++ & CWC(0x7FFF); - *lenp = CW((CW(*ip) & 0x7FFF) - CW(*offsetp)); + *lenp = BigEndianValue((BigEndianValue(*ip) & 0x7FFF) - BigEndianValue(*offsetp)); } else *offsetp = *lenp = CWC(-1); } @@ -37,8 +38,8 @@ P4(PUBLIC pascal trap, BOOLEAN, LNextCell, BOOLEAN, hnext, /* IMIV-274 */ Cell scratch; INTEGER right, bottom; - scratch.v = CW(cellp->v); - scratch.h = CW(cellp->h); + scratch.v = BigEndianValue(cellp->v); + scratch.h = BigEndianValue(cellp->h); right = Hx(list, dataBounds.right); bottom = Hx(list, dataBounds.bottom); if (hnext) { @@ -57,8 +58,8 @@ P4(PUBLIC pascal trap, BOOLEAN, LNextCell, BOOLEAN, hnext, /* IMIV-274 */ retval = FALSE; } if (retval) { - cellp->v = CW(scratch.v); - cellp->h = CW(scratch.h); + cellp->v = BigEndianValue(scratch.v); + cellp->h = BigEndianValue(scratch.h); } return retval; } @@ -73,14 +74,14 @@ P3(PUBLIC pascal trap, void, LRect, Rect *, cellrect, /* IMIV-274 */ csize.h = Hx(list, cellSize.h); csize.v = Hx(list, cellSize.v); *cellrect = HxX(list, rView); - cellrect->top = CW(CW(cellrect->top) + + cellrect->top = BigEndianValue(BigEndianValue(cellrect->top) + ((cell.v - Hx(list, visible.top)) * csize.v)); - cellrect->left = CW(CW(cellrect->left) + + cellrect->left = BigEndianValue(BigEndianValue(cellrect->left) + ((cell.h - Hx(list, visible.left)) * csize.h)); - if ((temp = CW(cellrect->top) + csize.v) < CW(cellrect->bottom)) - cellrect->bottom = CW(temp); - if ((temp = CW(cellrect->left) + csize.h) < CW(cellrect->right)) - cellrect->right = CW(temp); + if ((temp = BigEndianValue(cellrect->top) + csize.v) < BigEndianValue(cellrect->bottom)) + cellrect->bottom = BigEndianValue(temp); + if ((temp = BigEndianValue(cellrect->left) + csize.h) < BigEndianValue(cellrect->right)) + cellrect->right = BigEndianValue(temp); } else { cellrect->top = cellrect->left = cellrect->bottom = cellrect->right = CWC(0); @@ -141,27 +142,27 @@ P5(PUBLIC pascal trap, BOOLEAN, LSearch, Ptr, dp, /* IMIV-274 */ HLock((Handle) HxP(list, cells)); fp = proc ? (cmpf) proc : (cmpf) P_IUMagString; - cell.h = CW(cellp->h); - cell.v = CW(cellp->v); + cell.h = BigEndianValue(cellp->h); + cell.v = BigEndianValue(cellp->v); swappedcell = *cellp; /* TODO: SPEEDUP: the following is a stupid way to do the loop, instead ip and ep should be used! */ - while ((C_LFind(&off, &len, cell, list), len = CW (len), off = CW (off), + while ((C_LFind(&off, &len, cell, list), len = BigEndianValue (len), off = BigEndianValue (off), len != -1) && CALLCMP(dp, (Ptr) STARH(HxP(list, cells)) + off, dl, len, fp) != 0) if (!C_LNextCell(TRUE, TRUE, &swappedcell, list)) { cell.h = Hx(list, dataBounds.right); cell.v = Hx(list, dataBounds.bottom); } else { - cell.h = CW (swappedcell.h); - cell.v = CW (swappedcell.v); + cell.h = BigEndianValue (swappedcell.h); + cell.v = BigEndianValue (swappedcell.v); } HUnlock((Handle) HxP(list, cells)); HUnlock((Handle) list); if (len != -1) { - cellp->h = CW(cell.h); - cellp->v = CW(cell.v); + cellp->h = BigEndianValue(cell.h); + cellp->v = BigEndianValue(cell.v); /*-->*/ return TRUE; } else return FALSE; @@ -181,9 +182,9 @@ P3(PUBLIC pascal trap, void, LSize, INTEGER, width, /* IMIV-274 */ oldright = Hx(list, rView.right); oldbottom = Hx(list, rView.bottom); newright = Hx(list, rView.left) + width; - HxX(list, rView.right) = CW(newright); + HxX(list, rView.right) = BigEndianValue(newright); newbottom = Hx(list, rView.top) + height; - HxX(list, rView.bottom) = CW(newbottom); + HxX(list, rView.bottom) = BigEndianValue(newbottom); ch = HxP(list, hScroll); cv = HxP(list, vScroll); @@ -203,12 +204,12 @@ P3(PUBLIC pascal trap, void, LSize, INTEGER, width, /* IMIV-274 */ MoveControl(cv, newright, Hx(list, rView.top) - 1); SizeControl(cv, 16, newbottom - Hx(list, rView.top) + 2); } - r.top = CW(MIN(oldbottom, newbottom)); - r.bottom = CW(MAX(oldbottom, newbottom)); - r.left = CW(Hx(list, rView.left) - 1); - r.right = CW(MAX(oldright, newright)); + r.top = BigEndianValue(MIN(oldbottom, newbottom)); + r.bottom = BigEndianValue(MAX(oldbottom, newbottom)); + r.left = BigEndianValue(Hx(list, rView.left) - 1); + r.right = BigEndianValue(MAX(oldright, newright)); if (ch) - r.bottom = CW(CW(r.bottom) + (16)); + r.bottom = BigEndianValue(BigEndianValue(r.bottom) + (16)); RectRgn(rectrgn, &r); UnionRgn(rectrgn, updatergn, updatergn); } else { /* just right different */ @@ -218,12 +219,12 @@ P3(PUBLIC pascal trap, void, LSize, INTEGER, width, /* IMIV-274 */ if (cv) MoveControl(cv, newright, Hx(list, rView.top) - 1); } - r.left = CW(MIN(oldright, newright)); - r.right = CW(MAX(oldright, newright)); - r.top = CW(Hx(list, rView.top) - 1); - r.bottom = CW(MAX(oldbottom, newbottom)); + r.left = BigEndianValue(MIN(oldright, newright)); + r.right = BigEndianValue(MAX(oldright, newright)); + r.top = BigEndianValue(Hx(list, rView.top) - 1); + r.bottom = BigEndianValue(MAX(oldbottom, newbottom)); if (cv) - r.right = CW(CW(r.right) + (16)); + r.right = BigEndianValue(BigEndianValue(r.right) + (16)); RectRgn(rectrgn, &r); UnionRgn(rectrgn, updatergn, updatergn); } else if (newbottom != oldbottom) { /* just bottom different */ @@ -232,12 +233,12 @@ P3(PUBLIC pascal trap, void, LSize, INTEGER, width, /* IMIV-274 */ if (cv) { SizeControl(cv, 16, newbottom - Hx(list, rView.top) + 2); } - r.top = CW(MIN(oldbottom, newbottom)); - r.bottom = CW(MAX(oldbottom, newbottom)); - r.left = CW(Hx(list, rView.left) - 1); - r.right = CW(MAX(oldright, newright)); + r.top = BigEndianValue(MIN(oldbottom, newbottom)); + r.bottom = BigEndianValue(MAX(oldbottom, newbottom)); + r.left = BigEndianValue(Hx(list, rView.left) - 1); + r.right = BigEndianValue(MAX(oldright, newright)); if (ch) - r.bottom = CW(CW(r.bottom) + (16)); + r.bottom = BigEndianValue(BigEndianValue(r.bottom) + (16)); RectRgn(rectrgn, &r); UnionRgn(rectrgn, updatergn, updatergn); } diff --git a/src/listAddDel.cpp b/src/listAddDel.cpp index 3e40237f..13b0fc50 100644 --- a/src/listAddDel.cpp +++ b/src/listAddDel.cpp @@ -15,6 +15,7 @@ char ROMlib_rcsid_listAddDel[] = #include "rsys/list.h" using namespace Executor; +using namespace ByteSwap; P3(PUBLIC pascal trap, INTEGER, LAddColumn, INTEGER, count, /* IMIV-271 */ INTEGER, coln, ListHandle, list) @@ -35,7 +36,7 @@ P3(PUBLIC pascal trap, INTEGER, LAddColumn, INTEGER, count, /* IMIV-271 */ if (coln < Hx(list, dataBounds.left)) coln = Hx(list, dataBounds.left); - HxX(list, dataBounds.right) = CW(Hx(list, dataBounds.right) + count); + HxX(list, dataBounds.right) = BigEndianValue(Hx(list, dataBounds.right) + count); if (noffsets) { TRAPBEGIN(); @@ -54,11 +55,11 @@ P3(PUBLIC pascal trap, INTEGER, LAddColumn, INTEGER, count, /* IMIV-271 */ ip -= nafter; op -= nafter; BlockMove(ip, op, nafter); - offset = CW(*(INTEGER *)op) & 0x7FFF; + offset = BigEndianValue(*(INTEGER *)op) & 0x7FFF; for (i = 0; ++i <= count; ) { op -= sizeof(INTEGER); - *(INTEGER *)op = CW(offset); + *(INTEGER *)op = BigEndianValue(offset); } ip -= nbefore; op -= nbefore; @@ -71,10 +72,10 @@ P3(PUBLIC pascal trap, INTEGER, LAddColumn, INTEGER, count, /* IMIV-271 */ if (Hx(list, listFlags) & DODRAW) { todraw = HxX(list, dataBounds); - todraw.left = CW(coln); + todraw.left = BigEndianValue(coln); SectRect(&todraw, &HxX(list, visible), &todraw); - for (c.v = CW(todraw.top) ; c.v < CW(todraw.bottom); c.v++) - for (c.h = CW(todraw.left) ; c.h < CW(todraw.right); c.h++) + for (c.v = BigEndianValue(todraw.top) ; c.v < BigEndianValue(todraw.bottom); c.v++) + for (c.h = BigEndianValue(todraw.left) ; c.h < BigEndianValue(todraw.right); c.h++) C_LDraw(c, list); } TRAPEND(); @@ -100,7 +101,7 @@ P3(PUBLIC pascal trap, INTEGER, LAddRow, INTEGER, count, /* IMIV-271 */ if (rown < Hx(list, dataBounds.top)) rown = Hx(list, dataBounds.top); - HxX(list, dataBounds.bottom) = CW(Hx(list, dataBounds.bottom) + count); + HxX(list, dataBounds.bottom) = BigEndianValue(Hx(list, dataBounds.bottom) + count); if (noffsets) { TRAPBEGIN(); @@ -114,11 +115,11 @@ P3(PUBLIC pascal trap, INTEGER, LAddRow, INTEGER, count, /* IMIV-271 */ *--op = *--ip; /* sentinel */ ip -= nafter; op -= nafter; - offset = CW(*ip) & 0x7FFF; + offset = BigEndianValue(*ip) & 0x7FFF; BlockMove((Ptr) ip, (Ptr) op, nafter * sizeof(INTEGER)); /* move the after rows */ while (--noffsets >= 0) - *--op = CW(offset); + *--op = BigEndianValue(offset); p.h = Hx(list, cellSize.h); p.v = Hx(list, cellSize.v); @@ -126,10 +127,10 @@ P3(PUBLIC pascal trap, INTEGER, LAddRow, INTEGER, count, /* IMIV-271 */ if (Hx(list, listFlags) & DODRAW) { todraw = HxX(list, dataBounds); - todraw.top = CW(rown); + todraw.top = BigEndianValue(rown); SectRect(&todraw, &HxX(list, visible), &todraw); - for (c.v = CW(todraw.top) ; c.v < CW(todraw.bottom); c.v++) - for (c.h = CW(todraw.left) ; c.h < CW(todraw.right); c.h++) + for (c.v = BigEndianValue(todraw.top) ; c.v < BigEndianValue(todraw.bottom); c.v++) + for (c.h = BigEndianValue(todraw.left) ; c.h < BigEndianValue(todraw.right); c.h++) C_LDraw(c, list); } TRAPEND(); @@ -152,10 +153,10 @@ compute_visible_rect (Rect *rp, ListHandle list, INTEGER top, INTEGER left, new_bottom = new_top + (bottom - top ) * v; new_right = new_left + (right - left) * h; - rp->top = CW (new_top); - rp->left = CW (new_left); - rp->bottom = CW (new_bottom); - rp->right = CW (new_right); + rp->top = BigEndianValue (new_top); + rp->left = BigEndianValue (new_left); + rp->bottom = BigEndianValue (new_bottom); + rp->right = BigEndianValue (new_right); SectRect (rp, &HxX (list, rView), rp); } @@ -202,7 +203,7 @@ P3(PUBLIC pascal trap, void, LDelColumn, INTEGER, count, /* IMIV-271 */ if (coln > Hx(list, dataBounds.right)) coln = Hx(list, dataBounds.right); - HxX(list, dataBounds.right) = CW(Hx(list, dataBounds.right) - count); + HxX(list, dataBounds.right) = BigEndianValue(Hx(list, dataBounds.right) - count); if (noffsets) { INTEGER visible_right, bounds_right; @@ -217,11 +218,11 @@ P3(PUBLIC pascal trap, void, LDelColumn, INTEGER, count, /* IMIV-271 */ /* SPEEDUP: partial loop unrolling ... combine things and don't bother adding delta when we know that it's zero */ while (--nrows >= 0) { - off1 = CW(*ip) & 0x7FFF; + off1 = BigEndianValue(*ip) & 0x7FFF; for (i = nbefore; --i >= 0; ) /* copy before-offsets */ - *op++ = CW(CW(*ip++) - delta); + *op++ = BigEndianValue(BigEndianValue(*ip++) - delta); - off2 = CW(*ip) & 0x7FFF; + off2 = BigEndianValue(*ip) & 0x7FFF; ntomove = off2 - off1; BlockMove(dataip, dataop, ntomove); /* copy before-data */ dataip += ntomove; @@ -229,22 +230,22 @@ P3(PUBLIC pascal trap, void, LDelColumn, INTEGER, count, /* IMIV-271 */ ip += count; /* skip count offsets */ - off3 = CW(*ip) & 0x7FFF; + off3 = BigEndianValue(*ip) & 0x7FFF; ntomove = off3 - off2; dataip += ntomove; /* skip appropriate data */ delta += ntomove; /* note this */ - off4 = CW(*ip) & 0x7FFF; + off4 = BigEndianValue(*ip) & 0x7FFF; for (i = nafter; --i >= 0; ) /* copy after-offsets */ - *op++ = CW(CW(*ip++) - delta); + *op++ = BigEndianValue(BigEndianValue(*ip++) - delta); - off5 = CW(*ip) & 0x7FFF; + off5 = BigEndianValue(*ip) & 0x7FFF; ntomove = off5 - off4; BlockMove(dataip, dataop, ntomove); /* copy before-data */ dataip += ntomove; dataop += ntomove; } - *op++ = CW(CW(*ip++) - delta); /* sentinel */ + *op++ = BigEndianValue(BigEndianValue(*ip++) - delta); /* sentinel */ SetHandleSize((Handle) list, GetHandleSize((Handle) list) - noffsets * sizeof(INTEGER)); SetHandleSize((Handle) HxP(list, cells), @@ -272,7 +273,7 @@ P3(PUBLIC pascal trap, void, LDelColumn, INTEGER, count, /* IMIV-271 */ if (visible_left > 0 && visible_right > bounds_right) { --visible_left; - HxX(list, visible.left) = CW (visible_left); + HxX(list, visible.left) = BigEndianValue (visible_left); coln = visible_left; } } @@ -287,10 +288,10 @@ P3(PUBLIC pascal trap, void, LDelColumn, INTEGER, count, /* IMIV-271 */ EraseRect (&eraser); todraw = HxX(list, dataBounds); - todraw.left = CW(coln); + todraw.left = BigEndianValue(coln); SectRect(&todraw, &HxX(list, visible), &todraw); - for (c.v = CW(todraw.top) ; c.v < CW(todraw.bottom); c.v++) - for (c.h = CW(todraw.left) ; c.h < CW(todraw.right); c.h++) + for (c.v = BigEndianValue(todraw.top) ; c.v < BigEndianValue(todraw.bottom); c.v++) + for (c.h = BigEndianValue(todraw.left) ; c.h < BigEndianValue(todraw.right); c.h++) C_LDraw(c, list); } TRAPEND(); @@ -336,7 +337,7 @@ P3(PUBLIC pascal trap, void, LDelRow, INTEGER, count, /* IMIV-272 */ ncols = Hx(list, dataBounds.right) - Hx(list, dataBounds.left); noffsets = count * ncols; - HxX(list, dataBounds.bottom) = CW(Hx(list, dataBounds.bottom) - count); + HxX(list, dataBounds.bottom) = BigEndianValue(Hx(list, dataBounds.bottom) - count); if (noffsets) { INTEGER visible_bottom, bounds_bottom; @@ -347,14 +348,14 @@ P3(PUBLIC pascal trap, void, LDelRow, INTEGER, count, /* IMIV-272 */ nafter = nrows * ncols - nbefore; ip = op = (unsigned short int *) HxX(list, cellArray) + nbefore; ip += noffsets; - off1 = CW(*op) & 0x7FFF; - off2 = CW(*ip) & 0x7FFF; + off1 = BigEndianValue(*op) & 0x7FFF; + off2 = BigEndianValue(*ip) & 0x7FFF; delta = off2 - off1; while (--nafter >= 0) - *op++ = CW(CW(*ip++) - delta); - off3 = CW(*ip) & 0x7FFF; - *op = CW(CW(*ip) - delta); /* sentinel */ + *op++ = BigEndianValue(BigEndianValue(*ip++) - delta); + off3 = BigEndianValue(*ip) & 0x7FFF; + *op = BigEndianValue(BigEndianValue(*ip) - delta); /* sentinel */ ntomove = off3 - off2; BlockMove((Ptr) STARH(HxP(list, cells)) + off2, @@ -386,7 +387,7 @@ P3(PUBLIC pascal trap, void, LDelRow, INTEGER, count, /* IMIV-272 */ if (visible_top > 0 && visible_bottom > bounds_bottom) { --visible_top; - HxX(list, visible.top) = CW (visible_top); + HxX(list, visible.top) = BigEndianValue (visible_top); rown = visible_top; } } @@ -400,11 +401,11 @@ P3(PUBLIC pascal trap, void, LDelRow, INTEGER, count, /* IMIV-272 */ EraseRect (&eraser); todraw = HxX(list, dataBounds); - todraw.top = CW(rown); + todraw.top = BigEndianValue(rown); SectRect(&todraw, &HxX(list, visible), &todraw); - for (c.v = CW(todraw.top) ; c.v < CW(todraw.bottom); c.v++) - for (c.h = CW(todraw.left) ; c.h < CW(todraw.right); c.h++) + for (c.v = BigEndianValue(todraw.top) ; c.v < BigEndianValue(todraw.bottom); c.v++) + for (c.h = BigEndianValue(todraw.left) ; c.h < BigEndianValue(todraw.right); c.h++) C_LDraw(c, list); } TRAPEND(); diff --git a/src/listCreate.cpp b/src/listCreate.cpp index 1ac0a125..7d18ec0a 100644 --- a/src/listCreate.cpp +++ b/src/listCreate.cpp @@ -16,28 +16,29 @@ char ROMlib_rcsid_listCreate[] = #include "rsys/list.h" using namespace Executor; +using namespace ByteSwap; #define STEF_lActivefix A3(PUBLIC, void, ROMlib_vminmax, INTEGER *, minp, /* INTERNAL */ INTEGER *, maxp, ListPtr, lp) { - *minp = CW(lp->dataBounds.top); - *maxp = *minp + CW(lp->dataBounds.bottom) - CW(lp->visible.bottom) + - CW(lp->visible.top); - if (CW(lp->cellSize.v) * (CW(lp->visible.bottom) - CW(lp->visible.top)) > - CW(lp->rView.bottom) - CW(lp->rView.top)) + *minp = BigEndianValue(lp->dataBounds.top); + *maxp = *minp + BigEndianValue(lp->dataBounds.bottom) - BigEndianValue(lp->visible.bottom) + + BigEndianValue(lp->visible.top); + if (BigEndianValue(lp->cellSize.v) * (BigEndianValue(lp->visible.bottom) - BigEndianValue(lp->visible.top)) > + BigEndianValue(lp->rView.bottom) - BigEndianValue(lp->rView.top)) ++*maxp; } A3(PUBLIC, void, ROMlib_hminmax, INTEGER *, minp, /* INTERNAL */ INTEGER *, maxp, ListPtr, lp) { - *minp = CW(lp->dataBounds.left); - *maxp = *minp + CW(lp->dataBounds.right) - CW(lp->visible.right) + - CW(lp->visible.left); - if (CW(lp->cellSize.h) * (CW(lp->visible.right) - CW(lp->visible.left)) > - CW(lp->rView.right) - CW(lp->rView.left)) + *minp = BigEndianValue(lp->dataBounds.left); + *maxp = *minp + BigEndianValue(lp->dataBounds.right) - BigEndianValue(lp->visible.right) + + BigEndianValue(lp->visible.left); + if (BigEndianValue(lp->cellSize.h) * (BigEndianValue(lp->visible.right) - BigEndianValue(lp->visible.left)) > + BigEndianValue(lp->rView.right) - BigEndianValue(lp->rView.left)) ++*maxp; } @@ -119,8 +120,8 @@ P9(PUBLIC pascal trap, ListHandle, LNew, Rect *, rview, /* IMIV-270 */ Handle temph; LISTDECL(); - noffs = (CW(bounds->right) - CW(bounds->left)) * - (CW(bounds->bottom) - CW(bounds->top)) +1; + noffs = (BigEndianValue(bounds->right) - BigEndianValue(bounds->left)) * + (BigEndianValue(bounds->bottom) - BigEndianValue(bounds->top)) +1; retval = (ListHandle) NewHandle(sizeof(ListRec) - sizeof(HxX(retval, cellArray)) + (noffs+1) * sizeof(INTEGER)); if (!retval) @@ -174,10 +175,10 @@ P9(PUBLIC pascal trap, ListHandle, LNew, Rect *, rview, /* IMIV-270 */ lp->listFlags = draw ? DODRAW : 0; if (scrollv) { r = lp->rView; - r.top = CW(CW(r.top) - 1); + r.top = BigEndianValue(BigEndianValue(r.top) - 1); r.left = r.right; - r.right = CW(CW(r.right) + (16)); - r.bottom = CW(CW(r.bottom) + 1); + r.right = BigEndianValue(BigEndianValue(r.right) + (16)); + r.bottom = BigEndianValue(BigEndianValue(r.bottom) + 1); ROMlib_vminmax(&min, &max, lp); lp->vScroll = RM(NewControl((WindowPtr) wind, &r, (StringPtr) "", draw && lp->lActive, min, min, max, scrollBarProc, (LONGINT) 0)); @@ -187,10 +188,10 @@ P9(PUBLIC pascal trap, ListHandle, LNew, Rect *, rview, /* IMIV-270 */ if (scrollh) { r = lp->rView; - r.left = CW(CW(r.left) - 1); + r.left = BigEndianValue(BigEndianValue(r.left) - 1); r.top = r.bottom; - r.bottom = CW(CW(r.bottom) + (16)); - r.right = CW(CW(r.right) + 1); + r.bottom = BigEndianValue(BigEndianValue(r.bottom) + (16)); + r.right = BigEndianValue(BigEndianValue(r.right) + 1); ROMlib_hminmax(&min, &max, lp); lp->hScroll = RM(NewControl((WindowPtr) wind, &r, (StringPtr) "", draw && lp->lActive, min, min, max, scrollBarProc, (LONGINT) 0)); diff --git a/src/listDisplay.cpp b/src/listDisplay.cpp index e4c267c2..0ca09919 100644 --- a/src/listDisplay.cpp +++ b/src/listDisplay.cpp @@ -17,6 +17,7 @@ char ROMlib_rcsid_listDisplay[] = #include "rsys/hook.h" using namespace Executor; +using namespace ByteSwap; P2(PUBLIC pascal trap, void, LDraw, Cell, cell, /* IMIV-275 */ ListHandle, list) @@ -29,9 +30,9 @@ P2(PUBLIC pascal trap, void, LDraw, Cell, cell, /* IMIV-275 */ LISTDECL(); if ((ip = ROMlib_getoffp(cell, list))) { - off0 = CW(ip[0]) & 0x7FFF; - off1 = CW(ip[1]) & 0x7FFF; - setit = (CW(ip[0]) & 0x8000) && Hx(list, lActive); + off0 = BigEndianValue(ip[0]) & 0x7FFF; + off1 = BigEndianValue(ip[1]) & 0x7FFF; + setit = (BigEndianValue(ip[0]) & 0x8000) && Hx(list, lActive); saveport = thePort; SetPort(HxP(list, port)); saveclip = PORT_CLIP_REGION_X (thePort); @@ -103,8 +104,8 @@ P3(PUBLIC pascal trap, void, LScroll, INTEGER, ncol, /* IMIV-275 */ ncol = tmpi; } - HxX(list, visible.top) = CW(Hx(list, visible.top) + nrow); - HxX(list, visible.left) = CW(Hx(list, visible.left) + ncol); + HxX(list, visible.top) = BigEndianValue(Hx(list, visible.top) + nrow); + HxX(list, visible.left) = BigEndianValue(Hx(list, visible.left) + ncol); p.h = Hx(list, cellSize.h); p.v = Hx(list, cellSize.v); @@ -132,8 +133,8 @@ P1(PUBLIC pascal trap, void, LAutoScroll, ListHandle, list) /* IMIV-275 */ cell.h = HxX(list, dataBounds.left); cell.v = HxX(list, dataBounds.top); if (C_LGetSelect(TRUE, &cell, list)) { - cell.h = CW(cell.h); - cell.v = CW(cell.v); + cell.h = BigEndianValue(cell.h); + cell.v = BigEndianValue(cell.v); if (!PtInRect(cell, &HxX(list, visible))) { C_LScroll(cell.h - Hx(list, visible.left), cell.v - Hx(list, visible.top), list); @@ -156,24 +157,24 @@ P2(PUBLIC pascal trap, void, LUpdate, RgnHandle, rgn, /* IMIV-275 */ csize.h = Hx(list, cellSize.h); csize.v = Hx(list, cellSize.v); C_LRect(&r, c, list); - top = CW(r.top); - left = CW(r.left); + top = BigEndianValue(r.top); + left = BigEndianValue(r.left); bottom = top + (Hx(list, visible.bottom) - Hx(list, visible.top)) * csize.v; right = left + (Hx(list, visible.right) - Hx(list, visible.left)) * csize.h; - while (CW(r.top) < bottom) { - while (CW(r.left) < right) { + while (BigEndianValue(r.top) < bottom) { + while (BigEndianValue(r.left) < right) { if (RectInRgn(&r, rgn)) C_LDraw(c, list); - r.left = CW(CW(r.left ) + (csize.h)); - r.right = CW(CW(r.right) + (csize.h)); + r.left = BigEndianValue(BigEndianValue(r.left ) + (csize.h)); + r.right = BigEndianValue(BigEndianValue(r.right) + (csize.h)); c.h++; } c.h = cleft; c.v++; - r.top = CW(CW(r.top) + (csize.v)); - r.bottom = CW(CW(r.bottom) + (csize.v)); - r.left = CW(left); - r.right = CW(left + csize.h); + r.top = BigEndianValue(BigEndianValue(r.top) + (csize.v)); + r.bottom = BigEndianValue(BigEndianValue(r.bottom) + (csize.v)); + r.left = BigEndianValue(left); + r.right = BigEndianValue(left + csize.h); } if ((ch = HxP(list, hScroll))) { if (RectInRgn(&HxX(ch, contrlRect), rgn)) @@ -217,9 +218,9 @@ P2(PUBLIC pascal trap, void, LActivate, BOOLEAN, act, /* IMIV-276 */ c.v++) { for (c.h = Hx(list, visible.left); c.h < Hx(list, visible.right); c.h++) { - if ((ip = ROMlib_getoffp(c, list)) && (CW(*ip) & 0x8000)) { - off0 = CW(ip[0]) & 0x7FFF; - off1 = CW(ip[1]) & 0x7FFF; + if ((ip = ROMlib_getoffp(c, list)) && (BigEndianValue(*ip) & 0x8000)) { + off0 = BigEndianValue(ip[0]) & 0x7FFF; + off1 = BigEndianValue(ip[1]) & 0x7FFF; saveclip = PORT_CLIP_REGION_X (thePort); PORT_CLIP_REGION_X (thePort) = RM (NewRgn ()); C_LRect(&r, c, list); diff --git a/src/listMouse.cpp b/src/listMouse.cpp index db046884..27232f9b 100644 --- a/src/listMouse.cpp +++ b/src/listMouse.cpp @@ -23,6 +23,7 @@ char ROMlib_rcsid_listMouse[] = #include "rsys/hook.h" using namespace Executor; +using namespace ByteSwap; #if defined (BINCOMPAT) typedef pascal BOOLEAN (*clickproc)( void ); @@ -43,14 +44,14 @@ namespace Executor { A2(PRIVATE, void, findcell, Cell *, cp, ListHandle, list) { - cp->h = CW((CW(cp->h) - Hx(list, rView.left)) / Hx(list, cellSize.h) + + cp->h = BigEndianValue((BigEndianValue(cp->h) - Hx(list, rView.left)) / Hx(list, cellSize.h) + Hx(list, visible.left)); - cp->v = CW((CW(cp->v) - Hx(list, rView.top)) / Hx(list, cellSize.v) + + cp->v = BigEndianValue((BigEndianValue(cp->v) - Hx(list, rView.top)) / Hx(list, cellSize.v) + Hx(list, visible.top)); - if (CW(cp->h) >= Hx(list, visible.right)) + if (BigEndianValue(cp->h) >= Hx(list, visible.right)) cp->h = CWC(32767); - if (CW(cp->v) >= Hx(list, visible.bottom)) + if (BigEndianValue(cp->v) >= Hx(list, visible.bottom)) cp->v = CWC(32767); } @@ -64,15 +65,15 @@ A4(PRIVATE, void, setselectnilflag, BOOLEAN, setit, Cell, cell, LISTDECL(); if ((ip = ROMlib_getoffp(cell, list))) { - off0wbit = CW(*ip); + off0wbit = BigEndianValue(*ip); if (setit) - *ip = CW(off0wbit | 0x8000); + *ip = BigEndianValue(off0wbit | 0x8000); else - *ip = CW(off0wbit & 0x7FFF); + *ip = BigEndianValue(off0wbit & 0x7FFF); if (PtInRect(cell, &HxX(list, visible)) && (!(off0wbit & 0x8000) ^ !setit)) { off0 = off0wbit & 0x7FFF; - off1 = CW(ip[1]) & 0x7FFF; + off1 = BigEndianValue(ip[1]) & 0x7FFF; if (hiliteempty || off0 != off1) { C_LRect(&r, cell, list); @@ -107,12 +108,12 @@ A4(PRIVATE, void, rectvalue, register Rect *, rp, register INTEGER, value, LISTDECL(); LISTBEGIN(list); - for (c.v = CW(rp->top) ; c.v < CW(rp->bottom); c.v++) { - c.h = CW(rp->left); + for (c.v = BigEndianValue(rp->top) ; c.v < BigEndianValue(rp->bottom); c.v++) { + c.h = BigEndianValue(rp->left); if ((sp = ip = ROMlib_getoffp(c, list))) { - for (ep = ip + (CW(rp->right) - CW(rp->left)); ip != ep; ip++) - if (!(CW(*ip) & 0x8000) ^ !value) { - c.h = CW(rp->left) + (ip - sp); + for (ep = ip + (BigEndianValue(rp->right) - BigEndianValue(rp->left)); ip != ep; ip++) + if (!(BigEndianValue(*ip) & 0x8000) ^ !value) { + c.h = BigEndianValue(rp->left) + (ip - sp); setselectnilflag(value, c, list, hiliteempty); } } @@ -127,10 +128,10 @@ A5(PRIVATE, void, rect2value, register Rect *, in, register Rect *, butnotin, register INTEGER *ip; Cell c; - for (c.v = CW(in->top) ; c.v < CW(in->bottom); c.v++) - for (c.h = CW(in->left) ; c.h < CW(in->right); c.h++) + for (c.v = BigEndianValue(in->top) ; c.v < BigEndianValue(in->bottom); c.v++) + for (c.h = BigEndianValue(in->left) ; c.h < BigEndianValue(in->right); c.h++) if (!PtInRect(c, butnotin) && (ip = ROMlib_getoffp(c, list))) - if (!(CW(*ip) & 0x8000) ^ !value) + if (!(BigEndianValue(*ip) & 0x8000) ^ !value) setselectnilflag(value, c, list, hiliteempty); } @@ -143,8 +144,8 @@ A1(PRIVATE, void, scrollbyvalues, ListHandle, list) h = (ch = HxP(list, hScroll)) ? GetCtlValue(ch) : Hx(list, visible.left); v = (ch = HxP(list, vScroll)) ? GetCtlValue(ch) : Hx(list, visible.top); C_LScroll(h - Hx(list, visible.left), v - Hx(list, visible.top), list); - HxX(list, visible.left) = CW(h); - HxX(list, visible.top) = CW(v); + HxX(list, visible.left) = BigEndianValue(h); + HxX(list, visible.top) = BigEndianValue(v); p.h = Hx(list, cellSize.h); p.v = Hx(list, cellSize.v); C_LCellSize(p, list); @@ -158,9 +159,9 @@ P2(PUBLIC, pascal void, ROMlib_mytrack, ControlHandle, ch, INTEGER, part) lp = (ListPtr) (long) STARH((Handle) (long) MR(HxX(ch, contrlRfCon))); page = ch == MR(lp->hScroll) ? - CW(lp->visible.right) - CW(lp->visible.left) - 1 + BigEndianValue(lp->visible.right) - BigEndianValue(lp->visible.left) - 1 : - CW(lp->visible.bottom) - CW(lp->visible.top) - 1; + BigEndianValue(lp->visible.bottom) - BigEndianValue(lp->visible.top) - 1; switch (part) { case inUpButton: @@ -223,12 +224,12 @@ P3(PUBLIC pascal trap, BOOLEAN, LClick, Point, pt, /* IMIV-273 */ if (PtInRect(pt, &HxX(list, rView))) { TRAPBEGIN(); flags = Hx(list, selFlags); - newcell.h = CW(pt.h); - newcell.v = CW(pt.v); + newcell.h = BigEndianValue(pt.h); + newcell.v = BigEndianValue(pt.v); findcell(&newcell, list); if (newcell.h == HxX(list, lastClick.h) && newcell.v == HxX(list, lastClick.v) && - TickCount() < Hx(list, clikTime) + CL(DoubleTime)) + TickCount() < Hx(list, clikTime) + BigEndianValue(DoubleTime)) doubleclick = TRUE; HxX(list, lastClick) = newcell; hiliteempty = !(flags & lNoNilHilite); @@ -262,113 +263,113 @@ P3(PUBLIC pascal trap, BOOLEAN, LClick, Point, pt, /* IMIV-273 */ anchor.top = anchor.bottom = 0; if (extend) { rswapped = HxX(list, dataBounds); - r.top = CW(rswapped.top); - r.left = CW(rswapped.left); - r.bottom = CW(rswapped.bottom); - r.right = CW(rswapped.right); + r.top = BigEndianValue(rswapped.top); + r.left = BigEndianValue(rswapped.left); + r.bottom = BigEndianValue(rswapped.bottom); + r.right = BigEndianValue(rswapped.right); for (c.h = r.left; c.h < r.right ; c.h++) for (c.v = r.top; c.v < r.bottom ; c.v++) { - cswapped.h = CW(c.h); - cswapped.v = CW(c.v); + cswapped.h = BigEndianValue(c.h); + cswapped.v = BigEndianValue(c.v); if (C_LGetSelect(FALSE, &cswapped, list)) goto out1; } out1: - c.h = CW(cswapped.h); - c.v = CW(cswapped.v); + c.h = BigEndianValue(cswapped.h); + c.v = BigEndianValue(cswapped.v); if (c.h != r.right) { - anchor.left = CW(c.h); + anchor.left = BigEndianValue(c.h); for (c.h = r.right-1; c.h >= r.left ; c.h--) for (c.v = r.top; c.v < r.bottom ; c.v++) { - cswapped.h = CW(c.h); - cswapped.v = CW(c.v); + cswapped.h = BigEndianValue(c.h); + cswapped.v = BigEndianValue(c.v); if (C_LGetSelect(FALSE, &cswapped, list)) goto out2; } out2: - c.h = CW(cswapped.h); - c.v = CW(cswapped.v); - anchor.right = CW(c.h + 1); + c.h = BigEndianValue(cswapped.h); + c.v = BigEndianValue(cswapped.v); + anchor.right = BigEndianValue(c.h + 1); - cswapped.h = CW(r.left); - cswapped.v = CW(r.top); + cswapped.h = BigEndianValue(r.left); + cswapped.v = BigEndianValue(r.top); C_LGetSelect(TRUE, &cswapped, list); anchor.top = cswapped.v; for (c.v = r.bottom - 1; c.v >= r.top ; c.v--) for (c.h = r.left; c.h < r.right ; c.h++) { - cswapped.h = CW(c.h); - cswapped.v = CW(c.v); + cswapped.h = BigEndianValue(c.h); + cswapped.v = BigEndianValue(c.v); if (C_LGetSelect(FALSE, &cswapped, list)) goto out3; } out3: - anchor.bottom = CW(CW(cswapped.v) + 1); + anchor.bottom = BigEndianValue(BigEndianValue(cswapped.v) + 1); } } if (anchor.top == anchor.bottom) { anchor.top = newcell.v; anchor.left = newcell.h; - anchor.bottom = CW(CW(anchor.top) + 1); - anchor.right = CW(CW(anchor.left) + 1); + anchor.bottom = BigEndianValue(BigEndianValue(anchor.top) + 1); + anchor.right = BigEndianValue(BigEndianValue(anchor.left) + 1); } - c.h = CW(anchor.left); - c.v = CW(anchor.top); + c.h = BigEndianValue(anchor.left); + c.v = BigEndianValue(anchor.top); C_LRect(&rswapped, c, list); - if (pt.h < CW(rswapped.right) && pt.v < CW(rswapped.bottom)) { - anchor.top = CW(CW(anchor.bottom) - 1); - anchor.left = CW(CW(anchor.right) - 1); + if (pt.h < BigEndianValue(rswapped.right) && pt.v < BigEndianValue(rswapped.bottom)) { + anchor.top = BigEndianValue(BigEndianValue(anchor.bottom) - 1); + anchor.left = BigEndianValue(BigEndianValue(anchor.right) - 1); } else { - anchor.bottom = CW(CW(anchor.top) + 1); - anchor.right = CW(CW(anchor.left) + 1); + anchor.bottom = BigEndianValue(BigEndianValue(anchor.top) + 1); + anchor.right = BigEndianValue(BigEndianValue(anchor.left) + 1); } oldselrect = (flags & lUseSense) ? anchor : HxX(list, dataBounds); } - HxX(list, clikTime) = CL(TickCount()); - HxX(list, clikLoc.h) = CW(pt.h); - HxX(list, clikLoc.v) = CW(pt.v); + HxX(list, clikTime) = BigEndianValue(TickCount()); + HxX(list, clikLoc.h) = BigEndianValue(pt.h); + HxX(list, clikLoc.v) = BigEndianValue(pt.v); oldcell.h = CWC(32767); - evt.where.h = CW(pt.h); - evt.where.v = CW(pt.v); + evt.where.h = BigEndianValue(pt.h); + evt.where.v = BigEndianValue(pt.v); pinrect = HxX(list, rView); - pinrect.left = CW(CW(pinrect.left) - 1); - pinrect.bottom = CW(CW(pinrect.bottom) - 1); + pinrect.left = BigEndianValue(BigEndianValue(pinrect.left) - 1); + pinrect.bottom = BigEndianValue(BigEndianValue(pinrect.bottom) - 1); do { HxX(list, mouseLoc) = evt.where; if (HxP(list, lClikLoop)) if (CALLCLICK(HxP(list, lClikLoop))) /*-->*/ break; - p.h = CW(evt.where.h); - p.v = CW(evt.where.v); + p.h = BigEndianValue(evt.where.h); + p.v = BigEndianValue(evt.where.v); if (!PtInRect(p, &HxX(list, rView))) { ctlchanged = FALSE; scrollh = HxP(list, hScroll); scrollv = HxP(list, vScroll); dh = 0; dv = 0; - if (CW(evt.where.h) < Hx(list, rView.left)) { + if (BigEndianValue(evt.where.h) < Hx(list, rView.left)) { if (scrollh) { SetCtlValue(scrollh, GetCtlValue(scrollh)-1); ctlchanged = TRUE; } else dh = -1; - } else if (CW(evt.where.h) > Hx(list, rView.right)) { + } else if (BigEndianValue(evt.where.h) > Hx(list, rView.right)) { if (scrollh) { SetCtlValue(scrollh, GetCtlValue(scrollh)+1); ctlchanged = TRUE; } else dh = 1; } - if (CW(evt.where.v) < Hx(list, rView.top)) { + if (BigEndianValue(evt.where.v) < Hx(list, rView.top)) { if (scrollv) { SetCtlValue(scrollv, GetCtlValue(scrollv)-1); ctlchanged = TRUE; } else dv = -1; - } else if (CW(evt.where.v) > Hx(list, rView.bottom)) { + } else if (BigEndianValue(evt.where.v) > Hx(list, rView.bottom)) { if (scrollv) { SetCtlValue(scrollv, GetCtlValue(scrollv)+1); ctlchanged = TRUE; @@ -380,17 +381,17 @@ P3(PUBLIC pascal trap, BOOLEAN, LClick, Point, pt, /* IMIV-273 */ else C_LScroll(dh, dv, list); } - p.h = CW(evt.where.h); - p.v = CW(evt.where.v); + p.h = BigEndianValue(evt.where.h); + p.v = BigEndianValue(evt.where.v); l = PinRect(&pinrect, p); - newcell.h = CW(LoWord(l)); - newcell.v = CW(HiWord(l)); + newcell.h = BigEndianValue(LoWord(l)); + newcell.v = BigEndianValue(HiWord(l)); findcell(&newcell, list); if (userects) { newcellr.top = newcell.v; newcellr.left = newcell.h; - newcellr.bottom = CW(CW(newcellr.top) + 1); - newcellr.right = CW(CW(newcellr.left) + 1); + newcellr.bottom = BigEndianValue(BigEndianValue(newcellr.top) + 1); + newcellr.right = BigEndianValue(BigEndianValue(newcellr.left) + 1); UnionRect(&anchor, &newcellr, &newselrect); rect2value(&oldselrect, &newselrect, !cellvalue, list, hiliteempty); @@ -400,13 +401,13 @@ P3(PUBLIC pascal trap, BOOLEAN, LClick, Point, pt, /* IMIV-273 */ if (newcell.h != oldcell.h || newcell.v != oldcell.v) { if (onlyone && oldcell.h != 32767) { - oldcellunswapped.h = CW(oldcell.h); - oldcellunswapped.v = CW(oldcell.v); + oldcellunswapped.h = BigEndianValue(oldcell.h); + oldcellunswapped.v = BigEndianValue(oldcell.v); setselectnilflag(FALSE, oldcellunswapped, list, hiliteempty); } - newcellunswapped.h = CW(newcell.h); - newcellunswapped.v = CW(newcell.v); + newcellunswapped.h = BigEndianValue(newcell.h); + newcellunswapped.v = BigEndianValue(newcell.v); setselectnilflag(cellvalue, newcellunswapped, list, hiliteempty); oldcell = newcell; diff --git a/src/listOps.cpp b/src/listOps.cpp index b38e022b..65b134cb 100644 --- a/src/listOps.cpp +++ b/src/listOps.cpp @@ -15,6 +15,7 @@ char ROMlib_rcsid_listOps[] = #include "rsys/list.h" using namespace Executor; +using namespace ByteSwap; A2(PUBLIC, INTEGER *, ROMlib_getoffp, Cell, cell, /* INTERNAL */ ListHandle, list) @@ -23,9 +24,9 @@ A2(PUBLIC, INTEGER *, ROMlib_getoffp, Cell, cell, /* INTERNAL */ INTEGER ncols, *retval; if (list && PtInRect(cell, rp = &HxX(list, dataBounds))) { - ncols = CW(rp->right) - CW(rp->left); - retval = HxX(list, cellArray) + ncols * (cell.v - CW(rp->top)) + - (cell.h - CW(rp->left)); + ncols = BigEndianValue(rp->right) - BigEndianValue(rp->left); + retval = HxX(list, cellArray) + ncols * (cell.v - BigEndianValue(rp->top)) + + (cell.h - BigEndianValue(rp->left)); } else retval = 0; return retval; @@ -52,9 +53,9 @@ A5(PRIVATE, void, cellhelper, AddOrRep, addorrep, Ptr, dp, INTEGER, dl, ep = ROMlib_getoffp(temp, list) + 1; ip_offset = (char *) ip - (char *) STARH (list); ep_offset = (char *) ep - (char *) STARH (list); - off0 = CW(ip[0]) & 0x7FFF; - off1 = CW(ip[1]) & 0x7FFF; - off2 = CW(ep[0]) & 0x7FFF; + off0 = BigEndianValue(ip[0]) & 0x7FFF; + off1 = BigEndianValue(ip[1]) & 0x7FFF; + off2 = BigEndianValue(ep[0]) & 0x7FFF; len = off1 - off0; /* @@ -106,7 +107,7 @@ A5(PRIVATE, void, cellhelper, AddOrRep, addorrep, Ptr, dp, INTEGER, dl, if (delta) { while (++ip <= ep) - *ip = CW(CW(*ip) + (delta)); + *ip = BigEndianValue(BigEndianValue(*ip) + (delta)); } if (Hx(list, listFlags) & DODRAW) C_LDraw(cell, list); @@ -132,13 +133,13 @@ P4(PUBLIC pascal trap, void, LGetCell, Ptr, dp, INTEGER *, dlp, /* IMIV-272 */ INTEGER ntomove; if ((ip = ROMlib_getoffp(cell, list))) { - off1 = CW(*ip++) & 0x7fff; - off2 = CW(*ip) & 0x7fff; + off1 = BigEndianValue(*ip++) & 0x7fff; + off2 = BigEndianValue(*ip) & 0x7fff; ntomove = off2 - off1; - if (ntomove > CW(*dlp)) - ntomove = CW(*dlp); + if (ntomove > BigEndianValue(*dlp)) + ntomove = BigEndianValue(*dlp); BlockMove((Ptr) STARH(HxP(list, cells)) + off1, dp, (Size) ntomove); - *dlp = CW(ntomove); + *dlp = BigEndianValue(ntomove); } } @@ -157,29 +158,29 @@ P2(PUBLIC pascal trap, void, LCellSize, Point, csize, /* IMIV-273 */ INTEGER nh, nv; lp = STARH(list); - if (!(lp->cellSize.h = CW(csize.h))) - lp->cellSize.h = CW((CW(lp->rView.right) - CW(lp->rView.left)) / - MAX(1, (CW(lp->dataBounds.right) - - CW(lp->dataBounds.left)))); - if (!(lp->cellSize.v = CW(csize.v))) { + if (!(lp->cellSize.h = BigEndianValue(csize.h))) + lp->cellSize.h = BigEndianValue((BigEndianValue(lp->rView.right) - BigEndianValue(lp->rView.left)) / + MAX(1, (BigEndianValue(lp->dataBounds.right) + - BigEndianValue(lp->dataBounds.left)))); + if (!(lp->cellSize.v = BigEndianValue(csize.v))) { gp = thePort; SetPort(MR(lp->port)); GetFontInfo(&fi); lp = STARH(list); /* could have moved */ - lp->cellSize.v = CW(CW(fi.ascent) + CW(fi.descent) + CW(fi.leading)); + lp->cellSize.v = BigEndianValue(BigEndianValue(fi.ascent) + BigEndianValue(fi.descent) + BigEndianValue(fi.leading)); SetPort(gp); } lp->visible.right = lp->dataBounds.right; lp->visible.bottom = lp->dataBounds.bottom; - nh = (CW(lp->rView.right) - CW(lp->rView.left) + CW(lp->cellSize.h) - 1) / - CW(lp->cellSize.h); - nv = (CW(lp->rView.bottom) - CW(lp->rView.top) + CW(lp->cellSize.v) - 1) / - CW(lp->cellSize.v); - if (CW(lp->visible.right) - CW(lp->visible.left) > nh) - lp->visible.right = CW(CW(lp->visible.left) + nh); - - if (CW(lp->visible.bottom) - CW(lp->visible.top) > nv) - lp->visible.bottom = CW(CW(lp->visible.top) + nv); + nh = (BigEndianValue(lp->rView.right) - BigEndianValue(lp->rView.left) + BigEndianValue(lp->cellSize.h) - 1) / + BigEndianValue(lp->cellSize.h); + nv = (BigEndianValue(lp->rView.bottom) - BigEndianValue(lp->rView.top) + BigEndianValue(lp->cellSize.v) - 1) / + BigEndianValue(lp->cellSize.v); + if (BigEndianValue(lp->visible.right) - BigEndianValue(lp->visible.left) > nh) + lp->visible.right = BigEndianValue(BigEndianValue(lp->visible.left) + nh); + + if (BigEndianValue(lp->visible.bottom) - BigEndianValue(lp->visible.top) > nv) + lp->visible.bottom = BigEndianValue(BigEndianValue(lp->visible.top) + nv); { ControlHandle control; @@ -215,11 +216,11 @@ P3(PUBLIC pascal trap, BOOLEAN, LGetSelect, BOOLEAN, next, /* IMIV-273 */ if (!list || !cellp) retval = FALSE; else if (next) { - c.h = CW(cellp->h); - c.v = CW(cellp->v); + c.h = BigEndianValue(cellp->h); + c.v = BigEndianValue(cellp->v); if (!(ip = ROMlib_getoffp(c, list))) { temp.h = 0; - temp.h = CW(cellp->v) + 1; + temp.h = BigEndianValue(cellp->v) + 1; ip = ROMlib_getoffp(temp, list); } if (!ip) @@ -228,7 +229,7 @@ P3(PUBLIC pascal trap, BOOLEAN, LGetSelect, BOOLEAN, next, /* IMIV-273 */ temp.h = Hx(list, dataBounds.right) - 1; temp.v = Hx(list, dataBounds.bottom) - 1; ep = ROMlib_getoffp(temp, list) + 1; - while (ip != ep && !(CW(*ip) & 0x8000)) + while (ip != ep && !(BigEndianValue(*ip) & 0x8000)) ip++; if (ip == ep) retval = FALSE; @@ -237,18 +238,18 @@ P3(PUBLIC pascal trap, BOOLEAN, LGetSelect, BOOLEAN, next, /* IMIV-273 */ ncols = Hx(list, dataBounds.right) - Hx(list, dataBounds.left); rown = nint / ncols; coln = nint % ncols; - cellp->v = CW(Hx(list, dataBounds.top) + rown); - cellp->h = CW(Hx(list, dataBounds.left) + coln); + cellp->v = BigEndianValue(Hx(list, dataBounds.top) + rown); + cellp->h = BigEndianValue(Hx(list, dataBounds.left) + coln); retval = TRUE; } } } else { - p.h = CW(cellp->h); - p.v = CW(cellp->v); + p.h = BigEndianValue(cellp->h); + p.v = BigEndianValue(cellp->v); if (!(ip = ROMlib_getoffp(p, list))) retval = FALSE; else - retval = (CW(*ip) & 0x8000) ? TRUE : FALSE; + retval = (BigEndianValue(*ip) & 0x8000) ? TRUE : FALSE; } return retval; } diff --git a/src/listStdLDEF.cpp b/src/listStdLDEF.cpp index e9422c91..c874c1be 100644 --- a/src/listStdLDEF.cpp +++ b/src/listStdLDEF.cpp @@ -16,6 +16,8 @@ namespace Executor { void C_ldef0(INTEGER, BOOLEAN, Rect*, Cell, INTEGER, INTEGER, ListHandle); } +using namespace ByteSwap; + A5(PRIVATE, void, draw, BOOLEAN, sel, Rect *, rect, INTEGER, doff, INTEGER, dl, ListHandle, list) { @@ -25,7 +27,7 @@ A5(PRIVATE, void, draw, BOOLEAN, sel, Rect *, rect, INTEGER, doff, savePort = thePort; SetPort(HxP(list, port)); EraseRect(rect); - MoveTo(CW(rect->left) + Hx(list, indent.h), CW(rect->top) + Hx(list, indent.v)); + MoveTo(BigEndianValue(rect->left) + Hx(list, indent.h), BigEndianValue(rect->top) + Hx(list, indent.v)); HLock((Handle) HxP(list, cells)); DrawText((Ptr) STARH(HxP(list, cells)) + doff, 0, dl); HUnlock((Handle) HxP(list, cells)); diff --git a/src/main.cpp b/src/main.cpp index 92132c6f..5e7b174a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -134,6 +134,7 @@ char ROMlib_rcsid_main[] = #endif using namespace Executor; +using namespace ByteSwap; BOOLEAN Executor::force_big_offset = CONFIG_OFFSET_P; @@ -571,7 +572,7 @@ A1(PRIVATE, void, misc_self_examination, char *, us) exit(6); } - if (fseek(ROMlib_fp, CL(arch.offset), SEEK_SET) == -1) { + if (fseek(ROMlib_fp, BigEndianValue(arch.offset), SEEK_SET) == -1) { fprintf(stderr, "couldn't seek after load seg command\n"); exit(17); } @@ -891,7 +892,7 @@ setup_trap_vectors (void) /* Set up the trap vector for the timer interrupt. */ timer_callback = callback_install (catchalarm, NULL); - *(syn68k_addr_t *)SYN68K_TO_US(M68K_TIMER_VECTOR * 4) = CL (timer_callback); + *(syn68k_addr_t *)SYN68K_TO_US(M68K_TIMER_VECTOR * 4) = BigEndianValue (timer_callback); /* Fill in unhandled trap vectors so they cause graceful deaths. * Skip over those trap vectors which are known to have legitimate @@ -923,7 +924,7 @@ setup_trap_vectors (void) { syn68k_addr_t c; c = callback_install (unhandled_trap, (void *) i); - *(syn68k_addr_t *)SYN68K_TO_US(i * 4) = CL (c); + *(syn68k_addr_t *)SYN68K_TO_US(i * 4) = BigEndianValue (c); } } #endif /* SYN68K */ @@ -1913,7 +1914,7 @@ int main(int argc, char** argv) MenuList = 0; MBSaveLoc = 0; - SysVersion = CW (system_version); + SysVersion = BigEndianValue (system_version); FSFCBLen = CWC (94); ScrapState = CWC (-1); @@ -1954,7 +1955,7 @@ int main(int argc, char** argv) UTableBase = (DCtlHandlePtr) (long) RM (NewPtr (sizeof (UTableBase[0].p) * NDEVICES)); memset (MR (UTableBase), 0, sizeof (UTableBase[0].p) * NDEVICES); - UnitNtryCnt = CW (NDEVICES); + UnitNtryCnt = BigEndianValue (NDEVICES); TheZone = ApplZone; if (graphics_p) @@ -1967,12 +1968,12 @@ int main(int argc, char** argv) make_rgb_spec (&mac_16bpp_rgb_spec, 16, TRUE, 0, 5, 10, 5, 5, 5, 0, - CL (GetCTSeed ())); + BigEndianValue (GetCTSeed ())); make_rgb_spec (&mac_32bpp_rgb_spec, 32, TRUE, 0, 8, 16, 8, 8, 8, 0, - CL (GetCTSeed ())); + BigEndianValue (GetCTSeed ())); gd_allocate_main_device (); } diff --git a/src/menu.cpp b/src/menu.cpp index c39024d2..d051b641 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -47,6 +47,7 @@ char ROMlib_rcsid_menu[] = #include "rsys/stubify.h" using namespace Executor; +using namespace ByteSwap; typedef pascal void (*menuhookp)( void ); @@ -104,7 +105,7 @@ P0(PUBLIC pascal trap, void, DrawMenuBar) Hx(MENULIST, muoff) + sizeof(muelem) + 4)) #define HIEROFF \ - CW(HIEROFFX) + BigEndianValue(HIEROFFX) #define MINMENULISTSIZE ((Size) sizeof(INTEGER) * 4 + sizeof(HIDDEN_Handle)) @@ -182,7 +183,7 @@ P0(PUBLIC pascal trap, void, InitMenus) { int n_entries; - n_entries = CW (*(uint16 *) STARH (default_mcinfo)); + n_entries = BigEndianValue (*(uint16 *) STARH (default_mcinfo)); MenuCInfo = (MCTableHandle) RM (NewHandle (n_entries * sizeof (MCEntry))); BlockMove ((Ptr) (&((uint16 *) STARH (default_mcinfo))[1]), @@ -206,7 +207,7 @@ P2(PUBLIC pascal trap, MenuHandle, NewMenu, INTEGER, mid, StringPtr, str) if (!str) str = (StringPtr) ""; retval = (MenuHandle) NewHandle((Size) SIZEOFMINFO + U(str[0]) + 1); - HxX(retval, menuID) = CW(mid); + HxX(retval, menuID) = BigEndianValue(mid); HxX(retval, menuWidth) = HxX(retval, menuHeight) = 0; /* menuHeight calculated elsewhere */ SetResLoad(TRUE); @@ -268,14 +269,14 @@ P1 (PUBLIC pascal trap, MenuHandle, GetMenu, int16, rid) entry.mctReserved = 0; mct_res = (mct_res_t *) STARH (mct_res_h); - for (i = 0; i < CW (mct_res->n_entries); i ++) + for (i = 0; i < BigEndianValue (mct_res->n_entries); i ++) { memcpy (&entry, &mct_res->entries[i], sizeof mct_res->entries[i]); SetMCEntries (1, &entry); } */ mct_res = (mct_res_t *) STARH (mct_res_h); - SetMCEntries (CW (mct_res->n_entries), + SetMCEntries (BigEndianValue (mct_res->n_entries), &mct_res->entries[0]); }); @@ -291,7 +292,7 @@ P1 (PUBLIC pascal trap, MenuHandle, GetMenu, int16, rid) MemErr = CWC (noErr); temph = GetResource (TICK("MDEF"), - CW (*(int16 *)&HxX(retval, menuProc))); + BigEndianValue (*(int16 *)&HxX(retval, menuProc))); if (SIZEOFMINFO != 15) Munger ((Handle) retval, (int32) 6, (Ptr) 0, (int32) 0, (Ptr) "x", (int32) 2); @@ -349,9 +350,9 @@ A7(PRIVATE, void, app, StringPtr, str, char, icon, char, marker, eip->menitem++; if (disflag) - STARH(eip->menh)->enableFlags &= CL(~((LONGINT)1 << eip->menitem)); + STARH(eip->menh)->enableFlags &= BigEndianValue(~((LONGINT)1 << eip->menitem)); else - STARH(eip->menh)->enableFlags |= CL((LONGINT)1 << eip->menitem); + STARH(eip->menh)->enableFlags |= BigEndianValue((LONGINT)1 << eip->menitem); newsize = eip->menoff + SIZEOFMEXT + 1 + U(str[0]); SetHandleSize((Handle) eip->menh, newsize); /* @@ -582,7 +583,7 @@ P2(PUBLIC pascal trap, void, DelMenuItem, MenuHandle, mh, /* IMIV-56 */ if (item < 32) { unchangedmask = (1L << item) - 1; /* 2s complement dependent */ HxX(mh, enableFlags) = - CL(((Hx(mh, enableFlags) >> 1) & ~unchangedmask) | + BigEndianValue(((Hx(mh, enableFlags) >> 1) & ~unchangedmask) | (Hx(mh, enableFlags) & unchangedmask) | 0x80000000); } @@ -640,7 +641,7 @@ A4(PRIVATE, void, xInsertResMenu, MenuHandle, mh, StringPtr, str, ep = sp + hsize; while (sp != ep) *dp++ = *sp++; - HxX(mh, enableFlags) = CL(Hx(mh, enableFlags) | + HxX(mh, enableFlags) = BigEndianValue(Hx(mh, enableFlags) | oldeflags << (endinf.menitem - after)); #if 0 /* RagTime suggests that at least for InsMenuItem */ /* CalcMenuSize shouldn't be called */ @@ -683,7 +684,7 @@ P2(PUBLIC pascal trap, void, InsertMenu, MenuHandle, mh, INTEGER, before) { mpend = HxX(MENULIST, mulist) + HIEROFF / sizeof(muelem); for (mp = FIRSTHIER; - mp != mpend && (CW(STARH(MR(mp->muhandle))->menuID) != mid1); + mp != mpend && (BigEndianValue(STARH(MR(mp->muhandle))->menuID) != mid1); mp++) ; if (mp != mpend) /* already there */ @@ -699,7 +700,7 @@ P2(PUBLIC pascal trap, void, InsertMenu, MenuHandle, mh, INTEGER, before) mpend = HxX(MENULIST, mulist) + Hx(MENULIST, muoff) / sizeof(muelem); for (mp = HxX(MENULIST, mulist); mp != mpend; mp++) { - if ((mid2 = CW(STARH(MR(mp->muhandle))->menuID)) == mid1) + if ((mid2 = BigEndianValue(STARH(MR(mp->muhandle))->menuID)) == mid1) /*-->*/ return; if (mid2 == before) bindex = mp; @@ -720,10 +721,10 @@ P2(PUBLIC pascal trap, void, InsertMenu, MenuHandle, mh, INTEGER, before) Munger(MR(MenuList), binoff, (Ptr) 0, (LONGINT) 0, (Ptr) &newmuelem, (LONGINT) sizeof(newmuelem)); } - HxX(MENULIST, muoff) = CW(Hx(MENULIST, muoff) + sizeof(muelem)); + HxX(MENULIST, muoff) = BigEndianValue(Hx(MENULIST, muoff) + sizeof(muelem)); MBDFCALL(mbCalc, 0, binoff); } - HIEROFFX = CW(HIEROFF + sizeof(muelem)); + HIEROFFX = BigEndianValue(HIEROFF + sizeof(muelem)); } } @@ -736,7 +737,7 @@ P1 (PUBLIC pascal trap, void, DeleteMenu, int16, mid) mpend = HxX(MENULIST, mulist) + Hx(MENULIST, muoff) / sizeof(muelem); for (mp = HxX(MENULIST, mulist); - mp != mpend && CW(STARH(MR(mp->muhandle))->menuID) != mid; + mp != mpend && BigEndianValue(STARH(MR(mp->muhandle))->menuID) != mid; mp++) ; if (mp != mpend) @@ -744,14 +745,14 @@ P1 (PUBLIC pascal trap, void, DeleteMenu, int16, mid) deleteloc = (LONGINT) ((char *)mp - (char *)STARH(MR(MenuList))); Munger (MR (MenuList), deleteloc, (Ptr) 0, (int32) sizeof (muelem), (Ptr) "", (int32) 0); - HxX(MENULIST, muoff) = CW(Hx(MENULIST, muoff) - sizeof(muelem)); + HxX(MENULIST, muoff) = BigEndianValue(Hx(MENULIST, muoff) - sizeof(muelem)); MBDFCALL(mbCalc, 0, deleteloc); } else { mpend = HxX(MENULIST, mulist) + HIEROFF / sizeof(muelem); for (mp = FIRSTHIER; - mp != mpend && (CW(STARH(MR(mp->muhandle))->menuID) != mid); + mp != mpend && (BigEndianValue(STARH(MR(mp->muhandle))->menuID) != mid); mp++) ; if (mp == mpend) @@ -760,7 +761,7 @@ P1 (PUBLIC pascal trap, void, DeleteMenu, int16, mid) (int32) ((char *)mp - (char *) STARH (MR (MenuList))), (Ptr) 0, (int32) sizeof(muelem), (Ptr) "", (int32) 0); } - HIEROFFX = CW (HIEROFF - sizeof (muelem)); + HIEROFFX = BigEndianValue (HIEROFF - sizeof (muelem)); } typedef mbartype *mbarptr; @@ -847,7 +848,7 @@ menu_id_exists_p (int id) initpairs (mps); for (mp = mps[nonhier].startp; mp != mps[nonhier].endp; mp ++) { - if (CW (STARH (MR (mp->muhandle))->menuID) == id) + if (BigEndianValue (STARH (MR (mp->muhandle))->menuID) == id) return TRUE; } return FALSE; @@ -862,7 +863,7 @@ A1(PUBLIC, INTEGER, ROMlib_mentosix, INTEGER, menuid) initpairs(mps); for (i = (int) nonhier; i <= (int) hier; i++) { for (mp = mps[i].startp, mpend = mps[i].endp; - mp < mpend && CW(STARH(MR(mp->muhandle))->menuID) != menuid; mp++) + mp < mpend && BigEndianValue(STARH(MR(mp->muhandle))->menuID) != menuid; mp++) ; if (mp < mpend) /*-->*/ return (char *) mp - (char *) STARH(MR(MenuList)); @@ -885,10 +886,10 @@ A2(PRIVATE, BOOLEAN, mtoggle, INTEGER, mid, highstate, h) P1 (PUBLIC pascal trap, void, HiliteMenu, INTEGER, mid) { - if (mid != CW (TheMenu)) + if (mid != BigEndianValue (TheMenu)) { if (TheMenu) - mtoggle (CW (TheMenu), RESTORE); + mtoggle (BigEndianValue (TheMenu), RESTORE); if (! menu_id_exists_p (mid)) mid = 0; if (mid) @@ -898,7 +899,7 @@ P1 (PUBLIC pascal trap, void, HiliteMenu, INTEGER, mid) mtoggle (mid, HILITE); } } - TheMenu = CW (mid); + TheMenu = BigEndianValue (mid); } A1(static inline, void, ROMlib_CALLMENUHOOK, menuhookp, fp) @@ -932,10 +933,10 @@ A1(PRIVATE, INTEGER, wheretowhich, LONGINT, offset) A1(PRIVATE, void, shadowrect, Rect *, rp) { - rp->top = CW(CW(rp->top) - 1); - rp->left = CW(CW(rp->left) - 1); - rp->bottom = CW(CW(rp->bottom) + 2); - rp->right = CW(CW(rp->right) + 2); + rp->top = BigEndianValue(BigEndianValue(rp->top) - 1); + rp->left = BigEndianValue(BigEndianValue(rp->left) - 1); + rp->bottom = BigEndianValue(BigEndianValue(rp->bottom) + 2); + rp->right = BigEndianValue(BigEndianValue(rp->right) + 2); } A3(PRIVATE, void, restoren, INTEGER, ntodrop, RgnHandle, restoredrgn, @@ -977,7 +978,7 @@ A2(PRIVATE, MenuHandle, menunumtomh, INTEGER, mid, INTEGER *, sixp) mpend = HxX(MENULIST, mulist) + HIEROFF / sizeof(muelem); for (mp = FIRSTHIER; mp != mpend && - CW(STARH(MR(mp->muhandle))->menuID) != mid; mp++) + BigEndianValue(STARH(MR(mp->muhandle))->menuID) != mid; mp++) ; if (mp != mpend) { *sixp = (char *) mp - (char *)STARH(MR(MenuList)); @@ -1044,8 +1045,8 @@ int32 Executor::ROMlib_menuhelper (MenuHandle mh, Rect *saverp, while (!done) { GetMouse (&pt); - pt.h = CW (pt.h); - pt.v = CW (pt.v); + pt.h = BigEndianValue (pt.h); + pt.v = BigEndianValue (pt.v); pointaslong = ((int32) pt.v << 16) | (unsigned short) pt.h; where = MBDFCALL (mbHit, 0, pointaslong); if (MenuHook) @@ -1056,9 +1057,9 @@ int32 Executor::ROMlib_menuhelper (MenuHandle mh, Rect *saverp, { PORT_TX_FACE_X (MR (wmgr_port)) = (Style) CB (0); PORT_TX_FONT_X (MR (wmgr_port)) = CWC (0); - item = CW(item); + item = BigEndianValue(item); MENUCALL (mChooseMsg, mh, &r, pt, &item); - item = CW(item); + item = BigEndianValue(item); if (item != olditem || changedmenus) { if (firstitem == -1) @@ -1082,9 +1083,9 @@ int32 Executor::ROMlib_menuhelper (MenuHandle mh, Rect *saverp, item = olditem; PORT_TX_FACE_X (MR (wmgr_port)) = (Style) CB (0); PORT_TX_FONT_X (MR (wmgr_port)) = CWC (0); - item = CW(item); + item = BigEndianValue(item); MENUCALL (mChooseMsg, mh, &r, pt, &item); - item = CW(item); + item = BigEndianValue(item); DisposeRgn (PORT_CLIP_REGION (MR (wmgr_port))); PORT_CLIP_REGION_X (MR (wmgr_port)) = saveclip; } @@ -1176,9 +1177,9 @@ int32 Executor::ROMlib_menuhelper (MenuHandle mh, Rect *saverp, { MR (wmgr_port)->txFace = (Style) 0; MR (wmgr_port)->txFont = 0; - item = CW(item); + item = BigEndianValue(item); MENUCALL(mChooseMsg, mh, &r, pt, &item); - item = CW(item); + item = BigEndianValue(item); } else item = 0; @@ -1190,8 +1191,8 @@ int32 Executor::ROMlib_menuhelper (MenuHandle mh, Rect *saverp, whichmenuhit = wheretowhich(where); newentry = (mbdfentry *)STARH(MR(MBSaveLoc)) + whichmenuhit; oldentry = (mbdfentry *)STARH(MR(MBSaveLoc)) + oldwhichmenuhit; - oldentry->mbReserved = CL((ULONGINT)item); - olditem = item = CL(newentry->mbReserved); + oldentry->mbReserved = BigEndianValue((ULONGINT)item); + olditem = item = BigEndianValue(newentry->mbReserved); changedmenus = TRUE; mh = MR(((muelem *) ((char *)STARH(MR(MenuList)) + where))->muhandle); templ = where; @@ -1244,9 +1245,9 @@ int32 Executor::ROMlib_menuhelper (MenuHandle mh, Rect *saverp, tempp.h = 0; PORT_TX_FACE_X (MR (wmgr_port)) = (Style) CB (0); PORT_TX_FONT_X (MR (wmgr_port)) = CWC (0); - tempi = CW(tempi); + tempi = BigEndianValue(tempi); MENUCALL(mChooseMsg, mh, &r, tempp, &tempi); - tempi = CW(tempi); + tempi = BigEndianValue(tempi); #if !defined(MACOSX_) if (MenuFlash) { @@ -1255,15 +1256,15 @@ int32 Executor::ROMlib_menuhelper (MenuHandle mh, Rect *saverp, Delay(3L, (LONGINT *) 0); PORT_TX_FACE_X (MR (wmgr_port)) = (Style) CB (0); PORT_TX_FONT_X (MR (wmgr_port)) = CWC (0); - tempi = CW(tempi); + tempi = BigEndianValue(tempi); MENUCALL(mChooseMsg, mh, &r, pt, &tempi); - tempi = CW(tempi); + tempi = BigEndianValue(tempi); Delay(3L, (LONGINT *) 0); PORT_TX_FACE_X (MR (wmgr_port)) = (Style) CB (0); PORT_TX_FONT_X (MR (wmgr_port)) = CWC (0); - tempi = CW(tempi); + tempi = BigEndianValue(tempi); MENUCALL(mChooseMsg, mh, &r, tempp, &tempi); - tempi = CW(tempi); + tempi = BigEndianValue(tempi); } Delay(3L, (LONGINT *) 0); } @@ -1331,7 +1332,7 @@ P1(PUBLIC pascal trap, void, FlashMenuBar, INTEGER, mid) TheMenu = 0; } else { l |= (LONGINT) HILITE << 16; - TheMenu = CW(mid); + TheMenu = BigEndianValue(mid); } MBDFCALL(mbHilite, 0, l); } @@ -1485,13 +1486,13 @@ P3(PUBLIC pascal trap, void, GetItem, MenuHandle, mh, INTEGER, item, P2(PUBLIC pascal trap, void, DisableItem, MenuHandle, mh, INTEGER, item) { if (mh) - HxX(mh, enableFlags) = CL(Hx(mh, enableFlags) & ~((LONGINT)1<mmarker); + *markp = BigEndianValue((INTEGER) (unsigned char) mep->mmarker); } P3(PUBLIC pascal trap, void, SetItemIcon, MenuHandle, mh, INTEGER, item, @@ -1541,7 +1542,7 @@ P3(PUBLIC pascal trap, void, GetItemIcon, MenuHandle, mh, INTEGER, item, mextp mep; if ((mep = ROMlib_mitemtop(mh, item, (StringPtr *) 0))) - *iconp = CW((INTEGER) (unsigned char) Cx(mep->micon)); + *iconp = BigEndianValue((INTEGER) (unsigned char) Cx(mep->micon)); } P3(PUBLIC pascal trap, void, SetItemStyle, MenuHandle, mh, INTEGER, item, @@ -1561,7 +1562,7 @@ P3(PUBLIC pascal trap, void, GetItemStyle, MenuHandle, mh, INTEGER, item, mextp mep; if ((mep = ROMlib_mitemtop(mh, item, (StringPtr *) 0))) - *stylep = CW((INTEGER) (unsigned char) Cx(mep->mstyle)); + *stylep = BigEndianValue((INTEGER) (unsigned char) Cx(mep->mstyle)); } P1(PUBLIC pascal trap, INTEGER, CountMItems, MenuHandle, mh) @@ -1587,7 +1588,7 @@ P1(PUBLIC pascal trap, MenuHandle, GetMHandle, INTEGER, mid) mpend = HxX(MENULIST, mulist) + HIEROFF / sizeof(muelem); for (mp = FIRSTHIER; - mp != mpend && CW(STARH(MR(mp->muhandle))->menuID) != mid; mp++) + mp != mpend && BigEndianValue(STARH(MR(mp->muhandle))->menuID) != mid; mp++) ; if (mp != mpend) retval = MR(mp->muhandle); @@ -1595,7 +1596,7 @@ P1(PUBLIC pascal trap, MenuHandle, GetMHandle, INTEGER, mid) { mpend = HxX(MENULIST, mulist) + Hx(MENULIST, muoff) / sizeof(muelem); for (mp = HxX(MENULIST, mulist); - mp != mpend && CW(STARH(MR(mp->muhandle))->menuID) != mid; mp++) + mp != mpend && BigEndianValue(STARH(MR(mp->muhandle))->menuID) != mid; mp++) ; if (mp != mpend) retval = MR(mp->muhandle); @@ -1608,7 +1609,7 @@ P1(PUBLIC pascal trap, MenuHandle, GetMHandle, INTEGER, mid) P1(PUBLIC pascal trap, void, SetMenuFlash, INTEGER, i) { - MenuFlash = CW(i); + MenuFlash = BigEndianValue(i); } A0(PUBLIC, BOOLEAN, ROMlib_shouldalarm) diff --git a/src/menuV.cpp b/src/menuV.cpp index 18bc1563..050a69b8 100644 --- a/src/menuV.cpp +++ b/src/menuV.cpp @@ -23,6 +23,7 @@ char ROMlib_rcsid_menuV[] = #include "rsys/prefs.h" using namespace Executor; +using namespace ByteSwap; P1(PUBLIC pascal trap, void, InitProcMenu, INTEGER, mbid) { @@ -43,7 +44,7 @@ P1(PUBLIC pascal trap, void, InitProcMenu, INTEGER, mbid) * the bits are not masked off. */ MBDFHndl = RM(GetResource(TICK("MBDF"), mbid)); - HxX(MENULIST, mufu) = CW(mbid); + HxX(MENULIST, mufu) = BigEndianValue(mbid); MBDFCALL(mbInit, 0, 0L); } @@ -58,7 +59,7 @@ P3(PUBLIC pascal trap, void, GetItemCmd, MenuHandle, mh, INTEGER, item, mextp mep; if ((mep = ROMlib_mitemtop(mh, item, (StringPtr *) 0))) - *cmdp = CW((unsigned short) (unsigned char) mep->mkeyeq); + *cmdp = BigEndianValue((unsigned short) (unsigned char) mep->mkeyeq); } P3(PUBLIC pascal trap, void, SetItemCmd, MenuHandle, mh, INTEGER, item, @@ -118,7 +119,7 @@ P4(PUBLIC pascal trap, LONGINT, PopUpMenuSelect, MenuHandle, mh, INTEGER, top, THEPORT_SAVE_EXCURSION (MR (wmgr_port), { - tempi = CW (tempi); + tempi = BigEndianValue (tempi); MENUCALL (mPopUpRect, mh, &saver, p, &tempi); TopMenuItem = tempi; where = ROMlib_mentosix (Hx (mh, menuID)); diff --git a/src/mixed_mode.cpp b/src/mixed_mode.cpp index d1ec8c98..94aef298 100644 --- a/src/mixed_mode.cpp +++ b/src/mixed_mode.cpp @@ -42,7 +42,7 @@ P3 (PUBLIC pascal trap, UniversalProcPtr, NewRoutineDescriptor, ProcPtr, proc, p->reserved2 = CBC (0); p->selectorInfo = CBC (0); p->routineCount = CWC (0); - p->routineRecords[0].procInfo = CL (info); + p->routineRecords[0].procInfo = BigEndianValue (info); p->routineRecords[0].reserved1 = CBC (0); p->routineRecords[0].ISA = CB (isa); p->routineRecords[0].routineFlags = CWC (kSelectorsAreNotIndexable); diff --git a/src/mman.cpp b/src/mman.cpp index 82d3899a..719241cc 100644 --- a/src/mman.cpp +++ b/src/mman.cpp @@ -45,6 +45,7 @@ char ROMlib_rcsid_mman[] = #include using namespace Executor; +using namespace ByteSwap; int Executor::ROMlib_applzone_size = DEFAULT_APPLZONE_SIZE; int Executor::ROMlib_syszone_size = DEFAULT_SYSZONE_SIZE; @@ -614,7 +615,7 @@ Executor::MoreMasters (void) void print_free (void) { - printf ("%d %d\n", CL (MR(ApplZone)->zcbFree), CL (MR(SysZone)->zcbFree)); + printf ("%d %d\n", BigEndianValue (MR(ApplZone)->zcbFree), BigEndianValue (MR(SysZone)->zcbFree)); } #endif @@ -637,9 +638,9 @@ Executor::InitZone (ProcPtr pGrowZone, int16 cMoreMasters, zone->bkLim = RM ((Ptr) last_block); zone->purgePtr = CLC_NULL; zone->hFstFree = CLC_NULL; - zone->zcbFree = CL ((uint32) limitPtr - (uint32) zone - 64); + zone->zcbFree = BigEndianValue ((uint32) limitPtr - (uint32) zone - 64); zone->gzProc = RM (pGrowZone); - zone->moreMast = CW (cMoreMasters); + zone->moreMast = BigEndianValue (cMoreMasters); zone->flags = CWC (0); zone->minCBFree = CWC (0); zone->purgeProc = CLC_NULL; @@ -793,7 +794,7 @@ Executor::DisposHandle (Handle h) MM_SLAM ("entry"); if (TTS_HACK && - h == (Handle) (CL (*(long *)SYN68K_TO_US (256)) + ROMlib_offset)) + h == (Handle) (BigEndianValue (*(long *)SYN68K_TO_US (256)) + ROMlib_offset)) h = 0; if (h) @@ -935,7 +936,7 @@ Executor::SetHandleSize (Handle h, Size newsize) ROMlib_memnomove_p = save_memnomove_p; ZONE_ZCB_FREE_X (current_zone) - = CL (ZONE_ZCB_FREE (current_zone) - PSIZE (nextblock)); + = BigEndianValue (ZONE_ZCB_FREE (current_zone) - PSIZE (nextblock)); SETPSIZE (block, oldpsize + PSIZE (nextblock)); SETSIZEC (block, 0); @@ -1158,7 +1159,7 @@ Executor::ReallocHandle (Handle h, Size size) { SETPSIZE (oldb, newsize); ZONE_ZCB_FREE_X (current_zone) - = CL (ZONE_ZCB_FREE (current_zone) - PSIZE (newb)); + = BigEndianValue (ZONE_ZCB_FREE (current_zone) - PSIZE (newb)); ROMlib_setupblock (oldb, size, REL, h, state); goto done; } @@ -1351,7 +1352,7 @@ Executor::SetPtrSize (Ptr p, Size newsize) if (ROMlib_makespace (&nextblock, newsize - oldpsize)) { ZONE_ZCB_FREE_X (current_zone) - = CL (ZONE_ZCB_FREE_X (current_zone) - PSIZE (nextblock)); + = BigEndianValue (ZONE_ZCB_FREE_X (current_zone) - PSIZE (nextblock)); SETPSIZE (block, oldpsize + PSIZE (nextblock)); SETSIZEC (block, 0); @@ -2079,7 +2080,7 @@ Executor::ROMlib_installhandle (Handle sh, Handle dh) block_header_t *sb = HANDLE_TO_BLOCK (sh); ROMlib_freeblock (db); SETMASTER (dh, STARH (sh)); - BLOCK_LOCATION_OFFSET_X (sb) = CL ((uint32) dh - (uint32) MR (TheZone)); + BLOCK_LOCATION_OFFSET_X (sb) = BigEndianValue ((uint32) dh - (uint32) MR (TheZone)); sh->p = (Ptr) ZONE_HFST_FREE_X (MR (TheZone)); ZONE_HFST_FREE_X (MR (TheZone)) = RM ((Ptr) sh); } @@ -2092,7 +2093,7 @@ Executor::MemError (void) { MM_SLAM ("entry"); - return CW (MemErr); + return BigEndianValue (MemErr); } THz diff --git a/src/mmansubr.cpp b/src/mmansubr.cpp index 89df08af..c31f3613 100644 --- a/src/mmansubr.cpp +++ b/src/mmansubr.cpp @@ -24,6 +24,7 @@ char ROMlib_rcsid_mmansubr[] = #include using namespace Executor; +using namespace ByteSwap; /* Attempts to notify the user of a catastrophic heap failure then exits. */ void @@ -297,7 +298,7 @@ addr_info (char *addr) return; /* blah */ - id = CW (id); + id = BigEndianValue (id); type = MR (type); res_name[res_name[0] + 1] = '\0'; @@ -601,10 +602,10 @@ Executor::ROMlib_setupblock (block_header_t *block, #endif if (olduse == FREE) - ZONE_ZCB_FREE_X (current_zone) = CL (ZONE_ZCB_FREE (current_zone) + ZONE_ZCB_FREE_X (current_zone) = BigEndianValue (ZONE_ZCB_FREE (current_zone) - PSIZE (block)); else - ZONE_ZCB_FREE_X (current_zone) = CL (ZONE_ZCB_FREE (current_zone) + ZONE_ZCB_FREE_X (current_zone) = BigEndianValue (ZONE_ZCB_FREE (current_zone) + oldsize - asize); } @@ -642,7 +643,7 @@ Executor::ROMlib_freeblock (block_header_t *block) THz current_zone; current_zone = MR (TheZone); - ZONE_ZCB_FREE_X (current_zone) = CL (ZONE_ZCB_FREE (current_zone) + ZONE_ZCB_FREE_X (current_zone) = BigEndianValue (ZONE_ZCB_FREE (current_zone) + PSIZE (block)); mm_set_block_fields_offset (block, FREE_BLOCK_STATE, FREE, 0, PSIZE (block), @@ -982,7 +983,7 @@ Executor::ROMlib_relalloc (Size size, block_header_t ** newblk) SETSIZEC (b, 0); SET_BLOCK_STATE (b, FREE_BLOCK_STATE); - ZONE_ZCB_FREE_X (current_zone) = CL (ZONE_ZCB_FREE (current_zone) + ZONE_ZCB_FREE_X (current_zone) = BigEndianValue (ZONE_ZCB_FREE (current_zone) + newsize); HeapEnd = (Ptr) ZONE_BK_LIM (current_zone); return noErr; diff --git a/src/notify.cpp b/src/notify.cpp index 6d7f84d1..e864491e 100644 --- a/src/notify.cpp +++ b/src/notify.cpp @@ -14,6 +14,7 @@ char ROMlib_rcsid_notify[] = #include "rsys/hook.h" using namespace Executor; +using namespace ByteSwap; /* Forward declarations in NotifyMgr.h (DO NOT DELETE THIS LINE) */ @@ -52,7 +53,7 @@ A1(PUBLIC trap, OSErrRET, NMInstall, NMRecPtr, nmptr) savea0 = EM_A0; savea1 = EM_A1; PUSHADDR((LONGINT) (long) US_TO_SYN68K(nmptr)); - CALL_EMULATOR((syn68k_addr_t) CL((long) nmptr->nmResp)); + CALL_EMULATOR((syn68k_addr_t) BigEndianValue((long) nmptr->nmResp)); EM_D0 = saved0; EM_D1 = saved1; EM_D2 = saved2; diff --git a/src/osevent.cpp b/src/osevent.cpp index e8e9747e..661a82ec 100644 --- a/src/osevent.cpp +++ b/src/osevent.cpp @@ -53,6 +53,7 @@ char ROMlib_rcsid_osevent[] = #include "SegmentLdr.h" using namespace Executor; +using namespace ByteSwap; #define NEVENT 20 @@ -116,7 +117,7 @@ Executor::ROMlib_set_keyboard (const char *keyboardname) if (new_h) { GetResInfo (new_h, &kchr_id, 0, 0); - kchr_id = CW (kchr_id); + kchr_id = BigEndianValue (kchr_id); LoadResource (new_h); if (kchr_ptr) { @@ -213,11 +214,11 @@ A1(PUBLIC, void, ROMlib_eventinit, boolean_t, graphics_valid_p) /* INTERNAL */ main_gd_bounds = &GD_BOUNDS (MR (MainDevice)); #if defined (MSDOS) - init_dos_events (CW (main_gd_bounds->right), - CW (main_gd_bounds->bottom)); + init_dos_events (BigEndianValue (main_gd_bounds->right), + BigEndianValue (main_gd_bounds->bottom)); #elif defined (EVENT_SVGALIB) - if (!event_init (CW (main_gd_bounds->right), - CW (main_gd_bounds->bottom))) + if (!event_init (BigEndianValue (main_gd_bounds->right), + BigEndianValue (main_gd_bounds->bottom))) { fprintf (stderr, "Unable to initialize svgalib events.\n" @@ -355,11 +356,11 @@ A3(PUBLIC trap, OSErrRET, PPostEvent, INTEGER, evcode, /* IMIV-85 */ if (!((1 << evcode)&Cx(SysEvtMask))) /*-->*/ return evtNotEnb; qp = geteventelem(); - qp->evtQWhat = CW(evcode); - qp->evtQMessage = CL(evmsg); - qp->evtQWhen = CL(tmpticks); + qp->evtQWhat = BigEndianValue(evcode); + qp->evtQMessage = BigEndianValue(evmsg); + qp->evtQWhen = BigEndianValue(tmpticks); qp->evtQWhere = ROMlib_curs; - qp->evtQModifiers = CW(ROMlib_mods); + qp->evtQModifiers = BigEndianValue(ROMlib_mods); Enqueue((QElemPtr) qp, &EventQueue); if (qelp) (*qelp).p = qp; @@ -397,8 +398,8 @@ A3(PRIVATE, OSErrRET, _PPostEvent, INTEGER, evcode, A6(PUBLIC, OSErrRET, ROMlib_PPostEvent, INTEGER, evcode, LONGINT, evmsg, HIDDEN_EvQElPtr *, qelp, LONGINT, when, Point, where, INTEGER, butmods) { - MouseLocation2.h = ROMlib_curs.h = CW(where.h); - MouseLocation2.v = ROMlib_curs.v = CW(where.v); + MouseLocation2.h = ROMlib_curs.h = BigEndianValue(where.h); + MouseLocation2.v = ROMlib_curs.v = BigEndianValue(where.v); ROMlib_mods = butmods; return _PPostEvent(evcode, evmsg, qelp); @@ -464,7 +465,7 @@ A3(PRIVATE, BOOLEAN, OSEventCommon, INTEGER, evmask, EventRecord *, eventp, (Ptr) &psn, sizeof psn, target); CountAppFiles (&dummy, &count); - count = CW (count); + count = BigEndianValue (count); if (count) { @@ -489,7 +490,7 @@ A3(PRIVATE, BOOLEAN, OSEventCommon, INTEGER, evmask, EventRecord *, eventp, TEMP_C_STRING_FROM_STR255 (file.fName)); #endif - FSMakeFSSpec (CW (file.vRefNum), 0, file.fName, &spec); + FSMakeFSSpec (BigEndianValue (file.vRefNum), 0, file.fName, &spec); AEPutPtr (list, i, typeFSS, (Ptr) &spec, sizeof spec); } @@ -558,7 +559,7 @@ A3(PRIVATE, BOOLEAN, OSEventCommon, INTEGER, evmask, EventRecord *, eventp, } retval = TRUE; } else { - eventp->when = CL(TickCount()); + eventp->when = BigEndianValue(TickCount()); { #if defined(X) || defined(MACOSX_) @@ -567,8 +568,8 @@ A3(PRIVATE, BOOLEAN, OSEventCommon, INTEGER, evmask, EventRecord *, eventp, LONGINT newmods; querypointerX(&x, &y, &newmods); - eventp->where.h = MouseLocation2.h = ROMlib_curs.h = CW(x); - eventp->where.v = MouseLocation2.v = ROMlib_curs.v = CW(y); + eventp->where.h = MouseLocation2.h = ROMlib_curs.h = BigEndianValue(x); + eventp->where.v = MouseLocation2.v = ROMlib_curs.v = BigEndianValue(y); } else #endif MouseLocation2 = eventp->where = ROMlib_curs; @@ -579,16 +580,16 @@ A3(PRIVATE, BOOLEAN, OSEventCommon, INTEGER, evmask, EventRecord *, eventp, LONGINT x, y; querypointerX (&x, &y, NULL); - eventp->where.h = MouseLocation2.h = ROMlib_curs.h = CW (x); - eventp->where.v = MouseLocation2.v = ROMlib_curs.v = CW (y); + eventp->where.h = MouseLocation2.h = ROMlib_curs.h = BigEndianValue (x); + eventp->where.v = MouseLocation2.v = ROMlib_curs.v = BigEndianValue (y); } #endif - eventp->modifiers = CW(ROMlib_mods); + eventp->modifiers = BigEndianValue(ROMlib_mods); if ((evmask & autoKeyMask) && lastdown != -1 && ticks > autoticks) { autoticks = ticks + Cx(KeyRepThresh); eventp->what = CWC(autoKey); - eventp->message = CL(lastdown); + eventp->message = BigEndianValue(lastdown); retval = TRUE; } else { eventp->what = CWC(nullEvent); @@ -632,7 +633,7 @@ A2(PUBLIC trap, BOOLEANRET, OSEventAvail, INTEGER, evmask, A1(PUBLIC trap, void, SetEventMask, INTEGER, evmask) { - SysEvtMask = CW(evmask); + SysEvtMask = BigEndianValue(evmask); } A0(PUBLIC, QHdrPtr, GetEvQHdr) diff --git a/src/osutil.cpp b/src/osutil.cpp index 2c786e73..7251b339 100644 --- a/src/osutil.cpp +++ b/src/osutil.cpp @@ -38,6 +38,7 @@ char ROMlib_rcsid_osutil[] = #endif using namespace Executor; +using namespace ByteSwap; /* * NOTE: HandToHand is not directly called by the outside world. @@ -624,7 +625,7 @@ A1(PUBLIC, void, GetTime, DateTimeRec *, d) LONGINT secs; GetDateTime(&secs); - Secs2Date(CL(secs), d); + Secs2Date(BigEndianValue(secs), d); } A1(PUBLIC, void, SetTime, DateTimeRec *, d) @@ -644,7 +645,7 @@ A0(PRIVATE, void, setdefaults) SPValid = VALID; SPAlarm = SPATalkB = SPATalkA = SPConfig = 0; SPPrint = SPPortB = SPPortA = CW(baud9600 | stop10 | data8 | noParity); - SPFont = CW(geneva - 1); + SPFont = BigEndianValue(geneva - 1); SPKbd = 0x63; SPVolCtl = 3; SPClikCaret = 0x88; @@ -693,11 +694,11 @@ A0(PRIVATE, void, deriveglobals) (tmg.tm_min * 60) + tmg.tm_sec; ROMlib_GMTcorrect = gmtimenow - ltimenow; - KeyThresh = CW((short) ((SPKbd >> 4) & 0xF) * 4); - KeyRepThresh = CW((short) (SPKbd & 0xF) * 4); - MenuFlash = CW((short) (SPMisc2 >> 2) & 3); - CaretTime = CL((short) (SPClikCaret & 0xF) * 4); - DoubleTime = CL((short) (SPClikCaret & 0xF0) / 4); + KeyThresh = BigEndianValue((short) ((SPKbd >> 4) & 0xF) * 4); + KeyRepThresh = BigEndianValue((short) (SPKbd & 0xF) * 4); + MenuFlash = BigEndianValue((short) (SPMisc2 >> 2) & 3); + CaretTime = BigEndianValue((short) (SPClikCaret & 0xF) * 4); + DoubleTime = BigEndianValue((short) (SPClikCaret & 0xF0) / 4); } A0(PUBLIC trap, OSErrRET, InitUtil) /* IMII-380 */ @@ -723,10 +724,10 @@ A0(PUBLIC trap, OSErrRET, InitUtil) /* IMII-380 */ SPPortB = sp.portB; SPAlarm = sp.alarm; SPFont = sp.font; - SPKbd = CW(sp.kbdPrint) >> 8; - SPPrint = CW(sp.kbdPrint); - SPVolCtl = CW(sp.volClik) >> 8; - SPClikCaret = CW(sp.volClik); + SPKbd = BigEndianValue(sp.kbdPrint) >> 8; + SPPrint = BigEndianValue(sp.kbdPrint); + SPVolCtl = BigEndianValue(sp.volClik) >> 8; + SPClikCaret = BigEndianValue(sp.volClik); #if !defined (BIGENDIAN) SPMisc2 = sp.misc; #else @@ -769,8 +770,8 @@ A0(PUBLIC trap, OSErrRET, WriteParam) /* IMII-382 */ sp.portB = SPPortB; sp.alarm = SPAlarm; sp.font = SPFont; - sp.kbdPrint = CW((short) (SPKbd << 8) | (SPPrint & 0xff)); - sp.volClik = CW((short) (SPVolCtl << 8) | (SPClikCaret & 0xff)); + sp.kbdPrint = BigEndianValue((short) (SPKbd << 8) | (SPPrint & 0xff)); + sp.volClik = BigEndianValue((short) (SPVolCtl << 8) | (SPClikCaret & 0xff)); #if !defined (BIGENDIAN) sp.misc = SPMisc2; #else @@ -834,9 +835,9 @@ A2(PUBLIC, LONGINT, NGetTrapAddress, INTEGER, n, INTEGER, ttype) /* IMII-384 */ LONGINT retval; retval = (LONGINT) ((ttype == OSTrap) ? - (LONGINT) CL((long) ostraptable[n&(NOSENTRIES-1)]) + (LONGINT) BigEndianValue((int) ostraptable[n&(NOSENTRIES-1)]) : - (LONGINT) CL((long) tooltraptable[n&(NTOOLENTRIES-1)])); + (LONGINT) BigEndianValue((int) tooltraptable[n&(NTOOLENTRIES-1)])); warning_trace_info ("n = 0x%x, ttype = %d, retval = %p", (uint16) n, ttype, (void *) retval); return retval; @@ -1000,12 +1001,12 @@ A2(PUBLIC trap, OSErrRET, SysEnvirons, INTEGER, vers, SysEnvRecPtr, p) if (vers <= 0) /*-->*/ return envBadVers; - p->environsVersion = CW (vers); + p->environsVersion = BigEndianValue (vers); p->machineType = CWC (53); p->systemVersion = SysVersion; #if !defined (SYN68K) - p->processor = CW(ROMlib_processor); + p->processor = BigEndianValue(ROMlib_processor); p->hasFPU = ROMlib_hasFPU; #else /* SYN68K */ p->processor = CWC(env68040); diff --git a/src/pef_hash.cpp b/src/pef_hash.cpp index 33cbfe6f..2adfc3a3 100644 --- a/src/pef_hash.cpp +++ b/src/pef_hash.cpp @@ -17,6 +17,7 @@ char ROMlib_rcsid_pef_hash[] = #include using namespace Executor; +using namespace ByteSwap; /* * @@ -155,7 +156,7 @@ update_export_hash_table (uint32 *hashp, int hash_index, int first_index, new_value = ((run_count << CHAIN_COUNT_SHIFT) | (first_index & FIRST_INDEX_MASK)); - hashp[hash_index] = CL (new_value); + hashp[hash_index] = BigEndianValue (new_value); } @@ -210,10 +211,10 @@ ROMlib_build_pef_hash (const map_entry_t table[], int count) PEFLIH_TERM_OFFSET_X (retval) = CLC (-1); /* totalImportedSymbolCount, relocSectionCount, relocInstrOffset are all already 0 */ - PEFLIH_STRINGS_OFFSET_X (retval) = CL (string_table_offset); - PEFLIH_HASH_OFFSET_X (retval) = CL (hash_offset); - PEFLIH_HASH_TABLE_POWER_X (retval) = CL (hash_power); - PEFLIH_SYMBOL_COUNT_X (retval) = CL (count); + PEFLIH_STRINGS_OFFSET_X (retval) = BigEndianValue (string_table_offset); + PEFLIH_HASH_OFFSET_X (retval) = BigEndianValue (hash_offset); + PEFLIH_HASH_TABLE_POWER_X (retval) = BigEndianValue (hash_power); + PEFLIH_SYMBOL_COUNT_X (retval) = BigEndianValue (count); hashp = (typeof (hashp)) ((char *) retval + hash_offset); exportp = (typeof (exportp)) ((char *) retval + export_offset); @@ -232,7 +233,7 @@ ROMlib_build_pef_hash (const map_entry_t table[], int count) strlen (table[i].symbol_name)); sorted[i].hash_index = PEFHashTableIndex (sorted[i].hash_word, hash_power); - sorted[i].class_and_name_x = CL ((kPEFTVectSymbol << 24) | + sorted[i].class_and_name_x = BigEndianValue ((kPEFTVectSymbol << 24) | name_offset); sorted[i].value = (uint32) RM (&table[i].value); length = strlen (table[i].symbol_name); @@ -286,9 +287,9 @@ lookup_by_index (const pef_hash_t *hashp, int index, int name_offset; retval = &hashp->symbol_table[index]; - name_offset = CL (retval->classAndName) & NAME_MASK; + name_offset = BigEndianValue (retval->classAndName) & NAME_MASK; *namep = hashp->symbol_names + name_offset; - *namelen = CL (hashp->export_key_table[index]) >> 16; + *namelen = BigEndianValue (hashp->export_key_table[index]) >> 16; } return retval; @@ -341,12 +342,12 @@ lookup_by_name (const ConnectionID connp, offset = PEFLIH_STRINGS_OFFSET (lihp); string_tablep = (typeof (string_tablep)) ((char *) lihp + offset); - chain_count_and_first_index = CL (hash_entries[hash_index]); + chain_count_and_first_index = BigEndianValue (hash_entries[hash_index]); chain_count = ((chain_count_and_first_index >> CHAIN_COUNT_SHIFT) & CHAIN_COUNT_MASK); index = ((chain_count_and_first_index >> FIRST_INDEX_SHIFT) & FIRST_INDEX_MASK); - hash_word_swapped = CL (hash_word); + hash_word_swapped = BigEndianValue (hash_word); for (past_index = index + chain_count; index < past_index && (export_key_table[index] != hash_word_swapped || @@ -404,19 +405,19 @@ P4 (PUBLIC pascal trap, OSErr, FindSymbol, ConnectionID, connID, switch (section_index) { case -2: /* absolute address */ - *symAddr = (Ptr) CL (val); + *symAddr = (Ptr) BigEndianValue (val); break; case -3: /* re-exported */ warning_unimplemented ("name = '%.*s', val = 0x%x", symName[0], symName+1, val); - *symAddr = (Ptr) CL (val); + *symAddr = (Ptr) BigEndianValue (val); break; default: { uint32 sect_start; sect_start = connID->sects[section_index].start; - *symAddr = (Ptr) CL (val + sect_start); + *symAddr = (Ptr) BigEndianValue (val + sect_start); } break; } diff --git a/src/prError.cpp b/src/prError.cpp index 957b4e69..2baba931 100644 --- a/src/prError.cpp +++ b/src/prError.cpp @@ -14,13 +14,14 @@ char ROMlib_rcsid_prError[] = #include "PrintMgr.h" using namespace Executor; +using namespace ByteSwap; P0(PUBLIC pascal trap, INTEGER, PrError) { - return CW(PrintErr); + return BigEndianValue(PrintErr); } P1(PUBLIC pascal trap, void, PrSetError, INTEGER, iErr) { - PrintErr = CW(iErr); + PrintErr = BigEndianValue(iErr); } diff --git a/src/prLowLevel.cpp b/src/prLowLevel.cpp index f570194a..bbfd7c08 100644 --- a/src/prLowLevel.cpp +++ b/src/prLowLevel.cpp @@ -40,6 +40,7 @@ char ROMlib_rcsid_prLowLevel[] = #endif using namespace Executor; +using namespace ByteSwap; PUBLIC uint32 ROMlib_PrDrvrVers = 70; @@ -140,13 +141,13 @@ P2(PUBLIC pascal, void, ROMlib_myjobproc, DialogPtr, dp, INTEGER, itemno) first = GetDILong (dp, PRINT_FIRST_BOX_NO, 1); last = GetDILong (dp, PRINT_LAST_BOX_NO, 9999); - HxX(hPrint, prJob.iFstPage) = CW (first); - HxX(hPrint, prJob.iLstPage) = CW (last); + HxX(hPrint, prJob.iFstPage) = BigEndianValue (first); + HxX(hPrint, prJob.iLstPage) = BigEndianValue (last); } { num_copies = GetDILong (dp, PRINT_COPIES_BOX_NO, 1); - HxX(hPrint, prJob.iCopies) = CW (num_copies); + HxX(hPrint, prJob.iCopies) = BigEndianValue (num_copies); } #if defined (CYGWIN32) #warning TODO use better x and y coords @@ -399,8 +400,8 @@ get_popup_bounding_box (Rect *rp, DialogPtr dp, INTEGER itemno) INTEGER unused; GetDItem (dp, itemno, &unused, NULL, rp); - rp->left = CW (CW (rp->left) - 1); - rp->bottom = CW (CW (rp->bottom) + 3); + rp->left = BigEndianValue (BigEndianValue (rp->left) - 1); + rp->bottom = BigEndianValue (BigEndianValue (rp->bottom) + 3); } #endif @@ -594,7 +595,7 @@ P3(PUBLIC, pascal BOOLEAN, ROMlib_stlfilterproc, DialogPeek, dp, { char c; - c = CL (evt->message) & 0xFF; + c = BigEndianValue (evt->message) & 0xFF; if (c == '\r' || c == NUMPAD_ENTER) { maybe_wait_for_keyup (); @@ -615,8 +616,8 @@ P3(PUBLIC, pascal BOOLEAN, ROMlib_stlfilterproc, DialogPeek, dp, gp = thePort; SetPort((GrafPtr) dp); GlobalToLocal(&localp); - localp.h = CW(localp.h); - localp.v = CW(localp.v); + localp.h = BigEndianValue(localp.h); + localp.v = BigEndianValue(localp.v); SetPort(gp); GetDItem ((DialogPtr) dp, OK, &unused, &h, &r); if (PtInRect (localp, &r)) @@ -685,7 +686,7 @@ P3(PUBLIC, pascal BOOLEAN, ROMlib_numsonlyfilterproc, DialogPeek, dp, case '\r': case NUMPAD_ENTER: maybe_wait_for_keyup (); - *ith = CW(OK); + *ith = BigEndianValue(OK); return TRUE; break; default: @@ -963,10 +964,10 @@ adjust_menu_common (TPPrDlg dlg, INTEGER item, heading_t heading, ini_key_t defk INTEGER unused; GetDItem ((DialogPtr) dlg, item, &unused, &h, &r); - r.right = CW (CW (r.left) + max_wid + 38); + r.right = BigEndianValue (BigEndianValue (r.left) + max_wid + 38); SetDItem ((DialogPtr) dlg, item, ctrlItem, MR (h.p), &r); - SizeControl (ch, CW (r.right) - CW (r.left), - CW (r.bottom) - CW (r.top)); + SizeControl (ch, BigEndianValue (r.right) - BigEndianValue (r.left), + BigEndianValue (r.bottom) - BigEndianValue (r.top)); } SetCtlMax (ch, i); if (default_index > -1) @@ -1122,9 +1123,9 @@ P1(PUBLIC pascal trap, TPPrDlg, PrStlInit, THPrint, hPrint) new1 = StringWidth (new_type_label); HUnlock (h); - r.left = CW (CW(r.left) + orig - new1); + r.left = BigEndianValue (BigEndianValue(r.left) + orig - new1); SetDItem ((DialogPtr) retval, LAYOUT_PRINTER_TYPE_LABEL_NO, - CW (item_type), h, &r); + BigEndianValue (item_type), h, &r); SetIText (GetDIText ((DialogPtr) retval, LAYOUT_PRINTER_NAME_NO), new_printer_name); SetIText (GetDIText ((DialogPtr) retval, @@ -1183,7 +1184,7 @@ P2(PUBLIC pascal trap, BOOLEAN, PrDlgMain, THPrint, hPrint, ProcPtr, initfptr) else { ModalDialog((ProcPtr) MR(prrecptr->pFltrProc), &item); - item = CW(item); + item = BigEndianValue(item); } CALLPRITEMPROC(prrecptr, item, MR(prrecptr->pItemProc)); @@ -1230,7 +1231,7 @@ P1(PUBLIC pascal trap, void, PrGeneral, Ptr, pData) /* IMV-410 */ tgp = (TGnlData *) pData; ((TGnlData *) pData)->iError = CWC(OpNotImpl); - switch (CW(tgp->iOpCode)) { + switch (BigEndianValue(tgp->iOpCode)) { case GetRslData: { TGetRslBlk *resolp; @@ -1250,8 +1251,8 @@ P1(PUBLIC pascal trap, void, PrGeneral, Ptr, pData) /* IMV-410 */ else { resolp->iRslRecCnt = CWC (2); - resolp->rgRslRec[1].iXRsl = CW (ROMlib_optional_res_x); - resolp->rgRslRec[1].iYRsl = CW (ROMlib_optional_res_y); + resolp->rgRslRec[1].iXRsl = BigEndianValue (ROMlib_optional_res_x); + resolp->rgRslRec[1].iYRsl = BigEndianValue (ROMlib_optional_res_y); } } break; @@ -1261,15 +1262,15 @@ P1(PUBLIC pascal trap, void, PrGeneral, Ptr, pData) /* IMV-410 */ resolp = (TSetRslBlk *) pData; if (!((resolp->iXRsl == CWC (72) && resolp->iYRsl == CWC (72)) || - (resolp->iXRsl == CW (ROMlib_optional_res_x) && - resolp->iYRsl == CW (ROMlib_optional_res_y)))) + (resolp->iXRsl == BigEndianValue (ROMlib_optional_res_x) && + resolp->iYRsl == BigEndianValue (ROMlib_optional_res_y)))) resolp->iError = CWC (NoSuchRsl); else { resolp->iError = CWC (noErr); ROMlib_set_default_resolution (MR (resolp->hPrint), - CW (resolp->iYRsl), - CW (resolp->iXRsl)); + BigEndianValue (resolp->iYRsl), + BigEndianValue (resolp->iXRsl)); } } break; diff --git a/src/prPrinting.cpp b/src/prPrinting.cpp index 57087286..5fda1535 100644 --- a/src/prPrinting.cpp +++ b/src/prPrinting.cpp @@ -37,6 +37,7 @@ PUBLIC boolean_t deferred_printing_p = FALSE /* TRUE */; #endif using namespace Executor; +using namespace ByteSwap; PUBLIC int pageno = 0; /* This isn't really the way to do it */ PUBLIC int Executor::ROMlib_passpostscript = TRUE; @@ -261,14 +262,14 @@ P3(PUBLIC pascal trap, void, PrComment, INTEGER, kind, INTEGER, size, break; case rotatebegin: ip = (INTEGER *) STARH(hand); - flippage = CW(ip[0]); - angle = CW(ip[1]); + flippage = BigEndianValue(ip[0]); + angle = BigEndianValue(ip[1]); ROMlib_rotatebegin(flippage, angle); break; case rotatecenter: fp = (Fixed *) STARH(hand); - yoffset = CL(fp[0]); - xoffset = CL(fp[1]); + yoffset = BigEndianValue(fp[0]); + xoffset = BigEndianValue(fp[1]); ROMlib_rotatecenter( Cx(thePort->pnLoc.v) + (double) yoffset / (1L << 16), Cx(thePort->pnLoc.h) + diff --git a/src/prRecords.cpp b/src/prRecords.cpp index 609172c2..14ab7d3a 100644 --- a/src/prRecords.cpp +++ b/src/prRecords.cpp @@ -19,6 +19,7 @@ char ROMlib_rcsid_prRecords[] = #include "rsys/print.h" using namespace Executor; +using namespace ByteSwap; PRIVATE void set_wDev (THPrint hPrint) @@ -32,18 +33,18 @@ Executor::ROMlib_set_default_resolution (THPrint hPrint, INTEGER vres, INTEGER h printer_init (); update_printing_globals (); - HxX(hPrint, prInfo.iVRes) = CW (vres); - HxX(hPrint, prInfo.iHRes) = CW (hres); + HxX(hPrint, prInfo.iVRes) = BigEndianValue (vres); + HxX(hPrint, prInfo.iHRes) = BigEndianValue (hres); HxX(hPrint, prInfo.rPage.top) = CWC (0); HxX(hPrint, prInfo.rPage.left) = CWC (0); - HxX(hPrint, prInfo.rPage.bottom) = CW ((ROMlib_paper_y - 72) * vres / 72); - HxX(hPrint, prInfo.rPage.right) = CW ((ROMlib_paper_x - 72) * hres / 72); + HxX(hPrint, prInfo.rPage.bottom) = BigEndianValue ((ROMlib_paper_y - 72) * vres / 72); + HxX(hPrint, prInfo.rPage.right) = BigEndianValue ((ROMlib_paper_x - 72) * hres / 72); - HxX(hPrint, rPaper.top) = CW ((INTEGER) (-0.5 * vres)); - HxX(hPrint, rPaper.bottom) = CW ((INTEGER) + HxX(hPrint, rPaper.top) = BigEndianValue ((INTEGER) (-0.5 * vres)); + HxX(hPrint, rPaper.bottom) = BigEndianValue ((INTEGER) ((ROMlib_paper_y - 36) * vres / 72)); - HxX(hPrint, rPaper.left) = CW ((INTEGER) (-0.5 * hres)); - HxX(hPrint, rPaper.right) = CW ((INTEGER) + HxX(hPrint, rPaper.left) = BigEndianValue ((INTEGER) (-0.5 * hres)); + HxX(hPrint, rPaper.right) = BigEndianValue ((INTEGER) ((ROMlib_paper_x - 36) * hres / 72)); ROMlib_resolution_x = hres; @@ -58,7 +59,7 @@ P1(PUBLIC pascal trap, void, PrintDefault, THPrint, hPrint) LaserWriter we're using wants */ memset((char *) STARH(hPrint), 0, sizeof(TPrint)); - HxX(hPrint, iPrVersion) = CW (ROMlib_PrDrvrVers); + HxX(hPrint, iPrVersion) = BigEndianValue (ROMlib_PrDrvrVers); ROMlib_set_default_resolution (hPrint, 72, 72); @@ -75,7 +76,7 @@ P1(PUBLIC pascal trap, void, PrintDefault, THPrint, hPrint) HxX(hPrint, prInfoPT.iHRes) = CWC(72); HxX(hPrint, prInfoPT.rPage) = HxX(hPrint, prInfo.rPage); - HxX(hPrint, prXInfo.iRowBytes) = CW((Hx(hPrint, prXInfo.iBandH) + 7) / 8); + HxX(hPrint, prXInfo.iRowBytes) = BigEndianValue((Hx(hPrint, prXInfo.iBandH) + 7) / 8); /* TODO: what about the rest of prXInfo? (is zero for now) */ HxX(hPrint, prJob.iFstPage) = CWC(1); diff --git a/src/process.cpp b/src/process.cpp index 47287609..f2deab7a 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -18,6 +18,7 @@ char ROMlib_rcsid_process[] = #include "rsys/process.h" using namespace Executor; +using namespace ByteSwap; #define declare_handle_type(type_prefix) \ typedef type_prefix ## _t *type_prefix ## _ptr; \ @@ -27,7 +28,7 @@ using namespace Executor; declare_handle_type (size_resource); #define SIZE_FLAGS_X(size) (HxX (size, flags)) -#define SIZE_FLAGS(size) (CW (SIZE_FLAGS_X (size))) +#define SIZE_FLAGS(size) (BigEndianValue (SIZE_FLAGS_X (size))) static size_resource_handle get_size_resource () @@ -100,8 +101,8 @@ Executor::process_create (boolean_t desk_accessory_p, /* + stack size */); info->launch_ticks = TickCount (); - info->serial_number.highLongOfPSN = CL (-1); - info->serial_number.lowLongOfPSN = CL (next_free_psn ++); + info->serial_number.highLongOfPSN = BigEndianValue (-1); + info->serial_number.lowLongOfPSN = BigEndianValue (next_free_psn ++); info->next = process_info_list; process_info_list = info; @@ -177,21 +178,21 @@ P2 (PUBLIC pascal trap, OSErr, GetProcessInformation, return paramErr; PROCESS_INFO_SERIAL_NUMBER (process_info) = info->serial_number; - PROCESS_INFO_TYPE_X (process_info) = CL (info->type); - PROCESS_INFO_SIGNATURE_X (process_info) = CL (info->signature); - PROCESS_INFO_MODE_X (process_info) = CL (info->mode); + PROCESS_INFO_TYPE_X (process_info) = BigEndianValue (info->type); + PROCESS_INFO_SIGNATURE_X (process_info) = BigEndianValue (info->signature); + PROCESS_INFO_MODE_X (process_info) = BigEndianValue (info->mode); PROCESS_INFO_LOCATION_X (process_info) = (Ptr) ApplZone; - PROCESS_INFO_SIZE_X (process_info) = CL (info->size); + PROCESS_INFO_SIZE_X (process_info) = BigEndianValue (info->size); /* ### set current zone to applzone? */ PROCESS_INFO_FREE_MEM_X (process_info) = FreeMem (); PROCESS_INFO_LAUNCHER (process_info) = no_process; - PROCESS_INFO_LAUNCH_DATE_X (process_info) = CL (info->launch_ticks); + PROCESS_INFO_LAUNCH_DATE_X (process_info) = BigEndianValue (info->launch_ticks); current_ticks = TickCount (); PROCESS_INFO_ACTIVE_TIME_X (process_info) - = CL (current_ticks - info->launch_ticks); + = BigEndianValue (current_ticks - info->launch_ticks); return noErr; } diff --git a/src/qBit.cpp b/src/qBit.cpp index 7bb42dd4..378d9ca6 100644 --- a/src/qBit.cpp +++ b/src/qBit.cpp @@ -22,6 +22,7 @@ char ROMlib_rcsid_qBit[] = #include "rsys/mman.h" using namespace Executor; +using namespace ByteSwap; P6 (PUBLIC pascal trap, void, CopyBits, BitMap *, src_bitmap, BitMap *, dst_bitmap, @@ -134,7 +135,7 @@ P6 (PUBLIC pascal trap, void, CopyBits, PtrToHand ((Ptr) dst_bitmap, &t, sizeof (PixMap)); bogo_port_pixmap = (PixMapHandle) t.p; - CPORT_PIXMAP_X_NO_ASSERT (theCPort) = CL (bogo_port_pixmap); + CPORT_PIXMAP_X_NO_ASSERT (theCPort) = BigEndianValue (bogo_port_pixmap); CPORT_VERSION_X_NO_ASSERT (theCPort) = CPORT_FLAG_BITS_X; } else @@ -142,8 +143,8 @@ P6 (PUBLIC pascal trap, void, CopyBits, big_region = NewRgn (); SetRectRgn (big_region, -32767, -32767, 32767, 32767); - PORT_VIS_REGION_X (thePort) = CL (big_region); - PORT_CLIP_REGION_X (thePort) = CL (big_region); + PORT_VIS_REGION_X (thePort) = BigEndianValue (big_region); + PORT_CLIP_REGION_X (thePort) = BigEndianValue (big_region); SetRect (&PORT_RECT (thePort), -32767, -32767, 32767, 32767); if (src_bitmap == &thePort->portBits) @@ -202,38 +203,38 @@ P4 (PUBLIC pascal trap, void, ScrollRect, Rect *, rp, INTEGER, dh, INTEGER, dv, srcr = *rp; #if 0 - OffsetRect(&srcr, -CW (PORT_BOUNDS (thePort).left), - -CW (PORT_BOUNDS (thePort).top)); /* loc to glob */ + OffsetRect(&srcr, -BigEndianValue (PORT_BOUNDS (thePort).left), + -BigEndianValue (PORT_BOUNDS (thePort).top)); /* loc to glob */ #endif dstr = srcr; updatergn2 = NewRgn(); RectRgn(updatergn2, &srcr); if (dh > 0) { - dstr.left = CW(CW(dstr.left) + dh); - srcr.right = CW(CW(srcr.right) - dh); + dstr.left = BigEndianValue(BigEndianValue(dstr.left) + dh); + srcr.right = BigEndianValue(BigEndianValue(srcr.right) - dh); } else { - srcr.left = CW(CW(srcr.left) - dh); - dstr.right = CW(CW(dstr.right) + dh); + srcr.left = BigEndianValue(BigEndianValue(srcr.left) - dh); + dstr.right = BigEndianValue(BigEndianValue(dstr.right) + dh); } if (dv > 0) { - dstr.top = CW(CW(dstr.top) + dv); - srcr.bottom = CW(CW(srcr.bottom) - dv); + dstr.top = BigEndianValue(BigEndianValue(dstr.top) + dv); + srcr.bottom = BigEndianValue(BigEndianValue(srcr.bottom) - dv); } else { - srcr.top = CW(CW(srcr.top) - dv); - dstr.bottom = CW(CW(dstr.bottom) + dv); + srcr.top = BigEndianValue(BigEndianValue(srcr.top) - dv); + dstr.bottom = BigEndianValue(BigEndianValue(dstr.bottom) + dv); } RectRgn(temp = NewRgn(), &dstr); DiffRgn(updatergn2, temp, updatergn2); #if 0 OffsetRgn(updatergn2, - CW (PORT_BOUNDS (thePort).left), - CW (PORT_BOUNDS (thePort).top)); /* glob to loc */ + BigEndianValue (PORT_BOUNDS (thePort).left), + BigEndianValue (PORT_BOUNDS (thePort).top)); /* glob to loc */ #endif UnionRgn(updatergn2, temp2, updatergn2); diff --git a/src/qCConv.cpp b/src/qCConv.cpp index 68b4d28f..669e7868 100644 --- a/src/qCConv.cpp +++ b/src/qCConv.cpp @@ -12,6 +12,7 @@ char ROMlib_rcsid_qCConv[] = #include "CQuickDraw.h" using namespace Executor; +using namespace ByteSwap; /* cmy and rgb color spaces are simply complements */ @@ -28,7 +29,7 @@ P2 (PUBLIC pascal trap, void, RGB2CMY, RGBColor *, rgb_color, CMYColor *, cmy_color) { - /* use `bar = ~foo' instead of `bar = CW (MaxSmallFract - CW (foo))' + /* use `bar = ~foo' instead of `bar = BigEndianValue (MaxSmallFract - BigEndianValue (foo))' to compute the complement value */ cmy_color->cyan = ~rgb_color->red; @@ -49,16 +50,16 @@ static inline unsigned short value (unsigned long n1, unsigned long n2, unsigned long hue) { if (hue < ANGLE_TO_SF (60)) - return CW (n1 + SF_MULT (n2 - n1, + return BigEndianValue (n1 + SF_MULT (n2 - n1, SF_MULT (hue, C_TO_SF (6)))); else if (hue < ANGLE_TO_SF (180)) - return CW (n2); + return BigEndianValue (n2); else if (hue < ANGLE_TO_SF (240)) - return CW (n1 + SF_MULT (n2 - n1, + return BigEndianValue (n1 + SF_MULT (n2 - n1, SF_MULT (ANGLE_TO_SF (240) - hue, C_TO_SF (6)))); else - return CW (n1); + return BigEndianValue (n1); } @@ -77,9 +78,9 @@ P2 (PUBLIC pascal trap, void, HSL2RGB, unsigned long m1, m2; /* the hue represents a angle in the range [0, 360) */ - unsigned long h = CW (hsl_color->hue); - unsigned long s = CW (hsl_color->saturation); - unsigned long l = CW (hsl_color->lightness); + unsigned long h = BigEndianValue (hsl_color->hue); + unsigned long s = BigEndianValue (hsl_color->saturation); + unsigned long l = BigEndianValue (hsl_color->lightness); if (l <= (MaxSmallFract / 2)) m2 = SF_MULT (l, (C_TO_SF (1) + s)); @@ -101,9 +102,9 @@ P2 (PUBLIC pascal trap, void, RGB2HSL, RGBColor *, rgb_color, HSLColor *, hsl_color) { - unsigned long r = CW (rgb_color->red); - unsigned long g = CW (rgb_color->green); - unsigned long b = CW (rgb_color->blue); + unsigned long r = BigEndianValue (rgb_color->red); + unsigned long g = BigEndianValue (rgb_color->green); + unsigned long b = BigEndianValue (rgb_color->blue); unsigned long max = MAX (r, MAX (g, b)); unsigned long min = MIN (r, MIN (g, b)); @@ -162,9 +163,9 @@ P2 (PUBLIC pascal trap, void, RGB2HSL, gui_fatal("r = 0x%lx, g = 0x%lx, b = 0x%lx", r, g, b); } - hsl_color->hue = CW (h); - hsl_color->saturation = CW (s); - hsl_color->lightness = CW (l); + hsl_color->hue = BigEndianValue (h); + hsl_color->saturation = BigEndianValue (s); + hsl_color->lightness = BigEndianValue (l); } P2 (PUBLIC pascal trap, void, HSV2RGB, @@ -180,9 +181,9 @@ P2 (PUBLIC pascal trap, void, HSV2RGB, else { /* the hue represents a angle in the range [0, 360) */ - unsigned long h = CW (hsv_color->hue); - unsigned long s = CW (hsv_color->saturation); - unsigned long v = CW (hsv_color->value); + unsigned long h = BigEndianValue (hsv_color->hue); + unsigned long s = BigEndianValue (hsv_color->saturation); + unsigned long v = BigEndianValue (hsv_color->value); /* one of the six color verticies of the hex cone, [0, 6) */ unsigned sextant = SF_TO_C (h * 6); @@ -198,35 +199,35 @@ P2 (PUBLIC pascal trap, void, HSV2RGB, switch (sextant) { case 0: - rgb_color->red = CW (v); - rgb_color->green = CW (t); - rgb_color->blue = CW (p); + rgb_color->red = BigEndianValue (v); + rgb_color->green = BigEndianValue (t); + rgb_color->blue = BigEndianValue (p); break; case 1: - rgb_color->red = CW (q); - rgb_color->green = CW (v); - rgb_color->blue = CW (p); + rgb_color->red = BigEndianValue (q); + rgb_color->green = BigEndianValue (v); + rgb_color->blue = BigEndianValue (p); break; case 2: - rgb_color->red = CW (p); - rgb_color->green = CW (v); - rgb_color->blue = CW (t); + rgb_color->red = BigEndianValue (p); + rgb_color->green = BigEndianValue (v); + rgb_color->blue = BigEndianValue (t); break; case 3: - rgb_color->red = CW (p); - rgb_color->green = CW (q); - rgb_color->blue = CW (v); + rgb_color->red = BigEndianValue (p); + rgb_color->green = BigEndianValue (q); + rgb_color->blue = BigEndianValue (v); break; case 4: - rgb_color->red = CW (t); - rgb_color->green = CW (p); - rgb_color->blue = CW (v); + rgb_color->red = BigEndianValue (t); + rgb_color->green = BigEndianValue (p); + rgb_color->blue = BigEndianValue (v); break; case 5: case 6: - rgb_color->red = CW (v); - rgb_color->green = CW (p); - rgb_color->blue = CW (q); + rgb_color->red = BigEndianValue (v); + rgb_color->green = BigEndianValue (p); + rgb_color->blue = BigEndianValue (q); break; default: gui_fatal ("sextant = %d", sextant); @@ -238,9 +239,9 @@ P2 (PUBLIC pascal trap, void, RGB2HSV, RGBColor *, rgb_color, HSVColor *, hsv_color) { - unsigned long r = CW (rgb_color->red); - unsigned long g = CW (rgb_color->green); - unsigned long b = CW (rgb_color->blue); + unsigned long r = BigEndianValue (rgb_color->red); + unsigned long g = BigEndianValue (rgb_color->green); + unsigned long b = BigEndianValue (rgb_color->blue); unsigned long max = MAX (r, MAX (g, b)); unsigned long min = MIN (r, MIN (g, b)); @@ -293,9 +294,9 @@ P2 (PUBLIC pascal trap, void, RGB2HSV, gui_fatal ("r = 0x%lx, g = 0x%lx, b = 0x%lx", r, g, b); } - hsv_color->hue = CW (h); - hsv_color->saturation = CW (s); - hsv_color->value = CW (v); + hsv_color->hue = BigEndianValue (h); + hsv_color->saturation = BigEndianValue (s); + hsv_color->value = BigEndianValue (v); } P1 (PUBLIC pascal trap, SmallFract, Fix2SmallFract, diff --git a/src/qCGrafPort.cpp b/src/qCGrafPort.cpp index 7d5224d6..b5ca6587 100644 --- a/src/qCGrafPort.cpp +++ b/src/qCGrafPort.cpp @@ -22,6 +22,7 @@ char ROMlib_rcsid_qCGrafport[] = #include "rsys/evil.h" using namespace Executor; +using namespace ByteSwap; P1 (PUBLIC pascal trap, void, OpenCPort, CGrafPtr, port) @@ -168,7 +169,7 @@ P1 (PUBLIC pascal trap, void, RGBForeColor, CPORT_RGB_FG_COLOR (theCPort) = *color; /* pick the best color and store it into `theCPort->fgColor' */ - PORT_FG_COLOR_X (theCPort) = CL (Color2Index (color)); + PORT_FG_COLOR_X (theCPort) = BigEndianValue (Color2Index (color)); } else { @@ -177,9 +178,9 @@ P1 (PUBLIC pascal trap, void, RGBForeColor, basic_qd_color = high_bits_to_colors - [CW (color->red) >> 15] - [CW (color->green) >> 15] - [CW (color->blue) >> 15]; + [BigEndianValue (color->red) >> 15] + [BigEndianValue (color->green) >> 15] + [BigEndianValue (color->blue) >> 15]; ForeColor (basic_qd_color); } @@ -204,7 +205,7 @@ P1 (PUBLIC pascal trap, void, RGBBackColor, CPORT_RGB_BK_COLOR (theCPort) = *color; /* pick the best color and store it into `theCPort->bkColor' */ - PORT_BK_COLOR_X (theCPort) = CL (Color2Index (color)); + PORT_BK_COLOR_X (theCPort) = BigEndianValue (Color2Index (color)); } else { @@ -213,9 +214,9 @@ P1 (PUBLIC pascal trap, void, RGBBackColor, basic_qd_color = high_bits_to_colors - [CW (color->red) >> 15] - [CW (color->green) >> 15] - [CW (color->blue) >> 15]; + [BigEndianValue (color->red) >> 15] + [BigEndianValue (color->green) >> 15] + [BigEndianValue (color->blue) >> 15]; BackColor (basic_qd_color); } @@ -490,7 +491,7 @@ P1 (PUBLIC pascal trap, PixPatHandle, GetPixPat, INTEGER, pixpat_id) ctab_ptr = (CTabPtr) ((char *) STARH (pixpat_res) + (int) PIXMAP_TABLE_AS_OFFSET (patmap)); ctab_size = (sizeof (ColorTable) - + (sizeof (ColorSpec) * CW (ctab_ptr->ctSize))); + + (sizeof (ColorSpec) * BigEndianValue (ctab_ptr->ctSize))); /* SetHandleSize ((Handle) PIXMAP_TABLE (patmap), ctab_size); */ @@ -502,8 +503,8 @@ P1 (PUBLIC pascal trap, PixPatHandle, GetPixPat, INTEGER, pixpat_id) (Ptr) STARH (PIXMAP_TABLE (patmap)), ctab_size); - /* ctab_ptr->ctSeed = CL (GetCTSeed ()); */ - CTAB_SEED_X (PIXMAP_TABLE (patmap)) = CL (GetCTSeed ()); + /* ctab_ptr->ctSeed = BigEndianValue (GetCTSeed ()); */ + CTAB_SEED_X (PIXMAP_TABLE (patmap)) = BigEndianValue (GetCTSeed ()); }); #if 0 @@ -570,7 +571,7 @@ P2 (PUBLIC pascal trap, void, MakeRGBPat, SetHandleSize ((Handle) PIXMAP_TABLE (patmap), (Size) (sizeof (ColorTable) + (4 * sizeof (ColorSpec)))); - CTAB_SEED_X (PIXMAP_TABLE (patmap)) = CL (GetCTSeed ()); + CTAB_SEED_X (PIXMAP_TABLE (patmap)) = BigEndianValue (GetCTSeed ()); CTAB_SIZE_X (PIXMAP_TABLE (patmap)) = CWC (5); CTAB_TABLE (PIXMAP_TABLE (patmap))[4].rgb = *color; } diff --git a/src/qColor.cpp b/src/qColor.cpp index 2b4a3b21..8684c3cf 100644 --- a/src/qColor.cpp +++ b/src/qColor.cpp @@ -22,6 +22,7 @@ char ROMlib_rcsid_qColor[] = #include "rsys/qcolor.h" using namespace Executor; +using namespace ByteSwap; /* color quickdraw global stuff */ @@ -92,7 +93,7 @@ P1(PUBLIC pascal trap, void, ForeColor, LONGINT, c) if (CGrafPort_p (the_port)) RGBForeColor (ROMlib_qd_color_to_rgb (c)); else - PORT_FG_COLOR_X (the_port) = CL (c); + PORT_FG_COLOR_X (the_port) = BigEndianValue (c); } } @@ -106,13 +107,13 @@ P1(PUBLIC pascal trap, void, BackColor, LONGINT, c) if (CGrafPort_p (the_port)) RGBBackColor (ROMlib_qd_color_to_rgb (c)); else - PORT_BK_COLOR_X (the_port) = CL (c); + PORT_BK_COLOR_X (the_port) = BigEndianValue (c); } } P1(PUBLIC pascal trap, void, ColorBit, INTEGER, b) { - PORT_COLR_BIT_X (thePort) = CW (b); + PORT_COLR_BIT_X (thePort) = BigEndianValue (b); } typedef CTabHandle clut_res_handle; @@ -158,8 +159,8 @@ P1 (PUBLIC pascal trap, CTabHandle, GetCTable, /* if the color table is b/w, set the seed to be the b/w clut seed */ /* #### ctab_id or a new seed? */ - CTAB_SEED_X (ctab) = CL (ctab_id == 33 ? 1 : ctab_id); - CTAB_SIZE_X (ctab) = CW (ctab_size); + CTAB_SEED_X (ctab) = BigEndianValue (ctab_id == 33 ? 1 : ctab_id); + CTAB_SIZE_X (ctab) = BigEndianValue (ctab_size); CTAB_FLAGS_X (ctab) = CTAB_GDEVICE_BIT_X; table = CTAB_TABLE (ctab); @@ -167,13 +168,13 @@ P1 (PUBLIC pascal trap, CTabHandle, GetCTable, stride = 0xFFFF0000UL / ctab_size; for (c = 0xFFFF0000UL, i = 0; i < ctab_size; c -= stride, i ++) { - table[i].value = CW (i); + table[i].value = BigEndianValue (i); table[i].rgb.red = table[i].rgb.green = table[i].rgb.blue - = CW ((c + 0x8000) >> 16); + = BigEndianValue ((c + 0x8000) >> 16); } /* Make sure the last entry is _exactly_ black. */ - table[ctab_size].value = CW (ctab_size); + table[ctab_size].value = BigEndianValue (ctab_size); table[ctab_size].rgb.red = table[ctab_size].rgb.green = table[ctab_size].rgb.blue = CWC (0); @@ -203,7 +204,7 @@ P1 (PUBLIC pascal trap, CTabHandle, GetCTable, ctab_handle_size); /* #### ctab_id or a new seed? */ - CTAB_SEED_X (ctab) = CL (ctab_id); + CTAB_SEED_X (ctab) = BigEndianValue (ctab_id); } else if (ctab_id >= 0 && ctab_id <= 8) { @@ -214,9 +215,9 @@ P1 (PUBLIC pascal trap, CTabHandle, GetCTable, ctab_size = (1 << ctab_id) - 1; ctab = (CTabHandle) NewHandle (CTAB_STORAGE_FOR_SIZE (ctab_size)); - CTAB_SIZE_X (ctab) = CW (ctab_size); + CTAB_SIZE_X (ctab) = BigEndianValue (ctab_size); CTAB_FLAGS_X (ctab) = CTAB_GDEVICE_BIT_X; - CTAB_SEED_X (ctab) = CL (ctab_id); + CTAB_SEED_X (ctab) = BigEndianValue (ctab_id); ctab_table = CTAB_TABLE (ctab); memcpy (ctab_table, default_ctab_colors[ROMlib_log2[ctab_id]], diff --git a/src/qColorMgr.cpp b/src/qColorMgr.cpp index 53a49aa6..283a9eab 100644 --- a/src/qColorMgr.cpp +++ b/src/qColorMgr.cpp @@ -25,6 +25,7 @@ char ROMlib_rcsid_qColorMgr[] = #include "rsys/dirtyrect.h" using namespace Executor; +using namespace ByteSwap; INTEGER ROMlib_qd_error; @@ -64,9 +65,9 @@ itable_hash (RGBColor *rgbp, int resolution) int retval; uint16 red, green, blue; - red = CW (rgbp->red) >> (16 - resolution); - green = CW (rgbp->green) >> (16 - resolution); - blue = CW (rgbp->blue) >> (16 - resolution); + red = BigEndianValue (rgbp->red) >> (16 - resolution); + green = BigEndianValue (rgbp->green) >> (16 - resolution); + blue = BigEndianValue (rgbp->blue) >> (16 - resolution); switch (resolution) { @@ -116,9 +117,9 @@ rgb_diff (RGBColor *rgb1p, RGBColor *rgb2p) */ - retval = (ABS (CW (rgb1p->red & 0xff) - CW (rgb2p->red & 0xff)) + - ABS (CW (rgb1p->green & 0xff) - CW (rgb2p->green & 0xff)) + - ABS (CW (rgb1p->blue & 0xff) - CW (rgb2p->blue & 0xff))); + retval = (ABS (BigEndianValue (rgb1p->red & 0xff) - BigEndianValue (rgb2p->red & 0xff)) + + ABS (BigEndianValue (rgb1p->green & 0xff) - BigEndianValue (rgb2p->green & 0xff)) + + ABS (BigEndianValue (rgb1p->blue & 0xff) - BigEndianValue (rgb2p->blue & 0xff))); return retval; } @@ -126,9 +127,9 @@ rgb_diff (RGBColor *rgb1p, RGBColor *rgb2p) /* FIXME: may have to round instead of cleave off the low bits */ #define RGB_TO_ITAB_INDEX(rgb, resolution) \ - (((CW ((rgb)->red) >> (16 - (resolution))) << (2 * (resolution))) \ - | ((CW ((rgb)->green) >> (16 - (resolution))) << (resolution)) \ - | ((CW ((rgb)->blue) >> (16 - (resolution))))) + (((BigEndianValue ((rgb)->red) >> (16 - (resolution))) << (2 * (resolution))) \ + | ((BigEndianValue ((rgb)->green) >> (16 - (resolution))) << (resolution)) \ + | ((BigEndianValue ((rgb)->blue) >> (16 - (resolution))))) static uint32 ROMlib_search_proc (RGBColor *rgb) @@ -147,9 +148,9 @@ ROMlib_search_proc (RGBColor *rgb) : &mac_32bpp_rgb_spec; retval = (*rgb_spec->rgbcolor_to_pixel) (rgb_spec, rgb, TRUE); if (pixel_size == 16) - retval = CW (retval); + retval = BigEndianValue (retval); else if (pixel_size == 32) - retval = CL (retval); + retval = BigEndianValue (retval); else gui_fatal ("unknown pixel size `%d'", pixel_size); } @@ -257,7 +258,7 @@ P1 (PUBLIC pascal trap, LONGINT, Color2Index, if (! success_p) position = ROMlib_search_proc (rgb); else - position = CL (position); /* They filled this in in big endian order. */ + position = BigEndianValue (position); /* They filled this in in big endian order. */ return position; } @@ -306,7 +307,7 @@ P1 (PUBLIC pascal trap, BOOLEAN, RealColor, closest = &(CTAB_TABLE (table)[index].rgb); /* high `resolution' bits */ - mask = CW (((1 << resolution) - 1) << (16 - resolution)); + mask = BigEndianValue (((1 << resolution) - 1) << (16 - resolution)); return !(((rgb->red ^ closest->red) & mask) || ((rgb->green ^ closest->green) & mask) @@ -395,12 +396,12 @@ P3 (PUBLIC pascal trap, void, GetSubTable, color table */ /* if (gd_ctab_p) - color->value = CW (ctab_index); + color->value = BigEndianValue (ctab_index); else color->value = target_ctab_table[ctab_index].value; color->rgb = target_ctab_table[ctab_index].rgb; */ - color->value = CW (ctab_index); + color->value = BigEndianValue (ctab_index); } PIXMAP_TABLE_X (gd_pmap) = gdev_ctab_save; @@ -422,12 +423,12 @@ Executor::average_color (GDHandle gd, gd_pmap = GD_PMAP (gd); gd_pixel_size = PIXMAP_PIXEL_SIZE (gd_pmap); - in_between.red = CW (((CW (c1->red) * ratio) - + (CW (c2->red) * (65535 - ratio))) / 65535); - in_between.green = CW (((CW (c1->green) * ratio) - + (CW (c2->green) * (65535 - ratio))) / 65535); - in_between.blue = CW (((CW (c1->blue) * ratio) - + (CW (c2->blue) * (65535 - ratio))) / 65535); + in_between.red = BigEndianValue (((BigEndianValue (c1->red) * ratio) + + (BigEndianValue (c2->red) * (65535 - ratio))) / 65535); + in_between.green = BigEndianValue (((BigEndianValue (c1->green) * ratio) + + (BigEndianValue (c2->green) * (65535 - ratio))) / 65535); + in_between.blue = BigEndianValue (((BigEndianValue (c1->blue) * ratio) + + (BigEndianValue (c2->blue) * (65535 - ratio))) / 65535); if (gd_pixel_size <= 8) { CTabHandle gd_ctab; @@ -697,7 +698,7 @@ P3 (PUBLIC pascal trap, void, MakeITable, #endif SetHandleSize ((Handle) inverse_table, new_size); } - ITAB_RES_X (inverse_table) = CW (resolution); + ITAB_RES_X (inverse_table) = BigEndianValue (resolution); itab_table = ITAB_TABLE (inverse_table); @@ -739,12 +740,12 @@ P3 (PUBLIC pascal trap, void, MakeITable, if (CTAB_FLAGS_X (color_table) & CTAB_GDEVICE_BIT_X) new_value = i; else - new_value = CW (color->value); + new_value = BigEndianValue (color->value); /* Save away the color for this index, in native endian byte order. */ - color_for_index[new_value].rgb.red = CW (color->rgb.red); - color_for_index[new_value].rgb.green = CW (color->rgb.green); - color_for_index[new_value].rgb.blue = CW (color->rgb.blue); + color_for_index[new_value].rgb.red = BigEndianValue (color->rgb.red); + color_for_index[new_value].rgb.green = BigEndianValue (color->rgb.green); + color_for_index[new_value].rgb.blue = BigEndianValue (color->rgb.blue); current_red = color_for_index[new_value].rgb.red; current_blue = color_for_index[new_value].rgb.blue; @@ -916,7 +917,7 @@ P2 (PUBLIC pascal trap, void, ReserveEntry, /* Only change the seed when necessary. */ if (old_value != entry->value) - CTAB_SEED_X (ctab) = CL (GetCTSeed ()); + CTAB_SEED_X (ctab) = BigEndianValue (GetCTSeed ()); } P3 (PUBLIC pascal trap, void, SetEntries, @@ -966,7 +967,7 @@ P3 (PUBLIC pascal trap, void, SetEntries, for (i = 0; i <= count; i ++) { - int index = CW (atable[i].value); + int index = BigEndianValue (atable[i].value); if (index < min) min = index; @@ -996,7 +997,7 @@ P3 (PUBLIC pascal trap, void, SetEntries, if (ctab_changed_p) { - CTAB_SEED_X (ctab) = CL (GetCTSeed ()); + CTAB_SEED_X (ctab) = BigEndianValue (GetCTSeed ()); if (gd == MR (MainDevice)) { if (num_colors > 0) @@ -1072,7 +1073,7 @@ P1 (PUBLIC pascal trap, void, DelComp, P1 (PUBLIC pascal trap, void, SetClientID, INTEGER, id) { - GD_ID_X (MR (TheGDevice)) = CW (id); + GD_ID_X (MR (TheGDevice)) = BigEndianValue (id); } P3 (PUBLIC pascal trap, void, SaveEntries, CTabHandle, src, CTabHandle, result, @@ -1086,18 +1087,18 @@ P3 (PUBLIC pascal trap, void, SaveEntries, CTabHandle, src, CTabHandle, result, src = PIXMAP_TABLE (GD_PMAP (MR (TheGDevice))); src_ctab_size = CTAB_SIZE (src); - req_size = CW (selection->reqLSize); + req_size = BigEndianValue (selection->reqLSize); SetHandleSize ((Handle) result, CTAB_STORAGE_FOR_SIZE (req_size)); - CTAB_SIZE_X (result) = CW (req_size); + CTAB_SIZE_X (result) = BigEndianValue (req_size); /* #### should this set the color table seed? */ - CTAB_SEED_X (result) = CL (GetCTSeed ()); - CTAB_FLAGS_X (result) = CW (0); + CTAB_SEED_X (result) = BigEndianValue (GetCTSeed ()); + CTAB_FLAGS_X (result) = BigEndianValue (0); for (i = 0; i <= req_size; i ++) { - int req_index = CW (selection->reqLData[i]); + int req_index = BigEndianValue (selection->reqLData[i]); if (req_index >= 0 && req_index <= src_ctab_size) @@ -1126,11 +1127,11 @@ P3 (PUBLIC pascal trap, void, RestoreEntries, CTabHandle, src, CTabHandle, dst, dst = PIXMAP_TABLE (GD_PMAP (MR (TheGDevice))); dst_ctab_size = CTAB_SIZE (dst); - req_size = CW (selection->reqLSize); + req_size = BigEndianValue (selection->reqLSize); for (i = 0; i < req_size; i ++) { - int req_index = CW (selection->reqLData[i]); + int req_index = BigEndianValue (selection->reqLData[i]); if (req_index >= 0 && req_index <= dst_ctab_size) diff --git a/src/qColorPicker.cpp b/src/qColorPicker.cpp index ce518a14..3b37c33c 100644 --- a/src/qColorPicker.cpp +++ b/src/qColorPicker.cpp @@ -31,6 +31,7 @@ char ROMlib_rcsid_qColorPicker[] = #include using namespace Executor; +using namespace ByteSwap; /* sanity defines */ @@ -219,8 +220,8 @@ compute_bounds (Point maybe_top_left) /* centered horizontally, with a third of the space above the window, and two-thirds below */ - top = CW (gd_rect->top) + (gd_height - height) / 3; - left = CW (gd_rect->left) + (gd_width - width) / 2; + top = BigEndianValue (gd_rect->top) + (gd_height - height) / 3; + left = BigEndianValue (gd_rect->left) + (gd_width - width) / 2; } else { @@ -228,10 +229,10 @@ compute_bounds (Point maybe_top_left) left = maybe_top_left.h; } - color_picker_window_bounds->top = CW (top); - color_picker_window_bounds->left = CW (left); - color_picker_window_bounds->bottom = CW (top + height); - color_picker_window_bounds->right = CW (left + width); + color_picker_window_bounds->top = BigEndianValue (top); + color_picker_window_bounds->left = BigEndianValue (left); + color_picker_window_bounds->bottom = BigEndianValue (top + height); + color_picker_window_bounds->right = BigEndianValue (left + width); } typedef enum miniarrow_hilite @@ -401,24 +402,24 @@ text_box_init (void) *te_bounds = *frame_bounds; InsetRect (te_bounds, 4, 4); - baseline = ( ( CW (frame_bounds->top) - + CW (frame_bounds->bottom)) / 2 + baseline = ( ( BigEndianValue (frame_bounds->top) + + BigEndianValue (frame_bounds->bottom)) / 2 - font_height / 2 + font_ascent); title_pt = &box->title_pt; label_pt = &box->label_pt; title_pt->v = label_pt->v = baseline; - title_pt->h = CW (template_bounds->left) + offset - StringWidth (title); - label_pt->h = CW (frame_bounds->right) + space_width / 2; + title_pt->h = BigEndianValue (template_bounds->left) + offset - StringWidth (title); + label_pt->h = BigEndianValue (frame_bounds->right) + space_width / 2; miniarrow_bounds = &box->miniarrow_rect; *miniarrow_bounds = *frame_bounds; - miniarrow_bounds->left = CW ( label_pt->h + miniarrow_bounds->left = BigEndianValue ( label_pt->h + label_width + space_width / 2); - miniarrow_bounds->right = CW ( label_pt->h + miniarrow_bounds->right = BigEndianValue ( label_pt->h + label_width + space_width / 2 + 22); @@ -565,8 +566,8 @@ text_box_miniarrow_update (struct text_box *box, miniarrow_rect = &box->miniarrow_rect; - center_x = (CW (miniarrow_rect->left) + CW (miniarrow_rect->right)) / 2; - center_y = (CW (miniarrow_rect->top) + CW (miniarrow_rect->bottom)) / 2; + center_x = (BigEndianValue (miniarrow_rect->left) + BigEndianValue (miniarrow_rect->right)) / 2; + center_y = (BigEndianValue (miniarrow_rect->top) + BigEndianValue (miniarrow_rect->bottom)) / 2; SetRect (&dst_rect, center_x - 13 / 2, center_y - 22 / 2, @@ -657,13 +658,13 @@ text_box_update_value_1 (struct text_box *box, int newval, switch (box->i) { case red_index: - current_color.red = CW (red); + current_color.red = BigEndianValue (red); break; case green_index: - current_color.green = CW (green); + current_color.green = BigEndianValue (green); break; case blue_index: - current_color.blue = CW (blue); + current_color.blue = BigEndianValue (blue); break; case hue_index: case saturation_index: @@ -711,18 +712,18 @@ hue_saturation_update (int new_hue, int new_saturation, if (full_update_p) { - hsl_color.hue = CW (hue); - hsl_color.saturation = CW (saturation); - hsl_color.lightness = CW (lightness); + hsl_color.hue = BigEndianValue (hue); + hsl_color.saturation = BigEndianValue (saturation); + hsl_color.lightness = BigEndianValue (lightness); HSL2RGB (&hsl_color, &rgb_color); text_box_update_value_1 (&text_boxes[red_index], - CW (rgb_color.red), TRUE, TRUE); + BigEndianValue (rgb_color.red), TRUE, TRUE); text_box_update_value_1 (&text_boxes[green_index], - CW (rgb_color.green), TRUE, TRUE); + BigEndianValue (rgb_color.green), TRUE, TRUE); text_box_update_value_1 (&text_boxes[blue_index], - CW (rgb_color.blue), TRUE, TRUE); + BigEndianValue (rgb_color.blue), TRUE, TRUE); compare_box_update (); } @@ -774,17 +775,17 @@ text_box_update_value (struct text_box *box, int newval, { text_box_update_value_1 (box, newval, update_if_p, TRUE); - rgb_color.red = CW (red); - rgb_color.green = CW (green); - rgb_color.blue = CW (blue); + rgb_color.red = BigEndianValue (red); + rgb_color.green = BigEndianValue (green); + rgb_color.blue = BigEndianValue (blue); RGB2HSL (&rgb_color, &hsl_color); - hue_saturation_update (CW (hsl_color.hue), CW (hsl_color.saturation), + hue_saturation_update (BigEndianValue (hsl_color.hue), BigEndianValue (hsl_color.saturation), FALSE); text_box_update_value_1 (&text_boxes[lightness_index], - CW (hsl_color.lightness), TRUE, TRUE); + BigEndianValue (hsl_color.lightness), TRUE, TRUE); break; } @@ -794,18 +795,18 @@ text_box_update_value (struct text_box *box, int newval, { text_box_update_value_1 (box, newval, update_if_p, TRUE); - hsl_color.hue = CW (hue); - hsl_color.saturation = CW (saturation); - hsl_color.lightness = CW (lightness); + hsl_color.hue = BigEndianValue (hue); + hsl_color.saturation = BigEndianValue (saturation); + hsl_color.lightness = BigEndianValue (lightness); HSL2RGB (&hsl_color, &rgb_color); text_box_update_value_1 (&text_boxes[red_index], - CW (rgb_color.red), TRUE, TRUE); + BigEndianValue (rgb_color.red), TRUE, TRUE); text_box_update_value_1 (&text_boxes[green_index], - CW (rgb_color.green), TRUE, TRUE); + BigEndianValue (rgb_color.green), TRUE, TRUE); text_box_update_value_1 (&text_boxes[blue_index], - CW (rgb_color.blue), TRUE, TRUE); + BigEndianValue (rgb_color.blue), TRUE, TRUE); break; } } @@ -871,7 +872,7 @@ event_loop (void) TEIdle (te); - switch (CW (evt.what)) + switch (BigEndianValue (evt.what)) { case mouseDown: { @@ -918,8 +919,8 @@ event_loop (void) { int center_y; - center_y = ( CW (box->miniarrow_rect.top) - + CW (box->miniarrow_rect.bottom)) / 2; + center_y = ( BigEndianValue (box->miniarrow_rect.top) + + BigEndianValue (box->miniarrow_rect.bottom)) / 2; integer_increment_p = FALSE; track_kount = 0; @@ -1038,17 +1039,17 @@ event_loop (void) #define current_compare_box_label ((StringPtr) "\005New: ") - MoveTo (( CW (orig_compare_box_bounds->left) + MoveTo (( BigEndianValue (orig_compare_box_bounds->left) - StringWidth (orig_compare_box_label)), - ( ( CW (orig_compare_box_bounds->top) - + CW (orig_compare_box_bounds->bottom)) / 2 + ( ( BigEndianValue (orig_compare_box_bounds->top) + + BigEndianValue (orig_compare_box_bounds->bottom)) / 2 - font_height / 2 + font_ascent)); DrawString (orig_compare_box_label); - MoveTo (( CW (current_compare_box_bounds->left) + MoveTo (( BigEndianValue (current_compare_box_bounds->left) - StringWidth (current_compare_box_label)), - ( ( CW (current_compare_box_bounds->top) - + CW (current_compare_box_bounds->bottom)) / 2 + ( ( BigEndianValue (current_compare_box_bounds->top) + + BigEndianValue (current_compare_box_bounds->bottom)) / 2 - font_height / 2 + font_ascent)); DrawString (current_compare_box_label); @@ -1061,7 +1062,7 @@ event_loop (void) { char ch; - ch = CL (evt.message) & 0xFF; + ch = BigEndianValue (evt.message) & 0xFF; switch (ch) { case '\r': @@ -1089,7 +1090,7 @@ event_loop (void) default: warning_unexpected ("unknown event.what `%d'", - CW (evt.what)); + BigEndianValue (evt.what)); break; } } @@ -1115,10 +1116,10 @@ color_wheel_init (void) *color_wheel_bounds = *template_color_wheel_bounds; OffsetRect (color_wheel_bounds, - StringWidth (label_0_degs), font_height); - color_wheel_center_y = ( CW (color_wheel_bounds->top) - + CW (color_wheel_bounds->bottom)) / 2; - color_wheel_center_x = ( CW (color_wheel_bounds->left) - + CW (color_wheel_bounds->right)) / 2; + color_wheel_center_y = ( BigEndianValue (color_wheel_bounds->top) + + BigEndianValue (color_wheel_bounds->bottom)) / 2; + color_wheel_center_x = ( BigEndianValue (color_wheel_bounds->left) + + BigEndianValue (color_wheel_bounds->right)) / 2; /* the colorwheel appears to be 192 pixels on a side, but it is really 208 pixels to handle target overlap */ @@ -1130,7 +1131,7 @@ color_wheel_init (void) : (bpp == 4 ? (intptr_t)&color_wheel_bits_4 : (gui_abort (), NULL))); - color_wheel_pixmap.rowBytes = CW ((bpp == 8) + color_wheel_pixmap.rowBytes = BigEndianValue ((bpp == 8) ? 0x80D0 : (bpp == 4 ? 0x8068 @@ -1166,14 +1167,14 @@ color_wheel_target_update (boolean_t short_cut_p) return; /* erase the current target */ - dst_rect.top = CW (current_target_y - 7); - dst_rect.left = CW (current_target_x - 7); - dst_rect.bottom = CW (current_target_y + 9); - dst_rect.right = CW (current_target_x + 9); + dst_rect.top = BigEndianValue (current_target_y - 7); + dst_rect.left = BigEndianValue (current_target_x - 7); + dst_rect.bottom = BigEndianValue (current_target_y + 9); + dst_rect.right = BigEndianValue (current_target_x + 9); src_rect = dst_rect; - OffsetRect (&src_rect, - CW (color_wheel_bounds->left), - - CW (color_wheel_bounds->top)); + OffsetRect (&src_rect, - BigEndianValue (color_wheel_bounds->left), + - BigEndianValue (color_wheel_bounds->top)); CopyBits ((BitMap *) &color_wheel_pixmap, PORT_BITS_FOR_COPY (thePort), &src_rect, &dst_rect, srcCopy, NULL); @@ -1258,11 +1259,11 @@ color_wheel_notice_lightness_change (void) for (i = 0; i < (int) NELEM (color_desc); i ++) { /* one half */ - hsl_color.lightness = CW (lightness); - hsl_color.hue = CW ( color_desc[i].angle + hsl_color.lightness = BigEndianValue (lightness); + hsl_color.hue = BigEndianValue ( color_desc[i].angle * 0xFFFF / 360.0); - hsl_color.saturation = CW ( color_desc[i].dist + hsl_color.saturation = BigEndianValue ( color_desc[i].dist * 0xFFFF); HSL2RGB (&hsl_color, &rgb_color); @@ -1291,10 +1292,10 @@ P4 (PUBLIC pascal trap, BOOLEAN, GetColor, GetFontInfo (&font_info); - font_height = ( CW (font_info.ascent) - + CW (font_info.descent) - + CW (font_info.leading)); - font_ascent = CW (font_info.ascent); + font_height = ( BigEndianValue (font_info.ascent) + + BigEndianValue (font_info.descent) + + BigEndianValue (font_info.leading)); + font_ascent = BigEndianValue (font_info.ascent); space_width = CharWidth (' '); } @@ -1302,15 +1303,15 @@ P4 (PUBLIC pascal trap, BOOLEAN, GetColor, { HSLColor *hsl_color = (HSLColor *)alloca (sizeof *hsl_color); - red = CW (in_color->red); - green = CW (in_color->green); - blue = CW (in_color->blue); + red = BigEndianValue (in_color->red); + green = BigEndianValue (in_color->green); + blue = BigEndianValue (in_color->blue); RGB2HSL (in_color, hsl_color); - hue = CW (hsl_color->hue); - saturation = CW (hsl_color->saturation); - lightness = CW (hsl_color->lightness); + hue = BigEndianValue (hsl_color->hue); + saturation = BigEndianValue (hsl_color->saturation); + lightness = BigEndianValue (hsl_color->lightness); color_wheel_noticed_lightness = -1; @@ -1363,7 +1364,7 @@ P4 (PUBLIC pascal trap, BOOLEAN, GetColor, LOCK_HANDLE_EXCURSION_1 (color_wheel_color_table, { - CTAB_SIZE_X (color_wheel_color_table) = CW (23); + CTAB_SIZE_X (color_wheel_color_table) = BigEndianValue (23); color_wheel_colors = CTAB_TABLE (color_wheel_color_table); color_wheel_notice_lightness_change (); diff --git a/src/qColorutil.cpp b/src/qColorutil.cpp index 6bf83483..2f243230 100644 --- a/src/qColorutil.cpp +++ b/src/qColorutil.cpp @@ -16,6 +16,7 @@ char ROMlib_rcsid_qColorutil[] = #include "rsys/mman.h" using namespace Executor; +using namespace ByteSwap; /* ctab with `zero' as the seed; if StdBits encounters a source pixmap with this as its color table, no depth conversion will be @@ -94,7 +95,7 @@ Executor::validate_fg_bk_ctab (void) if (memcmp (&old_fg, fg, sizeof old_fg) || memcmp (&old_bk, bk, sizeof old_bk)) - CTAB_SEED_X (ROMlib_fg_bk_ctab) = CL (GetCTSeed ()); + CTAB_SEED_X (ROMlib_fg_bk_ctab) = BigEndianValue (GetCTSeed ()); return ROMlib_fg_bk_ctab; } @@ -138,7 +139,7 @@ Executor::validate_relative_bw_ctab (void) if (memcmp (&old_entry0, entry0, sizeof old_entry0) || memcmp (&old_entry1, entry1, sizeof old_entry1)) - CTAB_SEED_X (ROMlib_relative_bw_ctab) = CL (GetCTSeed ()); + CTAB_SEED_X (ROMlib_relative_bw_ctab) = BigEndianValue (GetCTSeed ()); return ROMlib_relative_bw_ctab; } @@ -167,7 +168,7 @@ Executor::ROMlib_color_init (void) /* allocate and initialize ROMlib_bw_ctab */ ROMlib_bw_ctab = (CTabHandle) NewHandle (CTAB_STORAGE_FOR_SIZE (1)); CTAB_SIZE_X (ROMlib_bw_ctab) = CWC (1); - CTAB_SEED_X (ROMlib_bw_ctab) = CL (GetCTSeed ()); + CTAB_SEED_X (ROMlib_bw_ctab) = BigEndianValue (GetCTSeed ()); CTAB_FLAGS_X (ROMlib_bw_ctab) = CWC (0); bw_ctab_table = CTAB_TABLE (ROMlib_bw_ctab); diff --git a/src/qCursor.cpp b/src/qCursor.cpp index 756496f4..ef15a437 100644 --- a/src/qCursor.cpp +++ b/src/qCursor.cpp @@ -31,6 +31,7 @@ char ROMlib_rcsid_qCursor[] = #if !defined (CURSOR_DEBUG) using namespace Executor; +using namespace ByteSwap; #define HOST_SET_CURSOR(d,m,x,y) host_set_cursor (d,m,x,y) @@ -128,7 +129,7 @@ P1(PUBLIC pascal trap, void, SetCursor, Cursor *, cp) if (host_cursor_depth == 1) { HOST_SET_CURSOR ((char *) cp->data, (unsigned short *) cp->mask, - CW (cp->hotSpot.h), CW (cp->hotSpot.v)); + BigEndianValue (cp->hotSpot.h), BigEndianValue (cp->hotSpot.v)); } else { @@ -154,7 +155,7 @@ P1(PUBLIC pascal trap, void, SetCursor, Cursor *, cp) target_pixmap.cmpCount = CWC (1); target_pixmap.pixelType = CWC (0); target_pixmap.pixelSize = target_pixmap.cmpSize - = CW (host_cursor_depth); + = BigEndianValue (host_cursor_depth); /* the target pixmap colortable is not used by `convert_pixmap ()' target_pixmap.pmTable = ...; */ @@ -162,7 +163,7 @@ P1(PUBLIC pascal trap, void, SetCursor, Cursor *, cp) &ROMlib_cursor_rect, NULL); HOST_SET_CURSOR (data_baseaddr, (unsigned short *) cp->mask, - CW (cp->hotSpot.h), CW (cp->hotSpot.v)); + BigEndianValue (cp->hotSpot.h), BigEndianValue (cp->hotSpot.v)); } current_crsr = *cp; @@ -187,14 +188,14 @@ P0(PUBLIC pascal trap, void, InitCursor) P0(PUBLIC pascal trap, void, HideCursor) /* IMI-168 */ { ROMlib_restorecursor(); - CrsrState = CW(CW(CrsrState) - 1); + CrsrState = BigEndianValue(BigEndianValue(CrsrState) - 1); } P0(PUBLIC pascal trap, void, ShowCursor) /* IMI-168 */ { - if ( (CrsrState = CW(CW(CrsrState) + 1)) == 0 ) + if ( (CrsrState = BigEndianValue(BigEndianValue(CrsrState) + 1)) == 0 ) ROMlib_showcursor(); - if (CW(CrsrState) > 0) + if (BigEndianValue(CrsrState) > 0) CrsrState = 0; } @@ -204,7 +205,7 @@ namespace Executor { A1(PRIVATE, void, wewantpointermovements, INTEGER, x) { - CrsrState = CW(CW(CrsrState) + x); + CrsrState = BigEndianValue(BigEndianValue(CrsrState) + x); ROMlib_bewaremovement = TRUE; } @@ -219,8 +220,8 @@ P2(PUBLIC pascal trap, void, ShieldCursor, Rect *, rp, Point, p) /* IMI-474 */ EventRecord evt; GetOSEvent(0, &evt); - evt.where.v = CW(evt.where.v) + p.v; - evt.where.h = CW(evt.where.h) + p.h; + evt.where.v = BigEndianValue(evt.where.v) + p.v; + evt.where.h = BigEndianValue(evt.where.h) + p.h; if (PtInRect(evt.where, rp)) HideCursor(); else @@ -264,10 +265,10 @@ P1 (PUBLIC pascal trap, CCrsrHandle, GetCCursor, INTEGER, crsr_id) BlockMove ((Ptr) &resource->crsr, (Ptr) ccrsr, sizeof (CCrsr)); - /* NOTE: use CL below instead of MR because they're overloading + /* NOTE: use BigEndianValue below instead of MR because they're overloading crsrMap to have an offset rather than a handle */ - cursor_pixel_map_offset = CL ((uint32) ccrsr->crsrMap); + cursor_pixel_map_offset = BigEndianValue ((uint32) ccrsr->crsrMap); cursor_pixel_map_resource = (PixMapPtr) ((char *) resource + cursor_pixel_map_offset); @@ -277,7 +278,7 @@ P1 (PUBLIC pascal trap, CCrsrHandle, GetCCursor, INTEGER, crsr_id) (Ptr) STARH (cursor_pixel_map), sizeof *cursor_pixel_map_resource); - ccrsr_data_offset = CL ((long) ccrsr->crsrData); + ccrsr_data_offset = BigEndianValue ((long) ccrsr->crsrData); ccrsr_ctab_offset = (int) PIXMAP_TABLE_AS_OFFSET (MR (ccrsr->crsrMap)); ccrsr_data_size = ccrsr_ctab_offset - ccrsr_data_offset; @@ -288,7 +289,7 @@ P1 (PUBLIC pascal trap, CCrsrHandle, GetCCursor, INTEGER, crsr_id) ccrsr_data_size); tmp_ctab = (CTabPtr) ((char *) resource + ccrsr_ctab_offset); - ccrsr_ctab_size = CTAB_STORAGE_FOR_SIZE (CW (tmp_ctab->ctSize)); + ccrsr_ctab_size = CTAB_STORAGE_FOR_SIZE (BigEndianValue (tmp_ctab->ctSize)); h = RM (NewHandle (ccrsr_ctab_size)); PIXMAP_TABLE_X (MR (ccrsr->crsrMap)) = (CTabHandle) h; BlockMove ((Ptr) tmp_ctab, @@ -390,8 +391,8 @@ P1 (PUBLIC pascal trap, void, SetCCursor, /* only fields used by `convert_pixmap ()', baseAddr is filled in below */ memset (&ccrsr_xmap, 0, sizeof ccrsr_xmap); - ccrsr_xmap.rowBytes = CW (2 * host_cursor_depth); - ccrsr_xmap.pixelSize = CW (host_cursor_depth); + ccrsr_xmap.rowBytes = BigEndianValue (2 * host_cursor_depth); + ccrsr_xmap.pixelSize = BigEndianValue (host_cursor_depth); src = *STARH (CCRSR_MAP (ccrsr)); src.baseAddr = CCRSR_DATA (ccrsr)->p; @@ -403,7 +404,7 @@ P1 (PUBLIC pascal trap, void, SetCCursor, &ROMlib_cursor_rect, NULL); }); }); - CCRSR_XVALID_X (ccrsr) = CW (host_cursor_depth); + CCRSR_XVALID_X (ccrsr) = BigEndianValue (host_cursor_depth); CCRSR_ID_X (ccrsr) = CTAB_SEED_X (PIXMAP_TABLE (gd_pmap)); } @@ -413,14 +414,14 @@ P1 (PUBLIC pascal trap, void, SetCCursor, { HOST_SET_CURSOR ((char *) STARH (ccrsr_xdata), (unsigned short *) CCRSR_MASK (ccrsr), - CW (hot_spot->h), CW (hot_spot->v)); + BigEndianValue (hot_spot->h), BigEndianValue (hot_spot->v)); }); } else { HOST_SET_CURSOR ((char *) CCRSR_1DATA (ccrsr), (unsigned short *) CCRSR_MASK (ccrsr), - CW (hot_spot->h), CW (hot_spot->v)); + BigEndianValue (hot_spot->h), BigEndianValue (hot_spot->v)); } }); diff --git a/src/qGDevice.cpp b/src/qGDevice.cpp index e647fdc2..07cf4d01 100644 --- a/src/qGDevice.cpp +++ b/src/qGDevice.cpp @@ -26,6 +26,7 @@ char ROMlib_rcsid_gdev[] = #include "rsys/executor.h" using namespace Executor; +using namespace ByteSwap; /* * determined experimentally -- this fix is needed for Energy Scheming because @@ -94,13 +95,13 @@ Executor::gd_allocate_main_device (void) vdriver_bpp); gd_pixmap = GD_PMAP (graphics_device); - PIXMAP_SET_ROWBYTES_X (gd_pixmap, CW (vdriver_row_bytes)); + PIXMAP_SET_ROWBYTES_X (gd_pixmap, BigEndianValue (vdriver_row_bytes)); PIXMAP_BASEADDR_X (gd_pixmap) = (Ptr) RM (vdriver_fbuf); gd_rect = &GD_RECT (graphics_device); gd_rect->top = gd_rect->left = CWC (0); - gd_rect->bottom = CW (vdriver_height); - gd_rect->right = CW (vdriver_width); + gd_rect->bottom = BigEndianValue (vdriver_height); + gd_rect->right = BigEndianValue (vdriver_width); PIXMAP_BOUNDS (gd_pixmap) = *gd_rect; /* add ourselves to the device list */ @@ -155,8 +156,8 @@ P2 (PUBLIC pascal trap, GDHandle, NewGDevice, CTAB_FLAGS_X (PIXMAP_TABLE (GD_PMAP (this2))) |= CTAB_GDEVICE_BIT_X; GD_REF_CON_X (this2) = CWC (0); /* ??? */ - GD_REF_NUM_X (this2) = CW (ref_num); /* ??? */ - GD_MODE_X (this2) = CL (mode); /* ??? */ + GD_REF_NUM_X (this2) = BigEndianValue (ref_num); /* ??? */ + GD_MODE_X (this2) = BigEndianValue (mode); /* ??? */ GD_NEXT_GD_X (this2) = (GDHandle)RM (NULL); @@ -218,11 +219,11 @@ Executor::gd_set_bpp (GDHandle gd, boolean_t color_p, boolean_t fixed_p, int bpp gd_color_table = PIXMAP_TABLE (gd_pixmap); SetHandleSize ((Handle) gd_color_table, CTAB_STORAGE_FOR_SIZE ((1 << bpp) - 1)); - CTAB_SIZE_X (gd_color_table) = CW ((1 << bpp) - 1); + CTAB_SIZE_X (gd_color_table) = BigEndianValue ((1 << bpp) - 1); vdriver_get_colors (0, 1 << bpp, CTAB_TABLE (gd_color_table)); - CTAB_SEED_X (gd_color_table) = CL (GetCTSeed ()); + CTAB_SEED_X (gd_color_table) = BigEndianValue (GetCTSeed ()); } } else @@ -266,9 +267,9 @@ P3 (PUBLIC pascal trap, void, SetDeviceAttribute, BOOLEAN, value) { if (value) - GD_FLAGS_X (gdh) |= CW (1 << attribute); + GD_FLAGS_X (gdh) |= BigEndianValue (1 << attribute); else - GD_FLAGS_X (gdh) &= CW (~(1 << attribute)); + GD_FLAGS_X (gdh) &= BigEndianValue (~(1 << attribute)); } P1 (PUBLIC pascal trap, void, SetGDevice, @@ -371,8 +372,8 @@ P4 (PUBLIC pascal trap, void, DeviceLoop, gd_rect = GD_RECT (gd); port_bounds = &(PORT_BOUNDS (thePort)); OffsetRect (&gd_rect, - CW (port_bounds->left), - CW (port_bounds->top)); + BigEndianValue (port_bounds->left), + BigEndianValue (port_bounds->top)); /* Intersect GDevice rect with the specified region. */ RectRgn (gd_rect_rgn, &gd_rect); @@ -490,8 +491,8 @@ P4 (PUBLIC pascal trap, OSErr, SetDepth, gui_fatal ("vdriver not initialized, unable to change bpp"); gd_set_bpp (gdh, !vdriver_grayscale_p, vdriver_fixed_clut_p, bpp); - PIXMAP_SET_ROWBYTES_X (gd_pixmap, CW (vdriver_row_bytes)); - screenBitsX.rowBytes = CW (vdriver_row_bytes); + PIXMAP_SET_ROWBYTES_X (gd_pixmap, BigEndianValue (vdriver_row_bytes)); + screenBitsX.rowBytes = BigEndianValue (vdriver_row_bytes); cursor_reset_current_cursor (); diff --git a/src/qGWorld.cpp b/src/qGWorld.cpp index f98b87a1..a3f8f803 100644 --- a/src/qGWorld.cpp +++ b/src/qGWorld.cpp @@ -20,6 +20,7 @@ char ROMlib_rcsid_qGWorld[] = #include "rsys/qcolor.h" using namespace Executor; +using namespace ByteSwap; gw_info_t *gw_info_head, *gw_info_free; @@ -156,8 +157,8 @@ P6 (PUBLIC pascal trap, QDErr, NewGWorld, { Rect *temp_bounds = (Rect*)alloca (sizeof *temp_bounds); - temp_bounds->bottom = CW (RECT_HEIGHT (bounds)); - temp_bounds->right = CW (RECT_WIDTH (bounds)); + temp_bounds->bottom = BigEndianValue (RECT_HEIGHT (bounds)); + temp_bounds->right = BigEndianValue (RECT_WIDTH (bounds)); temp_bounds->top = temp_bounds->left = CWC (0); @@ -190,7 +191,7 @@ P6 (PUBLIC pascal trap, QDErr, NewGWorld, gd_pixmap = GD_PMAP (gw_gd); row_bytes = ((RECT_WIDTH (bounds) * depth + 31) / 32) * 4; - PIXMAP_SET_ROWBYTES_X (gd_pixmap, CW (row_bytes)); + PIXMAP_SET_ROWBYTES_X (gd_pixmap, BigEndianValue (row_bytes)); gd_pixmap_baseaddr = NewHandle (row_bytes * RECT_HEIGHT (bounds)); if (MemError () != noErr) @@ -219,9 +220,9 @@ P6 (PUBLIC pascal trap, QDErr, NewGWorld, { PIXMAP_PIXEL_TYPE_X (gd_pixmap) = CWC (0); PIXMAP_CMP_COUNT_X (gd_pixmap) = CWC (1); - PIXMAP_CMP_SIZE_X (gd_pixmap) = CW (depth); + PIXMAP_CMP_SIZE_X (gd_pixmap) = BigEndianValue (depth); } - PIXMAP_PIXEL_SIZE_X (gd_pixmap) = CW (depth); + PIXMAP_PIXEL_SIZE_X (gd_pixmap) = BigEndianValue (depth); if (ctab == NULL && depth <= 8) { int ctab_max_elt = (1 << depth) - 1; @@ -230,8 +231,8 @@ P6 (PUBLIC pascal trap, QDErr, NewGWorld, SetHandleSize ((Handle) ctab, CTAB_STORAGE_FOR_SIZE (ctab_max_elt)); - CTAB_SIZE_X (ctab) = CW (ctab_max_elt); - CTAB_SEED_X (ctab) = CL ((int32) depth); + CTAB_SIZE_X (ctab) = BigEndianValue (ctab_max_elt); + CTAB_SEED_X (ctab) = BigEndianValue ((int32) depth); CTAB_FLAGS_X (ctab) = CTAB_GDEVICE_BIT_X; memcpy (CTAB_TABLE (ctab), default_ctab_colors[ROMlib_log2[depth]], @@ -275,7 +276,7 @@ P6 (PUBLIC pascal trap, QDErr, NewGWorld, which may not match `depth' */ row_bytes = ((RECT_WIDTH (bounds) * depth + 31) / 32) * 4; - PIXMAP_SET_ROWBYTES_X (gw_pixmap, CW (row_bytes)); + PIXMAP_SET_ROWBYTES_X (gw_pixmap, BigEndianValue (row_bytes)); gw_pixmap_baseaddr = NewHandle (row_bytes * RECT_HEIGHT (bounds)); if (MemError () != noErr) @@ -413,7 +414,7 @@ P6 (PUBLIC pascal trap, GWorldFlags, UpdateGWorld, *temp_bounds = *bounds; OffsetRect (temp_bounds, - - CW (temp_bounds->left), - CW (temp_bounds->top)); + - BigEndianValue (temp_bounds->left), - BigEndianValue (temp_bounds->top)); bounds = temp_bounds; } } @@ -474,17 +475,17 @@ P6 (PUBLIC pascal trap, GWorldFlags, UpdateGWorld, dst_rect = *gw_bounds_ret; OffsetRect (&src_rect, - - CW (src_rect.left), - CW (src_rect.top)); + - BigEndianValue (src_rect.left), - BigEndianValue (src_rect.top)); OffsetRect (&dst_rect, - - CW (dst_rect.left), - CW (dst_rect.top)); + - BigEndianValue (dst_rect.left), - BigEndianValue (dst_rect.top)); SectRect (&src_rect, &dst_rect, &temp_rect); src_rect = dst_rect = temp_rect; OffsetRect (&src_rect, - CW (gw_bounds->left), CW (gw_bounds->top)); + BigEndianValue (gw_bounds->left), BigEndianValue (gw_bounds->top)); OffsetRect (&dst_rect, - CW (gw_bounds_ret->left), CW (gw_bounds_ret->top)); + BigEndianValue (gw_bounds_ret->left), BigEndianValue (gw_bounds_ret->top)); } CopyBits (PORT_BITS_FOR_COPY (gw), @@ -722,7 +723,7 @@ P4 (PUBLIC pascal trap, QDErr, NewScreenBuffer, rowbytes = ((width * bpp + 31) / 32) * 4; - PIXMAP_SET_ROWBYTES_X (pixels, CW (rowbytes)); + PIXMAP_SET_ROWBYTES_X (pixels, BigEndianValue (rowbytes)); /* not clear if we should be allocating a ptr or a handle for the pixmap baseaddr */ diff --git a/src/qGrafport.cpp b/src/qGrafport.cpp index 7622e359..edea7a0d 100644 --- a/src/qGrafport.cpp +++ b/src/qGrafport.cpp @@ -22,6 +22,7 @@ char ROMlib_rcsid_qGrafport[] = #include "rsys/picture.h" using namespace Executor; +using namespace ByteSwap; P1(PUBLIC pascal trap, void, InitGraf, Ptr, gp) { @@ -35,7 +36,7 @@ P1(PUBLIC pascal trap, void, InitGraf, Ptr, gp) /* screenBitsX flag bits must not be set */ screenBitsX.baseAddr = PIXMAP_BASEADDR_X (main_gd_pixmap); - screenBitsX.rowBytes = CW (PIXMAP_ROWBYTES (main_gd_pixmap) / + screenBitsX.rowBytes = BigEndianValue (PIXMAP_ROWBYTES (main_gd_pixmap) / PIXMAP_PIXEL_SIZE (main_gd_pixmap)); screenBitsX.bounds = PIXMAP_BOUNDS (main_gd_pixmap); @@ -67,7 +68,7 @@ P1(PUBLIC pascal trap, void, InitGraf, Ptr, gp) arrowX.hotSpot.h = arrowX.hotSpot.v = CWC(1); CrsrState = 0; - RndSeed = CL (TickCount ()); + RndSeed = BigEndianValue (TickCount ()); ScrVRes = ScrHRes = CWC(72); ScreenRow = screenBitsX.rowBytes; randSeedX = CLC (1); @@ -186,8 +187,8 @@ P1(PUBLIC pascal trap, void, SetPortBits, BitMap *, bm) P2(PUBLIC pascal trap, void, PortSize, INTEGER, w, INTEGER, h) { - PORT_RECT (thePort).bottom = CW (CW (PORT_RECT (thePort).top) + h); - PORT_RECT (thePort).right = CW (CW (PORT_RECT (thePort).left) + w); + PORT_RECT (thePort).bottom = BigEndianValue (BigEndianValue (PORT_RECT (thePort).top) + h); + PORT_RECT (thePort).right = BigEndianValue (BigEndianValue (PORT_RECT (thePort).left) + w); } P2 (PUBLIC pascal trap, void, MovePortTo, INTEGER, lg, INTEGER, tg) @@ -199,8 +200,8 @@ P2 (PUBLIC pascal trap, void, MovePortTo, INTEGER, lg, INTEGER, tg) current_port = thePort; port_bounds = &PORT_BOUNDS (current_port); port_rect = &PORT_RECT (current_port); - lg = CW (port_rect->left) - lg; - tg = CW (port_rect->top) - tg; + lg = BigEndianValue (port_rect->left) - lg; + tg = BigEndianValue (port_rect->top) - tg; w = RECT_WIDTH (port_bounds); h = RECT_HEIGHT (port_bounds); SetRect (port_bounds, lg, tg, lg + w, tg + h); @@ -219,9 +220,9 @@ P2 (PUBLIC pascal trap, void, SetOrigin, INTEGER, h, INTEGER, v) PICOP (OP_Origin); - swappeddh = CW(dh); + swappeddh = BigEndianValue(dh); PICWRITE (&swappeddh, sizeof swappeddh); - swappeddv = CW(dv); + swappeddv = BigEndianValue(dv); PICWRITE (&swappeddv, sizeof swappeddv); }); OffsetRect (&PORT_BOUNDS (thePort), dh, dv); diff --git a/src/qIMIV.cpp b/src/qIMIV.cpp index d6358958..e3d2bb9f 100644 --- a/src/qIMIV.cpp +++ b/src/qIMIV.cpp @@ -31,6 +31,7 @@ namespace Executor { } using namespace Executor; +using namespace ByteSwap; #define DOLEFT 1 #define DORIGHT 2 @@ -223,14 +224,14 @@ A9 (PRIVATE, void, xSeedFill, unsigned char *, srcp, unsigned char *, dstp, width, Negate); if (dstp >= (unsigned char *) MR(screenBitsX.baseAddr)) { byteoff = dstp - (unsigned char *) MR(screenBitsX.baseAddr); - voff = byteoff / CW(screenBitsX.rowBytes); - if (voff < CW(screenBitsX.bounds.bottom) - CW(screenBitsX.bounds.top)) + voff = byteoff / BigEndianValue(screenBitsX.rowBytes); + if (voff < BigEndianValue(screenBitsX.bounds.bottom) - BigEndianValue(screenBitsX.bounds.top)) { - dirty_rect_accrue (CW (screenBitsX.bounds.top) + voff, - (CW (screenBitsX.bounds.left) - + (byteoff % CW(screenBitsX.rowBytes) * 8L)), - CW (temprect.top) + height, - CW (temprect.left) + (LONGINT) width * 16); + dirty_rect_accrue (BigEndianValue (screenBitsX.bounds.top) + voff, + (BigEndianValue (screenBitsX.bounds.left) + + (byteoff % BigEndianValue(screenBitsX.rowBytes) * 8L)), + BigEndianValue (temprect.top) + height, + BigEndianValue (temprect.left) + (LONGINT) width * 16); } } TRAPEND(); @@ -271,10 +272,10 @@ create_scratch_bitmap_if_necessary (uint8 **_fbuf, offset = fbuf - screen_fbuf; - src_rect->top = CW (offset / screen_row_bytes); - src_rect->bottom = CW (offset / screen_row_bytes + height); - src_rect->left = CW ((offset % screen_row_bytes) * 8); - src_rect->right = CW ((offset % screen_row_bytes) * 8 + src_rect->top = BigEndianValue (offset / screen_row_bytes); + src_rect->bottom = BigEndianValue (offset / screen_row_bytes + height); + src_rect->left = BigEndianValue ((offset % screen_row_bytes) * 8); + src_rect->right = BigEndianValue ((offset % screen_row_bytes) * 8 + word_width * 16); *src_pm = *STARH (gd_pmap); @@ -388,16 +389,16 @@ copy_mask_1 (BitMap *src_bm, BitMap *mask_bm, BitMap *dst_bm, dst_top = dst_bottom = *dst_rect; src_bottom.top = src_top.bottom - = CW (CW (src_top.bottom) - src_half); + = BigEndianValue (BigEndianValue (src_top.bottom) - src_half); mask_bottom.top = mask_top.bottom - = CW (CW (mask_top.bottom) - mask_half); + = BigEndianValue (BigEndianValue (mask_top.bottom) - mask_half); dst_bottom.top = dst_top.bottom - = CW (CW (dst_top.bottom) - dst_half); + = BigEndianValue (BigEndianValue (dst_top.bottom) - dst_half); mask_top_bm = *mask_bm; mask_bottom_bm = *mask_bm; mask_bottom_bm.bounds.top = mask_top_bm.bounds.bottom - = CW (CW (mask_top_bm.bounds.bottom) - mask_half); + = BigEndianValue (BigEndianValue (mask_top_bm.bounds.bottom) - mask_half); copy_mask_1 (src_bm, &mask_top_bm, dst_bm, &src_top, &mask_top, &dst_top); @@ -426,7 +427,7 @@ P6 (PUBLIC pascal trap, void, CopyMask, /* IMIV-24 */ TEMP_ALLOC_ALLOCATE (mask_bits, temp_mask_bits, row_bytes * RECT_HEIGHT (mask_rect)); mask_bm.baseAddr = (Ptr)RM (mask_bits); - mask_bm.rowBytes = CW (row_bytes); + mask_bm.rowBytes = BigEndianValue (row_bytes); mask_bm.bounds = *mask_rect; CopyBits (mask_bogo_map, &mask_bm, diff --git a/src/qIMV.cpp b/src/qIMV.cpp index 98e355a0..20844735 100644 --- a/src/qIMV.cpp +++ b/src/qIMV.cpp @@ -18,6 +18,7 @@ char ROMlib_rcsid_qIMV[] = #include "rsys/tempalloc.h" using namespace Executor; +using namespace ByteSwap; /* these stubs are here to make my Pic V2 code work */ @@ -86,10 +87,10 @@ P3 (PUBLIC pascal trap, void, GetCPixel, INTEGER, h, INTEGER, v, temp_pm.pmTable = RM (ctab); pixmap_set_pixel_fields (&temp_pm, bpp); - src_rect.top = CW (v); - src_rect.bottom = CW (v + 1); - src_rect.left = CW (h); - src_rect.right = CW (h + 1); + src_rect.top = BigEndianValue (v); + src_rect.bottom = BigEndianValue (v + 1); + src_rect.left = BigEndianValue (h); + src_rect.right = BigEndianValue (h + 1); dst_rect = temp_pm.bounds; @@ -116,7 +117,7 @@ P3 (PUBLIC pascal trap, void, GetCPixel, INTEGER, h, INTEGER, v, /* non-device color tables aren't guaranteed to be sorted, so we need to hunt for an entry with the specified value */ - swapped_pixval = CW (pixval); + swapped_pixval = BigEndianValue (pixval); for (i = CTAB_SIZE (ctab); i >= 0; i--) if (cspec[i].value == swapped_pixval) break; @@ -142,10 +143,10 @@ P3 (PUBLIC pascal trap, void, SetCPixel, INTEGER, h, INTEGER, v, RGBColor save_fg_rgb; int32 save_fg; - temp_rect.top = CW (v); - temp_rect.bottom = CW (v + 1); - temp_rect.left = CW (h); - temp_rect.right = CW (h + 1); + temp_rect.top = BigEndianValue (v); + temp_rect.bottom = BigEndianValue (v + 1); + temp_rect.left = BigEndianValue (h); + temp_rect.right = BigEndianValue (h + 1); port = thePort; cgrafport_p = CGrafPort_p (port); @@ -225,7 +226,7 @@ P8 (PUBLIC pascal trap, void, SeedCFill, BitMap *, srcbp, BitMap *, dstbp, } else { - mr.matchData = CL (matchdata); + mr.matchData = BigEndianValue (matchdata); } GetCPixel (seedh, seedv, &pixel); @@ -248,11 +249,11 @@ P8 (PUBLIC pascal trap, void, SeedCFill, BitMap *, srcbp, BitMap *, dstbp, height = RECT_HEIGHT (srcrp); temp_rect.top = temp_rect.left = CWC (0); - temp_rect.right = CW (width); - temp_rect.bottom = CW (height); + temp_rect.right = BigEndianValue (width); + temp_rect.bottom = BigEndianValue (height); row_words = (width + 15) / 16; - temp_bitmap1.rowBytes = CW (row_words * 2); + temp_bitmap1.rowBytes = BigEndianValue (row_words * 2); TEMP_ALLOC_ALLOCATE (t, temp_bitmap1_bits, row_words * 2 * height); temp_bitmap1.baseAddr = (Ptr)RM (t); memset (MR (temp_bitmap1.baseAddr), '\377', row_words * 2 * height); @@ -308,7 +309,7 @@ P7 (PUBLIC pascal trap, void, CalcCMask, BitMap *, srcbp, BitMap *, dstbp, } else { - mr.matchData = CL (matchdata); + mr.matchData = BigEndianValue (matchdata); } mr.red = seedrgbp->red; @@ -329,8 +330,8 @@ P7 (PUBLIC pascal trap, void, CalcCMask, BitMap *, srcbp, BitMap *, dstbp, height = RECT_HEIGHT (srcrp); temp_rect.top = temp_rect.left = CWC (0); - temp_rect.right = CW (width); - temp_rect.bottom = CW (height); + temp_rect.right = BigEndianValue (width); + temp_rect.bottom = BigEndianValue (height); row_words = (width + 15) / 16; temp_bitmap1.rowBytes = CW (row_words * 2); diff --git a/src/qIMVI.cpp b/src/qIMVI.cpp index eaa71be5..49f0aec2 100644 --- a/src/qIMVI.cpp +++ b/src/qIMVI.cpp @@ -21,6 +21,7 @@ char ROMlib_rcsid_qIMVI[] = #include "sspairtable.ctable" using namespace Executor; +using namespace ByteSwap; /* * Basically a region is just a bunch of stop start pairs where the pairs @@ -74,14 +75,14 @@ P2 (PUBLIC pascal trap, OSErr, BitMapToRegion, RgnHandle, rh, return rgnTooBigErr; \ } \ else \ - *outp++ = CW(v); \ + *outp++ = BigEndianValue(v); \ } while (0) - top = CW(bmp->bounds.top); - left = CW(bmp->bounds.left); - bottom = CW(bmp->bounds.bottom); - right = CW(bmp->bounds.right); - rowbytes = CW(bmp->rowBytes) & ROWMASK; + top = BigEndianValue(bmp->bounds.top); + left = BigEndianValue(bmp->bounds.left); + bottom = BigEndianValue(bmp->bounds.bottom); + right = BigEndianValue(bmp->bounds.right); + rowbytes = BigEndianValue(bmp->rowBytes) & ROWMASK; linelen = (right - left + 7) / 8; if (linelen <= 0) /*-->*/ goto it_is_empty; @@ -150,7 +151,7 @@ P2 (PUBLIC pascal trap, OSErr, BitMapToRegion, RgnHandle, rh, HxX(rh, rgnBBox) = bmp->bounds; /* #warning we are not setting the bounding box properly */ #if 1 - HxX(rh, rgnSize) = CW(rgnsize); + HxX(rh, rgnSize) = BigEndianValue(rgnsize); #else RGN_SET_SMALL (rh); #endif diff --git a/src/qIMVxfer.cpp b/src/qIMVxfer.cpp index f91da2cc..59a95eca 100644 --- a/src/qIMVxfer.cpp +++ b/src/qIMVxfer.cpp @@ -14,6 +14,7 @@ char ROMlib_rcsid_qIMVxfer[] = #include "rsys/cquick.h" using namespace Executor; +using namespace ByteSwap; /* Helper function: creates a new, sorted table so the value is the * same as the index (although we don't bother filling in most of the @@ -25,8 +26,8 @@ sort_table (CTabPtr old, CTabPtr new1, unsigned max_color) int i; memset (&new1->ctTable, 0, (max_color + 1) * sizeof (ColorSpec)); - for (i = CW (old->ctSize); i >= 0; i--) - new1->ctTable[CW (old->ctTable[i].value) & max_color].rgb = + for (i = BigEndianValue (old->ctSize); i >= 0; i--) + new1->ctTable[BigEndianValue (old->ctTable[i].value) & max_color].rgb = old->ctTable[i].rgb; return new1; @@ -115,7 +116,7 @@ Executor::convert_transparent (const PixMap *src1, const PixMap *src2, boolean_t copy1_p, copy2_p; write_back_data_t write_back1, write_back2; - bits_per_pixel = CW (src1->pixelSize); + bits_per_pixel = BigEndianValue (src1->pixelSize); rgb_spec = pixmap_rgb_spec (src1); /* For bits_per_pixel == 1, you are just supposed to use the original @@ -155,7 +156,7 @@ Executor::convert_transparent (const PixMap *src1, const PixMap *src2, src1_rowbytes = BITMAP_ROWBYTES (src1); src2_rowbytes = BITMAP_ROWBYTES (src2); dst_rowbytes = (width * bits_per_pixel + 31) / 32 * 4; - dst->rowBytes = CW (dst_rowbytes); + dst->rowBytes = BigEndianValue (dst_rowbytes); /* We want to run x from 0 to width; adding these offsets gives us * the real x for the source bitmaps. @@ -163,8 +164,8 @@ Executor::convert_transparent (const PixMap *src1, const PixMap *src2, if (tile_src1_p) src1_deltax = pat_x_offset; else - src1_deltax = CW (r1->left) - CW (src1->bounds.left); - src2_deltax = CW (r2->left) - CW (src2->bounds.left); + src1_deltax = BigEndianValue (r1->left) - BigEndianValue (src1->bounds.left); + src2_deltax = BigEndianValue (r2->left) - BigEndianValue (src2->bounds.left); /* Compute a pointer to the base of the first row of each bitmap. */ if (tile_src1_p) @@ -177,12 +178,12 @@ Executor::convert_transparent (const PixMap *src1, const PixMap *src2, { src1_row_base = (unsigned char *) (MR (src1->baseAddr) - + ((CW (r1->top) - CW (src1->bounds.top)) * src1_rowbytes)); + + ((BigEndianValue (r1->top) - BigEndianValue (src1->bounds.top)) * src1_rowbytes)); } src2_row_base = (unsigned char *) (MR (src2->baseAddr) - + (CW (r2->top) - CW (src2->bounds.top)) * src2_rowbytes); + + (BigEndianValue (r2->top) - BigEndianValue (src2->bounds.top)) * src2_rowbytes); dst_row_base = (unsigned char *) MR (dst->baseAddr); #define RGB_TO_INDIRECT_PIXEL(rgb, pixel) \ @@ -198,10 +199,10 @@ Executor::convert_transparent (const PixMap *src1, const PixMap *src2, switch (bpp) \ { \ case 16: \ - (pixel) = CW (swapped_pixel); \ + (pixel) = BigEndianValue (swapped_pixel); \ break; \ case 32: \ - (pixel) = CL (swapped_pixel); \ + (pixel) = BigEndianValue (swapped_pixel); \ break; \ default: \ gui_fatal ("unknown bpp"); \ @@ -389,7 +390,7 @@ Executor::convert_pixmap_with_IMV_mode (const PixMap *src1, const PixMap *src2, boolean_t copy1_p, copy2_p; write_back_data_t write_back1, write_back2; - bits_per_pixel = CW (src1->pixelSize); + bits_per_pixel = BigEndianValue (src1->pixelSize); rgb_spec = pixmap_rgb_spec (src1); /* For bits_per_pixel == 1, you are just supposed to use the original @@ -481,7 +482,7 @@ Executor::convert_pixmap_with_IMV_mode (const PixMap *src1, const PixMap *src2, src1_rowbytes = BITMAP_ROWBYTES (src1); src2_rowbytes = BITMAP_ROWBYTES (src2); dst_rowbytes = (width * bits_per_pixel + 31) / 32 * 4; - dst->rowBytes = CW (dst_rowbytes); + dst->rowBytes = BigEndianValue (dst_rowbytes); /* We want to run x from 0 to width; adding these offsets gives us * the real x for the source bitmaps. @@ -489,8 +490,8 @@ Executor::convert_pixmap_with_IMV_mode (const PixMap *src1, const PixMap *src2, if (tile_src1_p) src1_deltax = pat_x_offset; else - src1_deltax = CW (r1->left) - CW (src1->bounds.left); - src2_deltax = CW (r2->left) - CW (src2->bounds.left); + src1_deltax = BigEndianValue (r1->left) - BigEndianValue (src1->bounds.left); + src2_deltax = BigEndianValue (r2->left) - BigEndianValue (src2->bounds.left); /* Compute a pointer to the base of the first row of each bitmap. */ if (tile_src1_p) @@ -501,17 +502,17 @@ Executor::convert_pixmap_with_IMV_mode (const PixMap *src1, const PixMap *src2, else { src1_row_base = (unsigned char *) (MR (src1->baseAddr) - + ((CW (r1->top) - CW (src1->bounds.top)) + + ((BigEndianValue (r1->top) - BigEndianValue (src1->bounds.top)) * src1_rowbytes)); } src2_row_base = (unsigned char *) (MR (src2->baseAddr) - + (CW (r2->top) - CW (src2->bounds.top)) * src2_rowbytes); + + (BigEndianValue (r2->top) - BigEndianValue (src2->bounds.top)) * src2_rowbytes); dst_row_base = (unsigned char *) MR (dst->baseAddr); /* Fetch the "op color" fields, in case they are needed. */ - op_red = CW (op_color->red); - op_green = CW (op_color->green); - op_blue = CW (op_color->blue); + op_red = BigEndianValue (op_color->red); + op_green = BigEndianValue (op_color->green); + op_blue = BigEndianValue (op_color->blue); #define CONVERT_BITS(read1, read2, write, next1, transform, bpp) \ { \ @@ -554,9 +555,9 @@ Executor::convert_pixmap_with_IMV_mode (const PixMap *src1, const PixMap *src2, ({ \ const RGBColor *color; \ color = &ctab->ctTable[pixel].rgb; \ - (r) = CW (color->red); \ - (g) = CW (color->green); \ - (b) = CW (color->blue); \ + (r) = BigEndianValue (color->red); \ + (g) = BigEndianValue (color->green); \ + (b) = BigEndianValue (color->blue); \ })) #define DIRECT_PIXEL_TO_RGB(bpp, pixel, red_out, green_out, blue_out, \ dummy_ctab) \ @@ -565,9 +566,9 @@ Executor::convert_pixmap_with_IMV_mode (const PixMap *src1, const PixMap *src2, RGBColor color; \ \ (*rgb_spec->pixel_to_rgbcolor) (rgb_spec, (pixel), &color); \ - (red_out) = CW (color.red); \ - (green_out) = CW (color.green); \ - (blue_out) = CW (color.blue); \ + (red_out) = BigEndianValue (color.red); \ + (green_out) = BigEndianValue (color.green); \ + (blue_out) = BigEndianValue (color.blue); \ })) #define PIXEL_TO_RGB(bpp, pixel, red, green, blue, ctab) \ ((void) \ diff --git a/src/qMisc.cpp b/src/qMisc.cpp index 2f4d8792..5e3696f5 100644 --- a/src/qMisc.cpp +++ b/src/qMisc.cpp @@ -22,6 +22,7 @@ char ROMlib_rcsid_qMisc[] = #include "rsys/region.h" using namespace Executor; +using namespace ByteSwap; namespace Executor { static BOOLEAN EquivRect(Rect*, Rect*); @@ -41,8 +42,8 @@ P0(PUBLIC pascal trap, INTEGER, Random) RndSeed = Cx(TickCount()); /* what better? */ if (RANDSEED >= 0x80000000) - randSeedX = CL((RANDSEED & 0x7FFFFFFF) + 1); - randSeedX = CL((RANDSEED * 16807 + + randSeedX = BigEndianValue((RANDSEED & 0x7FFFFFFF) + 1); + randSeedX = BigEndianValue((RANDSEED * 16807 + ( (((RANDSEED >> 14) * 16807) + (((RANDSEED & ((1<<14)-1)) * 16807) >> 14)) @@ -70,10 +71,10 @@ P2 (PUBLIC pascal trap, BOOLEAN, GetPixel, INTEGER, h, INTEGER, v) temp_bm.bounds.right = CWC (1); temp_bm.rowBytes = CWC (4); - src_rect.top = CW (v); - src_rect.bottom = CW (v + 1); - src_rect.left = CW (h); - src_rect.right = CW (h + 1); + src_rect.top = BigEndianValue (v); + src_rect.bottom = BigEndianValue (v + 1); + src_rect.left = BigEndianValue (h); + src_rect.right = BigEndianValue (h + 1); dst_rect = temp_bm.bounds; @@ -120,12 +121,12 @@ P3(PUBLIC pascal trap, void, ScalePt, Point *, pt, Rect *, srcr, Rect *, dstr) dstdh = Cx(dstr->right) - Cx(dstr->left); dstdv = Cx(dstr->bottom) - Cx(dstr->top); - pt->h = CW(((((LONGINT) CW(pt->h) * dstdh) << 1) / srcdh + 1) >> 1); - pt->v = CW(((((LONGINT) CW(pt->v) * dstdv) << 1) / srcdv + 1) >> 1); + pt->h = BigEndianValue(((((LONGINT) BigEndianValue(pt->h) * dstdh) << 1) / srcdh + 1) >> 1); + pt->v = BigEndianValue(((((LONGINT) BigEndianValue(pt->v) * dstdv) << 1) / srcdv + 1) >> 1); - if (CW(pt->v) < 1) + if (BigEndianValue(pt->v) < 1) pt->v = CWC(1); - if (CW(pt->h) < 1) + if (BigEndianValue(pt->h) < 1) pt->h = CWC(1); } } @@ -139,12 +140,12 @@ P3(PUBLIC pascal trap, void, MapPt, Point *, pt, Rect *, srcr, Rect *, dstr) dstdh = Cx(dstr->right) - Cx(dstr->left); dstdv = Cx(dstr->bottom) - Cx(dstr->top); - pt->h = CW(CW(pt->h) - (Cx(srcr->left))); - pt->v = CW(CW(pt->v) - (Cx(srcr->top))); - pt->h = CW((LONGINT) CW(pt->h) * dstdh / srcdh); - pt->v = CW((LONGINT) CW(pt->v) * dstdv / srcdv); - pt->h = CW(CW(pt->h) + (Cx(dstr->left))); - pt->v = CW(CW(pt->v) + (Cx(dstr->top))); + pt->h = BigEndianValue(BigEndianValue(pt->h) - (Cx(srcr->left))); + pt->v = BigEndianValue(BigEndianValue(pt->v) - (Cx(srcr->top))); + pt->h = BigEndianValue((LONGINT) BigEndianValue(pt->h) * dstdh / srcdh); + pt->v = BigEndianValue((LONGINT) BigEndianValue(pt->v) * dstdv / srcdv); + pt->h = BigEndianValue(BigEndianValue(pt->h) + (Cx(dstr->left))); + pt->v = BigEndianValue(BigEndianValue(pt->v) + (Cx(dstr->top))); } P3(PUBLIC pascal trap, void, MapRect, Rect *, r, Rect *, srcr, Rect *, dstr) @@ -174,10 +175,10 @@ P3(PUBLIC pascal trap, void, MapRgn, RgnHandle, rh, Rect *, srcr, Rect *, dstr) if (RGN_SMALL_P (rh)) MapRect(&HxX(rh, rgnBBox), srcr, dstr); else { - srcdh = CW(srcr->right) - (xoff1 = CW(srcr->left)); - dstdh = CW(dstr->right) - (xoff2 = CW(dstr->left)); - srcdv = CW(srcr->bottom) - (yoff1 = CW(srcr->top) ); - dstdv = CW(dstr->bottom) - (yoff2 = CW(dstr->top) ); + srcdh = BigEndianValue(srcr->right) - (xoff1 = BigEndianValue(srcr->left)); + dstdh = BigEndianValue(dstr->right) - (xoff2 = BigEndianValue(dstr->left)); + srcdv = BigEndianValue(srcr->bottom) - (yoff1 = BigEndianValue(srcr->top) ); + dstdv = BigEndianValue(dstr->bottom) - (yoff2 = BigEndianValue(dstr->top) ); xcoff = FixRatio(dstdh, srcdh); ycoff = FixRatio(dstdv, srcdv); ip = op = (INTEGER *) STARH(rh) + 5; @@ -186,11 +187,11 @@ P3(PUBLIC pascal trap, void, MapRgn, RgnHandle, rh, Rect *, srcr, Rect *, dstr) mergebuf = buf1; freebuf = buf2; do { - done = (newv = CW(*ip++)) == 32767; + done = (newv = BigEndianValue(*ip++)) == 32767; MAPV(newv); if (newv != oldv || done) { if (mergebuf[0] != 32767) { - *op++ = CW(oldv); + *op++ = BigEndianValue(oldv); saveop = op; hold = IMPOSSIBLE; for (tempp = mergebuf; (x1 = *tempp++) != 32767;) { @@ -200,12 +201,12 @@ P3(PUBLIC pascal trap, void, MapRgn, RgnHandle, rh, Rect *, srcr, Rect *, dstr) else if (hold == x1) hold = IMPOSSIBLE; else { - *op++ = CW(hold); + *op++ = BigEndianValue(hold); hold = (unsigned short) x1; } } if (hold != IMPOSSIBLE) - *op++ = CW(hold); + *op++ = BigEndianValue(hold); gui_assert(!((op - saveop)&1)); if (op == saveop) --op; @@ -218,17 +219,17 @@ P3(PUBLIC pascal trap, void, MapRgn, RgnHandle, rh, Rect *, srcr, Rect *, dstr) } if (!done) { for (tempp = freebuf, ipe = mergebuf, - x1 = CW(*ip++), x2 = *ipe++;;) { + x1 = BigEndianValue(*ip++), x2 = *ipe++;;) { if (x1 < x2) { *tempp++ = x1; - x1 = CW(*ip++); + x1 = BigEndianValue(*ip++); } else if (x1 > x2) { *tempp++ = x2; x2 = *ipe++; } else { if (x1 == 32767) /*-->*/ break; - x1 = CW(*ip++); + x1 = BigEndianValue(*ip++); x2 = *ipe++; } } diff --git a/src/qPaletteMgr.cpp b/src/qPaletteMgr.cpp index 832bba33..44f5ffce 100644 --- a/src/qPaletteMgr.cpp +++ b/src/qPaletteMgr.cpp @@ -25,6 +25,7 @@ char ROMlib_rcsid_qPaletteMgr[] = #include "rsys/dirtyrect.h" using namespace Executor; +using namespace ByteSwap; #define GD_CLUT_P(gd) (GD_TYPE_X (gd) == CWC (clutType)) @@ -32,17 +33,17 @@ using namespace Executor; #define CI_ALLOCATED_ENTRY_P(entry) ((entry)->ciPrivate & CI_ALLOCATED_BIT_X) #define CI_SET_ALLOCATED_ENTRY(entry, index) \ - ((entry)->ciPrivate = CI_ALLOCATED_BIT_X | CL (((index) & 0xFF) << 16)) + ((entry)->ciPrivate = CI_ALLOCATED_BIT_X | BigEndianValue (((index) & 0xFF) << 16)) #define CI_DEALLOCATE_ENTRY(entry) \ ((entry)->ciPrivate = CLC (0)) #define CI_ENTRY_INDEX(entry) \ - ((CL ((entry)->ciPrivate) >> 16) & 0xFF) + ((BigEndianValue ((entry)->ciPrivate) >> 16) & 0xFF) #define CI_ENTRY_INDEX_X(entry) \ - (CL (CI_ENTRY_INDEX (entry))) + (BigEndianValue (CI_ENTRY_INDEX (entry))) #define CI_USAGE_X(entry) ((entry)->ciUsage) -#define CI_USAGE(entry) (CW (CI_USAGE_X (entry))) +#define CI_USAGE(entry) (BigEndianValue (CI_USAGE_X (entry))) #define CI_TOLERANCE_X(entry) ((entry)->ciTolerance) -#define CI_TOLERANCE(entry) (CW (CI_TOLERANCE_X (entry))) +#define CI_TOLERANCE(entry) (BigEndianValue (CI_TOLERANCE_X (entry))) #define CI_USAGE_HAS_BITS_P(entry, bits) \ ((CI_USAGE (entry) & 0xF) == (bits)) #define CI_RGB(entry) ((entry)->ciRGB) @@ -220,9 +221,9 @@ P0 (PUBLIC pascal trap, INTEGER, PMgrVersion) static inline int rgb_delta (RGBColor *c1, RGBColor *c2) { - return MAX (MAX (ABS (CW (c1->red) - CW (c2->red)), - ABS (CW (c1->green) - CW (c2->green))), - ABS (CW (c1->blue) - CW (c2->blue))); + return MAX (MAX (ABS (BigEndianValue (c1->red) - BigEndianValue (c2->red)), + ABS (BigEndianValue (c1->green) - BigEndianValue (c2->green))), + ABS (BigEndianValue (c1->blue) - BigEndianValue (c2->blue))); } int @@ -580,7 +581,7 @@ pm_do_updates_gd_changed (void) gd_pixmap = GD_PMAP (gd); gd_ctab = PIXMAP_TABLE (gd_pixmap); - CTAB_SEED_X (gd_ctab) = CL (GetCTSeed ()); + CTAB_SEED_X (gd_ctab) = BigEndianValue (GetCTSeed ()); PaintWhite = 0; front_w = FrontWindow (); @@ -867,7 +868,7 @@ P4 (PUBLIC pascal trap, PaletteHandle, NewPalette, PALETTE_SEEDS_X (new_palette) = RM (NewHandle (sizeof (int))); PALETTE_SET_MODIFIED (new_palette); - PALETTE_ENTRIES_X (new_palette) = CW (entries); + PALETTE_ENTRIES_X (new_palette) = BigEndianValue (entries); info = PALETTE_INFO (new_palette); i = 0; @@ -880,16 +881,16 @@ P4 (PUBLIC pascal trap, PaletteHandle, NewPalette, for (; i < entries && i <= max_colors; i ++) { info[i].ciRGB = colors[i].rgb; - info[i].ciUsage = CW (src_usage); - info[i].ciTolerance = CW (src_tolerance); + info[i].ciUsage = BigEndianValue (src_usage); + info[i].ciTolerance = BigEndianValue (src_tolerance); } } for (; i < entries; i ++) { info[i].ciRGB = ROMlib_black_rgb_color; - info[i].ciUsage = CW (src_usage); - info[i].ciTolerance = CW (src_tolerance); + info[i].ciUsage = BigEndianValue (src_usage); + info[i].ciTolerance = BigEndianValue (src_tolerance); } return new_palette; @@ -1133,7 +1134,7 @@ set_palette_common (WindowPtr dst_window, PaletteHandle src_palette, #if 0 /* clear the palette bits, and set the new update */ PALETTE_PRIVATE_X (src_palette) &= ~PALETTE_UPDATE_FLAG_BITS_X; - PALETTE_PRIVATE_X (src_palette) |= CW (c_update); + PALETTE_PRIVATE_X (src_palette) |= BigEndianValue (c_update); #else elt->c_update = c_update; #endif @@ -1164,7 +1165,7 @@ P2 (PUBLIC pascal trap, void, SetPaletteUpdates, PaletteHandle, palette, INTEGER, update) { PALETTE_PRIVATE_X (palette) &= ~PALETTE_UPDATE_FLAG_BITS_X; - PALETTE_PRIVATE_X (palette) |= CW (update); + PALETTE_PRIVATE_X (palette) |= BigEndianValue (update); } P1 (PUBLIC pascal trap, INTEGER, GetPaletteUpdates, @@ -1204,7 +1205,7 @@ P1 (PUBLIC pascal trap, PaletteHandle, GetPalette, int gd_index_mask; \ \ gd_index_mask = CTAB_SIZE (PIXMAP_TABLE (GD_PMAP (MR (TheGDevice)))); \ - index_macro_x (thePort) = CL ((entry) & gd_index_mask); \ + index_macro_x (thePort) = BigEndianValue ((entry) & gd_index_mask); \ } \ else if (CI_USAGE_X (info) & CWC (pmAnimated)) \ { \ @@ -1266,7 +1267,7 @@ P1 (PUBLIC pascal trap, void, RestoreFore, ColorSpec *, cp) goto USE_RGB_ANYWAY; break; default: - warning_unexpected ("value = 0x%x (using rgb)", CW (cp->value)); + warning_unexpected ("value = 0x%x (using rgb)", BigEndianValue (cp->value)); /* FALL THROUGH */ case CWC (useRGB): USE_RGB_ANYWAY: @@ -1292,7 +1293,7 @@ P1 (PUBLIC pascal trap, void, RestoreBack, ColorSpec *, cp) goto USE_RGB_ANYWAY; break; default: - warning_unexpected ("value = 0x%x (using rgb)", CW (cp->value)); + warning_unexpected ("value = 0x%x (using rgb)", BigEndianValue (cp->value)); /* FALL THROUGH */ case CWC (useRGB): USE_RGB_ANYWAY: @@ -1378,7 +1379,7 @@ P5 (PUBLIC pascal trap, void, AnimatePalette, /* Compute the number of entries in the table to modify. */ dst_length = MIN ((CTAB_SIZE (src_ctab) + 1) - src_index, dst_length); - dst_length = MIN (CW (palette->pmEntries) - dst_entry, dst_length); + dst_length = MIN (BigEndianValue (palette->pmEntries) - dst_entry, dst_length); src_cspec = &CTAB_TABLE (src_ctab)[src_index]; @@ -1451,8 +1452,8 @@ P4 (PUBLIC pascal trap, void, SetEntryUsage, } entry = &PALETTE_INFO (dst_palette)[entry_index]; - CI_USAGE_X (entry) = CW (src_usage); - CI_TOLERANCE_X (entry) = CW (src_tolerance); + CI_USAGE_X (entry) = BigEndianValue (src_usage); + CI_TOLERANCE_X (entry) = BigEndianValue (src_tolerance); pm_deallocate_entry (entry, FALSE); @@ -1479,7 +1480,7 @@ P4 (PUBLIC pascal trap, void, CTab2Palette, /* resize the palette */ SetHandleSize ((Handle) dst_palette, PALETTE_STORAGE_FOR_ENTRIES (ctab_size + 1)); - PALETTE_ENTRIES_X (dst_palette) = CW (ctab_size + 1); + PALETTE_ENTRIES_X (dst_palette) = BigEndianValue (ctab_size + 1); ctab_table = CTAB_TABLE (src_ctab); palette_info = PALETTE_INFO (dst_palette); @@ -1491,8 +1492,8 @@ P4 (PUBLIC pascal trap, void, CTab2Palette, pm_deallocate_entry (entry, FALSE); entry->ciRGB = ctab_table[i].rgb; - entry->ciUsage = CW (src_usage); - entry->ciTolerance = CW (src_tolerance); + entry->ciUsage = BigEndianValue (src_usage); + entry->ciTolerance = BigEndianValue (src_tolerance); } PALETTE_SET_MODIFIED (dst_palette); } @@ -1516,13 +1517,13 @@ P2 (PUBLIC pascal trap, void, Palette2CTab, CTAB_SEED_X (dst_ctab) = CLC (0); CTAB_FLAGS_X (dst_ctab) = CWC (0); - CTAB_SIZE_X (dst_ctab) = CW (palette_entries - 1); + CTAB_SIZE_X (dst_ctab) = BigEndianValue (palette_entries - 1); palette_info = PALETTE_INFO (src_palette); ctab_table = CTAB_TABLE (dst_ctab); for (i = 0; i < palette_entries; i ++) { - ctab_table[i].value = CW (i); + ctab_table[i].value = BigEndianValue (i); ctab_table[i].rgb = palette_info[i].ciRGB; } @@ -1560,7 +1561,7 @@ P1 (PUBLIC pascal trap, LONGINT, Entry2Index, INTEGER, entry_index) return CI_ENTRY_INDEX (entry); } else - gui_fatal ("unhandled entry usage `%d'", CW (entry->ciUsage)); + gui_fatal ("unhandled entry usage `%d'", BigEndianValue (entry->ciUsage)); } P5 (PUBLIC pascal trap, void, CopyPalette, diff --git a/src/qPen.cpp b/src/qPen.cpp index ecc703f1..8ab50ec7 100644 --- a/src/qPen.cpp +++ b/src/qPen.cpp @@ -18,17 +18,18 @@ char ROMlib_rcsid_qPen[] = #include "rsys/picture.h" using namespace Executor; +using namespace ByteSwap; P0(PUBLIC pascal trap, void, HidePen) { if (thePortX) - PORT_PEN_VIS_X (thePort) = CW (PORT_PEN_VIS (thePort) - 1); + PORT_PEN_VIS_X (thePort) = BigEndianValue (PORT_PEN_VIS (thePort) - 1); } P0(PUBLIC pascal trap, void, ShowPen) { if (thePortX) - PORT_PEN_VIS_X (thePort) = CW (PORT_PEN_VIS (thePort) + 1); + PORT_PEN_VIS_X (thePort) = BigEndianValue (PORT_PEN_VIS (thePort) + 1); } P1(PUBLIC pascal trap, void, GetPen, Point *, ptp) @@ -138,15 +139,15 @@ P2(PUBLIC pascal trap, void, PenSize, INTEGER, w, INTEGER, h) { if (thePortX) { - PORT_PEN_SIZE (thePort).h = CW (w); - PORT_PEN_SIZE (thePort).v = CW (h); + PORT_PEN_SIZE (thePort).h = BigEndianValue (w); + PORT_PEN_SIZE (thePort).v = BigEndianValue (h); } } P1(PUBLIC pascal trap, void, PenMode, INTEGER, m) { if (thePortX) - PORT_PEN_MODE_X (thePort) = CW (m); + PORT_PEN_MODE_X (thePort) = BigEndianValue (m); } P1(PUBLIC pascal trap, void, PenPat, Pattern, pp) @@ -189,8 +190,8 @@ P2(PUBLIC pascal trap, void, MoveTo, INTEGER, h, INTEGER, v) { if (thePortX) { - PORT_PEN_LOC (thePort).h = CW (h); - PORT_PEN_LOC (thePort).v = CW (v); + PORT_PEN_LOC (thePort).h = BigEndianValue (h); + PORT_PEN_LOC (thePort).v = BigEndianValue (v); } } @@ -198,8 +199,8 @@ P2(PUBLIC pascal trap, void, Move, INTEGER, dh, INTEGER, dv) { if (thePortX) { - PORT_PEN_LOC (thePort).h = CW (CW (PORT_PEN_LOC (thePort).h) + (dh)); - thePort->pnLoc.v = CW (CW (PORT_PEN_LOC (thePort).v) + (dv)); + PORT_PEN_LOC (thePort).h = BigEndianValue (BigEndianValue (PORT_PEN_LOC (thePort).h) + (dh)); + thePort->pnLoc.v = BigEndianValue (BigEndianValue (PORT_PEN_LOC (thePort).v) + (dv)); } } @@ -211,8 +212,8 @@ P2(PUBLIC pascal trap, void, LineTo, INTEGER, h, INTEGER, v) p.h = h; p.v = v; CALLLINE(p); - PORT_PEN_LOC (thePort).h = CW(p.h); - PORT_PEN_LOC (thePort).v = CW(p.v); + PORT_PEN_LOC (thePort).h = BigEndianValue(p.h); + PORT_PEN_LOC (thePort).v = BigEndianValue(p.v); } } @@ -221,11 +222,11 @@ P2(PUBLIC pascal trap, void, Line, INTEGER, dh, INTEGER, dv) Point p; if (thePortX) { - p.h = CW (PORT_PEN_LOC (thePort).h) + dh; - p.v = CW (PORT_PEN_LOC (thePort).v) + dv; + p.h = BigEndianValue (PORT_PEN_LOC (thePort).h) + dh; + p.v = BigEndianValue (PORT_PEN_LOC (thePort).v) + dv; CALLLINE(p); - PORT_PEN_LOC (thePort).h = CW(p.h); - PORT_PEN_LOC (thePort).v = CW(p.v); + PORT_PEN_LOC (thePort).h = BigEndianValue(p.h); + PORT_PEN_LOC (thePort).v = BigEndianValue(p.v); } } diff --git a/src/qPicstuff.cpp b/src/qPicstuff.cpp index 2d42eccb..8ee855ef 100644 --- a/src/qPicstuff.cpp +++ b/src/qPicstuff.cpp @@ -29,6 +29,7 @@ char ROMlib_rcsid_qPicstuff[] = #include "rsys/executor.h" using namespace Executor; +using namespace ByteSwap; /* * Hooray for static variables. We have to do something like this because @@ -215,22 +216,22 @@ A2(PRIVATE, void, txratio, Point, num, Point, den) A2(PRIVATE, void, line, Point, op, Point, np) { - PORT_PEN_LOC (thePort).h = CW (op.h); - PORT_PEN_LOC (thePort).v = CW (op.v); + PORT_PEN_LOC (thePort).h = BigEndianValue (op.h); + PORT_PEN_LOC (thePort).v = BigEndianValue (op.v); CALLLINE(np); - PORT_PEN_LOC (thePort).h = CW (np.h); - PORT_PEN_LOC (thePort).v = CW (np.v); + PORT_PEN_LOC (thePort).h = BigEndianValue (np.h); + PORT_PEN_LOC (thePort).v = BigEndianValue (np.v); } A3(PRIVATE, void, shrtline, Point, op, SignedByte, dh, SignedByte, dv) { - PORT_PEN_LOC (thePort).h = CW(op.h); - PORT_PEN_LOC (thePort).v = CW(op.v); + PORT_PEN_LOC (thePort).h = BigEndianValue(op.h); + PORT_PEN_LOC (thePort).v = BigEndianValue(op.v); op.h += dh; op.v += dv; CALLLINE (op); - PORT_PEN_LOC (thePort).h = CW(op.h); - PORT_PEN_LOC (thePort).v = CW(op.v); + PORT_PEN_LOC (thePort).h = BigEndianValue(op.h); + PORT_PEN_LOC (thePort).v = BigEndianValue(op.v); } PRIVATE void setnumerdenom(Point *nump, Point *denp) @@ -291,10 +292,10 @@ A3(PRIVATE, void, longtext, Point, pt, StringPtr, s, Point *, pp) Point save, numer, denom; save = PORT_PEN_LOC (thePort); - pp->h = CW (pt.h); - pp->v = CW (pt.v); - PORT_PEN_LOC (thePort).h = CW (pt.h); - PORT_PEN_LOC (thePort).v = CW (pt.v); + pp->h = BigEndianValue (pt.h); + pp->v = BigEndianValue (pt.v); + PORT_PEN_LOC (thePort).h = BigEndianValue (pt.h); + PORT_PEN_LOC (thePort).v = BigEndianValue (pt.v); setnumerdenom (&numer, &denom); CALLTEXT ((INTEGER) U(s[0]), (Ptr) (s+1), numer, denom); PORT_PEN_LOC (thePort) = save; @@ -304,7 +305,7 @@ A3(PRIVATE, void, dhtext, unsigned char, dh, StringPtr, s, Point *, pp) { Point save, numer, denom; - pp->h = CW(CW(pp->h) + (dh)); + pp->h = BigEndianValue(BigEndianValue(pp->h) + (dh)); save = PORT_PEN_LOC (thePort); PORT_PEN_LOC (thePort) = *pp; setnumerdenom (&numer, &denom); @@ -316,7 +317,7 @@ A3(PRIVATE, void, dvtext, unsigned char, dv, StringPtr, s, Point *, pp) { Point save, numer, denom; - pp->v = CW (CW (pp->v) + (dv)); + pp->v = BigEndianValue (BigEndianValue (pp->v) + (dv)); save = PORT_PEN_LOC (thePort); PORT_PEN_LOC (thePort) = *pp; setnumerdenom (&numer, &denom); @@ -329,8 +330,8 @@ A4(PRIVATE, void, dhdvtext, Byte, dh, Byte, dv, { Point save, numer, denom; - pp->h = CW(CW(pp->h) + (dh)); - pp->v = CW(CW(pp->v) + (dv)); + pp->h = BigEndianValue(BigEndianValue(pp->h) + (dh)); + pp->v = BigEndianValue(BigEndianValue(pp->v) + (dv)); save = PORT_PEN_LOC (thePort); PORT_PEN_LOC (thePort) = *pp; setnumerdenom(&numer, &denom); @@ -374,8 +375,8 @@ A2 (PRIVATE, void, origin, INTEGER, dh, INTEGER, dv) { OffsetRect (&srcpicframe, dh, dv); - txtpoint.h = CW (CW (txtpoint.h) - dh); - txtpoint.v = CW (CW (txtpoint.v) - dv); + txtpoint.h = BigEndianValue (BigEndianValue (txtpoint.h) - dh); + txtpoint.v = BigEndianValue (BigEndianValue (txtpoint.v) - dv); } A1(PRIVATE, void, pnlochfrac, INTEGER, f) @@ -415,10 +416,10 @@ A2(PRIVATE, void, pnsize, INTEGER, pv, INTEGER, ph) { Point p; - p.h = CW(ph); - p.v = CW(pv); + p.h = BigEndianValue(ph); + p.v = BigEndianValue(pv); ScalePt(&p, &srcpicframe, &dstpicframe); - PenSize(CW(p.h), CW(p.v)); + PenSize(BigEndianValue(p.h), BigEndianValue(p.v)); } A1(PRIVATE, void, textface, Byte, f) @@ -550,7 +551,7 @@ PRIVATE void W_TextFont( INTEGER f ) INTEGER new_f; GetFNum (sp, &new_f); if (new_f) - f = CW (new_f); + f = BigEndianValue (new_f); } TextFont( f ); } @@ -777,7 +778,7 @@ fontname (INTEGER hsize, Handle hand) StringPtr sp; p = (char *) STARH (hand); - i = CW (*(INTEGER *)p); + i = BigEndianValue (*(INTEGER *)p); sp = (StringPtr) p + 2; add_assoc (i, sp); } @@ -1019,7 +1020,7 @@ PRIVATE INTEGER eatINTEGER() INTEGER retval; retval = eatINTEGERX(); - return CW(retval); + return BigEndianValue(retval); } PRIVATE LONGINT eatLONGINTX() @@ -1039,7 +1040,7 @@ PRIVATE LONGINT eatLONGINT() LONGINT retval; retval = eatLONGINTX(); - return CL(retval); + return BigEndianValue(retval); } PRIVATE void eatString(Str255 str) @@ -1079,7 +1080,7 @@ A2(PRIVATE, void, eatRegion, RgnHandle, rh, Size, hs) } else BlockMove((Ptr) nextbytep, (Ptr) STARH(rh) + sizeof(INTEGER), hs - sizeof(INTEGER)); - HxX(rh, rgnSize) = CW(hs); + HxX(rh, rgnSize) = BigEndianValue(hs); nextbytep += hs - sizeof(INTEGER); } @@ -1096,7 +1097,7 @@ A2(PRIVATE, void, eatPixMap, register PixMapPtr, pixp, INTEGER, rowb) /* TODO: byte swapping stuff, testing */ /* x(pixp->baseAddr) = 0; will be set later */ - pixp->rowBytes = rowb ? CW(rowb) : eatINTEGERX(); + pixp->rowBytes = rowb ? BigEndianValue(rowb) : eatINTEGERX(); eatRect(&pixp->bounds); pixp->pmVersion = eatINTEGERX(); pixp->packType = eatINTEGERX(); @@ -1117,7 +1118,7 @@ A2(PRIVATE, void, eatPixMap, register PixMapPtr, pixp, INTEGER, rowb) A2(PRIVATE, void, eatBitMap, BitMap *, bp, INTEGER, rowb) { bp->baseAddr = 0; - bp->rowBytes = rowb ? CW(rowb) : eatINTEGERX(); + bp->rowBytes = rowb ? BigEndianValue(rowb) : eatINTEGERX(); eatRect(&bp->bounds); } @@ -1303,8 +1304,8 @@ A2(PRIVATE, void, eatbitdata, register BitMap *, bp, BOOLEAN, packed) INTEGER length; Handle temph; - rowb = CW(bp->rowBytes) & ROWMASK; - datasize = (LONGINT) rowb * (CW(bp->bounds.bottom) - CW(bp->bounds.top)); + rowb = BigEndianValue(bp->rowBytes) & ROWMASK; + datasize = (LONGINT) rowb * (BigEndianValue(bp->bounds.bottom) - BigEndianValue(bp->bounds.top)); if (!packed) { if (procp) { h = NewHandle(datasize); @@ -1382,7 +1383,7 @@ A1(PRIVATE, void, eatColorTable, register PixMapPtr, pixmap) ch = MR(pixmap->pmTable); cp = STARH(ch); /* cp->ctSeed = */ eatLONGINTX(); - cp->ctSeed = CL (GetCTSeed ()); + cp->ctSeed = BigEndianValue (GetCTSeed ()); cp->ctFlags = eatINTEGERX(); cp->ctSize = eatINTEGERX(); SetHandleSize((Handle) ch, (Size)sizeof(ColorTable) - sizeof(cp->ctTable) + @@ -1554,8 +1555,8 @@ P2(PUBLIC pascal trap, void, DrawPicture, PicHandle, pic, Rect *, destrp) #endif /* LETGCCWAIL */ #if 0 - if (!pic || (CW (destrp->top) == CW (destrp->bottom) - && CW (destrp->left) == CW (destrp->right))) + if (!pic || (BigEndianValue (destrp->top) == BigEndianValue (destrp->bottom) + && BigEndianValue (destrp->left) == BigEndianValue (destrp->right))) return; #else if (!pic || !pic->p || EmptyRect(destrp) || EmptyRect(&HxX(pic, picFrame))) @@ -1627,8 +1628,8 @@ P2(PUBLIC pascal trap, void, DrawPicture, PicHandle, pic, Rect *, destrp) /* this will fail if we are actually drawing to a color graph port; we'll get spew colors instead of b/w, so let ForeColor or BackColor do the work */ - the_port->fgColor = CL(blackColor); - the_port->bkColor = CL(whiteColor); + the_port->fgColor = BigEndianValue(blackColor); + the_port->bkColor = BigEndianValue(whiteColor); #else ForeColor (blackColor); BackColor (whiteColor); @@ -1670,8 +1671,8 @@ P2(PUBLIC pascal trap, void, DrawPicture, PicHandle, pic, Rect *, destrp) reduce(&picnumh, &picdenh); reduce(&picnumv, &picdenv); - txtpoint.h = CW(CW(dstpicframe.left) - CW(srcpicframe.left)); - txtpoint.v = CW(CW(dstpicframe.top) - CW(srcpicframe.top)); + txtpoint.h = BigEndianValue(BigEndianValue(dstpicframe.left) - BigEndianValue(srcpicframe.left)); + txtpoint.v = BigEndianValue(BigEndianValue(dstpicframe.top) - BigEndianValue(srcpicframe.top)); scaleh = FixRatio (RECT_WIDTH (&dstpicframe), RECT_WIDTH (&srcpicframe)); scalev = FixRatio (RECT_HEIGHT (&dstpicframe), RECT_HEIGHT (&srcpicframe)); @@ -1718,8 +1719,8 @@ P2(PUBLIC pascal trap, void, DrawPicture, PicHandle, pic, Rect *, destrp) pp->h = eatINTEGERX(); if (sc & SCALEIT) MapPt(pp, &srcpicframe, destrp); - pp->h = CW(pp->h); - pp->v = CW(pp->v); + pp->h = BigEndianValue(pp->h); + pp->v = BigEndianValue(pp->v); ++pp; break; case RCT: @@ -1917,11 +1918,11 @@ P2(PUBLIC pascal trap, void, DrawPicture, PicHandle, pic, Rect *, destrp) } } if (opcode == OP_OvSize) { - points[0].h = CW(points[0].h); - points[0].v = CW(points[0].v); + points[0].h = BigEndianValue(points[0].h); + points[0].v = BigEndianValue(points[0].v); ScalePt(&points[0], &srcpicframe, &dstpicframe); - points[0].h = CW(points[0].h); - points[0].v = CW(points[0].v); + points[0].h = BigEndianValue(points[0].h); + points[0].v = BigEndianValue(points[0].v); ovh = points[0].v; ovw = points[0].h; } else if (opcode == OP_Version) { diff --git a/src/qPict2.cpp b/src/qPict2.cpp index 08aa1e1c..713f0056 100644 --- a/src/qPict2.cpp +++ b/src/qPict2.cpp @@ -18,6 +18,7 @@ char ROMlib_rcsid_qPic2[] = #include "rsys/rgbutil.h" using namespace Executor; +using namespace ByteSwap; P1 (PUBLIC pascal trap, OSErr, DisposePictInfo, PictInfoID, pict_info_id) @@ -71,9 +72,9 @@ P6 (PUBLIC pascal trap, OSErr, GetPictInfo, ({ \ const RGBColor *color; \ color = &CTAB_TABLE (color_table)[pixel].rgb; \ - (r) = CW (color->red); \ - (g) = CW (color->green); \ - (b) = CW (color->blue); \ + (r) = BigEndianValue (color->red); \ + (g) = BigEndianValue (color->green); \ + (b) = BigEndianValue (color->blue); \ })) #define DIRECT_PIXEL_TO_RGB(bpp, pixel, red_out, green_out, blue_out, \ dummy_color_table) \ @@ -82,9 +83,9 @@ P6 (PUBLIC pascal trap, OSErr, GetPictInfo, RGBColor color; \ \ (*rgb_spec->pixel_to_rgbcolor) (rgb_spec, (pixel), &color); \ - (red_out) = CW (color.red); \ - (green_out) = CW (color.green); \ - (blue_out) = CW (color.blue); \ + (red_out) = BigEndianValue (color.red); \ + (green_out) = BigEndianValue (color.green); \ + (blue_out) = BigEndianValue (color.blue); \ })) #define PIXEL_TO_RGB(bpp, pixel, red, green, blue, color_table) \ ((void) \ @@ -193,10 +194,10 @@ P6 (PUBLIC pascal trap, OSErr, GetPixMapInfo, bank_index \ = ((red & mask) >> 1) | ((green & mask) >> 6) | ((blue & mask) >> 11); \ \ - count = CW (bank[bank_index]); \ + count = BigEndianValue (bank[bank_index]); \ if (! count) \ unique_colors ++; \ - bank[bank_index] = CW (count + 1); \ + bank[bank_index] = BigEndianValue (count + 1); \ }) switch (bpp) @@ -307,9 +308,9 @@ P6 (PUBLIC pascal trap, OSErr, GetPixMapInfo, color_table = (CTabHandle) NewHandle (CTAB_STORAGE_FOR_SIZE (colors_requested)); - CTAB_SEED_X (color_table) = CL (GetCTSeed ()); - CTAB_FLAGS_X (color_table) = CW (0); - CTAB_SIZE_X (color_table) = CW (colors_requested); + CTAB_SEED_X (color_table) = BigEndianValue (GetCTSeed ()); + CTAB_FLAGS_X (color_table) = BigEndianValue (0); + CTAB_SIZE_X (color_table) = BigEndianValue (colors_requested); table = CTAB_TABLE (color_table); @@ -318,7 +319,7 @@ P6 (PUBLIC pascal trap, OSErr, GetPixMapInfo, for (i = 0, t = head; i < colors_requested && t; i ++, t = t->next) { - table[i].value = CW (i); + table[i].value = BigEndianValue (i); #define TILE(x) (((uint32) (x) * 0x8421UL) >> 4) @@ -333,7 +334,7 @@ P6 (PUBLIC pascal trap, OSErr, GetPixMapInfo, popular colors in the pixmap */ memset (pict_info, '\000', sizeof *pict_info); - pict_info->uniqueColors = CL (unique_colors); + pict_info->uniqueColors = BigEndianValue (unique_colors); if (verb & returnPalette) { diff --git a/src/qPicture.cpp b/src/qPicture.cpp index bdd59cbf..cb88973d 100644 --- a/src/qPicture.cpp +++ b/src/qPicture.cpp @@ -18,6 +18,7 @@ char ROMlib_rcsid_qPicture[] = #include "rsys/mman.h" using namespace Executor; +using namespace ByteSwap; PUBLIC PicHandle Executor::ROMlib_OpenPicture_helper (const Rect *pf, const OpenCPicParams *params) @@ -36,7 +37,7 @@ PUBLIC PicHandle Executor::ROMlib_OpenPicture_helper (const Rect *pf, HxX(ph, picSize) = CWC(10 + 16 * sizeof(INTEGER)); HxX(ph, picFrame) = *pf; ip = &HxX(ph, picSize) + 5; - ip[0] = CW(OP_Version); + ip[0] = BigEndianValue(OP_Version); ip[1] = CWC (0x2FF); /* see the explanation in IM-V p. 93 */ ip[2] = CWC (0x0c00); /* see IM:Imaging with QuickDraw A-22 - A-24 */ @@ -68,7 +69,7 @@ PUBLIC PicHandle Executor::ROMlib_OpenPicture_helper (const Rect *pf, ip[15] = CWC (0x001e); HxX(pch, picsize) = CLC(INITIALPICSIZE); - HxX(pch, pichowfar) = CL((LONGINT) Hx(ph, picSize)); + HxX(pch, pichowfar) = BigEndianValue((LONGINT) Hx(ph, picSize)); temprh = RM(NewRgn()); HxX(pch, picclip) = temprh; /* -32766 below is an attempt to force a reload */ @@ -151,7 +152,7 @@ PRIVATE void updateapat( Pattern srcpat, Pattern dstpat, INTEGER opcode) PRIVATE void updateaninteger( INTEGER src, INTEGER *dstp, INTEGER opcode) { - src = CW(src); + src = BigEndianValue(src); if (*dstp != src) { *dstp = src; PICOP(opcode); @@ -295,16 +296,16 @@ PRIVATE void updatetxnumtxden( Point num, Point den ) pch = (piccachehand) PORT_PIC_SAVE (thePort); if (Hx(pch, pictxnum.h) != num.h || Hx(pch, pictxnum.v) != num.v || Hx(pch, pictxden.v) != den.v || Hx(pch, pictxden.h) != den.h) { - HxX(pch, pictxnum.h) = CW(num.h); - HxX(pch, pictxnum.v) = CW(num.v); - HxX(pch, pictxden.h) = CW(den.h); - HxX(pch, pictxden.v) = CW(den.v); + HxX(pch, pictxnum.h) = BigEndianValue(num.h); + HxX(pch, pictxnum.v) = BigEndianValue(num.v); + HxX(pch, pictxden.h) = BigEndianValue(den.h); + HxX(pch, pictxden.v) = BigEndianValue(den.v); PICOP(OP_TxRatio); - num.h = CW(num.h); - num.v = CW(num.v); + num.h = BigEndianValue(num.h); + num.v = BigEndianValue(num.v); PICWRITE(&num, sizeof(num)); - den.h = CW(den.h); - den.v = CW(den.v); + den.h = BigEndianValue(den.h); + den.v = BigEndianValue(den.v); PICWRITE(&den, sizeof(den)); } } diff --git a/src/qPixMapConv.cpp b/src/qPixMapConv.cpp index 4b876336..e085d05e 100644 --- a/src/qPixMapConv.cpp +++ b/src/qPixMapConv.cpp @@ -24,6 +24,7 @@ char ROMlib_rcsid_qPixMapConv[] = #include "rsys/vdriver.h" using namespace Executor; +using namespace ByteSwap; static uint32 depth_table_space[DEPTHCONV_MAX_UINT32_TABLE_SIZE]; @@ -52,7 +53,7 @@ Executor::pixmap_black_white (const PixMap *pixmap, { int bpp; - bpp = CW (pixmap->pixelSize); + bpp = BigEndianValue (pixmap->pixelSize); *black_return = (1 << bpp) - 1; *white_return = 0; @@ -97,10 +98,10 @@ Executor::pixmap_copy (const PixMap *src_pm, const Rect *src_rect, pixmaps */ *return_pm = *src_pm; - row_bytes = ((width * CW (src_pm->pixelSize) + 31) / 32) * 4; + row_bytes = ((width * BigEndianValue (src_pm->pixelSize) + 31) / 32) * 4; return_pm->baseAddr = RM (NewPtr (height * row_bytes)); - return_pm->rowBytes = CW ( row_bytes + return_pm->rowBytes = BigEndianValue ( row_bytes | PIXMAP_DEFAULT_ROW_BYTES); return_pm->bounds = *return_rect; @@ -116,7 +117,7 @@ Executor::pixmap_copy (const PixMap *src_pm, const Rect *src_rect, pixmap_black_white (src_pm, &black_pixel, &white_pixel); ROMlib_blt_rgn_update_dirty_rect (rgn, srcCopy, - FALSE, CW (src_pm->pixelSize), + FALSE, BigEndianValue (src_pm->pixelSize), src_pm, return_pm, src_rect, return_rect, black_pixel, white_pixel); @@ -173,7 +174,7 @@ Executor::canonical_from_bogo_color (uint32 index, if (rgb_spec == mac_rgb_spec) { if (pixel_out) - *pixel_out = CW (index); + *pixel_out = BigEndianValue (index); if (rgb_out) (rgb_spec->pixel_to_rgbcolor) (rgb_spec, index, rgb_out); return; @@ -185,7 +186,7 @@ Executor::canonical_from_bogo_color (uint32 index, if (rgb_spec == mac_rgb_spec) { if (pixel_out) - *pixel_out = CL (index); + *pixel_out = BigEndianValue (index); if (rgb_out) (rgb_spec->pixel_to_rgbcolor) (rgb_spec, index, rgb_out); return; @@ -324,13 +325,13 @@ Executor::pixmap_set_pixel_fields (PixMap *pixmap, int bpp) if (bpp <= 8) { pixmap->pixelType = CWC (Indirect); - pixmap->cmpSize = pixmap->pixelSize = CW (bpp); + pixmap->cmpSize = pixmap->pixelSize = BigEndianValue (bpp); pixmap->cmpCount = CWC (1); } else { pixmap->pixelType = CWC (RGBDirect); - pixmap->pixelSize = CW (bpp); + pixmap->pixelSize = BigEndianValue (bpp); pixmap->cmpCount = CWC (3); switch (bpp) { @@ -356,7 +357,7 @@ sort_color_table (CTabHandle dsth, const CTabHandle srch) /* Claris Home Page has some PICTs with color tables that are too large, so we make sure we don't try to copy too much. */ - src_ct_size = MIN (CW (src->ctSize), CW (dst->ctSize)); + src_ct_size = MIN (BigEndianValue (src->ctSize), BigEndianValue (dst->ctSize)); if (src->ctFlags & CTAB_GDEVICE_BIT_X) { @@ -372,10 +373,10 @@ sort_color_table (CTabHandle dsth, const CTabHandle srch) src_table = src->ctTable; dst_table = dst->ctTable; - max_ctab_elt = CW (dst->ctSize); + max_ctab_elt = BigEndianValue (dst->ctSize); dst->ctSeed = src->ctSeed; for (i = src_ct_size; i >= 0; i--) - dst_table[CW (src_table[i].value) & max_ctab_elt].rgb + dst_table[BigEndianValue (src_table[i].value) & max_ctab_elt].rgb = src_table[i].rgb; } } @@ -400,8 +401,8 @@ Executor::convert_pixmap (const PixMap *src, PixMap *dst, TEMP_ALLOC_DECL (temp_scratch_pm_bits); /* Grab some useful information about the PixMaps. */ - src_bpp = CW (src->pixelSize); - dst_bpp = CW (dst->pixelSize); + src_bpp = BigEndianValue (src->pixelSize); + dst_bpp = BigEndianValue (dst->pixelSize); width = RECT_WIDTH (rect); height = RECT_HEIGHT (rect); @@ -450,7 +451,7 @@ Executor::convert_pixmap (const PixMap *src, PixMap *dst, mapping = (CTabHandle) (NewHandle (CTAB_STORAGE_FOR_SIZE (max_mapping_elt))); - CTAB_SIZE_X (mapping) = CW (max_mapping_elt); + CTAB_SIZE_X (mapping) = BigEndianValue (max_mapping_elt); CTAB_FLAGS_X (mapping) = CWC (0); /* the source color table may not specify all possible colors, so set unspecified colors to some sane value @@ -589,8 +590,8 @@ Executor::convert_pixmap (const PixMap *src, PixMap *dst, /* using BITMAP_... on a PixMap * is slimy */ src_row_bytes = BITMAP_ROWBYTES (src); src_base = (uint8 *) (MR (src->baseAddr) - + (CW (rect->top) - CW (src->bounds.top)) * src_row_bytes - + (CW (rect->left) - CW (src->bounds.left)) * src_bpp / 8); + + (BigEndianValue (rect->top) - BigEndianValue (src->bounds.top)) * src_row_bytes + + (BigEndianValue (rect->left) - BigEndianValue (src->bounds.left)) * src_bpp / 8); dst_row_bytes = BITMAP_ROWBYTES (dst); dst_base = (uint8 *) MR (dst->baseAddr); diff --git a/src/qPoint.cpp b/src/qPoint.cpp index 6d1460f7..b7f33a96 100644 --- a/src/qPoint.cpp +++ b/src/qPoint.cpp @@ -14,23 +14,24 @@ char ROMlib_rcsid_qPoint[] = #include "rsys/cquick.h" using namespace Executor; +using namespace ByteSwap; P2(PUBLIC pascal trap, void, AddPt, Point, src, Point *, dst) { - dst->h = CW(CW(dst->h) + (src.h)); - dst->v = CW(CW(dst->v) + (src.v)); + dst->h = BigEndianValue(BigEndianValue(dst->h) + (src.h)); + dst->v = BigEndianValue(BigEndianValue(dst->v) + (src.v)); } P2(PUBLIC pascal trap, void, SubPt, Point, src, Point *, dst) { - dst->h = CW(CW(dst->h) - (src.h)); - dst->v = CW(CW(dst->v) - (src.v)); + dst->h = BigEndianValue(BigEndianValue(dst->h) - (src.h)); + dst->v = BigEndianValue(BigEndianValue(dst->v) - (src.v)); } P3(PUBLIC pascal trap, void, SetPt, Point *, pt, INTEGER, h, INTEGER, v) { - pt->h = CW (h); - pt->v = CW (v); + pt->h = BigEndianValue (h); + pt->v = BigEndianValue (v); } P2(PUBLIC pascal trap, BOOLEAN, EqualPt, Point, p1, Point, p2) @@ -41,15 +42,15 @@ P2(PUBLIC pascal trap, BOOLEAN, EqualPt, Point, p1, Point, p2) P1(PUBLIC pascal trap, void, LocalToGlobal, Point *, pt) { if (thePortX) { - pt->h = CW(CW(pt->h) - (CW (PORT_BOUNDS (thePort).left))); - pt->v = CW(CW(pt->v) - (CW (PORT_BOUNDS (thePort).top))); + pt->h = BigEndianValue(BigEndianValue(pt->h) - (BigEndianValue (PORT_BOUNDS (thePort).left))); + pt->v = BigEndianValue(BigEndianValue(pt->v) - (BigEndianValue (PORT_BOUNDS (thePort).top))); } } P1(PUBLIC pascal trap, void, GlobalToLocal, Point *, pt) { if (thePortX) { - pt->h = CW(CW(pt->h) + (Cx (PORT_BOUNDS (thePort).left))); - pt->v = CW(CW(pt->v) + (Cx (PORT_BOUNDS (thePort).top))); + pt->h = BigEndianValue(BigEndianValue(pt->h) + (Cx (PORT_BOUNDS (thePort).left))); + pt->v = BigEndianValue(BigEndianValue(pt->v) + (Cx (PORT_BOUNDS (thePort).top))); } } diff --git a/src/qPoly.cpp b/src/qPoly.cpp index e4bb426b..c35e2c49 100644 --- a/src/qPoly.cpp +++ b/src/qPoly.cpp @@ -19,6 +19,7 @@ char ROMlib_rcsid_qPoly[] = #include "rsys/cquick.h" using namespace Executor; +using namespace ByteSwap; P0(PUBLIC pascal trap, PolyHandle, OpenPoly) { @@ -41,21 +42,21 @@ P0(PUBLIC pascal trap, void, ClosePoly) for (ip = (INTEGER *)((char *)STARH(ph) + SMALLPOLY), ep = (INTEGER *)((char *)STARH(ph) + Hx(ph, polySize)); ip != ep;) { - if ((i = CW(*ip)) <= top) + if ((i = BigEndianValue(*ip)) <= top) top = i; ++ip; if (i >= bottom) bottom = i; - if ((i = CW(*ip)) <= left) + if ((i = BigEndianValue(*ip)) <= left) left = i; ++ip; if (i >= right) right = i; } - HxX(ph, polyBBox.top) = CW(top); - HxX(ph, polyBBox.left) = CW(left); - HxX(ph, polyBBox.bottom) = CW(bottom); - HxX(ph, polyBBox.right) = CW(right); + HxX(ph, polyBBox.top) = BigEndianValue(top); + HxX(ph, polyBBox.left) = BigEndianValue(left); + HxX(ph, polyBBox.bottom) = BigEndianValue(bottom); + HxX(ph, polyBBox.right) = BigEndianValue(right); PORT_POLY_SAVE_X (thePort) = (Handle)CWC (0); ShowPen(); } @@ -71,15 +72,15 @@ P3(PUBLIC pascal trap, void, OffsetPoly, PolyHandle, poly, Point *pp, *ep; if (dh || dv) { - HxX(poly, polyBBox.top) = CW(Hx(poly, polyBBox.top) + dv); - HxX(poly, polyBBox.bottom) = CW(Hx(poly, polyBBox.bottom) + dv); - HxX(poly, polyBBox.left) = CW(Hx(poly, polyBBox.left) + dh); - HxX(poly, polyBBox.right) = CW(Hx(poly, polyBBox.right) + dh); + HxX(poly, polyBBox.top) = BigEndianValue(Hx(poly, polyBBox.top) + dv); + HxX(poly, polyBBox.bottom) = BigEndianValue(Hx(poly, polyBBox.bottom) + dv); + HxX(poly, polyBBox.left) = BigEndianValue(Hx(poly, polyBBox.left) + dh); + HxX(poly, polyBBox.right) = BigEndianValue(Hx(poly, polyBBox.right) + dh); pp = HxX(poly, polyPoints); ep = (Point *) (((char *) STARH(poly)) + Hx(poly, polySize)); while (pp != ep) { - pp->h = CW(CW(pp->h) + (dh)); - pp->v = CW(CW(pp->v) + (dv)); + pp->h = BigEndianValue(BigEndianValue(pp->h) + (dh)); + pp->v = BigEndianValue(BigEndianValue(pp->v) + (dv)); pp++; } } diff --git a/src/qRect.cpp b/src/qRect.cpp index 25c82461..f95a01bf 100644 --- a/src/qRect.cpp +++ b/src/qRect.cpp @@ -14,14 +14,15 @@ char ROMlib_rcsid_qRect[] = #include "ToolboxUtil.h" using namespace Executor; +using namespace ByteSwap; P5(PUBLIC pascal trap, void, SetRect, Rect *, r, INTEGER, left, INTEGER, top, INTEGER, right, INTEGER, bottom) { - r->top = CW(top); - r->left = CW(left); - r->bottom = CW(bottom); - r->right = CW(right); + r->top = BigEndianValue(top); + r->left = BigEndianValue(left); + r->bottom = BigEndianValue(bottom); + r->right = BigEndianValue(right); } P3(PUBLIC pascal trap, void, OffsetRect, Rect *, r, INTEGER, dh, INTEGER, dv) @@ -40,7 +41,7 @@ P3(PUBLIC pascal trap, void, InsetRect, Rect *, r, INTEGER, dh, INTEGER, dv) SWAPPED_OPW (r->right, -, dh); #if defined (INCOMPATIBLEBUTSANE) - if (CW(r->top) >= CW(r->bottom) || CW(r->left) >= CW(r->right)) + if (BigEndianValue(r->top) >= BigEndianValue(r->bottom) || BigEndianValue(r->left) >= BigEndianValue(r->right)) RECT_ZERO (r); #endif /* INCOMPATIBLEBUTSANE */ } @@ -48,15 +49,15 @@ P3(PUBLIC pascal trap, void, InsetRect, Rect *, r, INTEGER, dh, INTEGER, dv) P3(PUBLIC pascal trap, BOOLEAN, SectRect, const Rect *, s1, const Rect *, s2, Rect *, dest) { - if ( CW (s1->top) < CW (s2->bottom) - && CW (s2->top) < CW (s1->bottom) - && CW (s1->left) < CW (s2->right) - && CW (s2->left) < CW (s1->right)) + if ( BigEndianValue (s1->top) < BigEndianValue (s2->bottom) + && BigEndianValue (s2->top) < BigEndianValue (s1->bottom) + && BigEndianValue (s1->left) < BigEndianValue (s2->right) + && BigEndianValue (s2->left) < BigEndianValue (s1->right)) { - dest->top = CW (MAX (CW (s1->top), CW (s2->top))); - dest->left = CW (MAX (CW (s1->left), CW (s2->left))); - dest->bottom = CW (MIN (CW (s1->bottom), CW (s2->bottom))); - dest->right = CW (MIN (CW (s1->right), CW (s2->right))); + dest->top = BigEndianValue (MAX (BigEndianValue (s1->top), BigEndianValue (s2->top))); + dest->left = BigEndianValue (MAX (BigEndianValue (s1->left), BigEndianValue (s2->left))); + dest->bottom = BigEndianValue (MIN (BigEndianValue (s1->bottom), BigEndianValue (s2->bottom))); + dest->right = BigEndianValue (MIN (BigEndianValue (s1->right), BigEndianValue (s2->right))); return !EmptyRect (dest); } else @@ -68,8 +69,8 @@ P3(PUBLIC pascal trap, BOOLEAN, SectRect, const Rect *, s1, const Rect *, s2, P1(PUBLIC pascal trap, BOOLEAN, EmptyRect, Rect *, r) { - return(CW(r->top) >= CW(r->bottom) || - CW(r->left) >= CW(r->right)); + return(BigEndianValue(r->top) >= BigEndianValue(r->bottom) || + BigEndianValue(r->left) >= BigEndianValue(r->right)); } P3(PUBLIC pascal trap, void, UnionRect, Rect *, s1, Rect *, s2, Rect *, dest) @@ -79,10 +80,10 @@ P3(PUBLIC pascal trap, void, UnionRect, Rect *, s1, Rect *, s2, Rect *, dest) else if (EmptyRect(s2)) *dest = *s1; else { - dest->top = CW(MIN (CW(s1->top), CW(s2->top))); - dest->left = CW(MIN (CW(s1->left), CW(s2->left))); - dest->bottom = CW(MAX (CW(s1->bottom), CW(s2->bottom))); - dest->right = CW(MAX (CW(s1->right), CW(s2->right))); + dest->top = BigEndianValue(MIN (BigEndianValue(s1->top), BigEndianValue(s2->top))); + dest->left = BigEndianValue(MIN (BigEndianValue(s1->left), BigEndianValue(s2->left))); + dest->bottom = BigEndianValue(MAX (BigEndianValue(s1->bottom), BigEndianValue(s2->bottom))); + dest->right = BigEndianValue(MAX (BigEndianValue(s1->right), BigEndianValue(s2->right))); } } @@ -90,19 +91,19 @@ P2(PUBLIC pascal trap, BOOLEAN, PtInRect, Point, p, Rect *, r) { BOOLEAN retval; - retval = ( p.h >= CW(r->left) - && p.h < CW(r->right) - && p.v >= CW(r->top) - && p.v < CW(r->bottom)); + retval = ( p.h >= BigEndianValue(r->left) + && p.h < BigEndianValue(r->right) + && p.v >= BigEndianValue(r->top) + && p.v < BigEndianValue(r->bottom)); return retval; } P3(PUBLIC pascal trap, void, Pt2Rect, Point, p1, Point, p2, Rect *, dest) { - dest->top = CW(MIN (p1.v, p2.v)); - dest->left = CW(MIN (p1.h, p2.h)); - dest->bottom = CW(MAX (p1.v, p2.v)); - dest->right = CW(MAX (p1.h, p2.h)); + dest->top = BigEndianValue(MIN (p1.v, p2.v)); + dest->left = BigEndianValue(MIN (p1.h, p2.h)); + dest->bottom = BigEndianValue(MAX (p1.v, p2.v)); + dest->right = BigEndianValue(MAX (p1.h, p2.h)); } P3(PUBLIC pascal trap, void, PtToAngle, Rect *, rp, Point, p, INTEGER *, angle) @@ -116,8 +117,8 @@ P3(PUBLIC pascal trap, void, PtToAngle, Rect *, rp, Point, p, INTEGER *, angle) * just call atan2()? */ - dx = p.h - (CW (rp->left) + CW (rp->right)) / 2; - dy = p.v - (CW (rp->top) + CW (rp->bottom)) / 2; + dx = p.h - (BigEndianValue (rp->left) + BigEndianValue (rp->right)) / 2; + dy = p.v - (BigEndianValue (rp->top) + BigEndianValue (rp->bottom)) / 2; if (dx != 0) { @@ -136,7 +137,7 @@ P3(PUBLIC pascal trap, void, PtToAngle, Rect *, rp, Point, p, INTEGER *, angle) a = 180; } - *angle = CW (a); + *angle = BigEndianValue (a); } P2 (PUBLIC pascal trap, BOOLEAN, EqualRect, const Rect *, r1, const Rect *, r2) diff --git a/src/qRegion.cpp b/src/qRegion.cpp index 1a10d595..09669040 100644 --- a/src/qRegion.cpp +++ b/src/qRegion.cpp @@ -21,6 +21,7 @@ char ROMlib_rcsid_qRegion[] = #include "rsys/safe_alloca.h" using namespace Executor; +using namespace ByteSwap; #undef ALLOCABEGIN #define ALLOCABEGIN SAFE_DECL(); @@ -56,7 +57,7 @@ ROMlib_sledgehammer_rgn (RgnHandle rgn) start_ip = ip = RGN_DATA (rgn); /* #### verify that `y's are increasing also */ - for (y = CW (*ip++); y != RGN_STOP; y = CW (*ip++)) + for (y = BigEndianValue (*ip++); y != RGN_STOP; y = BigEndianValue (*ip++)) { /* #### verify that there are an even numbers of `x's */ if (special_rgn_p) @@ -70,7 +71,7 @@ ROMlib_sledgehammer_rgn (RgnHandle rgn) { int32 prev_x = INT32_MIN; - for (x = CW (*ip++); x != RGN_STOP; x = CW (*ip++)) + for (x = BigEndianValue (*ip++); x != RGN_STOP; x = BigEndianValue (*ip++)) gui_assert (x > prev_x); } } @@ -134,7 +135,7 @@ Executor::ROMlib_sizergn (RgnHandle rh, boolean_t special_p) /* INTERNAL */ { while (*ip != RGN_STOP_X) { - y = CW (*ip++); + y = BigEndianValue (*ip++); while ((i = *ip++) != RGN_STOP) { if (i < left) /* testing every element is a waste here */ @@ -148,8 +149,8 @@ Executor::ROMlib_sizergn (RgnHandle rh, boolean_t special_p) /* INTERNAL */ { while (*ip != RGN_STOP_X) { - y = CW (*ip++); - while ((i = CW (*ip++)) != RGN_STOP) + y = BigEndianValue (*ip++); + while ((i = BigEndianValue (*ip++)) != RGN_STOP) { if (i < left) /* testing every element is a waste here */ left = i; @@ -187,9 +188,9 @@ Executor::ROMlib_sizergn (RgnHandle rh, boolean_t special_p) /* INTERNAL */ HASSIGN_3 (rh, - rgnBBox.left, CW (left), - rgnBBox.bottom, CW (y), - rgnBBox.right, CW (right)); + rgnBBox.left, BigEndianValue (left), + rgnBBox.bottom, BigEndianValue (y), + rgnBBox.right, BigEndianValue (right)); } } @@ -266,13 +267,13 @@ P3 (PUBLIC pascal trap, void, OffsetRgn, RgnHandle, rh, ep = (INTEGER *) ((char *) ip + RGNP_SIZE (rp)) - 6; ip < ep; ip++) { - *ip = CW (CW (*ip) + (dv)); + *ip = BigEndianValue (BigEndianValue (*ip) + (dv)); ++ip; do { - *ip = CW (CW (*ip) + (dh)); + *ip = BigEndianValue (BigEndianValue (*ip) + (dh)); ++ip; - *ip = CW (CW (*ip) + (dh)); + *ip = BigEndianValue (BigEndianValue (*ip) + (dh)); ++ip; } while (*ip != RGN_STOP_X); @@ -300,7 +301,7 @@ P2 (PUBLIC pascal trap, BOOLEAN, PtInRgn, Point, p, RgnHandle, rh) *endpoints = RGN_STOP; ipe = endpoints; op = endpoints + NHPAIR; - while ((v = CW (*ipr++)) != RGN_STOP) + while ((v = BigEndianValue (*ipr++)) != RGN_STOP) { if (v > p.v) { @@ -311,9 +312,9 @@ P2 (PUBLIC pascal trap, BOOLEAN, PtInRgn, Point, p, RgnHandle, rh) } while (*ipr != RGN_STOP_X || *ipe != RGN_STOP) { - if (CW (*ipr) < *ipe) - *op++ = CW (*ipr++); - else if (*ipe < CW (*ipr)) + if (BigEndianValue (*ipr) < *ipe) + *op++ = BigEndianValue (*ipr++); + else if (*ipe < BigEndianValue (*ipr)) *op++ = *ipe++; else { @@ -352,9 +353,9 @@ P2 (PUBLIC pascal trap, BOOLEAN, PtInRgn, Point, p, RgnHandle, rh) op = freebuf; \ while (*ipr != RGN_STOP_X || *ipe != RGN_STOP) \ { \ - if (CW (*ipr) < *ipe) \ - *op++ = CW (*ipr++); \ - else if (*ipe < CW (*ipr)) \ + if (BigEndianValue (*ipr) < *ipe) \ + *op++ = BigEndianValue (*ipr++); \ + else if (*ipe < BigEndianValue (*ipr)) \ *op++ = *ipe++; \ else \ { \ @@ -394,14 +395,14 @@ P2 (PUBLIC pascal trap, BOOLEAN, PtInRgn, Point, p, RgnHandle, rh) \ ipe = cur; \ ipr = new; \ - *out++ = CW (vx); \ + *out++ = BigEndianValue (vx); \ hold = (LONGINT) (long) out; \ while (*ipr != RGN_STOP || *ipe != RGN_STOP) \ { \ if (*ipr < *ipe) \ - *out++ = CW (*ipr++); \ + *out++ = BigEndianValue (*ipr++); \ else if (*ipe < *ipr) \ - *out++ = CW (*ipe++); \ + *out++ = BigEndianValue (*ipe++); \ else \ { \ ipr++; \ @@ -412,7 +413,7 @@ P2 (PUBLIC pascal trap, BOOLEAN, PtInRgn, Point, p, RgnHandle, rh) --out; \ else \ { \ - *out++ = CW (RGN_STOP); \ + *out++ = BigEndianValue (RGN_STOP); \ } \ ipe = cur; \ cur = new; \ @@ -476,7 +477,7 @@ P2 (PUBLIC pascal trap, BOOLEAN, PtInRgn, Point, p, RgnHandle, rh) sp2 = src2; \ newsource \ newdest \ - *outp++ = CW(y); \ + *outp++ = BigEndianValue(y); \ outptr = outp; \ while (sstart != RGN_STOP && dstart != RGN_STOP) { \ if (sstop <= dstart) \ @@ -690,8 +691,8 @@ A3(PRIVATE, void, sectbinop, RgnHandle, srcrgn1, RgnHandle, srcrgn2, *src1ep = *src2ep = *sectsegep = *sectcurep = *freeep = *(src1ep+1) = *(src2ep+1) = RGN_STOP; - v1 = CW(*ipr1++); - v2 = CW(*ipr2++); + v1 = BigEndianValue(*ipr1++); + v2 = BigEndianValue(*ipr2++); wehavepairs = FALSE; /* whether or not scan lines have stuff */ switch (nspecial) { case 0: @@ -699,17 +700,17 @@ A3(PRIVATE, void, sectbinop, RgnHandle, srcrgn1, RgnHandle, srcrgn2, if (v1 < v2) { merge(ipr1, src1ep, freeep) /* no semi ... macro */ vx = v1; - v1 = CW(*ipr1++); + v1 = BigEndianValue(*ipr1++); } else if (v2 < v1) { merge(ipr2, src2ep, freeep) vx = v2; - v2 = CW(*ipr2++); + v2 = BigEndianValue(*ipr2++); } else { /* equal */ merge(ipr1, src1ep, freeep) merge(ipr2, src2ep, freeep) vx = v1; - v1 = CW(*ipr1++); - v2 = CW(*ipr2++); + v1 = BigEndianValue(*ipr1++); + v2 = BigEndianValue(*ipr2++); } sect(src1ep, src2ep, sectsegep) outputrgn(vx, sectcurep, sectsegep, tptr); @@ -721,17 +722,17 @@ A3(PRIVATE, void, sectbinop, RgnHandle, srcrgn1, RgnHandle, srcrgn2, if (v1 < v2) { nextline(ipr1, src1ep) /* no semi ... macro */ vx = v1; - v1 = CW(*ipr1++); + v1 = BigEndianValue(*ipr1++); } else if (v2 < v1) { merge(ipr2, src2ep, freeep) vx = v2; - v2 = CW(*ipr2++); + v2 = BigEndianValue(*ipr2++); } else { /* equal */ nextline(ipr1, src1ep) merge(ipr2, src2ep, freeep) vx = v1; - v1 = CW(*ipr1++); - v2 = CW(*ipr2++); + v1 = BigEndianValue(*ipr1++); + v2 = BigEndianValue(*ipr2++); } #if !defined (NDEBUG) assertincreasing(src1ep); @@ -746,17 +747,17 @@ A3(PRIVATE, void, sectbinop, RgnHandle, srcrgn1, RgnHandle, srcrgn2, if (v1 < v2) { nextline(ipr1, src1ep) /* no semi ... macro */ vx = v1; - v1 = CW(*ipr1++); + v1 = BigEndianValue(*ipr1++); } else if (v2 < v1) { nextline(ipr2, src2ep) vx = v2; - v2 = CW(*ipr2++); + v2 = BigEndianValue(*ipr2++); } else { /* equal */ nextline(ipr1, src1ep) nextline(ipr2, src2ep) vx = v1; - v1 = CW(*ipr1++); - v2 = CW(*ipr2++); + v1 = BigEndianValue(*ipr1++); + v2 = BigEndianValue(*ipr2++); } sectline(src1ep, src2ep, tptr, vx) } @@ -816,11 +817,11 @@ A4(PRIVATE, void, binop, optype, op, RgnHandle, srcrgn1, RgnHandle, srcrgn2, rp = &(RGN_BBOX (srcrgn1)); r1[0] = rp->top; r1[1] = rp->left; - r1[2] = rp->right != RGN_STOP_X ? rp->right : CW(RGN_STOP - 1); + r1[2] = rp->right != RGN_STOP_X ? rp->right : BigEndianValue(RGN_STOP - 1); r1[3] = RGN_STOP_X; - r1[4] = rp->bottom != RGN_STOP_X ? rp->bottom : CW(RGN_STOP - 1); + r1[4] = rp->bottom != RGN_STOP_X ? rp->bottom : BigEndianValue(RGN_STOP - 1); r1[5] = rp->left; - r1[6] = rp->right != RGN_STOP_X ? rp->right : CW(RGN_STOP - 1); + r1[6] = rp->right != RGN_STOP_X ? rp->right : BigEndianValue(RGN_STOP - 1); r1[7] = RGN_STOP_X; r1[8] = RGN_STOP_X; ipr1 = r1; @@ -830,11 +831,11 @@ A4(PRIVATE, void, binop, optype, op, RgnHandle, srcrgn1, RgnHandle, srcrgn2, rp = &(RGN_BBOX (srcrgn2)); r2[0] = rp->top; r2[1] = rp->left; - r2[2] = rp->right != RGN_STOP ? rp->right : CW(RGN_STOP - 1); + r2[2] = rp->right != RGN_STOP ? rp->right : BigEndianValue(RGN_STOP - 1); r2[3] = RGN_STOP_X; - r2[4] = rp->bottom != RGN_STOP ? rp->bottom : CW(RGN_STOP - 1); + r2[4] = rp->bottom != RGN_STOP ? rp->bottom : BigEndianValue(RGN_STOP - 1); r2[5] = rp->left; - r2[6] = rp->right != RGN_STOP ? rp->right : CW(RGN_STOP - 1); + r2[6] = rp->right != RGN_STOP ? rp->right : BigEndianValue(RGN_STOP - 1); r2[7] = RGN_STOP_X; r2[8] = RGN_STOP_X; ipr2 = r2; @@ -843,23 +844,23 @@ A4(PRIVATE, void, binop, optype, op, RgnHandle, srcrgn1, RgnHandle, srcrgn2, *src1ep = *src2ep = *sectsegep = *sectcurep = *freeep = *(src1ep+1) = *(src2ep+1) = RGN_STOP; - v1 = CW(*ipr1++); - v2 = CW(*ipr2++); + v1 = BigEndianValue(*ipr1++); + v2 = BigEndianValue(*ipr2++); while (v1 != RGN_STOP || v2 != RGN_STOP) { if (v1 < v2) { merge(ipr1, src1ep, freeep) /* no semi ... macro */ vx = v1; - v1 = CW(*ipr1++); + v1 = BigEndianValue(*ipr1++); } else if (v2 < v1) { merge(ipr2, src2ep, freeep) vx = v2; - v2 = CW(*ipr2++); + v2 = BigEndianValue(*ipr2++); } else { /* equal */ merge(ipr1, src1ep, freeep) merge(ipr2, src2ep, freeep) vx = v1; - v1 = CW(*ipr1++); - v2 = CW(*ipr2++); + v1 = BigEndianValue(*ipr1++); + v2 = BigEndianValue(*ipr2++); } switch (op) { case sectop: @@ -877,7 +878,7 @@ A4(PRIVATE, void, binop, optype, op, RgnHandle, srcrgn1, RgnHandle, srcrgn2, *tptr++ = RGN_STOP_X; gui_assert(sizeof(INTEGER) * (tptr - temppoints) <= 2 * (Hx(srcrgn1, rgnSize) + Hx(srcrgn2, rgnSize) + 18 * sizeof(INTEGER))); - HxX(dstrgn, rgnSize) = CW(RGN_SMALL_SIZE + sizeof(INTEGER) * (tptr - temppoints)); + HxX(dstrgn, rgnSize) = BigEndianValue(RGN_SMALL_SIZE + sizeof(INTEGER) * (tptr - temppoints)); /* TODO fix rgnBBox here */ ReallocHandle((Handle) dstrgn, RGN_SMALL_SIZE + sizeof(INTEGER) * (tptr - temppoints)); @@ -908,7 +909,7 @@ Executor::nonspecial_rgn_to_special_rgn (const INTEGER *src, INTEGER *dst) INTEGER *next_prev; /* Fetch the first X on this new scanline. */ - srcx = CW (src[1]); + srcx = BigEndianValue (src[1]); if (srcx == RGN_STOP) { /* The row with which to XOR is empty, so just extend the @@ -927,8 +928,8 @@ Executor::nonspecial_rgn_to_special_rgn (const INTEGER *src, INTEGER *dst) prevx = prev[1]; if (prevx == RGN_STOP) { - for (; (dst[1] = CW (src[1])) != RGN_STOP; src += 2, dst += 2) - dst[2] = CW (src[2]); + for (; (dst[1] = BigEndianValue (src[1])) != RGN_STOP; src += 2, dst += 2) + dst[2] = BigEndianValue (src[2]); src += 2; dst += 2; prev = next_prev; @@ -953,7 +954,7 @@ Executor::nonspecial_rgn_to_special_rgn (const INTEGER *src, INTEGER *dst) if (srcx < prevx) { *dst++ = srcx; - srcx = CW (*src++); + srcx = BigEndianValue (*src++); if (srcx == RGN_STOP) goto read_prev_only; } @@ -966,7 +967,7 @@ Executor::nonspecial_rgn_to_special_rgn (const INTEGER *src, INTEGER *dst) } else /* srcx == prevx */ { - srcx = CW (*src++); + srcx = BigEndianValue (*src++); prevx = *prev++; if (srcx == RGN_STOP) goto read_prev_only; @@ -993,7 +994,7 @@ Executor::nonspecial_rgn_to_special_rgn (const INTEGER *src, INTEGER *dst) while (srcx != RGN_STOP) { *dst++ = srcx; - srcx = CW (*src++); + srcx = BigEndianValue (*src++); } do_next: @@ -1016,10 +1017,10 @@ static INTEGER npairs; #define DECL void rhtopandinseth(RgnHandle rh, INTEGER *p, register INTEGER dh) #define STATEDECL SignedByte state; -#define SETIO ip = &HxX(rh, rgnSize) + 5; op = p; y = CW(*ip++); npairs = 0; \ +#define SETIO ip = &HxX(rh, rgnSize) + 5; op = p; y = BigEndianValue(*ip++); npairs = 0; \ state = HGetState((Handle) rh); \ HLock((Handle) rh) -#define NEXTPAIR (x = CW(*ip++)) == RGN_STOP ? (y = CW(*ip++), 0) : 1 +#define NEXTPAIR (x = BigEndianValue(*ip++)) == RGN_STOP ? (y = BigEndianValue(*ip++), 0) : 1 #define INCLXY(x, y) *op++ = y, *op++ = x, npairs++ #define UNSETIO HSetState((Handle) rh, state); INCLXY(RGN_STOP, RGN_STOP) @@ -1103,16 +1104,16 @@ A2(PRIVATE, void, ptorh, INTEGER *, p, RgnHandle, rh) op = RGN_DATA (rh); if (npairs) { /* decrement one 'cause of the 32767 sentinel */ - *op++ = CW(oy = *p); + *op++ = BigEndianValue(oy = *p); for (;npairs; npairs -= 2) { if ((y = *p++) != oy) { *op++ = RGN_STOP_X; - *op++ = CW(y); + *op++ = BigEndianValue(y); oy = y; } - *op++ = CW(*p++); + *op++ = BigEndianValue(*p++); ++p; /* if Cx((*ip)++ != oy) error! */ - *op++ = CW(*p++); + *op++ = BigEndianValue(*p++); } } *op++ = RGN_STOP_X; /* need one or two? */ @@ -1131,7 +1132,7 @@ P3(PUBLIC pascal trap, void, InsetRgn, RgnHandle, rh, INTEGER, dh, INTEGER, dv) #define INSANEBUTNECESSARY #if defined (INSANEBUTNECESSARY) rp = &RGN_BBOX (rh); - if (CW(rp->top) >= CW(rp->bottom) || CW(rp->left) >= CW(rp->right)) + if (BigEndianValue(rp->top) >= BigEndianValue(rp->bottom) || BigEndianValue(rp->left) >= BigEndianValue(rp->right)) RECT_ZERO (rp); #endif /* INSANEBUTNECESSARY */ } else { @@ -1158,10 +1159,10 @@ justone (const Rect *rp, RgnHandle rgn, RgnHandle dest) { const Rect *rp2 = &RGN_BBOX (rgn); - if ( CW (rp->left) <= CW (rp2->left) - && CW (rp->top) <= CW (rp2->top) - && CW (rp->right) >= CW (rp2->right) - && CW (rp->bottom) >= CW (rp2->bottom)) + if ( BigEndianValue (rp->left) <= BigEndianValue (rp2->left) + && BigEndianValue (rp->top) <= BigEndianValue (rp2->top) + && BigEndianValue (rp->right) >= BigEndianValue (rp2->right) + && BigEndianValue (rp->bottom) >= BigEndianValue (rp2->bottom)) { CopyRgn (rgn, dest); return TRUE; @@ -1251,7 +1252,7 @@ P3(PUBLIC pascal trap, void, XorRgn, RgnHandle, s1, RgnHandle, s2, if (RGN_SMALL_P (s1)) { temp2.p = (RgnPtr) ALLOCA( RGN_SMALL_SIZE + 9 * sizeof(INTEGER) ); #if 0 - BlockMove(CL(*(Ptr *) s1), (Ptr) temp2.p, RGN_SMALL_SIZE); + BlockMove(BigEndianValue(*(Ptr *) s1), (Ptr) temp2.p, RGN_SMALL_SIZE); #else memcpy((Ptr) temp2.p, MR(*(Ptr *) s1), RGN_SMALL_SIZE); #endif @@ -1273,7 +1274,7 @@ P3(PUBLIC pascal trap, void, XorRgn, RgnHandle, s1, RgnHandle, s2, if (RGN_SMALL_P (s2)) { temp3.p = (RgnPtr) ALLOCA (RGN_SMALL_SIZE + 9 * sizeof (INTEGER)); #if 0 - BlockMove(CL(*(Ptr *) s2), (Ptr) temp3.p, RGN_SMALL_SIZE); + BlockMove(BigEndianValue(*(Ptr *) s2), (Ptr) temp3.p, RGN_SMALL_SIZE); #else memcpy((Ptr) temp3.p, STARH (s2), RGN_SMALL_SIZE); #endif @@ -1297,73 +1298,73 @@ P3(PUBLIC pascal trap, void, XorRgn, RgnHandle, s1, RgnHandle, s2, op = RGN_DATA (dest); left = RGN_STOP; right = -32768; bottom = -32768; - for (y1 = CW(*ip1++), y2 = CW(*ip2++); y1 != RGN_STOP || y2 != RGN_STOP;) { + for (y1 = BigEndianValue(*ip1++), y2 = BigEndianValue(*ip2++); y1 != RGN_STOP || y2 != RGN_STOP;) { if (y1 < y2) { bottom = y1; - *op++ = CW(y1); + *op++ = BigEndianValue(y1); while ((*op++ = *ip1++) != RGN_STOP_X) { - x1 = CW(op[-1]); + x1 = BigEndianValue(op[-1]); if (x1 < left) left = x1; if (x1 > right) right = x1; } - y1 = CW(*ip1++); + y1 = BigEndianValue(*ip1++); } else if (y2 < y1) { bottom = y2; - *op++ = CW(y2); + *op++ = BigEndianValue(y2); while ((*op++ = *ip2++) != RGN_STOP_X) { - x2 = CW(op[-1]); + x2 = BigEndianValue(op[-1]); if (x2 < left) left = x2; if (x2 > right) right = x2; } - y2 = CW(*ip2++); + y2 = BigEndianValue(*ip2++); } else { cnt = 0; - for (x1 = CW(*ip1++), x2 = CW(*ip2++); + for (x1 = BigEndianValue(*ip1++), x2 = BigEndianValue(*ip2++); x1 != RGN_STOP || x2 != RGN_STOP;) { if (x1 < x2) { if (!cnt) { bottom = y1; - *op++ = CW(y1); + *op++ = BigEndianValue(y1); if (x1 < left) left = x1; } else if (x1 > right) right = x1; - *op++ = CW(x1); + *op++ = BigEndianValue(x1); cnt++; - x1 = CW(*ip1++); + x1 = BigEndianValue(*ip1++); } else if (x2 < x1) { if (!cnt) { bottom = y1; - *op++ = CW(y1); + *op++ = BigEndianValue(y1); if (x2 < left) left = x2; } else if (x2 > right) right = x2; - *op++ = CW(x2); + *op++ = BigEndianValue(x2); cnt++; - x2 = CW(*ip2++); + x2 = BigEndianValue(*ip2++); } else { - x1 = CW(*ip1++); - x2 = CW(*ip2++); + x1 = BigEndianValue(*ip1++); + x2 = BigEndianValue(*ip2++); } } if (cnt) *op++ = RGN_STOP_X; - y1 = CW(*ip1++); - y2 = CW(*ip2++); + y1 = BigEndianValue(*ip1++); + y2 = BigEndianValue(*ip2++); } } *op++ = RGN_STOP_X; HASSIGN_5 (dest, rgnBBox.top, *RGN_DATA (dest), - rgnBBox.left, CW (left), - rgnBBox.bottom, CW (bottom), - rgnBBox.right, CW (right), - rgnSize, CW ((char *) op - (char *) STARH (dest))); + rgnBBox.left, BigEndianValue (left), + rgnBBox.bottom, BigEndianValue (bottom), + rgnBBox.right, BigEndianValue (right), + rgnSize, BigEndianValue ((char *) op - (char *) STARH (dest))); if (rgn_is_rect_p (dest)) RGN_SET_SMALL (dest); if (finalrestingplace) { @@ -1428,7 +1429,7 @@ A1(PUBLIC, void, ROMlib_printrgn, RgnHandle, h) if (!RGN_SMALL_P (h)) { ip = RGN_DATA (h); - while ((y = CW (*ip++)) != RGN_STOP) + while ((y = BigEndianValue (*ip++)) != RGN_STOP) { printf ("%ld:", (long) y); if (special) @@ -1438,7 +1439,7 @@ A1(PUBLIC, void, ROMlib_printrgn, RgnHandle, h) } else { - while ((x = CW (*ip++)) != RGN_STOP) + while ((x = BigEndianValue (*ip++)) != RGN_STOP) printf (" %ld", (long) x); } printf (" 32767\n"); diff --git a/src/qRegular.cpp b/src/qRegular.cpp index 30415c2f..33f0630b 100644 --- a/src/qRegular.cpp +++ b/src/qRegular.cpp @@ -19,6 +19,7 @@ char ROMlib_rcsid_qRegular[] = #include "rsys/wind.h" using namespace Executor; +using namespace ByteSwap; P1(PUBLIC pascal trap, void, FrameRect, Rect *, r) { @@ -87,8 +88,8 @@ rect_matches_control_item (WindowPtr w, Rect *rp) Rect r; r = CTL_RECT (c); - retval = ((CW (r.top) - CW (rp->top) == CW (rp->bottom) - CW (r.bottom)) && - (CW (r.left) - CW (rp->left) == CW (rp->right) - CW (r.right))); + retval = ((BigEndianValue (r.top) - BigEndianValue (rp->top) == BigEndianValue (rp->bottom) - BigEndianValue (r.bottom)) && + (BigEndianValue (r.left) - BigEndianValue (rp->left) == BigEndianValue (rp->right) - BigEndianValue (r.right))); } return retval; diff --git a/src/qScale.cpp b/src/qScale.cpp index 4b597e7a..652948d7 100644 --- a/src/qScale.cpp +++ b/src/qScale.cpp @@ -14,6 +14,7 @@ char ROMlib_rcsid_qScale[] = #include "rsys/cquick.h" using namespace Executor; +using namespace ByteSwap; /* This routine scales old_bitmap and stores the result in dst_bitmap. * The only field of dst_bitmap that needs to be valid on entry is @@ -59,8 +60,8 @@ Executor::scale_blt_bitmap (const blt_bitmap_t *src_bitmap, blt_bitmap_t *dst_bi src_rowbytes = BITMAP_ROWBYTES (src_bitmap); dst_row_base = (uint8 *) MR (dst_bitmap->baseAddr); src_base = (uint8 *) (MR (src_bitmap->baseAddr) - + ((CW (old_rect->top) - CW (src_bitmap->bounds.top)) * src_rowbytes)); - left_x = (CW (old_rect->left) - CW (src_bitmap->bounds.left)) << 16; + + ((BigEndianValue (old_rect->top) - BigEndianValue (src_bitmap->bounds.top)) * src_rowbytes)); + left_x = (BigEndianValue (old_rect->left) - BigEndianValue (src_bitmap->bounds.left)) << 16; old_v = -1; /* This macro expresses the main horizontal scaling loop. The bits @@ -189,6 +190,6 @@ Executor::scale_blt_bitmap (const blt_bitmap_t *src_bitmap, blt_bitmap_t *dst_bi (1 << log2_bits_per_pixel)); } - BITMAP_SET_ROWBYTES_X (dst_bitmap, CW (dst_rowbytes)); + BITMAP_SET_ROWBYTES_X (dst_bitmap, BigEndianValue (dst_rowbytes)); dst_bitmap->bounds = *new_rect; } diff --git a/src/qStdArc.cpp b/src/qStdArc.cpp index db15477c..2c84b1cf 100644 --- a/src/qStdArc.cpp +++ b/src/qStdArc.cpp @@ -19,6 +19,7 @@ char ROMlib_rcsid_qStdArc[] = #include "rsys/picture.h" using namespace Executor; +using namespace ByteSwap; #define returnhv(hh, vv) { ptp->h = hh; ptp->v = vv; return; } @@ -29,8 +30,8 @@ namespace Executor { A3(PRIVATE, void, getpoint, INTEGER, angle, Rect *, r, Point *, ptp) { - INTEGER left = CW(r->left), top = CW(r->top), - right = CW(r->right), bottom = CW(r->bottom); + INTEGER left = BigEndianValue(r->left), top = BigEndianValue(r->top), + right = BigEndianValue(r->right), bottom = BigEndianValue(r->bottom); INTEGER radh = (right - left) / 2, radv = (bottom - top) / 2; INTEGER centh = left + radh, @@ -67,11 +68,11 @@ A3(PRIVATE, void, getpoint, INTEGER, angle, Rect *, r, Point *, ptp) A3(PRIVATE, INTEGER, findwall, Rect *, r, INTEGER, h, INTEGER, v) { - if (v == CW(r->top)) /* the order of tests is important */ + if (v == BigEndianValue(r->top)) /* the order of tests is important */ return(RTop); /* don't change them if you don't see */ - else if (h == CW(r->right)) /* why */ + else if (h == BigEndianValue(r->right)) /* why */ return(RRight); - else if (v == CW(r->bottom)) + else if (v == BigEndianValue(r->bottom)) return(RBottom); else return(RLeft); @@ -80,8 +81,8 @@ A3(PRIVATE, INTEGER, findwall, Rect *, r, INTEGER, h, INTEGER, v) P4 (PUBLIC pascal trap, void, StdArc, GrafVerb, verb, Rect *, r, INTEGER, starta, INTEGER, arca) { - INTEGER left = CW(r->left), top = CW(r->top), - right = CW(r->right), bottom = CW(r->bottom); + INTEGER left = BigEndianValue(r->left), top = BigEndianValue(r->top), + right = BigEndianValue(r->right), bottom = BigEndianValue(r->bottom); INTEGER ewall; Point spt, ept; register INTEGER h, v; @@ -107,9 +108,9 @@ P4 (PUBLIC pascal trap, void, StdArc, GrafVerb, verb, Rect *, r, ROMlib_drawingverbrectpicupdate( verb, r ); PICOP(OP_frameArc + (int) verb); PICWRITE(r, sizeof(*r)); - swappedstarta = CW(starta); + swappedstarta = BigEndianValue(starta); PICWRITE(&swappedstarta, sizeof(swappedstarta)); - swappedarca = CW(arca); + swappedarca = BigEndianValue(arca); PICWRITE(&swappedarca, sizeof(swappedarca)); }); diff --git a/src/qStdBits.cpp b/src/qStdBits.cpp index 0aebefcc..a98b5395 100644 --- a/src/qStdBits.cpp +++ b/src/qStdBits.cpp @@ -28,6 +28,7 @@ char ROMlib_rcsid_qStdBits[] = #include "rsys/tempalloc.h" using namespace Executor; +using namespace ByteSwap; static void ROMlib_real_copy_bits (PixMap *src, PixMap *dst, const Rect *src_rect, const Rect *dst_rect, @@ -37,10 +38,10 @@ static boolean_t src_dst_overlap_and_dst_below_src_p (const Rect *srcr, const Rect *dstr, int dh, int dv) { - if ( (CW (dstr->top)) < (CW (srcr->bottom) + dv) - && (CW (srcr->top) + dv) <= (CW (dstr->top)) - && (CW (srcr->left) + dh) < (CW (dstr->right)) - && (CW (dstr->left)) < (CW (srcr->right) + dh)) + if ( (BigEndianValue (dstr->top)) < (BigEndianValue (srcr->bottom) + dv) + && (BigEndianValue (srcr->top) + dv) <= (BigEndianValue (dstr->top)) + && (BigEndianValue (srcr->left) + dh) < (BigEndianValue (dstr->right)) + && (BigEndianValue (dstr->left)) < (BigEndianValue (srcr->right) + dh)) return TRUE; else return FALSE; @@ -50,7 +51,7 @@ static inline boolean_t dy_zero_p (const Rect *srcr, const Rect *dstr, int dh, int dv) { - return (CW (srcr->top) + dv) == CW (dstr->top); + return (BigEndianValue (srcr->top) + dv) == BigEndianValue (dstr->top); } void @@ -89,8 +90,8 @@ void Executor::canonicalize_bogo_map (BitMap *bogo_map, PixMap **canonical_addr, struct cleanup_info *info) { - int high_bits = ((unsigned short) CW (bogo_map->rowBytes)) >> 14; - int low_bit = ((unsigned short) CW (bogo_map->rowBytes)) & 1; + int high_bits = ((unsigned short) BigEndianValue (bogo_map->rowBytes)) >> 14; + int low_bit = ((unsigned short) BigEndianValue (bogo_map->rowBytes)) & 1; switch (high_bits) { @@ -198,7 +199,7 @@ Executor::canonicalize_bogo_map (BitMap *bogo_map, PixMap **canonical_addr, } #if !defined (NDEBUG) if ( (RECT_WIDTH (&BITMAP_BOUNDS (*canonical_addr)) - * CW ((*canonical_addr)->pixelSize) + * BigEndianValue ((*canonical_addr)->pixelSize) / 8) > BITMAP_ROWBYTES (*canonical_addr)) warning_unexpected ("unlikely map"); @@ -248,7 +249,7 @@ write_copybits_picdata (PixMap *src, PixMap *dst, } row_bytes = BITMAP_ROWBYTES (src); - pixel_size = CW (src->pixelSize); + pixel_size = BigEndianValue (src->pixelSize); direct_bits_p = (pixel_size == 16 || pixel_size == 32); if (pixel_size == 32) @@ -307,7 +308,7 @@ write_copybits_picdata (PixMap *src, PixMap *dst, PICWRITE (&zero, sizeof zero); PICWRITE (&ctab->ctFlags, sizeof ctab->ctFlags); PICWRITE (&ctab->ctSize, sizeof ctab->ctSize); - for (i = 0; i <= CW (ctab->ctSize); i ++) + for (i = 0; i <= BigEndianValue (ctab->ctSize); i ++) { ColorSpec *elt; @@ -320,7 +321,7 @@ write_copybits_picdata (PixMap *src, PixMap *dst, PICWRITE (src_rect, sizeof *src_rect); PICWRITE (dst_rect, sizeof *dst_rect); - swapped_mode = CW (mode); + swapped_mode = BigEndianValue (mode); PICWRITE (&swapped_mode, sizeof swapped_mode); if (mask) { @@ -390,7 +391,7 @@ write_copybits_picdata (PixMap *src, PixMap *dst, ip.p = MR (ip.p); count = op.p - (Ptr) packed_line; parity += count + countsize; - swappedcount = CW (count); + swappedcount = BigEndianValue (count); PICWRITE (countloc, countsize); PICWRITE (packed_line, count); } @@ -414,8 +415,8 @@ Executor::ROMlib_bogo_stdbits (BitMap *src_bogo_map, BitMap *dst_bogo_map, struct cleanup_info cleanup_info[2]; - if (CW (dst_rect->bottom) <= CW (dst_rect->top) - || CW (dst_rect->right) <= CW (dst_rect->left) + if (BigEndianValue (dst_rect->bottom) <= BigEndianValue (dst_rect->top) + || BigEndianValue (dst_rect->right) <= BigEndianValue (dst_rect->left) || (mask && !SectRect (dst_rect, &HxX (mask, rgnBBox), &dummy_rect))) return; @@ -466,8 +467,8 @@ Executor::StdBitsPicSaveFlag (BitMap *src_bogo_map, struct cleanup_info cleanup_info[2]; - if (CW (dst_rect->bottom) <= CW (dst_rect->top) - || CW (dst_rect->right) <= CW (dst_rect->left) + if (BigEndianValue (dst_rect->bottom) <= BigEndianValue (dst_rect->top) + || BigEndianValue (dst_rect->right) <= BigEndianValue (dst_rect->left) || (mask && !SectRect (dst_rect, &HxX (mask, rgnBBox), &dummy_rect))) return; @@ -555,7 +556,7 @@ ROMlib_real_copy_bits_helper (PixMap *src, PixMap *dst, #endif dst_rgb_spec = pixmap_rgb_spec (dst); - dst_depth = CW (dst->pixelSize); + dst_depth = BigEndianValue (dst->pixelSize); switch (dst_depth) { @@ -573,7 +574,7 @@ ROMlib_real_copy_bits_helper (PixMap *src, PixMap *dst, conversion on the src, so it matches that of the depth */ if (src->pixelSize != dst->pixelSize || (src->pmTable != dst->pmTable && - (CW (src->pixelSize) < 16 + (BigEndianValue (src->pixelSize) < 16 && (CTAB_SEED_X (MR (src->pmTable)) /* we assume the destination has the same color table as the current graphics device */ @@ -596,7 +597,7 @@ ROMlib_real_copy_bits_helper (PixMap *src, PixMap *dst, } #endif /* SAVE_CURSOR */ - src_depth = CW (src->pixelSize); + src_depth = BigEndianValue (src->pixelSize); switch (src_depth) { @@ -614,25 +615,25 @@ ROMlib_real_copy_bits_helper (PixMap *src, PixMap *dst, coordinates; and round down (up) to the byte boundary, and re-translate to boundary-relative bitmap coords */ widened_src_rect->left - = CW (((CW (src_rect->left) - CW (src->bounds.left)) + = BigEndianValue (((BigEndianValue (src_rect->left) - BigEndianValue (src->bounds.left)) & ~src_sub_byte_bits) - + CW (src->bounds.left)); + + BigEndianValue (src->bounds.left)); widened_src_rect->right - = CW ((((CW (src_rect->right) - CW (src->bounds.left)) + = BigEndianValue ((((BigEndianValue (src_rect->right) - BigEndianValue (src->bounds.left)) + src_sub_byte_bits) - & ~src_sub_byte_bits) + CW (src->bounds.left)); + & ~src_sub_byte_bits) + BigEndianValue (src->bounds.left)); /* the new_src should `be a pixmap' (have the pixmap bits set in the rowBytes) only if the dst is a pixmap; convert_pixmap does different things if the destination is a bitmap */ new_src->rowBytes = ( PIXMAP_DEFAULT_ROW_BYTES_X - | CW ((((RECT_WIDTH (widened_src_rect) + | BigEndianValue ((((RECT_WIDTH (widened_src_rect) * dst_depth) + 31) / 32) * 4)); /* Allocate temporary storage for the new_src_bits bitmap. */ n_bytes_needed = (BITMAP_ROWBYTES (new_src) - * (CW (src_rect->bottom) - CW (src_rect->top))); + * (BigEndianValue (src_rect->bottom) - BigEndianValue (src_rect->top))); TEMP_ALLOC_ALLOCATE (new_src_bits, temp_depth_bits, n_bytes_needed); new_src->baseAddr = (Ptr)RM (new_src_bits); @@ -670,7 +671,7 @@ ROMlib_real_copy_bits_helper (PixMap *src, PixMap *dst, new_src_row_bytes = (((RECT_WIDTH (dst_rect) * dst_depth + /* dst_sub_byte_bits */ 7) / 8) + 3) & ~3; - new_src->rowBytes = CW (new_src_row_bytes) | PIXMAP_DEFAULT_ROW_BYTES_X; + new_src->rowBytes = BigEndianValue (new_src_row_bytes) | PIXMAP_DEFAULT_ROW_BYTES_X; TEMP_ALLOC_ALLOCATE (scale_base, temp_scale_bits, new_src_row_bytes * RECT_HEIGHT (dst_rect)); @@ -702,12 +703,12 @@ ROMlib_real_copy_bits_helper (PixMap *src, PixMap *dst, if (src->baseAddr == dst->baseAddr && (src_dst_overlap_and_dst_below_src_p (src_rect, dst_rect, - CW (dst->bounds.left) - CW (src->bounds.left), - CW (dst->bounds.top) - CW (src->bounds.top))) + BigEndianValue (dst->bounds.left) - BigEndianValue (src->bounds.left), + BigEndianValue (dst->bounds.top) - BigEndianValue (src->bounds.top))) && (! RGN_SMALL_P (mask_region) || dy_zero_p (src_rect, dst_rect, - CW (dst->bounds.left) - CW (src->bounds.left), - CW (dst->bounds.top) - CW (src->bounds.top)))) + BigEndianValue (dst->bounds.left) - BigEndianValue (src->bounds.left), + BigEndianValue (dst->bounds.top) - BigEndianValue (src->bounds.top)))) { PixMap *new_src; void *overlap_bits; @@ -731,10 +732,10 @@ ROMlib_real_copy_bits_helper (PixMap *src, PixMap *dst, SectRect (&src->bounds, src_rect, &clipped_src_rect); height = RECT_HEIGHT (&clipped_src_rect); - offset = CW (clipped_src_rect.top) - CW (src_rect->top); + offset = BigEndianValue (clipped_src_rect.top) - BigEndianValue (src_rect->top); - copy_rect.top = CW (CW (src_rect->top) + offset); - copy_rect.bottom = CW (CW (src_rect->top) + offset + height); + copy_rect.top = BigEndianValue (BigEndianValue (src_rect->top) + offset); + copy_rect.bottom = BigEndianValue (BigEndianValue (src_rect->top) + offset + height); copy_rect.left = src->bounds.left; copy_rect.right = src->bounds.right; @@ -809,12 +810,12 @@ ROMlib_real_copy_bits (PixMap *src, PixMap *dst, { int default_nbits, new_nbits; - default_nbits = (RECT_WIDTH (src_rect) * CW (dst->pixelSize) * + default_nbits = (RECT_WIDTH (src_rect) * BigEndianValue (dst->pixelSize) * RECT_HEIGHT (src_rect)); - new_nbits = ((RECT_WIDTH (dst_rect) * CW (src->pixelSize) * + new_nbits = ((RECT_WIDTH (dst_rect) * BigEndianValue (src->pixelSize) * RECT_HEIGHT (dst_rect)) + - (RECT_WIDTH (dst_rect) * CW (dst->pixelSize) * + (RECT_WIDTH (dst_rect) * BigEndianValue (dst->pixelSize) * RECT_HEIGHT (dst_rect))); shrink_first_p = (new_nbits < default_nbits); } @@ -844,14 +845,14 @@ ROMlib_real_copy_bits (PixMap *src, PixMap *dst, #endif /* SAVE_CURSOR */ new_src = (PixMap *) alloca (sizeof *new_src); - src_depth = CW (src->pixelSize); + src_depth = BigEndianValue (src->pixelSize); temp_row_bytes = (RECT_WIDTH (dst_rect) * src_depth + 31) / 32 * 4; temp_bytes_needed = temp_row_bytes * RECT_HEIGHT (dst_rect); TEMP_ALLOC_ALLOCATE (temp_bits, temp_alloc_bits, temp_bytes_needed); *new_src = *src; new_src->baseAddr = (Ptr)RM (temp_bits); - new_src->rowBytes = CW (temp_row_bytes | PIXMAP_DEFAULT_ROWBYTES); + new_src->rowBytes = BigEndianValue (temp_row_bytes | PIXMAP_DEFAULT_ROWBYTES); new_src->bounds = *dst_rect; scale_blt_bitmap ((blt_bitmap_t *) src, (blt_bitmap_t *) new_src, diff --git a/src/qStdLine.cpp b/src/qStdLine.cpp index 16cc28e8..aab083d8 100644 --- a/src/qStdLine.cpp +++ b/src/qStdLine.cpp @@ -19,6 +19,7 @@ char ROMlib_rcsid_qStdLine[] = #include "rsys/picture.h" using namespace Executor; +using namespace ByteSwap; /* * eight scan convert routines... all very similar. @@ -84,9 +85,9 @@ A8(PRIVATE, void, scodydxx1x2, register LONGINT, y1, register INTEGER, x1, *opp2 = op2; } -#define OUT2(y, x1, x2) (*op++ = CW(y), \ - *op++ = CW(x1), \ - *op++ = CW(x2), \ +#define OUT2(y, x1, x2) (*op++ = BigEndianValue(y), \ + *op++ = BigEndianValue(x1), \ + *op++ = BigEndianValue(x2), \ *op++ = RGNSTOPX) A5(PRIVATE, INTEGER *, scrdydxx1x2, register LONGINT, y1, register INTEGER, x1, @@ -205,7 +206,7 @@ A5(PRIVATE, INTEGER *, scrdxdyx1x2, register INTEGER, y1, register LONGINT, x1, OUT2(y1++, x1 >> 16, ox); ox = x1 >> 16; } - op[-3] = CW(x2-1); + op[-3] = BigEndianValue(x2-1); return op; } @@ -275,7 +276,7 @@ A3(PRIVATE, void, regionify1, register INTEGER *, ip1, if (y1 < y2) { x1 = *ip1++; gui_assert(x1 < x2 || (x1 == 32767 && x2 == 32767)); - *op++ = CW(y1); + *op++ = BigEndianValue(y1); *op++ = x1; if (x1 == 32767) /*-->*/ break; @@ -285,7 +286,7 @@ A3(PRIVATE, void, regionify1, register INTEGER *, ip1, } else if (y1 > y2) { x2 = *ip2++; gui_assert(x1 < x2 || (x1 == 32767 && x2 == 32767)); - *op++ = CW(y2); + *op++ = BigEndianValue(y2); *op++ = x1; if (x1 == 32767) /*-->*/ break; @@ -298,7 +299,7 @@ A3(PRIVATE, void, regionify1, register INTEGER *, ip1, x1 = *ip1++; x2 = *ip2++; gui_assert(x1 < x2 || (x1 == 32767 && x2 == 32767)); - *op++ = CW(y1); + *op++ = BigEndianValue(y1); *op++ = x1; if (x1 == 32767) /*-->*/ break; @@ -309,7 +310,7 @@ A3(PRIVATE, void, regionify1, register INTEGER *, ip1, } } *op++ = CWC(32767); - rp->rgnSize = CW(-32768 + (op - (INTEGER *) rp) * sizeof(INTEGER)); + rp->rgnSize = BigEndianValue(-32768 + (op - (INTEGER *) rp) * sizeof(INTEGER)); } #define SWAP std::swap @@ -331,13 +332,13 @@ P1(PUBLIC pascal trap, void, StdLine, Point, p) PAUSEDECL; r32767 = 32767; - x1 = CW (PORT_PEN_LOC (thePort).h); - y1 = CW (PORT_PEN_LOC (thePort).v); + x1 = BigEndianValue (PORT_PEN_LOC (thePort).h); + y1 = BigEndianValue (PORT_PEN_LOC (thePort).v); x2 = p.h; y2 = p.v; - px = CW (PORT_PEN_SIZE (thePort).h); - py = CW (PORT_PEN_SIZE (thePort).v); + px = BigEndianValue (PORT_PEN_SIZE (thePort).h); + py = BigEndianValue (PORT_PEN_SIZE (thePort).v); if (PORT_POLY_SAVE_X (thePort) && (x1 != x2 || y1 != y2)) { ph = (PolyHandle) PORT_POLY_SAVE (thePort); @@ -345,16 +346,16 @@ P1(PUBLIC pascal trap, void, StdLine, Point, p) if (psize == SMALLPOLY) { SetHandleSize((Handle) ph, psize + 2 * sizeof(Point)); oip = (INTEGER *)((char *) STARH(ph) + psize); - *oip++ = CW(y1); - *oip++ = CW(x1); - HxX(ph, polySize) = CW(Hx(ph, polySize) + 2 * sizeof(Point)); + *oip++ = BigEndianValue(y1); + *oip++ = BigEndianValue(x1); + HxX(ph, polySize) = BigEndianValue(Hx(ph, polySize) + 2 * sizeof(Point)); } else { SetHandleSize((Handle) ph, psize + sizeof(Point)); oip = (INTEGER *)((char *) STARH(ph) + psize); - HxX(ph, polySize) = CW(Hx(ph, polySize) + sizeof(Point)); + HxX(ph, polySize) = BigEndianValue(Hx(ph, polySize) + sizeof(Point)); } - *oip++ = CW(y2); - *oip++ = CW(x2); + *oip++ = BigEndianValue(y2); + *oip++ = BigEndianValue(x2); } PIC_SAVE_EXCURSION @@ -362,8 +363,8 @@ P1(PUBLIC pascal trap, void, StdLine, Point, p) ROMlib_drawingpicupdate(); PICOP(OP_Line); PICWRITE(&PORT_PEN_LOC (thePort), sizeof (PORT_PEN_LOC (thePort))); - swappedp.h = CW(p.h); - swappedp.v = CW(p.v); + swappedp.h = BigEndianValue(p.h); + swappedp.v = BigEndianValue(p.v); PICWRITE(&swappedp, sizeof(swappedp)); }) @@ -389,15 +390,15 @@ P1(PUBLIC pascal trap, void, StdLine, Point, p) } if (PORT_REGION_SAVE_X (thePort) && y1 == y2 && x1 != x2) { rp.p = (RgnPtr) ALLOCA(SMALLRGN + 5 * sizeof(INTEGER)); - (rp.p)->rgnBBox.top = CW(y1); - (rp.p)->rgnBBox.left = CW(x1); - (rp.p)->rgnBBox.bottom = CW(y2); - (rp.p)->rgnBBox.right = CW(x1); + (rp.p)->rgnBBox.top = BigEndianValue(y1); + (rp.p)->rgnBBox.left = BigEndianValue(x1); + (rp.p)->rgnBBox.bottom = BigEndianValue(y2); + (rp.p)->rgnBBox.right = BigEndianValue(x1); (rp.p)->rgnSize = CWC(SMALLRGN + 5 * sizeof(INTEGER)); oip = (INTEGER *) ((char *)rp.p + SMALLRGN); - *oip++ = CW(y1); - *oip++ = CW(x1); - *oip++ = CW(x2); + *oip++ = BigEndianValue(y1); + *oip++ = BigEndianValue(x1); + *oip++ = BigEndianValue(x2); *oip++ = RGNSTOPX; *oip++ = RGNSTOPX; rp.p = RM(rp.p); @@ -419,10 +420,10 @@ P1(PUBLIC pascal trap, void, StdLine, Point, p) /* size allocated below is overkill */ rp.p = (RgnPtr) ALLOCA(SMALLRGN + (dy + 1) * sizeof(INTEGER) * 6 + sizeof(INTEGER)); - (rp.p)->rgnBBox.top = CW(y1); - (rp.p)->rgnBBox.left = CW(MIN(x1, x2)); - (rp.p)->rgnBBox.bottom = CW(y2); - (rp.p)->rgnBBox.right = CW(MAX(x1, x2)); + (rp.p)->rgnBBox.top = BigEndianValue(y1); + (rp.p)->rgnBBox.left = BigEndianValue(MIN(x1, x2)); + (rp.p)->rgnBBox.bottom = BigEndianValue(y2); + (rp.p)->rgnBBox.right = BigEndianValue(MAX(x1, x2)); if (dy >= dx) if (x2 > x1) @@ -435,7 +436,7 @@ P1(PUBLIC pascal trap, void, StdLine, Point, p) else op = scrdxdyx1x2(y1, x1+1, dy, dx, (INTEGER *)rp.p + 5); *op++ = RGNSTOPX; - (rp.p)->rgnSize = CW((char *) op - (char *) rp.p); + (rp.p)->rgnSize = BigEndianValue((char *) op - (char *) rp.p); rp.p = RM(rp.p); XorRgn (&rp, (RgnHandle) PORT_REGION_SAVE (thePort), @@ -450,10 +451,10 @@ P1(PUBLIC pascal trap, void, StdLine, Point, p) rp.p = (RgnPtr) ALLOCA(SMALLRGN + (dy + py + 1) * sizeof(LONGINT) * 4 + 3 * 2 * sizeof(LONGINT)); /* Cx(rp->rgnSize) gets filled in later */ - (rp.p)->rgnBBox.top = CW(y1); - (rp.p)->rgnBBox.left = CW(MIN(x1, x2)); - (rp.p)->rgnBBox.bottom = CW(y2 + py); - (rp.p)->rgnBBox.right = CW(MAX(x1, x2) + px); + (rp.p)->rgnBBox.top = BigEndianValue(y1); + (rp.p)->rgnBBox.left = BigEndianValue(MIN(x1, x2)); + (rp.p)->rgnBBox.bottom = BigEndianValue(y2 + py); + (rp.p)->rgnBBox.right = BigEndianValue(MAX(x1, x2) + px); op = destpoints = (INTEGER *) ALLOCA(MAXNPOINTS(dy) * sizeof(INTEGER)); op2 = destpoints2 = (INTEGER *) ALLOCA(MAXNPOINTS(dy) * sizeof(INTEGER)); diff --git a/src/qStdOval.cpp b/src/qStdOval.cpp index 3de85414..3a337483 100644 --- a/src/qStdOval.cpp +++ b/src/qStdOval.cpp @@ -17,6 +17,7 @@ char ROMlib_rcsid_qStdOval[] = #include "rsys/picture.h" using namespace Executor; +using namespace ByteSwap; P2(PUBLIC pascal trap, void, StdOval, GrafVerb, v, Rect *, rp) { @@ -33,8 +34,8 @@ P2(PUBLIC pascal trap, void, StdOval, GrafVerb, v, Rect *, rp) }); PAUSERECORDING; - if (CW(rp->bottom) - CW(rp->top) < 4 && - CW(rp->right) - CW(rp->left) < 4) + if (BigEndianValue(rp->bottom) - BigEndianValue(rp->top) < 4 && + BigEndianValue(rp->right) - BigEndianValue(rp->left) < 4) StdRect(v, rp); else { rh = ROMlib_circrgn(rp); @@ -46,11 +47,11 @@ P2(PUBLIC pascal trap, void, StdOval, GrafVerb, v, Rect *, rp) (RgnHandle) PORT_REGION_SAVE (thePort)); if (PORT_PEN_VIS (thePort) >= 0) { - r.top = CW (CW (rp->top) + CW (PORT_PEN_SIZE (thePort).v)); - r.left = CW (CW (rp->left) + CW (PORT_PEN_SIZE (thePort).h)); - r.bottom = CW (CW (rp->bottom) - CW (PORT_PEN_SIZE (thePort).v)); - r.right = CW (CW (rp->right) - CW (PORT_PEN_SIZE (thePort).h)); - if (CW (r.top) < CW (r.bottom) && CW (r.left) < CW (r.right)) + r.top = BigEndianValue (BigEndianValue (rp->top) + BigEndianValue (PORT_PEN_SIZE (thePort).v)); + r.left = BigEndianValue (BigEndianValue (rp->left) + BigEndianValue (PORT_PEN_SIZE (thePort).h)); + r.bottom = BigEndianValue (BigEndianValue (rp->bottom) - BigEndianValue (PORT_PEN_SIZE (thePort).v)); + r.right = BigEndianValue (BigEndianValue (rp->right) - BigEndianValue (PORT_PEN_SIZE (thePort).h)); + if (BigEndianValue (r.top) < BigEndianValue (r.bottom) && BigEndianValue (r.left) < BigEndianValue (r.right)) { rh2 = ROMlib_circrgn(&r); XorRgn(rh, rh2, rh); diff --git a/src/qStdPic.cpp b/src/qStdPic.cpp index 150675a7..e2b1d11b 100644 --- a/src/qStdPic.cpp +++ b/src/qStdPic.cpp @@ -20,6 +20,7 @@ char ROMlib_rcsid_qStdPic[] = #include "rsys/text.h" using namespace Executor; +using namespace ByteSwap; P3(PUBLIC pascal trap, void, StdComment, INTEGER, kind, INTEGER, size, Handle, hand) @@ -37,11 +38,11 @@ P3(PUBLIC pascal trap, void, StdComment, INTEGER, kind, INTEGER, size, break; } - kind = CW(kind); + kind = BigEndianValue(kind); if (size) { PICSAVEBEGIN(OP_LongComment); PICWRITE(&kind, sizeof(kind)); - swappedsize = CW(size); + swappedsize = BigEndianValue(size); PICWRITE(&swappedsize, sizeof(swappedsize)); state = HGetState(hand); HLock(hand); @@ -75,16 +76,16 @@ P2(PUBLIC pascal trap, void, StdPutPic, Ptr, sp, INTEGER, bc) oldhowfar = Hx(pch, pichowfar); ph = HxP(pch, pichandle); newhowfar = Hx(pch, pichowfar) + bc; - HxX(pch, pichowfar) = CL(newhowfar); + HxX(pch, pichowfar) = BigEndianValue(newhowfar); if (newhowfar > 32766) HxX(ph, picSize) = CWC (32766); else - HxX(ph, picSize) = CW (newhowfar); + HxX(ph, picSize) = BigEndianValue (newhowfar); if (Hx(pch, pichowfar) > Hx(pch, picsize)) { newsize = (Hx(pch, pichowfar) + 0xFF) & ~(LONGINT) 0xFF; SetHandleSize((Handle) ph, newsize); - HxX(pch, picsize) = CL(newsize); + HxX(pch, picsize) = BigEndianValue(newsize); } memmove((char *) STARH(ph) + oldhowfar, sp, bc); } diff --git a/src/qStdPoly.cpp b/src/qStdPoly.cpp index 079dc9ef..8a8b3061 100644 --- a/src/qStdPoly.cpp +++ b/src/qStdPoly.cpp @@ -20,6 +20,7 @@ char ROMlib_rcsid_qStdPoly[] = #include "rsys/picture.h" using namespace Executor; +using namespace ByteSwap; namespace Executor { PRIVATE void polyrgn(PolyHandle, RgnHandle); @@ -37,16 +38,16 @@ A2(PRIVATE, void, polyrgn, PolyHandle, ph, RgnHandle, rh) ep = (Point *) ((char *) STARH(ph) + Hx(ph, polySize)); firstp.h = Hx(ph, polyPoints[0].h); firstp.v = Hx(ph, polyPoints[0].v); - if (CW(ep[-1].h) == firstp.h && CW(ep[-1].v) == firstp.v) + if (BigEndianValue(ep[-1].h) == firstp.h && BigEndianValue(ep[-1].v) == firstp.v) ep--; tmpvis = PORT_PEN_VIS_X (thePort); PORT_PEN_VIS_X (thePort) = CWC (0); OpenRgn(); - MoveTo(CW(pp->h), CW(pp->v)); + MoveTo(BigEndianValue(pp->h), BigEndianValue(pp->v)); pp++; while (pp != ep) { - LineTo(CW(pp->h), CW(pp->v)); + LineTo(BigEndianValue(pp->h), BigEndianValue(pp->v)); pp++; } LineTo(firstp.h, firstp.v); @@ -91,13 +92,13 @@ P2(PUBLIC pascal trap, void, StdPoly, GrafVerb, verb, PolyHandle, ph) TRAPBEGIN (); pp = HxX(ph, polyPoints); ep = (Point *) ((char *) STARH(ph) + Hx(ph, polySize)); - firstp.h = CW(pp[0].h); - firstp.v = CW(pp[0].v); + firstp.h = BigEndianValue(pp[0].h); + firstp.v = BigEndianValue(pp[0].v); MoveTo (firstp.h, firstp.v); for (++pp; pp != ep; pp++) { - p.h = CW(pp[0].h); - p.v = CW(pp[0].v); + p.h = BigEndianValue(pp[0].h); + p.v = BigEndianValue(pp[0].v); StdLine(p); PORT_PEN_LOC (thePort) = pp[0]; } diff --git a/src/qStdRRect.cpp b/src/qStdRRect.cpp index bec54a85..c727d9cb 100644 --- a/src/qStdRRect.cpp +++ b/src/qStdRRect.cpp @@ -18,15 +18,16 @@ char ROMlib_rcsid_qStdRRect[] = #include "rsys/picture.h" using namespace Executor; +using namespace ByteSwap; #define TERM (*ip++ = RGNSTOPX) #define ADD4(y, x1, x2) \ - (*ip++ = CW((y)), *ip++ = CW((x1)), *ip++ = CW((x2)), TERM) + (*ip++ = BigEndianValue((y)), *ip++ = BigEndianValue((x1)), *ip++ = BigEndianValue((x2)), TERM) #define ADD6(y, x1, x2, x3, x4) \ - (*ip++ = CW((y)), *ip++ = CW((x1)), *ip++ = CW((x2)), \ - *ip++ = CW((x3)), *ip++ = CW((x4)), TERM) + (*ip++ = BigEndianValue((y)), *ip++ = BigEndianValue((x1)), *ip++ = BigEndianValue((x2)), \ + *ip++ = BigEndianValue((x3)), *ip++ = BigEndianValue((x4)), TERM) A1(PUBLIC, RgnHandle, ROMlib_circrgn, Rect *, r) /* INTERNAL */ { @@ -46,10 +47,10 @@ A1(PUBLIC, RgnHandle, ROMlib_circrgn, Rect *, r) /* INTERNAL */ ox = 0; #endif /* LETGCCWAIL */ - top = CW(r->top); - bottom = CW(r->bottom); + top = BigEndianValue(r->top); + bottom = BigEndianValue(r->bottom); dv = bottom - top; - dh = (right = CW(r->right)) - (left = CW(r->left)); + dh = (right = BigEndianValue(r->right)) - (left = BigEndianValue(r->left)); maxsize = 10 + (6 * dv + 1) * sizeof(INTEGER); rh = (RgnHandle) NewHandle(maxsize); @@ -74,7 +75,7 @@ A1(PUBLIC, RgnHandle, ROMlib_circrgn, Rect *, r) /* INTERNAL */ TERM; } } - HxX(rh, rgnSize) = CW((char *) ip - (char *) STARH(rh)); + HxX(rh, rgnSize) = BigEndianValue((char *) ip - (char *) STARH(rh)); SetHandleSize((Handle) rh, (Size) Hx(rh, rgnSize)); /*-->*/ return rh; } @@ -93,8 +94,8 @@ A1(PUBLIC, RgnHandle, ROMlib_circrgn, Rect *, r) /* INTERNAL */ rad = dv; } - centl = CW(r->left) + dh / 2; - centr = CW(r->left) + (dh + 1) / 2; + centl = BigEndianValue(r->left) + dh / 2; + centr = BigEndianValue(r->left) + (dh + 1) / 2; centt = top + dv / 2; first = TRUE; @@ -132,19 +133,19 @@ A1(PUBLIC, RgnHandle, ROMlib_circrgn, Rect *, r) /* INTERNAL */ else nx = savex / 2; if (first) { - *op++ = CW(top); - *op++ = CW(centl - nx); - *op++ = CW(centr + nx); + *op++ = BigEndianValue(top); + *op++ = BigEndianValue(centl - nx); + *op++ = BigEndianValue(centr + nx); *op++ = RGNSTOPX; ox = nx; first = FALSE; } else { if (nx != ox) { - *op++ = CW(centt - oy); - *op++ = CW(centl - nx); - *op++ = CW(centl - ox); - *op++ = CW(centr + ox); - *op++ = CW(centr + nx); + *op++ = BigEndianValue(centt - oy); + *op++ = BigEndianValue(centl - nx); + *op++ = BigEndianValue(centl - ox); + *op++ = BigEndianValue(centr + ox); + *op++ = BigEndianValue(centr + nx); *op++ = RGNSTOPX; ox = nx; } @@ -160,7 +161,7 @@ A1(PUBLIC, RgnHandle, ROMlib_circrgn, Rect *, r) /* INTERNAL */ while (ip != ep && *ip != RGNSTOPX) ip -= 2; ip2 = ip + 1; - *op++ = CW(bottom - (CW(*ip2++) - top)); + *op++ = BigEndianValue(bottom - (BigEndianValue(*ip2++) - top)); while ((*op++ = *ip2++) != RGNSTOPX) ; } @@ -171,7 +172,7 @@ A1(PUBLIC, RgnHandle, ROMlib_circrgn, Rect *, r) /* INTERNAL */ SetEmptyRgn (rh); else { - HxX(rh, rgnSize) = CW(sizeof(INTEGER) * (op - (INTEGER *) STARH(rh))); + HxX(rh, rgnSize) = BigEndianValue(sizeof(INTEGER) * (op - (INTEGER *) STARH(rh))); SetHandleSize((Handle) rh, (Size) Hx(rh, rgnSize)); } @@ -193,8 +194,8 @@ P4(PUBLIC pascal trap, void, StdRRect, GrafVerb, verb, Rect *, r, PIC_SAVE_EXCURSION ({ - p.h = CW (width); - p.v = CW (height); + p.h = BigEndianValue (width); + p.v = BigEndianValue (height); ROMlib_drawingverbrectovalpicupdate (verb, r, &p); PICOP (OP_frameRRect + (int) verb); PICWRITE (r, sizeof(*r)); @@ -205,13 +206,13 @@ P4(PUBLIC pascal trap, void, StdRRect, GrafVerb, verb, Rect *, r, /*-->*/ return; PAUSERECORDING; - ovaldx = CW(r->right) - CW(r->left) - width; - ovaldy = CW(r->bottom) - CW(r->top) - height; + ovaldx = BigEndianValue(r->right) - BigEndianValue(r->left) - width; + ovaldy = BigEndianValue(r->bottom) - BigEndianValue(r->top) - height; if (width < 4 && height < 4) StdRect(verb, r); else { - rectdx = CW(r->right) - CW(r->left) - width/2; - rectdy = CW(r->bottom) - CW(r->top) - height/2; + rectdx = BigEndianValue(r->right) - BigEndianValue(r->left) - width/2; + rectdy = BigEndianValue(r->bottom) - BigEndianValue(r->top) - height/2; rh = NewRgn(); corner = NewRgn(); @@ -219,12 +220,12 @@ P4(PUBLIC pascal trap, void, StdRRect, GrafVerb, verb, Rect *, r, RectRgn(rh, r); - SetRect(&tempr, CW(r->left), CW(r->top), - CW(r->left)+width, CW(r->top)+height); + SetRect(&tempr, BigEndianValue(r->left), BigEndianValue(r->top), + BigEndianValue(r->left)+width, BigEndianValue(r->top)+height); oval = ROMlib_circrgn(&tempr); - SetRect(&tempr, CW(r->left), CW(r->top), - CW(r->left)+width/2, CW(r->top)+height/2); + SetRect(&tempr, BigEndianValue(r->left), BigEndianValue(r->top), + BigEndianValue(r->left)+width/2, BigEndianValue(r->top)+height/2); RectRgn(smallr, &tempr); DiffRgn(smallr, oval, corner); diff --git a/src/qStdRect.cpp b/src/qStdRect.cpp index 0e715c2c..6694cbaa 100644 --- a/src/qStdRect.cpp +++ b/src/qStdRect.cpp @@ -18,6 +18,7 @@ char ROMlib_rcsid_qStdRect[] = #include "rsys/picture.h" using namespace Executor; +using namespace ByteSwap; P2(PUBLIC pascal trap, void, StdRect, GrafVerb, v, Rect *, rp) { @@ -28,16 +29,16 @@ P2(PUBLIC pascal trap, void, StdRect, GrafVerb, v, Rect *, rp) #define MOREINSANECOMPATIBILITY #if defined (MOREINSANECOMPATIBILITY) if (v == frame && PORT_REGION_SAVE_X (thePort)) { - if (CW(rp->left) > CW(rp->right)) { + if (BigEndianValue(rp->left) > BigEndianValue(rp->right)) { patcheduprect = *rp; patcheduprect.left = rp->right; patcheduprect.right = rp->left; - if (CW(rp->top) > CW(rp->bottom)) { + if (BigEndianValue(rp->top) > BigEndianValue(rp->bottom)) { patcheduprect.top = rp->bottom; patcheduprect.bottom = rp->top; } rp = &patcheduprect; - } else if (CW(rp->top) > CW(rp->bottom)) { + } else if (BigEndianValue(rp->top) > BigEndianValue(rp->bottom)) { patcheduprect = *rp; patcheduprect.top = rp->bottom; patcheduprect.bottom = rp->top; diff --git a/src/qStdRgn.cpp b/src/qStdRgn.cpp index e16bbaf2..273da4e7 100644 --- a/src/qStdRgn.cpp +++ b/src/qStdRgn.cpp @@ -31,6 +31,7 @@ char ROMlib_rcsid_qStdRgn[] = #include "rsys/dirtyrect.h" using namespace Executor; +using namespace ByteSwap; PUBLIC WriteWhenType Executor::ROMlib_when = WriteInBltrgn; @@ -130,7 +131,7 @@ Executor::ROMlib_blt_rgn_update_dirty_rect bbox_height = RECT_HEIGHT (&bbox); row_bytes = ((bbox_width * bpp + 31) / 32) * 4; - new_src_pm->rowBytes = CW (row_bytes); + new_src_pm->rowBytes = BigEndianValue (row_bytes); TEMP_ALLOC_ALLOCATE (new_bits, temp_alloc_space, row_bytes * bbox_height); new_src_pm->baseAddr = (Ptr) RM (new_bits); @@ -139,15 +140,15 @@ Executor::ROMlib_blt_rgn_update_dirty_rect new_src_pm->pmTable = RM (ROMlib_dont_depthconv_ctab); - top = (CW (src_rect->top) - + (CW (bbox.top) - CW (dst_rect->top))); - left = (CW (src_rect->left) - + (CW (bbox.left) - CW (dst_rect->left))); + top = (BigEndianValue (src_rect->top) + + (BigEndianValue (bbox.top) - BigEndianValue (dst_rect->top))); + left = (BigEndianValue (src_rect->left) + + (BigEndianValue (bbox.left) - BigEndianValue (dst_rect->left))); - convert_src_rect.top = CW (top); - convert_src_rect.left = CW (left); - convert_src_rect.bottom = CW (top + bbox_height); - convert_src_rect.right = CW (left + bbox_width); + convert_src_rect.top = BigEndianValue (top); + convert_src_rect.left = BigEndianValue (left); + convert_src_rect.bottom = BigEndianValue (top + bbox_height); + convert_src_rect.right = BigEndianValue (left + bbox_width); if (mode == transparent || mode == hilite) @@ -217,11 +218,11 @@ Executor::ROMlib_blt_rgn_update_dirty_rect if (screen_dst_p && update_dirty_p) { const Rect *r = &RGN_BBOX (rh); - int dst_top = CW (dst_pm->bounds.top); - int dst_left = CW (dst_pm->bounds.left); + int dst_top = BigEndianValue (dst_pm->bounds.top); + int dst_left = BigEndianValue (dst_pm->bounds.left); - dirty_rect_accrue (CW (r->top) - dst_top, CW (r->left) - dst_left, - CW (r->bottom) - dst_top, CW (r->right) - dst_left); + dirty_rect_accrue (BigEndianValue (r->top) - dst_top, BigEndianValue (r->left) - dst_left, + BigEndianValue (r->bottom) - dst_top, BigEndianValue (r->right) - dst_left); if (ROMlib_when == WriteInBltrgn) { dirty_rect_update_screen (); @@ -351,8 +352,8 @@ blt_pattern_to_bitmap_simple_mode (RgnHandle rh, INTEGER mode, } dst_pixmap.bounds = dst->bounds; - dst_top = CW (dst_pixmap.bounds.top); - dst_left = CW (dst_pixmap.bounds.left); + dst_top = BigEndianValue (dst_pixmap.bounds.top); + dst_left = BigEndianValue (dst_pixmap.bounds.left); /* Actually do the blt. */ update_dirty_p = xdblt_pattern (rh, mode, -dst_left, -dst_top, src, @@ -362,8 +363,8 @@ blt_pattern_to_bitmap_simple_mode (RgnHandle rh, INTEGER mode, if (screen_dst_p && update_dirty_p) { const Rect *r = &RGN_BBOX (rh); - dirty_rect_accrue (CW (r->top) - dst_top, CW (r->left) - dst_left, - CW (r->bottom) - dst_top, CW (r->right) - dst_left); + dirty_rect_accrue (BigEndianValue (r->top) - dst_top, BigEndianValue (r->left) - dst_left, + BigEndianValue (r->bottom) - dst_top, BigEndianValue (r->right) - dst_left); if (ROMlib_when == WriteInBltrgn) { dirty_rect_update_screen (); @@ -390,8 +391,8 @@ blt_pixpat_to_pixmap_simple_mode (RgnHandle rh, INTEGER mode, screen_dst_p = active_screen_addr_p (dst); - dst_top = CW (dst->bounds.top); - dst_left = CW (dst->bounds.left); + dst_top = BigEndianValue (dst->bounds.top); + dst_left = BigEndianValue (dst->bounds.left); if (src->patType == CWC (pixpat_old_style_pattern)) { @@ -475,8 +476,8 @@ blt_pixpat_to_pixmap_simple_mode (RgnHandle rh, INTEGER mode, if (screen_dst_p && update_dirty_p) { const Rect *r = &RGN_BBOX (rh); - dirty_rect_accrue (CW (r->top) - dst_top, CW (r->left) - dst_left, - CW (r->bottom) - dst_top, CW (r->right) - dst_left); + dirty_rect_accrue (BigEndianValue (r->top) - dst_top, BigEndianValue (r->left) - dst_left, + BigEndianValue (r->bottom) - dst_top, BigEndianValue (r->right) - dst_left); if (ROMlib_when == WriteInBltrgn) { dirty_rect_update_screen (); @@ -504,7 +505,7 @@ blt_fancy_pat_mode_to_pixmap (RgnHandle rh, int mode, TEMP_ALLOC_DECL (temp_alloc_space); /* Set up xdata for the thing being blitted. */ - bpp = CW (pixmap->pixelSize); + bpp = BigEndianValue (pixmap->pixelSize); log2_bpp = ROMlib_log2[bpp]; if (!pixpat_handle) @@ -542,9 +543,9 @@ blt_fancy_pat_mode_to_pixmap (RgnHandle rh, int mode, x = STARH (xh); pattern_pm.bounds.top = CWC (0); pattern_pm.bounds.left = CWC (0); - pattern_pm.bounds.bottom = CW (x->height_minus_1 + 1); - pattern_pm.bounds.right = CW ((x->row_bytes << (5 - x->log2_bpp)) >> 2); - pattern_pm.rowBytes = CW (x->row_bytes); + pattern_pm.bounds.bottom = BigEndianValue (x->height_minus_1 + 1); + pattern_pm.bounds.right = BigEndianValue ((x->row_bytes << (5 - x->log2_bpp)) >> 2); + pattern_pm.rowBytes = BigEndianValue (x->row_bytes); if (x->pat_bits) pattern_pm.baseAddr = (Ptr) RM (x->pat_bits); else @@ -583,7 +584,7 @@ blt_fancy_pat_mode_to_pixmap (RgnHandle rh, int mode, bbox = RGN_BBOX (rh); converted_pm.bounds = bbox; row_bytes = (((RECT_WIDTH (&bbox) << log2_bpp) + 31U) / 32) * 4; - converted_pm.rowBytes = CW (row_bytes); + converted_pm.rowBytes = BigEndianValue (row_bytes); TEMP_ALLOC_ALLOCATE (new_bits, temp_alloc_space, row_bytes * RECT_HEIGHT (&bbox)); converted_pm.baseAddr = (Ptr) RM (new_bits); @@ -635,11 +636,11 @@ blt_fancy_pat_mode_to_pixmap (RgnHandle rh, int mode, if (active_screen_addr_p (pixmap)) { const Rect *r = &RGN_BBOX (rh); - int dst_top = CW (pixmap->bounds.top); - int dst_left = CW (pixmap->bounds.left); + int dst_top = BigEndianValue (pixmap->bounds.top); + int dst_left = BigEndianValue (pixmap->bounds.left); - dirty_rect_accrue (CW (r->top) - dst_top, CW (r->left) - dst_left, - CW (r->bottom) - dst_top, CW (r->right) - dst_left); + dirty_rect_accrue (BigEndianValue (r->top) - dst_top, BigEndianValue (r->left) - dst_left, + BigEndianValue (r->bottom) - dst_top, BigEndianValue (r->right) - dst_left); if (ROMlib_when == WriteInBltrgn) { dirty_rect_update_screen (); @@ -727,7 +728,7 @@ P2 (PUBLIC pascal trap, void, StdRgn, (rgn, { RgnPtr rp = STARH (rgn); - PICWRITE (rp, CW (rp->rgnSize)); + PICWRITE (rp, BigEndianValue (rp->rgnSize)); }); }); @@ -753,7 +754,7 @@ P2 (PUBLIC pascal trap, void, StdRgn, /* construct the frame */ /* #warning "We inset the region AFTER we've clipped it to the port bounds???" */ - InsetRgn (rh, CW (pen_size.h), CW (pen_size.v)); + InsetRgn (rh, BigEndianValue (pen_size.h), BigEndianValue (pen_size.v)); XorRgn (rgn, rh, rh); /* now `paint' the frame */ diff --git a/src/qStdText.cpp b/src/qStdText.cpp index 9a3e4383..98487e96 100644 --- a/src/qStdText.cpp +++ b/src/qStdText.cpp @@ -24,6 +24,7 @@ char ROMlib_rcsid_qStdText[] = #include "rsys/safe_alloca.h" using namespace Executor; +using namespace ByteSwap; #undef ALLOCABEGIN @@ -58,20 +59,20 @@ A5(PRIVATE, void, charblit, BitMap *, fbmp, BitMap *, tbmp, /* INTERNAL */ /*-->*/ return; /* Find the first column of pixels to be copied. */ - firstfrom = CW(srect->left) - CW(fbmp->bounds.left); + firstfrom = BigEndianValue(srect->left) - BigEndianValue(fbmp->bounds.left); /* Find the last column of pixels to be copied. */ - lastfrom = CW(srect->right) - CW(fbmp->bounds.left); + lastfrom = BigEndianValue(srect->right) - BigEndianValue(fbmp->bounds.left); /* Find the first column pixels are to be copied to. */ - firstto = CW(drect->left) - CW(tbmp->bounds.left); + firstto = BigEndianValue(drect->left) - BigEndianValue(tbmp->bounds.left); /* Find the last column pixels are to be copied to. */ - lastto = CW(drect->right) - CW(tbmp->bounds.left); - numrows = CW(srect->bottom) - CW(srect->top); + lastto = BigEndianValue(drect->right) - BigEndianValue(tbmp->bounds.left); + numrows = BigEndianValue(srect->bottom) - BigEndianValue(srect->top); /* * If it is to be put into italics, start with the characters * shifted over and shift them back one pixel at a time later. @@ -90,10 +91,10 @@ A5(PRIVATE, void, charblit, BitMap *, fbmp, BitMap *, tbmp, /* INTERNAL */ */ firstfromword = (unsigned short *) (MR(fbmp->baseAddr) + BITMAP_ROWBYTES (fbmp) * - (CW(srect->top) - CW(fbmp->bounds.top) - 1)) + firstfrom / 16; + (BigEndianValue(srect->top) - BigEndianValue(fbmp->bounds.top) - 1)) + firstfrom / 16; firsttoword = (unsigned short *) (MR(tbmp->baseAddr) + BITMAP_ROWBYTES (tbmp) * - (CW(drect->top) - CW(tbmp->bounds.top) - 1)) + firstto / 16; + (BigEndianValue(drect->top) - BigEndianValue(tbmp->bounds.top) - 1)) + firstto / 16; /* * Calculate the number of words to be taken from one bitmap and the * number to be put to the other minus one. The minus one is because @@ -150,18 +151,18 @@ A5(PRIVATE, void, charblit, BitMap *, fbmp, BitMap *, tbmp, /* INTERNAL */ nextfromword = firstfromword += numfromwords; \ nexttoword = firsttoword += numtowords; \ /* Read the first two words and mask off the unused bits */ \ - nextlong = (((ULONGINT) CW(*nextfromword) << 16) + \ - CW(*(nextfromword + 1))) & firstmask; \ + nextlong = (((ULONGINT) BigEndianValue(*nextfromword) << 16) + \ + BigEndianValue(*(nextfromword + 1))) & firstmask; \ nextfromword += 2; \ for ( j = wordstodo ; --j >= 0 ; ) { \ /* Write the next word, calculated by taking the appropriate \ * 16 bits from a LONGINT. */ \ - *nexttoword++ |= CW(nextlong >> shiftsize); \ + *nexttoword++ |= BigEndianValue(nextlong >> shiftsize); \ /* Prepare the LONGINT for the next pass. */ \ - nextlong = (nextlong << 16) + CW(*nextfromword++); \ + nextlong = (nextlong << 16) + BigEndianValue(*nextfromword++); \ } \ /* Write the last word with the appropriate bits masked out. */ \ - *nexttoword |= CW((nextlong & lastmask) >> shiftsize); \ + *nexttoword |= BigEndianValue((nextlong & lastmask) >> shiftsize); \ } @@ -277,10 +278,10 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, PAUSEDECL; p = (unsigned char *) textbufp; - num.h = CW (nump->h); - num.v = CW (nump->v); - den.h = CW (denp->h); - den.v = CW (denp->v); + num.h = BigEndianValue (nump->h); + num.v = BigEndianValue (nump->v); + den.h = BigEndianValue (denp->h); + den.v = BigEndianValue (denp->v); retval = 0; if (action == text_helper_measure) { @@ -309,11 +310,11 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, Point swapped_num; Point swapped_den; - swapped_num.h = CW (num.h); - swapped_num.v = CW (num.v); - swapped_den.h = CW (den.h); - swapped_den.v = CW (den.v); - PORT_PEN_LOC (thePort).h = CW (CW (PORT_PEN_LOC (thePort).h) + swapped_num.h = BigEndianValue (num.h); + swapped_num.v = BigEndianValue (num.v); + swapped_den.h = BigEndianValue (den.h); + swapped_den.v = BigEndianValue (den.v); + PORT_PEN_LOC (thePort).h = BigEndianValue (BigEndianValue (PORT_PEN_LOC (thePort).h) + (CALLTXMEAS (n, textbufp, &swapped_num, &swapped_den, 0))); @@ -326,31 +327,31 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, fmi.size = PORT_TX_SIZE_X (thePort); fmi.face = PORT_TX_FACE_X (thePort); fmi.device = PORT_DEVICE_X (thePort); - fmi.numer.h = CW(num.h); - fmi.numer.v = CW(num.v); - fmi.denom.h = CW(den.h); - fmi.denom.v = CW(den.v); + fmi.numer.h = BigEndianValue(num.h); + fmi.numer.v = BigEndianValue(num.v); + fmi.denom.h = BigEndianValue(den.h); + fmi.denom.v = BigEndianValue(den.v); fmop = FMSwapFont(&fmi); if (action == text_helper_measure) { if (fmop->numer.h && fmop->denom.h) - nump->h = CW((LONGINT) Cx(fmop->numer.h) << 8 / Cx(fmop->denom.h)); + nump->h = BigEndianValue((LONGINT) Cx(fmop->numer.h) << 8 / Cx(fmop->denom.h)); else nump->h = fmop->numer.h; if (fmop->numer.v && fmop->denom.h) - nump->v = CW((LONGINT) Cx(fmop->numer.v) << 8 / Cx(fmop->denom.h)); + nump->v = BigEndianValue((LONGINT) Cx(fmop->numer.v) << 8 / Cx(fmop->denom.h)); else nump->v = fmop->numer.v; denp->h = WIDTHPTR->hFactor; denp->v = WIDTHPTR->hFactor; if (finfop) { - finfop->ascent = CW((unsigned short) CB(fmop->ascent)); - finfop->descent = CW((unsigned short) CB(fmop->descent)); - finfop->widMax = CW((unsigned short) CB(fmop->widMax)); - finfop->leading = CW((unsigned short) CB(fmop->leading)); + finfop->ascent = BigEndianValue((unsigned short) CB(fmop->ascent)); + finfop->descent = BigEndianValue((unsigned short) CB(fmop->descent)); + finfop->widMax = BigEndianValue((unsigned short) CB(fmop->widMax)); + finfop->leading = BigEndianValue((unsigned short) CB(fmop->leading)); } } @@ -368,9 +369,9 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, HLock(MR(fmop->fontHandle)); fp = (FontRec *) STARH(MR(fmop->fontHandle)); fmap.baseAddr = RM((Ptr) (&fp->rowWords + 1)); - fmap.rowBytes = CW(CW(fp->rowWords) * 2); + fmap.rowBytes = BigEndianValue(BigEndianValue(fp->rowWords) * 2); fmap.bounds.left = fmap.bounds.top = 0; - fmap.bounds.right = CW(CW(fp->rowWords) * 16); + fmap.bounds.right = BigEndianValue(BigEndianValue(fp->rowWords) * 16); fmap.bounds.bottom = fp->fRectHeight; srect.top = misrect.top = 0; srect.bottom = misrect.bottom = fp->fRectHeight; @@ -381,26 +382,26 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, misrect.left = *(locp + Cx(fp->lastChar) - Cx(fp->firstChar) + 1); misrect.right = *(locp + Cx(fp->lastChar) - Cx(fp->firstChar) + 2); drect.left = PORT_PEN_LOC (thePort).h; - drect.top = CW(CW (PORT_PEN_LOC (thePort).v) - CW(fp->ascent)); - drect.bottom = CW(CW(drect.top) + Cx(fp->fRectHeight)); + drect.top = BigEndianValue(BigEndianValue (PORT_PEN_LOC (thePort).v) - BigEndianValue(fp->ascent)); + drect.bottom = BigEndianValue(BigEndianValue(drect.top) + Cx(fp->fRectHeight)); hOutput = Cx(WIDTHPTR->hOutput); vOutput = Cx(WIDTHPTR->vOutput); hOutputInverse = FixRatio (1 << 8, hOutput); space_extra = PORT_SP_EXTRA (thePort); - spacewidth = (CL (WIDTHPTR->tabData[' ']) + space_extra - - CL (WIDTHPTR->sExtra)); + spacewidth = (BigEndianValue (WIDTHPTR->tabData[' ']) + space_extra + - BigEndianValue (WIDTHPTR->sExtra)); if (action == text_helper_draw) { Point swapped_num; Point swapped_den; - swapped_num.h = CW (num.h); - swapped_num.v = CW (num.v); - swapped_den.h = CW (den.h); - swapped_den.v = CW (den.v); + swapped_num.h = BigEndianValue (num.h); + swapped_num.v = BigEndianValue (num.v); + swapped_den.h = BigEndianValue (den.h); + swapped_den.v = BigEndianValue (den.v); strwidth = text_helper (n, textbufp, &swapped_num, &swapped_den, 0, 0, text_helper_measure); @@ -425,30 +426,30 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, if (strwidth <= 0) /*-->*/ return 0; - stylemap.rowBytes = CW((strwidth - Cx(fp->kernMax) + leftitalicoffset + + stylemap.rowBytes = BigEndianValue((strwidth - Cx(fp->kernMax) + leftitalicoffset + rightitalicoffset + 31)/32 * 4); - stylemap.bounds.top = CW (CW (PORT_PEN_LOC (thePort).v) + stylemap.bounds.top = BigEndianValue (BigEndianValue (PORT_PEN_LOC (thePort).v) - CB(fmop->ascent)); #if 0 - stylemap.bounds.bottom = CW (CW (PORT_PEN_LOC (thePort).v) + stylemap.bounds.bottom = BigEndianValue (BigEndianValue (PORT_PEN_LOC (thePort).v) + descent); #else { int height; height = MAX (CB(fmop->ascent) + descent, Cx (fp->fRectHeight)); - stylemap.bounds.bottom = CW (CW (PORT_PEN_LOC (thePort).v) + stylemap.bounds.bottom = BigEndianValue (BigEndianValue (PORT_PEN_LOC (thePort).v) - CB(fmop->ascent) + height); } #endif - stylemap.bounds.left = CW (CW (PORT_PEN_LOC (thePort).h) + stylemap.bounds.left = BigEndianValue (BigEndianValue (PORT_PEN_LOC (thePort).h) + Cx(fp->kernMax) - leftitalicoffset); - stylemap.bounds.right = CW(CW(PORT_PEN_LOC (thePort).h) + stylemap.bounds.right = BigEndianValue(BigEndianValue(PORT_PEN_LOC (thePort).h) + strwidth + rightitalicoffset); if (fmop->shadow) - stylemap.bounds.left = CW(CW(stylemap.bounds.left) - 1); - nbytes = ((CW(stylemap.bounds.bottom) - CW(stylemap.bounds.top)) * - CW(stylemap.rowBytes)); + stylemap.bounds.left = BigEndianValue(BigEndianValue(stylemap.bounds.left) - 1); + nbytes = ((BigEndianValue(stylemap.bounds.bottom) - BigEndianValue(stylemap.bounds.top)) * + BigEndianValue(stylemap.rowBytes)); stylemap.baseAddr = RM((Ptr) ALLOCA(nbytes)); memset(MR(stylemap.baseAddr), 0, nbytes); bmp = &stylemap; @@ -472,30 +473,30 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, first = Cx(fp->firstChar); max = Cx(fp->lastChar) - Cx(fp->firstChar); - misintwidth = CW(misrect.right) - CW(misrect.left); + misintwidth = BigEndianValue(misrect.right) - BigEndianValue(misrect.left); misfixwidth = FIXED(misintwidth); - left = FIXED(CW(PORT_PEN_LOC (thePort).h)) + FIXEDONEHALF; + left = FIXED(BigEndianValue(PORT_PEN_LOC (thePort).h)) + FIXEDONEHALF; left_begin = left; widths = WIDTHPTR->tabData; kernmax = Cx(fp->kernMax); leftmost = left >> 16; - WIDTHPTR->tabData[' '] = CL (spacewidth); - WIDTHPTR->sExtra = CL (space_extra); + WIDTHPTR->tabData[' '] = BigEndianValue (spacewidth); + WIDTHPTR->sExtra = BigEndianValue (space_extra); if (action == text_helper_draw) ASSERT_SAFE(MR(stylemap.baseAddr)); for (ep = p + n; p != ep; p++) { if (charlocp) - *charlocp++ = CW ((left - left_begin + 0xffff) >> 16); + *charlocp++ = BigEndianValue ((left - left_begin + 0xffff) >> 16); c = *p; - width = CL(widths[c]); + width = BigEndianValue(widths[c]); if ((c -= Cx(fp->firstChar)) < 0 || c > max - || (wid = CW(widp[c])) == -1) + || (wid = BigEndianValue(widp[c])) == -1) { - drect.left = CW(left >> 16); - if (CW(drect.left) < leftmost) - leftmost = CW(drect.left); - drect.right = CW(CW(drect.left) + misintwidth); + drect.left = BigEndianValue(left >> 16); + if (BigEndianValue(drect.left) < leftmost) + leftmost = BigEndianValue(drect.left); + drect.right = BigEndianValue(BigEndianValue(drect.left) + misintwidth); if (action == text_helper_draw) { charblit(&fmap, bmp, &misrect, &drect, TRUE); @@ -510,11 +511,11 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, { srect.left = locp[c]; srect.right = locp[c+1]; - drect.left = CW(left >> 16); - drect.left = CW(CW(drect.left) + (offset = (wid >> 8) + kernmax)); - if (CW(drect.left) < leftmost) - leftmost = CW(drect.left); - drect.right = CW(CW(drect.left) + CW(srect.right) - CW(srect.left)); + drect.left = BigEndianValue(left >> 16); + drect.left = BigEndianValue(BigEndianValue(drect.left) + (offset = (wid >> 8) + kernmax)); + if (BigEndianValue(drect.left) < leftmost) + leftmost = BigEndianValue(drect.left); + drect.right = BigEndianValue(BigEndianValue(drect.left) + BigEndianValue(srect.right) - BigEndianValue(srect.left)); if (action == text_helper_draw) { charblit(&fmap, bmp, &srect, &drect, TRUE); @@ -532,7 +533,7 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, } } if (charlocp) - *charlocp = CW ((left - left_begin + 0xffff) >> 16); + *charlocp = BigEndianValue ((left - left_begin + 0xffff) >> 16); if (action == text_helper_measure) { retval = (left - left_begin + 0xFFFF) >> 16; @@ -540,7 +541,7 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, else { ASSERT_SAFE(MR(stylemap.baseAddr)); - stylemap.bounds.right = CW((left >> 16) + rightitalicoffset); + stylemap.bounds.right = BigEndianValue((left >> 16) + rightitalicoffset); if (PORT_TX_FACE (thePort) & (int) bold) { stylemap2 = stylemap; @@ -557,8 +558,8 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, ASSERT_SAFE(MR(stylemap.baseAddr)); for (i = 0; i++ < Cx(fmop->bold);) { - drect.left = CW(CW(drect.left) + 1); - srect.right = CW(CW(srect.right) - 1); + drect.left = BigEndianValue(BigEndianValue(drect.left) + 1); + srect.right = BigEndianValue(BigEndianValue(srect.right) - 1); charblit(&stylemap2, bmp, &srect, &drect, FALSE); ASSERT_SAFE(MR(stylemap.baseAddr)); } @@ -614,22 +615,22 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, srect = stylemap.bounds; drect = srect; - srect.left = CW(CW(srect.left) + 1); - drect.right = CW(CW(drect.right) - 1); + srect.left = BigEndianValue(BigEndianValue(srect.left) + 1); + drect.right = BigEndianValue(BigEndianValue(drect.right) - 1); ASSERT_SAFE(MR(stylemap.baseAddr)); charblit(&stylemap2, &stylemap3, &srect, &drect, FALSE); ASSERT_SAFE(MR(stylemap.baseAddr)); - srect.left = CW(CW(srect.left) - 1); /* restore */ - drect.right = CW(CW(drect.right) + 1); + srect.left = BigEndianValue(BigEndianValue(srect.left) - 1); /* restore */ + drect.right = BigEndianValue(BigEndianValue(drect.right) + 1); for (i = 0; i++ < Cx(fmop->shadow); ) { - drect.left = CW(CW(drect.left) + 1); - srect.right = CW(CW(srect.right) - 1); + drect.left = BigEndianValue(BigEndianValue(drect.left) + 1); + srect.right = BigEndianValue(BigEndianValue(srect.right) - 1); charblit(&stylemap2, &stylemap3, &srect, &drect, FALSE); } ASSERT_SAFE(MR(stylemap.baseAddr)); - drect.left = CW(CW(drect.left) - Cx(fmop->shadow)); /* restore */ - srect.right = CW(CW(srect.right) + Cx(fmop->shadow)); + drect.left = BigEndianValue(BigEndianValue(drect.left) - Cx(fmop->shadow)); /* restore */ + srect.right = BigEndianValue(BigEndianValue(srect.right) + Cx(fmop->shadow)); #if 0 BlockMove(MR(stylemap3.baseAddr), MR(bmp->baseAddr), (Size) nbytes); @@ -637,40 +638,40 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, memcpy(MR(bmp->baseAddr), MR(stylemap3.baseAddr), (Size) nbytes); #endif - srect.top = CW(CW(srect.top) + 1); - drect.bottom = CW(CW(drect.bottom) - 1); + srect.top = BigEndianValue(BigEndianValue(srect.top) + 1); + drect.bottom = BigEndianValue(BigEndianValue(drect.bottom) - 1); ASSERT_SAFE(MR(stylemap.baseAddr)); charblit(&stylemap3, bmp, &srect, &drect, FALSE); - srect.top = CW(CW(srect.top) - 1); /* restore */ - drect.bottom = CW(CW(drect.bottom) + 1); + srect.top = BigEndianValue(BigEndianValue(srect.top) - 1); /* restore */ + drect.bottom = BigEndianValue(BigEndianValue(drect.bottom) + 1); ASSERT_SAFE(MR(stylemap.baseAddr)); for (i = 0; i++ < Cx(fmop->shadow); ) { - drect.top = CW(CW(drect.top) + 1); - srect.bottom = CW(CW(srect.bottom) - 1); + drect.top = BigEndianValue(BigEndianValue(drect.top) + 1); + srect.bottom = BigEndianValue(BigEndianValue(srect.bottom) - 1); charblit(&stylemap3, bmp, &srect, &drect, FALSE); } - drect.top = CW(CW(drect.top) - Cx(fmop->shadow)); /* restore */ - srect.bottom = CW(CW(srect.bottom) + Cx(fmop->shadow)); + drect.top = BigEndianValue(BigEndianValue(drect.top) - Cx(fmop->shadow)); /* restore */ + srect.bottom = BigEndianValue(BigEndianValue(srect.bottom) + Cx(fmop->shadow)); ASSERT_SAFE(MR(stylemap3.baseAddr)); ASSERT_SAFE(MR(stylemap.baseAddr)); } - drect.top = CW(CW(bmp->bounds.top) + drect.top = BigEndianValue(BigEndianValue(bmp->bounds.top) - (FixMul((LONGINT) CB(fmop->ascent) << 16, (Fixed) (vOutput - 256) << 8) >> 16)); - drect.left = CW(leftmost); - drect.bottom = CW(CW(drect.top) - + (FixMul((LONGINT) (CW(bmp->bounds.bottom) - - CW(bmp->bounds.top)) << 16, + drect.left = BigEndianValue(leftmost); + drect.bottom = BigEndianValue(BigEndianValue(drect.top) + + (FixMul((LONGINT) (BigEndianValue(bmp->bounds.bottom) + - BigEndianValue(bmp->bounds.top)) << 16, (Fixed) vOutput << 8) >> 16)); - drect.right = CW(leftmost + - (FixMul((LONGINT) (CW(bmp->bounds.right) + drect.right = BigEndianValue(leftmost + + (FixMul((LONGINT) (BigEndianValue(bmp->bounds.right) - leftmost) << 16, (Fixed) hOutput << 8) >> 16)); srect = bmp->bounds; - srect.left = CW(leftmost); + srect.left = BigEndianValue(leftmost); ASSERT_SAFE(MR(stylemap.baseAddr)); StdBits(bmp, &srect, &drect, PORT_TX_MODE (thePort) & 0x37, (RgnHandle)0); ASSERT_SAFE(MR(stylemap.baseAddr)); @@ -682,7 +683,7 @@ Executor::text_helper (LONGINT n, Ptr textbufp, Point *nump, Point *denp, ASSERT_SAFE (MR (stylemap2.baseAddr)); } - PORT_PEN_LOC (thePort).h = CW(CW(drect.right) - + PORT_PEN_LOC (thePort).h = BigEndianValue(BigEndianValue(drect.right) - (FixMul((LONGINT) rightitalicoffset << 16, (Fixed) hOutput << 8) >> 16)); ASSERT_SAFE(MR(stylemap.baseAddr)); @@ -720,10 +721,10 @@ P4(PUBLIC pascal trap, void, StdText, INTEGER, n, Ptr, textbufp, Point swapped_num; Point swapped_den; - swapped_num.h = CW (num.h); - swapped_num.v = CW (num.v); - swapped_den.h = CW (den.h); - swapped_den.v = CW (den.v); + swapped_num.h = BigEndianValue (num.h); + swapped_num.v = BigEndianValue (num.v); + swapped_den.h = BigEndianValue (den.h); + swapped_den.v = BigEndianValue (den.v); text_helper (n, textbufp, &swapped_num, &swapped_den, 0, 0, text_helper_draw); } diff --git a/src/qText.cpp b/src/qText.cpp index 2a587b84..c9eb6c04 100644 --- a/src/qText.cpp +++ b/src/qText.cpp @@ -19,11 +19,12 @@ char ROMlib_rcsid_qText[] = #include "rsys/glue.h" using namespace Executor; +using namespace ByteSwap; P1(PUBLIC pascal trap, void, TextFont, INTEGER, f) { if (thePort) - PORT_TX_FONT_X (thePort) = CW(f); + PORT_TX_FONT_X (thePort) = BigEndianValue(f); } P1(PUBLIC pascal trap, void, TextFace, INTEGER, thef) @@ -35,19 +36,19 @@ P1(PUBLIC pascal trap, void, TextFace, INTEGER, thef) P1(PUBLIC pascal trap, void, TextMode, INTEGER, m) { if (thePort) - PORT_TX_MODE_X (thePort) = CW(m); + PORT_TX_MODE_X (thePort) = BigEndianValue(m); } P1(PUBLIC pascal trap, void, TextSize, INTEGER, s) { if (thePort) - PORT_TX_SIZE_X (thePort) = CW(s); + PORT_TX_SIZE_X (thePort) = BigEndianValue(s); } P1(PUBLIC pascal trap, void, SpaceExtra, Fixed, e) { if (thePort) - PORT_SP_EXTRA_X (thePort) = CL(e); + PORT_SP_EXTRA_X (thePort) = BigEndianValue(e); } P1(PUBLIC pascal trap, void, DrawChar, CHAR, thec) @@ -98,7 +99,7 @@ P1(PUBLIC pascal trap, INTEGER, CharWidth, CHAR, thec) c = thec; np.h = np.v = dp.h = dp.v = CWC(256); retval = CALLTXMEAS(1, (Ptr) &c, &np, &dp, &fi); - return FixMul((LONGINT) retval << 16, (Fixed) CW(np.h) << 8) / ((LONGINT) CW(dp.h) << 8); + return FixMul((LONGINT) retval << 16, (Fixed) BigEndianValue(np.h) << 8) / ((LONGINT) BigEndianValue(dp.h) << 8); } P1(PUBLIC pascal trap, INTEGER, StringWidth, StringPtr, s) @@ -110,7 +111,7 @@ P1(PUBLIC pascal trap, INTEGER, StringWidth, StringPtr, s) np.h = np.v = dp.h = dp.v = CWC (256); retval = CALLTXMEAS((INTEGER)U(s[0]), (Ptr) s+1, &np, &dp, &fi); return FixMul ((LONGINT) retval << 16, - (Fixed) CW (np.h) << 8) / ((LONGINT) CW (dp.h) << 8); + (Fixed) BigEndianValue (np.h) << 8) / ((LONGINT) BigEndianValue (dp.h) << 8); } P3(PUBLIC pascal trap, INTEGER, TextWidth, Ptr, tb, INTEGER, fb, INTEGER, bc) @@ -122,7 +123,7 @@ P3(PUBLIC pascal trap, INTEGER, TextWidth, Ptr, tb, INTEGER, fb, INTEGER, bc) np.h = np.v = dp.h = dp.v = CWC(256); retval = CALLTXMEAS(bc, tb+fb, &np, &dp, &fi); return FixMul ((LONGINT) retval << 16, - (Fixed) CW(np.h) << 8) / ((LONGINT) CW(dp.h) << 8); + (Fixed) BigEndianValue(np.h) << 8) / ((LONGINT) BigEndianValue(dp.h) << 8); } P1(PUBLIC pascal trap, void, GetFontInfo, FontInfo *, ip) @@ -134,7 +135,7 @@ P1(PUBLIC pascal trap, void, GetFontInfo, FontInfo *, ip) pd.v = CWC(1); pd.h = CWC(1); CALLTXMEAS(0, (Ptr) "", &pn, &pd, ip); - ip->ascent = CW(CW(ip->ascent ) * CW(pn.v) / CW(pd.v)); - ip->descent = CW(CW(ip->descent) * CW(pn.v) / CW(pd.v)); - ip->leading = CW(CW(ip->leading) * CW(pn.v) / CW(pd.v)); + ip->ascent = BigEndianValue(BigEndianValue(ip->ascent ) * BigEndianValue(pn.v) / BigEndianValue(pd.v)); + ip->descent = BigEndianValue(BigEndianValue(ip->descent) * BigEndianValue(pn.v) / BigEndianValue(pd.v)); + ip->leading = BigEndianValue(BigEndianValue(ip->leading) * BigEndianValue(pn.v) / BigEndianValue(pd.v)); } diff --git a/src/rawpatblt.cpp b/src/rawpatblt.cpp index af6c6be3..8df6f4e0 100644 --- a/src/rawpatblt.cpp +++ b/src/rawpatblt.cpp @@ -23,6 +23,7 @@ namespace Executor { } using namespace Executor; +using namespace ByteSwap; /* Dummy table, not actually dereferenced. */ const void *xdblt_nop_table[1] = { NULL }; @@ -96,7 +97,7 @@ xdblt_canon_pattern (void) log2_bpp = xdblt_log2_bpp; rgn = xdblt_rgn_start; - y = CW (*rgn++); + y = BigEndianValue (*rgn++); if (y == RGNSTOP) goto done_with_scanlines; @@ -186,7 +187,7 @@ xdblt_canon_pattern (void) * so we have to look two bytes farther to find the next y * value. Special regions store y's as big endian. */ - next_y = CW (rgn[1]); + next_y = BigEndianValue (rgn[1]); rgn += 2; if (next_y == RGNSTOP) goto done_with_scanlines; diff --git a/src/rawsrcblt.cpp b/src/rawsrcblt.cpp index bb2b4b8c..971a1ada 100644 --- a/src/rawsrcblt.cpp +++ b/src/rawsrcblt.cpp @@ -32,6 +32,7 @@ namespace Executor { } using namespace Executor; +using namespace ByteSwap; const void **srcblt_noshift_stubs[8] = { srcblt_copy_noshift_labels, @@ -106,7 +107,7 @@ srcblt_bitmap (void) log2_bpp = srcblt_log2_bpp; rgn = srcblt_rgn_start; - y = CW (*rgn++); + y = BigEndianValue (*rgn++); if (y == RGNSTOP) goto done_with_scanlines; @@ -196,7 +197,7 @@ srcblt_bitmap (void) * so we have to look two bytes farther to find the next y * value. Special regions store y's as big endian. */ - next_y = CW (rgn[1]); + next_y = BigEndianValue (rgn[1]); rgn += 2; if (next_y == RGNSTOP) goto done_with_scanlines; diff --git a/src/resGet.cpp b/src/resGet.cpp index 6556f14d..bd7956bd 100644 --- a/src/resGet.cpp +++ b/src/resGet.cpp @@ -37,6 +37,7 @@ namespace Executor { } using namespace Executor; +using namespace ByteSwap; P1(PUBLIC pascal trap, void, SetResLoad, BOOLEAN, load) { @@ -50,7 +51,7 @@ A2(PRIVATE, INTEGER, countmapresources, resmaphand, map, ResType, typ) retval = 0; WALKTR(map, i, tr) - if (CL(tr->rtyp) == typ) { + if (BigEndianValue(tr->rtyp) == typ) { retval += 1 + Cx(tr->nres); break; } @@ -92,7 +93,7 @@ A3(PRIVATE, Handle, getindmapresource, resmaphand, map, ResType, typ, resref *rr; WALKTR(map, i, tr) - if (CL(tr->rtyp) == typ) { + if (BigEndianValue(tr->rtyp) == typ) { nr = Cx(tr->nres) + 1; WALKRR(map, tr, j, rr) if (--*indx == 0) @@ -156,7 +157,7 @@ A4(PUBLIC, OSErr, ROMlib_maptypidtop, resmaphand, map, /* INTERNAL */ resref *rr; WALKTR(map, i, tr) - if (CL(tr->rtyp) == typ) { + if (BigEndianValue(tr->rtyp) == typ) { WALKRR(map, tr, j, rr) if (Cx(rr->rid) == id) { *ptr = rr; @@ -399,7 +400,7 @@ A3(PRIVATE, Handle, getnamedmapresource, resmaphand, map, ResType, typ, resref *rr; WALKTR(map, i, tr) - if (CL(tr->rtyp) == typ) { + if (BigEndianValue(tr->rtyp) == typ) { WALKRR(map, tr, j, rr) if (Cx(rr->noff) != -1 && EqualString((StringPtr) ( (char *)STARH(map) + Hx(map, namoff) + Cx(rr->noff)), diff --git a/src/resGetinfo.cpp b/src/resGetinfo.cpp index eaa72250..1568b5a5 100644 --- a/src/resGetinfo.cpp +++ b/src/resGetinfo.cpp @@ -20,6 +20,7 @@ char ROMlib_rcsid_resGetinfo[] = #define STEF_GetResInfoFix using namespace Executor; +using namespace ByteSwap; P1(PUBLIC pascal trap, INTEGER, UniqueID, ResType, typ) { @@ -149,7 +150,7 @@ A2(PUBLIC, LONGINT, ROMlib_SizeResource, Handle, res, BOOLEAN, usehandle) return -1; } else - retval = CL (l[3]); + retval = BigEndianValue (l[3]); } } else @@ -157,7 +158,7 @@ A2(PUBLIC, LONGINT, ROMlib_SizeResource, Handle, res, BOOLEAN, usehandle) not_compressed_after_all: lc = sizeof(retval); ROMlib_setreserr(FSReadAll(Hx(map, resfn), &lc, (Ptr) &retval)); - retval = CL(retval); + retval = BigEndianValue(retval); if (ResErr != noErr) /*-->*/ return -1; } diff --git a/src/resInit.cpp b/src/resInit.cpp index 46332dc0..9f9299db 100644 --- a/src/resInit.cpp +++ b/src/resInit.cpp @@ -23,6 +23,7 @@ char ROMlib_rcsid_resInit[] = #include "rsys/appearance.h" using namespace Executor; +using namespace ByteSwap; /* extracts an int32 from a string of the form [^(]*([0-9]*).* * () == 0, any invalid string == -1 @@ -93,7 +94,7 @@ P0(PUBLIC pascal trap, INTEGER, InitResources) ROMlib_setreserr (noErr); str255assign(SysResName, SYSMACNAME); - SysMap = CW (OpenRFPerm ((StringPtr) SYSMACNAME, Cx (BootDrive), + SysMap = BigEndianValue (OpenRFPerm ((StringPtr) SYSMACNAME, Cx (BootDrive), fsCurPerm)); if (SysMap == CWC (-1)) @@ -123,7 +124,7 @@ P0(PUBLIC pascal trap, INTEGER, InitResources) }); - return CW(SysMap); + return BigEndianValue(SysMap); } P0(PUBLIC pascal trap, void, RsrcZoneInit) /* no op */ diff --git a/src/resMisc.cpp b/src/resMisc.cpp index d200e815..9bde1f8b 100644 --- a/src/resMisc.cpp +++ b/src/resMisc.cpp @@ -15,23 +15,24 @@ char ROMlib_rcsid_resMisc[] = #include "rsys/hook.h" using namespace Executor; +using namespace ByteSwap; A1(PUBLIC, INTEGER, ROMlib_setreserr, INTEGER, reserr) /* INTERNAL */ { - ResErr = CW(reserr); + ResErr = BigEndianValue(reserr); if (ResErr != noErr && ResErrProc) { ROMlib_hook(res_reserrprocnumber); EM_D0 = (unsigned short) reserr; /* TODO: is unsigned short correct? */ - CALL_EMULATOR((syn68k_addr_t) CL((long) ResErrProc)); + CALL_EMULATOR((syn68k_addr_t) BigEndianValue((long) ResErrProc)); } - return CW(ResErr); + return BigEndianValue(ResErr); } P0(PUBLIC pascal trap, INTEGER, ResError) { - return CW(ResErr); + return BigEndianValue(ResErr); } P1(PUBLIC pascal trap, INTEGER, GetResFileAttrs, INTEGER, rn) @@ -56,5 +57,5 @@ P2(PUBLIC pascal trap, void, SetResFileAttrs, INTEGER, rn, INTEGER, attrs) if (!map) return; /* don't set reserr. I kid you not, see I-127 */ else - HxX(map, resfatr) = CW (attrs); + HxX(map, resfatr) = BigEndianValue (attrs); } diff --git a/src/resMod.cpp b/src/resMod.cpp index 73d7c0ea..de286f2f 100644 --- a/src/resMod.cpp +++ b/src/resMod.cpp @@ -21,6 +21,7 @@ char ROMlib_rcsid_resMod[] = using namespace Executor; +using namespace ByteSwap; typedef res_sorttype_t *sorttypeptr; MAKE_HIDDEN(sorttypeptr); @@ -56,7 +57,7 @@ P3(PUBLIC pascal trap, void, SetResInfo, Handle, res, INTEGER, id, ROMlib_setreserr(resAttrErr); /* IV-18 */ return; } - rr->rid = CW(id); + rr->rid = BigEndianValue(id); if (name) { sl = U(name[0]); if (U(*(sp = (char *)STARH(map) + Hx(map, namoff) + Cx(rr->noff))) < sl || @@ -65,8 +66,8 @@ P3(PUBLIC pascal trap, void, SetResInfo, Handle, res, INTEGER, id, err = MemError(); if (ROMlib_setreserr(err)) return; - rr->noff = CW(Hx(map, rh.maplen) - Hx(map, namoff)); - HxX(map, rh.maplen) = CL(Hx(map, rh.maplen) + sl + 1); + rr->noff = BigEndianValue(Hx(map, rh.maplen) - Hx(map, namoff)); + HxX(map, rh.maplen) = BigEndianValue(Hx(map, rh.maplen) + sl + 1); sp = (char *)STARH(map) + Hx(map, namoff) + Cx(rr->noff); warning_unimplemented ("we leak space here"); } @@ -119,20 +120,20 @@ A2(PRIVATE, LONGINT, addtype, resmaphand, map, ResType, typ) LONGINT off; WALKTR(map, i, tr) - if (tr->rtyp == CL(typ)) + if (tr->rtyp == BigEndianValue(typ)) return((LONGINT)((char *)tr - (char *)STARH(map))); EWALKTR(tr) ROMlib_invalar(); - t.rtyp = CL(typ); + t.rtyp = BigEndianValue(typ); t.nres = CWC(-1); - t.rloff = CW(NAMEOFF(map) - TYPEOFF(map)); + t.rloff = BigEndianValue(NAMEOFF(map) - TYPEOFF(map)); off = (LONGINT)((char *)tr - (char *) STARH(map)); Munger((Handle) map, off, (Ptr) "", (LONGINT)0, (Ptr) &t, sizeof(t)); - NUMTMINUS1X(map) = CW(NUMTMINUS1(map) + 1); - MAPLENX(map) = CL(MAPLEN(map) + sizeof(t)); - NAMEOFFX(map) = CW(NAMEOFF(map) + sizeof(t)); + NUMTMINUS1X(map) = BigEndianValue(NUMTMINUS1(map) + 1); + MAPLENX(map) = BigEndianValue(MAPLEN(map) + sizeof(t)); + NAMEOFFX(map) = BigEndianValue(NAMEOFF(map) + sizeof(t)); WALKTR(map, i, tr) - tr->rloff = CW(CW(tr->rloff) + sizeof(t)); + tr->rloff = BigEndianValue(BigEndianValue(tr->rloff) + sizeof(t)); EWALKTR(tr) return(off); } @@ -152,7 +153,7 @@ A2(PRIVATE, LONGINT, addname, resmaphand, map, StringPtr, name) Munger((Handle) map, MAPLEN(map), (Ptr) "", (LONGINT)0, (Ptr) name, namelen); retval = MAPLEN(map) - NAMEOFF(map); - MAPLENX(map) = CL(MAPLEN(map) + namelen); + MAPLENX(map) = BigEndianValue(MAPLEN(map) + namelen); } return retval; } @@ -182,8 +183,8 @@ P4(PUBLIC pascal trap, void, AddResource, Handle, data, ResType, typ, } ROMlib_setreserr(noErr); toff = addtype(map, typ); - r.rid = CW(id); - r.noff = CW(addname(map, name)); + r.rid = BigEndianValue(id); + r.noff = BigEndianValue(addname(map, name)); r.ratr = CB(resChanged); r.doff[0] = r.doff[1] = r.doff[2] = 0xff; HxX(map, resfatr) |= CWC(mapChanged); @@ -204,15 +205,15 @@ P4(PUBLIC pascal trap, void, AddResource, Handle, data, ResType, typ, sizeof(resref)); roff -= TYPEOFF(map); /* roff is from the beginning of the typelist */ - MAPLENX(map) = CL(MAPLEN(map) + sizeof(resref)); - NAMEOFFX(map) = CW(NAMEOFF(map) + sizeof(resref)); + MAPLENX(map) = BigEndianValue(MAPLEN(map) + sizeof(resref)); + NAMEOFFX(map) = BigEndianValue(NAMEOFF(map) + sizeof(resref)); tr2 = (typref *)((char *)STARH(map) + toff); - tr2->nres = CW(CW(tr2->nres) + 1); + tr2->nres = BigEndianValue(BigEndianValue(tr2->nres) + 1); WALKTR(map, i, tr) if (Cx(tr->rloff) >= roff && tr != tr2) /* if (Cx(tr->rloff) > roff) would probably work, but I'm chicken -- ctm */ - tr->rloff = CW(CW(tr->rloff) + sizeof(resref)); + tr->rloff = BigEndianValue(BigEndianValue(tr->rloff) + sizeof(resref)); EWALKTR(tr) } @@ -252,34 +253,34 @@ P1(PUBLIC pascal trap, void, RmveResource, Handle, res) nlen = U(*((char *)STARH(map) + nmoff)) + 1; Munger((Handle) map, nmoff, (Ptr)0, nlen, (Ptr) "", (LONGINT) 0); nmoff -= NAMEOFF(map); - MAPLENX(map) = CL(MAPLEN(map) - nlen); + MAPLENX(map) = BigEndianValue(MAPLEN(map) - nlen); } else nmoff = 0x7fff; HxX(map, resfatr) |= CWC(mapChanged|mapCompact); Munger((Handle) map, rroff, (Ptr)0, (LONGINT)sizeof(resref), (Ptr) "", (LONGINT) 0); rroff -= TYPEOFF(map); - MAPLENX(map) = CL(MAPLEN(map) - sizeof(resref)); - NAMEOFFX(map) = CW(NAMEOFF(map) - sizeof(resref)); + MAPLENX(map) = BigEndianValue(MAPLEN(map) - sizeof(resref)); + NAMEOFFX(map) = BigEndianValue(NAMEOFF(map) - sizeof(resref)); tr = (typref *)((char *) STARH(map) + troff); - tr->nres = CW(CW(tr->nres) - 1); + tr->nres = BigEndianValue(BigEndianValue(tr->nres) - 1); if (tr->nres == -1) { ROMlib_invalar(); - NUMTMINUS1X(map) = CW(NUMTMINUS1(map) - 1); + NUMTMINUS1X(map) = BigEndianValue(NUMTMINUS1(map) - 1); Munger((Handle) map, troff, (Ptr)0, (LONGINT)sizeof(typref), (Ptr) "", (LONGINT) 0); tloss = sizeof(typref); - MAPLENX(map) = CL(MAPLEN(map) - sizeof(typref)); - NAMEOFFX(map) = CW(NAMEOFF(map) - sizeof(typref)); + MAPLENX(map) = BigEndianValue(MAPLEN(map) - sizeof(typref)); + NAMEOFFX(map) = BigEndianValue(NAMEOFF(map) - sizeof(typref)); } else tloss = 0; WALKTR(map, i, tr) if (Cx(tr->rloff) > rroff) - tr->rloff = CW(CW(tr->rloff) - sizeof(resref)); - tr->rloff = CW(CW(tr->rloff) - tloss); + tr->rloff = BigEndianValue(BigEndianValue(tr->rloff) - sizeof(resref)); + tr->rloff = BigEndianValue(BigEndianValue(tr->rloff) - tloss); WALKRR(map, tr, j, rr) if (Cx(rr->noff) > nmoff) - rr->noff = CW(CW(rr->noff) - nlen); + rr->noff = BigEndianValue(BigEndianValue(rr->noff) - nlen); EWALKRR(rr) EWALKTR(tr) } @@ -323,9 +324,9 @@ A2(PUBLIC, void, ROMlib_wr, resmaphand, map, resref *, rr) /* INTERNAL */ if (rr->doff[0] == 0xFF && rr->doff[1] == 0xFF && rr->doff[2] == 0xFF) { newloc = Hx(map, rh.rmapoff) - Hx(map, rh.rdatoff); - HxX(map, rh.rmapoff) = CL(Hx(map, rh.rmapoff) + rsize + + HxX(map, rh.rmapoff) = BigEndianValue(Hx(map, rh.rmapoff) + rsize + sizeof(LONGINT)); - HxX(map, rh.datlen) = CL(Hx(map, rh.datlen) + rsize + + HxX(map, rh.datlen) = BigEndianValue(Hx(map, rh.datlen) + rsize + sizeof(LONGINT)); B3ASSIGN(rr->doff, newloc); } else @@ -335,7 +336,7 @@ A2(PUBLIC, void, ROMlib_wr, resmaphand, map, resref *, rr) /* INTERNAL */ if (ResErr != noErr) return; lc = sizeof(LONGINT); - swappedrsize = CL(rsize); + swappedrsize = BigEndianValue(rsize); ROMlib_setreserr(FSWriteAll(Hx(map, resfn), &lc, (Ptr) &swappedrsize)); if (ResErr != noErr) return; @@ -380,7 +381,7 @@ A4(PRIVATE, void, getdat, INTEGER, fn, LONGINT, datoff, LONGINT, doff, SetFPos(fn, fsFromStart, datoff + doff); lc = sizeof(LONGINT); FSReadAll(fn, &lc, (Ptr) &size); - size = CL(size); + size = BigEndianValue(size); gui_assert(size >= 0); *h = NewHandle(size); gui_assert(*h); @@ -402,7 +403,7 @@ A4(PRIVATE, void, putdat, INTEGER, fn, LONGINT, datoff, LONGINT *, doffp, gui_assert(*doffp >= 0); SetFPos(fn, fsFromStart, datoff + *doffp); lc = sizeof(LONGINT); - swappedsize = CL(size); + swappedsize = BigEndianValue(size); FSWriteAll(fn, &lc, (Ptr) &swappedsize); lc = size; HLock(h); @@ -424,15 +425,15 @@ A4(PRIVATE, LONGINT, walkst, res_sorttype_t *, sp, res_sorttype_t *, sep, INTEGE B3ASSIGN(sp->rrptr->doff, doff); #if 0 if (sp->rrptr->ratr & resChanged) { - putdat(fn, datoff, &doff, (Handle) CL(sp->rrptr->rhand)); - } else if (!sp->rrptr->rhand || !*(Handle)CL(sp->rrptr->rhand)) { + putdat(fn, datoff, &doff, (Handle) BigEndianValue(sp->rrptr->rhand)); + } else if (!sp->rrptr->rhand || !*(Handle)BigEndianValue(sp->rrptr->rhand)) { getdat(fn, datoff, sp->diskoff, &h); putdat(fn, datoff, &doff, h); DisposHandle(h); } else if (doff != sp->diskoff) - putdat(fn, datoff, &doff, (Handle) CL(sp->rrptr->rhand)); + putdat(fn, datoff, &doff, (Handle) BigEndianValue(sp->rrptr->rhand)); else - doff += GetHandleSize((Handle) CL(sp->rrptr->rhand)) + + doff += GetHandleSize((Handle) BigEndianValue(sp->rrptr->rhand)) + sizeof(LONGINT); #else if (sp->rrptr->ratr & resChanged) @@ -446,7 +447,7 @@ A4(PRIVATE, LONGINT, walkst, res_sorttype_t *, sp, res_sorttype_t *, sep, INTEGE lc = sizeof(LONGINT); FSReadAll(fn, &lc, (Ptr) &size); gui_assert(lc == sizeof(LONGINT)); - size = CL(size); + size = BigEndianValue(size); gui_assert(size >= 0); doff += size + sizeof(LONGINT); } else { @@ -485,8 +486,8 @@ A1(PRIVATE, void, compactdata, resmaphand, map) HSetState((Handle) map, mapstate); HxX(map, resfatr) |= CWC(mapChanged); HxX(map, resfatr) &= CWC(~mapCompact); - HxX(map, rh.rmapoff) = CL(sizeof(reshead) + sizeof(rsrvrec) + datlen); - HxX(map, rh.datlen) = CL(datlen); + HxX(map, rh.rmapoff) = BigEndianValue(sizeof(reshead) + sizeof(rsrvrec) + datlen); + HxX(map, rh.datlen) = BigEndianValue(datlen); DisposHandle((Handle) st); } diff --git a/src/resOpen.cpp b/src/resOpen.cpp index 19948129..d05a4073 100644 --- a/src/resOpen.cpp +++ b/src/resOpen.cpp @@ -23,6 +23,7 @@ char ROMlib_rcsid_resOpen[] = #include "rsys/prefs.h" using namespace Executor; +using namespace ByteSwap; PUBLIC void Executor::HCreateResFile_helper (INTEGER vrefnum, LONGINT parid, Str255 name, @@ -50,7 +51,7 @@ Executor::HCreateResFile_helper (INTEGER vrefnum, LONGINT parid, Str255 name, FSClose(f); return; } - buf.bhead.rdatoff = buf.bhead.rmapoff = CL(sizeof(reshead) + + buf.bhead.rdatoff = buf.bhead.rmapoff = BigEndianValue(sizeof(reshead) + sizeof(rsrvrec)); buf.bhead.datlen = CLC(0); /* No data */ buf.bhead.maplen = CLC(sizeof(resmap) + sizeof(INTEGER)); @@ -100,7 +101,7 @@ Handle Executor::ROMlib_mgetres(resmaphand map, resref *rr) EM_A2 = (LONGINT) (long) US_TO_SYN68K(rr); #define TEMPORARYHACKUNTILWESWAPTABLES #if !defined(TEMPORARYHACKUNTILWESWAPTABLES) - EM_A0 = (LONGINT) CL(ostraptable[0xFC]); + EM_A0 = (LONGINT) BigEndianValue(ostraptable[0xFC]); #else /* defined(TEMPORARYHACKUNTILWESWAPTABLES) */ EM_A0 = (LONGINT) (long) ostraptable[0xFC]; #endif @@ -181,7 +182,7 @@ decompress_setup (INTEGER rn, int32 *dlenp, int32 *final_sizep, int32 *offsetp, LONGINT save_pos; GetFPos (rn, &save_pos); - *dcmp_handlep = GetResource (TICK("dcmp"), CW (info.dcmpID)); + *dcmp_handlep = GetResource (TICK("dcmp"), BigEndianValue (info.dcmpID)); SetFPos (rn, fsFromStart, save_pos); if (!*dcmp_handlep) @@ -192,7 +193,7 @@ decompress_setup (INTEGER rn, int32 *dlenp, int32 *final_sizep, int32 *offsetp, int32 working_size; LoadResource (*dcmp_handlep); - final_size = CL (info.uncompressedSize); + final_size = BigEndianValue (info.uncompressedSize); /* * The MacTech article says that the workingBufferFractionalSize @@ -369,7 +370,7 @@ Executor::ROMlib_mgetres2 (resmaphand map, resref *rr) retval = NULL; else { - dlen = CL (dlen); + dlen = BigEndianValue (dlen); if (ResLoad) retval = mgetres_helper (map, rr, dlen, retval); else if (!rr->rhand) @@ -550,7 +551,7 @@ P4 (PUBLIC pascal trap, INTEGER, HOpenResFile, INTEGER, vref, LONGINT, dirid, str255assign (local_name, fn); pbr.volumeParam.ioNamePtr = (StringPtr) RM ((Ptr) local_name); - pbr.volumeParam.ioVRefNum = CW (vref); + pbr.volumeParam.ioVRefNum = BigEndianValue (vref); pbr.volumeParam.ioVolIndex = CLC (-1); err = PBHGetVInfo (&pbr, FALSE); if (err) @@ -560,9 +561,9 @@ P4 (PUBLIC pascal trap, INTEGER, HOpenResFile, INTEGER, vref, LONGINT, dirid, } cpb.hFileInfo.ioNamePtr = RM (fn); - cpb.hFileInfo.ioVRefNum = CW (vref); + cpb.hFileInfo.ioVRefNum = BigEndianValue (vref); cpb.hFileInfo.ioFDirIndex = CWC (0); - cpb.hFileInfo.ioDirID = CL (dirid); + cpb.hFileInfo.ioDirID = BigEndianValue (dirid); if ((ROMlib_setreserr(PBGetCatInfo(&cpb, 0))) == noErr && perm > fsRdPerm) { @@ -572,7 +573,7 @@ P4 (PUBLIC pascal trap, INTEGER, HOpenResFile, INTEGER, vref, LONGINT, dirid, cpb.hFileInfo.ioDirID); if (fref != -1) { - CurMap = CW (fref); + CurMap = BigEndianValue (fref); /*-->*/ return fref; } } @@ -583,22 +584,22 @@ P4 (PUBLIC pascal trap, INTEGER, HOpenResFile, INTEGER, vref, LONGINT, dirid, ROMlib_invalar(); pbr.ioParam.ioNamePtr = RM (fn); - pbr.ioParam.ioVRefNum = CW (vref); + pbr.ioParam.ioVRefNum = BigEndianValue (vref); pbr.fileParam.ioFDirIndex = CWC (0); pbr.ioParam.ioPermssn = CB (perm); pbr.ioParam.ioMisc = CLC (0); - pbr.fileParam.ioDirID = CL (dirid); + pbr.fileParam.ioDirID = BigEndianValue (dirid); ROMlib_setreserr(PBHOpenRF(&pbr, FALSE)); if (ResErr != noErr) return(-1); - f = CW(pbr.ioParam.ioRefNum); + f = BigEndianValue(pbr.ioParam.ioRefNum); lc = sizeof(hd); ROMlib_setreserr(FSReadAll(f, &lc, (Ptr)&hd)); if (ResErr != noErr) { FSClose(f); return(-1); } - map = (resmaphand) NewHandle(CL(hd.maplen)); + map = (resmaphand) NewHandle(BigEndianValue(hd.maplen)); err = MemError(); if (ROMlib_setreserr(err)) { FSClose(f); @@ -611,7 +612,7 @@ P4 (PUBLIC pascal trap, INTEGER, HOpenResFile, INTEGER, vref, LONGINT, dirid, FSClose(f); return(-1); } - lc = CL(hd.maplen); + lc = BigEndianValue(hd.maplen); ROMlib_setreserr(FSReadAll(f, &lc, (Ptr) STARH(map))); if (ResErr != noErr) { DisposHandle((Handle) map); @@ -653,9 +654,9 @@ P4 (PUBLIC pascal trap, INTEGER, HOpenResFile, INTEGER, vref, LONGINT, dirid, } HxX(map, nextmap) = TopMapHndl; - HxX(map, resfn) = CW(f); + HxX(map, resfn) = BigEndianValue(f); TopMapHndl = RM((Handle) map); - CurMap = CW(f); + CurMap = BigEndianValue(f); /* check for resprload bits */ diff --git a/src/resPartial.cpp b/src/resPartial.cpp index 9b2241fe..51144471 100644 --- a/src/resPartial.cpp +++ b/src/resPartial.cpp @@ -15,6 +15,7 @@ char ROMlib_rcsid_resPartial[] = #include "rsys/file.h" using namespace Executor; +using namespace ByteSwap; P4 (PUBLIC pascal trap, void, ReadPartialResource, Handle, res, int32, offset, Ptr, buffer, int32, count) @@ -35,7 +36,7 @@ P4 (PUBLIC pascal trap, void, ReadPartialResource, LONGINT loc; cur_size = ROMlib_SizeResource (res, FALSE); - err = CW (ResErr); + err = BigEndianValue (ResErr); if (err == noErr && (uint32) offset + count > (uint32) cur_size) err = inputOutOfBounds; else diff --git a/src/resSetcur.cpp b/src/resSetcur.cpp index c00fb3bf..1577d269 100644 --- a/src/resSetcur.cpp +++ b/src/resSetcur.cpp @@ -14,6 +14,7 @@ char ROMlib_rcsid_resSetcur[] = #include "rsys/resource.h" using namespace Executor; +using namespace ByteSwap; P0(PUBLIC pascal trap, INTEGER, CurResFile) { @@ -83,7 +84,7 @@ P1(PUBLIC pascal trap, void, UseResFile, INTEGER, rn) rn = Cx(SysMap); ROMlib_invalar(); if (ROMlib_rntohandl(rn, &map)) { - CurMap = CW(rn); + CurMap = BigEndianValue(rn); ROMlib_setreserr(noErr); } else ROMlib_setreserr(resFNotFound); diff --git a/src/rgbutil.cpp b/src/rgbutil.cpp index d2309a99..86b6c64a 100644 --- a/src/rgbutil.cpp +++ b/src/rgbutil.cpp @@ -14,6 +14,7 @@ char ROMlib_rcsid_rgbutil[] = #include "rsys/cquick.h" using namespace Executor; +using namespace ByteSwap; /* This file contains routines useful for manipulating RGB pixels. * @@ -44,7 +45,7 @@ make_component_map (uint16 *map, int num_bits, boolean_t swap_p) v = i << (16 - num_bits); for (shift = num_bits; shift < 16; shift += num_bits) v |= v >> shift; - map[i] = swap_p ? CW (v) : v; + map[i] = swap_p ? BigEndianValue (v) : v; } /* Fill out the rest of the table with duplicate entries. */ @@ -80,7 +81,7 @@ rgb_extract_from_swapped_16bpp_pixel (const rgb_spec_t *rgb_spec, const rgb_map_t *table; table = &rgb_spec->map; - in = CW (in); + in = BigEndianValue (in); /* NOTE: we & 0xFF here because our lookup tables are built in * such a way as to ignore any extraneous high bits. This way we @@ -100,7 +101,7 @@ rgb_extract_from_swapped_32bpp_pixel (const rgb_spec_t *rgb_spec, const rgb_map_t *table; table = &rgb_spec->map; - in = CL (in); + in = BigEndianValue (in); /* NOTE: we & 0xFF here because our lookup tables are built in * such a way as to ignore any extraneous high bits. This way we @@ -194,9 +195,9 @@ rgbcolor_to_pixel (const rgb_spec_t *spec, if (spec->big_endian_p) { if (spec->bpp == 16) - v = (uint16) CW (v); /* cast masks off extra cruft in high bits. */ + v = (uint16) BigEndianValue (v); /* cast masks off extra cruft in high bits. */ else - v = CL (v); + v = BigEndianValue (v); } return v; diff --git a/src/scrap.cpp b/src/scrap.cpp index 13bf0182..14af0948 100644 --- a/src/scrap.cpp +++ b/src/scrap.cpp @@ -29,6 +29,7 @@ char ROMlib_rcsid_scrap[] = #endif using namespace Executor; +using namespace ByteSwap; P0(PUBLIC pascal trap, PScrapStuff, InfoScrap) { @@ -45,12 +46,12 @@ A1(PRIVATE, OSErr, cropen, INTEGER *, fp) { OSErr retval; - retval = FSOpen(MR(ScrapName), CW (BootDrive), fp); + retval = FSOpen(MR(ScrapName), BigEndianValue (BootDrive), fp); if (retval == fnfErr) { - retval = Create(MR(ScrapName), CW (BootDrive), TICK("MACS"), TICK("CLIP")); + retval = Create(MR(ScrapName), BigEndianValue (BootDrive), TICK("MACS"), TICK("CLIP")); if (retval != noErr) return(retval); - return(FSOpen(MR(ScrapName), CW (BootDrive), fp)); + return(FSOpen(MR(ScrapName), BigEndianValue (BootDrive), fp)); } return(retval); } @@ -85,7 +86,7 @@ P0(PUBLIC pascal trap, LONGINT, LoadScrap) LONGINT l = Cx(ScrapSize); if (ScrapState == 0) { - retval = FSOpen(MR(ScrapName), CW (BootDrive), &f); + retval = FSOpen(MR(ScrapName), BigEndianValue (BootDrive), &f); if (retval != noErr) return(retval); @@ -130,7 +131,7 @@ A0(PUBLIC, LONGINT, ROMlib_ZeroScrap) } else if (Cx(ScrapState) > 0) SetHandleSize(MR(ScrapHandle), (Size)0); ScrapSize = 0; - ScrapCount = CW(CW(ScrapCount) + 1); + ScrapCount = BigEndianValue(BigEndianValue(ScrapCount) + 1); return noErr; } @@ -153,18 +154,18 @@ P3(PUBLIC pascal trap, LONGINT, PutScrap, LONGINT, len, ResType, rest, Ptr, p) /*-->*/ return(retval); } #if defined(X) || defined(MACOSX_) || defined (SDL) - PutScrapX(rest, len, (char *) p, CW (ScrapCount)); + PutScrapX(rest, len, (char *) p, BigEndianValue (ScrapCount)); #endif /* defined(X) */ if (Cx(ScrapState) == 0) { - retval = FSOpen(MR(ScrapName), CW (BootDrive), &f); + retval = FSOpen(MR(ScrapName), BigEndianValue (BootDrive), &f); if (retval != noErr) /*-->*/ return(retval); SetFPos(f, fsFromStart, (LONGINT)Cx(ScrapSize)); l = 4; - rest = CL(rest); + rest = BigEndianValue(rest); FSWriteAll(f, &l, (Ptr) &rest); l = 4; - swappedlen = CL(len); + swappedlen = BigEndianValue(len); FSWriteAll(f, &l, (Ptr) &swappedlen); l = len = (len + 1) & -2L; FSWriteAll(f, &len, p); @@ -172,15 +173,15 @@ P3(PUBLIC pascal trap, LONGINT, PutScrap, LONGINT, len, ResType, rest, Ptr, p) } else { SetHandleSize(MR(ScrapHandle), (Size)Cx(ScrapSize) + 8); if (MemErr != noErr) -/*-->*/ return CW(MemErr); +/*-->*/ return BigEndianValue(MemErr); /* alignment stuff */ lp = (LONGINT *)((char *)STARH(MR(ScrapHandle)) + Cx(ScrapSize)); - *lp++ = CL(rest); - *lp++ = CL(len); + *lp++ = BigEndianValue(rest); + *lp++ = BigEndianValue(len); len = (len + 1) & -2L; PtrAndHand(p, MR(ScrapHandle), (Size)len); } - ScrapSize = CL(CL(ScrapSize) + 8 + len); + ScrapSize = BigEndianValue(BigEndianValue(ScrapSize) + 8 + len); return noErr; } @@ -272,15 +273,15 @@ P3(PUBLIC pascal trap, LONGINT, GetScrap, Handle, h, ResType, rest, /*-->*/ RETURN(retval); } if (ScrapState == 0) { - retval = FSOpen(MR(ScrapName), CW (BootDrive), &f); + retval = FSOpen(MR(ScrapName), BigEndianValue (BootDrive), &f); if (retval != noErr) /*-->*/ RETURN(retval); found = FALSE; while (l < Cx(ScrapSize) && !found) { ltoread = 8; FSReadAll(f, <oread, (Ptr) restlen); - s = CL(restlen[1]); - if (rest == CL(restlen[0])) + s = BigEndianValue(restlen[1]); + if (rest == BigEndianValue(restlen[0])) found = TRUE; else { incr = (8 + s + 1) & ~1L; @@ -294,7 +295,7 @@ P3(PUBLIC pascal trap, LONGINT, GetScrap, Handle, h, ResType, rest, } ReallocHandle(h, s); if (MemErr != noErr) -/*-->*/ RETURN(CW(MemErr)); +/*-->*/ RETURN(BigEndianValue(MemErr)); HLock(h); ltoread = s; FSReadAll(f, <oread, STARH(h)); @@ -304,9 +305,9 @@ P3(PUBLIC pascal trap, LONGINT, GetScrap, Handle, h, ResType, rest, HLock(MR(ScrapHandle)); p = MR(*(unsigned char **)MR(ScrapHandle)); #if 1 || !defined(QUADALIGN) - while (l < Cx(ScrapSize) && rest != CL(*(LONGINT *)p)) + while (l < Cx(ScrapSize) && rest != BigEndianValue(*(LONGINT *)p)) { - s = CL (*((LONGINT *) p + 1)); + s = BigEndianValue (*((LONGINT *) p + 1)); incr = (8 + s + 1) & ~1L; l += incr; p += incr; @@ -316,7 +317,7 @@ P3(PUBLIC pascal trap, LONGINT, GetScrap, Handle, h, ResType, rest, HUnlock(MR(ScrapHandle)); /*-->*/ RETURN(noTypeErr); } - s = CL (*((LONGINT *)p + 1)); + s = BigEndianValue (*((LONGINT *)p + 1)); #else /* QUADALIGN */ while (l < Cx(ScrapSize) && rest != SNAGLONG(p)) { incr = 8 + ((s = SNAGLONG(p + sizeof(LONGINT))) + 1) & -2L; @@ -333,7 +334,7 @@ P3(PUBLIC pascal trap, LONGINT, GetScrap, Handle, h, ResType, rest, PtrToXHand((Ptr) (p+8), h, s); HUnlock(MR(ScrapHandle)); } - *off = CL(l+8); + *off = BigEndianValue(l+8); RETURN(s); } @@ -443,8 +444,8 @@ ctab_from_surface (SDL_Surface *surfp) n_colors = SDL_n_colors (surfp); retval = (CTabHandle) NewHandle (CTAB_STORAGE_FOR_SIZE (n_colors-1)); - CTAB_SIZE_X (retval) = CW (n_colors - 1); - CTAB_SEED_X (retval) = CL (GetCTSeed ()); + CTAB_SIZE_X (retval) = BigEndianValue (n_colors - 1); + CTAB_SEED_X (retval) = BigEndianValue (GetCTSeed ()); CTAB_FLAGS_X (retval) = CTAB_GDEVICE_BIT_X; for (i = 0, ip = SDL_colors (surfp), op = CTAB_TABLE (retval); @@ -500,8 +501,8 @@ gworld_from_surface (SDL_Surface *surfp) r.top = CWC (0); r.left = CWC (0); - r.bottom = CW (n_lines); - r.right = CW (pixels_per_line); + r.bottom = BigEndianValue (n_lines); + r.right = BigEndianValue (pixels_per_line); { CGrafPtr save_port; GDHandle save_device; diff --git a/src/screen-dump.cpp b/src/screen-dump.cpp index fc66b04f..ef482b73 100644 --- a/src/screen-dump.cpp +++ b/src/screen-dump.cpp @@ -27,6 +27,7 @@ char ROMlib_rcsid_screendump[] = #include "rsys/screen-dump.h" using namespace Executor; +using namespace ByteSwap; #define II_little_endian 0x4949 #define MM_big_endian 0x4D4D @@ -142,7 +143,7 @@ dump_indirect_pm (PixMap *pm) height = RECT_HEIGHT (&pm->bounds); width = RECT_WIDTH (&pm->bounds); - bpp = CW (pm->pixelSize); + bpp = BigEndianValue (pm->pixelSize); if ( (bpp != 8 && bpp != 4) || VDRIVER_BYPASS_INTERNAL_FBUF_P ()) @@ -157,7 +158,7 @@ dump_indirect_pm (PixMap *pm) row_bytes = (width * bpp + 31) / 32 * 4; tiff_pm->baseAddr = (Ptr)RM (fbuf); - tiff_pm->rowBytes = CW (row_bytes | PIXMAP_DEFAULT_ROW_BYTES); + tiff_pm->rowBytes = BigEndianValue (row_bytes | PIXMAP_DEFAULT_ROW_BYTES); tiff_pm->bounds = pm->bounds; pixmap_set_pixel_fields (tiff_pm, bpp); @@ -246,9 +247,9 @@ dump_indirect_pm (PixMap *pm) for (i = 0; i <= color_table_size; i ++) { - color_map[i ] = CW (color_table[i].rgb.red); - color_map[i + (1 << bpp)] = CW (color_table[i].rgb.green); - color_map[i + (2 << bpp)] = CW (color_table[i].rgb.blue); + color_map[i ] = BigEndianValue (color_table[i].rgb.red); + color_map[i + (1 << bpp)] = BigEndianValue (color_table[i].rgb.green); + color_map[i + (2 << bpp)] = BigEndianValue (color_table[i].rgb.blue); } } @@ -321,7 +322,7 @@ Executor::do_dump_screen (void) int log2_bpp; gd_pm = STARH (gd_pmh); - log2_bpp = ROMlib_log2[CW (gd_pm->pixelSize)]; + log2_bpp = ROMlib_log2[BigEndianValue (gd_pm->pixelSize)]; (*dump_fns[log2_bpp]) (gd_pm); }); diff --git a/src/script.cpp b/src/script.cpp index 0a5a100f..37eac235 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -30,6 +30,7 @@ char ROMlib_rcsid_script[] = #include using namespace Executor; +using namespace ByteSwap; /* * NOTE: these are stubs to help me make FileMaker Pro go. @@ -216,10 +217,10 @@ P7 (PUBLIC pascal trap, void, NMeasureJust, Ptr, text, int32, length, warning_unimplemented ("slop = %d, run_pos = %d", slop, run_pos); - numerx.v = CW (numer.v); - numerx.h = CW (numer.h); - denomx.v = CW (denomx.v); - denomx.h = CW (denomx.h); + numerx.v = BigEndianValue (numer.v); + numerx.h = BigEndianValue (numer.h); + denomx.v = BigEndianValue (denomx.v); + denomx.h = BigEndianValue (denomx.h); xStdTxMeas (length, (uint8 *) text, &numerx, &denomx, NULL, (int16 *) charLocs); @@ -323,8 +324,8 @@ P6(PUBLIC pascal trap, void, FindWord, Ptr, textbufp, INTEGER, length, ++stop) ; - offsets[0] = CW(start); - offsets[1] = CW(stop); + offsets[0] = BigEndianValue(start); + offsets[1] = BigEndianValue(stop); offsets[2] = 0; /* Testing on Brute shows we should zero this memory */ offsets[3] = 0; offsets[4] = 0; @@ -338,8 +339,8 @@ P4(PUBLIC pascal trap, void, HiliteText, Ptr, textbufp, INTEGER, firstoffset, #if defined (BINCOMPAT) ROMlib_hook(script_notsupported); #endif /* BINCOMPAT */ - offsets[0] = CW(firstoffset); - offsets[1] = CW(secondoffset); + offsets[0] = BigEndianValue(firstoffset); + offsets[1] = BigEndianValue(secondoffset); offsets[2] = 0; offsets[3] = 0; offsets[4] = 0; @@ -371,8 +372,8 @@ P3 (PUBLIC pascal trap, void, DrawJust, Ptr, textbufp, { Fixed extra; - extra = CL (save_sp_extra_x) + FixRatio (slop, n_spaces); - PORT_SP_EXTRA_X (thePort) = CL (extra); + extra = BigEndianValue (save_sp_extra_x) + FixRatio (slop, n_spaces); + PORT_SP_EXTRA_X (thePort) = BigEndianValue (extra); } DrawText (textbufp, 0, length); PORT_SP_EXTRA_X (thePort) = save_sp_extra_x; @@ -413,7 +414,7 @@ this_date_rec(DateTimeRec *p) LONGINT now; GetDateTime (&now); - now = CL (now); + now = BigEndianValue (now); Secs2Date (now, p); } @@ -424,7 +425,7 @@ this_century (void) int retval; this_date_rec (&d); - retval = CW (d.year) / 100 * 100; + retval = BigEndianValue (d.year) / 100 * 100; return retval; } @@ -461,14 +462,14 @@ P5 (PUBLIC pascal trap, String2DateStatus, String2Date, else if (year_length < 3) year += this_century (); - *length_used_ret = CL (offset); + *length_used_ret = BigEndianValue (offset); /* not clear what we should do with other fields, some should probably be zeroed */ - date_time->year = CW (year); - date_time->month = CW (month); - date_time->day = CW (day); + date_time->year = BigEndianValue (year); + date_time->month = BigEndianValue (month); + date_time->day = BigEndianValue (day); retval = longDateFound; } else @@ -497,7 +498,7 @@ P7 (PUBLIC pascal trap, StyledLineBreakCode, StyledLineBreak, int width = 0; /* ### are we losing information here? */ - text_width = Fix2Long (CL (*text_width_fp)); + text_width = Fix2Long (BigEndianValue (*text_width_fp)); for (current_index = text_start, current_char = text[current_index]; current_index < text_end; @@ -506,7 +507,7 @@ P7 (PUBLIC pascal trap, StyledLineBreakCode, StyledLineBreak, /* ### do we do this? */ if (current_char == '\r') { - *text_offset = CL (current_index + 1); + *text_offset = BigEndianValue (current_index + 1); return smBreakWord; } @@ -528,23 +529,23 @@ P7 (PUBLIC pascal trap, StyledLineBreakCode, StyledLineBreak, if (*text_offset) { /* beginning of the line, break here */ - *text_offset = CL (current_index - 1); + *text_offset = BigEndianValue (current_index - 1); return smBreakChar; } - *text_offset = CL (current_index - 1); + *text_offset = BigEndianValue (current_index - 1); return smBreakWord; } else { - *text_offset = CL (last_word_break); + *text_offset = BigEndianValue (last_word_break); return smBreakWord; } } } /* if we got here, that means the run did not extend past the end of the current line */ - *text_width_fp = CL (Long2Fix (text_width - width)); - *text_offset = CL (current_index); + *text_width_fp = BigEndianValue (Long2Fix (text_width - width)); + *text_offset = BigEndianValue (current_index); return smBreakOverflow; } @@ -680,17 +681,17 @@ P2 (PUBLIC pascal trap, void, LongDate2Secs, LongDateRec *, ldatep, LONGINT high, low; INTEGER hour; - hour = CW (ldatep->hour); + hour = BigEndianValue (ldatep->hour); if (ldatep->pm && hour < 12) hour += 12; - secs = ROMlib_long_long_secs (CW (ldatep->year), CW (ldatep->month), - CW (ldatep->day), hour, - CW (ldatep->minute), CW (ldatep->second)); + secs = ROMlib_long_long_secs (BigEndianValue (ldatep->year), BigEndianValue (ldatep->month), + BigEndianValue (ldatep->day), hour, + BigEndianValue (ldatep->minute), BigEndianValue (ldatep->second)); high = secs >> 32; low = secs; - secs_outp[0] = CL (high); - secs_outp[1] = CL (low); + secs_outp[0] = BigEndianValue (high); + secs_outp[1] = BigEndianValue (low); } P2 (PUBLIC pascal trap, void, LongSecs2Date, ULONGINT *, secs_inp, @@ -700,14 +701,14 @@ P2 (PUBLIC pascal trap, void, LongSecs2Date, ULONGINT *, secs_inp, long long secs; INTEGER pm; - secs = ((long long) CL (secs_inp[0]) << 32) | CL (secs_inp[1]); + secs = ((long long) BigEndianValue (secs_inp[0]) << 32) | BigEndianValue (secs_inp[1]); date_to_swapped_fields (secs, &ldatep->year, &ldatep->month, &ldatep->day, &ldatep->hour, &ldatep->minute, &ldatep->second, &ldatep->dayOfWeek, &ldatep->dayOfYear, &ldatep->weekOfYear); - pm = (CW (ldatep->hour) > 12) ? 1 : 0; - ldatep->pm = CW (pm); + pm = (BigEndianValue (ldatep->hour) > 12) ? 1 : 0; + ldatep->pm = BigEndianValue (pm); } /* @@ -766,7 +767,7 @@ GetFormatOrder A0(PUBLIC, INTEGER, GetAppFont) { - return CW (ApFontID); + return BigEndianValue (ApFontID); } #if 0 @@ -840,10 +841,10 @@ P6(PUBLIC pascal trap, void, DrawJustified, Point swapped_denom; warning_unimplemented ("poorly implemented"); - swapped_numer.h = CW (numer.h); - swapped_numer.v = CW (numer.v); - swapped_denom.h = CW (denom.h); - swapped_denom.v = CW (denom.v); + swapped_numer.h = BigEndianValue (numer.h); + swapped_numer.v = BigEndianValue (numer.v); + swapped_denom.h = BigEndianValue (denom.h); + swapped_denom.v = BigEndianValue (denom.v); text_helper (textLength, textPtr, &swapped_numer, &swapped_denom, 0, 0, text_helper_draw); } @@ -879,10 +880,10 @@ P9(PUBLIC pascal trap, INTEGER, PixelToChar, locs = (INTEGER*)alloca( sizeof(INTEGER) * (textLen + 1)); - swapped_numer.h = CW (numer.h); - swapped_numer.v = CW (numer.v); - swapped_denom.h = CW (denom.h); - swapped_denom.v = CW (denom.v); + swapped_numer.h = BigEndianValue (numer.h); + swapped_numer.v = BigEndianValue (numer.v); + swapped_denom.h = BigEndianValue (denom.h); + swapped_denom.v = BigEndianValue (denom.v); int_pix_width = pixelWidth >> 16; @@ -893,19 +894,19 @@ P9(PUBLIC pascal trap, INTEGER, PixelToChar, to account for slop (probably better in the long run). Right now, we do neither. Ick. */ - if (int_pix_width >= CW(locs[textLen])) + if (int_pix_width >= BigEndianValue(locs[textLen])) { retval = textLen; *leadingEdgep = FALSE; - *widthRemainingp = pixelWidth - (CW(locs[textLen]) << 16); + *widthRemainingp = pixelWidth - (BigEndianValue(locs[textLen]) << 16); } else { *widthRemainingp = CLC (-1); - for (i = 0; int_pix_width > CW(locs[i]); ++i) + for (i = 0; int_pix_width > BigEndianValue(locs[i]); ++i) ; if ((i > 0) && - ((int_pix_width - CW(locs[i-1])) > (CW(locs[i]) - int_pix_width))) + ((int_pix_width - BigEndianValue(locs[i-1])) > (BigEndianValue(locs[i]) - int_pix_width))) { retval = i - 1; *leadingEdgep = FALSE; @@ -934,10 +935,10 @@ P8(PUBLIC pascal trap, INTEGER, CharToPixel, warning_unimplemented ("poorly implemented"); - swapped_numer.h = CW (numer.h); - swapped_numer.v = CW (numer.v); - swapped_denom.h = CW (denom.h); - swapped_denom.v = CW (denom.v); + swapped_numer.h = BigEndianValue (numer.h); + swapped_numer.v = BigEndianValue (numer.v); + swapped_denom.h = BigEndianValue (denom.h); + swapped_denom.v = BigEndianValue (denom.v); retval = text_helper (offset, textBuf, &swapped_numer, &swapped_denom, 0, 0, text_helper_measure); retval += (slop / textLen) >> 16; diff --git a/src/segment.cpp b/src/segment.cpp index 1c69d476..ad3f8960 100644 --- a/src/segment.cpp +++ b/src/segment.cpp @@ -69,6 +69,7 @@ typedef HIDDEN_finderinfoptr *finderinfohand; } using namespace Executor; +using namespace ByteSwap; PUBLIC int Executor::ROMlib_cacheheuristic = FALSE; @@ -524,7 +525,7 @@ A2(PUBLIC, void, ROMlib_seginit, LONGINT, argc, char **, argv) /* INTERNAL */ if (argv_to_appfile(fullpathname, &app)) { #if 0 - CurApRefNum = CW(OpenRFPerm(app.fName, CW(app.vRefNum), fsCurPerm)); + CurApRefNum = BigEndianValue(OpenRFPerm(app.fName, BigEndianValue(app.vRefNum), fsCurPerm)); #endif CurApName[0] = MIN(app.fName[0], sizeof(CurApName)-1); BlockMove((Ptr) app.fName+1, (Ptr) CurApName+1, (Size) CurApName[0]); @@ -552,7 +553,7 @@ A2(PUBLIC, void, ROMlib_seginit, LONGINT, argc, char **, argv) /* INTERNAL */ ROMlib_startupscreen = FALSE; ROMlib_exit = TRUE; newcount = Hx(fh, count) + 1; - HxX(fh, count) = CW(newcount); + HxX(fh, count) = BigEndianValue(newcount); SetHandleSize((Handle) fh, (char *) &HxX(fh, files)[newcount] - (char *)STARH(fh)); HxX(fh, files)[Hx(fh, count)-1] = app; @@ -560,7 +561,7 @@ A2(PUBLIC, void, ROMlib_seginit, LONGINT, argc, char **, argv) /* INTERNAL */ if (ROMlib_toopen) { if (argv_to_appfile(ROMlib_toopen, &app)) { newcount = Hx(fh, count) + 1; - HxX(fh, count) = CW(newcount); + HxX(fh, count) = BigEndianValue(newcount); SetHandleSize((Handle) fh, (char *) &HxX(fh, files)[newcount] - (char *) STARH(fh)); HxX(fh, files)[Hx(fh, count)-1] = app; @@ -574,7 +575,7 @@ A2(PUBLIC, void, ROMlib_seginit, LONGINT, argc, char **, argv) /* INTERNAL */ ROMlib_startupscreen = FALSE; ROMlib_exit = TRUE; newcount = Hx(fh, count) + 1; - HxX(fh, count) = CW(newcount); + HxX(fh, count) = BigEndianValue(newcount); SetHandleSize((Handle) fh, (char *) &HxX(fh, files)[newcount] - (char *) STARH(fh)); HxX(fh, files)[Hx(fh, count)-1] = app; @@ -606,7 +607,7 @@ A1(PUBLIC, void, ClrAppFiles, INTEGER, index) /* IMII-58 */ if (STARH((finderinfohand)MR(AppParmHandle))->files[index-1].fType) { STARH((finderinfohand)MR(AppParmHandle))->files[index-1].fType = 0; STARH((finderinfohand)MR(AppParmHandle))->count = - CW(CW(STARH((finderinfohand)MR(AppParmHandle))->count) - 1); + BigEndianValue(BigEndianValue(STARH((finderinfohand)MR(AppParmHandle))->count) - 1); } } @@ -653,7 +654,7 @@ PRIVATE BOOLEAN valid_browser( void ) OSErr err; FInfo finfo; - err = GetFInfo(FinderName, CW(BootDrive), &finfo); + err = GetFInfo(FinderName, BigEndianValue(BootDrive), &finfo); return !ROMlib_nobrowser && err == noErr && finfo.fdType == TICKX("APPL"); } @@ -668,7 +669,7 @@ PRIVATE void launch_browser( void ) ? MIN (flag_bpp, vdriver_max_bpp) : vdriver_max_bpp), 0, 0); - Launch(FinderName, CW(BootDrive)); + Launch(FinderName, BigEndianValue(BootDrive)); } P0(PUBLIC pascal trap, void, ExitToShell) @@ -726,7 +727,7 @@ P0(PUBLIC pascal trap, void, ExitToShell) if (QDExist == EXIST_NO) { a5 = (LONGINT) US_TO_SYN68K(&tmpA5); - CurrentA5 = (Ptr) CL(a5); + CurrentA5 = (Ptr) BigEndianValue(a5); InitGraf((Ptr) quickbytes + sizeof(quickbytes) - 4); } InitFonts(); @@ -761,7 +762,7 @@ P0(PUBLIC pascal trap, void, ExitToShell) CurApName[0] = MIN(reply.fName[0], 31); BlockMove((Ptr) reply.fName+1, (Ptr) CurApName+1, (Size) CurApName[0]); - Launch(CurApName, CW(reply.vRefNum)); + Launch(CurApName, BigEndianValue(reply.vRefNum)); } } } @@ -850,7 +851,7 @@ P1(PUBLIC pascal trap, void, LoadSeg, INTEGER volatile, segno) ResLoad = -1; /* CricketDraw III's behaviour suggested this */ newcode = GetResource(TICK("CODE"), segno); HLock(newcode); - taboff = CW(((INTEGER *) STARH(newcode))[0]); + taboff = BigEndianValue(((INTEGER *) STARH(newcode))[0]); if ((uint16) taboff == 0xA89F) /* magic compressed resource signature */ { /* We are totally dead here. We almost certainly can't use @@ -863,16 +864,16 @@ P1(PUBLIC pascal trap, void, LoadSeg, INTEGER volatile, segno) launch_compressed_lt7); C_ExitToShell (); } - savenentries = nentries = CW(((INTEGER *) STARH(newcode))[1]); + savenentries = nentries = BigEndianValue(((INTEGER *) STARH(newcode))[1]); saveptr = ptr = (short *) ((char *) (long) SYN68K_TO_US(a5) + taboff + Cx(CurJTOffset)); while (--nentries >= 0) { if (ptr[1] != CWC(JMPLINSTR)) { - offbytes = CW(*ptr); - *ptr++ = CW(segno); + offbytes = BigEndianValue(*ptr); + *ptr++ = BigEndianValue(segno); *ptr++ = CWC(JMPLINSTR); *(LONGINT *) ptr = - CL((LONGINT) (long) ((char *) US_TO_SYN68K(STARH(newcode)) + offbytes + 4)); + BigEndianValue((LONGINT) (long) ((char *) US_TO_SYN68K(STARH(newcode)) + offbytes + 4)); ptr += 2; } else ptr += 4; @@ -881,7 +882,7 @@ P1(PUBLIC pascal trap, void, LoadSeg, INTEGER volatile, segno) TRUE); } -#define SEGNOOFP(p) (CW(((INTEGER *)p)[-1])) +#define SEGNOOFP(p) (BigEndianValue(((INTEGER *)p)[-1])) namespace Executor { PRIVATE void unpatch(Ptr, Ptr); @@ -896,7 +897,7 @@ A2(PRIVATE, void, unpatch, Ptr, segstart, Ptr, p) firstpc = MR(*(Ptr *)(p + 2)); ip[1] = ip[-1]; /* the segment number */ - ip[-1] = CW(firstpc - segstart - 4); + ip[-1] = BigEndianValue(firstpc - segstart - 4); ip[0] = CWC(MOVESPINSTR); ip[2] = CWC(LOADSEGTRAP); } diff --git a/src/serial.cpp b/src/serial.cpp index 84a701af..ca506f43 100644 --- a/src/serial.cpp +++ b/src/serial.cpp @@ -53,6 +53,7 @@ char ROMlib_rcsid_serial[] = #endif using namespace Executor; +using namespace ByteSwap; #if defined (__alpha) || defined (LINUX) #define TERMIO @@ -125,7 +126,7 @@ A1(PUBLIC, void, RAMSDClose, SPortSel, port) /* IMII-250 */ A2(PUBLIC, OSErr, SerReset, INTEGER, rn, INTEGER, config) /* IMII-250 */ { - config = CW (config); + config = BigEndianValue (config); return Control(rn, SERSET, (Ptr) &config); } @@ -137,7 +138,7 @@ A3(PUBLIC, OSErr, SerSetBuf, INTEGER, rn, Ptr, p, INTEGER, len) /* IMII-251 */ sersetbuf_t temp; temp.p = RM (p); - temp.i = CW (len); + temp.i = BigEndianValue (len); return Control(rn, SERSETBUF, (Ptr) &temp); } @@ -235,7 +236,7 @@ A1(PRIVATE, DCtlPtr, otherdctl, ParmBlkPtr, pbp) DCtlHandle h; h = 0; - switch (CW(pbp->cntrlParam.ioCRefNum)) { + switch (BigEndianValue(pbp->cntrlParam.ioCRefNum)) { case AINREFNUM: h = GetDCtlEntry(AOUTREFNUM); break; @@ -264,7 +265,7 @@ PRIVATE char *specialname(ParmBlkPtr pbp, const char **lockfilep, { char *retval; - switch (CW(pbp->cntrlParam.ioCRefNum)) { + switch (BigEndianValue(pbp->cntrlParam.ioCRefNum)) { case AINREFNUM: case AOUTREFNUM: #if defined (NEXTSTEP) @@ -310,9 +311,9 @@ void callcomp(ParmBlkPtr pbp, compfuncp comp, OSErr err) } #define DOCOMPLETION(pbp, err) \ - (pbp)->ioParam.ioResult = CW(err); \ + (pbp)->ioParam.ioResult = BigEndianValue(err); \ if (((pbp)->ioParam.ioTrap & asyncTrpBit) && (pbp)->ioParam.ioCompletion) \ - callcomp(pbp, (compfuncp) CL((long)(pbp)->ioParam.ioCompletion), err); \ + callcomp(pbp, (compfuncp) BigEndianValue((long)(pbp)->ioParam.ioCompletion), err); \ return err #else @@ -320,7 +321,7 @@ void callcomp(ParmBlkPtr pbp, compfuncp comp, OSErr err) #warning BINCOMPAT not defined #define DOCOMPLETION(pbp, err) \ - (pbp)->ioParam.ioResult = CW(err); \ + (pbp)->ioParam.ioResult = BigEndianValue(err); \ if ((pbp)->ioParam.ioTrap & asyncTrpBit) \ (*(compfuncp) (pbp)->ioParam.ioCompletion)(); \ return err @@ -402,14 +403,14 @@ A2(PUBLIC, OSErr, ROMlib_serialopen, ParmBlkPtr, pbp, /* INTERNAL */ err = ROMlib_maperrno(); #endif #else - HxX(h, fd) = (CW(pbp->cntrlParam.ioCRefNum) == AINREFNUM || - CW(pbp->cntrlParam.ioCRefNum) == AOUTREFNUM) ? 0 : 1; + HxX(h, fd) = (BigEndianValue(pbp->cntrlParam.ioCRefNum) == AINREFNUM || + BigEndianValue(pbp->cntrlParam.ioCRefNum) == AOUTREFNUM) ? 0 : 1; #endif dcp->dCtlFlags |= CWC(OPENBIT); - SerReset(CW(pbp->cntrlParam.ioCRefNum), - (CW(pbp->cntrlParam.ioCRefNum) == AINREFNUM || - CW(pbp->cntrlParam.ioCRefNum) == AOUTREFNUM) ? - CW(SPPortA) : CW(SPPortB)); + SerReset(BigEndianValue(pbp->cntrlParam.ioCRefNum), + (BigEndianValue(pbp->cntrlParam.ioCRefNum) == AINREFNUM || + BigEndianValue(pbp->cntrlParam.ioCRefNum) == AOUTREFNUM) ? + BigEndianValue(SPPortA) : BigEndianValue(SPPortB)); #if defined (LINUX) || defined (MACOSX_) } #endif @@ -431,42 +432,42 @@ A2(PUBLIC, OSErr, ROMlib_serialprime, ParmBlkPtr, pbp, /* INTERNAL */ size_t req_count; buf = (char *) MR (pbp->ioParam.ioBuffer); - req_count = CL (pbp->ioParam.ioReqCount); + req_count = BigEndianValue (pbp->ioParam.ioReqCount); err = noErr; if (!(dcp->dCtlFlags & CWC(OPENBIT))) err = notOpenErr; else { #if defined(SERIALDEBUG) - warning_trace_info ("serial prime code %d", (LONGINT) (CW(pbp->ioParam.ioTrap) & 0xFF)); + warning_trace_info ("serial prime code %d", (LONGINT) (BigEndianValue(pbp->ioParam.ioTrap) & 0xFF)); #endif h = (hiddenh) MR(dcp->dCtlStorage); - switch (CW(pbp->ioParam.ioTrap) & 0xFF) { + switch (BigEndianValue(pbp->ioParam.ioTrap) & 0xFF) { case aRdCmd: - if (CW(pbp->cntrlParam.ioCRefNum) != AINREFNUM && - CW(pbp->cntrlParam.ioCRefNum) != BINREFNUM) + if (BigEndianValue(pbp->cntrlParam.ioCRefNum) != AINREFNUM && + BigEndianValue(pbp->cntrlParam.ioCRefNum) != BINREFNUM) err = readErr; else { /* this may have to be changed since we aren't looking for parity and framing errors */ #if defined (LINUX) || defined (MACOSX_) - pbp->ioParam.ioActCount = CL(read(HxX(h, fd), buf, req_count)); + pbp->ioParam.ioActCount = BigEndianValue(read(HxX(h, fd), buf, req_count)); #elif defined (MSDOS) || defined (CYGWIN32) - pbp->ioParam.ioActCount = CL(serial_bios_read(HxX(h, fd), buf, + pbp->ioParam.ioActCount = BigEndianValue(serial_bios_read(HxX(h, fd), buf, req_count)); #else #warning not sure what to do here #endif #if defined(SERIALDEBUG) warning_trace_info ("serial prime read %d bytes, first is 0x%0x", - (LONGINT) CL(pbp->ioParam.ioActCount), + (LONGINT) BigEndianValue(pbp->ioParam.ioActCount), (LONGINT) (unsigned char) buf[0]); #endif } break; case aWrCmd: - if (CW(pbp->cntrlParam.ioCRefNum) != AOUTREFNUM && - CW(pbp->cntrlParam.ioCRefNum) != BOUTREFNUM) + if (BigEndianValue(pbp->cntrlParam.ioCRefNum) != AOUTREFNUM && + BigEndianValue(pbp->cntrlParam.ioCRefNum) != BOUTREFNUM) err = writErr; else { #if defined(SERIALDEBUG) @@ -475,10 +476,10 @@ A2(PUBLIC, OSErr, ROMlib_serialprime, ParmBlkPtr, pbp, /* INTERNAL */ (LONGINT) (unsigned char) buf[0]); #endif #if defined (LINUX) || defined (MACOSX_) - pbp->ioParam.ioActCount = CL(write(HxX(h, fd), + pbp->ioParam.ioActCount = BigEndianValue(write(HxX(h, fd), buf, req_count)); #elif defined (MSDOS) || defined (CYGWIN32) - pbp->ioParam.ioActCount = CL( serial_bios_write(HxX(h, fd), + pbp->ioParam.ioActCount = BigEndianValue( serial_bios_write(HxX(h, fd), buf, req_count)); #else #warning not sure what to do here @@ -871,16 +872,16 @@ A2(PUBLIC, OSErr, ROMlib_serialctl, ParmBlkPtr, pbp, /* INTERNAL */ else { #if defined(SERIALDEBUG) warning_trace_info ("serial control code = %d, param0 = 0x%x", - (LONGINT) CW(pbp->cntrlParam.csCode), - (LONGINT) (unsigned short) CW(pbp->cntrlParam.csParam[0])); + (LONGINT) BigEndianValue(pbp->cntrlParam.csCode), + (LONGINT) (unsigned short) BigEndianValue(pbp->cntrlParam.csParam[0])); #endif h = (hiddenh) MR(dcp->dCtlStorage); - switch (CW(pbp->cntrlParam.csCode)) { + switch (BigEndianValue(pbp->cntrlParam.csCode)) { case SERKILLIO: err = noErr; /* All I/O done synchronously */ break; case SERSET: - err = serset(HxX(h, fd), CW(pbp->cntrlParam.csParam[0])); + err = serset(HxX(h, fd), BigEndianValue(pbp->cntrlParam.csParam[0])); break; case SERSETBUF: err = noErr; /* ignored */ @@ -896,7 +897,7 @@ A2(PUBLIC, OSErr, ROMlib_serialctl, ParmBlkPtr, pbp, /* INTERNAL */ err = ctlbrk(HxX(h, fd), SER_STOP); break; case SERBAUDRATE: - err = setbaud(HxX(h, fd), CW(pbp->cntrlParam.csParam[0])); + err = setbaud(HxX(h, fd), BigEndianValue(pbp->cntrlParam.csParam[0])); break; case SERMISC: #if defined (MSDOS) || defined (CYGWIN32) @@ -970,10 +971,10 @@ A2(PUBLIC, OSErr, ROMlib_serialstatus, ParmBlkPtr, pbp, /* INTERNAL */ err = notOpenErr; else { #if defined(SERIALDEBUG) - warning_trace_info ("serial status csCode = %d", (LONGINT) CW(pbp->cntrlParam.csCode)); + warning_trace_info ("serial status csCode = %d", (LONGINT) BigEndianValue(pbp->cntrlParam.csCode)); #endif h = (hiddenh) MR(dcp->dCtlStorage); - switch (CW(pbp->cntrlParam.csCode)) { + switch (BigEndianValue(pbp->cntrlParam.csCode)) { case SERGETBUF: #if defined (LINUX) || defined (MACOSX_) if (ioctl(HxX(h, fd), FIONREAD, &n) < 0) @@ -985,7 +986,7 @@ A2(PUBLIC, OSErr, ROMlib_serialstatus, ParmBlkPtr, pbp, /* INTERNAL */ #if defined(SERIALDEBUG) warning_trace_info ("serial status getbuf = %d", (LONGINT) n); #endif - *(LONGINT *) pbp->cntrlParam.csParam = CL(n); + *(LONGINT *) pbp->cntrlParam.csParam = BigEndianValue(n); err = noErr; } break; diff --git a/src/sound.cpp b/src/sound.cpp index d4e9dd29..78c5ac55 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -20,6 +20,7 @@ char ROMlib_rcsid_sound[] = #include "rsys/mman.h" using namespace Executor; +using namespace ByteSwap; /* TRUE when we want to pretend this host has no sound support. */ bool Executor::sound_disabled_p; @@ -58,9 +59,9 @@ PUBLIC int Executor::ROMlib_PretendSound = soundpretend; static inline bool qfull_p (SndChannelPtr chanp) { - return ((CW (chanp->qTail) == CW (chanp->qHead) - 1 || + return ((BigEndianValue (chanp->qTail) == BigEndianValue (chanp->qHead) - 1 || (chanp->qHead == CWC (0) - && CW (chanp->qTail) == CW (chanp->qLength) - 1))); + && BigEndianValue (chanp->qTail) == BigEndianValue (chanp->qLength) - 1))); } static inline bool @@ -73,7 +74,7 @@ qempty_p (SndChannelPtr chanp) * get 2.0 out the door. */ return (chanp->qHead == chanp->qTail - || CW (chanp->qLength) <= 0); + || BigEndianValue (chanp->qLength) <= 0); } static inline void @@ -81,9 +82,9 @@ enq (SndChannelPtr chanp, SndCommand cmd) { unsigned tail; - tail = CW (chanp->qTail); + tail = BigEndianValue (chanp->qTail); chanp->queue[tail] = cmd; - chanp->qTail = CW ((tail + 1) % CW (chanp->qLength)); + chanp->qTail = BigEndianValue ((INTEGER)((tail + 1) % BigEndianValue (chanp->qLength))); } static inline SndCommand @@ -92,9 +93,9 @@ deq (SndChannelPtr chanp) SndCommand ret; unsigned head; - head = CW (chanp->qHead); + head = BigEndianValue (chanp->qHead); ret = chanp->queue[head]; - chanp->qHead = CW ((head + 1) % CW (chanp->qLength)); + chanp->qHead = BigEndianValue ((INTEGER)((head + 1) % BigEndianValue (chanp->qLength))); return ret; } @@ -275,12 +276,12 @@ PUBLIC int Executor::ROMlib_get_snd_cmds (Handle sndh, SndCommand **cmdsp) int retval; p = STARH (sndh); - format = CW (*(INTEGER *)p); + format = BigEndianValue (*(INTEGER *)p); switch (format) { case 1: p += 2; - num_formats = CW (*(INTEGER *)p); + num_formats = BigEndianValue (*(INTEGER *)p); switch (num_formats) { case 0: @@ -308,7 +309,7 @@ PUBLIC int Executor::ROMlib_get_snd_cmds (Handle sndh, SndCommand **cmdsp) /* Now p points to "Number of sound commands" field of resource */ - retval = CW (*(INTEGER *)p); + retval = BigEndianValue (*(INTEGER *)p); *cmdsp = (SndCommand *)(p+2); return retval; @@ -329,12 +330,12 @@ P3(PUBLIC, pascal trap OSErr, SndPlay, SndChannelPtr, chanp, Handle, sndh, resp = NULL; if (resp) - format = CW (*(INTEGER *)resp); + format = BigEndianValue (*(INTEGER *)resp); else format = 0; warning_sound_log ("chanp %p fmt %d num_fmts %d async %d", - chanp, format, resp ? CW (*((INTEGER *)(resp+2))) : 0, + chanp, format, resp ? BigEndianValue (*((INTEGER *)(resp+2))) : 0, async); warning_sound_log (" sndh %s", (HGetState(sndh) & LOCKBIT) @@ -374,7 +375,7 @@ P3(PUBLIC, pascal trap OSErr, SndPlay, SndChannelPtr, chanp, Handle, sndh, offset */ if (cmd.cmd & CWC (0x8000)) { - cmd.param2 = (LONGINT) RM ((resp + CL (cmd.param2))); + cmd.param2 = (LONGINT) RM ((resp + BigEndianValue (cmd.param2))); cmd.cmd &= CWC (~0x8000); } @@ -451,11 +452,6 @@ P4(PUBLIC pascal trap, OSErr, SndNewChannel, HIDDEN_SndChannelPtr *, chanpp, P4(PUBLIC, pascal trap OSErr, SndAddModifier, SndChannelPtr, chanp, ProcPtr, mod, INTEGER, id, LONGINT, init) { -#if defined(OLD_BROKEN_NEXTSTEP_SOUND) - Handle h; - SndCommand cmd; - ModifierStubPtr modp; -#endif /* defined(OLD_BROKEN_NEXTSTEP_SOUND) */ OSErr retval; warning_sound_log ("chanp %p", chanp); @@ -468,53 +464,10 @@ P4(PUBLIC, pascal trap OSErr, SndAddModifier, SndChannelPtr, chanp, case soundpretend: retval = noErr; break; -#if defined(OLD_BROKEN_NEXTSTEP_SOUND) - case soundon: - if ((unsigned short) chanp->qLength != (unsigned short) CWC(stdQLength)) - retval = badChannel; - else { - modp = (ModifierStubPtr) NewPtr(sizeof(ModifierStub)); - modp->nextStub = chanp->firstMod; - chanp->firstMod = CL(modp); - modp->flags = 0; - if (mod) { - modp->code = CL(mod); - modp->hState = 0; - } else { - h = GetResource(TICK("snth"), id); - if (STARH(h) != (Ptr) P_snth5) { /* ACK; phone handle stuff */ - LoadResource(h); - modp->flags = MOD_SYNTH_FLAG; - modp->hState = HGetState(h); - HLock(h); - } - modp->code = (ProcPtr) h->p; - } - modp->userInfo = 0; - modp->count = 0; - modp->every = 0; - if (modp->code) { - cmd.cmd = CWC(initCmd); - cmd.param1 = CWC(0); - cmd.param2 = CL(init); - retval = SndDoImmediate(chanp, &cmd); - } else - retval = resProblem; - } - break; -#endif } return retval; } -#if defined(OLD_BROKEN_NEXTSTEP_SOUND) -static void dumpcmd(SndCommand *cmdp) -{ - printf("#%x,1-%x,2-%x.", (LONGINT) CW(cmdp->cmd), (LONGINT) CW(cmdp->param1), (LONGINT) CL(cmdp->param2)); -} -#endif - - typedef pascal BOOLEAN (*snthfp)(SndChannelPtr, SndCommand *, ModifierStubPtr); static BOOLEAN callasynth(SndChannelPtr chanp, SndCommand *cmdp, ModifierStubPtr mp) @@ -526,29 +479,6 @@ static BOOLEAN callasynth(SndChannelPtr chanp, SndCommand *cmdp, ModifierStubPtr return CToPascalCall((void*)MR(mp->code), CTOP_SectRect, chanp, cmdp, mp); } -#if defined(OLD_BROKEN_NEXTSTEP_SOUND) -PRIVATE void recsndcmd(SndChannelPtr chanp, SndCommand *cmdp, - ModifierStubPtr mp) -{ - INTEGER i; - BOOLEAN doanother; - - if (mp) { - i = 0; - do { - doanother = callasynth(chanp, cmdp, mp); - recsndcmd(chanp, cmdp, MR(mp->nextStub)); - if (doanother) { - cmdp->cmd = CWC(requestNextCmd); - cmdp->param1 = CW(++i); - cmdp->param2 = 0; - } - } while (doanother); - } -} -#endif /* defined(OLD_BROKEN_NEXTSTEP_SOUND) */ - - static inline boolean_t earlier_p (snd_time t1, snd_time t2) { @@ -566,7 +496,7 @@ earlier (snd_time t1, snd_time t2) static inline unsigned int snd_duration (SoundHeaderPtr hp) { - return CL (hp->length); + return BigEndianValue (hp->length); } #define CMD_DONE(c) (SND_CHAN_FLAGS_X (c) &= CWC (~CHAN_CMDINPROG_FLAG)) @@ -604,8 +534,8 @@ do_current_command (SndChannelPtr chanp, struct hunger_info info) warning_sound_log ("bufferCmd dur %d", (int) duration); - if (resample (sp, info.buf, CL (hp->length), - info.bufsize, CL (hp->sampleRate), + if (resample (sp, info.buf, BigEndianValue (hp->length), + info.bufsize, BigEndianValue (hp->sampleRate), SND_RATE << 16, &SND_CHAN_CURRENT_START (chanp), &SND_CHAN_PREV_SAMP (chanp), @@ -664,11 +594,11 @@ do_current_db (SndChannelPtr chanp, struct hunger_info info) f2d (SND_CHAN_CURRENT_START (chanp)), (int) SND_CHAN_TIME (chanp), (int) info.t3, - CL (dbp->dbNumFrames), - CL (dbhp->dbhSampleRate) / (double) (1 << 16)); + BigEndianValue (dbp->dbNumFrames), + BigEndianValue (dbhp->dbhSampleRate) / (double) (1 << 16)); #endif - if (resample (sp, info.buf, CL (dbp->dbNumFrames), - info.bufsize, CL (dbhp->dbhSampleRate), + if (resample (sp, info.buf, BigEndianValue (dbp->dbNumFrames), + info.bufsize, BigEndianValue (dbhp->dbhSampleRate), SND_RATE << 16, &SND_CHAN_CURRENT_START (chanp), &SND_CHAN_PREV_SAMP (chanp), @@ -687,13 +617,13 @@ do_current_db (SndChannelPtr chanp, struct hunger_info info) } #if 0 warning_sound_log ("dblback %p ch %p bp %p", - CL (dbhp->dbhDoubleBack), + BigEndianValue (dbhp->dbhDoubleBack), chanp, dbp); warning_sound_log (" frs %d flgs %d ui1 %x ui2 %x", - CL (dbp->dbNumFrames), - CL (dbp->dbFlags), - CL (dbp->dbUserInfo[0]), - CL (dbp->dbUserInfo[1])); + BigEndianValue (dbp->dbNumFrames), + BigEndianValue (dbp->dbFlags), + BigEndianValue (dbp->dbUserInfo[0]), + BigEndianValue (dbp->dbUserInfo[1])); #endif CToPascalCall ((void*)MR (dbhp->dbhDoubleBack), CTOP_SetCTitle, chanp, dbp); @@ -811,8 +741,8 @@ P3(PUBLIC, pascal trap OSErr, SndDoCommand, SndChannelPtr, chanp, warning_sound_log ("cmdp = NULL"); else warning_sound_log - ("cmd %d param1 0x%x param2 0x%x nowait %d", CW (cmdp->cmd), - CW (cmdp->param1), CL (cmdp->param2), CW (nowait)); + ("cmd %d param1 0x%x param2 0x%x nowait %d", BigEndianValue (cmdp->cmd), + BigEndianValue (cmdp->param1), BigEndianValue (cmdp->param2), CW (nowait)); #endif #if ERROR_SUPPORTED_P (ERROR_SOUND_LOG) @@ -826,7 +756,7 @@ P3(PUBLIC, pascal trap OSErr, SndDoCommand, SndChannelPtr, chanp, else warning_sound_log (" len %d rate 0x%x encode %d freq %d", - CL (hp->length), CL (hp->sampleRate), hp->encode, + BigEndianValue (hp->length), BigEndianValue (hp->sampleRate), hp->encode, hp->baseFrequency); } #endif @@ -893,7 +823,7 @@ P2 (PUBLIC, pascal trap OSErr, SndDoImmediate, SndChannelPtr, chanp, #endif { cmd = *cmdp; - switch (CW (cmd.cmd)) + switch (BigEndianValue (cmd.cmd)) { case flushCmd: warning_sound_log ("flushCmd"); @@ -924,7 +854,7 @@ P2 (PUBLIC, pascal trap OSErr, SndDoImmediate, SndChannelPtr, chanp, break; default: - warning_sound_log ("UNKNOWN CMD %d", CW (cmd.cmd)); + warning_sound_log ("UNKNOWN CMD %d", BigEndianValue (cmd.cmd)); retval = noErr; } } @@ -1053,13 +983,13 @@ P2(PUBLIC, pascal trap OSErr, SndDisposeChannel, SndChannelPtr, chanp, block = block_virtual_ints (); } restore_virtual_ints (block); - nextmp = CL(chanp->firstMod); + nextmp = BigEndianValue(chanp->firstMod); while ((mp = nextmp)) { - nextmp = CL(mp->nextStub); + nextmp = BigEndianValue(mp->nextStub); cmd.cmd = CWC(freeCmd); callasynth(chanp, &cmd, mp); if (mp->flags & MOD_SYNTH_FLAG) { - h = RecoverHandle((Ptr) CL(mp->code)); + h = RecoverHandle((Ptr) BigEndianValue(mp->code)); HSetState(h, mp->hState); } DisposPtr((Ptr) mp); @@ -1088,26 +1018,3 @@ P2(PUBLIC, pascal trap OSErr, SndDisposeChannel, SndChannelPtr, chanp, } return retval; } - -#if defined(OLD_BROKEN_NEXTSTEP_SOUND) -void ROMlib_soundcomplete( void *vp ) -{ - SndChannelPtr chanp; - virtual_int_state_t block; - - chanp = vp; - block = block_virtual_ints (); - if (chanp->flags & CWC(CHAN_IMMEDIATE_FLAG)) - chanp->flags &= CWC(~CHAN_IMMEDIATE_FLAG); - else { - chanp->qHead = CW(CW(chanp->qHead) + 1); - if ((unsigned short) chanp->qHead == (unsigned short) CWC(stdQLength)) - chanp->qHead = CWC(0); - if (chanp->qHead == chanp->qTail) - chanp->flags &= CWC(~CHAN_BUSY_FLAG); - else - recsndcmd(chanp, &chanp->queue[CW(chanp->qHead)], CL(chanp->firstMod)); - } - restore_virtual_ints (block); -} -#endif diff --git a/src/soundIMVI.cpp b/src/soundIMVI.cpp index 3716769d..9b6485c6 100644 --- a/src/soundIMVI.cpp +++ b/src/soundIMVI.cpp @@ -23,6 +23,7 @@ char ROMlib_rcsid_soundIMVI[] = #include "rsys/soundopts.h" using namespace Executor; +using namespace ByteSwap; P1(PUBLIC, pascal trap void, SndGetSysBeepState, INTEGER *, statep) { @@ -170,8 +171,8 @@ start_playing (SndChannelPtr chanp, SndDoubleBufferHeaderPtr paramp, task_inserted = TRUE; } duration_in_mills = (((long long) 1000 * (1 << 16) - * CL (dbp->dbNumFrames)) - / CL (paramp->dbhSampleRate)); + * BigEndianValue (dbp->dbNumFrames)) + / BigEndianValue (paramp->dbhSampleRate)); PrimeTime ((QElemPtr) &call_back_info.task, duration_in_mills); } else @@ -222,10 +223,10 @@ P2(PUBLIC, pascal trap OSErr, SndPlayDoubleBuffer, SndChannelPtr, chanp, warning_sound_log ("paramp = NULL"); else warning_sound_log ("nc %d sz %d c %d p %d", - CW (paramp->dbhNumChannels), - CW (paramp->dbhSampleSize), - CW (paramp->dbhCompressionID), - CW (paramp->dbhPacketSize)); + BigEndianValue (paramp->dbhNumChannels), + BigEndianValue (paramp->dbhSampleSize), + BigEndianValue (paramp->dbhCompressionID), + BigEndianValue (paramp->dbhPacketSize)); SND_CHAN_DBHP (chanp) = paramp; SND_CHAN_CURRENT_DB (chanp) = 0; /* diff --git a/src/soundfake.cpp b/src/soundfake.cpp index 82de5145..65a500d4 100644 --- a/src/soundfake.cpp +++ b/src/soundfake.cpp @@ -14,6 +14,7 @@ char ROMlib_rcsid_soundfake[] = #include "TimeMgr.h" using namespace Executor; +using namespace ByteSwap; /* This driver "goes through the motions" of playing a sound without * actually interacting with any sound hardware. The intent is to @@ -67,7 +68,7 @@ void SoundFake::NoteSoundInterrupt(void) /* Installs a time manager task to call back at the requested time. */ void SoundFake::set_up_tm_task(void) { - fake_sound_tm_task.tmAddr = (ProcPtr) CL ((uint32) fake_sound_callback); + fake_sound_tm_task.tmAddr = (ProcPtr) BigEndianValue ((uint32) fake_sound_callback); InsTime ((QElemPtr) &fake_sound_tm_task); PrimeTime ((QElemPtr) &fake_sound_tm_task, MSECS_FOR_BUFFER_TO_PLAY); } diff --git a/src/splash.cpp b/src/splash.cpp index 2af4178e..be3da0b6 100644 --- a/src/splash.cpp +++ b/src/splash.cpp @@ -47,11 +47,11 @@ splash_screen_display (boolean_t button_p, char *basename) header = *(struct splash_screen_header *) ROMlib_splashp->chars; - bpp = CL (header.bpp); - log2_bpp = CL (header.log2_bpp); + bpp = BigEndianValue (header.bpp); + log2_bpp = BigEndianValue (header.log2_bpp); - memcpy (color_buf, ROMlib_splashp->chars + CL (header.color_offset), - CL (header.color_count) * sizeof *color_buf); + memcpy (color_buf, ROMlib_splashp->chars + BigEndianValue (header.color_offset), + BigEndianValue (header.color_count) * sizeof *color_buf); bg_pixel = ((bpp == vdriver_bpp) ? header.bg_pixel @@ -71,7 +71,7 @@ splash_screen_display (boolean_t button_p, char *basename) } if (vdriver_bpp == bpp) - vdriver_set_colors (0, CL (header.color_count), (ColorSpec *) color_buf); + vdriver_set_colors (0, BigEndianValue (header.color_count), (ColorSpec *) color_buf); splash_top = (vdriver_height - SPLASH_SCREEN_HEIGHT) / 2; splash_left = (vdriver_width - SPLASH_SCREEN_WIDTH) / 2; @@ -90,14 +90,14 @@ splash_screen_display (boolean_t button_p, char *basename) #define ROWS_PER_PASS 32 - p = (char *) ROMlib_splashp->chars + CL (header.splash_bits_offset); + p = (char *) ROMlib_splashp->chars + BigEndianValue (header.splash_bits_offset); splash_row_bytes = SPLASH_SCREEN_WIDTH >> (3 - log2_bpp); tmp_buf = alloca (vdriver_row_bytes * ROWS_PER_PASS); /* Set up phony bitmap for screen. */ screen_bitmap.baseAddr = (Ptr) RM (vdriver_fbuf); - screen_bitmap.rowBytes = CW (vdriver_row_bytes); + screen_bitmap.rowBytes = BigEndianValue (vdriver_row_bytes); SetRect (&screen_bitmap.bounds, 0, 0, vdriver_width, ROWS_PER_PASS); src_origin.h = src_origin.v = CWC (0); @@ -117,7 +117,7 @@ splash_screen_display (boolean_t button_p, char *basename) { /* Set up phony bitmap to clear screen. */ blank_bitmap.baseAddr = (Ptr) RM (tmp_buf); - blank_bitmap.rowBytes = CW (vdriver_row_bytes); + blank_bitmap.rowBytes = BigEndianValue (vdriver_row_bytes); SetRect (&blank_bitmap.bounds, 0, 0, vdriver_width, ROWS_PER_PASS); memset (tmp_buf, bg_pixel, vdriver_row_bytes * ROWS_PER_PASS); @@ -126,7 +126,7 @@ splash_screen_display (boolean_t button_p, char *basename) int num_rows; num_rows = MIN (ROWS_PER_PASS, vdriver_height - i); - (RGN_BBOX (row_rgn)).bottom = CW (num_rows); + (RGN_BBOX (row_rgn)).bottom = BigEndianValue (num_rows); srcblt_rgn (row_rgn, srcCopy, vdriver_log2_bpp, &blank_bitmap, &screen_bitmap, &src_origin, &dst_origin, ~0, 0); @@ -144,13 +144,13 @@ splash_screen_display (boolean_t button_p, char *basename) /* Set up phony bitmap for src row. */ src_row_bitmap.baseAddr = (Ptr) RM (tmp_buf); - src_row_bitmap.rowBytes = CW (SPLASH_SCREEN_WIDTH + src_row_bitmap.rowBytes = BigEndianValue (SPLASH_SCREEN_WIDTH >> (3 - vdriver_log2_bpp)); SetRect (&src_row_bitmap.bounds, 0, 0, SPLASH_SCREEN_WIDTH, ROWS_PER_PASS); RGN_BBOX (row_rgn) = src_row_bitmap.bounds; SWAPPED_OPW (screen_bitmap.bounds.left, -, splash_left); - screen_bitmap.bounds.top = CW (-splash_top); + screen_bitmap.bounds.top = BigEndianValue (-splash_top); screen_bitmap.baseAddr = (Ptr) RM (vdriver_fbuf); /* Actually read and display the splash screen bits. */ @@ -159,7 +159,7 @@ splash_screen_display (boolean_t button_p, char *basename) int num_rows; num_rows = MIN (ROWS_PER_PASS, SPLASH_SCREEN_HEIGHT - i); - (RGN_BBOX (row_rgn)).bottom = CW (num_rows); + (RGN_BBOX (row_rgn)).bottom = BigEndianValue (num_rows); memcpy (tmp_buf, p, splash_row_bytes * num_rows); p += splash_row_bytes * num_rows; diff --git a/src/srcblt.cpp b/src/srcblt.cpp index d59beda1..24a03726 100644 --- a/src/srcblt.cpp +++ b/src/srcblt.cpp @@ -18,6 +18,7 @@ char ROMlib_rcsid_srcblt[] = #warning This seems unsafe... using namespace Executor; +using namespace ByteSwap; int srcblt_log2_bpp asm ("_srcblt_log2_bpp"); @@ -110,7 +111,7 @@ srcblt_rgn (RgnHandle rh, int mode, int log2_bpp, } else { - srcblt_src_row_bytes = CW (src->rowBytes) & ROWBYTES_VALUE_BITS; + srcblt_src_row_bytes = BigEndianValue (src->rowBytes) & ROWBYTES_VALUE_BITS; src_baseaddr = (char *) MR (src->baseAddr); #if defined (VGA_SCREEN_NEEDS_FAR_PTR) asm ("movw %%ds,%0" : "=m" (srcblt_src_selector)); @@ -123,20 +124,20 @@ srcblt_rgn (RgnHandle rh, int mode, int log2_bpp, #if defined (VGA_SCREEN_NEEDS_FAR_PTR) srcblt_dst_selector = vga_screen_selector; #endif - top = CW (dst->bounds.top); - left = CW (dst->bounds.left); + top = BigEndianValue (dst->bounds.top); + left = BigEndianValue (dst->bounds.left); /* Hide the cursor if necessary. */ old_vis_p |= (host_hide_cursor_if_intersects - (CW (rp->rgnBBox.top) - top, - CW (rp->rgnBBox.left) - left, - CW (rp->rgnBBox.bottom) - top, - CW (rp->rgnBBox.right) - left)); + (BigEndianValue (rp->rgnBBox.top) - top, + BigEndianValue (rp->rgnBBox.left) - left, + BigEndianValue (rp->rgnBBox.bottom) - top, + BigEndianValue (rp->rgnBBox.right) - left)); cursor_maybe_changed_p = TRUE; } else { - srcblt_dst_row_bytes = CW (dst->rowBytes) & ROWBYTES_VALUE_BITS; + srcblt_dst_row_bytes = BigEndianValue (dst->rowBytes) & ROWBYTES_VALUE_BITS; dst_baseaddr = (char *) MR (dst->baseAddr); #if defined (VGA_SCREEN_NEEDS_FAR_PTR) asm ("movw %%ds,%0" : "=m" (srcblt_dst_selector)); @@ -147,8 +148,8 @@ srcblt_rgn (RgnHandle rh, int mode, int log2_bpp, #endif /* VDRIVER_SUPPORTS_REAL_SCREEN_BLITS */ { /* Default to values for non-screen blit. */ - srcblt_src_row_bytes = CW (src->rowBytes) & ROWBYTES_VALUE_BITS; - srcblt_dst_row_bytes = CW (dst->rowBytes) & ROWBYTES_VALUE_BITS; + srcblt_src_row_bytes = BigEndianValue (src->rowBytes) & ROWBYTES_VALUE_BITS; + srcblt_dst_row_bytes = BigEndianValue (dst->rowBytes) & ROWBYTES_VALUE_BITS; src_baseaddr = (char *) MR (src->baseAddr); dst_baseaddr = (char *) MR (dst->baseAddr); #if defined (VGA_SCREEN_NEEDS_FAR_PTR) @@ -159,10 +160,10 @@ srcblt_rgn (RgnHandle rh, int mode, int log2_bpp, } /* Compute the offset to map dst y coords to src bitmap coords.*/ - src_y_offset = (CW (src_origin->v) - CW (src->bounds.top) - - CW (dst_origin->v)); + src_y_offset = (BigEndianValue (src_origin->v) - BigEndianValue (src->bounds.top) + - BigEndianValue (dst_origin->v)); src_baseaddr += src_y_offset * srcblt_src_row_bytes; - dst_baseaddr -= CW (dst->bounds.top) * srcblt_dst_row_bytes; + dst_baseaddr -= BigEndianValue (dst->bounds.top) * srcblt_dst_row_bytes; /* Handle the common case of flipped fg/bk colors and a copy xfer mode. */ if ((mode & 3) == (srcCopy & 3) /* either srcCopy or notSrcCopy */ @@ -173,10 +174,10 @@ srcblt_rgn (RgnHandle rh, int mode, int log2_bpp, srcblt_fg_color = ~0; } - srcblt_x_offset = -(CW (dst->bounds.left) << log2_bpp); + srcblt_x_offset = -(BigEndianValue (dst->bounds.left) << log2_bpp); - src_x_offset = (((CW (src_origin->h) - CW (src->bounds.left)) - - (CW (dst_origin->h) - CW (dst->bounds.left))) + src_x_offset = (((BigEndianValue (src_origin->h) - BigEndianValue (src->bounds.left)) + - (BigEndianValue (dst_origin->h) - BigEndianValue (dst->bounds.left))) << log2_bpp); src_baseaddr += (src_x_offset >> 3); left_shift = src_x_offset & 7; diff --git a/src/stdfile.cpp b/src/stdfile.cpp index 9dbb6736..8d7b4a5c 100644 --- a/src/stdfile.cpp +++ b/src/stdfile.cpp @@ -76,6 +76,7 @@ PUBLIC int Executor::nodrivesearch_p = FALSE; #include "rsys/system_error.h" using namespace Executor; +using namespace ByteSwap; typedef pascal BOOLEAN (*filtp)(DialogPtr dp, EventRecord *evp, INTEGER *ith); @@ -199,12 +200,12 @@ A1(PRIVATE, INTEGER, movealert, INTEGER, id) if (!(*h).p) LoadResource(h); rp = (Rect *) STARH(h); - dh = CW(rp->right) - CW(rp->left); - dv = CW(rp->bottom) - CW(rp->top); + dh = BigEndianValue(rp->right) - BigEndianValue(rp->left); + dv = BigEndianValue(rp->bottom) - BigEndianValue(rp->top); rp->left = CWC(150); rp->top = CWC(30); - rp->right = CW(150 + dh); - rp->bottom = CW(30 + dv); + rp->right = BigEndianValue(150 + dh); + rp->bottom = BigEndianValue(30 + dv); return(Alert(id, (ProcPtr)0)); } @@ -226,8 +227,8 @@ A1(PRIVATE, void, drawminiicon, INTEGER, icon) bm.bounds.right = bm.bounds.bottom = CWC(16); r.top = PORT_PEN_LOC (thePort).v; r.left = PORT_PEN_LOC (thePort).h; - r.bottom = CW(CW(r.top) + 16); - r.right = CW(CW(r.left) + 16); + r.bottom = BigEndianValue(BigEndianValue(r.top) + 16); + r.right = BigEndianValue(BigEndianValue(r.left) + 16); CopyBits(&bm, PORT_BITS_FOR_COPY (thePort), &bm.bounds, &r, srcCopy, NULL); HUnlock(h); @@ -251,9 +252,9 @@ A3(PRIVATE, void, drawinboxwithicon, StringPtr, str, Rect *, rp, INTEGER, icon) * ok. */ - MoveTo(CW(rp->left) + 2, CW(rp->top)); + MoveTo(BigEndianValue(rp->left) + 2, BigEndianValue(rp->top)); drawminiicon(icon); - MoveTo(CW(rp->left) + 2 + 16 + 3 , CW(rp->top) + CW(rp->bottom)-1); /* see note above */ + MoveTo(BigEndianValue(rp->left) + 2 + 16 + 3 , BigEndianValue(rp->top) + BigEndianValue(rp->bottom)-1); /* see note above */ r.left = rp->left; r.right = rp->right; r.top = rp->top; @@ -261,14 +262,14 @@ A3(PRIVATE, void, drawinboxwithicon, StringPtr, str, Rect *, rp, INTEGER, icon) ClipRect(&r); strlen = *str; MeasureText(strlen, (Ptr) (str + 1), (Ptr) strwidths); - lengthavail = CW(rp->right) - (CW(rp->left) + 2 + 16 + 3); - if (CW(strwidths[strlen]) > lengthavail) { + lengthavail = BigEndianValue(rp->right) - (BigEndianValue(rp->left) + 2 + 16 + 3); + if (BigEndianValue(strwidths[strlen]) > lengthavail) { width = StringWidth((StringPtr) ellipsis); /* 4 might be the space on the right of the ellipsis. */ /* TODO: figure out exactly what the number is. */ lengthavail -= (width + 4); widp = strwidths; - while (CW(*++widp) < lengthavail) + while (BigEndianValue(*++widp) < lengthavail) DrawChar(*++str); DrawString((StringPtr) ellipsis); } else @@ -287,8 +288,8 @@ A2(PRIVATE, void, safeflflip, fltype *, f, INTEGER, sel) if (sel >= fltop && sel < fltop + f->flnmlin) { r.left = f->flrect.left; r.right = f->flrect.right; - r.top = CW(CW(f->flrect.top) + (sel - fltop) * f->fllinht); - r.bottom = CW(CW(r.top) + f->fllinht); + r.top = BigEndianValue(BigEndianValue(f->flrect.top) + (sel - fltop) * f->fllinht); + r.bottom = BigEndianValue(BigEndianValue(r.top) + f->fllinht); if (EmptyRgn(MR(((WindowPeek)thePort)->updateRgn))) /* stuff to draw? */ InvertRect(&r); /* no: we can flip */ else @@ -308,8 +309,8 @@ A3(PRIVATE, void, flupdate, fltype *, f, INTEGER, st, INTEGER, n) Rect r; fltop = GetCtlValue(f->flsh); - r.top = CW(CW(f->flrect.top) + (st - fltop) * f->fllinht); - r.bottom = CW(f->flascent); + r.top = BigEndianValue(BigEndianValue(f->flrect.top) + (st - fltop) * f->fllinht); + r.bottom = BigEndianValue(f->flascent); r.left = f->flrect.left; r.right = f->flrect.right; @@ -319,16 +320,16 @@ A3(PRIVATE, void, flupdate, fltype *, f, INTEGER, st, INTEGER, n) drawinboxwithicon((StringPtr) (MR(*f->flstrs) + ip->floffs), &r, ip->flicns & ICONMASK); if (ip->flicns & GRAYBIT) { - r.bottom = CW(CW(r.top) + f->fllinht); + r.bottom = BigEndianValue(BigEndianValue(r.top) + f->fllinht); PenMode(notPatBic); PenPat(gray); PaintRect(&r); PenPat(black); PenMode(patCopy); - r.bottom = CW(f->flascent); + r.bottom = BigEndianValue(f->flascent); } ip++; - r.top = CW(CW(r.top) + (f->fllinht)); + r.top = BigEndianValue(BigEndianValue(r.top) + (f->fllinht)); } HUnlock((Handle) f->flstrs); if (sel >= st && sel < st + n) @@ -450,7 +451,7 @@ A2(PRIVATE, StringPtr, getdiskname, BOOLEAN *, ejectablep, pbr.volumeParam.ioNamePtr = RM(&retval[0]); pbr.volumeParam.ioVolIndex = 0; - pbr.volumeParam.ioVRefNum = CW(-CW(SFSaveDisk)); + pbr.volumeParam.ioVRefNum = BigEndianValue(-BigEndianValue(SFSaveDisk)); err = PBGetVInfo(&pbr, FALSE); cachedvrn = SFSaveDisk; if (err == noErr) @@ -486,7 +487,7 @@ A1(PRIVATE, void, drawjobberattop, DialogPeek, dp) GetPenState(&ps); PenNormal(); - if (CL(CurDirStore) == 2) { + if (BigEndianValue(CurDirStore) == 2) { #if 1 /* TODO: ask cliff about a better way to do this */ /* unused = */ getdiskname( &ejectable, NULL ); @@ -499,15 +500,15 @@ A1(PRIVATE, void, drawjobberattop, DialogPeek, dp) flp = WINDFL(dp); rp = &flp->flcurdirrect; savebottom = rp->bottom; - rp->bottom = CW(flp->flascent); - rp->left = CW(CW(rp->left) + (2)); + rp->bottom = BigEndianValue(flp->flascent); + rp->left = BigEndianValue(BigEndianValue(rp->left) + (2)); drawinboxwithicon(flp->flcurdirname, rp, icon); - rp->left = CW(CW(rp->left) - (2)); + rp->left = BigEndianValue(BigEndianValue(rp->left) - (2)); rp->bottom = savebottom; FrameRect(rp); - MoveTo(CW(rp->left)+1, CW(rp->bottom)); - LineTo(CW(rp->right), CW(rp->bottom)); - LineTo(CW(rp->right), CW(rp->top)+1); + MoveTo(BigEndianValue(rp->left)+1, BigEndianValue(rp->bottom)); + LineTo(BigEndianValue(rp->right), BigEndianValue(rp->bottom)); + LineTo(BigEndianValue(rp->right), BigEndianValue(rp->top)+1); SetPenState(&ps); } @@ -519,12 +520,12 @@ A1(PRIVATE, LONGINT, getdirid, StringPtr, fname) hpb.dirInfo.ioCompletion = 0; hpb.dirInfo.ioNamePtr = RM(fname); - hpb.dirInfo.ioVRefNum = CW(-CW(SFSaveDisk)); + hpb.dirInfo.ioVRefNum = BigEndianValue(-BigEndianValue(SFSaveDisk)); hpb.dirInfo.ioFDirIndex = CWC (0); hpb.dirInfo.ioDrDirID = CurDirStore; err = PBGetCatInfo(&hpb, FALSE); if (err == noErr) - retval = CL (hpb.dirInfo.ioDrDirID); + retval = BigEndianValue (hpb.dirInfo.ioDrDirID); else { warning_unexpected ("PBGetCatInfo return value err = %d\n", err); @@ -541,12 +542,12 @@ set_type_and_name (fltype *f, OSType type, Str255 name) switch (f->flavor) { case original_sf: - f->flreplyp.oreplyp->fType = CL (type); + f->flreplyp.oreplyp->fType = BigEndianValue (type); str31assign (f->flreplyp.oreplyp->fName, name); break; case new_sf: case new_custom_sf: - f->flreplyp.nreplyp->sfType = CL (type); + f->flreplyp.nreplyp->sfType = BigEndianValue (type); str31assign (f->flreplyp.nreplyp->sfFile.name, name); f->flreplyp.nreplyp->sfIsFolder = !!type; break; @@ -574,9 +575,9 @@ A2(PRIVATE, INTEGER, flwhich, fltype *, f, Point, p) if (!PtInRect(p, &f->flrect)) { bump = 0; - if (p.v < CW(f->flrect.top)) + if (p.v < BigEndianValue(f->flrect.top)) bump = -1; - else if (p.v >= CW(f->flrect.bottom)) + else if (p.v >= BigEndianValue(f->flrect.bottom)) bump = 1; if (bump) { from = GetCtlValue(f->flsh); @@ -585,7 +586,7 @@ A2(PRIVATE, INTEGER, flwhich, fltype *, f, Point, p) } /*-->*/ return(-1); } - retval = (p.v - CW(f->flrect.top)) / f->fllinht + GetCtlValue(f->flsh); + retval = (p.v - BigEndianValue(f->flrect.top)) / f->fllinht + GetCtlValue(f->flsh); if (retval >= f->flnmfil || MR(*f->flinfo)[retval].flicns & GRAYBIT) /*-->*/ retval = -1; return(retval); @@ -599,8 +600,8 @@ A3(PRIVATE, void, flmouse, fltype *, f, Point, p, ControlHandle, ch) evt.where = p; do { GlobalToLocal(&evt.where); - p.h = CW(evt.where.h); - p.v = CW(evt.where.v); + p.h = BigEndianValue(evt.where.h); + p.v = BigEndianValue(evt.where.v); if ((newsel = flwhich(f, p)) != f->flsel) { if (f->flsel != -1) { safeflflip(f, f->flsel); @@ -671,7 +672,7 @@ A1(PRIVATE, void, getcurname, fltype *, f) hpb.dirInfo.ioCompletion = 0; hpb.dirInfo.ioNamePtr = RM(&f->flcurdirname[0]); f->flcurdirname[0] = 0; - hpb.dirInfo.ioVRefNum = CW(-CW(SFSaveDisk)); + hpb.dirInfo.ioVRefNum = BigEndianValue(-BigEndianValue(SFSaveDisk)); hpb.dirInfo.ioFDirIndex = CWC(-1); hpb.dirInfo.ioDrDirID = CurDirStore; err = PBGetCatInfo(&hpb, FALSE); @@ -683,16 +684,16 @@ A1(PRIVATE, void, getcurname, fltype *, f) r = &f->flrect; w = StringWidth(f->flcurdirname) + 2 + 16 + 3 + 2 + 2 + 4; #if 1 - if (w > CW(r->right) - CW(r->left) + 17) { + if (w > BigEndianValue(r->right) - BigEndianValue(r->left) + 17) { f->flcurdirrect.left = r->left; - f->flcurdirrect.right = CW(CW(r->right) + 17); + f->flcurdirrect.right = BigEndianValue(BigEndianValue(r->right) + 17); } else { - f->flcurdirrect.left = CW((CW(r->left) + CW(r->right) + 17 - w) / 2 - 2); - f->flcurdirrect.right = CW(CW(f->flcurdirrect.left) + w); + f->flcurdirrect.left = BigEndianValue((BigEndianValue(r->left) + BigEndianValue(r->right) + 17 - w) / 2 - 2); + f->flcurdirrect.right = BigEndianValue(BigEndianValue(f->flcurdirrect.left) + w); } #else /* 1 */ - f->flcurdirrect.left = (CW(r->left) + CW(r->right) + 17 - w) / 2 - 2; - f->flcurdirrect.right = CW(CW(f->flcurdirrect.left) + w); + f->flcurdirrect.left = (BigEndianValue(r->left) + BigEndianValue(r->right) + 17 - w) / 2 - 2; + f->flcurdirrect.right = BigEndianValue(BigEndianValue(f->flcurdirrect.left) + w); #endif /* 1 */ } @@ -818,11 +819,11 @@ A1(PRIVATE, void, flfill, fltype *, f) SetCursor(STARH((watchh = GetCursor(watchCursor)))); pb.hFileInfo.ioNamePtr = RM(&s[0]); - pb.hFileInfo.ioVRefNum = CW(-CW(SFSaveDisk)); + pb.hFileInfo.ioVRefNum = BigEndianValue(-BigEndianValue(SFSaveDisk)); err = noErr; errcount = 0; for (dirindex = 1; err != fnfErr && errcount != 3; dirindex++) { - pb.hFileInfo.ioFDirIndex = CW(dirindex); + pb.hFileInfo.ioFDirIndex = BigEndianValue(dirindex); pb.hFileInfo.ioDirID = CurDirStore; err = PBGetCatInfo(&pb, FALSE); if (err) { @@ -892,7 +893,7 @@ P2(PUBLIC, pascal void, ROMlib_filebox, DialogPeek, dp, INTEGER, which) h.p = NULL; GetDItem((DialogPtr) dp, which, &i, &h, &r); -/* h.p = CL(h.p); we don't really use h */ +/* h.p = BigEndianValue(h.p); we don't really use h */ switch (which) { case getNmList: case putNmList: @@ -907,7 +908,7 @@ P2(PUBLIC, pascal void, ROMlib_filebox, DialogPeek, dp, INTEGER, which) case getDiskName: /* case putDiskName: getDiskName and putDiskName are the same */ EraseRect(&r); - width = CW(r.right) - CW(r.left); + width = BigEndianValue(r.right) - BigEndianValue(r.left); diskname = getdiskname( &ejectable, NULL ); GetDItem((DialogPtr) dp, putEject, &i, &ejhand, &r2); ejhand.p = MR(ejhand.p); @@ -918,10 +919,10 @@ P2(PUBLIC, pascal void, ROMlib_filebox, DialogPeek, dp, INTEGER, which) strwidth = StringWidth(diskname) + 2 + 16 + 3; offset = (width - strwidth) / 2; if (offset < 3) - r.left = CW(CW(r.left) + (3)); + r.left = BigEndianValue(BigEndianValue(r.left) + (3)); else - r.left = CW(CW(r.left) + (offset)); - r.bottom = CW(WINDFL(dp)->flascent); + r.left = BigEndianValue(BigEndianValue(r.left) + (offset)); + r.bottom = BigEndianValue(WINDFL(dp)->flascent); drawinboxwithicon(diskname, &r, ejectable ? MICONFLOPPY : MICONDISK); break; } @@ -933,7 +934,7 @@ A2(PRIVATE, void, realcd, DialogPeek, dp, LONGINT, dir) { fltype *fp; - CurDirStore = CL(dir); + CurDirStore = BigEndianValue(dir); fp = WINDFL(dp); SetHandleSize((Handle) fp->flinfo, (Size) 0); SetHandleSize((Handle) fp->flstrs, (Size) 0); @@ -941,11 +942,11 @@ A2(PRIVATE, void, realcd, DialogPeek, dp, LONGINT, dir) fp->flsel = -1; set_type_and_name (fp, 0, (StringPtr) ""); flfill(fp); - fp->flcurdirrect.right = CW(CW(fp->flcurdirrect.right ) + 1); - fp->flcurdirrect.bottom = CW(CW(fp->flcurdirrect.bottom) + 1); + fp->flcurdirrect.right = BigEndianValue(BigEndianValue(fp->flcurdirrect.right ) + 1); + fp->flcurdirrect.bottom = BigEndianValue(BigEndianValue(fp->flcurdirrect.bottom) + 1); EraseRect(&fp->flcurdirrect); getcurname(fp); - fp->flcurdirrect.bottom = CW(CW(fp->flcurdirrect.bottom) - 1); + fp->flcurdirrect.bottom = BigEndianValue(BigEndianValue(fp->flcurdirrect.bottom) - 1); /* don't need to do right; getcurname does */ drawjobberattop(dp); C_ROMlib_filebox(dp, getDiskName); @@ -964,12 +965,12 @@ A1(PRIVATE, LONGINT, getparent, LONGINT, dirid) cb.dirInfo.ioCompletion = 0; cb.dirInfo.ioNamePtr = 0; - cb.dirInfo.ioVRefNum = CW(-CW(SFSaveDisk)); + cb.dirInfo.ioVRefNum = BigEndianValue(-BigEndianValue(SFSaveDisk)); cb.dirInfo.ioFDirIndex = CWC (-1); - cb.dirInfo.ioDrDirID = CL(dirid); + cb.dirInfo.ioDrDirID = BigEndianValue(dirid); err = PBGetCatInfo(&cb, FALSE); if (err == noErr) - retval = CL(cb.dirInfo.ioDrParID); + retval = BigEndianValue(cb.dirInfo.ioDrParID); else { warning_unexpected ("PBGetCatInfo return = %d\n", err); @@ -986,7 +987,7 @@ PRIVATE BOOLEAN findparent(INTEGER *vrefp, LONGINT *diridp) char *namecpy, *slashp; INTEGER namelen; - vcbp = ROMlib_vcbbyvrn(CW(*vrefp)); + vcbp = ROMlib_vcbbyvrn(BigEndianValue(*vrefp)); retval = FALSE; if (!vcbp->vcbCTRef) { namelen = strlen(((VCBExtra *) vcbp)->unixname); @@ -1002,7 +1003,7 @@ PRIVATE BOOLEAN findparent(INTEGER *vrefp, LONGINT *diridp) if (Ustat(namecpy, &sbuf) == 0 && (vcbp = ROMlib_vcbbybiggestunixname(namecpy))) { *vrefp = vcbp->vcbVRefNum; - *diridp = CL((LONGINT) ST_INO (sbuf)); + *diridp = BigEndianValue((LONGINT) ST_INO (sbuf)); retval = TRUE; } } @@ -1016,14 +1017,14 @@ A1(PRIVATE, BOOLEAN, moveuponedir, DialogPtr, dp) INTEGER vrn; BOOLEAN retval; - parent = getparent(CL(CurDirStore)); - if (parent != CL(CurDirStore) && parent != 1) { - CurDirStore = CL(parent); + parent = getparent(BigEndianValue(CurDirStore)); + if (parent != BigEndianValue(CurDirStore) && parent != 1) { + CurDirStore = BigEndianValue(parent); retval = TRUE; } else { - vrn = CW(-CW(SFSaveDisk)); + vrn = BigEndianValue(-BigEndianValue(SFSaveDisk)); retval = findparent(&vrn, &CurDirStore); - SFSaveDisk = CW(-CW(vrn)); + SFSaveDisk = BigEndianValue(-BigEndianValue(vrn)); } return retval; } @@ -1155,19 +1156,19 @@ P3(PUBLIC, pascal INTEGER, ROMlib_stdffilt, DialogPeek, dp, fl = WINDFL(dp); opentoken = getOpen; /* getOpen and putSave are both 1 */ retval = FALSE; - switch (CW(evt->what)) { + switch (BigEndianValue(evt->what)) { case keyDown: - *ith = CW((CL(evt->message) & 0xFF) + keydownbit); - switch (CL(evt->message) & 0xFF) { + *ith = BigEndianValue((BigEndianValue(evt->message) & 0xFF) + keydownbit); + switch (BigEndianValue(evt->message) & 0xFF) { case NUMPAD_ENTER: case '\r' : - GetDItem((DialogPtr) dp, CW(dp->aDefItem), &i, (HIDDEN_Handle *) &h, &r); + GetDItem((DialogPtr) dp, BigEndianValue(dp->aDefItem), &i, (HIDDEN_Handle *) &h, &r); h.p = MR(h.p); if (Hx(h.p, contrlVis) && U(Hx(h.p, contrlHilite)) != 255) { prefix[0] = 0; oldticks = -1000; - *ith = CW(opentoken); + *ith = BigEndianValue(opentoken); retval = -1; //#if !defined(MACOSX_) HiliteControl(h.p, inButton); @@ -1177,14 +1178,14 @@ P3(PUBLIC, pascal INTEGER, ROMlib_stdffilt, DialogPeek, dp, } break; case ASCIIUPARROW: - if (CW(evt->modifiers) & cmdKey) + if (BigEndianValue(evt->modifiers) & cmdKey) *ith = CWC(getDiskName); /* the same as putDiskName */ else keyarrow(fl, -1); retval = -1; break; case ASCIIDOWNARROW: - if ((CW(evt->modifiers) & cmdKey) && fl->flsel != -1 && + if ((BigEndianValue(evt->modifiers) & cmdKey) && fl->flsel != -1 && (MR(*fl->flinfo) + fl->flsel)->flicns == MICONCFOLDER) { prefix[0] = 0; oldticks = -1000; @@ -1200,7 +1201,7 @@ P3(PUBLIC, pascal INTEGER, ROMlib_stdffilt, DialogPeek, dp, case '.': if (evt->modifiers & CWC(cmdKey)) { - *ith = CW(fl->fl_cancel_item); + *ith = BigEndianValue(fl->fl_cancel_item); retval = -1; break; } @@ -1212,14 +1213,14 @@ P3(PUBLIC, pascal INTEGER, ROMlib_stdffilt, DialogPeek, dp, */ if (!fl->flgraynondirs && dp->editField == -1) { flep = MR(*fl->flinfo) + fl->flnmfil - 1; - if (CL(evt->when) > lastkeydowntime + CL(DoubleTime)) { + if (BigEndianValue(evt->when) > lastkeydowntime + BigEndianValue(DoubleTime)) { flp = MR(*fl->flinfo); prefix[0] = 0; oldticks = -1000; } else flp = MR(*fl->flinfo) + ((fl->flsel) == -1 ? 0 : fl->flsel); - lastkeydowntime = CL(evt->when); - prefix[++prefix[0]] = CL(evt->message) & 0xff; + lastkeydowntime = BigEndianValue(evt->when); + prefix[++prefix[0]] = BigEndianValue(evt->message) & 0xff; while (flp < flep && RelString((StringPtr) (MR(*fl->flstrs) + flp->floffs), prefix, FALSE, TRUE) < 0) @@ -1243,15 +1244,15 @@ P3(PUBLIC, pascal INTEGER, ROMlib_stdffilt, DialogPeek, dp, case mouseDown: p = evt->where; GlobalToLocal(&p); - p.h = CW(p.h); - p.v = CW(p.v); + p.h = BigEndianValue(p.h); + p.v = BigEndianValue(p.v); if (PtInRect(p, &fl->flrect)) { GetDItem((DialogPtr) dp, getOpen, &i, (HIDDEN_Handle *) &h, &r); h.p = MR(h.p); flmouse(fl, evt->where, h.p); ticks = TickCount(); if (fl->flsel != -1 && savesel == fl->flsel && - (ticks < oldticks + CL(DoubleTime))) { + (ticks < oldticks + BigEndianValue(DoubleTime))) { prefix[0] = 0; *ith = CWC(opentoken); oldticks = -1000; @@ -1308,14 +1309,14 @@ A3(PRIVATE, void, flinit, fltype *, f, Rect *, r, ControlHandle, sh) f->flsh = sh; f->flrect = *r; - f->fllinht = CW(fi.ascent) + CW(fi.descent) + CW(fi.leading); + f->fllinht = BigEndianValue(fi.ascent) + BigEndianValue(fi.descent) + BigEndianValue(fi.leading); - f->flcurdirrect.top = CW(CW(r->top) - f->fllinht - 5); - f->flcurdirrect.bottom = CW(CW(f->flcurdirrect.top) + f->fllinht); + f->flcurdirrect.top = BigEndianValue(BigEndianValue(r->top) - f->fllinht - 5); + f->flcurdirrect.bottom = BigEndianValue(BigEndianValue(f->flcurdirrect.top) + f->fllinht); getcurname(f); - f->flascent = CW(fi.ascent); - f->flnmlin = (CW(r->bottom) - CW(r->top)) / f->fllinht; + f->flascent = BigEndianValue(fi.ascent); + f->flnmlin = (BigEndianValue(r->bottom) - BigEndianValue(r->top)) / f->fllinht; f->flnmfil = 0; f->flsel = -1; savezone = TheZone; @@ -1329,8 +1330,8 @@ A3(PRIVATE, void, stdfflip, Rect *, rp, INTEGER, n, INTEGER, height) { INTEGER savetop = rp->top; - rp->top = CW(CW(rp->top) + (n * height + 1)); - rp->bottom = CW(CW(rp->top) + height - 2); + rp->top = BigEndianValue(BigEndianValue(rp->top) + (n * height + 1)); + rp->bottom = BigEndianValue(BigEndianValue(rp->top) + height - 2); InvertRect(rp); rp->top = savetop; } @@ -1369,7 +1370,7 @@ A1(PRIVATE, BOOLEAN, trackdirs, DialogPeek, dp) hpb.dirInfo.ioCompletion = 0; hpb.dirInfo.ioNamePtr = RM (&next->name[0]); next->name[0] = 0; - hpb.dirInfo.ioVRefNum = CW (-CW(SFSaveDisk)); + hpb.dirInfo.ioVRefNum = BigEndianValue (-BigEndianValue(SFSaveDisk)); hpb.dirInfo.ioFDirIndex = CWC (-1); hpb.dirInfo.ioDrDirID = CurDirStore; max_width = 0; @@ -1386,8 +1387,8 @@ A1(PRIVATE, BOOLEAN, trackdirs, DialogPeek, dp) warning_unexpected ("PBGetCatInfo returns err = %d\n", err); done = TRUE; } - id = next->dirid = CL (hpb.dirInfo.ioDrDirID); - next->vrefnum = CW (hpb.dirInfo.ioVRefNum); + id = next->dirid = BigEndianValue (hpb.dirInfo.ioDrDirID); + next->vrefnum = BigEndianValue (hpb.dirInfo.ioVRefNum); next->next = (struct link *) ALLOCA (sizeof (struct link)); gui_assert (next->next); str_width = StringWidth (next->name); @@ -1405,12 +1406,12 @@ A1(PRIVATE, BOOLEAN, trackdirs, DialogPeek, dp) } } while (!done); fl = WINDFL(dp); - therect.top = CW (CW (fl->flcurdirrect.top) - - CW (PORT_BOUNDS (dp).top)); - therect.left = CW (CW (fl->flcurdirrect.left) - - CW (PORT_BOUNDS (dp).left)); - therect.bottom = CW (CW (therect.top) + count * fl->fllinht + 1); - therect.right = CW (CW (therect.left) + 2 + 16 + 3 + max_width + 4 + 2 + 3); + therect.top = BigEndianValue (BigEndianValue (fl->flcurdirrect.top) + - BigEndianValue (PORT_BOUNDS (dp).top)); + therect.left = BigEndianValue (BigEndianValue (fl->flcurdirrect.left) + - BigEndianValue (PORT_BOUNDS (dp).left)); + therect.bottom = BigEndianValue (BigEndianValue (therect.top) + count * fl->fllinht + 1); + therect.right = BigEndianValue (BigEndianValue (therect.left) + 2 + 16 + 3 + max_width + 4 + 2 + 3); ClipRect(&therect); { @@ -1426,18 +1427,18 @@ A1(PRIVATE, BOOLEAN, trackdirs, DialogPeek, dp) bounds = &PIXMAP_BOUNDS (save_bits); bounds->top = CWC (0); bounds->left = CWC (0); - bounds->bottom = CW (RECT_HEIGHT (&therect)); - bounds->right = CW (RECT_WIDTH (&therect)); + bounds->bottom = BigEndianValue (RECT_HEIGHT (&therect)); + bounds->right = BigEndianValue (RECT_WIDTH (&therect)); PIXMAP_PIXEL_SIZE_X (save_bits) = save_bpp_x = PIXMAP_PIXEL_SIZE_X (port_pixmap); ROMlib_copy_ctab (PIXMAP_TABLE (port_pixmap), PIXMAP_TABLE (save_bits)); - row_bytes = ((CW (bounds->right) * CW (save_bpp_x) + 31) / 32) * 4; - PIXMAP_SET_ROWBYTES_X (save_bits, CW (row_bytes)); + row_bytes = ((BigEndianValue (bounds->right) * BigEndianValue (save_bpp_x) + 31) / 32) * 4; + PIXMAP_SET_ROWBYTES_X (save_bits, BigEndianValue (row_bytes)); /* Allocate potentially large temporary pixmap space. */ TEMP_ALLOC_ALLOCATE (save_bits_mem, temp_save_bits, - CW (bounds->bottom) * row_bytes); + BigEndianValue (bounds->bottom) * row_bytes); PIXMAP_BASEADDR_X (save_bits) = (Ptr)RM (save_bits_mem); WRAPPER_SET_PIXMAP_X (wrapper, RM (save_bits)); @@ -1451,8 +1452,8 @@ A1(PRIVATE, BOOLEAN, trackdirs, DialogPeek, dp) /* highlite the appropriate box, etc. */ fillinrect.top = therect.top; - fillinrect.left = CW(CW(therect.left) + 2); - fillinrect.bottom = CW(fl->flascent); + fillinrect.left = BigEndianValue(BigEndianValue(therect.left) + 2); + fillinrect.bottom = BigEndianValue(fl->flascent); fillinrect.right = therect.right; for (i = count, next = &first; --i >= 0; next = next->next) @@ -1467,31 +1468,31 @@ A1(PRIVATE, BOOLEAN, trackdirs, DialogPeek, dp) drawinboxwithicon(next->name, &fillinrect, i ? MICONCFOLDER : MICONDISK); */ - fillinrect.top = CW(CW(fillinrect.top) + (fl->fllinht)); + fillinrect.top = BigEndianValue(BigEndianValue(fillinrect.top) + (fl->fllinht)); } - therect.right = CW(CW(therect.right) - (1)); - therect.bottom = CW(CW(therect.bottom) - (1)); + therect.right = BigEndianValue(BigEndianValue(therect.right) - (1)); + therect.bottom = BigEndianValue(BigEndianValue(therect.bottom) - (1)); FrameRect(&therect); - MoveTo(CW(therect.left)+1, CW(therect.bottom)); - LineTo(CW(therect.right), CW(therect.bottom)); - LineTo(CW(therect.right), CW(therect.top)+1); - therect.right = CW(CW(therect.right) + (1)); + MoveTo(BigEndianValue(therect.left)+1, BigEndianValue(therect.bottom)); + LineTo(BigEndianValue(therect.right), BigEndianValue(therect.bottom)); + LineTo(BigEndianValue(therect.right), BigEndianValue(therect.top)+1); + therect.right = BigEndianValue(BigEndianValue(therect.right) + (1)); sel = 0; fillinrect.top = therect.top; - fillinrect.left = CW (CW (fillinrect.left) - 1); - fillinrect.right = CW (CW (fillinrect.right) - 2); + fillinrect.left = BigEndianValue (BigEndianValue (fillinrect.left) - 1); + fillinrect.right = BigEndianValue (BigEndianValue (fillinrect.right) - 2); stdfflip (&fillinrect, sel, fl->fllinht); done = FALSE; seen_up_already = FALSE; firstsel = -1; while (!done) { - evt.where.h = CW (evt.where.h); - evt.where.v = CW (evt.where.v); + evt.where.h = BigEndianValue (evt.where.h); + evt.where.v = BigEndianValue (evt.where.v); if (PtInRect (evt.where, &therect)) - newsel = (evt.where.v - CW(therect.top)) / fl->fllinht; + newsel = (evt.where.v - BigEndianValue(therect.top)) / fl->fllinht; else newsel = -1; if (newsel != sel) @@ -1526,7 +1527,7 @@ A1(PRIVATE, BOOLEAN, trackdirs, DialogPeek, dp) } } - therect.bottom = CW (CW (therect.bottom) + 1); + therect.bottom = BigEndianValue (BigEndianValue (therect.bottom) + 1); /* restore the rect and clean up after ourselves */ CopyBits(wrapper, PORT_BITS_FOR_COPY (thePort), @@ -1537,8 +1538,8 @@ A1(PRIVATE, BOOLEAN, trackdirs, DialogPeek, dp) { for (i = 0, next = &first; i != sel; ++i, next = next->next) ; - CurDirStore = CL(next->dirid); - SFSaveDisk = CW(-next->vrefnum); + CurDirStore = BigEndianValue(next->dirid); + SFSaveDisk = BigEndianValue(-next->vrefnum); return TRUE; } ALLOCAEND @@ -1559,7 +1560,7 @@ makeworking (fltype *f) WDPBRec wdpb; OSErr err; - wdpb.ioVRefNum = CW(-CW(SFSaveDisk)); + wdpb.ioVRefNum = BigEndianValue(-BigEndianValue(SFSaveDisk)); wdpb.ioWDDirID = CurDirStore; wdpb.ioWDProcID = TICKX("STDF"); wdpb.ioNamePtr = 0; @@ -1572,7 +1573,7 @@ makeworking (fltype *f) break; case new_sf: case new_custom_sf: - f->flreplyp.nreplyp->sfFile.vRefNum = CW(-CW(SFSaveDisk)); + f->flreplyp.nreplyp->sfFile.vRefNum = BigEndianValue(-BigEndianValue(SFSaveDisk)); f->flreplyp.nreplyp->sfFile.parID = CurDirStore; break; default: @@ -1597,7 +1598,7 @@ PRIVATE boolean_t single_tree_fs_p(HParmBlkPtr pb) #if defined(MSDOS) || defined (CYGWIN32) return FALSE; #else - HVCB *vcbp = ROMlib_vcbbyvrn(CW(pb->volumeParam.ioVRefNum)); + HVCB *vcbp = ROMlib_vcbbyvrn(BigEndianValue(pb->volumeParam.ioVRefNum)); return vcbp && !vcbp->vcbCTRef; #endif @@ -1771,7 +1772,7 @@ PUBLIC void Executor::futzwithdosdisks( void ) try_to_mount_disk( DRIVE_NAME_OF (i), fd|MARKER, &mess, blocksize, 16 * PHYSBSIZE, flags, 0); - mess = CL(mess); + mess = BigEndianValue(mess); if (mess) { if (mess >> 16 == 0) { DRIVE_LOADED(i) = TRUE; @@ -1813,14 +1814,14 @@ A2(PRIVATE, void, bumpsavedisk, DialogPtr, dp, BOOLEAN, always) /* beenhere = TRUE; */ } #endif - pb.volumeParam.ioVRefNum = CW(-CW(SFSaveDisk)); + pb.volumeParam.ioVRefNum = BigEndianValue(-BigEndianValue(SFSaveDisk)); pb.volumeParam.ioNamePtr = 0; pb.volumeParam.ioVolIndex = 0; err = PBHGetVInfo(&pb, FALSE); if (err != noErr) warning_unexpected ("PBHGetVInfo returns %d", err); - else if (!SFSaveDisk || ISWDNUM(-CW(SFSaveDisk))) - SFSaveDisk = CW(-CW(pb.volumeParam.ioVRefNum)); + else if (!SFSaveDisk || ISWDNUM(-BigEndianValue(SFSaveDisk))) + SFSaveDisk = BigEndianValue(-BigEndianValue(pb.volumeParam.ioVRefNum)); if (always || pb.ioParam.ioResult != noErr || ejected(&pb)) { current = pb.volumeParam.ioVRefNum; is_single_tree_fs = single_tree_fs_p(&pb); @@ -1828,7 +1829,7 @@ A2(PRIVATE, void, bumpsavedisk, DialogPtr, dp, BOOLEAN, always) seenus = FALSE; vref = 0; do { - pb.volumeParam.ioVolIndex = CW(CW(pb.volumeParam.ioVolIndex) + 1); + pb.volumeParam.ioVolIndex = BigEndianValue(BigEndianValue(pb.volumeParam.ioVolIndex) + 1); err = PBHGetVInfo(&pb, FALSE); if (err != noErr && !seenus) warning_unexpected ("PBHGetVInfo = %d\n", err); @@ -1838,14 +1839,14 @@ A2(PRIVATE, void, bumpsavedisk, DialogPtr, dp, BOOLEAN, always) else if (!ejected(&pb) && (!is_single_tree_fs || !single_tree_fs_p(&pb))) { if (!vref || seenus) - vref = CW(pb.volumeParam.ioVRefNum); + vref = BigEndianValue(pb.volumeParam.ioVRefNum); if (seenus) /*-->*/ break; } } } while (err == noErr); if (vref) { - SFSaveDisk = CW(-vref); + SFSaveDisk = BigEndianValue(-vref); CurDirStore = CLC(2); } } @@ -1923,30 +1924,30 @@ A4(PRIVATE, void, transformsfpdialog, DialogPtr, dp, Point *, offset, extrasizeneeded = 110; SetRect(scrollrect, 16, 24, 231, 106); tep = STARH(MR(((DialogPeek)dp)->textH)); - tep->destRect.top = CW(CW(tep->destRect.top) + (extrasizeneeded)); - tep->destRect.bottom = CW(CW(tep->destRect.bottom) + (extrasizeneeded)); - tep->viewRect.top = CW(CW(tep->viewRect.top) + (extrasizeneeded)); - tep->viewRect.bottom = CW(CW(tep->viewRect.bottom) + (extrasizeneeded)); + tep->destRect.top = BigEndianValue(BigEndianValue(tep->destRect.top) + (extrasizeneeded)); + tep->destRect.bottom = BigEndianValue(BigEndianValue(tep->destRect.bottom) + (extrasizeneeded)); + tep->viewRect.top = BigEndianValue(BigEndianValue(tep->viewRect.top) + (extrasizeneeded)); + tep->viewRect.bottom = BigEndianValue(BigEndianValue(tep->viewRect.bottom) + (extrasizeneeded)); } - numitems = CW(*(INTEGER *)STARH((MR(((DialogPeek)dp)->items)))) + 1; + numitems = BigEndianValue(*(INTEGER *)STARH((MR(((DialogPeek)dp)->items)))) + 1; for (j = 1 ; j <= numitems ; j++) { GetDItem(dp, j, &i, &h, &r); - i = CW(i); + i = BigEndianValue(i); h.p = MR(h.p); - if (!getting || CW(r.bottom) > CW(scrollrect->top)) { - r.top = CW(CW(r.top) + (extrasizeneeded)); - r.bottom = CW(CW(r.bottom) + (extrasizeneeded)); + if (!getting || BigEndianValue(r.bottom) > BigEndianValue(scrollrect->top)) { + r.top = BigEndianValue(BigEndianValue(r.top) + (extrasizeneeded)); + r.bottom = BigEndianValue(BigEndianValue(r.bottom) + (extrasizeneeded)); if (i <= 7 && i >= 4) /* It's a control */ - MoveControl((ControlHandle) h.p, CW(r.left), CW(r.top)); + MoveControl((ControlHandle) h.p, BigEndianValue(r.left), BigEndianValue(r.top)); SetDItem(dp, j, i, h.p, &r); } } - windheight = CW(dp->portRect.bottom) - CW(dp->portRect.top) + extrasizeneeded; - SizeWindow( (WindowPtr) dp, CW(dp->portRect.right) - CW(dp->portRect.left), + windheight = BigEndianValue(dp->portRect.bottom) - BigEndianValue(dp->portRect.top) + extrasizeneeded; + SizeWindow( (WindowPtr) dp, BigEndianValue(dp->portRect.right) - BigEndianValue(dp->portRect.left), windheight, FALSE); if (getting) { - scrollrect->top = CW(CW(scrollrect->top) + (extrasizeneeded)); - scrollrect->bottom = CW(CW(scrollrect->bottom) + (extrasizeneeded)); + scrollrect->top = BigEndianValue(BigEndianValue(scrollrect->top) + (extrasizeneeded)); + scrollrect->bottom = BigEndianValue(BigEndianValue(scrollrect->bottom) + (extrasizeneeded)); } InvalRect(&dp->portRect); offset->v -= extrasizeneeded / 2; @@ -1982,7 +1983,7 @@ void adjustdrivebutton(DialogPtr dp) A1(PRIVATE, void, doeject, DialogPtr, dp) { - Eject((StringPtr) "", -CW(SFSaveDisk)); + Eject((StringPtr) "", -BigEndianValue(SFSaveDisk)); adjustdrivebutton(dp); bumpsavedisk(dp, TRUE); } @@ -1994,10 +1995,10 @@ A3(PRIVATE, OSType, gettypeX, StringPtr, name, INTEGER, vref, LONGINT, dirid) HParamBlockRec pbr; pbr.fileParam.ioNamePtr = RM (name); - pbr.fileParam.ioVRefNum = CW (vref); + pbr.fileParam.ioVRefNum = BigEndianValue (vref); pbr.fileParam.ioFVersNum = 0; pbr.fileParam.ioFDirIndex = CWC (0); - pbr.fileParam.ioDirID = CL (dirid); + pbr.fileParam.ioDirID = BigEndianValue (dirid); err = PBHGetFInfo (&pbr, FALSE); if (err == noErr) retval = pbr.fileParam.ioFlFndrInfo.fdType; @@ -2027,7 +2028,7 @@ unixcore (StringPtr namep, INTEGER *vrefnump, LONGINT *diridp) vcbp = ROMlib_vcbbyvrn(vrefnum); #else pbr.ioParam.ioNamePtr = (StringPtr)CLC(0); - pbr.ioParam.ioVRefNum = CW(vrefnum); + pbr.ioParam.ioVRefNum = BigEndianValue(vrefnum); vcbp = ROMlib_breakoutioname(&pbr, &templ, &tempcp, (BOOLEAN *) 0, TRUE); free (tempcp); #endif @@ -2051,7 +2052,7 @@ unixcore (StringPtr namep, INTEGER *vrefnump, LONGINT *diridp) vcbextrap = ROMlib_vcbbyunixname(newname); if (vcbextrap) { - *vrefnump = CW(vcbextrap->vcb.vcbVRefNum); + *vrefnump = BigEndianValue(vcbextrap->vcb.vcbVRefNum); if (*diridp == vcbextrap->u.ufs.ino) *diridp = 2; } @@ -2079,13 +2080,13 @@ P1(PUBLIC pascal trap, OSErr, unixmount, CInfoPBRec *, cbp) INTEGER vrefnum; LONGINT dirid; - vrefnum = CW(cbp->hFileInfo.ioVRefNum); - dirid = CL (cbp->hFileInfo.ioDirID); + vrefnum = BigEndianValue(cbp->hFileInfo.ioVRefNum); + dirid = BigEndianValue (cbp->hFileInfo.ioDirID); err = unixcore(MR(cbp->hFileInfo.ioNamePtr), &vrefnum, &dirid); if (err == noErr) { - cbp->hFileInfo.ioVRefNum = CW (vrefnum); - cbp->hFileInfo.ioDirID = CW (dirid); + cbp->hFileInfo.ioVRefNum = BigEndianValue (vrefnum); + cbp->hFileInfo.ioDirID = BigEndianValue (dirid); } } return err; @@ -2098,12 +2099,12 @@ PRIVATE void unixcd(fltype *f) LONGINT dirid; name = (StringPtr) (MR(*f->flstrs) + MR(*f->flinfo)[f->flsel].floffs); - vrefnum = -CW(SFSaveDisk); - dirid = CL (CurDirStore); + vrefnum = -BigEndianValue(SFSaveDisk); + dirid = BigEndianValue (CurDirStore); if (unixcore(name, &vrefnum, &dirid) == noErr) { - SFSaveDisk = CW (-vrefnum); - CurDirStore = CL (dirid); + SFSaveDisk = BigEndianValue (-vrefnum); + CurDirStore = BigEndianValue (dirid); } } @@ -2119,8 +2120,8 @@ get_starting_point (Point *pp) Rect main_gd_rect; main_gd_rect = PIXMAP_BOUNDS (GD_PMAP (MR (MainDevice))); - screen_width = CW (main_gd_rect.right); - screen_height = CW (main_gd_rect.bottom); + screen_width = BigEndianValue (main_gd_rect.right); + screen_height = BigEndianValue (main_gd_rect.bottom); pp->h = (screen_width - STANDARD_WIDTH) / 2; pp->v = (screen_height - STANDARD_HEIGHT) / 2; } @@ -2172,13 +2173,13 @@ destroy_new_folder_button (DialogPtr dp, ControlHandle ch) ? (fp)->flreplyp.oreplyp->vRefNum \ : (fp)->flreplyp.nreplyp->sfFile.vRefNum) -#define SF_VREFNUM(fp) (CW (SF_VREFNUM_X (fp))) +#define SF_VREFNUM(fp) (BigEndianValue (SF_VREFNUM_X (fp))) #define SF_DIRID_X(fp) ((fp)->flavor == original_sf \ ? 0 \ : (fp)->flreplyp.nreplyp->sfFile.parID) -#define SF_DIRID(fp) (CL (SF_DIRID_X (fp))) +#define SF_DIRID(fp) (BigEndianValue (SF_DIRID_X (fp))) PRIVATE void getditext (DialogPtr dp, INTEGER item, StringPtr text) @@ -2239,7 +2240,7 @@ new_folder_from_dp (DialogPtr dp, fltype *f) boolean_t retval; getditext (dp, 3, str); - hpb.ioParam.ioVRefNum = CW (-CW (SFSaveDisk)); + hpb.ioParam.ioVRefNum = BigEndianValue (-BigEndianValue (SFSaveDisk)); hpb.fileParam.ioDirID = CurDirStore; if (str[0] > 31) str[0] = 31; @@ -2368,7 +2369,7 @@ PUBLIC void spfcommon(Point p, StringPtr prompt, StringPtr name, f.flavor = flavor; f.flreplyp = rep; - if (p.h < 2 || p.v < CW(MBarHeight) + 7) + if (p.h < 2 || p.v < BigEndianValue(MBarHeight) + 7) get_starting_point (&p); *SF_GOOD_XP(&f) = CBC (FALSE); @@ -2467,7 +2468,7 @@ PUBLIC void spfcommon(Point p, StringPtr prompt, StringPtr name, if (f.flavor == original_sf) { putname = putName; - transform = CW(scrollrect.right) - CW(scrollrect.left) == 1; + transform = BigEndianValue(scrollrect.right) - BigEndianValue(scrollrect.left) == 1; } else { @@ -2485,7 +2486,7 @@ PUBLIC void spfcommon(Point p, StringPtr prompt, StringPtr name, { GetDItem(dp, getScroll, &i, &h, &r); h.p = MR(h.p); - transform = CW(r.right) - CW(r.left) == 16; + transform = BigEndianValue(r.right) - BigEndianValue(r.left) == 16; GetDItem(dp, getDotted, &i, &h, &r); h.p = MR(h.p); SetDItem(dp, getDotted, userItem, (Handle) P_ROMlib_filebox, &r); @@ -2503,11 +2504,11 @@ PUBLIC void spfcommon(Point p, StringPtr prompt, StringPtr name, h.p = MR(h.p); SetDItem(dp, diskname, userItem, (Handle) P_ROMlib_filebox, &r); - r.left = CW(CW(scrollrect.left) + 1); - r.right = CW(CW(scrollrect.right) - 16); - r.top = CW(CW(scrollrect.top) + 1); - r.bottom = CW(CW(scrollrect.bottom) - 1); - scrollrect.left = CW(CW(scrollrect.right) - 16); + r.left = BigEndianValue(BigEndianValue(scrollrect.left) + 1); + r.right = BigEndianValue(BigEndianValue(scrollrect.right) - 16); + r.top = BigEndianValue(BigEndianValue(scrollrect.top) + 1); + r.bottom = BigEndianValue(BigEndianValue(scrollrect.bottom) - 1); + scrollrect.left = BigEndianValue(BigEndianValue(scrollrect.right) - 16); scrollh = NewControl((WindowPtr) dp, &scrollrect, (StringPtr) "", TRUE, 0, 0, 0, scrollBarProc, 0L); flinit(&f, &r, scrollh); @@ -2527,10 +2528,10 @@ PUBLIC void spfcommon(Point p, StringPtr prompt, StringPtr name, (SF_NAME (&f))[0] = 0; } SetWRefCon((WindowPtr) dp, (LONGINT)(long)US_TO_SYN68K(&f)); - if (CW(dp->portRect.bottom) + p.v + 7 > CW(screenBitsX.bounds.bottom)) - p.v = CW(screenBitsX.bounds.bottom) - CW(dp->portRect.bottom) - 7; - if (p.v < CW(MBarHeight) + 7) - p.v = CW(MBarHeight) + 7; + if (BigEndianValue(dp->portRect.bottom) + p.v + 7 > BigEndianValue(screenBitsX.bounds.bottom)) + p.v = BigEndianValue(screenBitsX.bounds.bottom) - BigEndianValue(dp->portRect.bottom) - 7; + if (p.v < BigEndianValue(MBarHeight) + 7) + p.v = BigEndianValue(MBarHeight) + 7; MoveWindow((WindowPtr) dp, p.h, p.v, FALSE); ihit = -1; @@ -2544,7 +2545,7 @@ PUBLIC void spfcommon(Point p, StringPtr prompt, StringPtr name, SelectWindow((WindowPtr) dp); while (!done) { ModalDialog((ProcPtr) P_ROMlib_stdffilt, &ihit); - ihit = CW(ihit); + ihit = BigEndianValue(ihit); if (getorput == put) GetIText(pnhand.p, SF_NAME (&f)); if (dh.odh) @@ -2639,18 +2640,18 @@ PUBLIC void spfcommon(Point p, StringPtr prompt, StringPtr name, (evt.message & CLC(0xFFFF0000)) == 0) { pbr.volumeParam.ioNamePtr = 0; pbr.volumeParam.ioVolIndex = 0; - pbr.volumeParam.ioVRefNum = CW(CL(evt.message) & 0xFFFF); + pbr.volumeParam.ioVRefNum = BigEndianValue(BigEndianValue(evt.message) & 0xFFFF); err = PBGetVInfo(&pbr, FALSE); gui_assert(err == noErr); if (err == noErr) { adjustdrivebutton(dp); - SFSaveDisk = CW(-CW(pbr.volumeParam.ioVRefNum)); + SFSaveDisk = BigEndianValue(-BigEndianValue(pbr.volumeParam.ioVRefNum)); CurDirStore = CLC(2); ihit = FAKEREDRAW; } } if (ihit == FAKEREDRAW) - realcd((DialogPeek) dp, CL(CurDirStore)); + realcd((DialogPeek) dp, BigEndianValue(CurDirStore)); } if (f.flavor != original_sf && dh.odh) ihit = ROMlib_CALLDHOOK(&f, -2, dp, dh); /* the mac does this */ diff --git a/src/stdmbdf.cpp b/src/stdmbdf.cpp index 59db13bf..c9c011b2 100644 --- a/src/stdmbdf.cpp +++ b/src/stdmbdf.cpp @@ -31,6 +31,7 @@ namespace Executor { #include "apple.cmap" } using namespace Executor; +using namespace ByteSwap; enum { APPLE_CHAR = 0x14, INFINITY_CHAR = 0xB0 }; @@ -55,10 +56,10 @@ draw_menu_title (muelem *elt, menu_bar_color (&bar_color); menu_title_color (MI_ID (muhandle), &title_color); - dstr.top = CW (hilite_p ? 1 : 0); - dstr.bottom = CW (CW (MBarHeight) - 1); + dstr.top = BigEndianValue (hilite_p ? 1 : 0); + dstr.bottom = BigEndianValue (BigEndianValue (MBarHeight) - 1); dstr.left = elt->muleft; - dstr.right = last_menu_p ? CW (muright) : elt[1].muleft; + dstr.right = last_menu_p ? BigEndianValue (muright) : elt[1].muleft; RGBForeColor (hilite_p ? &bar_color : &title_color); RGBBackColor (hilite_p ? &title_color : &bar_color); @@ -68,7 +69,7 @@ draw_menu_title (muelem *elt, title = (char *) MI_DATA (muhandle); #if defined (COLOR_APPLE_MENU_ICON) - gd = CL (MainDevice); + gd = BigEndianValue (MainDevice); if (*title == 1 && title[1] == '\024' && PIXMAP_PIXEL_SIZE (GD_PMAP (gd)) > 2) @@ -76,7 +77,7 @@ draw_menu_title (muelem *elt, /* draw the color apple */ dstr = apple->bounds; OffsetRect (&dstr, - CW (elt->muleft) + MENULEFT - 6, 1); + BigEndianValue (elt->muleft) + MENULEFT - 6, 1); RGBForeColor (&ROMlib_black_rgb_color); RGBBackColor (&ROMlib_white_rgb_color); @@ -96,7 +97,7 @@ draw_menu_title (muelem *elt, RGBForeColor (&title_color); } PORT_TX_MODE_X (thePort) = srcCopy; - MoveTo (CW (elt->muleft) + MENULEFT - 3, 14); + MoveTo (BigEndianValue (elt->muleft) + MENULEFT - 3, 14); if (ROMlib_AppleChar && title[0] == 1 && title[1] == APPLE_CHAR) { title[1] = (char) ROMlib_AppleChar; @@ -149,10 +150,10 @@ realhilite (int16 offset, highstate h) Rect r; /* toggle the entire menu bar */ - mbar_height = CW (MBarHeight); + mbar_height = BigEndianValue (MBarHeight); r = PORT_RECT (MR (wmgr_port)); - r.bottom = CW (mbar_height - 1); + r.bottom = BigEndianValue (mbar_height - 1); if (h == HILITE) menu_title_color (0, &bar_color); @@ -163,15 +164,15 @@ realhilite (int16 offset, highstate h) EraseRect (&r); PenSize (1, 1); - MoveTo (CW (r.left), mbar_height - 1); - LineTo (CW (r.right) - 1, mbar_height - 1); + MoveTo (BigEndianValue (r.left), mbar_height - 1); + LineTo (BigEndianValue (r.right) - 1, mbar_height - 1); HLock (MR (MenuList)); menulistp = STARH (MENULIST); - mpend = menulistp->mulist + CW (menulistp->muoff) / sizeof (muelem); + mpend = menulistp->mulist + BigEndianValue (menulistp->muoff) / sizeof (muelem); for (mp = menulistp->mulist; mp != mpend; mp++) draw_menu_title (mp, mp == mpend - 1, - h == HILITE, CW (menulistp->muright)); + h == HILITE, BigEndianValue (menulistp->muright)); HUnlock (MR (MenuList)); } } @@ -186,7 +187,7 @@ mbdf_draw (int32 draw_p) Rect r; r = PORT_RECT (MR (wmgr_port)); - r.bottom = CW (CW (MBarHeight) - 1); + r.bottom = BigEndianValue (BigEndianValue (MBarHeight) - 1); ClipRect (&r); menu_bar_color (&bar_color); @@ -194,26 +195,26 @@ mbdf_draw (int32 draw_p) EraseRect (&r); PenSize (1, 1); - MoveTo (CW (r.left), CW (MBarHeight) - 1); - LineTo (CW (r.right) - 1, CW (MBarHeight) - 1); + MoveTo (BigEndianValue (r.left), BigEndianValue (MBarHeight) - 1); + LineTo (BigEndianValue (r.right) - 1, BigEndianValue (MBarHeight) - 1); if (draw_p == DRAWMENUBAR) { /* draw titles */ - r.bottom = CW (CW (r.bottom) - 1); + r.bottom = BigEndianValue (BigEndianValue (r.bottom) - 1); PORT_TX_FACE_X (MR (wmgr_port)) = (Style) CB (0); PORT_TX_FONT_X (MR (wmgr_port)) = SysFontFam; HLock (MR (MenuList)); menulistp = STARH (MENULIST); - mpend = menulistp->mulist + CW (menulistp->muoff) / sizeof (muelem); + mpend = menulistp->mulist + BigEndianValue (menulistp->muoff) / sizeof (muelem); for (mp = menulistp->mulist; mp != mpend; mp++) - draw_menu_title (mp, mp == mpend - 1, FALSE, CW (menulistp->muright)); + draw_menu_title (mp, mp == mpend - 1, FALSE, BigEndianValue (menulistp->muright)); HUnlock (MR (MenuList)); /* highlite title if necessary */ if (TheMenu) - realhilite (ROMlib_mentosix (CW (TheMenu)), HILITE); + realhilite (ROMlib_mentosix (BigEndianValue (TheMenu)), HILITE); /* set ClipRgn to full open */ ClipRect (&PORT_RECT (MR (wmgr_port))); @@ -245,9 +246,9 @@ A1(PRIVATE, LONGINT, hit, LONGINT, mousept) p.h = LoWord(mousept); p.v = HiWord(mousept); - if (p.v < CW(MBarHeight)) { + if (p.v < BigEndianValue(MBarHeight)) { mpend = HxX(MENULIST, mulist) + Hx(MENULIST, muoff) / sizeof(muelem); - for (mp = HxX(MENULIST, mulist); mp != mpend && CW(mp->muleft) <= p.h; mp++) + for (mp = HxX(MENULIST, mulist); mp != mpend && BigEndianValue(mp->muleft) <= p.h; mp++) ; if (mp == HxX(MENULIST, mulist) || p.h > Hx(MENULIST, muright)) /*-->*/ return NOTHITINMBAR; @@ -256,13 +257,13 @@ A1(PRIVATE, LONGINT, hit, LONGINT, mousept) } else { mbdfep = (mbdfentry *) STARH(MR (MBSaveLoc)); for (mbdfp = (mbdfentry *) - ((char *) mbdfep + CW(((mbdfheader *)mbdfep)->lastMBSave)); + ((char *) mbdfep + BigEndianValue(((mbdfheader *)mbdfep)->lastMBSave)); mbdfp != mbdfep && !PtInRect(p, &mbdfp->mbRectSave); mbdfp--) ; if (mbdfp == mbdfep) /*-->*/ return NOTHIT; else - /*-->*/ return CW(mbdfp->mbMLOffset); + /*-->*/ return BigEndianValue(mbdfp->mbMLOffset); } } @@ -290,18 +291,18 @@ A1(PRIVATE, void, calc, LONGINT, offset) HLock((Handle) mh); titsize = StringWidth(HxX(mh, menuData)) + SLOP; HUnlock((Handle) mh); - left = CW(mp[-1].muleft) + titsize; + left = BigEndianValue(mp[-1].muleft) + titsize; } - for (mep = (muelem *) ((char *)menulistp + CW(menulistp->muoff)) + 1; + for (mep = (muelem *) ((char *)menulistp + BigEndianValue(menulistp->muoff)) + 1; mp < mep ; mp++) { - mp->muleft = CW(left); + mp->muleft = BigEndianValue(left); mh = MR(mp->muhandle); HLock((Handle) mh); titsize = StringWidth(HxX(mh, menuData)) + SLOP; HUnlock((Handle) mh); left += titsize; } - menulistp->muright = CW(left); + menulistp->muright = BigEndianValue(left); HUnlock(MR (MenuList)); } @@ -344,7 +345,7 @@ A0(PRIVATE, void, height) FontInfo fi; GetFontInfo(&fi); - MBarHeight = CW(CW(fi.ascent) + CW(fi.descent) + CW(fi.leading) + 4); + MBarHeight = BigEndianValue(BigEndianValue(fi.ascent) + BigEndianValue(fi.descent) + BigEndianValue(fi.leading) + 4); } static void @@ -378,7 +379,7 @@ done:; \ int current_mb_save; current_mb_save = Hx (MBSAVELOC, lastMBSave) + sizeof (mbdfentry); - HxX (MBSAVELOC, lastMBSave) = CW (current_mb_save); + HxX (MBSAVELOC, lastMBSave) = BigEndianValue (current_mb_save); mep = (mbdfentry *) ((char *) STARH (MBSAVELOC) + current_mb_save); mep->mbRectSave = *rect; @@ -398,22 +399,22 @@ done:; \ FAIL; mep->mbMenuDir = CWC (MBRIGHTDIR); - mep->mbMLOffset = CW (offset); + mep->mbMLOffset = BigEndianValue (offset); mup = (muelem *) ((char *) STARH (MR (MenuList)) + offset); mep->mbMLHandle = mup->muhandle; mep->mbReserved = CLC (0); - save_rect.top = CW (CW (rect->top) - 1); - save_rect.left = CW (CW (rect->left) - 1); - save_rect.bottom = CW (CW (rect->bottom) + 2); - save_rect.right = CW (CW (rect->right) + 2); + save_rect.top = BigEndianValue (BigEndianValue (rect->top) - 1); + save_rect.left = BigEndianValue (BigEndianValue (rect->left) - 1); + save_rect.bottom = BigEndianValue (BigEndianValue (rect->bottom) + 2); + save_rect.right = BigEndianValue (BigEndianValue (rect->right) + 2); bounds = &PIXMAP_BOUNDS (save_pmh); *bounds = save_rect; /* long align the left boundary */ - bounds->left = CW (CW (save_rect.left) & ~31); - bounds->right = CW (MIN (CW (bounds->right), - CW (PORT_BOUNDS(thePort).right))); + bounds->left = BigEndianValue (BigEndianValue (save_rect.left) & ~31); + bounds->right = BigEndianValue (MIN (BigEndianValue (bounds->right), + BigEndianValue (PORT_BOUNDS(thePort).right))); height = RECT_HEIGHT (bounds); width = RECT_WIDTH (bounds); @@ -426,7 +427,7 @@ done:; \ pixmap_set_pixel_fields (STARH (save_pmh), gd_bpp); row_bytes = ((width * gd_bpp + 31) / 32) * 4; - PIXMAP_SET_ROWBYTES_X (save_pmh, CW (row_bytes)); + PIXMAP_SET_ROWBYTES_X (save_pmh, BigEndianValue (row_bytes)); p = NewPtr (height * row_bytes); if (MemErr != CWC (noErr)) @@ -463,14 +464,14 @@ done:; \ PenNormal (); RGBForeColor (&ROMlib_black_rgb_color); - save_rect.right = CW (CW (save_rect.right) - 1); - save_rect.bottom = CW (CW (save_rect.bottom) - 1); + save_rect.right = BigEndianValue (BigEndianValue (save_rect.right) - 1); + save_rect.bottom = BigEndianValue (BigEndianValue (save_rect.bottom) - 1); FrameRect (&save_rect); - MoveTo (CW (save_rect.right), CW (save_rect.top) + 3); - LineTo (CW (save_rect.right), CW (save_rect.bottom)); - MoveTo (CW (save_rect.left) + 3, CW (save_rect.bottom)); - LineTo (CW (save_rect.right), CW (save_rect.bottom)); + MoveTo (BigEndianValue (save_rect.right), BigEndianValue (save_rect.top) + 3); + LineTo (BigEndianValue (save_rect.right), BigEndianValue (save_rect.bottom)); + MoveTo (BigEndianValue (save_rect.left) + 3, BigEndianValue (save_rect.bottom)); + LineTo (BigEndianValue (save_rect.right), BigEndianValue (save_rect.bottom)); ClipRect (rect); } @@ -488,10 +489,10 @@ restore (void) mep = (mbdfentry *) ((char *) STARH (MBSAVELOC) + Hx (MBSAVELOC, lastMBSave)); save_rect = mep->mbRectSave; - save_rect.top = CW (CW (save_rect.top) - 1); - save_rect.left = CW (CW (save_rect.left) - 1); - save_rect.bottom = CW (CW (save_rect.bottom) + 2); - save_rect.right = CW (CW (save_rect.right) + 2); + save_rect.top = BigEndianValue (BigEndianValue (save_rect.top) - 1); + save_rect.left = BigEndianValue (BigEndianValue (save_rect.left) - 1); + save_rect.bottom = BigEndianValue (BigEndianValue (save_rect.bottom) + 2); + save_rect.right = BigEndianValue (BigEndianValue (save_rect.right) + 2); save_pmh = (PixMapHandle) MR (mep->mbBitsSave); @@ -520,7 +521,7 @@ restore (void) mep->mbBitsSave = NULL; HxX (MBSAVELOC, lastMBSave) - = CW (Hx (MBSAVELOC, lastMBSave) - sizeof (mbdfentry)); + = BigEndianValue (Hx (MBSAVELOC, lastMBSave) - sizeof (mbdfentry)); }); } @@ -539,20 +540,20 @@ A1(PRIVATE, Rect *, getrect, LONGINT, offset) CalcMenuSize(mh); if (hiword) { /* hierarchical */ /* note 7 and 5 below are guesses */ - r.top = CW(MAX(Hx(MBSAVELOC, mbItemRect.top), CW(MBarHeight)+7)); - r.left = CW(Hx(MBSAVELOC, mbItemRect.right) - 5); - r.bottom = CW(CW(r.top) + Hx(mh, menuHeight)); - r.right = CW(CW(r.left) + Hx(mh, menuWidth)); + r.top = BigEndianValue(MAX(Hx(MBSAVELOC, mbItemRect.top), BigEndianValue(MBarHeight)+7)); + r.left = BigEndianValue(Hx(MBSAVELOC, mbItemRect.right) - 5); + r.bottom = BigEndianValue(BigEndianValue(r.top) + Hx(mh, menuHeight)); + r.right = BigEndianValue(BigEndianValue(r.left) + Hx(mh, menuWidth)); } else { /* regular */ r.top = MBarHeight; r.left = mp->muleft; - r.bottom = CW(CW(r.top) + Hx(mh, menuHeight)); - r.right = CW(CW(r.left) + Hx(mh, menuWidth)); + r.bottom = BigEndianValue(BigEndianValue(r.top) + Hx(mh, menuHeight)); + r.right = BigEndianValue(BigEndianValue(r.left) + Hx(mh, menuWidth)); } - dh = CW(screenBitsX.bounds.right) - 10 - CW(r.right); + dh = BigEndianValue(screenBitsX.bounds.right) - 10 - BigEndianValue(r.right); if (dh > 0) dh = 0; - dv = CW(screenBitsX.bounds.bottom) - 10 - CW(r.bottom); + dv = BigEndianValue(screenBitsX.bounds.bottom) - 10 - BigEndianValue(r.bottom); if (dv > 0) dv = 0; OffsetRect(&r, dh, dv); @@ -565,8 +566,8 @@ A1(PRIVATE, mbdfentry *, offtomep, LONGINT, offset) mbdfep = (mbdfentry *) STARH(MR (MBSaveLoc)); for (mbdfp = (mbdfentry *) - ((char *) mbdfep + CW(((mbdfheader *)mbdfep)->lastMBSave)); - mbdfp != mbdfep && CW(mbdfp->mbMLOffset) != offset; mbdfp--) + ((char *) mbdfep + BigEndianValue(((mbdfheader *)mbdfep)->lastMBSave)); + mbdfp != mbdfep && BigEndianValue(mbdfp->mbMLOffset) != offset; mbdfp--) ; return mbdfp == mbdfep ? 0 : mbdfp; } @@ -593,7 +594,7 @@ A1(PRIVATE, RgnHandle, menurgn, RgnHandle, rgn) { Rect r; - if (CW(MBarHeight) <= 0) + if (BigEndianValue(MBarHeight) <= 0) height(); r = PORT_RECT (MR (wmgr_port)); r.bottom = MBarHeight; diff --git a/src/stdmdef.cpp b/src/stdmdef.cpp index e0b04666..7d1ad03b 100644 --- a/src/stdmdef.cpp +++ b/src/stdmdef.cpp @@ -25,13 +25,14 @@ char ROMlib_rcsid_stdmdef[] = #include "rsys/custom.h" using namespace Executor; +using namespace ByteSwap; static Rect *current_menu_rect; #define TOP_ARROW_P() \ - (CW (TopMenuItem) < CW (current_menu_rect->top)) + (BigEndianValue (TopMenuItem) < BigEndianValue (current_menu_rect->top)) #define BOTTOM_ARROW_P() \ - (CW (AtMenuBottom) > CW (current_menu_rect->bottom)) + (BigEndianValue (AtMenuBottom) > BigEndianValue (current_menu_rect->bottom)) static int16 checksize, cloversize, lineheight, ascent; @@ -160,7 +161,7 @@ size_menu (MenuHandle mh, tablePtr tablep) width = height = actual_height = 0; /* the 32 is just a guess */ - max_height = CW (screenBitsX.bounds.bottom) - 32; + max_height = BigEndianValue (screenBitsX.bounds.bottom) - 32; for (tp = tablep->entry, ep = tp + tablep->count; tp != ep; tp++) { icon_info_t icon_info; @@ -184,8 +185,8 @@ size_menu (MenuHandle mh, tablePtr tablep) width = w; } TextFace(0); - HxX (mh, menuWidth) = CW (width); - HxX (mh, menuHeight) = CW (actual_height); + HxX (mh, menuWidth) = BigEndianValue (width); + HxX (mh, menuHeight) = BigEndianValue (actual_height); } static void @@ -213,13 +214,13 @@ draw_right_arrow (Rect *menu_rect, MenuHandle mh, int item, int invert_p) arrow_bitmap.rowBytes = CWC (1); SetRect (&arrow_bitmap.bounds, 0, 0, /* right, bottom */ 6, 11); - y = CW (menu_rect->top) + 2; - x = CW (menu_rect->right) - 14; + y = BigEndianValue (menu_rect->top) + 2; + x = BigEndianValue (menu_rect->right) - 14; - dst_rect.top = CW (y); - dst_rect.left = CW (x); - dst_rect.bottom = CW (y + 11); - dst_rect.right = CW (x + 6); + dst_rect.top = BigEndianValue (y); + dst_rect.left = BigEndianValue (x); + dst_rect.bottom = BigEndianValue (y + 11); + dst_rect.right = BigEndianValue (x + 6); CopyBits (&arrow_bitmap, PORT_BITS_FOR_COPY (thePort), &arrow_bitmap.bounds, &dst_rect, srcCopy, NULL); @@ -257,7 +258,7 @@ draw_arrow (Rect *menu_rect, MenuHandle mh, arrowtype arrdir) arrow_bitmap.rowBytes = CWC (2); SetRect (&arrow_bitmap.bounds, 0, 0, /* right, bottom */ 11, 6); - top_of_item = CW (menu_rect->top); + top_of_item = BigEndianValue (menu_rect->top); } else if (arrdir == downarrow) { @@ -265,7 +266,7 @@ draw_arrow (Rect *menu_rect, MenuHandle mh, arrowtype arrdir) arrow_bitmap.rowBytes = CWC (2); SetRect (&arrow_bitmap.bounds, 0, 0, /* right, bottom */ 11, 6); - top_of_item = CW (menu_rect->bottom) - lineheight; + top_of_item = BigEndianValue (menu_rect->bottom) - lineheight; } else gui_abort (); @@ -278,14 +279,14 @@ draw_arrow (Rect *menu_rect, MenuHandle mh, arrowtype arrdir) erase_rect.left = menu_rect->left; erase_rect.right = menu_rect->right; - erase_rect.top = CW (top_of_item); - erase_rect.bottom = CW (top_of_item + lineheight); + erase_rect.top = BigEndianValue (top_of_item); + erase_rect.bottom = BigEndianValue (top_of_item + lineheight); EraseRect (&erase_rect); - dst_rect.top = CW (top_of_item + 5); - dst_rect.left = CW (CW (menu_rect->left) + checksize); - dst_rect.bottom = CW (top_of_item + 5 + /* arrows are `6' tall */ 6); - dst_rect.right = CW (CW (menu_rect->left) + checksize + dst_rect.top = BigEndianValue (top_of_item + 5); + dst_rect.left = BigEndianValue (BigEndianValue (menu_rect->left) + checksize); + dst_rect.bottom = BigEndianValue (top_of_item + 5 + /* arrows are `6' tall */ 6); + dst_rect.right = BigEndianValue (BigEndianValue (menu_rect->left) + checksize + /* arrows are `11' wide */ 11); CopyBits (&arrow_bitmap, PORT_BITS_FOR_COPY (thePort), &arrow_bitmap.bounds, &dst_rect, srcCopy, NULL); @@ -306,15 +307,15 @@ A3(PRIVATE, void, erasearrow, Rect *, rp, tablePtr, tablep, BOOLEAN, upordown) Rect r; INTEGER x, y; - x = CW(rp->left) + checksize; + x = BigEndianValue(rp->left) + checksize; if (upordown == UP) - y = CW(rp->top) + 5; + y = BigEndianValue(rp->top) + 5; else - y = CW(rp->bottom) - lineheight + 5; - r.top = CW(y); - r.left = CW(x); - r.bottom = CW(y+6); - r.right = CW(x+11); + y = BigEndianValue(rp->bottom) - lineheight + 5; + r.top = BigEndianValue(y); + r.left = BigEndianValue(x); + r.bottom = BigEndianValue(y+6); + r.right = BigEndianValue(x+11); EraseRect(&r); } @@ -341,8 +342,8 @@ draw_item (Rect *rp, struct table::tableentry *tp, int32 bit, int item, MenuHand active_p = ! ((MI_ENABLE_FLAGS (mh) & bit) != bit || divider_p); - top = tp[0].top + CW (TopMenuItem); - bottom = tp[1].top + CW (TopMenuItem); + top = tp[0].top + BigEndianValue (TopMenuItem); + bottom = tp[1].top + BigEndianValue (TopMenuItem); v = top + ascent; @@ -391,8 +392,8 @@ draw_item (Rect *rp, struct table::tableentry *tp, int32 bit, int item, MenuHand } RGBBackColor (invert_p ? &title_color : &bk_color); - rtmp.top = CW (top); - rtmp.bottom = CW (bottom); + rtmp.top = BigEndianValue (top); + rtmp.bottom = BigEndianValue (bottom); rtmp.left = rp->left; rtmp.right = rp->right; @@ -403,7 +404,7 @@ draw_item (Rect *rp, struct table::tableentry *tp, int32 bit, int item, MenuHand && !draw_right_arrow_p) { RGBForeColor (invert_p ? &bk_color : &mark_color); - MoveTo (CW (rp->left) + 2, v); + MoveTo (BigEndianValue (rp->left) + 2, v); DrawChar(tp->options->mmarker); } @@ -413,10 +414,10 @@ draw_item (Rect *rp, struct table::tableentry *tp, int32 bit, int item, MenuHand /* draw the icon */ if (draw_icon_p) { - rtmp.top = CW (top + ICON_PAD / 2); - rtmp.left = CW (CW (rp->left) + checksize + 2); - rtmp.bottom = CW (CW (rtmp.top) + (icon_info.height - ICON_PAD)); - rtmp.right = CW (CW (rtmp.left) + (icon_info.width - ICON_PAD)); + rtmp.top = BigEndianValue (top + ICON_PAD / 2); + rtmp.left = BigEndianValue (BigEndianValue (rp->left) + checksize + 2); + rtmp.bottom = BigEndianValue (BigEndianValue (rtmp.top) + (icon_info.height - ICON_PAD)); + rtmp.right = BigEndianValue (BigEndianValue (rtmp.left) + (icon_info.width - ICON_PAD)); if (icon_info.color_icon_p) PlotCIcon (&rtmp, (CIconHandle) icon_info.icon); @@ -427,22 +428,22 @@ draw_item (Rect *rp, struct table::tableentry *tp, int32 bit, int item, MenuHand if (divider_p) { RGBForeColor (&title_color); - MoveTo (CW (rp->left), v - 4); - LineTo (CW (rp->right), v - 4); + MoveTo (BigEndianValue (rp->left), v - 4); + LineTo (BigEndianValue (rp->right), v - 4); } else { RGBForeColor (invert_p ? &bk_color : &title_color); - MoveTo (CW (rp->left) + icon_info.width + checksize + 2, v); + MoveTo (BigEndianValue (rp->left) + icon_info.width + checksize + 2, v); TextFace (tp->options->mstyle); DrawString (tp->name); TextFace (0); } rtmp.left = rp->left; rtmp.right = rp->right; - rtmp.top = CW (top); - rtmp.bottom = CW (bottom); + rtmp.top = BigEndianValue (top); + rtmp.bottom = BigEndianValue (bottom); if ((iskeyequiv(tp) || draw_right_arrow_p) && !divider_p) { @@ -457,7 +458,7 @@ draw_item (Rect *rp, struct table::tableentry *tp, int32 bit, int item, MenuHand RGBForeColor (invert_p ? &bk_color : &command_color); - new_left = CW(rp->right) - (2 * cloversize + 1); + new_left = BigEndianValue(rp->right) - (2 * cloversize + 1); MoveTo (new_left, v); DrawChar (commandMark); DrawChar (tp->options->mkeyeq); @@ -466,7 +467,7 @@ draw_item (Rect *rp, struct table::tableentry *tp, int32 bit, int item, MenuHand Rect r; r = rtmp; - r.left = CW (new_left); + r.left = BigEndianValue (new_left); PenMode(notPatBic); PenPat(gray); PaintRect(&r); @@ -497,13 +498,13 @@ draw_menu (MenuHandle mh, Rect *rp, tablePtr tablep) struct table::tableentry *tp, *ep; int16 topcutoff, bottomcutoff; - if (CW (TopMenuItem) < CW(rp->top)) - topcutoff = CW(rp->top) - CW (TopMenuItem) + lineheight; + if (BigEndianValue (TopMenuItem) < BigEndianValue(rp->top)) + topcutoff = BigEndianValue(rp->top) - BigEndianValue (TopMenuItem) + lineheight; else topcutoff = 0; - if (CW (AtMenuBottom) > CW (rp->bottom)) - bottomcutoff = CW (rp->bottom) - CW (TopMenuItem) - lineheight; + if (BigEndianValue (AtMenuBottom) > BigEndianValue (rp->bottom)) + bottomcutoff = BigEndianValue (rp->bottom) - BigEndianValue (TopMenuItem) - lineheight; else bottomcutoff = 32767; @@ -519,9 +520,9 @@ draw_menu (MenuHandle mh, Rect *rp, tablePtr tablep) bit = 1 << nitem; draw_item (rp, tp, bit, nitem, mh, FALSE); } - if (CW(rp->top) > CW (TopMenuItem)) + if (BigEndianValue(rp->top) > BigEndianValue (TopMenuItem)) draw_arrow (rp, mh, uparrow); - if (CW (rp->bottom) < CW(AtMenuBottom)) + if (BigEndianValue (rp->bottom) < BigEndianValue(AtMenuBottom)) draw_arrow (rp, mh, downarrow); HxX (MBSAVELOC, mbUglyScroll) = CWC (0); } @@ -534,8 +535,8 @@ fliprect (Rect *rp, int16 i, tablePtr tablep, Rect *flipr) tp = &tablep->entry[i-1]; flipr->left = rp->left; flipr->right = rp->right; - flipr->top = CW(tp[0].top + CW(TopMenuItem)); - flipr->bottom = CW(tp[1].top + CW(TopMenuItem)); + flipr->top = BigEndianValue(tp[0].top + BigEndianValue(TopMenuItem)); + flipr->bottom = BigEndianValue(tp[1].top + BigEndianValue(TopMenuItem)); } static void @@ -550,9 +551,9 @@ doupdown (MenuHandle mh, Rect *rp, tablePtr tablep, BOOLEAN upordown, if (*itemp) { - /* flip (rp, CW (*itemp), tablep); */ - draw_item (rp, &tablep->entry[CW (*itemp) - 1], 1 << CW (*itemp), - CW (*itemp), mh, FALSE); + /* flip (rp, BigEndianValue (*itemp), tablep); */ + draw_item (rp, &tablep->entry[BigEndianValue (*itemp) - 1], 1 << BigEndianValue (*itemp), + BigEndianValue (*itemp), mh, FALSE); *itemp = CWC (0); } if (HxX (MBSAVELOC, mbUglyScroll)) @@ -560,43 +561,43 @@ doupdown (MenuHandle mh, Rect *rp, tablePtr tablep, BOOLEAN upordown, /* don't sroll the scroll arrows */ scrollr = *rp; if (TOP_ARROW_P ()) - scrollr.top = CW (CW (scrollr.top) + lineheight); + scrollr.top = BigEndianValue (BigEndianValue (scrollr.top) + lineheight); if (BOTTOM_ARROW_P ()) - scrollr.bottom = CW (CW (scrollr.bottom) - lineheight); + scrollr.bottom = BigEndianValue (BigEndianValue (scrollr.bottom) - lineheight); updater = *rp; if (upordown == UP) { - offset = MIN (lineheight, CW (rp->top) - CW (TopMenuItem)); - TopMenuItem = CW (CW (TopMenuItem) + offset); - AtMenuBottom = CW (CW (AtMenuBottom) + offset); + offset = MIN (lineheight, BigEndianValue (rp->top) - BigEndianValue (TopMenuItem)); + TopMenuItem = BigEndianValue (BigEndianValue (TopMenuItem) + offset); + AtMenuBottom = BigEndianValue (BigEndianValue (AtMenuBottom) + offset); if (TOP_ARROW_P ()) { updater.top = scrollr.top; - updater.bottom = CW (CW (updater.top) + lineheight); + updater.bottom = BigEndianValue (BigEndianValue (updater.top) + lineheight); } else { updater.top = rp->top; - updater.bottom = CW (CW (updater.top) + 2 * lineheight); + updater.bottom = BigEndianValue (BigEndianValue (updater.top) + 2 * lineheight); erasearrow (rp, tablep, UP); } } else { - offset = MAX (-lineheight, CW (rp->bottom) - CW (AtMenuBottom)); - TopMenuItem = CW (CW (TopMenuItem) + offset); - AtMenuBottom = CW (CW (AtMenuBottom) + offset); + offset = MAX (-lineheight, BigEndianValue (rp->bottom) - BigEndianValue (AtMenuBottom)); + TopMenuItem = BigEndianValue (BigEndianValue (TopMenuItem) + offset); + AtMenuBottom = BigEndianValue (BigEndianValue (AtMenuBottom) + offset); if (BOTTOM_ARROW_P ()) { updater.bottom = scrollr.bottom; - updater.top = CW (CW (updater.bottom) - lineheight); + updater.top = BigEndianValue (BigEndianValue (updater.bottom) - lineheight); } else { updater.bottom = rp->bottom; - updater.top = CW (CW (updater.bottom) - 2 * lineheight); + updater.top = BigEndianValue (BigEndianValue (updater.bottom) - 2 * lineheight); erasearrow (rp, tablep, DOWN); } } @@ -605,9 +606,9 @@ doupdown (MenuHandle mh, Rect *rp, tablePtr tablep, BOOLEAN upordown, DisposeRgn (updatergn); ClipRect (&updater); for (tp = tablep->entry, ep = tp + tablep->count, bit = 1 << 1; - tp[0].top < CW(updater.bottom) - CW(TopMenuItem) && tp != ep; + tp[0].top < BigEndianValue(updater.bottom) - BigEndianValue(TopMenuItem) && tp != ep; tp++, bit <<= 1) - if (tp[1].top > CW (updater.top) - CW (TopMenuItem)) + if (tp[1].top > BigEndianValue (updater.top) - BigEndianValue (TopMenuItem)) draw_item (rp, tp, tp - tablep->entry + 1, bit, mh, FALSE); rtmp.top = rtmp.left = CWC(-32767); rtmp.bottom = rtmp.right = CWC(32767); @@ -617,12 +618,12 @@ doupdown (MenuHandle mh, Rect *rp, tablePtr tablep, BOOLEAN upordown, HxX(MBSAVELOC, mbUglyScroll) = CWC (1); if (upordown == DOWN) { - if (CW(AtMenuBottom) >= CW (rp->bottom)) + if (BigEndianValue(AtMenuBottom) >= BigEndianValue (rp->bottom)) draw_arrow (rp, mh, downarrow); } else { - if (CW(TopMenuItem) <= CW (rp->top)) + if (BigEndianValue(TopMenuItem) <= BigEndianValue (rp->top)) draw_arrow (rp, mh, uparrow); } } @@ -639,51 +640,51 @@ choose_menu (MenuHandle mh, Rect *rp, Point p, int16 *itemp, tablePtr tablep) valid_rect.left = rp->left; valid_rect.right = rp->right; - valid_rect.top = CW (MAX (CW (rp->top), CW (TopMenuItem))); - valid_rect.bottom = CW (MIN (CW (rp->bottom), CW (AtMenuBottom))); + valid_rect.top = BigEndianValue (MAX (BigEndianValue (rp->top), BigEndianValue (TopMenuItem))); + valid_rect.bottom = BigEndianValue (MIN (BigEndianValue (rp->bottom), BigEndianValue (AtMenuBottom))); clip_rect.left = rp->left; clip_rect.right = rp->right; - clip_rect.top = CW (TOP_ARROW_P () ? CW (rp->top) + lineheight - : CW (rp->top)); - clip_rect.bottom = CW (BOTTOM_ARROW_P () ? CW (rp->bottom) - lineheight - : CW (rp->bottom)); + clip_rect.top = BigEndianValue (TOP_ARROW_P () ? BigEndianValue (rp->top) + lineheight + : BigEndianValue (rp->top)); + clip_rect.bottom = BigEndianValue (BOTTOM_ARROW_P () ? BigEndianValue (rp->bottom) - lineheight + : BigEndianValue (rp->bottom)); ClipRect (&clip_rect); - if (CW (*itemp) < 0) + if (BigEndianValue (*itemp) < 0) *itemp = CWC (0); if (PtInRect (p, &valid_rect)) { if (BOTTOM_ARROW_P () - && p.v >= CW(rp->bottom) - lineheight) + && p.v >= BigEndianValue(rp->bottom) - lineheight) doupdown (mh, rp, tablep, DOWN, itemp); else if (TOP_ARROW_P () - && p.v < CW(rp->top) + lineheight) + && p.v < BigEndianValue(rp->top) + lineheight) doupdown (mh, rp, tablep, UP, itemp); else { int32 bit; for (tp = tablep->entry, ep = tp + tablep->count; - tp != ep && p.v >= tp->top + CW (TopMenuItem); + tp != ep && p.v >= tp->top + BigEndianValue (TopMenuItem); tp++) ; nitem = tp - tablep->entry; - MenuDisable = CL ((menu_id<<16) | (uint16) nitem); + MenuDisable = BigEndianValue ((menu_id<<16) | (uint16) nitem); bit = (1 << nitem) | 1; if ((MI_ENABLE_FLAGS (mh) & bit) != bit || (tp[-1].name[0] && tp[-1].name[1] == '-')) nitem = 0; - if (CW (*itemp) != nitem) + if (BigEndianValue (*itemp) != nitem) { if (*itemp) /* redraw this guy normally */ - draw_item (rp, &tablep->entry[CW (*itemp) - 1], 1 << CW (*itemp), - CW (*itemp), mh, FALSE); + draw_item (rp, &tablep->entry[BigEndianValue (*itemp) - 1], 1 << BigEndianValue (*itemp), + BigEndianValue (*itemp), mh, FALSE); if (nitem) draw_item (rp, &tablep->entry[nitem - 1], 1 << nitem, nitem, mh, TRUE); - *itemp = CW (nitem); + *itemp = BigEndianValue (nitem); } if (nitem) fliprect (rp, nitem, tablep, &HxX(MBSAVELOC, mbItemRect)); @@ -691,7 +692,7 @@ choose_menu (MenuHandle mh, Rect *rp, Point p, int16 *itemp, tablePtr tablep) } else if (*itemp) { - nitem = CW (*itemp); + nitem = BigEndianValue (*itemp); draw_item (rp, &tablep->entry[nitem - 1], 1 << nitem, nitem, mh, FALSE); *itemp = CWC (0); } @@ -708,22 +709,22 @@ A5 (PRIVATE, void, popuprect, MenuHandle, mh, Rect *, rp, Point, p, if (Hx(mh, menuWidth) == -1 || Hx(mh, menuHeight) == -1) CalcMenuSize(mh); - rp->top = CW (p.v - tablep->entry[CW (*itemp) - 1].top); - rp->left = CW (p.h); - rp->right = CW (CW (rp->left) + Hx (mh, menuWidth)); + rp->top = BigEndianValue (p.v - tablep->entry[BigEndianValue (*itemp) - 1].top); + rp->left = BigEndianValue (p.h); + rp->right = BigEndianValue (BigEndianValue (rp->left) + Hx (mh, menuWidth)); *itemp = rp->top; - for (tp = tablep->entry; CW(rp->top) < CW(MBarHeight); tp++) - rp->top = CW(CW(rp->top) + (tp[1].top - tp[0].top)); + for (tp = tablep->entry; BigEndianValue(rp->top) < BigEndianValue(MBarHeight); tp++) + rp->top = BigEndianValue(BigEndianValue(rp->top) + (tp[1].top - tp[0].top)); - rp->bottom = CW(CW(rp->top) + Hx(mh, menuHeight)); + rp->bottom = BigEndianValue(BigEndianValue(rp->top) + Hx(mh, menuHeight)); - vmax = CW (screenBitsX.bounds.bottom) - 2; /* subtract 2 for frame */ - for (tp = tablep->entry + tablep->count - 1; CW(rp->bottom) > vmax; --tp) - rp->bottom = CW(CW(rp->bottom) - (tp[1].top - tp[0].top)); - rp->top = CW(CW(rp->bottom) - Hx(mh, menuHeight)); - for (tp = tablep->entry; CW(rp->top) < CW(MBarHeight); tp++) - rp->top = CW(CW(rp->top) + (tp[1].top - tp[0].top)); + vmax = BigEndianValue (screenBitsX.bounds.bottom) - 2; /* subtract 2 for frame */ + for (tp = tablep->entry + tablep->count - 1; BigEndianValue(rp->bottom) > vmax; --tp) + rp->bottom = BigEndianValue(BigEndianValue(rp->bottom) - (tp[1].top - tp[0].top)); + rp->top = BigEndianValue(BigEndianValue(rp->bottom) - Hx(mh, menuHeight)); + for (tp = tablep->entry; BigEndianValue(rp->top) < BigEndianValue(MBarHeight); tp++) + rp->top = BigEndianValue(BigEndianValue(rp->top) + (tp[1].top - tp[0].top)); } @@ -753,8 +754,8 @@ P5(PUBLIC, pascal void, mdef0, INTEGER, mess, MenuHandle, mh, Rect *, rp, GetFontInfo(&fi); checksize = CharWidth(checkMark) + 1; /* used to use widMax - 1 here */ - lineheight = CW(fi.ascent) + CW(fi.descent) + CW(fi.leading); - ascent = CW(fi.ascent); + lineheight = BigEndianValue(fi.ascent) + BigEndianValue(fi.descent) + BigEndianValue(fi.leading); + ascent = BigEndianValue(fi.ascent); cloversize = CharWidth(commandMark); for (sp = (char *) STARH(mh) + SIZEOFMINFO + Hx(mh, menuData[0]), count = 0; @@ -781,7 +782,7 @@ P5(PUBLIC, pascal void, mdef0, INTEGER, mess, MenuHandle, mh, Rect *, rp, v += icon_info.height ? MAX (icon_info.height, lineheight) : lineheight; } tabp->top = v; - AtMenuBottom = CW(CW(TopMenuItem) + v); + AtMenuBottom = BigEndianValue(BigEndianValue(TopMenuItem) + v); switch (mess) { diff --git a/src/syserr.cpp b/src/syserr.cpp index f00f3435..cbaf6a55 100644 --- a/src/syserr.cpp +++ b/src/syserr.cpp @@ -34,6 +34,7 @@ char ROMlib_rcsid_syserr[] = #include "rsys/syserr.h" using namespace Executor; +using namespace ByteSwap; PRIVATE myalerttab_t myalerttab = { CWC(8), @@ -128,10 +129,10 @@ A1(PRIVATE, INTEGER *, findid, INTEGER, id) int i; INTEGER *ip; - for (i = CW(*(INTEGER *) MR(DSAlertTab)), + for (i = BigEndianValue(*(INTEGER *) MR(DSAlertTab)), ip = (INTEGER *) MR(DSAlertTab) + 1; - i > 0 && CW(*ip) != id; - --i, ip = (INTEGER *) ((char *) ip + CW(ip[1]) + 2 * sizeof(INTEGER))) + i > 0 && BigEndianValue(*ip) != id; + --i, ip = (INTEGER *) ((char *) ip + BigEndianValue(ip[1]) + 2 * sizeof(INTEGER))) ; return i > 0 ? ip : (INTEGER *) 0; } @@ -142,7 +143,7 @@ A3(PRIVATE, void, drawtextstring, INTEGER, id, INTEGER, offsetx, struct tdef *tp; if (id && (tp = (struct tdef *) findid(id))) { - MoveTo(CW(tp->loc.h) + offsetx, CW(tp->loc.v) + offsety); + MoveTo(BigEndianValue(tp->loc.h) + offsetx, BigEndianValue(tp->loc.v) + offsety); DrawText_c_string (tp->text); } } @@ -194,22 +195,22 @@ A4(PRIVATE, void, dobuttons, INTEGER, id, INTEGER, offsetx, */ C_OffsetRect (&bp->buts[i].butloc, offsetx, offsety); - if ((sp = (struct sdef *)findid(CW(bp->buts[i].butstrid)))) { + if ((sp = (struct sdef *)findid(BigEndianValue(bp->buts[i].butstrid)))) { if (demo_button_p && sp->text[0] == 'O' && sp->text[1] == 'K') textp = "Demo"; else textp = sp->text; tcnt = strlen(textp); twid = TextWidth((Ptr) textp, 0, tcnt); - MoveTo((CW(bp->buts[i].butloc.left) + - CW(bp->buts[i].butloc.right) - twid) / 2, - (CW(bp->buts[i].butloc.top) + - CW(bp->buts[i].butloc.bottom)) / 2 + 4); + MoveTo((BigEndianValue(bp->buts[i].butloc.left) + + BigEndianValue(bp->buts[i].butloc.right) - twid) / 2, + (BigEndianValue(bp->buts[i].butloc.top) + + BigEndianValue(bp->buts[i].butloc.bottom)) / 2 + 4); DrawText((Ptr) textp, 0, tcnt); } #if defined (BILLBUTTONS) - h = CW(bp->buts[i].butloc.right) - CW(bp->buts[i].butloc.left); - v = (CW(bp->buts[i].butloc.bottom) - CW(bp->buts[i].butloc.top))/2; + h = BigEndianValue(bp->buts[i].butloc.right) - BigEndianValue(bp->buts[i].butloc.left); + v = (BigEndianValue(bp->buts[i].butloc.bottom) - BigEndianValue(bp->buts[i].butloc.top))/2; if (h > v) h = v; if (!(ROMlib_options & ROMLIB_RECT_SCREEN_BIT)) @@ -227,16 +228,16 @@ A4(PRIVATE, void, dobuttons, INTEGER, id, INTEGER, offsetx, for (done = 0; !done;) { C_GetNextEvent(mDownMask|keyDownMask, &evt); if (evt.what == CWC(mouseDown) || evt.what == CWC(keyDown)) { - p.h = CW(evt.where.h); - p.v = CW(evt.where.v); - for (i = 0; !done && i < CW(bp->nbut); i++) { + p.h = BigEndianValue(evt.where.h); + p.v = BigEndianValue(evt.where.v); + for (i = 0; !done && i < BigEndianValue(bp->nbut); i++) { if (PtInRect(p, &bp->buts[i].butloc) || ((evt.what == CWC(keyDown)) && - (((CL(evt.message) & charCodeMask) == '\r') || - ((CL(evt.message) & charCodeMask) == NUMPAD_ENTER))) + (((BigEndianValue(evt.message) & charCodeMask) == '\r') || + ((BigEndianValue(evt.message) & charCodeMask) == NUMPAD_ENTER))) ) { if ((pp = (struct pdef *) - findid(CW(bp->buts[i].butprocid)))) + findid(BigEndianValue(bp->buts[i].butprocid)))) /* NOTE: we will have to do a better job here sometime */ (*(void (*)(void))MR(pp->proc))(); @@ -282,24 +283,24 @@ P1(PUBLIC pascal, void, SysError, short, errorcode) if (!DSAlertTab) { #if defined (CLIFF_CENTERING_ALGORITHM) - DSAlertTab = CL((Ptr) &myalerttab); + DSAlertTab = BigEndianValue((Ptr) &myalerttab); DSAlertRect.top = CWC(64); DSAlertRect.left = CWC(32); DSAlertRect.bottom = CWC(190); DSAlertRect.right = CWC(480); #else - INTEGER screen_width = CW (main_gd_rect.right); - INTEGER screen_height = CW (main_gd_rect.bottom); + INTEGER screen_width = BigEndianValue (main_gd_rect.right); + INTEGER screen_height = BigEndianValue (main_gd_rect.bottom); DSAlertTab = RM((Ptr) &myalerttab); - DSAlertRect.top = CW((screen_height - 126) / 3); - DSAlertRect.left = CW((screen_width - 448) / 2); - DSAlertRect.bottom = CW(CW(DSAlertRect.top) + 126); - DSAlertRect.right = CW(CW(DSAlertRect.left) + 448); + DSAlertRect.top = BigEndianValue((screen_height - 126) / 3); + DSAlertRect.left = BigEndianValue((screen_width - 448) / 2); + DSAlertRect.bottom = BigEndianValue(BigEndianValue(DSAlertRect.top) + 126); + DSAlertRect.right = BigEndianValue(BigEndianValue(DSAlertRect.left) + 448); #endif - offsetx = CW (DSAlertRect.left) - 32; - offsety = CW (DSAlertRect.top) - 64; + offsetx = BigEndianValue (DSAlertRect.left) - 32; + offsety = BigEndianValue (DSAlertRect.top) - 64; } else { offsetx = offsety = 0; @@ -310,7 +311,7 @@ P1(PUBLIC pascal, void, SysError, short, errorcode) /* NOT DONE YET... signal handlers sort of do that anyway */ /* 2. Store errorcode in DSErrCode */ - DSErrCode = CW(errorcode); + DSErrCode = BigEndianValue(errorcode); /* 3. If no Cx(DSAlertTab), bitch */ if (!DSAlertTab) { @@ -322,7 +323,7 @@ P1(PUBLIC pascal, void, SysError, short, errorcode) /* 4. Allocate and re-initialize QuickDraw */ #if defined (BINCOMPAT) a5 = (LONGINT) (long) US_TO_SYN68K (&tmpa5); - CurrentA5 = (Ptr) (long) CL(a5); + CurrentA5 = (Ptr) (long) BigEndianValue(a5); #endif /* BINCOMPAT */ InitGraf((Ptr) quickbytes + sizeof(quickbytes) - 4); ROMlib_initport(&alertport); @@ -345,13 +346,13 @@ P1(PUBLIC pascal, void, SysError, short, errorcode) r = DSAlertRect; FillRect(&r, white); #if defined (OLDSTYLEALERT) - r.right = CW(CW(r.right) - (2)); - r.bottom = CW(CW(r.bottom) - (2)); + r.right = BigEndianValue(BigEndianValue(r.right) - (2)); + r.bottom = BigEndianValue(BigEndianValue(r.bottom) - (2)); FrameRect(&r); PenSize(2, 2); - MoveTo(CW(r.left)+2, CW(r.bottom)); - LineTo(CW(r.right), CW(r.bottom)); - LineTo(CW(r.right), CW(r.top)+2); + MoveTo(BigEndianValue(r.left)+2, BigEndianValue(r.bottom)); + LineTo(BigEndianValue(r.right), BigEndianValue(r.bottom)); + LineTo(BigEndianValue(r.right), BigEndianValue(r.top)+2); PenSize(1, 1); #else /* OLDSTYLEALERT */ FrameRect(&r); @@ -369,18 +370,18 @@ P1(PUBLIC pascal, void, SysError, short, errorcode) ap = (struct adef *) ((INTEGER *) MR(DSAlertTab) + 1); /* 7. text strings */ - drawtextstring(CW(ap->primetextid), offsetx, offsety); - drawtextstring(CW(ap->secondtextid), offsetx, offsety); + drawtextstring(BigEndianValue(ap->primetextid), offsetx, offsety); + drawtextstring(BigEndianValue(ap->secondtextid), offsetx, offsety); /* 8. icon */ - drawicon(CW(ap->iconid), offsetx, offsety); + drawicon(BigEndianValue(ap->iconid), offsetx, offsety); /* 9. TODO: figure out what to do with the proc ... */ /* 10, 11, 12, 13. check for non-zero button id */ /* #warning We blow off ResumeProc until we can properly handle it */ if (ap->buttonid) - dobuttons(/* CL(ResumeProc) ? Cx(ap->buttonid) + 1 : */ Cx(ap->buttonid), + dobuttons(/* BigEndianValue(ResumeProc) ? Cx(ap->buttonid) + 1 : */ Cx(ap->buttonid), offsetx, offsety, false); TRAPEND(); diff --git a/src/system_error.cpp b/src/system_error.cpp index 3683e8b1..0f42d91a 100644 --- a/src/system_error.cpp +++ b/src/system_error.cpp @@ -26,6 +26,7 @@ char ROMlib_rcsid_system_error[] = #include "rsys/options.h" using namespace Executor; +using namespace ByteSwap; #define N_BUTTONS (3) @@ -84,7 +85,7 @@ event_loop (void) | keyDownMask | autoKeyMask), &evt); where = SWAP_POINT (evt.where); - switch (CW (evt.what)) + switch (BigEndianValue (evt.what)) { case mouseDown: { @@ -146,7 +147,7 @@ event_loop (void) { char ch; - ch = CL (evt.message) & 0xFF; + ch = BigEndianValue (evt.message) & 0xFF; if (ch == '\r' || ch == NUMPAD_ENTER) { int i; @@ -245,9 +246,9 @@ Executor::system_error (const char *_message, int _default_button, 0, strlen (message)); GetFontInfo (&font_info); - text_height = ( CW (font_info.ascent) - + CW (font_info.descent) - + CW (font_info.leading)); + text_height = ( BigEndianValue (font_info.ascent) + + BigEndianValue (font_info.descent) + + BigEndianValue (font_info.leading)); line_count /* must be at least one line of text, otherwise we'll get hit @@ -291,8 +292,8 @@ Executor::system_error (const char *_message, int _default_button, /* centered horizontally, with a third of the space above the window, and two-thirds below */ - top = CW (gd_rect->top) + (gd_height - height) / 3; - left = CW (gd_rect->left) + (gd_width - width) / 2; + top = BigEndianValue (gd_rect->top) + (gd_height - height) / 3; + left = BigEndianValue (gd_rect->left) + (gd_width - width) / 2; MoveWindow (msg_window, left, top, TRUE); } @@ -301,8 +302,8 @@ Executor::system_error (const char *_message, int _default_button, message_rect.top = CWC (10); message_rect.left = CWC (10); - message_rect.bottom = CW (message_height + 10); - message_rect.right = CW (message_width + 10); + message_rect.bottom = BigEndianValue (message_height + 10); + message_rect.right = BigEndianValue (message_width + 10); for (i = 0; i < N_BUTTONS; i ++) if (buttons[i].text != NULL) @@ -310,11 +311,11 @@ Executor::system_error (const char *_message, int _default_button, Rect ctl_rect; unsigned char buf[256]; - ctl_rect.top = CW (height - 10 - 20); - ctl_rect.bottom = CW (height - 10); + ctl_rect.top = BigEndianValue (height - 10 - 20); + ctl_rect.bottom = BigEndianValue (height - 10); - ctl_rect.right = CW ( width - 10 - i * (max_button_width + 13)); - ctl_rect.left = CW ( width - 10 - i * (max_button_width + 13) + ctl_rect.right = BigEndianValue ( width - 10 - i * (max_button_width + 13)); + ctl_rect.left = BigEndianValue ( width - 10 - i * (max_button_width + 13) - max_button_width); *buf = (unsigned char) strlen (buttons[i].text); diff --git a/src/teAccess.cpp b/src/teAccess.cpp index 549712f6..6a6d3cb7 100644 --- a/src/teAccess.cpp +++ b/src/teAccess.cpp @@ -21,6 +21,7 @@ char ROMlib_rcsid_teAccess[] = #include "rsys/mman.h" using namespace Executor; +using namespace ByteSwap; P3 (PUBLIC pascal trap, void, TESetText, Ptr, p, LONGINT, length, TEHandle, teh) { @@ -30,11 +31,11 @@ P3 (PUBLIC pascal trap, void, TESetText, Ptr, p, LONGINT, length, TEHandle, teh) #if 0 HASSIGN_3 (teh, - selStart, CW (length), - selEnd, CW (length), - teLength, CW (length)); + selStart, BigEndianValue (length), + selEnd, BigEndianValue (length), + teLength, BigEndianValue (length)); #else - HxX (teh, teLength) = CW (length); + HxX (teh, teLength) = BigEndianValue (length); #endif /* ### adjust recal* fields? */ if (TE_STYLIZED_P (teh)) @@ -53,7 +54,7 @@ P3 (PUBLIC pascal trap, void, TESetText, Ptr, p, LONGINT, length, TEHandle, teh) TE_STYLE_SIZE_FOR_N_RUNS (1)); HxX (te_style, runs[0].startChar) = CWC (0); HxX (te_style, runs[0].styleIndex) = CWC (0); - HxX (te_style, runs[1].startChar) = CW (length + 1); + HxX (te_style, runs[1].startChar) = BigEndianValue (length + 1); HxX (te_style, runs[1].styleIndex) = CWC (-1); style_table = TE_STYLE_STYLE_TABLE (te_style); SetHandleSize ((Handle) style_table, @@ -66,9 +67,9 @@ P3 (PUBLIC pascal trap, void, TESetText, Ptr, p, LONGINT, length, TEHandle, teh) stFace, PORT_TX_FACE (thePort), stSize, PORT_TX_SIZE_X (thePort), stColor, ROMlib_black_rgb_color, - stHeight, CW (CW (finfo.ascent) - + CW (finfo.descent) - + CW (finfo.leading)), + stHeight, BigEndianValue (BigEndianValue (finfo.ascent) + + BigEndianValue (finfo.descent) + + BigEndianValue (finfo.leading)), stAscent, finfo.ascent); } TECalText (teh); diff --git a/src/teDisplay.cpp b/src/teDisplay.cpp index aeb96ef0..c563df75 100644 --- a/src/teDisplay.cpp +++ b/src/teDisplay.cpp @@ -21,11 +21,12 @@ char ROMlib_rcsid_teDisplay[] = #include "rsys/region.h" using namespace Executor; +using namespace ByteSwap; P2 (PUBLIC pascal trap, void, TESetJust, INTEGER, j, TEHandle, teh) { TE_SLAM (teh); - HxX (teh, just) = CW(j); + HxX (teh, just) = BigEndianValue(j); TECalText (teh); TE_SLAM (teh); } diff --git a/src/teEdit.cpp b/src/teEdit.cpp index 304c3aa6..9715a6db 100644 --- a/src/teEdit.cpp +++ b/src/teEdit.cpp @@ -27,6 +27,7 @@ char ROMlib_rcsid_teEdit[] = #include "rsys/text.h" using namespace Executor; +using namespace ByteSwap; static void tedoinserttext (TEHandle te, int16 hlen, int16 len, @@ -45,9 +46,9 @@ tedoinserttext (TEHandle te, int16 hlen, int16 len, HASSIGN_3 (te, - selEnd, CW (TE_SEL_END (te) + len), - selStart, CW (TE_SEL_START (te) + len), - teLength, CW (TE_LENGTH (te) + len)); + selEnd, BigEndianValue (TE_SEL_END (te) + len), + selStart, BigEndianValue (TE_SEL_START (te) + len), + teLength, BigEndianValue (TE_LENGTH (te) + len)); } void @@ -106,13 +107,13 @@ Executor::ROMlib_teremovestyleinfo (TEStyleHandle te_style, current_run = &runs[current_run_index]; STYLE_RUN_START_CHAR_X (current_run) - = CW (STYLE_RUN_START_CHAR (current_run) - shift); + = BigEndianValue (STYLE_RUN_START_CHAR (current_run) - shift); } memmove (&runs[start_run_index], &runs[end_run_index], (n_runs - end_run_index + 1) * sizeof *runs); n_runs -= end_run_index - start_run_index; - TE_STYLE_N_RUNS_X (te_style) = CW (n_runs); + TE_STYLE_N_RUNS_X (te_style) = BigEndianValue (n_runs); SetHandleSize ((Handle) te_style, TE_STYLE_SIZE_FOR_N_RUNS (n_runs)); @@ -143,8 +144,8 @@ tereplaceselection (TEHandle teh, int16 start, int16 stop, int16 len, BlockMove (ptr, STARH (hText) + start, len); TE_SEL_END_X (teh) = TE_SEL_START_X (teh) - = CW (TE_SEL_START (teh) + len); - TE_LENGTH_X (teh) = CW (hlen + nchar); + = BigEndianValue (TE_SEL_START (teh) + len); + TE_LENGTH_X (teh) = BigEndianValue (hlen + nchar); TE_CARET_STATE_X (teh) = CWC (-1); /* will be highlit below */ } @@ -167,7 +168,7 @@ te_style_insert_runs (TEStyleHandle te_style, StyleRun *run = &runs[run_i]; STYLE_RUN_START_CHAR_X (run) - = CW (STYLE_RUN_START_CHAR (run) + len); + = BigEndianValue (STYLE_RUN_START_CHAR (run) + len); } for (run_i = 0; run_i < n_new_runs; run_i ++) @@ -199,10 +200,10 @@ te_style_insert_runs (TEStyleHandle te_style, new_style = ST_ELT (style_table, new_style_index); - ST_ELT_COUNT_X (new_style) = CW (ST_ELT_COUNT (new_style) + 1); + ST_ELT_COUNT_X (new_style) = BigEndianValue (ST_ELT_COUNT (new_style) + 1); release_style_index (te_style, style_index); - STYLE_RUN_STYLE_INDEX_X (run) = CW (new_style_index); + STYLE_RUN_STYLE_INDEX_X (run) = BigEndianValue (new_style_index); } } stabilize_style_info (te_style); @@ -272,14 +273,14 @@ Executor::ROMlib_teinsertstyleinfo (TEHandle te, FALSE); /* must swap here, the elt start char is a `int32' */ - STYLE_RUN_START_CHAR_X (new_run) = CW (SCRAP_ELT_START_CHAR (scrap_elt)); - STYLE_RUN_STYLE_INDEX_X (new_run) = CW (style_index); + STYLE_RUN_START_CHAR_X (new_run) = BigEndianValue (SCRAP_ELT_START_CHAR (scrap_elt)); + STYLE_RUN_STYLE_INDEX_X (new_run) = BigEndianValue (style_index); } { StyleRun *new_run; new_run = &new_runs[scrap_n_styles]; - STYLE_RUN_START_CHAR_X (new_run) = CW (len); + STYLE_RUN_START_CHAR_X (new_run) = BigEndianValue (len); STYLE_RUN_STYLE_INDEX_X (new_run) = CWC (-1); } @@ -318,7 +319,7 @@ Executor::ROMlib_tedoitall (TEHandle teh, Ptr ptr, /* INTERNAL */ && TE_LINE_HEIGHT (teh) == -1) { lht = TE_STYLE_LH_TABLE (te_style); - oldlh = CW ((STARH(lht) + Hx(teh, nLines) - 1)->lhHeight); + oldlh = BigEndianValue ((STARH(lht) + Hx(teh, nLines) - 1)->lhHeight); } else { @@ -366,21 +367,21 @@ Executor::ROMlib_tedoitall (TEHandle teh, Ptr ptr, /* INTERNAL */ if (start > hlen) { warning_unexpected ("start = %d, hlen = %d", start, hlen); - TE_SEL_START_X (teh) = CW (hlen); + TE_SEL_START_X (teh) = BigEndianValue (hlen); start = hlen; } if (stop > hlen) { warning_unexpected ("stop = %d, hlen = %d", stop, hlen); - TE_SEL_END_X (teh) = CW (hlen); + TE_SEL_END_X (teh) = BigEndianValue (hlen); stop = hlen; } if (start > stop) { warning_unexpected ("start = %d, stop = %d", start, stop); - TE_SEL_START_X (teh) = CW (stop); + TE_SEL_START_X (teh) = BigEndianValue (stop); start = stop; } @@ -404,14 +405,14 @@ Executor::ROMlib_tedoitall (TEHandle teh, Ptr ptr, /* INTERNAL */ { if (*ptr == '\010' || !ROMlib_forward_del_p) { - HxX(teh, selStart) = CW(Hx(teh, selStart) - 1); + HxX(teh, selStart) = BigEndianValue(Hx(teh, selStart) - 1); start = Hx(teh, selStart); } else { if (stop < hlen) { - HxX(teh, selEnd) = CW(Hx(teh, selEnd) + 1); + HxX(teh, selEnd) = BigEndianValue(Hx(teh, selEnd) + 1); stop = Hx(teh, selEnd); } } @@ -428,37 +429,37 @@ Executor::ROMlib_tedoitall (TEHandle teh, Ptr ptr, /* INTERNAL */ ROMlib_caltext (teh, start, nchar, &calstart, &calend); TE_CHAR_TO_POINT (teh, TE_LENGTH (teh), &newend); if (TE_STYLIZED_P (teh) && TE_LINE_HEIGHT (teh) == -1) - newlh = CW ((STARH (lht) + TE_N_LINES (teh) - 1)->lhHeight); + newlh = BigEndianValue ((STARH (lht) + TE_N_LINES (teh) - 1)->lhHeight); if (oldend.v > newend.v) { - eraser.top = CW(newend.v); - eraser.left = CW(newend.h); - eraser.bottom = CW(newend.v + newlh); + eraser.top = BigEndianValue(newend.v); + eraser.left = BigEndianValue(newend.h); + eraser.bottom = BigEndianValue(newend.v + newlh); eraser.right = HxX(teh, viewRect.right); SectRect(&HxX(teh, viewRect), &eraser, &eraser); EraseRect(&eraser); eraser.top = eraser.bottom; eraser.left = HxX(teh, viewRect.left); - if (eraser.top != CW(oldend.v)) + if (eraser.top != BigEndianValue(oldend.v)) { - eraser.bottom = CW(oldend.v); + eraser.bottom = BigEndianValue(oldend.v); eraser.right = HxX(teh, viewRect.right); SectRect(&HxX(teh, viewRect), &eraser, &eraser); EraseRect(&eraser); - eraser.top = CW(oldend.v); + eraser.top = BigEndianValue(oldend.v); } - eraser.bottom = CW(oldend.v + oldlh); - eraser.right = CW(oldend.h); + eraser.bottom = BigEndianValue(oldend.v + oldlh); + eraser.right = BigEndianValue(oldend.h); SectRect(&HxX(teh, viewRect), &eraser, &eraser); EraseRect(&eraser); } else if (oldend.v == newend.v && oldend.h > newend.h) { - eraser.top = CW(oldend.v); - eraser.left = CW(newend.h); - eraser.bottom = CW(oldend.v + oldlh); - eraser.right = CW(oldend.h); + eraser.top = BigEndianValue(oldend.v); + eraser.left = BigEndianValue(newend.h); + eraser.bottom = BigEndianValue(oldend.v + oldlh); + eraser.right = BigEndianValue(oldend.h); SectRect(&HxX(teh, viewRect), &eraser, &eraser); EraseRect(&eraser); } @@ -534,15 +535,15 @@ static void doarrow (TEHandle te, CHAR thec) pt.v -= offset; else pt.v += offset; - TEP_SEL_POINT (tep).h = CW (pt.h); - TEP_SEL_POINT (tep).v = CW (pt.v); + TEP_SEL_POINT (tep).h = BigEndianValue (pt.h); + TEP_SEL_POINT (tep).v = BigEndianValue (pt.v); sel_start = TEP_DO_TEXT (tep, 0, length, teFind); break; } } - TEP_SEL_START_X (tep) = CW (sel_start); - TEP_SEL_END_X (tep) = CW (sel_start); + TEP_SEL_START_X (tep) = BigEndianValue (sel_start); + TEP_SEL_END_X (tep) = BigEndianValue (sel_start); if (TEP_CARET_STATE (tep)) TEP_CARET_STATE_X (tep) = CWC (caret_vis); ROMlib_togglelite (te); @@ -654,9 +655,9 @@ P1 (PUBLIC pascal trap, void, TECopy, TEHandle, te) run_start = RUN_START_CHAR (current_run); SCRAP_ELT_START_CHAR_X (scrap_elt) = (run_start < start ? CLC (0) - : CL (run_start - start)); + : BigEndianValue (run_start - start)); } - SCRAP_N_STYLES_X (scrap) = CW (n_scrap_styles); + SCRAP_N_STYLES_X (scrap) = BigEndianValue (n_scrap_styles); LOCK_HANDLE_EXCURSION_1 (scrap, @@ -668,11 +669,11 @@ P1 (PUBLIC pascal trap, void, TECopy, TEHandle, te) HSetState ((Handle) te_style, te_style_flags); } - TEScrpLength = CW (len); + TEScrpLength = BigEndianValue (len); #if defined(X) || defined(MACOSX_) || defined(SDL) /* ### should this lock `TEScrpHandle'? */ - PutScrapX (TICK("TEXT"), CW (TEScrpLength), - (char *) STARH (MR (TEScrpHandle)), CW(ScrapCount)); + PutScrapX (TICK("TEXT"), BigEndianValue (TEScrpLength), + (char *) STARH (MR (TEScrpHandle)), BigEndianValue(ScrapCount)); #endif /* defined(X) */ HSetState (hText, hText_flags); @@ -691,12 +692,12 @@ P1(PUBLIC pascal trap, void, TEPaste, TEHandle, teh) s = GetScrapX (TICK("TEXT"), (char **) MR (TEScrpHandle)); if (s >= 0) - TEScrpLength = CW (s); + TEScrpLength = BigEndianValue (s); #endif /* defined(X) */ LOCK_HANDLE_EXCURSION_1 (MR (TEScrpHandle), { - ROMlib_tedoitall (teh, STARH (MR (TEScrpHandle)), CW (TEScrpLength), + ROMlib_tedoitall (teh, STARH (MR (TEScrpHandle)), BigEndianValue (TEScrpLength), FALSE, NULL); }); } diff --git a/src/teIMIV.cpp b/src/teIMIV.cpp index c6b2a861..34b14b7f 100644 --- a/src/teIMIV.cpp +++ b/src/teIMIV.cpp @@ -19,6 +19,7 @@ char ROMlib_rcsid_teIMIV[] = #include "rsys/mman.h" using namespace Executor; +using namespace ByteSwap; P3 (PUBLIC pascal trap, void, TEPinScroll, int16, dh, /* IMIV-57 */ int16, dv, TEHandle, te) @@ -37,8 +38,8 @@ P3 (PUBLIC pascal trap, void, TEPinScroll, int16, dh, /* IMIV-57 */ if (dv > 0) { - int view_rect_top = CW (view_rect -> top); - int dest_rect_top = CW (dest_rect -> top); + int view_rect_top = BigEndianValue (view_rect -> top); + int dest_rect_top = BigEndianValue (dest_rect -> top); /* `destRect.top' must stay below `viewRect.bottom' */ @@ -48,7 +49,7 @@ P3 (PUBLIC pascal trap, void, TEPinScroll, int16, dh, /* IMIV-57 */ else { Point end_pt; - int view_rect_bottom = CW (view_rect -> bottom); + int view_rect_bottom = BigEndianValue (view_rect -> bottom); int dest_rect_bottom; { @@ -76,7 +77,7 @@ P3 (PUBLIC pascal trap, void, TEPinScroll, int16, dh, /* IMIV-57 */ if (dh > 0) { - maxshift = CW (view_rect->left) - CW (dest_rect->left); + maxshift = BigEndianValue (view_rect->left) - BigEndianValue (dest_rect->left); if (maxshift > 0) dh = MIN (maxshift, dh); else @@ -84,7 +85,7 @@ P3 (PUBLIC pascal trap, void, TEPinScroll, int16, dh, /* IMIV-57 */ } else { - maxshift = CW (view_rect->left) - CW (dest_rect->left); + maxshift = BigEndianValue (view_rect->left) - BigEndianValue (dest_rect->left); if (maxshift < 0) dh = MAX (maxshift, dh); else @@ -108,9 +109,9 @@ A1 (PUBLIC, void, ROMlib_teautoloop, TEHandle, teh) Point pt; GetMouse(&pt); - if (CW(pt.v) < Hx(teh, viewRect.top)) + if (BigEndianValue(pt.v) < Hx(teh, viewRect.top)) TEPinScroll(0, Hx(teh, lineHeight), teh); - else if (CW(pt.v) > Hx(teh, viewRect.bottom)) + else if (BigEndianValue(pt.v) > Hx(teh, viewRect.bottom)) TEPinScroll(0, -Hx(teh, lineHeight), teh); } diff --git a/src/teIMV.cpp b/src/teIMV.cpp index 669bbbf1..c4e3c9d2 100644 --- a/src/teIMV.cpp +++ b/src/teIMV.cpp @@ -25,6 +25,7 @@ char ROMlib_rcsid_teIMV[] = #include "rsys/hook.h" using namespace Executor; +using namespace ByteSwap; void Executor::generic_elt_copy (generic_elt_t *dst, generic_elt_t *src) @@ -46,9 +47,9 @@ Executor::generic_elt_calc_height_ascent (generic_elt_t *elt) TextFont (GENERIC_ELT_FONT (elt)); TextFace (GENERIC_ELT_FACE (elt)); GetFontInfo (&font_info); - GENERIC_ELT_HEIGHT_X (elt) = CW ( CW (font_info.ascent) - + CW (font_info.descent) - + CW (font_info.leading)); + GENERIC_ELT_HEIGHT_X (elt) = BigEndianValue ( BigEndianValue (font_info.ascent) + + BigEndianValue (font_info.descent) + + BigEndianValue (font_info.leading)); GENERIC_ELT_ASCENT_X (elt) = font_info.ascent; TextSize (savesize); TextFace (saveface); @@ -85,7 +86,7 @@ Executor::adjust_attrs (TextStyle *orig_attrs, TextStyle *new_attrs, TS_FACE (dst_attrs) = TS_FACE (orig_attrs); if (mode & addSize) - TS_SIZE_X (dst_attrs) = CW (TS_SIZE (new_attrs) + TS_SIZE (orig_attrs)); + TS_SIZE_X (dst_attrs) = BigEndianValue (TS_SIZE (new_attrs) + TS_SIZE (orig_attrs)); else if (mode & doSize) TS_SIZE_X (dst_attrs) = TS_SIZE_X (new_attrs); else @@ -125,7 +126,7 @@ Executor::make_style_run_at (TEStyleHandle te_style, int16 sel) /* split the current style into two */ n_runs = TE_STYLE_N_RUNS (te_style) + 1; - TE_STYLE_N_RUNS_X (te_style) = CW (n_runs); + TE_STYLE_N_RUNS_X (te_style) = BigEndianValue (n_runs); SetHandleSize ((Handle) te_style, TE_STYLE_SIZE_FOR_N_RUNS (n_runs)); runs = TE_STYLE_RUNS (te_style); @@ -140,10 +141,10 @@ Executor::make_style_run_at (TEStyleHandle te_style, int16 sel) style_table = TE_STYLE_STYLE_TABLE (te_style); style = ST_ELT (style_table, style_index); - ST_ELT_COUNT_X (style) = CW (ST_ELT_COUNT (style) + 1); + ST_ELT_COUNT_X (style) = BigEndianValue (ST_ELT_COUNT (style) + 1); - STYLE_RUN_START_CHAR_X (&runs[run_index + 1]) = CW (sel); - STYLE_RUN_STYLE_INDEX_X (&runs[run_index + 1]) = CW (style_index); + STYLE_RUN_START_CHAR_X (&runs[run_index + 1]) = BigEndianValue (sel); + STYLE_RUN_STYLE_INDEX_X (&runs[run_index + 1]) = BigEndianValue (style_index); return run_index + 1; } @@ -185,7 +186,7 @@ Executor::get_style_index (TEStyleHandle te_style, TextStyle *attrs, int incr_co && TS_COLOR (attrs).blue == ST_ELT_COLOR (st_elt).blue)) { if (incr_count_p) - ST_ELT_COUNT_X (st_elt) = CW (ST_ELT_COUNT (st_elt) + 1); + ST_ELT_COUNT_X (st_elt) = BigEndianValue (ST_ELT_COUNT (st_elt) + 1); return st_i; } else if (!cache_filled_p) @@ -199,7 +200,7 @@ Executor::get_style_index (TEStyleHandle te_style, TextStyle *attrs, int incr_co /* a style not already in the style table was asked for. create it */ n_styles ++; - TE_STYLE_N_STYLES_X (te_style) = CW (n_styles); + TE_STYLE_N_STYLES_X (te_style) = BigEndianValue (n_styles); SetHandleSize ((Handle) style_table, STYLE_TABLE_SIZE_FOR_N_STYLES (n_styles)); st_elt = ST_ELT (style_table, n_styles - 1); @@ -233,7 +234,7 @@ Executor::release_style_index (TEStyleHandle te_style, int16 style_index) style_table = TE_STYLE_STYLE_TABLE (te_style); st_elt = ST_ELT (style_table, style_index); gui_assert (ST_ELT_COUNT (st_elt) > 0); - ST_ELT_COUNT_X (st_elt) = CW (ST_ELT_COUNT (st_elt) - 1); + ST_ELT_COUNT_X (st_elt) = BigEndianValue (ST_ELT_COUNT (st_elt) - 1); } /* `release_style_index ()' only decreases the reference count, so @@ -256,7 +257,7 @@ Executor::stabilize_style_info (TEStyleHandle te_style) index_map = (int16*)alloca (n_styles * sizeof *index_map); for (i = 0; i < n_styles; i ++) - index_map[i] = CW (i); + index_map[i] = BigEndianValue (i); for (i = 0; i < n_styles; i ++) { @@ -284,7 +285,7 @@ Executor::stabilize_style_info (TEStyleHandle te_style) index to the last style in the style table, and shrink the style table by 1 */ *ST_ELT (style_table, i) = *ST_ELT (style_table, n_styles - 1); - index_map[n_styles - 1] = CW (i); + index_map[n_styles - 1] = BigEndianValue (i); /* so that we can verify, when we change the run style indexes, that noone refers to this map index */ @@ -295,7 +296,7 @@ Executor::stabilize_style_info (TEStyleHandle te_style) } done: - TE_STYLE_N_STYLES_X (te_style) = CW (n_styles); + TE_STYLE_N_STYLES_X (te_style) = BigEndianValue (n_styles); SetHandleSize ((Handle) style_table, STYLE_TABLE_SIZE_FOR_N_STYLES (n_styles)); @@ -330,14 +331,14 @@ combine_run_with_next (TEStyleHandle te_style, int16 run_index) (n_runs - run_index - 1) * sizeof *runs); n_runs --; - TE_STYLE_N_RUNS_X (te_style) = CW (n_runs); + TE_STYLE_N_RUNS_X (te_style) = BigEndianValue (n_runs); SetHandleSize ((Handle) te_style, TE_STYLE_SIZE_FOR_N_RUNS (n_runs)); style_index = STYLE_RUN_STYLE_INDEX (&runs[run_index]); style_table = TE_STYLE_STYLE_TABLE (te_style); style = ST_ELT (style_table, style_index); - ST_ELT_COUNT_X (style) = CW (ST_ELT_COUNT (style) - 1); + ST_ELT_COUNT_X (style) = BigEndianValue (ST_ELT_COUNT (style) - 1); } void @@ -429,7 +430,7 @@ te_add_attrs_to_range (TEHandle te, new_style_index = get_style_index (te_style, &new_attrs, TRUE); release_style_index (te_style, orig_style_index); - STYLE_RUN_STYLE_INDEX_X (current_run) = CW (new_style_index); + STYLE_RUN_STYLE_INDEX_X (current_run) = BigEndianValue (new_style_index); } }); @@ -470,9 +471,9 @@ P2 (PUBLIC pascal trap, TEHandle, TEStylNew, Rect *, dst, Rect *, view) /* font info used to fill in the fisrt style element */ GetFontInfo (&font_info); - font_height = (CW (font_info.ascent) - + CW (font_info.descent) - + CW (font_info.leading)); + font_height = (BigEndianValue (font_info.ascent) + + BigEndianValue (font_info.descent) + + BigEndianValue (font_info.leading)); style_table = (STHandle) NewHandle (sizeof (STElement)); HASSIGN_7 (style_table, @@ -481,7 +482,7 @@ P2 (PUBLIC pascal trap, TEHandle, TEStylNew, Rect *, dst, Rect *, view) stFace, PORT_TX_FACE (thePort), stSize, PORT_TX_SIZE_X (thePort), stColor, ROMlib_black_rgb_color, - stHeight, CW (font_height), + stHeight, BigEndianValue (font_height), stAscent, font_info.ascent); TE_STYLE_STYLE_TABLE_X (te_style) = RM (style_table); @@ -511,7 +512,7 @@ P2 (PUBLIC pascal trap, TEHandle, TEStylNew, Rect *, dst, Rect *, view) stp->scrpColor.blue = 0; /* black ? */ stp->scrpStartChar = CLC(0); - stp->scrpHeight = CW (font_height); + stp->scrpHeight = BigEndianValue (font_height); stp->scrpAscent = font_info.ascent; SetStylHandle (te_style, teh); @@ -569,7 +570,7 @@ P1 (PUBLIC pascal trap, StScrpHandle, GetStylScrap, TEHandle, te) scrap_n_styles = MAX (end_run_index - start_run_index, 1); scrap = (StScrpHandle) NewHandle (SCRAP_SIZE_FOR_N_STYLES (scrap_n_styles)); - SCRAP_N_STYLES_X (scrap) = CW (scrap_n_styles); + SCRAP_N_STYLES_X (scrap) = BigEndianValue (scrap_n_styles); if (start == end) warning_unimplemented ("should check null scrap, first"); @@ -589,7 +590,7 @@ P1 (PUBLIC pascal trap, StScrpHandle, GetStylScrap, TEHandle, te) generic_elt_copy (SCRAP_ELT_TO_GENERIC_ELT (scrap_elt), ST_ELT_TO_GENERIC_ELT (style)); SCRAP_ELT_START_CHAR_X (scrap_elt) - = CL (RUN_START_CHAR (current_run) - start); + = BigEndianValue (RUN_START_CHAR (current_run) - start); } te_style_combine_runs (te_style); @@ -610,8 +611,8 @@ P2 (PUBLIC pascal trap, INTEGER, TEGetOffset, Point, pt, TEHandle, te) Point sp; sp = TE_SEL_POINT (te); - TE_SEL_POINT (te).h = CW (pt.h); - TE_SEL_POINT (te).v = CW (pt.v); + TE_SEL_POINT (te).h = BigEndianValue (pt.h); + TE_SEL_POINT (te).v = BigEndianValue (pt.v); retval = TE_DO_TEXT (te, 0, TE_LENGTH (te), teFind); TE_SEL_POINT (te) = sp; @@ -677,7 +678,7 @@ P3 (PUBLIC pascal trap, int32, TEGetHeight, l = STARH (MR (STARH (te_style)->lhTab)) + startLine; le = l + endLine - startLine; for ( ; l <= le ; l++) - retval += CW (l->lhHeight); + retval += BigEndianValue (l->lhHeight); } else retval = TE_LINE_HEIGHT (teh) * (endLine - startLine + 1); @@ -914,7 +915,7 @@ P5 (PUBLIC pascal trap, void, TEReplaceStyle, int16, mode, new_style_index = get_style_index (te_style, new_attrs, TRUE); release_style_index (te_style, orig_style_index); - RUN_STYLE_INDEX_X (run) = CW (new_style_index); + RUN_STYLE_INDEX_X (run) = BigEndianValue (new_style_index); } } HSetState ((Handle) te_style, te_style_flags); diff --git a/src/teInit.cpp b/src/teInit.cpp index 5c12e057..d65de1f8 100644 --- a/src/teInit.cpp +++ b/src/teInit.cpp @@ -23,6 +23,7 @@ char ROMlib_rcsid_teInit[] = #include "rsys/tesave.h" using namespace Executor; +using namespace ByteSwap; P0 (PUBLIC pascal trap, void, TEInit) { @@ -60,9 +61,9 @@ P2 (PUBLIC pascal trap, TEHandle, TENew, Rect *, dst, Rect *, view) (teh, destRect, *dst, viewRect, *view, - lineHeight, CW (CW (finfo.ascent) - + CW (finfo.descent) - + CW (finfo.leading)), + lineHeight, BigEndianValue (BigEndianValue (finfo.ascent) + + BigEndianValue (finfo.descent) + + BigEndianValue (finfo.leading)), fontAscent, finfo.ascent, active, FALSE, caretState, CWC (caret_invis), diff --git a/src/teInsert.cpp b/src/teInsert.cpp index c67ddf5f..bae03fbf 100644 --- a/src/teInsert.cpp +++ b/src/teInsert.cpp @@ -28,6 +28,7 @@ char ROMlib_rcsid_teInsert[] = #include "rsys/text.h" using namespace Executor; +using namespace ByteSwap; int16 Executor::ROMlib_StyleTextWidth (TEPtr tep, @@ -180,13 +181,13 @@ Executor::te_char_to_point (const TEPtr tep, int16 sel, Point *p) gui_fatal ("unknown justification"); if (on_break_p) - left = (CW (dest_rect->left) + left_offset); + left = (BigEndianValue (dest_rect->left) + left_offset); else - left = (CW (dest_rect->left) + left = (BigEndianValue (dest_rect->left) + left_offset + TEP_TEXT_WIDTH (tep, Text, line_start, sel - line_start)); - for (top = CW (dest_rect->top), lineno_i = 0; lineno_i < lineno; lineno_i ++) + for (top = BigEndianValue (dest_rect->top), lineno_i = 0; lineno_i < lineno; lineno_i ++) /* ### hoist alot of the internal constants out of this loop */ top += TEP_HEIGHT_FOR_LINE (tep, lineno_i); if (on_break_p) @@ -332,14 +333,14 @@ P1 (PUBLIC pascal trap, void, TEIdle, TEHandle, teh) TESAVE (teh); TE_SLAM (teh); - if ((ticks = TickCount()) > Hx(teh, caretTime) + CL(CaretTime) + if ((ticks = TickCount()) > Hx(teh, caretTime) + BigEndianValue(CaretTime) && Hx(teh, active) && (sel = Hx(teh, selStart)) == Hx(teh, selEnd) && (state = Hx(teh, caretState))) { togglecaret(teh, sel, TRUE); - HxX(teh, caretState) = CW (state ^ 0xFF00); - HxX(teh, caretTime) = CL (ticks); + HxX(teh, caretState) = BigEndianValue (state ^ 0xFF00); + HxX(teh, caretTime) = BigEndianValue (ticks); } TE_SLAM (teh); TERESTORE (); @@ -400,13 +401,13 @@ te_draw (TEPtr tep, n_lines = TEP_N_LINES (tep); dest_rect = &TEP_DEST_RECT (tep); - dest_rect_left = CW (dest_rect->left); - dest_rect_right = CW (dest_rect->right); - dest_rect_top = CW (dest_rect->top); - dest_rect_bottom = CW (dest_rect->bottom); + dest_rect_left = BigEndianValue (dest_rect->left); + dest_rect_right = BigEndianValue (dest_rect->right); + dest_rect_top = BigEndianValue (dest_rect->top); + dest_rect_bottom = BigEndianValue (dest_rect->bottom); view_rect = &TEP_VIEW_RECT (tep); - view_rect_bottom = CW (view_rect->bottom); + view_rect_bottom = BigEndianValue (view_rect->bottom); { int16 height; @@ -429,8 +430,8 @@ te_draw (TEPtr tep, SectRect (view_rect, view_rect, clip_rect); #endif - clip_rect_top = CW (clip_rect->top); - clip_rect_bottom = CW (clip_rect->bottom); + clip_rect_top = BigEndianValue (clip_rect->top); + clip_rect_bottom = BigEndianValue (clip_rect->bottom); /* clip the lines to draw by the visible lines */ for (current_lineno = 0, height = dest_rect_top;; current_lineno ++) @@ -505,7 +506,7 @@ te_draw (TEPtr tep, runs = (StyleRun*)alloca (sizeof *runs * 2); RUN_START_CHAR_X (&runs[0]) = CWC (0); RUN_STYLE_INDEX_X (&runs[0]) = CWC (0); - RUN_START_CHAR_X (&runs[1]) = CW (TEP_LENGTH (tep) + 1); + RUN_START_CHAR_X (&runs[1]) = BigEndianValue (TEP_LENGTH (tep) + 1); RUN_STYLE_INDEX_X (&runs[1]) = CWC (-1); n_styles = 1; @@ -550,10 +551,10 @@ te_draw (TEPtr tep, DrawText (Text, current_posn, current_run_end - current_posn); #if 0 - gui_assert (CW (orig_pn.h) + gui_assert (BigEndianValue (orig_pn.h) + TextWidth (Text, current_posn, current_run_end - current_posn) - == CW (PORT_PEN_LOC (thePort).h)); + == BigEndianValue (PORT_PEN_LOC (thePort).h)); #endif current_run ++; style_update_port (&styles[RUN_STYLE_INDEX (current_run)]); @@ -637,8 +638,8 @@ te_hilite (TEPtr tep, line_starts = TEP_LINE_STARTS (tep); dest_rect = &TEP_DEST_RECT (tep); - dest_rect_left = CW (dest_rect->left); - dest_rect_right = CW (dest_rect->right); + dest_rect_left = BigEndianValue (dest_rect->left); + dest_rect_right = BigEndianValue (dest_rect->right); length = TEP_LENGTH (tep); /* highlight the first line */ @@ -713,15 +714,15 @@ te_find (TEPtr tep, int16 start, int16 end) Text = STARH (hText); dest_rect = &TEP_DEST_RECT (tep); - dest_rect_top = CW (dest_rect->top); - dest_rect_left = CW (dest_rect->left); + dest_rect_top = BigEndianValue (dest_rect->top); + dest_rect_left = BigEndianValue (dest_rect->left); length = TEP_LENGTH (tep); n_lines = TEP_N_LINES (tep); line_starts = TEP_LINE_STARTS (tep); - v = CW (TEP_SEL_POINT (tep).v); - h = CW (TEP_SEL_POINT (tep).h) - dest_rect_left; + v = BigEndianValue (TEP_SEL_POINT (tep).v); + h = BigEndianValue (TEP_SEL_POINT (tep).h) - dest_rect_left; if (! Text) { @@ -848,11 +849,11 @@ double_click_p (TEHandle te, int16 cl) ticks = TickCount (); if (cl == TE_CLICK_LOC (te) - && ticks <= TE_CLICK_TIME (te) + CL (DoubleTime)) + && ticks <= TE_CLICK_TIME (te) + BigEndianValue (DoubleTime)) return TRUE; - TE_CLICK_LOC_X (te) = CW (cl); - TE_CLICK_TIME_X (te) = CL (ticks); + TE_CLICK_LOC_X (te) = BigEndianValue (cl); + TE_CLICK_TIME_X (te) = BigEndianValue (ticks); return FALSE; } @@ -975,8 +976,8 @@ P3 (PUBLIC pascal trap, void, TEClick, Point, pt, BOOLEAN, extend, TEP_CLICK_STUFF_X (tep) = CWC (0); - TEP_SEL_POINT (tep).h = CW (pt.h); - TEP_SEL_POINT (tep).v = CW (pt.v); + TEP_SEL_POINT (tep).h = BigEndianValue (pt.h); + TEP_SEL_POINT (tep).v = BigEndianValue (pt.v); click_posn = TEP_DO_TEXT (tep, 0, length, teFind); state = TEP_CARET_STATE (tep); @@ -1109,9 +1110,9 @@ P3 (PUBLIC pascal trap, void, TEClick, Point, pt, BOOLEAN, extend, } \ }) - TEP_SEL_START_X (tep) = CW (start); - TEP_SEL_END_X (tep) = CW (end); - TEP_CARET_STATE_X (tep) = CW (state); + TEP_SEL_START_X (tep) = BigEndianValue (start); + TEP_SEL_END_X (tep) = BigEndianValue (end); + TEP_CARET_STATE_X (tep) = BigEndianValue (state); while (Button () && CALLCLIKOK (te)) { @@ -1185,9 +1186,9 @@ P3 (PUBLIC pascal trap, void, TEClick, Point, pt, BOOLEAN, extend, gui_fatal ("origin is neither start nor end"); } - TEP_SEL_START_X (tep) = CW (start); - TEP_SEL_END_X (tep) = CW (end); - TEP_CARET_STATE_X (tep) = CW (state); + TEP_SEL_START_X (tep) = BigEndianValue (start); + TEP_SEL_END_X (tep) = BigEndianValue (end); + TEP_CARET_STATE_X (tep) = BigEndianValue (state); } /* suck out the up event if it is there */ @@ -1221,8 +1222,8 @@ P3 (PUBLIC pascal trap, void, TESetSelect, int32, start, int32, stop, TE_DO_TEXT (teh, start, stop, teHilite); TERESTORE (); - TE_SEL_START_X (teh) = CW (start); - TE_SEL_END_X (teh) = CW (stop); + TE_SEL_START_X (teh) = BigEndianValue (start); + TE_SEL_END_X (teh) = BigEndianValue (stop); if (TE_ACTIVE (teh)) TE_CARET_STATE_X (teh) = (start != stop ? CWC (0) diff --git a/src/teMisc.cpp b/src/teMisc.cpp index d2b04804..62a885b0 100644 --- a/src/teMisc.cpp +++ b/src/teMisc.cpp @@ -27,6 +27,7 @@ char ROMlib_rcsid_teMisc[] = #include "rsys/text.h" using namespace Executor; +using namespace ByteSwap; int16 nextbreak (TEHandle teh, int16 off, int16 len, int16 max_width); @@ -321,7 +322,7 @@ int16 Executor::te_char_to_lineno (TEPtr te, int16 sel) current = (high + low) / 2; while (low < high - && (current_elt = CW (line_starts[current])) != sel) + && (current_elt = BigEndianValue (line_starts[current])) != sel) { if (current_elt < sel) low = current + 1; @@ -329,7 +330,7 @@ int16 Executor::te_char_to_lineno (TEPtr te, int16 sel) high = current - 1; current = (high + low) / 2; } - if (CW (line_starts[current]) > sel + if (BigEndianValue (line_starts[current]) > sel || current == n_lines) retval = current - 1; else @@ -384,10 +385,10 @@ calclhtab (TEHandle teh) if (ST_ELT_ASCENT (current_style) > LH_ASCENT (lh)) LH_ASCENT_X (lh) = ST_ELT_ASCENT_X (current_style); - if (CW (*linestarts) == TE_LENGTH (teh)) + if (BigEndianValue (*linestarts) == TE_LENGTH (teh)) break; - if (STYLE_RUN_START_CHAR (current_run + 1) > CW (linestarts[1])) + if (STYLE_RUN_START_CHAR (current_run + 1) > BigEndianValue (linestarts[1])) { if (first_changed == -1 && ( LH_HEIGHT (lh) != orig_height @@ -397,7 +398,7 @@ calclhtab (TEHandle teh) lh ++; clear_lh_p = TRUE; } - else if (STYLE_RUN_START_CHAR (current_run + 1) < CW (linestarts[1])) + else if (STYLE_RUN_START_CHAR (current_run + 1) < BigEndianValue (linestarts[1])) current_run ++; else { @@ -478,7 +479,7 @@ Executor::ROMlib_caltext (TEHandle te, int line_start = LINE_START (line_starts, t); int new_line_start = line_start + n_added; - LINE_START_X (line_starts, t) = CW (new_line_start); + LINE_START_X (line_starts, t) = BigEndianValue (new_line_start); } /* starting from the first line, recompute all the end lines. we @@ -511,7 +512,7 @@ Executor::ROMlib_caltext (TEHandle te, been relocated */ line_starts = TE_LINE_STARTS (te); orig_current_line_break = LINE_START (line_starts, current_lineno + 1); - LINE_START_X (line_starts, current_lineno + 1) = CW (current_line_break); + LINE_START_X (line_starts, current_lineno + 1) = BigEndianValue (current_line_break); if (first_changed == -1 && orig_current_line_break != current_line_break) @@ -524,7 +525,7 @@ Executor::ROMlib_caltext (TEHandle te, else n_lines = current_lineno + 1; - TE_N_LINES_X (te) = CW (n_lines); + TE_N_LINES_X (te) = BigEndianValue (n_lines); te_set_line_starts_allocation (te, n_lines); line_starts = TE_LINE_STARTS (te); LINE_START_X (line_starts, n_lines + 1) = CWC (0); @@ -576,7 +577,7 @@ P1 (PUBLIC pascal trap, void, TECalText, TEHandle, te) /* don't do this check because people call this caltext when the TE has been frobbed and is in a wacky state */ /* TE_SLAM (te); */ - TE_LENGTH_X (te) = CW (GetHandleSize (TE_HTEXT (te))); + TE_LENGTH_X (te) = BigEndianValue (GetHandleSize (TE_HTEXT (te))); ROMlib_caltext (te, 0, 32767, NULL, NULL); TE_SLAM (te); } @@ -631,7 +632,7 @@ Executor::ROMlib_call_TEDoText (TEPtr tp, int16 first, int16 last, int16 what) EM_D3 = (LONGINT) first; EM_D4 = (LONGINT) last; EM_D7 = (LONGINT) what; - EM_A0 = (LONGINT) (long) CL ((long) TEDoText); + EM_A0 = (LONGINT) (long) BigEndianValue ((long) TEDoText); CALL_EMULATOR (EM_A0); myd0 = EM_D0; EM_D2 = saved2; diff --git a/src/teScrap.cpp b/src/teScrap.cpp index bf90f251..22e95f2a 100644 --- a/src/teScrap.cpp +++ b/src/teScrap.cpp @@ -18,6 +18,7 @@ char ROMlib_rcsid_teScrap[] = #include "rsys/mman.h" using namespace Executor; +using namespace ByteSwap; A0(PUBLIC, OSErr, TEFromScrap) { @@ -30,7 +31,7 @@ A0(PUBLIC, OSErr, TEFromScrap) TEScrpLength = CWC (0); } else - TEScrpLength = CW (m); + TEScrpLength = BigEndianValue (m); return m < 0 ? m : noErr; } @@ -41,7 +42,7 @@ A0 (PUBLIC, OSErr, TEToScrap) LOCK_HANDLE_EXCURSION_1 (MR (TEScrpHandle), { - m = PutScrap (CW (TEScrpLength), TICK ("TEXT"), + m = PutScrap (BigEndianValue (TEScrpLength), TICK ("TEXT"), STARH (MR (TEScrpHandle))); }); return m < 0 ? m : 0; @@ -54,10 +55,10 @@ A0 (PUBLIC, Handle, TEScrapHandle) A0 (PUBLIC, int32, TEGetScrapLen) { - return CW (TEScrpLength); + return BigEndianValue (TEScrpLength); } A1 (PUBLIC, void, TESetScrapLen, int32, ln) { - TEScrpLength = CW (ln); + TEScrpLength = BigEndianValue (ln); } diff --git a/src/time.cpp b/src/time.cpp index 5dd1168d..ca79944b 100644 --- a/src/time.cpp +++ b/src/time.cpp @@ -29,6 +29,7 @@ char ROMlib_rcsid_time[] = #endif using namespace Executor; +using namespace ByteSwap; #if defined (SYSV) LONGINT @@ -185,12 +186,12 @@ A3 (PRIVATE, LONGINT, catchalarm, LONGINT, volatile signo, qp; qp = (TMTask *) MR (qp->qLink)) { - tm_count = CL (qp->tmCount); + tm_count = BigEndianValue (qp->tmCount); if (tm_count > 0) { tm_count -= diff; - qp->tmCount = CL (tm_count); + qp->tmCount = BigEndianValue (tm_count); if (tm_count <= 0) { ProcPtr tm_addr; @@ -225,7 +226,7 @@ A3 (PRIVATE, LONGINT, catchalarm, LONGINT, volatile signo, qp; qp = (TMTask *) MR (qp->qLink)) { - tm_count = CL (qp->tmCount); + tm_count = BigEndianValue (qp->tmCount); if (tm_count > 0 && tm_count < min) min = tm_count; } @@ -336,7 +337,7 @@ A2 (PRIVATE, void, ROMlib_PrimeTime, QElemPtr, taskp, LONGINT, count) * way the extra time subtracted off during the catchalarm will * exactly match the extra time we added here. */ - ((TMTask *) taskp)->tmCount = CL (count + now_msecs - last_interrupt_msecs); + ((TMTask *) taskp)->tmCount = BigEndianValue (count + now_msecs - last_interrupt_msecs); if (count < msecs_until_next || msecs_until_next <= 0) { diff --git a/src/toolevent.cpp b/src/toolevent.cpp index f3fe615e..5fc0b869 100644 --- a/src/toolevent.cpp +++ b/src/toolevent.cpp @@ -56,6 +56,7 @@ char ROMlib_rcsid_toolevent[] = #include using namespace Executor; +using namespace ByteSwap; /* #define EVENTTRACE */ @@ -144,7 +145,7 @@ A0(PRIVATE, void, ROMlib_togglealarm) src_alarm_bitmap.baseAddr = (*alarmh).p; else /* once again, we need to move the (Ptr) cast - inside the CL () because it confuses gcc */ + inside the BigEndianValue () because it confuses gcc */ src_alarm_bitmap.baseAddr = RM ((Ptr) hard_coded_alarm); /* save the screen to save_alarm_bitmap */ @@ -718,7 +719,7 @@ PRIVATE void mod_item_enableness( DialogPtr dp, INTEGER item, Rect r; GetDItem(dp, item, &type, &h, &r); - type = CW(type); + type = BigEndianValue(type); h.p = MR(h.p); if (((type & itemDisable) && enableness_wanted == enable) || (!(type & itemDisable) && enableness_wanted == disable)) @@ -836,7 +837,7 @@ PRIVATE void dopreferences( void ) do { ModalDialog((ProcPtr) 0, &ihit); - ihit = CW(ihit); + ihit = BigEndianValue(ihit); switch (ihit) { case PREFNORMALITEM: @@ -926,7 +927,7 @@ A3(PRIVATE, BOOLEAN, doevent, INTEGER, em, EventRecord *, evt, if (SPVolCtl & 0x80) { TRACE(3); GetDateTime(&now); - now = CL(now); + now = BigEndianValue(now); TRACE(4); if ((ULONGINT) now >= (ULONGINT) Cx(SPAlarm)) { TRACE(5); @@ -955,7 +956,7 @@ A3(PRIVATE, BOOLEAN, doevent, INTEGER, em, EventRecord *, evt, TRACE(12); GetOSEvent(0, evt); TRACE(13); - evt->what = CW(activateEvt); + evt->what = BigEndianValue(activateEvt); evt->message = (LONGINT) (long) CurDeactive; if (remflag) CurDeactive = (WindowPtr) 0; @@ -966,9 +967,9 @@ A3(PRIVATE, BOOLEAN, doevent, INTEGER, em, EventRecord *, evt, TRACE(14); GetOSEvent(0, evt); TRACE(15); - evt->what = CW(activateEvt); + evt->what = BigEndianValue(activateEvt); evt->message = (LONGINT) (long) CurActivate; - evt->modifiers |= CW(activeFlag); + evt->modifiers |= BigEndianValue(activeFlag); if (remflag) CurActivate = (WindowPtr) 0; retval = TRUE; @@ -1041,7 +1042,7 @@ A3(PRIVATE, BOOLEAN, doevent, INTEGER, em, EventRecord *, evt, #endif } if (!retval) - evt->what = CW(nullEvent); + evt->what = BigEndianValue(nullEvent); /*-->*/ goto done; } } else { @@ -1065,7 +1066,7 @@ A3(PRIVATE, BOOLEAN, doevent, INTEGER, em, EventRecord *, evt, nread = read(ns, device, sizeof(device)); ROMlib_updateworkspace(); ROMlib_openfloppy(device, &evt->message); - evt->what = CW(diskEvt); + evt->what = BigEndianValue(diskEvt); retval = TRUE; } else { gui_assert(errno == EWOULDBLOCK); @@ -1076,7 +1077,7 @@ A3(PRIVATE, BOOLEAN, doevent, INTEGER, em, EventRecord *, evt, ROMlib_openharddisk("/tmp/testvol\0\0", &evt->message); if (evt->message) { TRACE(27); - evt->what = CW(diskEvt); + evt->what = BigEndianValue(diskEvt); retval = TRUE; } } @@ -1147,8 +1148,8 @@ P4(PUBLIC pascal trap, BOOLEAN, WaitNextEvent, INTEGER, mask, static INTEGER saved_h, saved_v; /* TODO: see what PtInRgn does with 0 as a RgnHandle */ - p.h = CW(evp->where.h); - p.v = CW(evp->where.v); + p.h = BigEndianValue(evp->where.h); + p.v = BigEndianValue(evp->where.v); if (mousergn && !EmptyRgn(mousergn) && !PtInRgn(p, mousergn) && (p.h != saved_h || p.v != saved_v)) { evp->what = CWC(osEvt); @@ -1246,12 +1247,12 @@ P0 (PUBLIC pascal trap, LONGINT, TickCount) */ if (ROMlib_clock) - Ticks_UL.u = CL (ticks); + Ticks_UL.u = BigEndianValue (ticks); new_time = (UNIXTIMETOMACTIME (ROMlib_start_time.tv_sec) + (long) ((ROMlib_start_time.tv_usec / (1000000.0 / 60) + ticks) / 60)); - Time = CL (new_time); + Time = BigEndianValue (new_time); return ticks; } @@ -1303,8 +1304,8 @@ sendsuspendevent (void) !(size_info.size_flags & SZcanBackground) */ ) ) { - p.h = CW(MouseLocation.h); - p.v = CW(MouseLocation.v); + p.h = BigEndianValue(MouseLocation.h); + p.v = BigEndianValue(MouseLocation.v); ROMlib_PPostEvent(osEvt, SUSPENDRESUMEBITS|SUSPEND|CONVERTCLIPBOARD, (HIDDEN_EvQElPtr *) 0, TickCount(), p, ROMlib_mods); } @@ -1329,8 +1330,8 @@ sendresumeevent (boolean_t cvtclip) what = SUSPENDRESUMEBITS | RESUME; if (cvtclip) what |= CONVERTCLIPBOARD; - p.h = CW(MouseLocation.h); - p.v = CW(MouseLocation.v); + p.h = BigEndianValue(MouseLocation.h); + p.v = BigEndianValue(MouseLocation.v); ROMlib_PPostEvent(osEvt, what, (HIDDEN_EvQElPtr *) 0, TickCount(), p, ROMlib_mods); } @@ -1341,8 +1342,8 @@ sendcopy (void) { Point p; - p.h = CW(MouseLocation.h); - p.v = CW(MouseLocation.v); + p.h = BigEndianValue(MouseLocation.h); + p.v = BigEndianValue(MouseLocation.v); ROMlib_PPostEvent(keyDown, 0x0863, /* 0x63 == 'c' */ (HIDDEN_EvQElPtr *) 0, TickCount(), p, cmdKey|btnState); ROMlib_PPostEvent(keyUp, 0x0863, @@ -1354,8 +1355,8 @@ sendpaste (void) { Point p; - p.h = CW(MouseLocation.h); - p.v = CW(MouseLocation.v); + p.h = BigEndianValue(MouseLocation.h); + p.v = BigEndianValue(MouseLocation.v); ROMlib_PPostEvent(keyDown, 0x0976, /* 0x76 == 'v' */ (HIDDEN_EvQElPtr *) 0, TickCount(), p, cmdKey|btnState); ROMlib_PPostEvent(keyUp, 0x0976, @@ -1375,8 +1376,8 @@ post_helper (INTEGER code, uint8 raw, uint8 mapped, INTEGER mods) { Point p; - p.h = CW(MouseLocation.h); - p.v = CW(MouseLocation.v); + p.h = BigEndianValue(MouseLocation.h); + p.v = BigEndianValue(MouseLocation.v); ROMlib_PPostEvent(code, (raw << 8)|mapped, (HIDDEN_EvQElPtr *) 0, TickCount(), p, btnState|mods); diff --git a/src/toolutil.cpp b/src/toolutil.cpp index 7aae4026..bc0f6924 100644 --- a/src/toolutil.cpp +++ b/src/toolutil.cpp @@ -31,6 +31,7 @@ char ROMlib_rcsid_toolutil[] = #include using namespace Executor; +using namespace ByteSwap; namespace Executor { PRIVATE Fixed minvert(Fixed); @@ -398,23 +399,23 @@ P3(PUBLIC pascal trap, void, LongMul, LONGINT, a, LONGINT, b, Int64Bit *, c) lb = b & 0xFFFF; halb = ha * lb; lahb = la * hb; - c->hiLong = CL(ha * hb); - c->loLong = CL(la * lb); - c->hiLong = CL(CL(c->hiLong) + (halb >> 16)); - c->hiLong = CL(CL(c->hiLong) + (lahb >> 16)); - carry = CL(c->loLong) >> 31; - c->loLong = CL(CL(c->loLong) + (halb << 16)); + c->hiLong = BigEndianValue(ha * hb); + c->loLong = BigEndianValue(la * lb); + c->hiLong = BigEndianValue(BigEndianValue(c->hiLong) + (halb >> 16)); + c->hiLong = BigEndianValue(BigEndianValue(c->hiLong) + (lahb >> 16)); + carry = BigEndianValue(c->loLong) >> 31; + c->loLong = BigEndianValue(BigEndianValue(c->loLong) + (halb << 16)); carry += (halb >> 15) & 1; - c->loLong = CL(CL(c->loLong) + (lahb << 16)); + c->loLong = BigEndianValue(BigEndianValue(c->loLong) + (lahb << 16)); carry += (lahb >> 15) & 1; carry >>= 1; - c->hiLong = CL(CL(c->hiLong) + (carry)); + c->hiLong = BigEndianValue(BigEndianValue(c->hiLong) + (carry)); if (sign == -1) { c->hiLong = ~c->hiLong; if (c->loLong) - c->loLong = CL(~CL(c->loLong) + 1); + c->loLong = BigEndianValue(~BigEndianValue(c->loLong) + 1); else - c->hiLong = CL(CL(c->hiLong) + 1); + c->hiLong = BigEndianValue(BigEndianValue(c->hiLong) + 1); } } diff --git a/src/vbl.cpp b/src/vbl.cpp index 5aefc26f..1ce77c59 100644 --- a/src/vbl.cpp +++ b/src/vbl.cpp @@ -27,6 +27,7 @@ char ROMlib_rcsid_vbl[] = #include "rsys/prefs.h" using namespace Executor; +using namespace ByteSwap; typedef enum { @@ -82,7 +83,7 @@ A0 (PUBLIC, void, C_ROMlib_vcatch) EM_A7 = (EM_A7 - 32) & ~3; /* Might as well long-align it. */ /* Save the old Ticks value & compute new value. */ - old_ticks = CL (Ticks); + old_ticks = BigEndianValue (Ticks); new_ticks = C_TickCount (); ticks_elapsed = new_ticks - old_ticks; @@ -107,12 +108,12 @@ A0 (PUBLIC, void, C_ROMlib_vcatch) /* Account for possible missed ticks by possibly subtracting * off more than one tick from the VBL count. */ - old_vbl_count = CW (vp->vblCount); + old_vbl_count = BigEndianValue (vp->vblCount); new_vbl_count = old_vbl_count - ticks_elapsed; if (old_vbl_count > 0 && new_vbl_count < 0) new_vbl_count = 0; /* Only compensate for zero crossings. */ - vp->vblCount = CW (new_vbl_count); + vp->vblCount = BigEndianValue (new_vbl_count); if (new_vbl_count == 0) { VBLQueue.qFlags |= CWC (VBUSY); @@ -123,7 +124,7 @@ A0 (PUBLIC, void, C_ROMlib_vcatch) */ EM_A0 = (LONGINT) (long) US_TO_SYN68K_CHECK0(vp); - EM_A1 = (LONGINT) CL ((long) vp->vblAddr); + EM_A1 = (LONGINT) BigEndianValue ((long) vp->vblAddr); CALL_EMULATOR ((syn68k_addr_t) EM_A1); @@ -185,7 +186,7 @@ A1 (PUBLIC trap, OSErrRET, VInstall, VBLTaskPtr, vtaskp) { static unsigned short m68k_rts = CWC (0x4E75); /* RTS */ - vtaskp->vblCount = CW (CW (vtaskp->vblCount) + CW (vtaskp->vblPhase)); + vtaskp->vblCount = BigEndianValue (BigEndianValue (vtaskp->vblCount) + BigEndianValue (vtaskp->vblPhase)); if (vtaskp->qType == CWC ((INTEGER) vType)) { if (!VBLQueue.qHead) diff --git a/src/version.cpp b/src/version.cpp index a0d2cc4f..4dd32269 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -16,6 +16,7 @@ char ROMlib_rcsid_version[] = #include "MemoryMgr.h" using namespace Executor; +using namespace ByteSwap; /* A simple version number like "1.99q" */ const char ROMlib_executor_version[] = EXECUTOR_VERSION; @@ -93,7 +94,7 @@ ROMlib_set_system_version (uint32 version) enum { MINOR_MASK = 0xF, REV_MASK = 0xF }; system_version = version; - SysVersion = CW (version); + SysVersion = BigEndianValue (version); major = version >> 8; minor = (version >> 4) & MINOR_MASK; diff --git a/src/vgavdriver.cpp b/src/vgavdriver.cpp index cdd3284a..6878bf87 100644 --- a/src/vgavdriver.cpp +++ b/src/vgavdriver.cpp @@ -2031,12 +2031,12 @@ host_set_cursor (char *cursor_data, mask_baseaddr = alloca (16 * row_bytes); target_pixmap.baseAddr = RM (mask_baseaddr); - target_pixmap.rowBytes = CW (row_bytes); + target_pixmap.rowBytes = BigEndianValue (row_bytes); target_pixmap.bounds = ROMlib_cursor_rect; target_pixmap.cmpCount = CWC (1); target_pixmap.pixelType = CWC (0); target_pixmap.pixelSize = target_pixmap.cmpSize - = CW (1 << vdriver_log2_bpp); + = BigEndianValue (1 << vdriver_log2_bpp); /* The target pixmap colortable is not used by `convert_pixmap ()' * target_pixmap.pmTable = ...; */ @@ -2061,12 +2061,12 @@ host_set_cursor (char *cursor_data, for (xmod = 0; xmod < 8; xmod++) for (y = 0; y < 16; y++) { - and = ~(CW (m[y]) << (16 - xmod)); + and = ~(BigEndianValue (m[y]) << (16 - xmod)); cursor_masks.bpp1[xmod][y][0].and_mask = and >> 24; cursor_masks.bpp1[xmod][y][1].and_mask = and >> 16; cursor_masks.bpp1[xmod][y][2].and_mask = and >> 8; - xor = CW (d[y]) << (16 - xmod); + xor = BigEndianValue (d[y]) << (16 - xmod); cursor_masks.bpp1[xmod][y][0].xor_mask = xor >> 24; cursor_masks.bpp1[xmod][y][1].xor_mask = xor >> 16; cursor_masks.bpp1[xmod][y][2].xor_mask = xor >> 8; @@ -2084,21 +2084,21 @@ host_set_cursor (char *cursor_data, for (xmod = 0; xmod < 4; xmod++) for (y = 0; y < 16; y++) { - and = ~(CL (m[y]) >> (xmod * 2)); + and = ~(BigEndianValue (m[y]) >> (xmod * 2)); cursor_masks.bpp2[xmod][y][0].and_mask = and >> 24; cursor_masks.bpp2[xmod][y][1].and_mask = and >> 16; cursor_masks.bpp2[xmod][y][2].and_mask = and >> 8; cursor_masks.bpp2[xmod][y][3].and_mask = and; cursor_masks.bpp2[xmod][y][4].and_mask = - ~(CL (m[y]) << (8 - (xmod * 2))); + ~(BigEndianValue (m[y]) << (8 - (xmod * 2))); - xor = CL (d[y]) >> (xmod * 2); + xor = BigEndianValue (d[y]) >> (xmod * 2); cursor_masks.bpp2[xmod][y][0].xor_mask = xor >> 24; cursor_masks.bpp2[xmod][y][1].xor_mask = xor >> 16; cursor_masks.bpp2[xmod][y][2].xor_mask = xor >> 8; cursor_masks.bpp2[xmod][y][3].xor_mask = xor; cursor_masks.bpp2[xmod][y][4].xor_mask = - CL (d[y]) << (8 - (xmod * 2)); + BigEndianValue (d[y]) << (8 - (xmod * 2)); } break; } diff --git a/src/windColor.cpp b/src/windColor.cpp index 5f4507c1..13afaa6d 100644 --- a/src/windColor.cpp +++ b/src/windColor.cpp @@ -20,6 +20,7 @@ char ROMlib_rcsid_windColor[] = #include "rsys/wind.h" using namespace Executor; +using namespace ByteSwap; /* return a pointer to the auxilary window record associated with `w' */ @@ -137,7 +138,7 @@ P2 (PUBLIC pascal trap, void, SetWinColor, /* FIXME: copy? */ HxX (aux_w, awCTable) = RM (new_w_ctab); HxX (aux_w, dialogCItem) = 0; - HxX (aux_w, awFlags) = /* CL (proc_id & 0x0F) */ 0; + HxX (aux_w, awFlags) = /* BigEndianValue (proc_id & 0x0F) */ 0; HxX (aux_w, awReserved) = 0; HxX (aux_w, awRefCon) = 0; } @@ -156,7 +157,7 @@ P2 (PUBLIC pascal trap, void, SetWinColor, /* pick the best color and store it into window's port's bkColor field */ - PORT_BK_COLOR_X (w) = CL (Color2Index (color)); + PORT_BK_COLOR_X (w) = BigEndianValue (Color2Index (color)); if (WINDOW_VISIBLE_X (w)) THEPORT_SAVE_EXCURSION @@ -167,8 +168,8 @@ P2 (PUBLIC pascal trap, void, SetWinColor, CopyRgn (WINDOW_CONT_REGION (w), t); OffsetRgn (t, - CW (PORT_BOUNDS (w).left), - CW (PORT_BOUNDS (w).top)); + BigEndianValue (PORT_BOUNDS (w).left), + BigEndianValue (PORT_BOUNDS (w).top)); EraseRgn (t); DisposeRgn (t); }); diff --git a/src/windDisplay.cpp b/src/windDisplay.cpp index afefab59..da9ba767 100644 --- a/src/windDisplay.cpp +++ b/src/windDisplay.cpp @@ -20,6 +20,7 @@ char ROMlib_rcsid_windDisplay[] = #include "rsys/glue.h" using namespace Executor; +using namespace ByteSwap; P2(PUBLIC pascal trap, void, SetWTitle, WindowPtr, w, StringPtr, t) { @@ -30,7 +31,7 @@ P2(PUBLIC pascal trap, void, SetWTitle, WindowPtr, w, StringPtr, t) THEPORT_SAVE_EXCURSION (MR (wmgr_port), { - WINDOW_TITLE_WIDTH_X (w) = CW (StringWidth (t)); + WINDOW_TITLE_WIDTH_X (w) = BigEndianValue (StringWidth (t)); if (WINDOW_VISIBLE_X (w)) { @@ -319,9 +320,9 @@ P2(PUBLIC pascal trap, void, SendBehind, WindowPtr, w, WindowPtr, behind) #if 0 newfront = (WindowPeek) FrontWindow (); if (oldfront != newfront) { - CurDeactive = CL((WindowPtr) oldfront); + CurDeactive = BigEndianValue((WindowPtr) oldfront); HiliteWindow((WindowPtr) oldfront, FALSE); - CurActivate = CL((WindowPtr) newfront); + CurActivate = BigEndianValue((WindowPtr) newfront); HiliteWindow((WindowPtr) newfront, TRUE); } #else /* 0 */ @@ -346,16 +347,16 @@ P1(PUBLIC pascal trap, void, DrawGrowIcon, WindowPtr, w) { SetClip (PORT_CLIP_REGION (w)); OffsetRgn (WINDOW_STRUCT_REGION (w), - CW (PORT_BOUNDS (w).left), - CW (PORT_BOUNDS (w).top)); + BigEndianValue (PORT_BOUNDS (w).left), + BigEndianValue (PORT_BOUNDS (w).top)); SectRgn (PORT_CLIP_REGION (thePort), WINDOW_STRUCT_REGION (w), PORT_CLIP_REGION (thePort)); OffsetRgn (WINDOW_STRUCT_REGION (w), - - CW (PORT_BOUNDS (w).left), - - CW (PORT_BOUNDS (w).top)); + - BigEndianValue (PORT_BOUNDS (w).left), + - BigEndianValue (PORT_BOUNDS (w).top)); OffsetRgn (PORT_CLIP_REGION (thePort), - - CW (PORT_BOUNDS (w).left), - - CW (PORT_BOUNDS (w).top)); + - BigEndianValue (PORT_BOUNDS (w).left), + - BigEndianValue (PORT_BOUNDS (w).top)); ClipAbove ((WindowPeek) w); WINDCALL(w, wDrawGIcon, 0); }); diff --git a/src/windDocdef.cpp b/src/windDocdef.cpp index 72734a12..e9e8b959 100644 --- a/src/windDocdef.cpp +++ b/src/windDocdef.cpp @@ -20,6 +20,7 @@ char ROMlib_rcsid_windDocdef[] = #include "rsys/image.h" using namespace Executor; +using namespace ByteSwap; namespace Executor { #include "zoom.cmap" @@ -40,8 +41,8 @@ PUBLIC BOOLEAN ROMlib_window_zoomed(WindowPeek wp) boundsrp = &PORT_BOUNDS (wp); retval = (WINDOW_SPARE_FLAG_X (wp) - && CW (portrp->top) - CW (boundsrp->top) == CW (staterp->top) - && CW (portrp->left) - CW (boundsrp->left) == CW (staterp->left) + && BigEndianValue (portrp->top) - BigEndianValue (boundsrp->top) == BigEndianValue (staterp->top) + && BigEndianValue (portrp->left) - BigEndianValue (boundsrp->left) == BigEndianValue (staterp->left) && RECT_WIDTH(portrp) == RECT_WIDTH(staterp) && RECT_HEIGHT(portrp) == RECT_HEIGHT(staterp) ); return retval; @@ -160,7 +161,7 @@ Executor::validate_colors_for_window (GrafPtr w) { /* same content color */ for (i = 0; i <= w_ctab_size; i ++) - if (w_ctab_table[i].value == CW (wContentColor)) + if (w_ctab_table[i].value == BigEndianValue (wContentColor)) color_window_colors[wContentColor] = w_ctab_table[i].rgb; } @@ -172,7 +173,7 @@ Executor::validate_colors_for_window (GrafPtr w) int w_ctab_entry_index; w_ctab_entry = &w_ctab_table[i]; - w_ctab_entry_index = CW (w_ctab_entry->value); + w_ctab_entry_index = BigEndianValue (w_ctab_entry->value); if (w_ctab_entry_index < 0 || w_ctab_entry_index > 12) { #if !defined (CYGWIN32) /* just gets in the way of debugging under windows */ @@ -300,10 +301,10 @@ toggle_box_active (enum box_flag which_box, Point origin) pixel_image_t *box; /* compute the destination rectangle */ - dst_rect.top = CW (origin.v); - dst_rect.left = CW (origin.h); - dst_rect.bottom = CW (origin.v + 13); - dst_rect.right = CW (origin.h + 13); + dst_rect.top = BigEndianValue (origin.v); + dst_rect.left = BigEndianValue (origin.h); + dst_rect.bottom = BigEndianValue (origin.v + 13); + dst_rect.right = BigEndianValue (origin.h + 13); /* set box */ if (rounded_window_p) @@ -320,7 +321,7 @@ toggle_box_active (enum box_flag which_box, Point origin) { /* invert the set bits of the box */ PORT_FG_COLOR_X (thePort) - = CL ((1 << PIXMAP_PIXEL_SIZE (CPORT_PIXMAP (thePort))) - 1); + = BigEndianValue ((1 << PIXMAP_PIXEL_SIZE (CPORT_PIXMAP (thePort))) - 1); PORT_FG_COLOR_X (thePort) = CLC (0); } else @@ -349,7 +350,7 @@ toggle_box_active (enum box_flag which_box, Point origin) target_color = &ROMlib_white_rgb_color; PORT_FG_COLOR_X (thePort) - = CL (Color2Index (target_color) ^ Color2Index (frame)); + = BigEndianValue (Color2Index (target_color) ^ Color2Index (frame)); } image_copy (rounded_window_p ? ractive : active, @@ -362,8 +363,8 @@ toggle_zoom_box (GrafPtr w) { Point origin; - origin.h = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left) - 21; - origin.v = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top) - 16; + origin.h = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left) - 21; + origin.v = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top) - 16; toggle_box_active (zoom_box_flag, origin); } @@ -373,8 +374,8 @@ toggle_go_away_box (GrafPtr w) { Point origin; - origin.h = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left) + 8; - origin.v = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top) - 16; + origin.h = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left) + 8; + origin.v = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top) - 16; toggle_box_active (go_away_box_flag, origin); } @@ -434,10 +435,10 @@ draw_title (GrafPtr w, int title_start; int left_bound; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); /* #warning "clean up this port mess in draw_title ()" */ GetPort(&tp); @@ -553,10 +554,10 @@ draw_frame (GrafPtr w, int draw_zoom_p, boolean_t goaway_override) int left, top, right, bottom; Rect r; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); PenSize (1, 1); /* draw with the current foreground color */ @@ -573,7 +574,7 @@ draw_frame (GrafPtr w, int draw_zoom_p, boolean_t goaway_override) /* draw the frame; these are drawn in the frame_outline_color */ RGBForeColor (frame_outline); - r.bottom = CW (bottom + 1); + r.bottom = BigEndianValue (bottom + 1); FrameRect (&r); MoveTo (left, top - 1); LineTo (right, top - 1); @@ -611,10 +612,10 @@ draw_grow_lines (Rect *bounds) int left, top, right, bottom; Rect r; - left = CW (bounds->left); - top = CW (bounds->top); - right = CW (bounds->right); - bottom = CW (bounds->bottom); + left = BigEndianValue (bounds->left); + top = BigEndianValue (bounds->top); + right = BigEndianValue (bounds->right); + bottom = BigEndianValue (bounds->bottom); PenSize (1, 1); SetRect (&r, left - 1, top - 19, right + 1, bottom + 1); @@ -637,10 +638,10 @@ draw_dialog_box (GrafPtr w) Rect r; RGBColor middle_color; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); PenSize (1, 1); PenMode (patCopy); @@ -721,10 +722,10 @@ draw_plain_dialog_box (GrafPtr w) int left, top, right, bottom; Rect r; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); PenSize (1, 1); PenMode (patCopy); @@ -739,10 +740,10 @@ draw_alt_dialog_box (GrafPtr w) int left, top, right, bottom; Rect r; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); PenSize (1, 1); PenMode (patCopy); @@ -765,10 +766,10 @@ draw_grow_icon (GrafPtr w) { int left, top, right, bottom; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); PenPat (black); PenSize (1, 1); @@ -787,10 +788,10 @@ draw_grow_icon (GrafPtr w) { Rect rect; - rect.top = CW (bottom - 14); - rect.left = CW (right - 14); - rect.bottom = CW (bottom); - rect.right = CW (right); + rect.top = BigEndianValue (bottom - 14); + rect.left = BigEndianValue (right - 14); + rect.bottom = BigEndianValue (bottom); + rect.right = BigEndianValue (right); image_copy (grow, color_p, &rect, srcCopy); } @@ -802,10 +803,10 @@ erase_grow_icon (GrafPtr w) int left, top, right, bottom; Rect r; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); PenPat (black); PenSize (1, 1); @@ -825,10 +826,10 @@ hit_doc (WindowPeek w, LONGINT parm, int growable_p, Point p; int left, top, right, bottom; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); p.v = HiWord (parm); p.h = LoWord (parm); @@ -890,40 +891,40 @@ calc_doc (GrafPtr w) INTEGER *ip; int left, top, right, bottom; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); SetRectRgn (WINDOW_CONT_REGION (w), left, top, right, bottom); rh = WINDOW_STRUCT_REGION (w); ReallocHandle ((Handle) rh, (Size) 44); - HxX (rh, rgnBBox.left) = CW (left - 1); - HxX (rh, rgnBBox.top) = CW (top - 19); - HxX (rh, rgnBBox.right) = CW (right + 2); - HxX (rh, rgnBBox.bottom) = CW (bottom + 2); + HxX (rh, rgnBBox.left) = BigEndianValue (left - 1); + HxX (rh, rgnBBox.top) = BigEndianValue (top - 19); + HxX (rh, rgnBBox.right) = BigEndianValue (right + 2); + HxX (rh, rgnBBox.bottom) = BigEndianValue (bottom + 2); HxX (rh, rgnSize) = CWC (44); ip = (INTEGER *) STARH (rh) + 5; - *ip++ = CW(top - 19); - *ip++ = CW(left - 1); - *ip++ = CW(right + 1); + *ip++ = BigEndianValue(top - 19); + *ip++ = BigEndianValue(left - 1); + *ip++ = BigEndianValue(right + 1); *ip++ = CWC(32767); - *ip++ = CW(top - 18); - *ip++ = CW(right + 1); - *ip++ = CW(right + 2); + *ip++ = BigEndianValue(top - 18); + *ip++ = BigEndianValue(right + 1); + *ip++ = BigEndianValue(right + 2); *ip++ = CWC(32767); - *ip++ = CW(bottom + 1); - *ip++ = CW(left - 1); - *ip++ = CW(left); + *ip++ = BigEndianValue(bottom + 1); + *ip++ = BigEndianValue(left - 1); + *ip++ = BigEndianValue(left); *ip++ = CWC(32767); - *ip++ = CW(bottom + 2); - *ip++ = CW(left); - *ip++ = CW(right + 2); + *ip++ = BigEndianValue(bottom + 2); + *ip++ = BigEndianValue(left); + *ip++ = BigEndianValue(right + 2); *ip++ = CWC(32767); *ip++ = CWC(32767); @@ -936,41 +937,41 @@ calc_alt_dialog_box (GrafPtr w) INTEGER *ip; int left, top, right, bottom; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); SetRectRgn (WINDOW_CONT_REGION (w), left, top, right, bottom); rh = WINDOW_STRUCT_REGION (w); ReallocHandle ((Handle) rh, (Size) 44); - HxX (rh, rgnBBox.left) = CW (left - 1); - HxX (rh, rgnBBox.top) = CW (top - 1); - HxX (rh, rgnBBox.right) = CW (right + 3); - HxX (rh, rgnBBox.bottom) = CW (bottom + 3); + HxX (rh, rgnBBox.left) = BigEndianValue (left - 1); + HxX (rh, rgnBBox.top) = BigEndianValue (top - 1); + HxX (rh, rgnBBox.right) = BigEndianValue (right + 3); + HxX (rh, rgnBBox.bottom) = BigEndianValue (bottom + 3); HxX (rh, rgnSize) = CWC (44); ip = (INTEGER *) STARH (rh) + 5; - *ip++ = CW(top - 1); - *ip++ = CW(left - 1); - *ip++ = CW(right + 1); + *ip++ = BigEndianValue(top - 1); + *ip++ = BigEndianValue(left - 1); + *ip++ = BigEndianValue(right + 1); *ip++ = CWC(32767); - *ip++ = CW(top + 1); - *ip++ = CW(right + 1); - *ip++ = CW(right + 3); + *ip++ = BigEndianValue(top + 1); + *ip++ = BigEndianValue(right + 1); + *ip++ = BigEndianValue(right + 3); *ip++ = CWC(32767); - *ip++ = CW(bottom + 1); - *ip++ = CW(left - 1); - *ip++ = CW(left + 1); + *ip++ = BigEndianValue(bottom + 1); + *ip++ = BigEndianValue(left - 1); + *ip++ = BigEndianValue(left + 1); *ip++ = CWC(32767); - *ip++ = CW(bottom + 3); - *ip++ = CW(left + 1); - *ip++ = CW(right + 3); + *ip++ = BigEndianValue(bottom + 3); + *ip++ = BigEndianValue(left + 1); + *ip++ = BigEndianValue(right + 3); *ip++ = CWC(32767); *ip++ = CWC(32767); @@ -981,10 +982,10 @@ calc_dialog_box (GrafPtr w, INTEGER n) { int left, top, right, bottom; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); SetRectRgn (WINDOW_CONT_REGION (w), left, top, right, bottom); SetRectRgn (WINDOW_STRUCT_REGION (w), @@ -1110,12 +1111,12 @@ P4 (PUBLIC pascal, LONGINT, wdef0, wsp->stdState = GD_BOUNDS (MR (TheGDevice)); InsetRect (&wsp->stdState, 3, 3); - wsp->stdState.top = CW (CW (wsp->stdState.top) + 38); + wsp->stdState.top = BigEndianValue (BigEndianValue (wsp->stdState.top) + 38); wsp->userState = PORT_RECT (w); /* local to global */ - OffsetRect (&wsp->userState, -CW (PORT_BOUNDS (w).left), - -CW (PORT_BOUNDS (w).top)); + OffsetRect (&wsp->userState, -BigEndianValue (PORT_BOUNDS (w).left), + -BigEndianValue (PORT_BOUNDS (w).top)); WINDOW_SPARE_FLAG_X (w) = TRUE; } @@ -1144,8 +1145,8 @@ P4 (PUBLIC pascal, LONGINT, wdef0, temp_rgn); OffsetRgn (temp_rgn, - - CW (PORT_BOUNDS (w).left), - - CW (PORT_BOUNDS (w).top)); + - BigEndianValue (PORT_BOUNDS (w).left), + - BigEndianValue (PORT_BOUNDS (w).top)); CopyRgn (PORT_CLIP_REGION (thePort), save_clip); SectRgn (PORT_CLIP_REGION (thePort), temp_rgn, @@ -1207,10 +1208,10 @@ draw_rounded_doc (GrafPtr w) int draw_go_away_p; Rect r; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); SetRect (&r, left - 1, top - 19, right + 1, top); FillRect (&r, white); @@ -1239,10 +1240,10 @@ hit_rounded_doc (GrafPtr w, LONGINT param) Point p; int left, top, right, bottom; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); p.v = HiWord (param); p.h = LoWord (param); @@ -1287,10 +1288,10 @@ calc_rounded_doc (GrafPtr w, INTEGER curve_code) RgnHandle rh; Rect r; - left = CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left); - top = CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top); - right = CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left); - bottom = CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top); + left = BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left); + top = BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top); + right = BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left); + bottom = BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top); SetRectRgn (WINDOW_CONT_REGION (w), left, top, right, bottom); @@ -1299,10 +1300,10 @@ calc_rounded_doc (GrafPtr w, INTEGER curve_code) else curve = 16; - r.left = CW(left - 1); - r.top = CW(top - 19); - r.right = CW(right + 1); - r.bottom = CW(bottom + 1); + r.left = BigEndianValue(left - 1); + r.top = BigEndianValue(top - 19); + r.right = BigEndianValue(right + 1); + r.bottom = BigEndianValue(bottom + 1); OpenRgn (); FrameRoundRect (&r, curve, curve); CloseRgn (WINDOW_STRUCT_REGION (w)); diff --git a/src/windInit.cpp b/src/windInit.cpp index d3b5edaa..3fa1aaa3 100644 --- a/src/windInit.cpp +++ b/src/windInit.cpp @@ -42,6 +42,7 @@ char ROMlib_rcsid_windInit[] = #include "rsys/launch.h" using namespace Executor; +using namespace ByteSwap; PUBLIC BOOLEAN Executor::ROMlib_dirtyvariant = FALSE; @@ -103,12 +104,12 @@ P0 (PUBLIC pascal trap, void, InitWindows) FrameRect (&GD_BOUNDS (MR (TheGDevice))); CloseRgn (MR (GrayRgn)); mrgn = NewRgn(); - SetRectRgn(mrgn, 0, 0, CW (GD_BOUNDS (MR (TheGDevice)).right), - CW(MBarHeight)); + SetRectRgn(mrgn, 0, 0, BigEndianValue (GD_BOUNDS (MR (TheGDevice)).right), + BigEndianValue(MBarHeight)); SectRgn(MR(GrayRgn), mrgn, mrgn); corners = NewRgn(); - SetRectRgn(corners, 0, 0, CW (GD_BOUNDS (MR (TheGDevice)).right), - CW (GD_BOUNDS (MR (TheGDevice)).bottom)); + SetRectRgn(corners, 0, 0, BigEndianValue (GD_BOUNDS (MR (TheGDevice)).right), + BigEndianValue (GD_BOUNDS (MR (TheGDevice)).bottom)); DiffRgn(corners, MR(GrayRgn), corners); PaintRgn(corners); CopyRgn (MR (GrayRgn), PORT_VIS_REGION (MR (wmgr_port))); @@ -116,8 +117,8 @@ P0 (PUBLIC pascal trap, void, InitWindows) PenPat(white); PaintRgn(mrgn); PenPat(black); - MoveTo(0, CW(MBarHeight) - 1); - Line (CW (GD_BOUNDS (MR (TheGDevice)).right), 0); + MoveTo(0, BigEndianValue(MBarHeight) - 1); + Line (BigEndianValue (GD_BOUNDS (MR (TheGDevice)).right), 0); if ((USE_DESKCPAT_VAR & USE_DESKCPAT_BIT) && PIXMAP_PIXEL_SIZE (GD_PMAP (MR (MainDevice))) > 2) FillCRgn(MR(GrayRgn), MR(DeskCPat)); @@ -423,7 +424,7 @@ ROMlib_new_window_common (WindowPeek w, HxX (t_aux_w, awOwner) = (WindowPtr) RM (w); HxX (t_aux_w, awCTable) = (CTabHandle) RM (GetResource (TICK("wctb"), 0)); HxX (t_aux_w, dialogCItem) = 0; - HxX (t_aux_w, awFlags) = CL ((proc_id & 0xF) << 24); + HxX (t_aux_w, awFlags) = BigEndianValue ((proc_id & 0xF) << 24); HxX (t_aux_w, awReserved) = 0; HxX (t_aux_w, awRefCon) = 0; AuxWinHead = RM (t_aux_w); @@ -439,19 +440,19 @@ ROMlib_new_window_common (WindowPeek w, OpenCPort ((CGrafPtr) w); else OpenPort ((GrafPtr) w); - OffsetRect (&PORT_BOUNDS (w), -CW (bounds->left), -CW (bounds->top)); + OffsetRect (&PORT_BOUNDS (w), -BigEndianValue (bounds->left), -BigEndianValue (bounds->top)); PORT_RECT (w) = *bounds; - OffsetRect (&PORT_RECT (w), -CW (bounds->left), -CW (bounds->top)); + OffsetRect (&PORT_RECT (w), -BigEndianValue (bounds->left), -BigEndianValue (bounds->top)); LOCK_HANDLE_EXCURSION_1 (WINDOW_TITLE (w), { - WINDOW_TITLE_WIDTH_X (w) = CW (StringWidth (STARH (WINDOW_TITLE (w)))); + WINDOW_TITLE_WIDTH_X (w) = BigEndianValue (StringWidth (STARH (WINDOW_TITLE (w)))); }); TextFont (applFont); WINDOW_CONTROL_LIST_X (w) = (ControlHandle)CWC (0); WINDOW_PIC_X (w) = (PicHandle)CWC (0); - WINDOW_REF_CON_X (w) = CL (ref_con); + WINDOW_REF_CON_X (w) = BigEndianValue (ref_con); WINDCALL ((WindowPtr) w, wNew, 0); if (WINDOW_VISIBLE_X (w)) { @@ -572,7 +573,7 @@ P3 (PUBLIC pascal trap, CWindowPtr, GetNewCWindow, Hx (win_res, _wvisible) != 0, Hx (win_res, _wprocid), behind, Hx (win_res, _wgoaway) != 0, - CL (*(LONGINT *) ((char *) &HxX (win_res, _wrect) + 14))); + BigEndianValue (*(LONGINT *) ((char *) &HxX (win_res, _wrect) + 14))); win_ctab_res = ROMlib_getrestid (TICK ("wctb"), window_id); @@ -610,7 +611,7 @@ P3(PUBLIC pascal trap, WindowPtr, GetNewWindow, INTEGER, wid, Ptr, wst, (StringPtr) ((char *) &HxX(wh, _wrect) + 18), Hx(wh, _wvisible) != 0, Hx(wh, _wprocid), (WindowPtr) behind, Hx(wh, _wgoaway) != 0, - CL(*(LONGINT *)( (char *) &HxX(wh, _wrect) + 14))); + BigEndianValue(*(LONGINT *)( (char *) &HxX(wh, _wrect) + 14))); return(tp); } diff --git a/src/windMisc.cpp b/src/windMisc.cpp index a6477e2a..84f4597d 100644 --- a/src/windMisc.cpp +++ b/src/windMisc.cpp @@ -26,6 +26,7 @@ char ROMlib_rcsid_windMisc[] = #include "rsys/executor.h" using namespace Executor; +using namespace ByteSwap; PRIVATE boolean_t is_window_ptr (WindowPeek w) @@ -50,7 +51,7 @@ is_window_ptr (WindowPeek w) P2(PUBLIC pascal trap, void, SetWRefCon, WindowPtr, w, LONGINT, data) { if (is_window_ptr ((WindowPeek) w)) - WINDOW_REF_CON_X (w) = CL(data); + WINDOW_REF_CON_X (w) = BigEndianValue(data); } /* @@ -105,14 +106,14 @@ P1(PUBLIC pascal trap, PicHandle, GetWindowPic, WindowPtr, w) P2(PUBLIC pascal trap, LONGINT, PinRect, Rect *, r, Point, p) { - if (p.h < CW(r->left)) - p.h = CW(r->left); - else if (p.h >= CW(r->right)) - p.h = CW(r->right) - 1; - if (p.v < CW(r->top)) - p.v = CW(r->top); - else if (p.v >= CW(r->bottom)) - p.v = CW(r->bottom) - 1; + if (p.h < BigEndianValue(r->left)) + p.h = BigEndianValue(r->left); + else if (p.h >= BigEndianValue(r->right)) + p.h = BigEndianValue(r->right) - 1; + if (p.v < BigEndianValue(r->top)) + p.v = BigEndianValue(r->top); + else if (p.v >= BigEndianValue(r->bottom)) + p.v = BigEndianValue(r->bottom) - 1; return(((LONGINT)p.v << 16) | (unsigned short) p.h); } @@ -143,8 +144,8 @@ P6 (PUBLIC pascal trap, LONGINT, DragTheRgn, while (!GetOSEvent(mUpMask, &ev)) { GlobalToLocal (&ev.where); - ev.where.h = CW (ev.where.h); - ev.where.v = CW (ev.where.v); + ev.where.h = BigEndianValue (ev.where.h); + ev.where.v = BigEndianValue (ev.where.v); if (PtInRect(ev.where, slop)) { l = PinRect (limit, ev.where); @@ -247,7 +248,7 @@ P1(PUBLIC pascal trap, BOOLEAN, CheckUpdate, EventRecord *, ev) }); else { - ev->what = CW(updateEvt); + ev->what = BigEndianValue(updateEvt); ev->message = (long) RM(wp); return TRUE; } @@ -368,8 +369,8 @@ P1(PUBLIC pascal trap, void, CalcVis, WindowPeek, w) DiffRgn (PORT_VIS_REGION (w), WINDOW_STRUCT_REGION (wp), PORT_VIS_REGION (w)); OffsetRgn (PORT_VIS_REGION (w), - CW (PORT_BOUNDS (w).left), - CW (PORT_BOUNDS (w).top)); + BigEndianValue (PORT_BOUNDS (w).left), + BigEndianValue (PORT_BOUNDS (w).top)); } } @@ -460,7 +461,7 @@ Executor::CALLDRAGHOOK (void) savea2 = EM_A2; savea3 = EM_A3; EM_D0 = 0; - CALL_EMULATOR((syn68k_addr_t) CL((long)DragHook)); + CALL_EMULATOR((syn68k_addr_t) BigEndianValue((long)DragHook)); EM_D0 = saved0; EM_D1 = saved1; EM_D2 = saved2; @@ -487,7 +488,7 @@ Executor::WINDCALLDESKHOOK (void) savea2 = EM_A2; savea3 = EM_A3; EM_D0 = 0; - CALL_EMULATOR((syn68k_addr_t) CL((long) DeskHook)); + CALL_EMULATOR((syn68k_addr_t) BigEndianValue((long) DeskHook)); EM_D0 = saved0; EM_D1 = saved1; EM_D2 = saved2; diff --git a/src/windMouse.cpp b/src/windMouse.cpp index de262033..41136d8e 100644 --- a/src/windMouse.cpp +++ b/src/windMouse.cpp @@ -21,6 +21,7 @@ char ROMlib_rcsid_windMouse[] = #include "rsys/menu.h" using namespace Executor; +using namespace ByteSwap; #if !defined (No_STEF_zoommods) /* WINDOW_ZOOMED returns TRUE if w is currently in stdState (big) */ @@ -84,8 +85,8 @@ A3(PRIVATE, BOOLEAN, xTrackBox, WindowPtr, wp, Point, pt, WINDCALL(wp, wDraw, part); while (!GetOSEvent(mUpMask, &ev)) { - ev.where.h = CW(ev.where.h); - ev.where.v = CW(ev.where.v); + ev.where.h = BigEndianValue(ev.where.h); + ev.where.v = BigEndianValue(ev.where.v); CALLDRAGHOOK(); if (pt.h != ev.where.h || pt.v != ev.where.v) { @@ -145,13 +146,13 @@ P3(PUBLIC pascal trap, void, ZoomWindow, WindowPtr, wp, /* IMIV-50 */ { u = &((WStateData *) STARH (WINDOW_DATA (wp)))->userState; u->top - = CW (CW (PORT_RECT (wp).top) - CW (PORT_BOUNDS (wp).top)); + = BigEndianValue (BigEndianValue (PORT_RECT (wp).top) - BigEndianValue (PORT_BOUNDS (wp).top)); u->left - = CW (CW (PORT_RECT (wp).left) - CW (PORT_BOUNDS (wp).left)); + = BigEndianValue (BigEndianValue (PORT_RECT (wp).left) - BigEndianValue (PORT_BOUNDS (wp).left)); u->bottom - = CW (CW (PORT_RECT (wp).bottom) - CW(PORT_BOUNDS (wp).top)); + = BigEndianValue (BigEndianValue (PORT_RECT (wp).bottom) - BigEndianValue(PORT_BOUNDS (wp).top)); u->right - = CW (CW (PORT_RECT (wp).right) - CW (PORT_BOUNDS (wp).left)); + = BigEndianValue (BigEndianValue (PORT_RECT (wp).right) - BigEndianValue (PORT_BOUNDS (wp).left)); } #endif behind = NewRgn(); @@ -163,11 +164,11 @@ P3(PUBLIC pascal trap, void, ZoomWindow, WindowPtr, wp, /* IMIV-50 */ PORT_RECT (wp) = MR (*(WStateData **) WINDOW_DATA (wp))->stdState; OffsetRect (&PORT_BOUNDS (wp), - -CW(PORT_RECT (wp).left) - CW(PORT_BOUNDS (wp).left), - -CW(PORT_RECT (wp).top) - CW(PORT_BOUNDS (wp).top)); + -BigEndianValue(PORT_RECT (wp).left) - BigEndianValue(PORT_BOUNDS (wp).left), + -BigEndianValue(PORT_RECT (wp).top) - BigEndianValue(PORT_BOUNDS (wp).top)); OffsetRect (&PORT_RECT (wp), - -CW (PORT_RECT (wp).left), -CW (PORT_RECT (wp).top)); + -BigEndianValue (PORT_RECT (wp).left), -BigEndianValue (PORT_RECT (wp).top)); WINDCALL(wp, wCalcRgns, 0); UnionRgn(behind, WINDOW_STRUCT_REGION (wp), behind); diff --git a/src/windSize.cpp b/src/windSize.cpp index 338e9305..6cba253a 100644 --- a/src/windSize.cpp +++ b/src/windSize.cpp @@ -22,6 +22,7 @@ char ROMlib_rcsid_windSize[] = #include "rsys/wind.h" using namespace Executor; +using namespace ByteSwap; /* * Note, the code below probably be rewritten to use XorRgn as much @@ -63,8 +64,8 @@ P4(PUBLIC pascal trap, void, MoveWindow, WindowPtr, wp, INTEGER, h, INTEGER, v, RgnHandle last_three_pixels; tmpr = GD_BOUNDS (MR (TheGDevice)); - tmpr.top = CW (CW (tmpr.bottom) - 1); - tmpr.left = CW (CW (tmpr.right) - 3); + tmpr.top = BigEndianValue (BigEndianValue (tmpr.bottom) - 1); + tmpr.left = BigEndianValue (BigEndianValue (tmpr.right) - 3); last_three_pixels = NewRgn (); RectRgn (last_three_pixels, &tmpr); DiffRgn (movepart, last_three_pixels, movepart); @@ -91,11 +92,11 @@ P4(PUBLIC pascal trap, void, MoveWindow, WindowPtr, wp, INTEGER, h, INTEGER, v, * Picture editting window come up in the wrong place. * (That could be due to other inconsistencies though, like the */ - h += CW (PORT_BOUNDS (w).left) - CW (PORT_RECT (w).left); - v += CW (PORT_BOUNDS (w).top) - CW (PORT_RECT (w).top); + h += BigEndianValue (PORT_BOUNDS (w).left) - BigEndianValue (PORT_RECT (w).left); + v += BigEndianValue (PORT_BOUNDS (w).top) - BigEndianValue (PORT_RECT (w).top); #else - h += CW (PORT_BOUNDS (w).left); - v += CW (PORT_BOUNDS (w).top); + h += BigEndianValue (PORT_BOUNDS (w).left); + v += BigEndianValue (PORT_BOUNDS (w).top); #endif if (WINDOW_VISIBLE_X (w)) { @@ -181,15 +182,15 @@ P3 (PUBLIC pascal trap, void, DragWindow, WindowPtr, wp, Point, p, Rect *, rp) rh = NewRgn (); CopyRgn (WINDOW_STRUCT_REGION (wp), rh); r = *rp; - if (CW (r.top) < 24) + if (BigEndianValue (r.top) < 24) r.top = CWC (24); l = DragGrayRgn (rh, p, &r, &r, noConstraint, (ProcPtr) 0); if ((uint32) l != 0x80008000) MoveWindow(wp, - (- CW (PORT_BOUNDS (wp).left) - + LoWord (l) + CW (PORT_RECT (wp).left)), - (- CW (PORT_BOUNDS (wp).top) - + HiWord (l) + CW (PORT_RECT (wp).top)), + (- BigEndianValue (PORT_BOUNDS (wp).left) + + LoWord (l) + BigEndianValue (PORT_RECT (wp).left)), + (- BigEndianValue (PORT_BOUNDS (wp).top) + + HiWord (l) + BigEndianValue (PORT_RECT (wp).top)), !cmddown); DisposeRgn (rh); @@ -227,31 +228,31 @@ P3(PUBLIC pascal trap, LONGINT, GrowWindow, WindowPtr, w, Point, startp, p.h = startp.h; p.v = startp.v; #if 0 - r.left = CW (- CW (PORT_BOUNDS (w).left)); - r.top = CW (- CW (PORT_BOUNDS (w).top)); - r.right = CW (CW (r.left) + RECT_WIDTH (&PORT_RECT (w))); - r.bottom = CW (CW (r.top) + RECT_HEIGHT (&PORT_RECT (w))); + r.left = BigEndianValue (- BigEndianValue (PORT_BOUNDS (w).left)); + r.top = BigEndianValue (- BigEndianValue (PORT_BOUNDS (w).top)); + r.right = BigEndianValue (BigEndianValue (r.left) + RECT_WIDTH (&PORT_RECT (w))); + r.bottom = BigEndianValue (BigEndianValue (r.top) + RECT_HEIGHT (&PORT_RECT (w))); #else - r.left = CW (CW (PORT_RECT (w).left) - CW (PORT_BOUNDS (w).left)); - r.top = CW (CW (PORT_RECT (w).top) - CW (PORT_BOUNDS (w).top)); - r.right = CW (CW (PORT_RECT (w).right) - CW (PORT_BOUNDS (w).left)); - r.bottom = CW (CW (PORT_RECT (w).bottom) - CW (PORT_BOUNDS (w).top)); + r.left = BigEndianValue (BigEndianValue (PORT_RECT (w).left) - BigEndianValue (PORT_BOUNDS (w).left)); + r.top = BigEndianValue (BigEndianValue (PORT_RECT (w).top) - BigEndianValue (PORT_BOUNDS (w).top)); + r.right = BigEndianValue (BigEndianValue (PORT_RECT (w).right) - BigEndianValue (PORT_BOUNDS (w).left)); + r.bottom = BigEndianValue (BigEndianValue (PORT_RECT (w).bottom) - BigEndianValue (PORT_BOUNDS (w).top)); #endif - pinr.left = CW(CW(r.left) + CW(rp->left)); - if (CW(pinr.left) <= CW(r.left) && CW(rp->left) > 0) + pinr.left = BigEndianValue(BigEndianValue(r.left) + BigEndianValue(rp->left)); + if (BigEndianValue(pinr.left) <= BigEndianValue(r.left) && BigEndianValue(rp->left) > 0) pinr.left = CWC(32767); - pinr.top = CW(CW(r.top) + CW(rp->top)); - if (CW(pinr.top) <= CW(r.top) && CW(rp->top) > 0) + pinr.top = BigEndianValue(BigEndianValue(r.top) + BigEndianValue(rp->top)); + if (BigEndianValue(pinr.top) <= BigEndianValue(r.top) && BigEndianValue(rp->top) > 0) pinr.top = CWC(32767); - pinr.right = CW(CW(r.left) + CW(rp->right)); - if (CW(pinr.right) <= CW(r.left) && CW(rp->right) > 0) + pinr.right = BigEndianValue(BigEndianValue(r.left) + BigEndianValue(rp->right)); + if (BigEndianValue(pinr.right) <= BigEndianValue(r.left) && BigEndianValue(rp->right) > 0) pinr.right = CWC(32767); - pinr.bottom = CW(CW(r.top) + CW(rp->bottom)); - if (CW(pinr.bottom) <= CW(r.top) && CW(rp->bottom) > 0) + pinr.bottom = BigEndianValue(BigEndianValue(r.top) + BigEndianValue(rp->bottom)); + if (BigEndianValue(pinr.bottom) <= BigEndianValue(r.top) && BigEndianValue(rp->bottom) > 0) pinr.bottom = CWC(32767); gp = thePort; @@ -262,16 +263,16 @@ P3(PUBLIC pascal trap, LONGINT, GrowWindow, WindowPtr, w, Point, startp, WINDCALL((WindowPtr) w, wGrow, (LONGINT) (long) &r); while (!GetOSEvent(mUpMask, &ev)) { - ev.where.h = CW(ev.where.h); - ev.where.v = CW(ev.where.v); + ev.where.h = BigEndianValue(ev.where.h); + ev.where.v = BigEndianValue(ev.where.v); l = PinRect (&pinr, ev.where); ev.where.v = HiWord(l); ev.where.h = LoWord(l); if (p.h != ev.where.h || p.v != ev.where.v) { WINDCALL((WindowPtr) w, wGrow, (LONGINT) (long) &r); - r.right = CW(CW(r.right) + (ev.where.h - p.h)); - r.bottom = CW(CW(r.bottom) + (ev.where.v - p.v)); + r.right = BigEndianValue(BigEndianValue(r.right) + (ev.where.h - p.h)); + r.bottom = BigEndianValue(BigEndianValue(r.bottom) + (ev.where.v - p.v)); WINDCALL((WindowPtr) w, wGrow, (LONGINT) (long) &r); p.h = ev.where.h; p.v = ev.where.v; @@ -282,8 +283,8 @@ P3(PUBLIC pascal trap, LONGINT, GrowWindow, WindowPtr, w, Point, startp, RESTORE_PORT (MR ((GrafPtr) WMgrPort)); RESTORE_PORT (gp); if (p.h != startp.h || p.v != startp.v) -/*-->*/ return(((LONGINT)(CW(r.bottom) - CW(r.top)) << 16)| - (unsigned short)(CW(r.right) - CW(r.left))); +/*-->*/ return(((LONGINT)(BigEndianValue(r.bottom) - BigEndianValue(r.top)) << 16)| + (unsigned short)(BigEndianValue(r.right) - BigEndianValue(r.left))); else return(0L); } @@ -298,8 +299,8 @@ P4 (PUBLIC pascal trap, void, SizeWindow, WindowPtr, w, if (WINDOW_VISIBLE_X (w)) SaveOld ((WindowPeek) w); - PORT_RECT (w).right = CW (CW (PORT_RECT (w).left) + width); - PORT_RECT (w).bottom = CW (CW (PORT_RECT (w).top) + height); + PORT_RECT (w).right = BigEndianValue (BigEndianValue (PORT_RECT (w).left) + width); + PORT_RECT (w).bottom = BigEndianValue (BigEndianValue (PORT_RECT (w).top) + height); THEPORT_SAVE_EXCURSION (MR (wmgr_port), diff --git a/src/windUpdate.cpp b/src/windUpdate.cpp index 2cd06630..74fda7bd 100644 --- a/src/windUpdate.cpp +++ b/src/windUpdate.cpp @@ -16,6 +16,7 @@ char ROMlib_rcsid_windUpdate[] = #include "rsys/wind.h" using namespace Executor; +using namespace ByteSwap; P1(PUBLIC pascal trap, void, InvalRect, Rect *, r) { @@ -27,8 +28,8 @@ P1(PUBLIC pascal trap, void, InvalRect, Rect *, r) r_copy = *r; /* Just in case NewRgn moves memory */ rh = NewRgn(); RectRgn(rh, &r_copy); - OffsetRgn(rh, -CW (PORT_BOUNDS (thePort).left), - -CW (PORT_BOUNDS (thePort).top)); + OffsetRgn(rh, -BigEndianValue (PORT_BOUNDS (thePort).left), + -BigEndianValue (PORT_BOUNDS (thePort).top)); UnionRgn(rh, WINDOW_UPDATE_REGION (thePort), WINDOW_UPDATE_REGION (thePort)); DisposeRgn(rh); @@ -42,8 +43,8 @@ P1 (PUBLIC pascal trap, void, InvalRgn, RgnHandle, r) int top, left; current_port = thePort; - top = CW (PORT_BOUNDS (current_port).top); - left = CW (PORT_BOUNDS (current_port).left); + top = BigEndianValue (PORT_BOUNDS (current_port).top); + left = BigEndianValue (PORT_BOUNDS (current_port).left); OffsetRgn (r, -left, -top); @@ -59,8 +60,8 @@ P1(PUBLIC pascal trap, void, ValidRect, Rect *, r) rh = NewRgn(); RectRgn(rh, r); - OffsetRgn(rh, -CW (PORT_BOUNDS (thePort).left), - -CW (PORT_BOUNDS (thePort).top)); + OffsetRgn(rh, -BigEndianValue (PORT_BOUNDS (thePort).left), + -BigEndianValue (PORT_BOUNDS (thePort).top)); DiffRgn (WINDOW_UPDATE_REGION (thePort), rh, WINDOW_UPDATE_REGION (thePort)); DisposeRgn(rh); @@ -68,12 +69,12 @@ P1(PUBLIC pascal trap, void, ValidRect, Rect *, r) P1(PUBLIC pascal trap, void, ValidRgn, RgnHandle, r) { - OffsetRgn(r, -CW (PORT_BOUNDS (thePort).left), - -CW (PORT_BOUNDS (thePort).top)); + OffsetRgn(r, -BigEndianValue (PORT_BOUNDS (thePort).left), + -BigEndianValue (PORT_BOUNDS (thePort).top)); DiffRgn (WINDOW_UPDATE_REGION (thePort), r, WINDOW_UPDATE_REGION (thePort)); - OffsetRgn (r, CW (PORT_BOUNDS (thePort).left), - CW (PORT_BOUNDS (thePort).top)); + OffsetRgn (r, BigEndianValue (PORT_BOUNDS (thePort).left), + BigEndianValue (PORT_BOUNDS (thePort).top)); } PUBLIC int Executor::ROMlib_emptyvis = 0; @@ -95,8 +96,8 @@ P1(PUBLIC pascal trap, void, BeginUpdate, WindowPtr, w) { CopyRgn (WINDOW_UPDATE_REGION (w), PORT_VIS_REGION (w)); OffsetRgn (PORT_VIS_REGION (w), - CW (PORT_BOUNDS (w).left), - CW (PORT_BOUNDS (w).top)); + BigEndianValue (PORT_BOUNDS (w).left), + BigEndianValue (PORT_BOUNDS (w).top)); SectRgn (PORT_VIS_REGION (w), MR (SaveVisRgn), PORT_VIS_REGION (w)); SetEmptyRgn (WINDOW_UPDATE_REGION (w)); ROMlib_emptyvis = EmptyRgn (PORT_VIS_REGION (w)); @@ -108,7 +109,7 @@ P1(PUBLIC pascal trap, void, EndUpdate, WindowPtr, w) CopyRgn(MR(SaveVisRgn), PORT_VIS_REGION (w)); CopyRgn (WINDOW_CONT_REGION (w), MR (SaveVisRgn)); OffsetRgn (MR (SaveVisRgn), - CW (PORT_BOUNDS (w).left), - CW (PORT_BOUNDS (w).top)); + BigEndianValue (PORT_BOUNDS (w).left), + BigEndianValue (PORT_BOUNDS (w).top)); ROMlib_emptyvis = 0; } diff --git a/src/xdata.cpp b/src/xdata.cpp index ce76769f..9732876b 100644 --- a/src/xdata.cpp +++ b/src/xdata.cpp @@ -19,6 +19,7 @@ char ROMlib_rcsid_xdata[] = #include "rsys/vdriver.h" using namespace Executor; +using namespace ByteSwap; boolean_t Executor::update_xdata_if_needed (xdata_handle_t xh, PixPat *pixpat, @@ -29,7 +30,7 @@ Executor::update_xdata_if_needed (xdata_handle_t xh, PixPat *pixpat, x = STARH (xh); if (x->ctab_seed_x != CTAB_SEED_X (MR (dest->pmTable)) - || (1 << x->log2_bpp) != CW (dest->pixelSize) + || (1 << x->log2_bpp) != BigEndianValue (dest->pixelSize) || (x->log2_bpp >= 4 && x->rgb_spec != pixmap_rgb_spec (dest))) { if (x->raw_pat_bits_mem) @@ -113,10 +114,10 @@ raw_bits_for_pattern (const Pattern pattern, PixMap *target, conv_table->ctTable[0].value = CWC (0); conv_table->ctTable[1].value = CWC (~0); - target_depth = CW (target->pixelSize); + target_depth = BigEndianValue (target->pixelSize); dst_row_bytes = target_depth; /* old-style Patterns always 8 pixels wide. */ *row_bytes = dst_row_bytes; - dst_pixmap_tmpl.rowBytes = (CW (dst_row_bytes) + dst_pixmap_tmpl.rowBytes = (BigEndianValue (dst_row_bytes) | (target->rowBytes & ROWBYTES_FLAG_BITS_X) | PIXMAP_DEFAULT_ROWBYTES_X); pixmap_set_pixel_fields (&dst_pixmap_tmpl, target_depth); @@ -151,13 +152,13 @@ raw_bits_for_color_pattern (PixPatPtr pixpat, PixMap *target, src = STARH (patmap); bounds = &src->bounds; - target_depth = CW (target->pixelSize); + target_depth = BigEndianValue (target->pixelSize); row_bytes = ((RECT_WIDTH (bounds) * target_depth) + 7) / 8; *row_bytesp = row_bytes; dst = *target; dst.bounds = *bounds; - dst.rowBytes = (CW (row_bytes) + dst.rowBytes = (BigEndianValue (row_bytes) | (target->rowBytes & ROWBYTES_FLAG_BITS_X) | PIXMAP_DEFAULT_ROWBYTES_X); dst.baseAddr = (Ptr) RM (bits); @@ -188,7 +189,7 @@ raw_bits_for_rgb_pattern (PixPatPtr pixpat, PixMap *target, */ desired_color = CTAB_TABLE (PIXMAP_TABLE (MR (pixpat->patMap)))[4].rgb; - target_depth = CW (target->pixelSize); + target_depth = BigEndianValue (target->pixelSize); if (target_depth <= 8) { @@ -311,7 +312,7 @@ xdata_for_raw_data (PixMap *target, xdata_t *x, uint32 *raw_bits, memset (x, 0, sizeof *x); x->magic_cookie = XDATA_MAGIC_COOKIE; - x->log2_bpp = ROMlib_log2[CW (target->pixelSize)]; + x->log2_bpp = ROMlib_log2[BigEndianValue (target->pixelSize)]; x->ctab_seed_x = CTAB_SEED_X (MR (target->pmTable)); x->rgb_spec = pixmap_rgb_spec (target); diff --git a/src/xdblt.cpp b/src/xdblt.cpp index e8776f54..8bdc772b 100644 --- a/src/xdblt.cpp +++ b/src/xdblt.cpp @@ -28,6 +28,7 @@ char ROMlib_rcsid_xdblt[] = #include "rsys/autorefresh.h" using namespace Executor; +using namespace ByteSwap; /* Holds the four-byte pattern value, for "short & narrow" patterns. */ uint32 xdblt_pattern_value asm ("_xdblt_pattern_value"); @@ -128,14 +129,14 @@ hide_cursor_if_necessary (RgnHandle rh, const PixMap *dst, boolean_t *old_vis) int top, left; RgnPtr rp; - top = CW (dst->bounds.top); - left = CW (dst->bounds.left); + top = BigEndianValue (dst->bounds.top); + left = BigEndianValue (dst->bounds.left); rp = STARH (rh); - *old_vis = host_hide_cursor_if_intersects (CW (rp->rgnBBox.top) - top, - CW (rp->rgnBBox.left) - left, - CW (rp->rgnBBox.bottom) - top, - CW (rp->rgnBBox.right) - left); + *old_vis = host_hide_cursor_if_intersects (BigEndianValue (rp->rgnBBox.top) - top, + BigEndianValue (rp->rgnBBox.left) - left, + BigEndianValue (rp->rgnBBox.bottom) - top, + BigEndianValue (rp->rgnBBox.right) - left); return TRUE; } @@ -172,13 +173,13 @@ setup_dst_bitmap (int log2_bpp, PixMap *dst_pixmap) #endif } - dst -= row_bytes * CW (dst_pixmap->bounds.top); + dst -= row_bytes * BigEndianValue (dst_pixmap->bounds.top); xdblt_dst_row_bytes = row_bytes; byte_slop = (unsigned long) dst & 3; xdblt_dst_baseaddr = (uint32 *) (dst - byte_slop); xdblt_x_offset = ((byte_slop << 3) - - (CW (dst_pixmap->bounds.left) << log2_bpp)); + - (BigEndianValue (dst_pixmap->bounds.left) << log2_bpp)); return xdblt_x_offset << 3; } @@ -241,17 +242,17 @@ Executor::xdblt_xdata_norgb_norotate (RgnHandle rh, int mode, { int top, left; - top = CW (dst->bounds.top); - left = CW (dst->bounds.left); + top = BigEndianValue (dst->bounds.top); + left = BigEndianValue (dst->bounds.left); accel_result = vdriver_accel_rect_fill - (CW (r->rgnBBox.top) - top, CW (r->rgnBBox.left) - left, - CW (r->rgnBBox.bottom) - top, CW (r->rgnBBox.right) - left, + (BigEndianValue (r->rgnBBox.top) - top, BigEndianValue (r->rgnBBox.left) - left, + BigEndianValue (r->rgnBBox.bottom) - top, BigEndianValue (r->rgnBBox.right) - left, xdblt_pattern_value & ROMlib_pixel_size_mask[x->log2_bpp]); if (accel_result != VDRIVER_ACCEL_NO_UPDATE) - note_executor_changed_screen (CW (r->rgnBBox.top) - top, - CW (r->rgnBBox.bottom) - top); + note_executor_changed_screen (BigEndianValue (r->rgnBBox.top) - top, + BigEndianValue (r->rgnBBox.bottom) - top); } else accel_result = VDRIVER_ACCEL_NO_UPDATE; @@ -679,17 +680,17 @@ do_short_narrow_pattern (RgnHandle rh, int mode, uint32 v, PixMap *dst, { int top, left; - top = CW (dst->bounds.top); - left = CW (dst->bounds.left); + top = BigEndianValue (dst->bounds.top); + left = BigEndianValue (dst->bounds.left); accel_result = vdriver_accel_rect_fill - (CW (r->rgnBBox.top) - top, CW (r->rgnBBox.left) - left, - CW (r->rgnBBox.bottom) - top, CW (r->rgnBBox.right) - left, + (BigEndianValue (r->rgnBBox.top) - top, BigEndianValue (r->rgnBBox.left) - left, + BigEndianValue (r->rgnBBox.bottom) - top, BigEndianValue (r->rgnBBox.right) - left, xdblt_pattern_value & ROMlib_pixel_size_mask[log2_bpp]); if (accel_result != VDRIVER_ACCEL_NO_UPDATE) - note_executor_changed_screen (CW (r->rgnBBox.top) - top, - CW (r->rgnBBox.bottom) - top); + note_executor_changed_screen (BigEndianValue (r->rgnBBox.top) - top, + BigEndianValue (r->rgnBBox.bottom) - top); } else accel_result = VDRIVER_ACCEL_NO_UPDATE; @@ -777,7 +778,7 @@ Executor::xdblt_pattern (RgnHandle rh, int mode, rgb_spec = pixmap_rgb_spec (dst); /* Tile fg and bk colors out to 32bpp. */ - log2_bpp = ROMlib_log2[CW (dst->pixelSize)]; + log2_bpp = ROMlib_log2[BigEndianValue (dst->pixelSize)]; mask = ROMlib_pixel_size_mask[log2_bpp]; tile = ROMlib_pixel_tile_scale[log2_bpp]; fg_color = (fg_color & mask) * tile; From 21cd209f5be1c25e6a9f10f4184dd9a68097f7d0 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sat, 9 Aug 2014 14:21:35 -0600 Subject: [PATCH 012/390] Move the preferences/settings to C++ string class. --- OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm | 4 +- src/error.cpp | 5 ++ src/executor.cpp | 4 +- src/include/rsys/error.h | 2 + src/include/rsys/ini.h | 12 +-- src/include/rsys/option.h | 22 +++--- src/include/rsys/parsenum.h | 4 +- src/include/rsys/parseopt.h | 8 +- src/include/rsys/version.h | 2 +- src/ini.cpp | 53 ++++++------- src/main.cpp | 15 ++-- src/option.mm | 85 ++++++++++++--------- src/parsenum.cpp | 9 ++- src/parseopt.cpp | 17 +++-- src/prLowLevel.cpp | 66 +++++++--------- src/version.cpp | 2 +- 16 files changed, 166 insertions(+), 144 deletions(-) diff --git a/OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm b/OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm index 0a7555b6..e0566c2d 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm +++ b/OSX-only/CocoaExecutor/NeXT Classes/NEXT.mm @@ -545,10 +545,10 @@ PRIVATE void pinmouse(INTEGER *hp, INTEGER *vp, BOOLEAN swap) } namespace Executor { - static LONGINT addtoop(char*, INTEGER, char**, char); + static LONGINT addtoop(const char*, INTEGER, char**, char); } -A4(PRIVATE, LONGINT, addtoop, char *, string, INTEGER, size, char **, op, +A4(PRIVATE, LONGINT, addtoop, const char *, string, INTEGER, size, char **, op, char, doit) { if (!doit) diff --git a/src/error.cpp b/src/error.cpp index b2b97d80..39d34419 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -151,6 +151,11 @@ error_parse_option_string (const char *options) return success_p; } +bool +error_parse_option_string (std::string options) +{ + return error_parse_option_string(options.c_str()); +} /* Enables or disables the specified error and returns its old enabledness. */ bool diff --git a/src/executor.cpp b/src/executor.cpp index 3b53c18b..8ea2fe4b 100644 --- a/src/executor.cpp +++ b/src/executor.cpp @@ -212,7 +212,7 @@ trap_break_me (void) } void -trap_dump_bits (char *msg, char *data, int size) +trap_dump_bits (const char *msg, char *data, int size) { int i; @@ -281,7 +281,7 @@ PRIVATE void setup28( void ) PUBLIC void Executor::setupsignals( void ) { -#if defined (MACOSX_) +#if defined (NEXT) LONGINT tocatch[] = { SIGHUP, SIGINT, diff --git a/src/include/rsys/error.h b/src/include/rsys/error.h index eedf263f..9637dd31 100644 --- a/src/include/rsys/error.h +++ b/src/include/rsys/error.h @@ -14,6 +14,8 @@ #include "rsys/noreturn.h" #ifdef __cplusplus +#include +bool error_parse_option_string (std::string options); extern "C" { #endif /* diff --git a/src/include/rsys/ini.h b/src/include/rsys/ini.h index b4ea7b49..4ef1c773 100644 --- a/src/include/rsys/ini.h +++ b/src/include/rsys/ini.h @@ -7,18 +7,20 @@ * * $Id: ini.h 87 2005-05-25 01:57:33Z ctm $ */ + +#include + namespace Executor { -typedef char *heading_t; -typedef char *ini_key_t; -typedef char *value_t; +typedef std::string heading_t; +typedef std::string ini_key_t; +typedef std::string value_t; typedef struct pair_link_str { struct pair_link_str *next; ini_key_t key; value_t value; -} -pair_link_t; +} pair_link_t; extern char *ROMlib_PrintersIni; extern char *ROMlib_PrintDef; diff --git a/src/include/rsys/option.h b/src/include/rsys/option.h index 76f11813..7db3c99b 100644 --- a/src/include/rsys/option.h +++ b/src/include/rsys/option.h @@ -20,10 +20,10 @@ typedef enum option_kind typedef struct option { /* text of the option. does not include the `-' prefix */ - char *text; + std::string text; /* description of the option */ - char *desc; + std::string desc; /* kind of argument */ option_kind_t kind; @@ -39,7 +39,7 @@ typedef struct option #endif /* value of option if it is specified with no argument */ - char *opt_val; + std::string opt_val; } option_t; typedef enum priority @@ -54,14 +54,14 @@ typedef enum priority typedef struct opt_val { - char *text; + std::string text; /* temporary value (ie., those specified in by an application specific configuration file */ - char *t_val; + std::string t_val; priority_t t_pri; - const char *val; + std::string val; priority_t pri; } opt_val_t; @@ -79,7 +79,7 @@ extern opt_database_t *common_db; void opt_init (void); void opt_shutdown (void); -void opt_register (char *new_interface, option_t *opts, int n_opts); +void opt_register (std::string new_interface, option_t *opts, int n_opts); /* provide a function to parse specified arguments */ opt_database_t *opt_alloc_db (void); @@ -87,14 +87,14 @@ int opt_parse (opt_database_t *db, option_t *opts, int n_opts, int *argc, char *argv[]); /* returns TRUE if options was specified */ -int opt_int_val (opt_database_t *db, char *opt, int *retval, +int opt_int_val (opt_database_t *db, std::string opt, int *retval, boolean_t *parse_error_p); -int opt_val (opt_database_t *db, char *opt, const char **retval); -void opt_put_val (opt_database_t *db, char *opt, const char *value, +int opt_val (opt_database_t *db, std::string opt, std::string *retval); +void opt_put_val (opt_database_t *db, std::string &opt, std::string value, priority_t pri, int temp_val_p); -void opt_put_int_val (opt_database_t *db, char *opt, int value, +void opt_put_int_val (opt_database_t *db, std::string &opt, int value, priority_t pri, int temp_val_p); diff --git a/src/include/rsys/parsenum.h b/src/include/rsys/parsenum.h index e4cd59e8..632969fa 100644 --- a/src/include/rsys/parsenum.h +++ b/src/include/rsys/parsenum.h @@ -2,7 +2,7 @@ #define _RSYS_PARSENUM_H_ namespace Executor { -extern boolean_t parse_number (const char *orig_num, int32 *val, - unsigned round_up_to_multiple_of); +extern boolean_t parse_number (std::string orig_num, int32 *val, + unsigned round_up_to_multiple_of); } #endif /* !_RSYS_PARSENUM_H_ */ diff --git a/src/include/rsys/parseopt.h b/src/include/rsys/parseopt.h index 8882afc1..ce000b8d 100644 --- a/src/include/rsys/parseopt.h +++ b/src/include/rsys/parseopt.h @@ -1,11 +1,11 @@ #if !defined (_RSYS_PARSEOPT_H_) #define _RSYS_PARSEOPT_H_ namespace Executor { -extern boolean_t parse_system_version (const char *vers); -extern boolean_t parse_size_opt (const char *opt, const char *arg); +extern boolean_t parse_system_version (std::string vers); + extern boolean_t parse_size_opt (std::string opt, std::string arg); extern boolean_t parse_prres_opt (Executor::INTEGER *outx, Executor::INTEGER *outy, - const char *arg); -extern boolean_t ROMlib_parse_version (const char *vers, uint32 *version_out); + std::string arg); +extern boolean_t ROMlib_parse_version (std::string vers, uint32 *version_out); #define CREATE_SYSTEM_VERSION(a, b, c) \ diff --git a/src/include/rsys/version.h b/src/include/rsys/version.h index 1fa8b98d..507eb006 100644 --- a/src/include/rsys/version.h +++ b/src/include/rsys/version.h @@ -26,7 +26,7 @@ extern "C" { #define MINOR_REVISION 1 extern const char ROMlib_executor_version[]; -extern char *ROMlib_executor_full_name; +extern const char *ROMlib_executor_full_name; #define PLATFORM_MOD 10 /* last decimal digit of serial number is platform */ #define COMPOSITE_MOD 100 /* 2nd to last digit is price class */ diff --git a/src/ini.cpp b/src/ini.cpp index 8c7c9310..35d69e62 100644 --- a/src/ini.cpp +++ b/src/ini.cpp @@ -38,16 +38,17 @@ Executor::new_heading (unsigned char *start, int len) linkp = (heading_link_t*)malloc (sizeof *linkp); if (!linkp) - retval = NULL; + retval = ""; else { - linkp->heading = (heading_t)malloc (len + 1); - if (!linkp->heading) { - retval = NULL; + char *p = (char*)alloca(len + 1); + if (!p) { + retval = ""; free (linkp); } else { - strncpy (linkp->heading, (char *) start, len); - linkp->heading[len] = 0; - linkp->next = headings; + strncpy (p, (char *) start, len); + p[len] = 0; + linkp->heading = p; + linkp->next = headings; linkp->pairs = 0; headings = linkp; retval = linkp->heading; @@ -63,11 +64,11 @@ find_heading (heading_t heading) static heading_link_t *cachep; heading_link_t *retval; - if (cachep && strcmp (cachep->heading, heading) == 0) + if (cachep && cachep->heading == heading) retval = cachep; else { for (retval = headings; - retval && strcmp (retval->heading, heading) != 0; + retval && retval->heading != heading; retval = retval->next) ; if (retval) @@ -82,27 +83,27 @@ Executor::new_key_value_pair (heading_t heading, unsigned char *keystart, int ke { pair_link_t *pairp = (pair_link_t*)malloc (sizeof *pairp); if (pairp) { - pairp->key = (ini_key_t)malloc (keylen+1); - if (!pairp->key) + char *keyp; + keyp = (char *)alloca(keylen + 1); + if (!keyp) free (pairp); else { - pairp->value = (value_t)malloc (valuelen+1); - if (!pairp->value) { - free (pairp->key); + char *valueP = (char*)alloca(valuelen + 1); + if (!valueP) { free (pairp); } else { heading_link_t *headingp; - strncpy (pairp->key, (char *) keystart, keylen); - pairp->key[keylen] = 0; - strncpy (pairp->value, (char *) valuestart, valuelen); - pairp->value[valuelen] = 0; + strncpy (keyp, (char *) keystart, keylen); + keyp[keylen] = 0; + pairp->value = keyp; + strncpy (valueP, (char *) valuestart, valuelen); + valueP[valuelen] = 0; + pairp->value = valueP; headingp = find_heading (heading); pairp->next = 0; if (!headingp) { - warning_unexpected ("couldn't find %s", heading); - free (pairp->key); - free (pairp->value); + warning_unexpected ("couldn't find %s", heading.c_str()); free (pairp); } else { pair_link_t **pairpp; @@ -240,7 +241,7 @@ Executor::add_heading_to_file (FILE *fp, heading_t heading) { boolean_t retval; - retval = fprintf (fp, "[%s]\n", heading) > 0; + retval = fprintf (fp, "[%s]\n", heading.c_str()) > 0; return retval; } @@ -249,7 +250,7 @@ Executor::add_key_value_to_file (FILE *fp, ini_key_t key, value_t value) { boolean_t retval; - retval = fprintf (fp, "%s=%s\n", key, value) > 0; + retval = fprintf (fp, "%s=%s\n", key.c_str(), value.c_str()) > 0; return retval; } @@ -268,14 +269,14 @@ Executor::find_key (heading_t heading, ini_key_t key) value_t retval; heading_link_t *headingp; - retval = NULL; - if (heading && key) { + retval = ""; + if (heading != "" && key != "") { headingp = find_heading (heading); if (headingp) { pair_link_t *pairp; for (pairp = headingp->pairs; - pairp && strcmp (pairp->key, key) != 0; + pairp && pairp->key != key; pairp = pairp->next) ; if (pairp) diff --git a/src/main.cpp b/src/main.cpp index 5e7b174a..05cda4ab 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -135,6 +135,7 @@ char ROMlib_rcsid_main[] = using namespace Executor; using namespace ByteSwap; +using namespace std; BOOLEAN Executor::force_big_offset = CONFIG_OFFSET_P; @@ -1301,7 +1302,7 @@ int main(int argc, char** argv) vdriver_opt_register, NULL, }; - const char *arg; + string arg; #if defined(PERSONALITY_HACK) int pers; @@ -1747,7 +1748,7 @@ int main(int argc, char** argv) #endif { - const char *str; + string str; if (opt_val (common_db, "prvers", &str)) { @@ -2003,17 +2004,17 @@ int main(int argc, char** argv) #endif { - const char *appearance_str; + string appearance_str; if (opt_val (common_db, "appearance", &appearance_str)) - bad_arg_p |= !ROMlib_parse_appearance (appearance_str); + bad_arg_p |= !ROMlib_parse_appearance (appearance_str.c_str()); } InitResources (); /* parse the `-system' option */ { - const char *system_str; + string system_str; if (opt_val (common_db, "system", &system_str)) bad_arg_p |= !parse_system_version (system_str); @@ -2034,9 +2035,9 @@ int main(int argc, char** argv) if (opt_val (common_db, "keyboard", &arg)) { - keyboard_set_failed = !ROMlib_set_keyboard (arg); + keyboard_set_failed = !ROMlib_set_keyboard (arg.c_str()); if (keyboard_set_failed) - printf ("``%s'' is not an available keyboard\n", arg); + printf ("``%s'' is not an available keyboard\n", arg.c_str()); } else keyboard_set_failed = FALSE; diff --git a/src/option.mm b/src/option.mm index 644dc85c..8ef1974d 100644 --- a/src/option.mm +++ b/src/option.mm @@ -22,10 +22,11 @@ #import using namespace Executor; +using namespace std; struct opt_block { - char *interface; + string interface; option_t *opts; int n_opts; } *opt_blocks; @@ -72,7 +73,7 @@ } } -void +static void strcpy_to_wrap_buf (char *text) { int text_len; @@ -95,6 +96,14 @@ *dst = '\0'; } +static inline void +strcpy_to_wrap_buf (string text) +{ + char *textP = (char *)alloca(text.length() + 10); + strcpy(textP, text.c_str()); + strcpy_to_wrap_buf(textP); +} + static void wrap (char *buf, int desired_len, @@ -165,6 +174,12 @@ } } +void +send_to_help_buf (string text, int append_newline_p) +{ + send_to_help_buf(text.c_str(), text.length(), append_newline_p); +} + void _generate_help_message (void) { @@ -190,12 +205,12 @@ send_to_help_buf ("", 0, TRUE); for (block_i = 0; block_i < n_opt_blocks; block_i ++) { - char *interface = opt_blocks[block_i].interface; + string interface = opt_blocks[block_i].interface; option_t *opts = opt_blocks[block_i].opts; int n_opts = opt_blocks[block_i].n_opts; int opt_i; - send_to_help_buf (interface, strlen (interface), FALSE); + send_to_help_buf (interface, FALSE); send_to_help_buf (":", 1, TRUE); for (opt_i = 0; opt_i < n_opts; opt_i ++) @@ -207,14 +222,14 @@ int opt_text_len; int same_line_p; - if (!opt->desc) + if (opt->desc == "") continue; - opt_text_len = strlen (opt->text); + opt_text_len = opt->text.length(); same_line_p = opt_text_len < 14; send_to_help_buf (" -", 3, FALSE); - send_to_help_buf (opt->text, opt_text_len, + send_to_help_buf (opt->text, !same_line_p); if (same_line_p) send_to_help_buf (spaces, @@ -270,7 +285,7 @@ void -Executor::opt_register (char *new_interface, +Executor::opt_register (string new_interface, option_t *new_opts, int n_new_opts) { int block_i; @@ -289,7 +304,7 @@ /* check for conflicting options */ for (block_i = 0; block_i < n_opt_blocks; block_i ++) { - char *interface = opt_blocks[block_i].interface; + string interface = opt_blocks[block_i].interface; option_t *opts = opt_blocks[block_i].opts; int n_opts = opt_blocks[block_i].n_opts; int opt_i, new_opt_i; @@ -297,14 +312,14 @@ for (opt_i = 0; opt_i < n_opts; opt_i ++) for (new_opt_i = 0; new_opt_i < n_new_opts; new_opt_i ++) { - if (!strcmp (opts[opt_i].text, + if ( (opts[opt_i].text == new_opts[new_opt_i].text)) { /* conflicting options */ fprintf (ERRMSG_STREAM, "\ %s: opt internal error: `%s' and `%s' both request option `%s'\n", program_name, - interface, new_interface, opts[opt_i].text); + interface.c_str(), new_interface.c_str(), opts[opt_i].text.c_str()); exit (-16); } } @@ -343,7 +358,7 @@ } PRIVATE opt_val_t * -opt_lookup_helper (opt_database_t *db, char *opt) +opt_lookup_helper (opt_database_t *db, string &opt) { opt_val_t *retval; int i; @@ -353,7 +368,7 @@ /* try to find this option in the database */ for (i = 0; i < db->n_opt_vals; i ++) { - if (strcmp (db->opt_vals[i].text, opt) == 0) + if (db->opt_vals[i].text == opt) { retval = &db->opt_vals[i]; break; @@ -363,19 +378,19 @@ } opt_val_t * -opt_lookup (opt_database_t *db, char *opt) +opt_lookup (opt_database_t *db, string &opt) { opt_val_t *retval; retval = opt_lookup_helper (db, opt); - if (!retval || !retval->t_val) + if (!retval || retval->t_val == "") { NSUserDefaults *defaults; NSString *try1; defaults = [NSUserDefaults standardUserDefaults]; - try1 = [defaults stringForKey:@(opt)]; + try1 = [defaults stringForKey:@(opt.c_str())]; if (try1) { if (retval) { @@ -399,7 +414,7 @@ } void -Executor::opt_put_val (opt_database_t *db, char *opt, const char *val, +Executor::opt_put_val (opt_database_t *db, string &opt, string val, priority_t pri, int temp_val_p) { opt_val_t *opt_val; @@ -426,13 +441,13 @@ opt_val = &db->opt_vals[db->n_opt_vals ++]; opt_val->text = opt; - opt_val->val = NULL; - opt_val->t_val = NULL; + opt_val->val = ""; + opt_val->t_val = ""; } if (temp_val_p) { - opt_val->t_val = (char*)val; + opt_val->t_val = val; opt_val->t_pri = pri; } else @@ -443,7 +458,7 @@ } void -Executor::opt_put_int_val (opt_database_t *db, char *opt, int valint, +Executor::opt_put_int_val (opt_database_t *db, string &opt, int valint, priority_t pri, int temp_val_p) { char *val, buf[256]; @@ -455,20 +470,20 @@ opt_put_val (db, opt, val, pri, temp_val_p); } -#define option_value(opt_val) ((opt_val)->t_val ?: (opt_val)->val) +#define option_value(opt_val) ((opt_val)->t_val == "" ? "" : (opt_val)->val) int -Executor::opt_val (opt_database_t *db, char *opt, const char **retval) +Executor::opt_val (opt_database_t *db, string opt, string *retval) { opt_val_t *opt_val; - const char *val = NULL; + string val = ""; boolean_t found_p = FALSE; opt_val = opt_lookup (db, opt); if (opt_val) { val = option_value (opt_val); - if (val) + if (val != "") { if (retval) *retval = val; @@ -485,21 +500,21 @@ * Returns TRUE if a value was found. */ int -Executor::opt_int_val (opt_database_t *db, char *opt, int *retval, +Executor::opt_int_val (opt_database_t *db, string opt, int *retval, boolean_t *parse_error_p) { opt_val_t *opt_val; - const char *val = NULL; + string val = ""; opt_val = opt_lookup (db, opt); - if (opt_val && (val = option_value (opt_val)) && retval) + if (opt_val && (val = option_value (opt_val)) != "" && retval) { int32 v; if (!parse_number (val, &v, 1)) { if (parse_error_p) { - fprintf (stderr, "Malformed numeric argument to -%s.\n", opt); + fprintf (stderr, "Malformed numeric argument to -%s.\n", opt.c_str()); *parse_error_p = TRUE; } return FALSE; @@ -509,7 +524,7 @@ /* Do *NOT* touch *parse_error_p if there is no error. */ - return opt_val && val; + return opt_val && val != ""; } int @@ -543,9 +558,9 @@ option_t *opt = &opts[opt_i]; if (!strcmp (&arg[1], - opt->text)) + opt->text.c_str())) { - const char *optval = NULL; + string optval = ""; /* found the option */ switch (opt->kind) @@ -563,7 +578,7 @@ optval = opt->opt_val; break; case opt_sticky: - optval = &arg[1 + strlen (opt->text)]; + optval = &arg[1 + opt->text.length()]; break; case opt_sep: if ((i + 1) < *argc) @@ -575,7 +590,7 @@ { fprintf (ERRMSG_STREAM, "\ %s: option `-%s' requires argument\n", - program_name, opt->text); + program_name, opt->text.c_str()); parse_error_p = TRUE; } break; @@ -591,7 +606,7 @@ { fprintf (ERRMSG_STREAM, "\ %s: option `-%s' requires argument\n", - program_name, opt->text); + program_name, opt->text.c_str()); parse_error_p = TRUE; } goto next_arg; diff --git a/src/parsenum.cpp b/src/parsenum.cpp index 31b53ac2..2f7160dd 100644 --- a/src/parsenum.cpp +++ b/src/parsenum.cpp @@ -12,6 +12,7 @@ char ROMlib_rcsid_parsenum[] = #include using namespace Executor; +using namespace std; /* If the given string has a 'k', 'K', 'm', or 'M' suffix, returns the * log base 2 corresponding to that size (either 10 or 20) and removes @@ -128,7 +129,7 @@ parse_base_number (const char *s, const char *digits, long long *vp, * want rounding, just pass "1" for round_up_to_multiple_of. */ boolean_t -Executor::parse_number (const char *orig_num, int32 *val, +Executor::parse_number (string orig_num, int32 *val, unsigned round_up_to_multiple_of) { long long orig_raw_val, raw_val, div; @@ -141,11 +142,11 @@ Executor::parse_number (const char *orig_num, int32 *val, *val = 0; /* Empty string is an error. We check this here to simplify checks later. */ - if (orig_num == NULL || orig_num[0] == '\0') + if (orig_num == "" || orig_num[0] == '\0') return FALSE; - num = (char *) alloca (strlen (orig_num) + 1); - strcpy (num, orig_num); + num = (char *) alloca (orig_num.length() + 1); + strcpy (num, orig_num.c_str()); /* Check for leading + or -, and advance past it. */ negate_p = (num[0] == '-'); diff --git a/src/parseopt.cpp b/src/parseopt.cpp index 135d7b58..f58a0f54 100644 --- a/src/parseopt.cpp +++ b/src/parseopt.cpp @@ -19,6 +19,7 @@ char ROMlib_rcsid_parseopt[] = #include using namespace Executor; +using namespace std; /* Parse version e.g. "executor -system 7.0.2". Omitted * digits will be zero, so "executor -system 7" is equivalent to @@ -26,7 +27,7 @@ using namespace Executor; */ boolean_t -Executor::ROMlib_parse_version (const char *vers, uint32 *version_out) +Executor::ROMlib_parse_version (string vers, uint32 *version_out) { boolean_t success_p; int major_version, minor_version, teeny_version; @@ -34,8 +35,8 @@ Executor::ROMlib_parse_version (const char *vers, uint32 *version_out) char *temp_str, *system_str; /* Copy the version to a temp string we can manipulate. */ - system_str = (char *) alloca (strlen (vers) + 1); - strcpy (system_str, vers); + system_str = (char *) alloca (vers.length() + 1); + strcpy (system_str, vers.c_str()); major_str = system_str; @@ -80,7 +81,7 @@ Executor::ROMlib_parse_version (const char *vers, uint32 *version_out) * "executor -system 7.0.0". Returns TRUE on success, else FALSE. */ boolean_t -Executor::parse_system_version (const char *vers) +Executor::parse_system_version (string vers) { boolean_t retval; @@ -100,10 +101,11 @@ Executor::parse_system_version (const char *vers) * on parse error. */ boolean_t -Executor::parse_size_opt (const char *opt, const char *arg) +Executor::parse_size_opt (string opt, string arg1) { boolean_t success_p; int w, h; + const char *arg = arg1.c_str(); w = h = 0; if (arg != NULL) @@ -135,7 +137,7 @@ Executor::parse_size_opt (const char *opt, const char *arg) if (w == 0 || h == 0) { fprintf (stderr, "Invalid screen size. Use something like " - "\"-%s 640x480\".\n", opt); + "\"-%s 640x480\".\n", opt.c_str()); success_p = FALSE; } else if (w < VDRIVER_MIN_SCREEN_WIDTH || h < VDRIVER_MIN_SCREEN_HEIGHT) @@ -159,10 +161,11 @@ Executor::parse_size_opt (const char *opt, const char *arg) */ PUBLIC boolean_t -Executor::parse_prres_opt (INTEGER *outx, INTEGER *outy, const char *arg) +Executor::parse_prres_opt (INTEGER *outx, INTEGER *outy, string arg1) { boolean_t retval; INTEGER x, y, *p; + const char *arg = arg1.c_str(); x = 0; y = 0; diff --git a/src/prLowLevel.cpp b/src/prLowLevel.cpp index bbfd7c08..baa4af1c 100644 --- a/src/prLowLevel.cpp +++ b/src/prLowLevel.cpp @@ -223,14 +223,14 @@ update_orientation (DialogPtr dp, INTEGER button) switch (button) { case LAYOUT_LANDSCAPE_ICON_NO: - if (strcmp (ROMlib_paper_orientation, "Landscape") != 0) + if (ROMlib_paper_orientation != "Landscape") { ROMlib_paper_orientation = "Landscape"; add_orientation_icons_to_update_region (dp); } break; case LAYOUT_PORTRAIT_ICON_NO: - if (strcmp (ROMlib_paper_orientation, "Portrait") != 0) + if (ROMlib_paper_orientation != "Portrait") { ROMlib_paper_orientation = "Portrait"; add_orientation_icons_to_update_region (dp); @@ -307,17 +307,17 @@ Executor::update_printing_globals (void) ROMlib_paper_x = 612; ROMlib_paper_y = 792; dimensions = find_key ("Paper Size", ROMlib_paper); - if (dimensions) - sscanf (dimensions, "%d %d", &ROMlib_paper_x, &ROMlib_paper_y); + if (dimensions != "") + sscanf (dimensions.c_str(), "%d %d", &ROMlib_paper_x, &ROMlib_paper_y); } - if ((strcmp (ROMlib_paper_orientation, "Portrait") == 0) == + if ((ROMlib_paper_orientation == "Portrait") == (ROMlib_paper_x > ROMlib_paper_y)) SWAP (ROMlib_paper_x, ROMlib_paper_y); ROMlib_document_paper_sizes = "%%DocumentPaperSizes: "; ROMlib_paper_size = "%%PaperSize: "; - ROMlib_paper_size_name = ROMlib_paper; + ROMlib_paper_size_name = ROMlib_paper.c_str(); ROMlib_paper_size_name_terminator = "\n"; if (ROMlib_paper_x < ROMlib_paper_y) @@ -337,21 +337,15 @@ Executor::update_printing_globals (void) PRIVATE void update_ROMlib_printer_vars (TPPrDlg dp) { - if (ROMlib_printer) - free (ROMlib_printer); ROMlib_printer = find_item_key ((DialogPtr) dp, LAYOUT_PRINTER_TYPE_NO); - if (ROMlib_paper) - free (ROMlib_paper); ROMlib_paper = find_item_key ((DialogPtr) dp, LAYOUT_PAPER_NO); - if (ROMlib_port) - free (ROMlib_port); ROMlib_port = find_item_key ((DialogPtr) dp, LAYOUT_PORT_MENU_NO); ROMlib_set_default_resolution (MR (dp->hPrintUsr), 72, 72); - if (strcmp (ROMlib_printer, "PostScript File") == 0) + if (ROMlib_printer == "PostScript File") { Handle h; Size hs; @@ -376,16 +370,16 @@ update_ROMlib_printer_vars (TPPrDlg dp) if (fp) { add_heading_to_file (fp, "Defaults"); - if (ROMlib_printer) + if (ROMlib_printer != "") add_key_value_to_file (fp, "Printer", ROMlib_printer); - if (ROMlib_paper) + if (ROMlib_paper != "") add_key_value_to_file (fp, "Paper Size", ROMlib_paper); - if (ROMlib_port) + if (ROMlib_port != "") add_key_value_to_file (fp, "Port", ROMlib_port); - if (ROMlib_paper_orientation) + if (ROMlib_paper_orientation != "") add_key_value_to_file (fp, "Orientation", ROMlib_paper_orientation); close_ini_file (fp); @@ -428,7 +422,7 @@ update_port (DialogPtr dp) gp = thePort; SetPort (dp); - keyp = find_item_key (dp, LAYOUT_PRINTER_TYPE_NO); + keyp = strdup(find_item_key (dp, LAYOUT_PRINTER_TYPE_NO).c_str()); if (strcmp (keyp, "PostScript File") == 0) { if (print_where != PRINT_TO_FILE) @@ -447,7 +441,7 @@ update_port (DialogPtr dp) { Str255 str; - unique_file_name (ROMlib_spool_template, "execout*.ps", str); + unique_file_name (ROMlib_spool_template.c_str(), "execout*.ps", str); SetIText (GetDIText (dp, LAYOUT_FILENAME_NO), str); filename_chosen_p = TRUE; } @@ -637,7 +631,7 @@ P3(PUBLIC, pascal BOOLEAN, ROMlib_stlfilterproc, DialogPeek, dp, break; } - keyp = find_item_key ((DialogPtr) dp, LAYOUT_PRINTER_TYPE_NO); + keyp = strdup(find_item_key ((DialogPtr) dp, LAYOUT_PRINTER_TYPE_NO).c_str()); if (retval && *ith == CWC (OK) && (strcmp (keyp, "PostScript File") == 0)) { struct stat sbuf; @@ -736,12 +730,10 @@ adjust_print_range_controls (TPPrDlg dlg, THPrint hPrint) PRIVATE ini_key_t get_default_key (ini_key_t key, ini_key_t default_if_not_found) { - ini_key_t retval; - - retval = find_key ("Defaults", key); + ini_key_t retval = find_key ("Defaults", key); /* Verify that the default is legitimate */ - if (!find_key (key, retval)) + if (find_key (key, retval) == "") { pair_link_t *pairp; @@ -749,7 +741,7 @@ get_default_key (ini_key_t key, ini_key_t default_if_not_found) if (pairp) retval = pairp->key; } - if (!retval) + if (retval == "") retval = default_if_not_found; return retval; } @@ -788,12 +780,12 @@ get_all_defaults (void) int i; for (i = 0; i < (int) NELEM (default_table); ++i) - if (!*default_table[i].variablep) + if (*default_table[i].variablep == "") *default_table[i].variablep = get_default_key (default_table[i].key, default_table[i].default_key); ROMlib_spool_template = find_key ("Printer", "PostScript File"); - if (!ROMlib_spool_template) + if (ROMlib_spool_template == "") ROMlib_spool_template = "+/execout*.ps"; } @@ -806,14 +798,14 @@ adjust_print_name (DialogPtr dp) { Str255 str; - unique_file_name (ROMlib_spool_template, "execout*.ps", str); + unique_file_name (ROMlib_spool_template.c_str(), "execout*.ps", str); ROMlib_spool_file = cstring_from_str255 (str); } - if (strcmp (ROMlib_printer, "PostScript File") == 0) + if (ROMlib_printer == "PostScript File") str255assignc (name, ROMlib_spool_file); else - str255assignc (name, ROMlib_printer); + str255assignc (name, ROMlib_printer.c_str()); SetIText (GetDIText (dp, 3), name); } @@ -876,7 +868,7 @@ P2(PUBLIC, pascal void, ROMlib_orientation, DialogPeek, dp, INTEGER, which) PenSize (1, 1); InsetRect (&r, 1, 1); if ((which == LAYOUT_PORTRAIT_NO) != - (strcmp (ROMlib_paper_orientation, "Portrait") == 0)) + (ROMlib_paper_orientation == "Portrait")) PenPat (white); FrameRect (&r); PenPat (black); @@ -949,9 +941,9 @@ adjust_menu_common (TPPrDlg dlg, INTEGER item, heading_t heading, ini_key_t defk continue; #endif - if (strcmp (pairp->key, defkey) == 0) + if (pairp->key == defkey) default_index = i; - str255assignc (str, pairp->key); + str255assignc (str, pairp->key.c_str()); AppendMenu (mh, str); wid = StringWidth (str); if (wid > max_wid) @@ -1012,8 +1004,8 @@ set_default_orientation (TPPrDlg dlg) INTEGER orientation_button; orientation_button = - (ROMlib_paper_orientation && - strcmp (ROMlib_paper_orientation, "Landscape") == 0) + (ROMlib_paper_orientation != "" && + ROMlib_paper_orientation == "Landscape") ? LAYOUT_LANDSCAPE_ICON_NO : @@ -1171,7 +1163,7 @@ P2(PUBLIC pascal trap, BOOLEAN, PrDlgMain, THPrint, hPrint, ProcPtr, initfptr) if ((prrecptr = CALLPRINITPROC(hPrint, initfptr))) { if (!SUNPATH_HACK || (((pritemprocp) MR(prrecptr->pItemProc) != (pritemprocp) P_ROMlib_myjobproc) || - strcmp (ROMlib_printer, WIN32_TOKEN) != 0)) + ROMlib_printer != std::string(WIN32_TOKEN))) { ShowWindow((WindowPtr) prrecptr); SelectWindow((WindowPtr) prrecptr); @@ -1179,7 +1171,7 @@ P2(PUBLIC pascal trap, BOOLEAN, PrDlgMain, THPrint, hPrint, ProcPtr, initfptr) do { if (SUNPATH_HACK && (((pritemprocp) MR(prrecptr->pItemProc) == (pritemprocp) P_ROMlib_myjobproc) && - strcmp (ROMlib_printer, WIN32_TOKEN) == 0)) + ROMlib_printer == std::string(WIN32_TOKEN))) item = 1; else { diff --git a/src/version.cpp b/src/version.cpp index 4dd32269..1056d579 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -22,7 +22,7 @@ using namespace ByteSwap; const char ROMlib_executor_version[] = EXECUTOR_VERSION; /* A descriptive string like "Executor 1.99q DEMO" */ -char *ROMlib_executor_full_name = "Executor " EXECUTOR_VERSION +const char *ROMlib_executor_full_name = "Executor " EXECUTOR_VERSION #if defined (RELEASE_DEMO) " DEMO" #elif defined (RELEASE_INTERNAL) From 3ba51325923f63ea92e3ddee80cc1e0bd9d931c4 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sat, 9 Aug 2014 14:31:30 -0600 Subject: [PATCH 013/390] =?UTF-8?q?Use=20Clang=E2=80=99s=20built-in=20Pasc?= =?UTF-8?q?al=20string=20generation=20to=20generate=20more=20Pascal=20stri?= =?UTF-8?q?ngs.=20Fix=20integer=20casts=20for=20lseek,=20so=20the=20value?= =?UTF-8?q?=20is=20properly=20byte-swapped.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fileAccess.cpp | 14 +++++++------- src/fileInfo.cpp | 2 +- src/icon.cpp | 18 +++++++++--------- src/include/rsys/common.h | 10 +++++----- src/include/rsys/file.h | 39 +++++++++++++++++++++------------------ src/launch.cpp | 2 +- 6 files changed, 44 insertions(+), 41 deletions(-) diff --git a/src/fileAccess.cpp b/src/fileAccess.cpp index f51f5690..371cf2c7 100644 --- a/src/fileAccess.cpp +++ b/src/fileAccess.cpp @@ -1435,7 +1435,7 @@ pbsetfpos (ParmBlkPtr pb, boolean_t can_go_past_eof) forkoffset = FORKOFFSET(fp); err = pbfpos(pb, &toseek, can_go_past_eof); fd = fp->fcfd; - pb->ioParam.ioPosOffset = BigEndianValue(lseek(fd, toseek, L_SET) - forkoffset); + pb->ioParam.ioPosOffset = BigEndianValue((int)(lseek(fd, toseek, L_SET) - forkoffset)); } fs_err_hook (err); return err; @@ -1519,8 +1519,8 @@ A2(PUBLIC, OSErr, ufsPBRead, ParmBlkPtr, pb, BOOLEAN, a) /* INTERNAL */ err = ioErr; } else { pb->ioParam.ioActCount = BigEndianValue(nread); - pb->ioParam.ioPosOffset = BigEndianValue(lseek(fd, 0L, L_INCR) - - forkoffset); + pb->ioParam.ioPosOffset = BigEndianValue((int)(lseek(fd, 0L, L_INCR) - + forkoffset)); if (rc != Cx(pb->ioParam.ioReqCount)) err = eofErr; } @@ -1578,8 +1578,8 @@ A2(PUBLIC, OSErr, ufsPBWrite, ParmBlkPtr, pb, BOOLEAN, a) /* INTERNAL */ } else { err = noErr; pb->ioParam.ioActCount = BigEndianValue(nwrite); - pb->ioParam.ioPosOffset = BigEndianValue(lseek(fd, 0L, L_INCR) - - forkoffset); + pb->ioParam.ioPosOffset = BigEndianValue((int)(lseek(fd, 0L, L_INCR) - + forkoffset)); if (Cx(pb->ioParam.ioPosOffset) > Cx(fp->fcleof)) { fp->fcleof = pb->ioParam.ioPosOffset; err = ROMlib_seteof(fp); @@ -1607,8 +1607,8 @@ A2(PUBLIC, OSErr, ufsPBGetFPos, ParmBlkPtr, pb, /* INTERNAL */ fp = PRNTOFPERR(Cx(pb->ioParam.ioRefNum), &err); if (err == noErr) { forkoffset = FORKOFFSET(fp); - pb->ioParam.ioPosOffset = BigEndianValue(lseek(fp->fcfd, 0L, L_INCR) - - forkoffset); + pb->ioParam.ioPosOffset = BigEndianValue((int)(lseek(fp->fcfd, 0L, L_INCR) - + forkoffset)); pb->ioParam.ioReqCount = pb->ioParam.ioActCount = pb->ioParam.ioPosMode = 0; } diff --git a/src/fileInfo.cpp b/src/fileInfo.cpp index f7e1c285..7d95ec26 100644 --- a/src/fileInfo.cpp +++ b/src/fileInfo.cpp @@ -484,7 +484,7 @@ A5(PUBLIC, OSErr, ROMlib_PBGetSetFInfoD, ParmBlkPtr, pb, /* INTERNAL */ pb->fileParam.ioFlFndrInfo.fdType = BigEndianValue (type); } } - pb->fileParam.ioFlLgLen = BigEndianValue(datasbuf.st_size); + pb->fileParam.ioFlLgLen = BigEndianValue((int)datasbuf.st_size); pb->fileParam.ioFlRLgLen = 0; pb->fileParam.ioFlCrDat = BigEndianValue(UNIXTIMETOMACTIME(datasbuf.st_ctime)); diff --git a/src/icon.cpp b/src/icon.cpp index f6b9ac8f..39899f8a 100644 --- a/src/icon.cpp +++ b/src/icon.cpp @@ -626,20 +626,20 @@ P2 (PUBLIC pascal trap, OSErr, SetSuiteLabel, typedef struct { - RGBColor rgb_color; - char *string; + RGBColor rgb_color; + Str255 string; } label_info_t; PRIVATE label_info_t labels[7] = { - { { 0, 0, 0,}, "\011Essential", }, - { { 0, 0, 0,}, "\003Hot", }, - { { 0, 0, 0,}, "\013In Progress", }, - { { 0, 0, 0,}, "\004Cool", }, - { { 0, 0, 0,}, "\010Personal", }, - { { 0, 0, 0,}, "\011Project 1", }, - { { 0, 0, 0,}, "\011Project 2", }, + { { 0, 0, 0,}, "\pEssential", }, + { { 0, 0, 0,}, "\pHot", }, + { { 0, 0, 0,}, "\pIn Progress", }, + { { 0, 0, 0,}, "\pCool", }, + { { 0, 0, 0,}, "\pPersonal", }, + { { 0, 0, 0,}, "\pProject 1", }, + { { 0, 0, 0,}, "\pProject 2", }, }; P3 (PUBLIC pascal trap, OSErr, GetLabel, diff --git a/src/include/rsys/common.h b/src/include/rsys/common.h index 3c447a2c..28c3f715 100644 --- a/src/include/rsys/common.h +++ b/src/include/rsys/common.h @@ -85,11 +85,11 @@ T BigEndianValue(T value) return value; } - template < typename T > - void BigEndianInPlace(T &value) - { - sized_byteswap< sizeof(T) >(reinterpret_cast(&value)); - } +template < typename T > +void BigEndianInPlace(T &value) +{ + sized_byteswap< sizeof(T) >(reinterpret_cast(&value)); +} } namespace Executor { #endif diff --git a/src/include/rsys/file.h b/src/include/rsys/file.h index 8b30b4b1..373804d9 100644 --- a/src/include/rsys/file.h +++ b/src/include/rsys/file.h @@ -24,14 +24,24 @@ extern char *copystr (const char *name); #define SYSMACNAME "\006System" namespace Executor { -typedef struct PACKED { + +typedef struct hashlink_str { + struct hashlink_str *next; + LONGINT dirid; + LONGINT parid; + char *dirname; +} hashlink_t; + +#pragma pack(push, 2) + +typedef struct { LONGINT fd; LONGINT offset; LONGINT bsize; LONGINT maxbytes; } hfs_access_t; -typedef struct PACKED { +typedef struct { LONGINT flags; DrvQEl dq; Ptr devicename; /* "/usr" "/dev/rfd0" whatever */ @@ -67,7 +77,7 @@ extern boolean_t cd_mounted_by_trickery_p; #define fcfisres (1 << 1) #define fcwriteperm (1 << 0) -typedef struct PACKED { +typedef struct { LONGINT fdfnum; /* LONGINT fcbFlNum */ Byte fcflags; /* Byte fcbMdRByt */ Byte fcbTypByt; @@ -89,14 +99,14 @@ typedef struct PACKED { #define NFCB 348 /* should be related to NOFILE */ -typedef struct PACKED { +typedef struct { INTEGER nbytes; fcbrec fc[NFCB]; } fcbhidden; #define ROMlib_fcblocks (((fcbhidden *)MR(FCBSPtr))->fc) -typedef struct PACKED { /* add new elements to the beginning of this struct */ +typedef struct { /* add new elements to the beginning of this struct */ LONGINT magicword; FInfo FndrInfo; LONGINT LgLen; @@ -206,21 +216,14 @@ extern fcbrec *PRNTOFPERR (INTEGER prn, OSErr *errp); #define INODEMAP "inodemap" -typedef struct hashlink_str { - struct hashlink_str *next; - LONGINT dirid; - LONGINT parid; - char *dirname; -} hashlink_t; - -typedef struct PACKED { +typedef struct { VCB vcb; char *unixname; #if !defined(__alpha) char *filler; #endif union { - struct PACKED { + struct { LONGINT ino; LONGINT nhashentries; hashlink_t **hashtable; @@ -260,16 +263,14 @@ enum bLimitFCBs, }; -typedef struct PACKED -{ +typedef struct { INTEGER vMVersion; ULONGINT vMAttrib; LONGINT vMLocalHand; LONGINT vMServerAdr; LONGINT vMVolumeGrade; INTEGER vMForeignPrivID; -} -getvolparams_info_t; +} getvolparams_info_t; #define HARDLOCKED (1 << 7) #define SOFTLOCKED (1 << 15) @@ -331,6 +332,8 @@ enum { SLASH_CHAR_OFFSET = 0 }; extern StringPtr ROMlib_exefname; extern char *ROMlib_exeuname; +#pragma pack(pop) + #if !defined (__STDC__) extern LONGINT ROMlib_FORKOFFSET(); extern OSErr ROMlib_seteof(); diff --git a/src/launch.cpp b/src/launch.cpp index 6d479c61..992fa351 100644 --- a/src/launch.cpp +++ b/src/launch.cpp @@ -613,7 +613,7 @@ PRIVATE void launchchain(StringPtr fName, INTEGER vRefNum, BOOLEAN resetmemory, ROMlib_MacSize.first = INITIALPAIRVALUE; ROMlib_directdiskaccess = FALSE; ROMlib_clear_gestalt_list (); - ParseConfigFile ((StringPtr) "\017ExecutorDefault", 0); + ParseConfigFile ((StringPtr) "\pExecutorDefault", 0); ParseConfigFile (ename, err == noErr ? BigEndianValue(finfo.fdCreator) : 0); ROMlib_clockonoff(!ROMlib_noclock); if ((ROMlib_ScreenSize.first != INITIALPAIRVALUE From b77dfc2edd128adb9fadb5ff12978179e2480b05 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sat, 9 Aug 2014 14:32:37 -0600 Subject: [PATCH 014/390] Some work on Mac OS X to Executor FSSpec translation. --- CocoaExecutor.xcodeproj/project.pbxproj | 6 + src/stdfile-OSXPrivate.cpp | 206 ++++++++++++++++++++++++ src/stdfile-OSXPrivate.h | 22 +++ 3 files changed, 234 insertions(+) create mode 100644 src/stdfile-OSXPrivate.cpp create mode 100644 src/stdfile-OSXPrivate.h diff --git a/CocoaExecutor.xcodeproj/project.pbxproj b/CocoaExecutor.xcodeproj/project.pbxproj index c2934fc3..d4dbf943 100644 --- a/CocoaExecutor.xcodeproj/project.pbxproj +++ b/CocoaExecutor.xcodeproj/project.pbxproj @@ -471,6 +471,7 @@ 55A742AC198DC09200F1A8A5 /* local_charset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98BD1987FCBD00ADF159 /* local_charset.cpp */; }; 55A742AE198DE07900F1A8A5 /* check_structs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98611987FCBD00ADF159 /* check_structs.cpp */; }; 55A742B0198DE1C100F1A8A5 /* slash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55A742AF198DE1C100F1A8A5 /* slash.cpp */; }; + 55B9B6D21996903700DBC7A3 /* stdfile-OSXPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55B9B6D01996903700DBC7A3 /* stdfile-OSXPrivate.cpp */; }; 55D30F53198C1B65009BBB62 /* mkvol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55D30F50198C1B65009BBB62 /* mkvol.cpp */; }; 55D30F55198C1E3C009BBB62 /* parsenum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98D41987FCBD00ADF159 /* parsenum.cpp */; }; 55D30F56198C1FE2009BBB62 /* mkvol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55D30F50198C1B65009BBB62 /* mkvol.cpp */; }; @@ -1185,6 +1186,8 @@ 55A742B1198DE36600F1A8A5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/Executor.xib; sourceTree = ""; }; 55A742B2198DE37D00F1A8A5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Executor.strings; sourceTree = ""; }; 55A742B4198DE48E00F1A8A5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/info.strings; sourceTree = ""; }; + 55B9B6D01996903700DBC7A3 /* stdfile-OSXPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "stdfile-OSXPrivate.cpp"; sourceTree = ""; }; + 55B9B6D11996903700DBC7A3 /* stdfile-OSXPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "stdfile-OSXPrivate.h"; sourceTree = ""; }; 55D30F48198C1B08009BBB62 /* mkvol */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mkvol; sourceTree = BUILT_PRODUCTS_DIR; }; 55D30F4F198C1B65009BBB62 /* mkvol_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mkvol_internal.h; sourceTree = ""; }; 55D30F50198C1B65009BBB62 /* mkvol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = mkvol.cpp; sourceTree = ""; usesTabs = 0; }; @@ -1439,6 +1442,8 @@ 558B992B1987FCBE00ADF159 /* stdfile.cpp */, 557F308E198967BE009873EB /* stdfile-OSX.h */, 557F308D198967BE009873EB /* stdfile-OSX.cpp */, + 55B9B6D11996903700DBC7A3 /* stdfile-OSXPrivate.h */, + 55B9B6D01996903700DBC7A3 /* stdfile-OSXPrivate.cpp */, ); name = "File access"; sourceTree = ""; @@ -2724,6 +2729,7 @@ 559AF4B8198AF72B00DE8472 /* segment.cpp in Sources */, 558B99871987FCBF00ADF159 /* error.cpp in Sources */, 558B9A061987FCBF00ADF159 /* qStdText.cpp in Sources */, + 55B9B6D21996903700DBC7A3 /* stdfile-OSXPrivate.cpp in Sources */, 556E0559198584DE00FC4362 /* arrow_left_active.map in Sources */, 556E0557198584DE00FC4362 /* arrow_down_active.map in Sources */, 558B99861987FCBF00ADF159 /* emutraptables.cpp in Sources */, diff --git a/src/stdfile-OSXPrivate.cpp b/src/stdfile-OSXPrivate.cpp new file mode 100644 index 00000000..5c7cc903 --- /dev/null +++ b/src/stdfile-OSXPrivate.cpp @@ -0,0 +1,206 @@ +// +// stdfile-OSXPrivate.cpp +// CocoaExecutor +// +// Created by C.W. Betts on 8/9/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#include +#include "rsys/common.h" +#include "rsys/hfs.h" +#include "stdfile-OSXPrivate.h" +#include + +#undef FSMakeFSSpec +using namespace MacBridge; +using namespace ByteSwap; + +static OSStatus FSSpecToPOSIXPath (const FSSpec *inSpec, char *ioPath, unsigned long inPathLength) +{ + OSStatus err = noErr; + FSRef ref; + FSSpec spec; + CFStringRef nameString = NULL; + CFStringRef pathString = NULL; + CFURLRef pathURL = NULL; + CFURLRef parentURL = NULL; + + // First, try to create an FSRef for the FSSpec + if (err == noErr) { + err = FSpMakeFSRef (inSpec, &ref); + } + + if (err == noErr) { + // It's a directory or a file that exists; convert directly into a path + err = FSRefMakePath (&ref, (UInt8 *)ioPath, inPathLength); + } else { + // The suck case. It's a file that doesn't exist. + err = noErr; + + // Build an FSSpec for the parent directory, which must exist + if (err == noErr) { + Str31 name; + name[0] = 0; + + err = FSMakeFSSpec (inSpec->vRefNum, inSpec->parID, name, &spec); + } + + // Build an FSRef for the parent directory + if (err == noErr) { + err = FSpMakeFSRef (&spec, &ref); + } + + // Now make a CFURL for the parent + if (err == noErr) { + parentURL = CFURLCreateFromFSRef(CFAllocatorGetDefault (), &ref); + if (parentURL == NULL) { err = memFullErr; } + } + + if (err == noErr) { + nameString = CFStringCreateWithPascalString (CFAllocatorGetDefault (), inSpec->name, + kCFStringEncodingMacRoman); + if (nameString == NULL) { err = memFullErr; } + } + + // Now we just add the filename back onto the path + if (err == noErr) { + pathURL = CFURLCreateCopyAppendingPathComponent (CFAllocatorGetDefault (), + parentURL, nameString, + false /* Not a directory */); + if (pathURL == NULL) { err = memFullErr; } + } + + if (err == noErr) { + pathString = CFURLCopyFileSystemPath (pathURL, kCFURLPOSIXPathStyle); + if (pathString == NULL) { err = memFullErr; } + } + + if (err == noErr) { + Boolean converted = CFStringGetCString (pathString, ioPath, inPathLength, CFStringGetSystemEncoding ()); + if (!converted) { err = fnfErr; } + } + } + + // Free allocated memory + if (parentURL != NULL) { CFRelease (parentURL); } + if (nameString != NULL) { CFRelease (nameString); } + if (pathURL != NULL) { CFRelease (pathURL); } + if (pathString != NULL) { CFRelease (pathString); } + + return err; +} + +static OSStatus POSIXPathToFSSpec (const char *inPath, FSSpec *outSpec) +{ + OSStatus err = noErr; + FSRef ref; + Boolean isDirectory; + FSCatalogInfo info; + CFStringRef pathString = NULL; + CFURLRef pathURL = NULL; + CFURLRef parentURL = NULL; + CFStringRef nameString = NULL; + + // First, try to create an FSRef for the full path + if (err == noErr) { + err = FSPathMakeRef ((UInt8 *) inPath, &ref, &isDirectory); + } + + if (err == noErr) { + // It's a directory or a file that exists; convert directly into an FSSpec: + err = FSGetCatalogInfo (&ref, kFSCatInfoNone, NULL, NULL, outSpec, NULL); + } else { + // The suck case. The file doesn't exist. + err = noErr; + + // Get a CFString for the path + if (err == noErr) { + pathString = CFStringCreateWithCString (CFAllocatorGetDefault (), inPath, CFStringGetSystemEncoding ()); + if (pathString == NULL) { err = memFullErr; } + } + + // Get a CFURL for the path + if (err == noErr) { + pathURL = CFURLCreateWithFileSystemPath (CFAllocatorGetDefault (), + pathString, kCFURLPOSIXPathStyle, + false /* Not a directory */); + if (pathURL == NULL) { err = memFullErr; } + } + + // Get a CFURL for the parent + if (err == noErr) { + parentURL = CFURLCreateCopyDeletingLastPathComponent (CFAllocatorGetDefault (), pathURL); + if (parentURL == NULL) { err = memFullErr; } + } + + // Build an FSRef for the parent directory, which must be valid to make an FSSpec + if (err == noErr) { + Boolean converted = CFURLGetFSRef (parentURL, &ref); + if (!converted) { err = fnfErr; } + } + + // Get the node ID of the parent directory + if (err == noErr) { + err = FSGetCatalogInfo(&ref, kFSCatInfoNodeFlags|kFSCatInfoNodeID, &info, NULL, outSpec, NULL); + } + + // Get a CFString for the file name + if (err == noErr) { + nameString = CFURLCopyLastPathComponent (pathURL); + if (nameString == NULL) { err = memFullErr; } + } + + // Copy the string into the FSSpec + if (err == noErr) { + Boolean converted = CFStringGetPascalString (pathString, outSpec->name, sizeof (outSpec->name), + CFStringGetSystemEncoding ()); + if (!converted) { err = fnfErr; } + } + + // Set the node ID in the FSSpec + if (err == noErr) { + outSpec->parID = info.nodeID; + } + } + + // Free allocated memory + if (pathURL != NULL) { CFRelease (pathURL); } + if (pathString != NULL) { CFRelease (pathString); } + if (parentURL != NULL) { CFRelease (parentURL); } + if (nameString != NULL) { CFRelease (nameString); } + + return err; +} + +OSStatus MacBridge::MacFSSpecToExecutorFSSpec(const ::FSSpec *inMac, Executor::FSSpec *outExec) +{ + char aPath[PATH_MAX] = {0}; + OSStatus theErr = BigEndianValue(FSSpecToPOSIXPath(inMac, aPath, PATH_MAX)); + CFURLRef aURL = ::CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (UInt8*)aPath, strlen(aPath), false); + theErr = MacCFURLToExecutorFSSpec(aURL, outExec); + CFRelease(aURL); + + return theErr; +} + +OSStatus MacBridge::MacCFURLToExecutorFSSpec(CFURLRef inMac, Executor::FSSpec *outExec) +{ + OSStatus theErr = CLC((OSStatus)noErr); + char aPath[PATH_MAX] = {0}; + if (!CFURLGetFileSystemRepresentation(inMac, false, (UInt8*)aPath, PATH_MAX)) + { + return CLC((OSStatus)fnfErr); + } + CFStringRef aStr = CFURLCopyLastPathComponent(inMac); + Executor::Str255 strName = {0}; + if (!CFStringGetPascalString(aStr, strName, 256, kCFStringEncodingMacRoman)) { + theErr = CLC((OSStatus)fnfErr); + } + CFRelease(aStr); + + Executor::HVCB *customPart = Executor::ROMlib_vcbbybiggestunixname(aPath); + Executor::C_FSMakeFSSpec(customPart->vcbDrvNum, customPart->vcbDirIDM, strName, outExec); + + return theErr; +} diff --git a/src/stdfile-OSXPrivate.h b/src/stdfile-OSXPrivate.h new file mode 100644 index 00000000..9d841c0e --- /dev/null +++ b/src/stdfile-OSXPrivate.h @@ -0,0 +1,22 @@ +// +// stdfile-OSXPrivate.h +// CocoaExecutor +// +// Created by C.W. Betts on 8/9/14. +// Copyright (c) 2014 C.W. Betts. All rights reserved. +// + +#ifndef __CocoaExecutor__stdfile_OSXPrivate__ +#define __CocoaExecutor__stdfile_OSXPrivate__ + +#include +#include + +#include "stdfile.h" + +namespace MacBridge { + PUBLIC OSStatus MacCFURLToExecutorFSSpec(CFURLRef inMac, Executor::FSSpec *outExec); + PUBLIC OSStatus MacFSSpecToExecutorFSSpec(const ::FSSpec *inMac, Executor::FSSpec *outExec); +} + +#endif /* defined(__CocoaExecutor__stdfile_OSXPrivate__) */ From fe0b687b179506a46b96a1a5bde9d8dbcbe5e971 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sat, 9 Aug 2014 18:46:03 -0600 Subject: [PATCH 015/390] Migrate the options to vectors. --- CocoaExecutor.xcodeproj/project.pbxproj | 22 +- .../CocoaExecutor/CocoaExecutor-Prefix.pch | 5 + .../AppIcon.appiconset/Executor copy.png | Bin 1070 -> 0 bytes .../AppIcon.appiconset/Executor.png | Bin 972 -> 0 bytes .../CocoaExecutor/NeXT Classes/MacWinClass.h | 4 + .../{MacWinClass.m => MacWinClass.mm} | 3 +- .../CocoaExecutor/NeXT Classes/NEXTmain.mm | 6 +- src/ctlPopup.cpp | 2 +- src/fileAccess.cpp | 12 +- src/fileDouble.cpp | 8 +- src/fileMisc.cpp | 2 +- src/hfsBtree.cpp | 4 +- src/hfsHelper.cpp | 10 +- src/hfsMisc.cpp | 2 +- src/include/QuickDraw.h | 12 +- src/include/rsys/option.h | 31 ++- src/include/rsys/parsenum.h | 2 + src/main.cpp | 10 +- src/mkvol/mkvol.cpp | 8 +- src/option.mm | 227 +++++++----------- src/osutil.cpp | 10 +- src/sound.cpp | 2 +- 22 files changed, 173 insertions(+), 209 deletions(-) delete mode 100644 OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor copy.png delete mode 100644 OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor.png rename OSX-only/CocoaExecutor/NeXT Classes/{MacWinClass.m => MacWinClass.mm} (77%) diff --git a/CocoaExecutor.xcodeproj/project.pbxproj b/CocoaExecutor.xcodeproj/project.pbxproj index d4dbf943..11702928 100644 --- a/CocoaExecutor.xcodeproj/project.pbxproj +++ b/CocoaExecutor.xcodeproj/project.pbxproj @@ -13,7 +13,7 @@ 5500AB561985A66A00FF62C0 /* Executor_main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB3F1985A66A00FF62C0 /* Executor_main.mm */; }; 5500AB571985A66A00FF62C0 /* MacAppClass.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB431985A66A00FF62C0 /* MacAppClass.mm */; }; 5500AB581985A66A00FF62C0 /* MacViewClass.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB461985A66A00FF62C0 /* MacViewClass.mm */; }; - 5500AB591985A66A00FF62C0 /* MacWinClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB481985A66A00FF62C0 /* MacWinClass.m */; }; + 5500AB591985A66A00FF62C0 /* MacWinClass.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB481985A66A00FF62C0 /* MacWinClass.mm */; }; 5500AB5A1985A66A00FF62C0 /* NEXT.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB491985A66A00FF62C0 /* NEXT.mm */; }; 5500AB5B1985A66A00FF62C0 /* NEXTkeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB4A1985A66A00FF62C0 /* NEXTkeyboard.cpp */; }; 5500AB5C1985A66A00FF62C0 /* NEXTmain.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB4B1985A66A00FF62C0 /* NEXTmain.mm */; }; @@ -631,7 +631,7 @@ 5500AB451985A66A00FF62C0 /* MacViewClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacViewClass.h; sourceTree = ""; }; 5500AB461985A66A00FF62C0 /* MacViewClass.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.objcpp; path = MacViewClass.mm; sourceTree = ""; }; 5500AB471985A66A00FF62C0 /* MacWinClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacWinClass.h; sourceTree = ""; }; - 5500AB481985A66A00FF62C0 /* MacWinClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MacWinClass.m; sourceTree = ""; }; + 5500AB481985A66A00FF62C0 /* MacWinClass.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MacWinClass.mm; sourceTree = ""; }; 5500AB491985A66A00FF62C0 /* NEXT.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NEXT.mm; sourceTree = ""; }; 5500AB4A1985A66A00FF62C0 /* NEXTkeyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NEXTkeyboard.cpp; sourceTree = ""; usesTabs = 1; }; 5500AB4B1985A66A00FF62C0 /* NEXTmain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NEXTmain.mm; sourceTree = ""; }; @@ -737,7 +737,7 @@ 556063341988680000D6F0B2 /* evil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = evil.h; sourceTree = ""; }; 556063351988680000D6F0B2 /* executor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = executor.h; sourceTree = ""; }; 556063361988680000D6F0B2 /* fauxdbm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fauxdbm.h; sourceTree = ""; }; - 556063371988680000D6F0B2 /* file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = file.h; sourceTree = ""; }; + 556063371988680000D6F0B2 /* file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = file.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 556063381988680000D6F0B2 /* filedouble.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = filedouble.h; sourceTree = ""; }; 556063391988680000D6F0B2 /* flags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flags.h; sourceTree = ""; }; 5560633A1988680000D6F0B2 /* float_fcw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = float_fcw.h; sourceTree = ""; }; @@ -930,7 +930,7 @@ 558B985C1987FCBD00ADF159 /* autorefresh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = autorefresh.cpp; sourceTree = ""; }; 558B985D1987FCBD00ADF159 /* balloon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = balloon.cpp; sourceTree = ""; }; 558B985E1987FCBD00ADF159 /* bindec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bindec.cpp; sourceTree = ""; usesTabs = 0; }; - 558B985F1987FCBD00ADF159 /* blockdev.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = blockdev.cpp; sourceTree = ""; }; + 558B985F1987FCBD00ADF159 /* blockdev.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = blockdev.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 558B98601987FCBD00ADF159 /* cfm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cfm.cpp; sourceTree = ""; }; 558B98611987FCBD00ADF159 /* check_structs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = check_structs.cpp; sourceTree = ""; }; 558B98621987FCBD00ADF159 /* checkpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = checkpoint.cpp; sourceTree = ""; }; @@ -974,13 +974,13 @@ 558B98881987FCBD00ADF159 /* error.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = error.cpp; sourceTree = ""; }; 558B98891987FCBD00ADF159 /* executor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = executor.cpp; sourceTree = ""; }; 558B988A1987FCBD00ADF159 /* fauxdbm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fauxdbm.c; sourceTree = ""; }; - 558B988B1987FCBD00ADF159 /* fileAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileAccess.cpp; sourceTree = ""; }; + 558B988B1987FCBD00ADF159 /* fileAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = fileAccess.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 558B988C1987FCBD00ADF159 /* fileCreate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileCreate.cpp; sourceTree = ""; }; 558B988D1987FCBD00ADF159 /* fileDirs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileDirs.cpp; sourceTree = ""; }; - 558B988E1987FCBD00ADF159 /* fileDouble.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileDouble.cpp; sourceTree = ""; }; + 558B988E1987FCBD00ADF159 /* fileDouble.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = fileDouble.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 558B988F1987FCBD00ADF159 /* fileHighlevel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileHighlevel.cpp; sourceTree = ""; }; 558B98901987FCBD00ADF159 /* fileInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileInfo.cpp; sourceTree = ""; }; - 558B98911987FCBD00ADF159 /* fileMisc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileMisc.cpp; sourceTree = ""; }; + 558B98911987FCBD00ADF159 /* fileMisc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = fileMisc.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 558B98921987FCBD00ADF159 /* fileVolumes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = fileVolumes.cpp; sourceTree = ""; usesTabs = 0; }; 558B98931987FCBD00ADF159 /* finder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = finder.cpp; sourceTree = ""; }; 558B98941987FCBD00ADF159 /* float4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = float4.cpp; sourceTree = ""; }; @@ -998,9 +998,9 @@ 558B98A01987FCBD00ADF159 /* hfsChanging.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsChanging.cpp; sourceTree = ""; }; 558B98A11987FCBD00ADF159 /* hfsCreate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsCreate.cpp; sourceTree = ""; }; 558B98A21987FCBD00ADF159 /* hfsFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsFile.cpp; sourceTree = ""; }; - 558B98A31987FCBD00ADF159 /* hfsHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsHelper.cpp; sourceTree = ""; usesTabs = 0; }; + 558B98A31987FCBD00ADF159 /* hfsHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = hfsHelper.cpp; sourceTree = ""; usesTabs = 0; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 558B98A41987FCBD00ADF159 /* hfsHier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsHier.cpp; sourceTree = ""; }; - 558B98A51987FCBD00ADF159 /* hfsMisc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsMisc.cpp; sourceTree = ""; }; + 558B98A51987FCBD00ADF159 /* hfsMisc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = hfsMisc.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 558B98A61987FCBD00ADF159 /* hfsVolume.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsVolume.cpp; sourceTree = ""; }; 558B98A71987FCBD00ADF159 /* hfsWorkingdir.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsWorkingdir.cpp; sourceTree = ""; }; 558B98A81987FCBD00ADF159 /* hfsXbar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hfsXbar.cpp; sourceTree = ""; }; @@ -1297,7 +1297,7 @@ 5500AB451985A66A00FF62C0 /* MacViewClass.h */, 5500AB461985A66A00FF62C0 /* MacViewClass.mm */, 5500AB471985A66A00FF62C0 /* MacWinClass.h */, - 5500AB481985A66A00FF62C0 /* MacWinClass.m */, + 5500AB481985A66A00FF62C0 /* MacWinClass.mm */, 5500AB491985A66A00FF62C0 /* NEXT.mm */, 5500AB4A1985A66A00FF62C0 /* NEXTkeyboard.cpp */, 5500AB4B1985A66A00FF62C0 /* NEXTmain.mm */, @@ -2658,7 +2658,7 @@ 5500AB561985A66A00FF62C0 /* Executor_main.mm in Sources */, 558B99691987FCBF00ADF159 /* ctlInit.cpp in Sources */, 558B99791987FCBF00ADF159 /* dialCreate.cpp in Sources */, - 5500AB591985A66A00FF62C0 /* MacWinClass.m in Sources */, + 5500AB591985A66A00FF62C0 /* MacWinClass.mm in Sources */, 558B99AD1987FCBF00ADF159 /* ini.cpp in Sources */, 558B9A3E1987FCBF00ADF159 /* toolmath.cpp in Sources */, 558B99721987FCBF00ADF159 /* dcconvert.cpp in Sources */, diff --git a/OSX-only/CocoaExecutor/CocoaExecutor-Prefix.pch b/OSX-only/CocoaExecutor/CocoaExecutor-Prefix.pch index f6b18d8c..0997b486 100644 --- a/OSX-only/CocoaExecutor/CocoaExecutor-Prefix.pch +++ b/OSX-only/CocoaExecutor/CocoaExecutor-Prefix.pch @@ -6,6 +6,11 @@ #include +#ifdef __cplusplus +#include +#include +#endif + #ifdef __OBJC__ #import #endif diff --git a/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor copy.png b/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor copy.png deleted file mode 100644 index c8ed17c3592d0cd798839dea8ce20fc8dd60367d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1070 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}t&H|6fVg?3oVGw3ym^DX&fq{uV zGbExU!q>+tIX_n~F(p4KRj(qq0H~UQ!KT6r$jnVGNmQuF&B-gas<2f8tFQvHLBje< z3ScEA*|tg%z5xo(`9-M;rg|oN21<5Z3JMA~MJZ`kK`w4k?LeNbQbtKhft9{~d3m{B zxv^e;QM$gNrKP35fswwEkuFe$ZgFK^Nn(X=Ua>O75STeGsl~}fnFS@8`FRQ;a}$&D zOG|8(lt3220mPjpnP~`{@`|C}0(wv%B%^PrXP^%^8>rO=Bx)5AlvC2unFfg9=ba4!c;Jh2oIH^^EW9!_# zi)1(P-RyE{5K8%)UVhE~uggc<3dvBf|0|yA?){?e;Xb=>o`lV@c_n2}{!ZDxwc)9H zLy~UNTA7-e+K={V33kNZ-mai`*LC*xHIZwxIG)^@rEqmys=G%+o^uK3n%8!gEV%{= z)+{gdg!2|>Gp_x){+j1)Av@LFO#cmOhm{pxIJ&tzb-FR+dzdi&_ZDKk?x4PQt=;aW zySeppE^};Ieo@(x?bgq}(n9gT#Fpyl=@T>#ce8BDc#&lyz3a43yUHRP6^AS3#u<#o zS?&v}qD-e`$~MKtdiU)N3(scrlws;?s*=!+vbC*z`B|W`W=_GG4=UT`d_A5B{dhW4 zqeg!^!+qnT&hu6VuROHMXX}}kO3R)2dqdxYMNeRP>4Q%{>?ddlCCqr>b;)qWmj%(A z#b%qw%W``j4P%+~v$gJMS@}h76}PXKR&4TnExFBuRZeiPMlDwyHE-s!{gbUo}c>t}crsLs!yfnap$6(Hu<=^mKyl+!NO9zdXC*eT~`*`S5jH U68`GBZUW_KPgg&ebxsLQ0Cm=a_y7O^ diff --git a/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor.png b/OSX-only/CocoaExecutor/Images.xcassets/AppIcon.appiconset/Executor.png deleted file mode 100644 index 1d40a48efa04fca977979e2644738ae040ca1e52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 972 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}t&H|6fVg?3oVGw3ym^DX&fq`*p zW=KRygs+cPa(=E}VoH8es$NBI0Z=sqgH44MkeQoWlBiITo0C^;Rbi_HR$&EXgM{^! z6u?SKvTcDSm?5wAYV@L$&-EhW9tqL4l=k8r3yNT~+mrH|C%GdPrYxaL#KH64DhI;*9 z@l<#37i|ys*?sdQY>v$X<|?a%esJZ}rxspe+-Z%8|= ztnk9o&E2WfjUnH|gz3Mx5bJdZ^|fp5b}!w{t(S9|W6Sc3%8qQee)g3XiU%gPR7X#r zpmDgHWmCqBEEDNnr+wO07TKscTq!rsU@XpZUr-fgIwe!KDK6H#Z)aF|Hk+pmQ(se+ zgl?3rZRN|)0*y6u3eJ2`*)Hen@kHpy)0rAI`qLTi8y9t+w=#I;p;bOx&$Lup?!@04 z`W`HL0?SJueEMNOK|?5E#sjZQhAX}-h~6wV+dN*D+w*7`%cP&Jbw|s}FLJB6eZ90| zlizE}Z62(0f_pWZIoEZUwwXrQuSIvgiJ)QDSp-SsWR15D8G5S`njxgN@xNAExKgS diff --git a/OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.h b/OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.h index 5e6590bd..76296a4f 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.h +++ b/OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.h @@ -3,6 +3,10 @@ #import +namespace Executor { + extern void ROMlib_dummywincall( void ); +} + @interface MacWindow : NSWindow - (BOOL)commandKey:(NSEvent *)theEvent; diff --git a/OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.m b/OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.mm similarity index 77% rename from OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.m rename to OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.mm index 215f8ebb..3f97583b 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.m +++ b/OSX-only/CocoaExecutor/NeXT Classes/MacWinClass.mm @@ -13,8 +13,7 @@ - (BOOL)commandKey:(NSEvent *)theEvent return( NO ); } -extern void ROMlib_dummywincall( void ); -void ROMlib_dummywincall( void ) +void Executor::ROMlib_dummywincall( void ) { } diff --git a/OSX-only/CocoaExecutor/NeXT Classes/NEXTmain.mm b/OSX-only/CocoaExecutor/NeXT Classes/NEXTmain.mm index 59944193..9bb83ea6 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/NEXTmain.mm +++ b/OSX-only/CocoaExecutor/NeXT Classes/NEXTmain.mm @@ -1,3 +1,5 @@ +#import + #include "rsys/common.h" #include "MacTypes.h" @@ -6,7 +8,6 @@ #include #include -#import #include "rsys/keyboards.h" #include "MemoryMgr.h" @@ -23,6 +24,7 @@ #include #include "ourstuff.h" #include "contextswitch.h" +#include "MacWinClass.h" #warning "punt this #include" #include "rsys/memory_layout.h" @@ -34,8 +36,6 @@ char ROMlib_040; -extern "C" void ROMlib_dummywincall( void ); - void ROMlib_calldummies( void ) { SETUPA5; diff --git a/src/ctlPopup.cpp b/src/ctlPopup.cpp index 457df8fa..06ad1ca8 100644 --- a/src/ctlPopup.cpp +++ b/src/ctlPopup.cpp @@ -357,7 +357,7 @@ draw (ControlHandle ctl, draw_state_t draw_state, if (title_right - title_left < StringWidth (item_title)) { int i, width; - char ellipsis[] = { 4, ' ', '.', '.', '.' }; + Str15 ellipsis = "\p..."; title_right -= StringWidth ((StringPtr) ellipsis); diff --git a/src/fileAccess.cpp b/src/fileAccess.cpp index 371cf2c7..37023015 100644 --- a/src/fileAccess.cpp +++ b/src/fileAccess.cpp @@ -1158,7 +1158,7 @@ A4(PRIVATE, OSErr, PBOpenForkD, ParmBlkPtr, pb, BOOLEAN, a, { fp->fcflags |= fcfisres; fp->hiddenfd = fp->fcfd; - lseek(fp->fcfd, ROMlib_FORKOFFSET(fp), L_SET); + lseek(fp->fcfd, ROMlib_FORKOFFSET(fp), SEEK_SET); } else { @@ -1307,7 +1307,7 @@ pbfpos (ParmBlkPtr pb, LONGINT *toseekp, boolean_t can_go_past_eof) switch (Cx(pb->ioParam.ioPosMode) & POSMASK) { case fsAtMark: - if ((pos = lseek(fd, 0L, L_INCR)) == -1) { + if ((pos = lseek(fd, 0L, SEEK_CUR)) == -1) { switch(errno) { case EBADF: err = fnOpnErr; @@ -1373,7 +1373,7 @@ A3(PRIVATE, OSErr, PBLockUnlockRange, ParmBlkPtr, pb, BOOLEAN, a, OSErr (*cleanup) (int fd, uint32 start, uint32 count); fd = fp->fcfd; - curseek = lseek(fd, 0, L_SET); + curseek = lseek(fd, 0, SEEK_SET); if (op == lock) { @@ -1387,14 +1387,14 @@ A3(PRIVATE, OSErr, PBLockUnlockRange, ParmBlkPtr, pb, BOOLEAN, a, } err = verify (fd, toseek, BigEndianValue (pb->ioParam.ioReqCount)); - if (err == noErr && lseek(fd, toseek, L_SET) == -1) + if (err == noErr && lseek(fd, toseek, SEEK_SET) == -1) err = ROMlib_maperrno(); if (err == noErr) err = ROMlib_lockunlockrange (fd, toseek, BigEndianValue (pb->ioParam.ioReqCount), op); if (err == noErr) err = cleanup (fd, toseek, BigEndianValue (pb->ioParam.ioReqCount)); - lseek(fd, curseek, L_SET); + lseek(fd, curseek, SEEK_SET); } } fs_err_hook (err); @@ -1435,7 +1435,7 @@ pbsetfpos (ParmBlkPtr pb, boolean_t can_go_past_eof) forkoffset = FORKOFFSET(fp); err = pbfpos(pb, &toseek, can_go_past_eof); fd = fp->fcfd; - pb->ioParam.ioPosOffset = BigEndianValue((int)(lseek(fd, toseek, L_SET) - forkoffset)); + pb->ioParam.ioPosOffset = BigEndianValue((int)(lseek(fd, toseek, SEEK_SET) - forkoffset)); } fs_err_hook (err); return err; diff --git a/src/fileDouble.cpp b/src/fileDouble.cpp index e7406187..9069df14 100644 --- a/src/fileDouble.cpp +++ b/src/fileDouble.cpp @@ -223,7 +223,7 @@ A5(PRIVATE, BOOLEAN, getsetentry, GetOrSetType, gors, LONGINT, fd, INTEGER n; retval = FALSE; - saveloc = lseek(fd, 0L, L_INCR); + saveloc = lseek(fd, 0L, SEEK_CUR); lseek(fd, 0L, L_SET); nread = read(fd, buf, sizeof(buf)); dfp = (struct defaulthead *) buf; @@ -285,7 +285,7 @@ A2(PRIVATE, void, writebyteat, LONGINT, fd, LONGINT, loc) { off_t saveloc; - saveloc = lseek(fd, 0L, L_INCR); + saveloc = lseek(fd, 0L, SEEK_CUR); lseek(fd, loc, L_SET); write(fd, "", 1); lseek(fd, saveloc, L_SET); @@ -328,7 +328,7 @@ A1(PUBLIC, OSErr, ROMlib_seteof, fcbrec *, fp) /* INTERNAL */ if (leof > peof) writebyteat(fd, leof-1); else if (leof < peof) { - curloc = lseek(fd, 0L, L_INCR); + curloc = lseek(fd, 0L, SEEK_CUR); ftruncate(fd, leof); if (curloc > leof) lseek(fd, leof, L_SET); @@ -356,7 +356,7 @@ A5(PRIVATE, BOOLEAN, getsetpiece, GetOrSetType, gors, LONGINT, fd, off_t saveloc; BOOLEAN retval; - saveloc = lseek(fd, 0L, L_INCR); + saveloc = lseek(fd, 0L, SEEK_CUR); lseek(fd, Cx(sdp->offset), L_SET); switch (gors) { case Get: diff --git a/src/fileMisc.cpp b/src/fileMisc.cpp index e814f5fa..2d593bcd 100644 --- a/src/fileMisc.cpp +++ b/src/fileMisc.cpp @@ -111,7 +111,7 @@ A2(PUBLIC, OSErr, ufsPBGetFCBInfo, FCBPBPtr, pb, /* INTERNAL */ pb->ioFCBStBlk = 0; pb->ioFCBEOF = fp->fcleof; pb->ioFCBPLen = fp->fcleof; - pb->ioFCBCrPs = lseek(fp->fcfd, 0, L_INCR) - FORKOFFSET(fp); + pb->ioFCBCrPs = lseek(fp->fcfd, 0, SEEK_CUR) - FORKOFFSET(fp); pb->ioFCBVRefNum = MR(fp->fcvptr)->vcbVRefNum; /* what's this? */ pb->ioFCBClpSiz = MR(fp->fcvptr)->vcbClpSiz; pb->ioFCBParID = fp->fcparid; diff --git a/src/hfsBtree.cpp b/src/hfsBtree.cpp index 3bfb3b70..5e79b49a 100644 --- a/src/hfsBtree.cpp +++ b/src/hfsBtree.cpp @@ -766,8 +766,8 @@ PRIVATE OSErr add_free_nodes(cacheentry *block0cachep, ULONGINT n_new_nodes) newbtp->ndType = CB(mapnode); /* 2 */ newbtp->ndNRecs = CWC(1); - *((short *) newbtp + 255) = CWC(MAP_PAGE_MAP_BEGIN); - *((short *) newbtp + 254) = CWC(MAP_PAGE_MAP_END); + *((short *) newbtp + 255) = CWC((short)MAP_PAGE_MAP_BEGIN); + *((short *) newbtp + 254) = CWC((short)MAP_PAGE_MAP_END); --n_new_nodes; oldcachep->flags |= CACHEDIRTY; newcachep->flags |= CACHEDIRTY; diff --git a/src/hfsHelper.cpp b/src/hfsHelper.cpp index 80218273..dfa82411 100644 --- a/src/hfsHelper.cpp +++ b/src/hfsHelper.cpp @@ -538,14 +538,14 @@ PUBLIC OSErr Executor::ROMlib_readwrite(LONGINT fd, char *buffer, LONGINT count, totransfer = MIN(count, remainder); newbuffer = (char *) (((long) alloca(blocksize + 3)+3) & ~3); offset = offset / blocksize * blocksize; - JUMPTODONEIF(seekfp(fd, offset, L_SET) < 0) + JUMPTODONEIF(seekfp(fd, offset, SEEK_SET) < 0) needlseek = FALSE; JUMPTODONEIF(readfp(fd, newbuffer, blocksize) != blocksize) if (rw == reading) { memmove(buffer, newbuffer+blocksize-remainder, totransfer); } else { memmove(newbuffer+blocksize-remainder, buffer, totransfer); - JUMPTODONEIF(seekfp(fd, offset, L_SET) < 0) + JUMPTODONEIF(seekfp(fd, offset, SEEK_SET) < 0) JUMPTODONEIF(writefp(fd, newbuffer, blocksize) != blocksize) } buffer += totransfer; @@ -556,7 +556,7 @@ PUBLIC OSErr Executor::ROMlib_readwrite(LONGINT fd, char *buffer, LONGINT count, remainder = count % blocksize; count -= remainder; if (needlseek) { - JUMPTODONEIF(seekfp(fd, offset, L_SET) < 0) + JUMPTODONEIF(seekfp(fd, offset, SEEK_SET) < 0) needlseek = FALSE; } while (count) { @@ -576,13 +576,13 @@ PUBLIC OSErr Executor::ROMlib_readwrite(LONGINT fd, char *buffer, LONGINT count, if (!newbuffer) newbuffer = (char *) (((long) alloca(blocksize+3)+3) & ~3); if (needlseek) - JUMPTODONEIF(seekfp(fd, offset, L_SET) < 0) + JUMPTODONEIF(seekfp(fd, offset, SEEK_SET) < 0) JUMPTODONEIF(readfp(fd, newbuffer, blocksize) != blocksize) if (rw == reading) { memmove(buffer, newbuffer, count); } else { memmove(newbuffer, buffer, count); - JUMPTODONEIF(seekfp(fd, offset, L_SET) < 0) + JUMPTODONEIF(seekfp(fd, offset, SEEK_SET) < 0) JUMPTODONEIF(writefp(fd, newbuffer, blocksize) != blocksize) } } diff --git a/src/hfsMisc.cpp b/src/hfsMisc.cpp index 1c29dd86..5177fd5a 100644 --- a/src/hfsMisc.cpp +++ b/src/hfsMisc.cpp @@ -108,7 +108,7 @@ A2(PUBLIC trap, OSErrRET, PBGetFCBInfo, FCBPBPtr, pb, BOOLEAN, async) pb->ioFCBCrPs = fcbp->fcbCrPs; /* HFS */ pb->ioFCBPLen = fcbp->fcbPLen; } else { - pb->ioFCBCrPs = BigEndianValue((ULONGINT)(lseek(((fcbrec *)fcbp)->fcfd, 0, L_INCR) - /* UFS */ + pb->ioFCBCrPs = BigEndianValue((ULONGINT)(lseek(((fcbrec *)fcbp)->fcfd, 0, SEEK_CUR) - /* UFS */ FORKOFFSET((fcbrec *) fcbp))); pb->ioFCBPLen = fcbp->fcbEOF; } diff --git a/src/include/QuickDraw.h b/src/include/QuickDraw.h index 76f44bf8..9e0b65ca 100644 --- a/src/include/QuickDraw.h +++ b/src/include/QuickDraw.h @@ -90,11 +90,13 @@ MAKE_HIDDEN(CursPtr); typedef HIDDEN_CursPtr *CursHandle; typedef SignedByte GrafVerb; -#define frame 0 -#define paint 1 -#define erase 2 -#define invert 3 -#define fill 4 +enum { + frame = 0, + paint = 1, + erase = 2, + invert = 3, + fill = 4 +}; typedef struct PACKED { INTEGER polySize; diff --git a/src/include/rsys/option.h b/src/include/rsys/option.h index 7db3c99b..a737c900 100644 --- a/src/include/rsys/option.h +++ b/src/include/rsys/option.h @@ -1,5 +1,8 @@ #if !defined (_RSYS_OPTION_H_) #define _RSYS_OPTION_H_ + +#include + namespace Executor { typedef enum option_kind { @@ -42,6 +45,8 @@ typedef struct option std::string opt_val; } option_t; +typedef std::vector option_vec; + typedef enum priority { pri_appl_config_file, @@ -65,36 +70,30 @@ typedef struct opt_val priority_t pri; } opt_val_t; -typedef struct opt_database -{ - opt_val_t *opt_vals; - int n_opt_vals; - int max_opt_vals; -} opt_database_t; - +typedef std::vector opt_database_t; /* common options */ -extern option_t opt_common[]; -extern opt_database_t *common_db; +extern const option_vec common_opts; +extern opt_database_t common_db; void opt_init (void); void opt_shutdown (void); -void opt_register (std::string new_interface, option_t *opts, int n_opts); +void opt_register (std::string new_interface, option_vec opts); /* provide a function to parse specified arguments */ -opt_database_t *opt_alloc_db (void); -int opt_parse (opt_database_t *db, option_t *opts, int n_opts, +opt_database_t opt_alloc_db (void); +int opt_parse (opt_database_t &db, option_vec opts, int *argc, char *argv[]); /* returns TRUE if options was specified */ -int opt_int_val (opt_database_t *db, std::string opt, int *retval, +int opt_int_val (opt_database_t &db, std::string opt, int *retval, boolean_t *parse_error_p); -int opt_val (opt_database_t *db, std::string opt, std::string *retval); -void opt_put_val (opt_database_t *db, std::string &opt, std::string value, +int opt_val (opt_database_t &db, std::string opt, std::string *retval); +void opt_put_val (opt_database_t &db, std::string &opt, std::string value, priority_t pri, int temp_val_p); -void opt_put_int_val (opt_database_t *db, std::string &opt, int value, +void opt_put_int_val (opt_database_t &db, std::string &opt, int value, priority_t pri, int temp_val_p); diff --git a/src/include/rsys/parsenum.h b/src/include/rsys/parsenum.h index 632969fa..3f036592 100644 --- a/src/include/rsys/parsenum.h +++ b/src/include/rsys/parsenum.h @@ -1,6 +1,8 @@ #if !defined (_RSYS_PARSENUM_H_) #define _RSYS_PARSENUM_H_ +#include + namespace Executor { extern boolean_t parse_number (std::string orig_num, int32 *val, unsigned round_up_to_multiple_of); diff --git a/src/main.cpp b/src/main.cpp index 05cda4ab..178e2395 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -133,6 +133,8 @@ char ROMlib_rcsid_main[] = #include "x.h" #endif +#include + using namespace Executor; using namespace ByteSwap; using namespace std; @@ -191,7 +193,7 @@ static boolean_t use_native_code_p = TRUE; version A.B.C */ uint32 Executor::system_version = 0x700; /* keep this in sync with Browser's .ecf file */ -static option_t common_opts[] = +const option_vec Executor::common_opts = { { "sticky", "sticky menus", opt_no_arg, NULL }, { "pceditkeys", "have Delete key delete one character forward", @@ -450,7 +452,7 @@ capable of color.", { "hfsplusro", "unsupported -- do not use", opt_no_arg, NULL }, }; -opt_database_t *Executor::common_db; +opt_database_t Executor::common_db; /* Prints the specified value in a representation appropriate for command @@ -1400,7 +1402,7 @@ int main(int argc, char** argv) opt_init (); common_db = opt_alloc_db (); - opt_register ("common", common_opts, NELEM (common_opts)); + opt_register ("common", common_opts); opt_register_pre_note ("welcome to the executor help message."); opt_register_pre_note ("usage: `executor [option...] " @@ -1410,7 +1412,7 @@ int main(int argc, char** argv) (*reg_funcs[i]) (); if (!bad_arg_p) - bad_arg_p = opt_parse (common_db, common_opts, NELEM (common_opts), + bad_arg_p = opt_parse (common_db, common_opts, &argc, argv); if (opt_val (common_db, "version", NULL)) diff --git a/src/mkvol/mkvol.cpp b/src/mkvol/mkvol.cpp index 9a120508..88bc06bd 100644 --- a/src/mkvol/mkvol.cpp +++ b/src/mkvol/mkvol.cpp @@ -7,6 +7,8 @@ char ROMlib_rcsid_mkvol[] = "$Id: mkvol.c 63 2004-12-24 18:19:43Z ctm $"; #endif +#undef _DARWIN_NO_64_BIT_INODE + /* #include "rsys/common.h" */ #if defined (__MINGW32__) #define CYGWIN32 @@ -686,8 +688,8 @@ adjust_hfv_name (char **namepp) char *new_namep; new_namep = (char*)malloc (name_len + 4 + 1); - sprintf (new_namep, "%s.hfv", namep); - fprintf (stderr, "Adding \".hfv\" to rename \"%s\" to \"%s\"\n", + sprintf (new_namep, "%s%s", namep, DEFAULT_SUFFIX); + fprintf (stderr, "Adding \"" DEFAULT_SUFFIX "\" to rename \"%s\" to \"%s\"\n", namep, new_namep); namep = new_namep; } @@ -929,7 +931,7 @@ main (int argc, char *argv[]) time_t now; struct tm *tmp; int32 years, leaps; - int32 nsecs, nbytes; + int32 nsecs = 0, nbytes = 0; long timevar; boolean_t force_p, help_p; char *hfv_name, *volume_name, *volume_size; diff --git a/src/option.mm b/src/option.mm index 8ef1974d..04175dc9 100644 --- a/src/option.mm +++ b/src/option.mm @@ -24,14 +24,13 @@ using namespace Executor; using namespace std; -struct opt_block +typedef struct opt_block { string interface; - option_t *opts; - int n_opts; -} *opt_blocks; -static int n_opt_blocks_max; -static int n_opt_blocks; + option_vec opts; +} opt_block; +typedef vector optBlocks; +static optBlocks opt_blocks; static int max_pre_notes; static int n_pre_notes; @@ -67,10 +66,7 @@ pre_notes = nullptr; } - if (opt_blocks) { - free (opt_blocks); - opt_blocks = nullptr; - } + opt_blocks.clear(); } static void @@ -113,25 +109,22 @@ buf_len = strlen (buf); - if (buf_len <= desired_len) - { - *out_len = buf_len; - *next_len = -1; - } - else - { - char *t; + if (buf_len <= desired_len) { + *out_len = buf_len; + *next_len = -1; + } else { + char *t; - t = &buf[desired_len]; - while (!isspace (*t)) - t --; - *next_len = (t - buf) + 1; + t = &buf[desired_len]; + while (!isspace (*t)) + t --; + *next_len = (t - buf) + 1; - while (isspace (*t)) - t --; + while (isspace (*t)) + t --; - *out_len = (t - buf) + 1; - } + *out_len = (t - buf) + 1; + } } void @@ -183,7 +176,7 @@ void _generate_help_message (void) { - int i, block_i; + int i; char *buf; for (i = 0; i < n_pre_notes; i ++) @@ -203,22 +196,19 @@ } /* newline to separate pre-notes and options */ send_to_help_buf ("", 0, TRUE); - for (block_i = 0; block_i < n_opt_blocks; block_i ++) + for (optBlocks::iterator block_i = opt_blocks.begin(); block_i != opt_blocks.end(); block_i ++) { - string interface = opt_blocks[block_i].interface; - option_t *opts = opt_blocks[block_i].opts; - int n_opts = opt_blocks[block_i].n_opts; - int opt_i; + string interface = block_i->interface; + option_vec *opts = &block_i->opts; send_to_help_buf (interface, FALSE); send_to_help_buf (":", 1, TRUE); - for (opt_i = 0; opt_i < n_opts; opt_i ++) + for (option_vec::iterator opt = opts->begin(); opt != opts->end(); opt ++) { const char *spaces = " "; int next_len, out_len; - option_t *opt = &opts[opt_i]; int opt_text_len; int same_line_p; @@ -286,91 +276,67 @@ void Executor::opt_register (string new_interface, - option_t *new_opts, int n_new_opts) + option_vec new_opts) { - int block_i; struct opt_block *block; - + if (help_buf) - { - /* internal error, must register all options before generating - help message */ - fprintf (ERRMSG_STREAM, "\ -%s: internal options error: opt register after help message generation.\n", - program_name); - exit (-16); - } + { + /* internal error, must register all options before generating + help message */ + fprintf (ERRMSG_STREAM, "\ + %s: internal options error: opt register after help message generation.\n", + program_name); + exit (-16); + } /* check for conflicting options */ - for (block_i = 0; block_i < n_opt_blocks; block_i ++) - { - string interface = opt_blocks[block_i].interface; - option_t *opts = opt_blocks[block_i].opts; - int n_opts = opt_blocks[block_i].n_opts; - int opt_i, new_opt_i; - - for (opt_i = 0; opt_i < n_opts; opt_i ++) - for (new_opt_i = 0; new_opt_i < n_new_opts; new_opt_i ++) - { - if ( (opts[opt_i].text == - new_opts[new_opt_i].text)) - { - /* conflicting options */ - fprintf (ERRMSG_STREAM, "\ -%s: opt internal error: `%s' and `%s' both request option `%s'\n", - program_name, - interface.c_str(), new_interface.c_str(), opts[opt_i].text.c_str()); - exit (-16); - } - } - } - - if (!opt_blocks) - { - n_opt_blocks = 0; - n_opt_blocks_max = 4; - opt_blocks = (struct opt_block*)malloc (n_opt_blocks_max * sizeof *opt_blocks); - } - else if (n_opt_blocks == n_opt_blocks_max) - { - n_opt_blocks_max *= 2; - opt_blocks = (struct opt_block*)realloc (opt_blocks, n_opt_blocks_max * sizeof *opt_blocks); - } + for (optBlocks::iterator blockIt = opt_blocks.begin(); blockIt != opt_blocks.end(); blockIt++) + { + string interface = blockIt->interface; + option_vec *opts = &blockIt->opts; + + for (option_vec::iterator opt_i = opts->begin(); opt_i != opts->end(); opt_i ++) + for (option_vec::iterator new_opt_i = new_opts.begin(); new_opt_i != new_opts.end(); new_opt_i ++) + { + if ( (opt_i->text == + new_opt_i->text)) + { + /* conflicting options */ + fprintf (ERRMSG_STREAM, "\ + %s: opt internal error: `%s' and `%s' both request option `%s'\n", + program_name, + interface.c_str(), new_interface.c_str(), opt_i->text.c_str()); + exit (-16); + } + } + } - block = &opt_blocks[n_opt_blocks ++]; + block = &opt_blocks.back(); block->interface = new_interface; block->opts = new_opts; - block->n_opts = n_new_opts; } -opt_database_t * +opt_database_t Executor::opt_alloc_db (void) { - opt_database_t *retval = (opt_database_t*)malloc(sizeof *retval); + opt_database_t retval = opt_database_t() ; - retval->opt_vals = NULL; - retval->n_opt_vals = 0; - /* default maximum */ - retval->max_opt_vals = 4; - return retval; } PRIVATE opt_val_t * -opt_lookup_helper (opt_database_t *db, string &opt) +opt_lookup_helper (opt_database_t &db, string &opt) { - opt_val_t *retval; - int i; - - retval = 0; + opt_val_t *retval = nullptr; /* try to find this option in the database */ - for (i = 0; i < db->n_opt_vals; i ++) + for (opt_database_t::iterator i = db.begin() ; i != db.end(); i ++) { - if (db->opt_vals[i].text == opt) + if (i->text == opt) { - retval = &db->opt_vals[i]; + retval = &*i; break; } } @@ -378,7 +344,7 @@ } opt_val_t * -opt_lookup (opt_database_t *db, string &opt) +opt_lookup (opt_database_t &db, string &opt) { opt_val_t *retval; @@ -414,51 +380,36 @@ } void -Executor::opt_put_val (opt_database_t *db, string &opt, string val, +Executor::opt_put_val (opt_database_t &db, string &opt, string val, priority_t pri, int temp_val_p) { - opt_val_t *opt_val; + opt_val_t *opt_val = opt_lookup_helper (db, opt); - opt_val = opt_lookup_helper (db, opt); if (!opt_val) - { - if (db->opt_vals) - { - /* this option is not yet in the database, add it */ - if (db->n_opt_vals == db->max_opt_vals) - { - /* allocate some new ones */ - db->max_opt_vals *= 2; - db->opt_vals = (opt_val_t*)realloc (db->opt_vals, - (sizeof *(db->opt_vals) - * db->max_opt_vals)); - } - } - else - { - db->opt_vals = (opt_val_t*)malloc (sizeof *(db->opt_vals) * db->max_opt_vals); - } - opt_val = &db->opt_vals[db->n_opt_vals ++]; - - opt_val->text = opt; - opt_val->val = ""; - opt_val->t_val = ""; - } + { + opt_val_t tmpVal; + tmpVal.text = opt; + tmpVal.val = ""; + tmpVal.t_val = ""; + db.push_back(tmpVal); + opt_val = &db.back(); + + } if (temp_val_p) - { - opt_val->t_val = val; - opt_val->t_pri = pri; - } + { + opt_val->t_val = val; + opt_val->t_pri = pri; + } else - { - opt_val->val = val; - opt_val->pri = pri; - } + { + opt_val->val = val; + opt_val->pri = pri; + } } void -Executor::opt_put_int_val (opt_database_t *db, string &opt, int valint, +Executor::opt_put_int_val (opt_database_t &db, string &opt, int valint, priority_t pri, int temp_val_p) { char *val, buf[256]; @@ -473,7 +424,7 @@ #define option_value(opt_val) ((opt_val)->t_val == "" ? "" : (opt_val)->val) int -Executor::opt_val (opt_database_t *db, string opt, string *retval) +Executor::opt_val (opt_database_t &db, string opt, string *retval) { opt_val_t *opt_val; string val = ""; @@ -500,7 +451,7 @@ * Returns TRUE if a value was found. */ int -Executor::opt_int_val (opt_database_t *db, string opt, int *retval, +Executor::opt_int_val (opt_database_t &db, string opt, int *retval, boolean_t *parse_error_p) { opt_val_t *opt_val; @@ -528,7 +479,7 @@ } int -Executor::opt_parse (opt_database_t *db, option_t *opts, int n_opts, +Executor::opt_parse (opt_database_t &db, option_vec opts, int *argc, char *argv[]) { int parse_error_p = FALSE; @@ -550,12 +501,10 @@ /* option */ if (*arg == '-') { - int opt_i; - /* find the option among the options */ - for (opt_i = 0; opt_i < n_opts; opt_i ++) + for (option_vec::iterator opt_i = opts.begin(); opt_i != opts.end(); opt_i ++) { - option_t *opt = &opts[opt_i]; + option_t *opt = &*opt_i; if (!strcmp (&arg[1], opt->text.c_str())) diff --git a/src/osutil.cpp b/src/osutil.cpp index 7251b339..87829beb 100644 --- a/src/osutil.cpp +++ b/src/osutil.cpp @@ -372,19 +372,19 @@ A1(PUBLIC trap, OSErrRET, SetDateTime, LONGINT, mactime) PRIVATE unsigned long long -secsinminutes (ULONGINT nminutes) +secsinminutes (unsigned long long nminutes) { return nminutes * 60; } PRIVATE unsigned long long -secsinhours (ULONGINT nhours) +secsinhours (unsigned long long nhours) { return nhours * secsinminutes((LONGINT) 60); } PRIVATE unsigned long long -secsindays (ULONGINT ndays) +secsindays (unsigned long long ndays) { return ndays * secsinhours((LONGINT) 24); } @@ -606,11 +606,11 @@ Executor::date_to_swapped_fields (long long mactime, INTEGER *yearp, INTEGER *mo A2(PUBLIC trap, void, Date2Secs, DateTimeRec *, d, LONGINT *, s) { - LONGINT l; + long long l; l = ROMlib_long_long_secs (CW (d->year), CW (d->month), CW (d->day), CW (d->hour), CW (d->minute), CW (d->second)); - *s = l; + *s = (LONGINT)l; } A2(PUBLIC trap, void, Secs2Date, LONGINT, mactime, DateTimeRec *, d) diff --git a/src/sound.cpp b/src/sound.cpp index 78c5ac55..67b43bf2 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -470,7 +470,7 @@ P4(PUBLIC, pascal trap OSErr, SndAddModifier, SndChannelPtr, chanp, typedef pascal BOOLEAN (*snthfp)(SndChannelPtr, SndCommand *, ModifierStubPtr); -static BOOLEAN callasynth(SndChannelPtr chanp, SndCommand *cmdp, ModifierStubPtr mp) +BOOLEAN callasynth(SndChannelPtr chanp, SndCommand *cmdp, ModifierStubPtr mp) { /* * NOTE: when we support sound, we'll have to check for known P_routines From d4834c34acad953c0093f03218e7b63f50934fbf Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sat, 9 Aug 2014 21:10:34 -0600 Subject: [PATCH 016/390] More C++ work. --- CocoaExecutor.xcodeproj/project.pbxproj | 70 ++- .../CocoaExecutor/NeXT Classes/NEXTmain.mm | 4 +- .../CocoaExecutor/NeXT Classes/SoundOSX.h | 2 +- .../sound/sdl/{sdl-sound.c => sdl-sound.cpp} | 186 +++----- src/config/sound/sdl/sdl-sound.h | 51 +- src/include/rsys/option.h | 1 + src/include/rsys/parseopt.h | 2 +- src/include/rsys/print.h | 8 +- src/include/rsys/sounddriver.h | 40 +- src/include/rsys/soundfake.h | 2 +- src/main.cpp | 449 +++++++++--------- src/option.mm | 11 +- src/prLowLevel.cpp | 21 +- src/prPrinting.cpp | 36 +- src/sounddriver.cpp | 27 +- src/soundfake.cpp | 3 +- 16 files changed, 492 insertions(+), 421 deletions(-) rename src/config/sound/sdl/{sdl-sound.c => sdl-sound.cpp} (64%) diff --git a/CocoaExecutor.xcodeproj/project.pbxproj b/CocoaExecutor.xcodeproj/project.pbxproj index 11702928..6addf0fe 100644 --- a/CocoaExecutor.xcodeproj/project.pbxproj +++ b/CocoaExecutor.xcodeproj/project.pbxproj @@ -18,6 +18,11 @@ 5500AB5B1985A66A00FF62C0 /* NEXTkeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB4A1985A66A00FF62C0 /* NEXTkeyboard.cpp */; }; 5500AB5C1985A66A00FF62C0 /* NEXTmain.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB4B1985A66A00FF62C0 /* NEXTmain.mm */; }; 5500AB5D1985A66A00FF62C0 /* NEXTprint.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB4C1985A66A00FF62C0 /* NEXTprint.mm */; }; + 553A7ED1199708A300DFF4F6 /* sdl-sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 553A7ECF199708A300DFF4F6 /* sdl-sound.cpp */; }; + 553A7ED6199709EE00DFF4F6 /* SDL_sound.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 553A7ED4199709EE00DFF4F6 /* SDL_sound.framework */; }; + 553A7ED7199709EE00DFF4F6 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 553A7ED5199709EE00DFF4F6 /* SDL.framework */; }; + 553A7ED9199716E900DFF4F6 /* SDL_sound.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 553A7ED4199709EE00DFF4F6 /* SDL_sound.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 553A7EDA199716E900DFF4F6 /* SDL.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 553A7ED5199709EE00DFF4F6 /* SDL.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 553B0B6C19888B690041B809 /* hfsHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98A31987FCBD00ADF159 /* hfsHelper.cpp */; }; 556062EB1988441700D6F0B2 /* xdata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99511987FCBF00ADF159 /* xdata.cpp */; }; 556062EC198844B800D6F0B2 /* xdblt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B99521987FCBF00ADF159 /* xdblt.cpp */; }; @@ -460,7 +465,6 @@ 559AF49F198ABFE600DE8472 /* Syn68k.c in Sources */ = {isa = PBXBuildFile; fileRef = 559AF49E198ABFE600DE8472 /* Syn68k.c */; }; 559AF4A0198AC14900DE8472 /* libsyn68k.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 558B9A571988049300ADF159 /* libsyn68k.a */; }; 559AF4A2198AC90F00DE8472 /* stub.c in Sources */ = {isa = PBXBuildFile; fileRef = 559AF4A1198AC90F00DE8472 /* stub.c */; }; - 559AF4A5198AC9AB00DE8472 /* rsys.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 556062F21988679400D6F0B2 /* rsys.framework */; }; 559AF4B5198AE0F400DE8472 /* mkexpandtables.c in Sources */ = {isa = PBXBuildFile; fileRef = 559AF4B4198AE0F400DE8472 /* mkexpandtables.c */; }; 559AF4B8198AF72B00DE8472 /* segment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B991E1987FCBE00ADF159 /* segment.cpp */; }; 559D530D198FFA44009E479A /* SpeechManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 559D530B198FFA44009E479A /* SpeechManager.cpp */; }; @@ -566,6 +570,18 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 553A7ED8199716D500DFF4F6 /* Copy Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 553A7ED9199716E900DFF4F6 /* SDL_sound.framework in Copy Frameworks */, + 553A7EDA199716E900DFF4F6 /* SDL.framework in Copy Frameworks */, + ); + name = "Copy Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; 557F30A219897619009873EB /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -695,6 +711,10 @@ 5500AC3F1985B31E00FF62C0 /* VDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VDriver.h; sourceTree = ""; }; 5500AC401985B31E00FF62C0 /* VRetraceMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VRetraceMgr.h; sourceTree = ""; }; 5500AC411985B31E00FF62C0 /* WindowMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = WindowMgr.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 553A7ECF199708A300DFF4F6 /* sdl-sound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "sdl-sound.cpp"; sourceTree = ""; }; + 553A7ED0199708A300DFF4F6 /* sdl-sound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "sdl-sound.h"; sourceTree = ""; }; + 553A7ED4199709EE00DFF4F6 /* SDL_sound.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_sound.framework; path = /Library/Frameworks/SDL_sound.framework; sourceTree = ""; }; + 553A7ED5199709EE00DFF4F6 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = ""; }; 556062F21988679400D6F0B2 /* rsys.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = rsys.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 556062F51988679400D6F0B2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 5560630F1988680000D6F0B2 /* aboutbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aboutbox.h; sourceTree = ""; }; @@ -1208,7 +1228,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 559AF4A5198AC9AB00DE8472 /* rsys.framework in Frameworks */, + 553A7ED6199709EE00DFF4F6 /* SDL_sound.framework in Frameworks */, + 553A7ED7199709EE00DFF4F6 /* SDL.framework in Frameworks */, 559AF4A0198AC14900DE8472 /* libsyn68k.a in Frameworks */, 557F308C19895414009873EB /* Carbon.framework in Frameworks */, 557F308A1989540D009873EB /* ApplicationServices.framework in Frameworks */, @@ -1307,10 +1328,10 @@ 55A742A1198D79DD00F1A8A5 /* SoundOSX.h */, 55A742A0198D79DD00F1A8A5 /* SoundOSX.cpp */, ); - indentWidth = 2; + indentWidth = 4; path = "NeXT Classes"; sourceTree = ""; - usesTabs = 0; + usesTabs = 1; }; 5500AB611985B31E00FF62C0 /* Executor-Mac headers */ = { isa = PBXGroup; @@ -1378,6 +1399,7 @@ name = "Executor-Mac headers"; path = ../../src/include; sourceTree = ""; + usesTabs = 0; }; 551EE33A198D5E1E004A3A41 /* Window Sources */ = { isa = PBXGroup; @@ -1591,6 +1613,18 @@ name = QuickDraw; sourceTree = ""; }; + 553A7ECE1997086800DFF4F6 /* SDL Sound */ = { + isa = PBXGroup; + children = ( + 553A7ECF199708A300DFF4F6 /* sdl-sound.cpp */, + 553A7ED0199708A300DFF4F6 /* sdl-sound.h */, + ); + indentWidth = 2; + name = "SDL Sound"; + path = ../../src/config/sound/sdl; + sourceTree = ""; + usesTabs = 0; + }; 556062F31988679400D6F0B2 /* rsys */ = { isa = PBXGroup; children = ( @@ -1763,9 +1797,11 @@ 556062F41988679400D6F0B2 /* Supporting Files */, 559AF4A1198AC90F00DE8472 /* stub.c */, ); + indentWidth = 2; name = rsys; path = src/include/rsys; sourceTree = ""; + usesTabs = 0; }; 556062F41988679400D6F0B2 /* Supporting Files */ = { isa = PBXGroup; @@ -1813,6 +1849,8 @@ 556E040519856E5700FC4362 /* Frameworks */ = { isa = PBXGroup; children = ( + 553A7ED4199709EE00DFF4F6 /* SDL_sound.framework */, + 553A7ED5199709EE00DFF4F6 /* SDL.framework */, 557F308B19895414009873EB /* Carbon.framework */, 557F308819895405009873EB /* CoreServices.framework */, 558B98511987F5BA00ADF159 /* IOKit.framework */, @@ -1842,6 +1880,7 @@ 5500AB371985A66A00FF62C0 /* NeXT Classes */, 556E05461985847000FC4362 /* Interface Maps */, 557F3090198974E4009873EB /* Templates */, + 553A7ECE1997086800DFF4F6 /* SDL Sound */, 5500AB321985911A00FF62C0 /* x86_64.cpp */, 556E041E19856E5700FC4362 /* Images.xcassets */, 558B9A511987FCDF00ADF159 /* skel */, @@ -2106,6 +2145,7 @@ name = "Executor-Mac sources"; path = ../../src; sourceTree = ""; + usesTabs = 0; }; 558B9A5B198804BF00ADF159 /* syn68k */ = { isa = PBXGroup; @@ -2351,6 +2391,7 @@ 556E03FF19856E5700FC4362 /* Sources */, 556E040019856E5700FC4362 /* Frameworks */, 556E040119856E5700FC4362 /* Resources */, + 553A7ED8199716D500DFF4F6 /* Copy Frameworks */, ); buildRules = ( 5500AB2C19858B8F00FF62C0 /* PBXBuildRule */, @@ -2917,6 +2958,7 @@ 556E0558198584DE00FC4362 /* arrow_down_inactive.map in Sources */, 559D5311198FFAE1009E479A /* SpeechManager-MacBridge.cpp in Sources */, 558B9A081987FCBF00ADF159 /* qText.cpp in Sources */, + 553A7ED1199708A300DFF4F6 /* sdl-sound.cpp in Sources */, 558B9A381987FCBF00ADF159 /* teMisc.cpp in Sources */, 553B0B6C19888B690041B809 /* hfsHelper.cpp in Sources */, ); @@ -3234,15 +3276,23 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = NO; COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(LOCAL_LIBRARY_DIR)/Frameworks", + ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "OSX-only/CocoaExecutor/CocoaExecutor-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( - Sound_MACOSX_, _DARWIN_NO_64_BIT_INODE, "$(inherited)", ); + GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ( + Sound_SDL_Sound, + Sound_MACOSX_, + ); HEADER_SEARCH_PATHS = ( "OSX-only/syn68k", + /Library/Frameworks/SDL.framework/Headers, "$(inherited)", ); INFOPLIST_FILE = "OSX-only/CocoaExecutor/CocoaExecutor-Info.plist"; @@ -3259,15 +3309,23 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = NO; COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(LOCAL_LIBRARY_DIR)/Frameworks", + ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "OSX-only/CocoaExecutor/CocoaExecutor-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( - Sound_MACOSX_, _DARWIN_NO_64_BIT_INODE, "$(inherited)", ); + GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ( + Sound_SDL_Sound, + Sound_MACOSX_, + ); HEADER_SEARCH_PATHS = ( "OSX-only/syn68k", + /Library/Frameworks/SDL.framework/Headers, "$(inherited)", ); INFOPLIST_FILE = "OSX-only/CocoaExecutor/CocoaExecutor-Info.plist"; diff --git a/OSX-only/CocoaExecutor/NeXT Classes/NEXTmain.mm b/OSX-only/CocoaExecutor/NeXT Classes/NEXTmain.mm index 9bb83ea6..605cc2f1 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/NEXTmain.mm +++ b/OSX-only/CocoaExecutor/NeXT Classes/NEXTmain.mm @@ -97,6 +97,7 @@ void ROMlib_checkadb( void ) * or we need to use some thread routines. */ +#warning This code is too processor-specific! #if defined(mc68000) asm("movel #cont, sp@-" "\n\tmoveml d2-d7/a2-a6, sp@-" @@ -109,8 +110,7 @@ void ROMlib_checkadb( void ) "\n\tmoveml sp@+, d2-d7/a2-a6" "\n\trts" "\n\tcont:" : "=m" (*from_spp) : "m" (*to_spp)); -#warning This code is too processor-specific! -#elif defined(i386) || defined(i486) +#elif defined(i386) || defined(i486) || defined(__i386__) asm("pushl $cont\n\t" "pushal\n\t" "pushfl\n\t" diff --git a/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h b/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h index 05c61187..7d95fa07 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h +++ b/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h @@ -16,7 +16,7 @@ #include "rsys/sounddriver.h" namespace Executor { - class SoundOSX : SoundDriver { + class SoundOSX : public SoundDriver { public: virtual bool sound_init(); virtual void sound_shutdown(); diff --git a/src/config/sound/sdl/sdl-sound.c b/src/config/sound/sdl/sdl-sound.cpp similarity index 64% rename from src/config/sound/sdl/sdl-sound.c rename to src/config/sound/sdl/sdl-sound.cpp index aa518d52..f869ef4d 100644 --- a/src/config/sound/sdl/sdl-sound.c +++ b/src/config/sound/sdl/sdl-sound.cpp @@ -21,24 +21,10 @@ #include "rsys/sounddriver.h" #include "rsys/m68kint.h" #include "sdl-sound.h" +#include -#define LOGBUFSIZE 11 /* Must be between 7 and 17 decimal */ - -/* - * There's what appears to be a bug in some of the SDLs out there that - * results in SDL choosing to use one half the number of samples that we ask - * for. As such, we're going to make room for twice the amount we want and - * then ask for twice the amount. If we get it, oh well, it just means - * more latency. - */ - -static int num_samples; - -#define BUFSIZE (1 << (LOGBUFSIZE+1)) /* +1 as bug workaround */ - -static int semid = -1; /* Semaphore id */ -static int sound_on = 0; /* 1 if we are generating interrupts */ -static boolean_t have_sound_p; /* TRUE if sound is supported */ +using namespace Executor; +using namespace ByteSwap; enum { NON_RUNNING_SOUND_RATE = 22255 }; @@ -55,17 +41,10 @@ ROMlib_set_sdl_audio_driver_name (const char *str) sdl_audio_driver_name = NULL; } -PUBLIC int ROMlib_SND_RATE = - NON_RUNNING_SOUND_RATE; /* we need to set this to something, - in case we don't succeed when we - try to initialize. May as well set - it to the common Mac value. */ - - /* Wait on the semaphore (atomic decrement) */ -static void -patl_wait (void) +void +SDLSound::patl_wait (void) { struct sembuf op_wait[] = { { 0, -1, 0 } }; @@ -82,8 +61,8 @@ patl_wait (void) /* Signal the semaphore (atomic increment) */ -static void -patl_signal (void) +void +SDLSound::patl_signal (void) { struct sembuf op_signal[] = { { 0, 1, 0 } }; @@ -96,43 +75,39 @@ patl_signal (void) } } -static snd_time t1 = 0; - -static boolean_t -sound_sdl_works_p (sound_driver_t *s) +bool +SDLSound::sound_works () { return have_sound_p; } -static void -sound_sdl_go (sound_driver_t *s) +void +SDLSound::sound_go () { sound_on = 1; patl_signal (); - SDL_PauseAudio(0); + SDL_PauseAudio(0); } -static void -sound_sdl_stop (sound_driver_t *s) +void +SDLSound::sound_stop () { sound_on = 0; } /* Do any bookkeeping needed to start feeding a hungry device */ -static void -sound_sdl_hunger_start (sound_driver_t *s) +void +SDLSound::HungerStart() { t1 += num_samples; } -static unsigned char buf[7*BUFSIZE]; - /* Figure out how to feed the hungry output device. */ -static struct hunger_info -sound_sdl_get_hunger_info (sound_driver_t *s) +struct hunger_info +SDLSound::GetHungerInfo () { struct hunger_info info; @@ -146,15 +121,12 @@ sound_sdl_get_hunger_info (sound_driver_t *s) return info; } -PRIVATE Uint8 *sdl_stream = NULL; - -static ssize_t -sdl_write (const void *buf, size_t len) +ssize_t +SDLSound::sdl_write (const void *buf, size_t len) { // fprintf (stderr, "sdl_write: stream = %p, len = %d, buf[0]= 0x%02x, buf[1] = 0x%02x\n", sdl_stream, (int) len, ((uint8_t *) buf)[0], ((uint8_t *) buf)[1]); - if (sdl_stream) - { + if (sdl_stream) { memcpy (sdl_stream, buf, len); sdl_stream = NULL; } @@ -165,16 +137,15 @@ sdl_write (const void *buf, size_t len) /* Assuming that the information returned by snd_get_hunger_info was honored, send the samples off to the device. */ -static void -sound_sdl_hunger_finish (sound_driver_t *s) +void +SDLSound::HungerFinish () { struct hunger_info info; - info = sound_sdl_get_hunger_info (s); + info = GetHungerInfo(); while (sdl_write (info.buf + (info.t2 % info.bufsize), num_samples) - < 0) - { + < 0) { if (errno != EINTR) gui_fatal ("Write failed"); } @@ -191,11 +162,11 @@ union semun }; #endif -static void -sound_sdl_shutdown (sound_driver_t *s) +void +SDLSound::sound_shutdown () { if (semid >= 0) - semctl (semid, 0, IPC_RMID, (union semun)0); + semctl (semid, 0, IPC_RMID, (union semun){.val = 0}); if (have_sound_p) { @@ -206,25 +177,25 @@ sound_sdl_shutdown (sound_driver_t *s) sdl_stream = NULL; } -static void -sound_sdl_clear_pending (sound_driver_t *s) +void +SDLSound::sound_clear_pending () { } -static boolean_t -sound_sdl_silent_p (sound_driver_t *s) +bool +SDLSound::sound_silent () { return FALSE; } -static void -sound_sdl_shutdown_at_exit (void) +void +SDLSound::sound_sdl_shutdown_at_exit (void) { - sound_sdl_shutdown (&sound_driver); + SOUND_SHUTDOWN(); } -PRIVATE void -sdl_wait_until_callback_has_been_called (void) +void +SDLSound::sdl_wait_until_callback_has_been_called (void) { #warning TODO usleep is not the answer while (sdl_stream == 0) @@ -235,29 +206,29 @@ sdl_wait_until_callback_has_been_called (void) is ready to accept input, then set a flag for the emulator thread. */ -static void * -loop (void *unused) +void * +SDLSound::loop (void *unused) { - while (TRUE) - { - patl_wait (); - // fprintf (stderr, "waiting until callback has been called\n"); - sdl_wait_until_callback_has_been_called (); - - /* Request interrupt */ - if (sound_on) - { - cpu_state.interrupt_pending[M68K_SOUND_PRIORITY] = 1; - cpu_state.interrupt_status_changed = INTERRUPT_STATUS_CHANGED; - } + while (TRUE) { + SDLSound *ourSelf = (SDLSound *)unused; + ourSelf->patl_wait (); + // fprintf (stderr, "waiting until callback has been called\n"); + ourSelf->sdl_wait_until_callback_has_been_called (); + + /* Request interrupt */ + if (ourSelf->sound_on) { + cpu_state.interrupt_pending[M68K_SOUND_PRIORITY] = 1; + cpu_state.interrupt_status_changed = INTERRUPT_STATUS_CHANGED; } + } return NULL; /* won't get here */ } -static void -sound_sdl_hunger_callback(void *unused, Uint8 *stream, int len) +void +SDLSound::hunger_callback(void *unused, Uint8 *stream, int len) { + SDLSound *ourself = (SDLSound *)unused; // FILE *fp; // int fd; @@ -270,29 +241,38 @@ sound_sdl_hunger_callback(void *unused, Uint8 *stream, int len) // close (fd); // fprintf (stderr, "callback: stream = %p\n", stream); - if (len != num_samples) - gui_fatal ("len = %d, expected %d", len, num_samples); - sdl_stream = stream; - while (sdl_stream != 0) + if (len != ourself->num_samples) + gui_fatal ("len = %d, expected %d", len, ourself->num_samples); + ourself->sdl_stream = stream; + while (ourself->sdl_stream != 0) usleep (1); #warning TODO signal something to say that we can write } -boolean_t -sound_sdl_init (sound_driver_t *s) +bool +SDLSound::sound_init () { SDL_AudioSpec spec; syn68k_addr_t my_callback; int sysret; + semid = -1; /* Semaphore id */ + sound_on = 0; /* 1 if we are generating interrupts */ + t1 = 0; + sdl_stream = NULL; + ROMlib_SND_RATE = + NON_RUNNING_SOUND_RATE; /* we need to set this to something, + in case we don't succeed when we + try to initialize. May as well set + it to the common Mac value. */ + have_sound_p = FALSE; if (sound_disabled_p) goto fail; - if (SDL_AudioInit (sdl_audio_driver_name) != 0) - { - char *err; + if (SDL_AudioInit (sdl_audio_driver_name) != 0) { + const char *err; err = SDL_GetError (); fprintf (stderr, "SDL_Init(SDL_INIT_AUDIO) failed: '%s'\n", @@ -310,11 +290,10 @@ sound_sdl_init (sound_driver_t *s) SDL_AudioDriverName. It doesn't hurt to add 3 here. */ sanity_len = strlen (sdl_audio_driver_name) + 3; - sanity_check_name = alloca (sanity_len); + sanity_check_name = (char *)alloca (sanity_len); SDL_AudioDriverName (sanity_check_name, sanity_len); success = strcmp (sdl_audio_driver_name, sanity_check_name) == 0; - if (!success) - { + if (!success) { fprintf (stderr, "Wanted '%s', got '%s'", sdl_audio_driver_name, sanity_check_name); return FALSE; @@ -327,8 +306,8 @@ sound_sdl_init (sound_driver_t *s) spec.format = AUDIO_U8; spec.channels = 1; spec.samples = BUFSIZE; - spec.callback = sound_sdl_hunger_callback; - spec.userdata = NULL; + spec.callback = hunger_callback; + spec.userdata = this; #if !defined (HAS_OPENAUDIO_EX) #define SDL_OpenAudioEx(a,b,c,d) SDL_OpenAudio (a, b) @@ -369,7 +348,7 @@ sound_sdl_init (sound_driver_t *s) atexit (sound_sdl_shutdown_at_exit); /* make sure semid gets freed */ my_callback = callback_install (sound_callback, NULL); - *(syn68k_addr_t *) SYN68K_TO_US(M68K_SOUND_VECTOR * 4) = CL (my_callback); + *(syn68k_addr_t *) SYN68K_TO_US(M68K_SOUND_VECTOR * 4) = BigEndianValue (my_callback); { sigset_t all_signals, current_mask; @@ -379,7 +358,7 @@ sound_sdl_init (sound_driver_t *s) sigdelset (&all_signals, SIGIO); sigprocmask (SIG_SETMASK, &all_signals, ¤t_mask); // fprintf (stderr, "about to start thread\n"); - sysret = pthread_create (&thread, NULL, loop, NULL); + sysret = pthread_create (&thread, NULL, loop, this); sigprocmask (SIG_SETMASK, ¤t_mask, 0); } if (sysret != 0) @@ -389,17 +368,6 @@ sound_sdl_init (sound_driver_t *s) have_sound_p = TRUE; - s->sound_init = sound_sdl_init; - s->sound_shutdown = sound_sdl_shutdown; - s->sound_works_p = sound_sdl_works_p; - s->sound_silent_p = sound_sdl_silent_p; - s->sound_hunger_finish = sound_sdl_hunger_finish; - s->sound_go = sound_sdl_go; - s->sound_stop = sound_sdl_stop; - s->sound_hunger_start = sound_sdl_hunger_start; - s->sound_get_hunger_info = sound_sdl_get_hunger_info; - s->sound_clear_pending = sound_sdl_clear_pending; - /* Success! */ return TRUE; diff --git a/src/config/sound/sdl/sdl-sound.h b/src/config/sound/sdl/sdl-sound.h index 0effda09..a0eb0fa9 100644 --- a/src/config/sound/sdl/sdl-sound.h +++ b/src/config/sound/sdl/sdl-sound.h @@ -3,9 +3,58 @@ #define SOUND_SDL +#include #include "rsys/sounddriver.h" -extern boolean_t sound_sdl_init (sound_driver_t *s); +namespace Executor { + +#define LOGBUFSIZE 11 /* Must be between 7 and 17 decimal */ + + /* + * There's what appears to be a bug in some of the SDLs out there that + * results in SDL choosing to use one half the number of samples that we ask + * for. As such, we're going to make room for twice the amount we want and + * then ask for twice the amount. If we get it, oh well, it just means + * more latency. + */ + +#define BUFSIZE (1 << (LOGBUFSIZE+1)) /* +1 as bug workaround */ + + class SDLSound : public SoundDriver { + public: + virtual bool sound_init(); + virtual void sound_shutdown(); + virtual bool sound_works(); + virtual bool sound_silent(); + virtual void sound_go(); + virtual void sound_stop(); + virtual void HungerStart(); + virtual struct hunger_info GetHungerInfo(); + virtual void HungerFinish(); + virtual void sound_clear_pending(); + virtual bool HasSoundClearPending() { return true; } + + private: + int num_samples; + + int semid; /* Semaphore id */ + int sound_on; /* 1 if we are generating interrupts */ + bool have_sound_p; /* TRUE if sound is supported */ + + unsigned char buf[7*BUFSIZE]; + void patl_wait(); + void patl_signal (void); + snd_time t1; + Uint8 *sdl_stream; + ssize_t sdl_write (const void *buf, size_t len); + void sdl_wait_until_callback_has_been_called (void); + static void sound_sdl_shutdown_at_exit (void); + static void *loop (void *unused); + static void hunger_callback(void *unused, Uint8 *stream, int len); + }; +} + +//extern boolean_t sound_sdl_init (sound_driver_t *s); extern void ROMlib_set_sdl_audio_driver_name (const char *str); #endif /* !_SDL_SOUND_H_ */ diff --git a/src/include/rsys/option.h b/src/include/rsys/option.h index a737c900..921891d8 100644 --- a/src/include/rsys/option.h +++ b/src/include/rsys/option.h @@ -99,6 +99,7 @@ void opt_put_int_val (opt_database_t &db, std::string &opt, int value, char *opt_help_message (void); void opt_register_pre_note (char *note); +void opt_register_pre_note (std::string note); extern uint32 parse_drive_opt (const char *opt_name, const char *opt_value); extern FILE * executor_dir_fopen (const char *file, const char *perm); diff --git a/src/include/rsys/parseopt.h b/src/include/rsys/parseopt.h index ce000b8d..f226e900 100644 --- a/src/include/rsys/parseopt.h +++ b/src/include/rsys/parseopt.h @@ -2,7 +2,7 @@ #define _RSYS_PARSEOPT_H_ namespace Executor { extern boolean_t parse_system_version (std::string vers); - extern boolean_t parse_size_opt (std::string opt, std::string arg); +extern boolean_t parse_size_opt (std::string opt, std::string arg); extern boolean_t parse_prres_opt (Executor::INTEGER *outx, Executor::INTEGER *outy, std::string arg); extern boolean_t ROMlib_parse_version (std::string vers, uint32 *version_out); diff --git a/src/include/rsys/print.h b/src/include/rsys/print.h index 78b87a9b..35db2197 100644 --- a/src/include/rsys/print.h +++ b/src/include/rsys/print.h @@ -180,11 +180,11 @@ TCenterRec, *TCenterRecPtr; MAKE_HIDDEN(TCenterRecPtr); typedef HIDDEN_TCenterRecPtr *TCenterRecHdl; -extern char *ROMlib_document_paper_sizes; +extern std::string ROMlib_document_paper_sizes; extern ini_key_t ROMlib_paper_orientation; -extern char *ROMlib_paper_size; -extern const char *ROMlib_paper_size_name; -extern const char *ROMlib_paper_size_name_terminator; +extern std::string ROMlib_paper_size; +extern std::string ROMlib_paper_size_name; +extern std::string ROMlib_paper_size_name_terminator; extern int ROMlib_rotation; extern int ROMlib_translate_x; extern int ROMlib_translate_y; diff --git a/src/include/rsys/sounddriver.h b/src/include/rsys/sounddriver.h index 9f1b9d7c..cca6ad41 100644 --- a/src/include/rsys/sounddriver.h +++ b/src/include/rsys/sounddriver.h @@ -6,17 +6,17 @@ namespace Executor { class SoundDriver { public: - virtual bool sound_init() = 0; - virtual void sound_shutdown() = 0; - virtual bool sound_works() = 0; - virtual bool sound_silent() = 0; - virtual void sound_go() = 0; - virtual void sound_stop() = 0; - virtual void HungerStart() = 0; - virtual struct hunger_info GetHungerInfo() = 0; - virtual void HungerFinish() = 0; - virtual void sound_clear_pending() = 0; - virtual bool HasSoundClearPending() = 0; + virtual bool sound_init() = 0; + virtual void sound_shutdown() = 0; + virtual bool sound_works() = 0; + virtual bool sound_silent() = 0; + virtual void sound_go() = 0; + virtual void sound_stop() = 0; + virtual void HungerStart() = 0; + virtual struct hunger_info GetHungerInfo() = 0; + virtual void HungerFinish() = 0; + virtual void sound_clear_pending() = 0; + virtual bool HasSoundClearPending() = 0; }; /* Current sound driver in use. */ @@ -26,15 +26,15 @@ extern void sound_init (void); #define _SOUND_CALL(func) (sound_driver->func ()) -#define SOUND_SHUTDOWN() _SOUND_CALL (sound_shutdown) -#define SOUND_WORKS_P() _SOUND_CALL (sound_works) -#define SOUND_SILENT_P() _SOUND_CALL (sound_silent) -#define SOUND_HUNGER_FINISH() _SOUND_CALL (HungerFinish) -#define SOUND_GO() _SOUND_CALL (sound_go) -#define SOUND_STOP() _SOUND_CALL (sound_stop) -#define SOUND_HUNGER_START() _SOUND_CALL (HungerStart) -#define SOUND_GET_HUNGER_INFO() _SOUND_CALL (GetHungerInfo) -#define SOUND_CLEAR_PENDING() _SOUND_CALL (sound_clear_pending) +#define SOUND_SHUTDOWN() _SOUND_CALL (sound_shutdown) +#define SOUND_WORKS_P() _SOUND_CALL (sound_works) +#define SOUND_SILENT_P() _SOUND_CALL (sound_silent) +#define SOUND_HUNGER_FINISH() _SOUND_CALL (HungerFinish) +#define SOUND_GO() _SOUND_CALL (sound_go) +#define SOUND_STOP() _SOUND_CALL (sound_stop) +#define SOUND_HUNGER_START() _SOUND_CALL (HungerStart) +#define SOUND_GET_HUNGER_INFO() _SOUND_CALL (GetHungerInfo) +#define SOUND_CLEAR_PENDING() _SOUND_CALL (sound_clear_pending) } #include "sound-config.h" diff --git a/src/include/rsys/soundfake.h b/src/include/rsys/soundfake.h index 45e233be..7839f200 100644 --- a/src/include/rsys/soundfake.h +++ b/src/include/rsys/soundfake.h @@ -5,7 +5,7 @@ #include "TimeMgr.h" namespace Executor { - class SoundFake: SoundDriver { + class SoundFake: public SoundDriver { public: virtual bool sound_init(); virtual void sound_shutdown(); diff --git a/src/main.cpp b/src/main.cpp index 178e2395..4f62f43d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -473,12 +473,12 @@ print_command_line_value (FILE *fp, int v) } static void -check_arg (char *argname, int *arg, int min, int max) +check_arg (string argname, int *arg, int min, int max) { if (*arg < min || *arg > max) { fprintf (stderr, "%s: invalid value for `%s': must be between ", - program_name, argname); + program_name, argname.c_str()); print_command_line_value (stderr, min); fputs (" and ", stderr); print_command_line_value (stderr, max); @@ -1288,9 +1288,9 @@ int main(int argc, char** argv) INTEGER i; static unsigned short jmpl_to_ResourceStub[3] = - { - CWC ((unsigned short)0x4EF9), 0, 0 /* Filled in below. */ - }; + { + CWC ((unsigned short)0x4EF9), 0, 0 /* Filled in below. */ + }; long l; ULONGINT save_trap_vectors[64]; virtual_int_state_t int_state; @@ -1300,10 +1300,10 @@ int main(int argc, char** argv) boolean_t check_files_p; /* See if FILES= is big enough? */ #endif static void (*reg_funcs[]) (void) = - { - vdriver_opt_register, - NULL, - }; + { + vdriver_opt_register, + NULL, + }; string arg; #if defined(PERSONALITY_HACK) @@ -1311,18 +1311,18 @@ int main(int argc, char** argv) pers = personality(0xffffffff); if ((pers & MMAP_PAGE_ZERO) == 0) - { - if (personality(pers|MMAP_PAGE_ZERO|READ_IMPLIES_EXEC) == 0) - execv(argv[0], argv); - } + { + if (personality(pers|MMAP_PAGE_ZERO|READ_IMPLIES_EXEC) == 0) + execv(argv[0], argv); + } #endif - + int grayscale_p = FALSE; #if defined (DISPLAY_SPLASH_SCREEN) boolean_t splash_screen_displayed_p; -#endif +#endif #if defined (VDRIVER_SVGALIB) /* We need to do this right away, to give up suid root privileges. */ @@ -1341,21 +1341,19 @@ int main(int argc, char** argv) ROMlib_do_custom (); ROMlib_command_line = construct_command_line_string (argc, argv); - if (!arch_init ()) - { - fprintf (stderr, "Unable to initialize CPU information.\n"); - exit (-100); - } + if (!arch_init ()) { + fprintf (stderr, "Unable to initialize CPU information.\n"); + exit (-100); + } + + if (!os_init ()) { + fprintf (stderr, "Unable to initialize operating system features.\n"); + exit (-101); + } - if (!os_init ()) - { - fprintf (stderr, "Unable to initialize operating system features.\n"); - exit (-101); - } - { char *t; - + t = strrchr (*argv, '/'); if (t) program_name = &t[1]; @@ -1376,7 +1374,7 @@ int main(int argc, char** argv) ROMlib_WriteWhen (WriteInOSEvent); -#if defined (MACOSX_) +#if defined (MACOSX_) && 0 ROMlib_seteuid (0); /* This is necessary because when people copy setuid-root files from floppies, the setuid bit stays, but the "root" part doesn't, so @@ -1406,31 +1404,29 @@ int main(int argc, char** argv) opt_register_pre_note ("welcome to the executor help message."); opt_register_pre_note ("usage: `executor [option...] " - "[program [document1 document2 ...]]'"); + "[program [document1 document2 ...]]'"); for (i = 0; reg_funcs[i]; i ++) (*reg_funcs[i]) (); if (!bad_arg_p) bad_arg_p = opt_parse (common_db, common_opts, - &argc, argv); + &argc, argv); - if (opt_val (common_db, "version", NULL)) - { - fprintf (stdout, "%s\n", EXECUTOR_VERSION); - exit (0); - } + if (opt_val (common_db, "version", NULL)) { + fprintf (stdout, "%s\n", EXECUTOR_VERSION); + exit (0); + } -/* - * If they ask for help, it's not an error -- it should go to stdout - */ + /* + * If they ask for help, it's not an error -- it should go to stdout + */ - if (opt_val (common_db, "help", NULL)) - { - fprintf (stdout, "%s", opt_help_message ()); - exit (0); - } + if (opt_val (common_db, "help", NULL)) { + fprintf (stdout, "%s", opt_help_message ()); + exit (0); + } /* Verify that the user input a legal bits per pixel. "0" is a legal * value here; that means "use the vdriver's default." @@ -1439,10 +1435,10 @@ int main(int argc, char** argv) if (flag_bpp != 0 && flag_bpp != 1 && flag_bpp != 2 && flag_bpp != 4 && flag_bpp != 8 && flag_bpp != 16 && flag_bpp != 32) - { - fprintf (stderr, "Bits per pixel must be 1, 2, 4, 8, 16 or 32.\n"); - bad_arg_p = TRUE; - } + { + fprintf (stderr, "Bits per pixel must be 1, 2, 4, 8, 16 or 32.\n"); + bad_arg_p = TRUE; + } #if defined (SDL) if (opt_val (common_db, "fullscreen", NULL)) @@ -1480,7 +1476,7 @@ int main(int argc, char** argv) if (opt_val (common_db, "prres", &arg)) bad_arg_p |= !parse_prres_opt (&ROMlib_optional_res_x, - &ROMlib_optional_res_y, arg); + &ROMlib_optional_res_y, arg); if (opt_val (common_db, "debug", &arg)) bad_arg_p |= !error_parse_option_string (arg); @@ -1488,40 +1484,37 @@ int main(int argc, char** argv) #if defined (MSDOS) || defined (CYGWIN32) if (opt_val (common_db, "macdrives", &arg)) ROMlib_macdrives = parse_drive_opt ("macdrives", arg); - else - { + else { #if !defined (CYGWIN32) - ROMlib_macdrives = 3; /* A: + B: */ - { - int cdrom; + ROMlib_macdrives = 3; /* A: + B: */ + { + int cdrom; - cdrom = dosdisk_find_cdrom (); - if (cdrom != -1) - ROMlib_macdrives |= (1 << cdrom); - } + cdrom = dosdisk_find_cdrom (); + if (cdrom != -1) + ROMlib_macdrives |= (1 << cdrom); + } #else - char buf[512]; + char buf[512]; - if (win_GetLogicalDriveStrings (sizeof buf - 1, buf)) - { + if (win_GetLogicalDriveStrings (sizeof buf - 1, buf)) { char *p; for (p = buf; *p; p += strlen (p) + 1) - if (win_direct_accessible_disk (p)) - ROMlib_macdrives |= win_drive_to_bit (p); + if (win_direct_accessible_disk (p)) + ROMlib_macdrives |= win_drive_to_bit (p); } #endif - } + } if (opt_val (common_db, "dosdrives", &arg)) ROMlib_dosdrives = parse_drive_opt ("dosdrives", arg); - if (opt_val (common_db, "skipdrives", &arg)) - { - skipdrives = parse_drive_opt ("skipdrives", arg); - ROMlib_macdrives &= ~skipdrives; - ROMlib_dosdrives &= ~skipdrives; - } + if (opt_val (common_db, "skipdrives", &arg)) { + skipdrives = parse_drive_opt ("skipdrives", arg); + ROMlib_macdrives &= ~skipdrives; + ROMlib_dosdrives &= ~skipdrives; + } #endif @@ -1529,10 +1522,10 @@ int main(int argc, char** argv) { int dangerous_video_p = FALSE; opt_int_val (common_db, "dangerousvideospeedup", - &dangerous_video_p, &bad_arg_p); + &dangerous_video_p, &bad_arg_p); if (!dangerous_video_p) opt_int_val (common_db, "videospeedup", - &dangerous_video_p, &bad_arg_p); + &dangerous_video_p, &bad_arg_p); try_to_use_fat_ds_vga_hack_p = dangerous_video_p; } @@ -1561,23 +1554,20 @@ int main(int argc, char** argv) dcache_set_enabled (!nocache); } -#if defined (SYN68K) +#if defined (SYN68K) use_native_code_p = ! opt_val (common_db, "notnative", NULL); -#endif +#endif afpd_conventions_p = opt_val (common_db, "afpd", NULL); netatalk_conventions_p = (afpd_conventions_p || opt_val (common_db, "netatalk", NULL)); - if (netatalk_conventions_p) - { - apple_double_quote_char = ':'; - apple_double_fork_prefix = ".AppleDouble/"; - } - else - { - apple_double_quote_char = '%'; - apple_double_fork_prefix = "%"; - } + if (netatalk_conventions_p) { + apple_double_quote_char = ':'; + apple_double_fork_prefix = ".AppleDouble/"; + } else { + apple_double_quote_char = '%'; + apple_double_fork_prefix = "%"; + } apple_double_fork_prefix_length = strlen (apple_double_fork_prefix); substitute_fonts_p = !opt_val (common_db, "cities", NULL); @@ -1600,53 +1590,52 @@ int main(int argc, char** argv) /* Parse the "-memory" option. */ { int total_memory; - if (opt_int_val (common_db, "memory", &total_memory, &bad_arg_p)) - { - check_arg ("memory", &total_memory, - (MIN_APPLZONE_SIZE + DEFAULT_SYSZONE_SIZE - + DEFAULT_STACK_SIZE), - (MAX_APPLZONE_SIZE + DEFAULT_SYSZONE_SIZE - + DEFAULT_STACK_SIZE)); - - /* Set up the three memory sizes appropriately. For now we - * just allocate the defaults for syszone and stack, and - * put everything else in -applzone. - */ - ROMlib_syszone_size = DEFAULT_SYSZONE_SIZE; - ROMlib_stack_size = DEFAULT_STACK_SIZE; - ROMlib_applzone_size = (total_memory - ROMlib_syszone_size - - ROMlib_stack_size); - } + if (opt_int_val (common_db, "memory", &total_memory, &bad_arg_p)) { + check_arg ("memory", &total_memory, + (MIN_APPLZONE_SIZE + DEFAULT_SYSZONE_SIZE + + DEFAULT_STACK_SIZE), + (MAX_APPLZONE_SIZE + DEFAULT_SYSZONE_SIZE + + DEFAULT_STACK_SIZE)); + + /* Set up the three memory sizes appropriately. For now we + * just allocate the defaults for syszone and stack, and + * put everything else in -applzone. + */ + ROMlib_syszone_size = DEFAULT_SYSZONE_SIZE; + ROMlib_stack_size = DEFAULT_STACK_SIZE; + ROMlib_applzone_size = (total_memory - ROMlib_syszone_size + - ROMlib_stack_size); + } } - + /* I bumped the minimal ROMlib_applzone to 512, since Loser needs - more than 256. I guess it's a little unfair to people who bypass - Loser, but it will prevent confusion. */ + more than 256. I guess it's a little unfair to people who bypass + Loser, but it will prevent confusion. */ opt_int_val (common_db, "applzone", &ROMlib_applzone_size, &bad_arg_p); if (ROMlib_applzone_size < 65536) note_memory_syntax_change ("applzone", ROMlib_applzone_size); else check_arg ("applzone", &ROMlib_applzone_size, MIN_APPLZONE_SIZE, - MAX_APPLZONE_SIZE); - + MAX_APPLZONE_SIZE); + opt_int_val (common_db, "syszone", &ROMlib_syszone_size, &bad_arg_p); if (ROMlib_syszone_size < 65536) note_memory_syntax_change ("syszone", ROMlib_syszone_size); else check_arg ("syszone", &ROMlib_syszone_size, MIN_SYSZONE_SIZE, - MAX_SYSZONE_SIZE); + MAX_SYSZONE_SIZE); opt_int_val (common_db, "stack", &ROMlib_stack_size, &bad_arg_p); if (ROMlib_stack_size < 32768) note_memory_syntax_change ("stack", ROMlib_stack_size); else check_arg ("stack", &ROMlib_stack_size, MIN_STACK_SIZE, MAX_STACK_SIZE); - + #if defined (MM_MANY_APPLZONES) opt_int_val (common_db, "napplzones", &mm_n_applzones, &bad_arg_p); check_arg ("napplzones", &mm_n_applzones, 1, /* random */ 255); #endif /* !MM_MANY_APPLZONES */ - + ROMlib_InitZones (force_big_offset ? offset_big : offset_none); { @@ -1690,10 +1679,10 @@ int main(int argc, char** argv) #endif if (graphics_p && !vdriver_init (0, 0, 0, FALSE, &argc, argv)) - { - fprintf (stderr, "Unable to initialize video driver.\n"); - exit (-12); - } + { + fprintf (stderr, "Unable to initialize video driver.\n"); + exit (-12); + } #if defined (SYN68K) /* Save the trap vectors away. */ @@ -1720,11 +1709,11 @@ int main(int argc, char** argv) opt_int_val (common_db, "nobrowser", &ROMlib_nobrowser, &bad_arg_p); opt_int_val (common_db, "print", &ROMlib_print, &bad_arg_p); - -#if defined (NEXT) || defined (LINUX) + +#if defined (MACOSX_) || defined (LINUX) opt_int_val (common_db, "nodotfiles", &ROMlib_no_dot_files, &bad_arg_p); #endif - + #if defined (NOMOUSE_COMMAND_LINE_OPTION) opt_int_val (common_db, "nomouse", &ROMlib_no_mouse, &bad_arg_p); #endif @@ -1732,19 +1721,18 @@ int main(int argc, char** argv) #if 0 opt_int_val (common_db, "noclock", &ROMlib_noclock, &bad_arg_p); #endif - + { int no_auto = FALSE; opt_int_val (common_db, "noautorefresh", &no_auto, &bad_arg_p); do_autorefresh_p = !no_auto; } - + opt_int_val (common_db, "refresh", &ROMlib_refresh, &bad_arg_p); check_arg ("refresh", &ROMlib_refresh, 0, 60); opt_int_val (common_db, "grayscale", &grayscale_p, &bad_arg_p); - #if defined (LINUX) opt_int_val (common_db, "nodrivesearch", &nodrivesearch_p, &bad_arg_p); #endif @@ -1752,15 +1740,14 @@ int main(int argc, char** argv) { string str; - if (opt_val (common_db, "prvers", &str)) - { - uint32 vers; + if (opt_val (common_db, "prvers", &str)) { + uint32 vers; - if (!ROMlib_parse_version (str, &vers)) - bad_arg_p = TRUE; - else - ROMlib_PrDrvrVers = (vers >> 8) * 10 + ((vers >> 4) & 0xF); - } + if (!ROMlib_parse_version (str, &vers)) + bad_arg_p = TRUE; + else + ROMlib_PrDrvrVers = (vers >> 8) * 10 + ((vers >> 4) & 0xF); + } } #if defined (SUPPORT_LOG_ERR_TO_RAM) @@ -1773,40 +1760,40 @@ int main(int argc, char** argv) #endif if (opt_val (common_db, "info", NULL)) - { + { #if defined (MSDOS) - msdos_print_info (); + msdos_print_info (); #else - print_info (); + print_info (); #endif /* MSDOS */ - exit (0); - } + exit (0); + } #if defined (MSDOS) { int port; - + if (opt_int_val (common_db, "modemport", &port, &bad_arg_p)) + { + if (port < 1 || port > 4) { - if (port < 1 || port > 4) - { - fprintf (stderr, "modemport must be 1, 2, 3 or 4.\n"); - bad_arg_p = TRUE; - } - else - set_modem_port_mapping_to_pc_port (port); + fprintf (stderr, "modemport must be 1, 2, 3 or 4.\n"); + bad_arg_p = TRUE; } - + else + set_modem_port_mapping_to_pc_port (port); + } + if (opt_int_val (common_db, "printerport", &port, &bad_arg_p)) + { + if (port < 1 || port > 4) { - if (port < 1 || port > 4) - { - fprintf (stderr, "printerport must be 1, 2, 3 or 4.\n"); - bad_arg_p = TRUE; - } - else - set_printer_port_mapping_to_pc_port (port); + fprintf (stderr, "printerport must be 1, 2, 3 or 4.\n"); + bad_arg_p = TRUE; } + else + set_printer_port_mapping_to_pc_port (port); + } } #endif @@ -1814,21 +1801,20 @@ int main(int argc, char** argv) * I don't think we should call ExitToShell yet because the * rest of the system isn't initialized. */ - if (argc >= 2) - { - int a; - - /* Only complain if we see something with a leading dash; anything - * else might be a file to launch. - */ - for (a = 1; a < argc; a++) - if (argv[a][0] == '-') - { - fprintf (stderr, "%s: unknown option `%s'\n", - program_name, argv[a]); - bad_arg_p = TRUE; - } - } + if (argc >= 2) { + int a; + + /* Only complain if we see something with a leading dash; anything + * else might be a file to launch. + */ + for (a = 1; a < argc; a++) { + if (argv[a][0] == '-') { + fprintf (stderr, "%s: unknown option `%s'\n", + program_name, argv[a]); + bad_arg_p = TRUE; + } + } + } filltables (); @@ -1847,7 +1833,6 @@ int main(int argc, char** argv) setupsignals (); - Ticks_UL.u = 0; nilhandle = 0; /* so nil dereferences "work" */ @@ -1884,24 +1869,21 @@ int main(int argc, char** argv) SoundActive = soundactiveoff; PortBUse = 2; /* configured for Serial driver */ memset (KeyMap, 0, sizeof_KeyMap); - if (vdriver_grayscale_p || grayscale_p) - { - /* Choose a nice light gray hilite color. */ - HiliteRGB.red = CWC (0xAAAA); - HiliteRGB.green = CWC (0xAAAA); - HiliteRGB.blue = CWC (0xAAAA); - } - else - { - /* how about a nice yellow hilite color? */ - HiliteRGB.red = CWC (0xFFFF); - HiliteRGB.green = CWC (0xFFFF); - HiliteRGB.blue = CWC (0); - } + if (vdriver_grayscale_p || grayscale_p) { + /* Choose a nice light gray hilite color. */ + HiliteRGB.red = CWC ((unsigned short)0xAAAA); + HiliteRGB.green = CWC ((unsigned short)0xAAAA); + HiliteRGB.blue = CWC ((unsigned short)0xAAAA); + } else { + /* how about a nice yellow hilite color? */ + HiliteRGB.red = CWC ((unsigned short)0xFFFF); + HiliteRGB.green = CWC ((unsigned short)0xFFFF); + HiliteRGB.blue = CWC ((unsigned short)0); + } { - static uint16 ret = CWC (0x4E75); - + static uint16 ret = CWC ((unsigned short)0x4E75); + JCrsrTask = (ProcPtr) RM (&ret); } @@ -1936,12 +1918,11 @@ int main(int argc, char** argv) * particularly close and then complain about lousy performance and * flaky behavior. */ - if (!msdos_check_memory_remaining (768 * 1024)) - { - vdriver_shutdown (); - print_mem_full_message (); - exit (-50); - } + if (!msdos_check_memory_remaining (768 * 1024)) { + vdriver_shutdown (); + print_mem_full_message (); + exit (-50); + } #endif @@ -1956,32 +1937,31 @@ int main(int argc, char** argv) TheZone = SysZone; UTableBase = - (DCtlHandlePtr) (long) RM (NewPtr (sizeof (UTableBase[0].p) * NDEVICES)); + (DCtlHandlePtr) (long) RM (NewPtr (sizeof (UTableBase[0].p) * NDEVICES)); memset (MR (UTableBase), 0, sizeof (UTableBase[0].p) * NDEVICES); UnitNtryCnt = BigEndianValue (NDEVICES); TheZone = ApplZone; - if (graphics_p) - { - /* Set up the current graphics mode appropriately. */ - if (!vdriver_set_mode (flag_width, flag_height, flag_bpp, grayscale_p)) - illegal_mode (); - - /* initialize the mac rgb_spec's */ - make_rgb_spec (&mac_16bpp_rgb_spec, + if (graphics_p) { + /* Set up the current graphics mode appropriately. */ + if (!vdriver_set_mode (flag_width, flag_height, flag_bpp, grayscale_p)) + illegal_mode (); + + /* initialize the mac rgb_spec's */ + make_rgb_spec (&mac_16bpp_rgb_spec, 16, TRUE, 0, 5, 10, 5, 5, 5, 0, BigEndianValue (GetCTSeed ())); - - make_rgb_spec (&mac_32bpp_rgb_spec, + + make_rgb_spec (&mac_32bpp_rgb_spec, 32, TRUE, 0, 8, 16, 8, 8, 8, 0, BigEndianValue (GetCTSeed ())); - - gd_allocate_main_device (); - } -#if defined (DISPLAY_SPLASH_SCREEN) + gd_allocate_main_device (); + } + +#if defined (DISPLAY_SPLASH_SCREEN) if (graphics_p) splash_screen_displayed_p = splash_screen_display (FALSE, "splash"); #endif @@ -1994,14 +1974,14 @@ int main(int argc, char** argv) InitUtil (); #if !defined (X) && !defined (SDL) -/* #warning "Hack so we don't smash mouse/keyboard m68k interrupt vectors." */ + /* #warning "Hack so we don't smash mouse/keyboard m68k interrupt vectors." */ #if defined (M68K_EVENT_VECTOR) save_trap_vectors[M68K_EVENT_VECTOR] - = *(syn68k_addr_t *)SYN68K_TO_US(M68K_EVENT_VECTOR * 4); + = *(syn68k_addr_t *)SYN68K_TO_US(M68K_EVENT_VECTOR * 4); #endif #if defined (M68K_MOUSE_MOVED_VECTOR) save_trap_vectors[M68K_MOUSE_MOVED_VECTOR] - = *(syn68k_addr_t *)SYN68K_TO_US(M68K_MOUSE_MOVED_VECTOR * 4); + = *(syn68k_addr_t *)SYN68K_TO_US(M68K_MOUSE_MOVED_VECTOR * 4); #endif #endif @@ -2017,31 +1997,28 @@ int main(int argc, char** argv) /* parse the `-system' option */ { string system_str; - + if (opt_val (common_db, "system", &system_str)) bad_arg_p |= !parse_system_version (system_str); else ROMlib_set_system_version (system_version); } - if (bad_arg_p) - { - fprintf (stderr, - "Type \"%s -help\" for a list of command-line options.\n", - program_name); - exit (-10); - } + if (bad_arg_p) { + fprintf (stderr, + "Type \"%s -help\" for a list of command-line options.\n", + program_name); + exit (-10); + } { boolean_t keyboard_set_failed; - - if (opt_val (common_db, "keyboard", &arg)) - { - keyboard_set_failed = !ROMlib_set_keyboard (arg.c_str()); - if (keyboard_set_failed) - printf ("``%s'' is not an available keyboard\n", arg.c_str()); - } - else + + if (opt_val (common_db, "keyboard", &arg)) { + keyboard_set_failed = !ROMlib_set_keyboard (arg.c_str()); + if (keyboard_set_failed) + printf ("``%s'' is not an available keyboard\n", arg.c_str()); + } else keyboard_set_failed = FALSE; if (keyboard_set_failed || opt_val (common_db, "keyboards", NULL)) @@ -2049,26 +2026,25 @@ int main(int argc, char** argv) } ROMlib_seginit (argc, argv); - + InitFonts (); - - + #if !defined (NDEBUG) dump_init (NULL); #endif - + /* see qColorutil.c */ ROMlib_color_init (); - + wind_color_init (); /* must be called after `ROMlib_color_init ()' */ image_inits (); - + /* must be after `image_inits ()' */ sb_ctl_init (); - + AE_init (); - + { INTEGER env = 0; ROMlib_Fsetenv (&env, 0); @@ -2091,19 +2067,18 @@ int main(int argc, char** argv) /* Set up timer interrupts. We need to do this after everything else * has been initialized. */ - if (!syncint_init ()) - { - vdriver_shutdown (); - fputs ("Fatal error: unable to initialize timer.\n", stderr); - exit (-11); - } + if (!syncint_init ()) { + vdriver_shutdown (); + fputs ("Fatal error: unable to initialize timer.\n", stderr); + exit (-11); + } #endif /* SYN68K */ sound_init (); - + set_refresh_rate (ROMlib_refresh); - + restore_virtual_ints (int_state); WWExist = QDExist = EXIST_NO; @@ -2111,7 +2086,7 @@ int main(int argc, char** argv) #if defined (CYGWIN32) complain_if_no_ghostscript (); #endif - + executor_main (); if (!ROMlib_no_windows) @@ -2119,5 +2094,5 @@ int main(int argc, char** argv) else exit (0); /* NOT REACHED */ - return 0; + return 0; } diff --git a/src/option.mm b/src/option.mm index 04175dc9..f56b4a08 100644 --- a/src/option.mm +++ b/src/option.mm @@ -249,6 +249,13 @@ return help_buf; } +void Executor::opt_register_pre_note (string note) +{ + char *aPreNote = strdup(note.c_str()); + + opt_register_pre_note(aPreNote); +} + void Executor::opt_register_pre_note (char *note) { @@ -279,7 +286,7 @@ option_vec new_opts) { struct opt_block *block; - + if (help_buf) { /* internal error, must register all options before generating @@ -295,7 +302,7 @@ { string interface = blockIt->interface; option_vec *opts = &blockIt->opts; - + for (option_vec::iterator opt_i = opts->begin(); opt_i != opts->end(); opt_i ++) for (option_vec::iterator new_opt_i = new_opts.begin(); new_opt_i != new_opts.end(); new_opt_i ++) { diff --git a/src/prLowLevel.cpp b/src/prLowLevel.cpp index baa4af1c..f92bf9a2 100644 --- a/src/prLowLevel.cpp +++ b/src/prLowLevel.cpp @@ -207,16 +207,6 @@ add_orientation_icons_to_update_region (DialogPtr dp) SetPort (gp); } -#define SWAP(a, b) do \ -{ \ - typeof (a) __temp; \ - \ - __temp = a; \ - a = b; \ - b = __temp; \ -} \ -while (FALSE); - PRIVATE void update_orientation (DialogPtr dp, INTEGER button) { @@ -258,15 +248,16 @@ Executor::cstring_from_str255 (Str255 text) return retval; } -PUBLIC ini_key_t Executor::ROMlib_printer = NULL; +namespace Executor { +PUBLIC ini_key_t ROMlib_printer = NULL; PRIVATE ini_key_t ROMlib_paper = NULL; -PUBLIC ini_key_t Executor::ROMlib_port = NULL; -PUBLIC ini_key_t Executor::ROMlib_paper_orientation = NULL; +PUBLIC ini_key_t ROMlib_port = NULL; +PUBLIC ini_key_t ROMlib_paper_orientation = NULL; PRIVATE ini_key_t ROMlib_spool_template = NULL; - #if defined (MSDOS) || defined (CYGWIN32) PRIVATE ini_key_t ROMlib_print_filter = NULL; #endif +} PRIVATE MenuHandle GetPopUpMenu (ControlHandle ch) @@ -313,7 +304,7 @@ Executor::update_printing_globals (void) if ((ROMlib_paper_orientation == "Portrait") == (ROMlib_paper_x > ROMlib_paper_y)) - SWAP (ROMlib_paper_x, ROMlib_paper_y); + std::swap (ROMlib_paper_x, ROMlib_paper_y); ROMlib_document_paper_sizes = "%%DocumentPaperSizes: "; ROMlib_paper_size = "%%PaperSize: "; diff --git a/src/prPrinting.cpp b/src/prPrinting.cpp index 5fda1535..43dc99d0 100644 --- a/src/prPrinting.cpp +++ b/src/prPrinting.cpp @@ -38,30 +38,32 @@ PUBLIC boolean_t deferred_printing_p = FALSE /* TRUE */; using namespace Executor; using namespace ByteSwap; +using namespace std; PUBLIC int pageno = 0; /* This isn't really the way to do it */ -PUBLIC int Executor::ROMlib_passpostscript = TRUE; -PUBLIC int Executor::ROMlib_fontsubstitution = FALSE; - -PUBLIC char *Executor::ROMlib_document_paper_sizes; -PUBLIC char *Executor::ROMlib_paper_size; -PUBLIC const char *Executor::ROMlib_paper_size_name; -PUBLIC const char *Executor::ROMlib_paper_size_name_terminator; -PUBLIC int Executor::ROMlib_rotation; -PUBLIC int Executor::ROMlib_translate_x; -PUBLIC int Executor::ROMlib_translate_y; -PUBLIC int Executor::ROMlib_resolution_x = 72; -PUBLIC int Executor::ROMlib_resolution_y = 72; - -PUBLIC int Executor::ROMlib_paper_x; -PUBLIC int Executor::ROMlib_paper_y; +namespace Executor { +PUBLIC int ROMlib_passpostscript = TRUE; +PUBLIC int ROMlib_fontsubstitution = FALSE; + +PUBLIC string ROMlib_document_paper_sizes; +PUBLIC string ROMlib_paper_size; +PUBLIC string ROMlib_paper_size_name; +PUBLIC string ROMlib_paper_size_name_terminator; +PUBLIC int ROMlib_rotation = 0; +PUBLIC int ROMlib_translate_x = 0; +PUBLIC int ROMlib_translate_y = 0; +PUBLIC int ROMlib_resolution_x = 72; +PUBLIC int ROMlib_resolution_y = 72; + +PUBLIC int ROMlib_paper_x = 0; +PUBLIC int ROMlib_paper_y = 0; /* This boolean is here to prevent Energy Scheming from causing trouble. ES calls PrPageClose twice at the end. This fix is sub-optimal, but probably won't hurt anything. */ PRIVATE boolean_t page_is_open = FALSE; - +} #include "rsys/nextprint.h" #if defined(MACOSX_) @@ -400,9 +402,7 @@ ourinit (TPPrPort port, BOOLEAN preserve_font) NeXTOpenPage(); } -#if !defined(MACOSX_) #include -#endif PRIVATE boolean_t need_pclose; diff --git a/src/sounddriver.cpp b/src/sounddriver.cpp index 7b8cd3e1..ee520d37 100644 --- a/src/sounddriver.cpp +++ b/src/sounddriver.cpp @@ -15,6 +15,10 @@ char ROMlib_rcsid_sounddriver[] = #include "SoundOSX.h" #endif +#ifdef Sound_SDL_Sound +#include "sdl-sound.h" +#endif + using namespace Executor; /* This is the current sound driver. */ @@ -30,24 +34,41 @@ Executor::sound_init (void) /* Try all available sound drivers and keep the first one that works. */ do { #ifdef Sound_MACOSX_ + { SoundOSX *sndOSX = new SoundOSX; if (!sndOSX->sound_init()) { delete sndOSX; } else { found_one_p = true; - sound_driver = (class SoundDriver*)sndOSX; + sound_driver = static_cast(sndOSX); break; } + } #endif - + +#ifdef Sound_SDL_Sound + { + SDLSound *sndSDL = new SDLSound; + if (!sndSDL->sound_init()) { + delete sndSDL; + } else { + found_one_p = true; + sound_driver = static_cast(sndSDL); + break; + } + } +#endif + + { SoundFake *sndFake = new SoundFake; if (!sndFake->sound_init()) { delete sndFake; } else { found_one_p = true; - sound_driver = (class SoundDriver*)sndFake; + sound_driver = static_cast(sndFake); break; } + } } while (0); diff --git a/src/soundfake.cpp b/src/soundfake.cpp index 65a500d4..6ecef749 100644 --- a/src/soundfake.cpp +++ b/src/soundfake.cpp @@ -147,6 +147,7 @@ bool SoundFake::sound_init() fake_sound_callback = callback_install (handle_fake_sound_callback, this); no_more_sound_p = FALSE; num_fake_buffers_enqueued = 0; - + ROMlib_SND_RATE = 22255; + return true; } From 2e4415d3ffbf5909341f1f0a9329cb7c09685e57 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sat, 9 Aug 2014 21:37:17 -0600 Subject: [PATCH 017/390] Spacing changes. --- .../CocoaExecutor/NeXT Classes/SoundOSX.cpp | 8 +-- .../CocoaExecutor/NeXT Classes/SoundOSX.h | 2 +- src/include/rsys/soundfake.h | 60 +++++++++---------- 3 files changed, 33 insertions(+), 37 deletions(-) diff --git a/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.cpp b/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.cpp index ec535080..c639766f 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.cpp +++ b/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.cpp @@ -13,7 +13,8 @@ using namespace Executor; bool SoundOSX::sound_init() { - return false; + ROMlib_SND_RATE = 22255; + return false; } void SoundOSX::sound_shutdown() @@ -96,11 +97,6 @@ syn68k_addr_t SoundOSX::handle_fake_sound_callback (syn68k_addr_t addr, void *ou return POPADDR (); } -bool SoundOSX::HasSoundClearPending() -{ - return false; -} - void Executor::ROMlib_callcompletion( void *chanp ) { diff --git a/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h b/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h index 7d95fa07..abe37b98 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h +++ b/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h @@ -28,7 +28,7 @@ namespace Executor { virtual struct hunger_info GetHungerInfo(); virtual void HungerFinish(); virtual void sound_clear_pending(); - virtual bool HasSoundClearPending(); + virtual bool HasSoundClearPending() {return false;} private: AudioUnit AudioUnit; diff --git a/src/include/rsys/soundfake.h b/src/include/rsys/soundfake.h index 7839f200..818abf39 100644 --- a/src/include/rsys/soundfake.h +++ b/src/include/rsys/soundfake.h @@ -5,36 +5,36 @@ #include "TimeMgr.h" namespace Executor { - class SoundFake: public SoundDriver { - public: - virtual bool sound_init(); - virtual void sound_shutdown(); - virtual bool sound_works(); - virtual bool sound_silent(); - virtual void HungerFinish(); - virtual void sound_go(); - virtual void sound_stop(); - virtual void HungerStart(); - virtual struct hunger_info GetHungerInfo(); - virtual void sound_clear_pending(); - virtual bool HasSoundClearPending() { - return true; - } - - private: - snd_time t1; - /* # of fake buffers currently enqueued. */ - int num_fake_buffers_enqueued; - /* Set to TRUE when we're shutting down, and don't want any new sound - * to creep in. - */ - syn68k_addr_t fake_sound_callback; - bool no_more_sound_p; - TMTask fake_sound_tm_task; - static syn68k_addr_t handle_fake_sound_callback (syn68k_addr_t addr, void *junk); - void NoteSoundInterrupt(); - void set_up_tm_task(); - }; + class SoundFake: public SoundDriver { + public: + virtual bool sound_init(); + virtual void sound_shutdown(); + virtual bool sound_works(); + virtual bool sound_silent(); + virtual void HungerFinish(); + virtual void sound_go(); + virtual void sound_stop(); + virtual void HungerStart(); + virtual struct hunger_info GetHungerInfo(); + virtual void sound_clear_pending(); + virtual bool HasSoundClearPending() { + return true; + } + + private: + snd_time t1; + /* # of fake buffers currently enqueued. */ + int num_fake_buffers_enqueued; + /* Set to TRUE when we're shutting down, and don't want any new sound + * to creep in. + */ + syn68k_addr_t fake_sound_callback; + bool no_more_sound_p; + TMTask fake_sound_tm_task; + static syn68k_addr_t handle_fake_sound_callback (syn68k_addr_t addr, void *junk); + void NoteSoundInterrupt(); + void set_up_tm_task(); + }; } #endif /* !_RSYS_SOUNDFAKE_H_ */ From a5d14241ecbb14ccbb79fedd70f953a0ee44f22a Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sun, 10 Aug 2014 13:05:20 -0600 Subject: [PATCH 018/390] Un-comment some code. --- .../NeXT Classes/Executor_main.mm | 44 +++++++++---------- src/config/front-ends/nextstep/psfns.psw | 1 - src/main.cpp | 2 + 3 files changed, 24 insertions(+), 23 deletions(-) delete mode 100644 src/config/front-ends/nextstep/psfns.psw diff --git a/OSX-only/CocoaExecutor/NeXT Classes/Executor_main.mm b/OSX-only/CocoaExecutor/NeXT Classes/Executor_main.mm index c3a08f43..6b6a88f3 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/Executor_main.mm +++ b/OSX-only/CocoaExecutor/NeXT Classes/Executor_main.mm @@ -20,41 +20,41 @@ int ExecutorArgc; const char **ExecutorArgv; -int main(int argc, const char *argv[]) { +int main(int argc, const char *argv[]) +{ +#if 1 /* THIS IS A TEMPORARY HACK */ -#if 0 /* THIS IS A TEMPORARY HACK */ - - void *where; - kern_return_t r; + void *where; + kern_return_t r; #if defined(i386) - struct rlimit rl; + struct rlimit rl; - getrlimit(RLIMIT_STACK, &rl); - rl.rlim_cur = NEXT_STACK_SIZE; - setrlimit(RLIMIT_STACK, &rl); + getrlimit(RLIMIT_STACK, &rl); + rl.rlim_cur = NEXT_STACK_SIZE; + setrlimit(RLIMIT_STACK, &rl); #endif /* defined(i386) */ #if !defined (STRICT_OPENSTEP) #define LENGTH (TEXT_SEGMENT_START - PAGE_ZERO_START) - if ((r=vm_deallocate(task_self(), 0, LENGTH))!=KERN_SUCCESS) { - fprintf(stderr, "Could not deallocate err=%d\n", r); - exit(-10); - } + if ((r=vm_deallocate(mach_task_self(), 0, LENGTH)) != KERN_SUCCESS) { + fprintf(stderr, "Could not deallocate err=%d\n", r); + exit(-10); + } - where = PAGE_ZERO_START; - if ((r=vm_allocate(task_self(), (vm_address_t *)&where, (vm_size_t) LENGTH, - FALSE)) != KERN_SUCCESS) { - fprintf(stderr, "Could not allocate err=%d\n", r); - exit(-11); + where = PAGE_ZERO_START; + if ((r = vm_allocate(mach_task_self(), (vm_address_t *)&where, (vm_size_t) LENGTH, + FALSE)) != KERN_SUCCESS) { + fprintf(stderr, "Could not allocate err=%d\n", r); + exit(-11); } #endif #endif - ExecutorArgc = argc; - ExecutorArgv = argv; - Executor::nextmain(); + ExecutorArgc = argc; + ExecutorArgv = argv; + Executor::nextmain(); - return NSApplicationMain (argc, argv); + return NSApplicationMain (argc, argv); } diff --git a/src/config/front-ends/nextstep/psfns.psw b/src/config/front-ends/nextstep/psfns.psw deleted file mode 100644 index ccea5d69..00000000 --- a/src/config/front-ends/nextstep/psfns.psw +++ /dev/null @@ -1 +0,0 @@ -% no longer needed diff --git a/src/main.cpp b/src/main.cpp index 4f62f43d..84f966b6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1278,6 +1278,8 @@ win_drive_to_bit (const char *drive_namep) namespace Executor { PUBLIC int oldmain(int, char**); } +extern int ExecutorArgc; +extern char **ExecutorArgv; A2 (PUBLIC, int, main, int, argc, char **, argv) #else From 66dc0bae860be7db92fa96e34f941fa8a9f58f3c Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Fri, 17 Oct 2014 13:36:31 -0600 Subject: [PATCH 019/390] Remove some old 68k-only code used in NeXT, but useless with modern CPUs and OS X. --- CocoaExecutor.xcodeproj/project.pbxproj | 4 +- .../NeXT Classes/Executor_main.mm | 17 +- .../NeXT Classes/MacViewClass.mm | 27 +--- .../CocoaExecutor/NeXT Classes/ourstuff.h | 1 + src/main.cpp | 145 +++++++++--------- src/osevent.cpp | 3 - src/prLowLevel.cpp | 13 +- src/prPrinting.cpp | 3 - src/unix_like.cpp | 9 +- 9 files changed, 95 insertions(+), 127 deletions(-) diff --git a/CocoaExecutor.xcodeproj/project.pbxproj b/CocoaExecutor.xcodeproj/project.pbxproj index 6addf0fe..6dce698e 100644 --- a/CocoaExecutor.xcodeproj/project.pbxproj +++ b/CocoaExecutor.xcodeproj/project.pbxproj @@ -16,7 +16,6 @@ 5500AB591985A66A00FF62C0 /* MacWinClass.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB481985A66A00FF62C0 /* MacWinClass.mm */; }; 5500AB5A1985A66A00FF62C0 /* NEXT.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB491985A66A00FF62C0 /* NEXT.mm */; }; 5500AB5B1985A66A00FF62C0 /* NEXTkeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB4A1985A66A00FF62C0 /* NEXTkeyboard.cpp */; }; - 5500AB5C1985A66A00FF62C0 /* NEXTmain.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB4B1985A66A00FF62C0 /* NEXTmain.mm */; }; 5500AB5D1985A66A00FF62C0 /* NEXTprint.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5500AB4C1985A66A00FF62C0 /* NEXTprint.mm */; }; 553A7ED1199708A300DFF4F6 /* sdl-sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 553A7ECF199708A300DFF4F6 /* sdl-sound.cpp */; }; 553A7ED6199709EE00DFF4F6 /* SDL_sound.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 553A7ED4199709EE00DFF4F6 /* SDL_sound.framework */; }; @@ -2720,7 +2719,6 @@ 558B99C01987FCBF00ADF159 /* menu.cpp in Sources */, 558B99D51987FCBF00ADF159 /* prError.cpp in Sources */, 558B9A461987FCBF00ADF159 /* virtualint.cpp in Sources */, - 5500AB5C1985A66A00FF62C0 /* NEXTmain.mm in Sources */, 558B9A0D1987FCBF00ADF159 /* resGet.cpp in Sources */, 558B99C91987FCBF00ADF159 /* mmansubr.cpp in Sources */, 558B9A151987FCBF00ADF159 /* resPartial.cpp in Sources */, @@ -3296,6 +3294,7 @@ "$(inherited)", ); INFOPLIST_FILE = "OSX-only/CocoaExecutor/CocoaExecutor-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks @loader_path/Frameworks $(inherited)"; PRODUCT_NAME = NeoClassic; USER_HEADER_SEARCH_PATHS = "OSX-only/CocoaExecutor src/include"; WRAPPER_EXTENSION = app; @@ -3329,6 +3328,7 @@ "$(inherited)", ); INFOPLIST_FILE = "OSX-only/CocoaExecutor/CocoaExecutor-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @loader_path/../Frameworks @loader_path/Frameworks $(inherited)"; LLVM_LTO = NO; PRODUCT_NAME = NeoClassic; USER_HEADER_SEARCH_PATHS = "OSX-only/CocoaExecutor src/include"; diff --git a/OSX-only/CocoaExecutor/NeXT Classes/Executor_main.mm b/OSX-only/CocoaExecutor/NeXT Classes/Executor_main.mm index 6b6a88f3..812557a2 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/Executor_main.mm +++ b/OSX-only/CocoaExecutor/NeXT Classes/Executor_main.mm @@ -17,12 +17,9 @@ #define NEXT_STACK_SIZE (512L * 1024) #endif /* defined(i386) */ -int ExecutorArgc; -const char **ExecutorArgv; - -int main(int argc, const char *argv[]) +void Executor::NeXTMain() { -#if 1 /* THIS IS A TEMPORARY HACK */ +#if 0 /* THIS IS A TEMPORARY HACK */ void *where; kern_return_t r; @@ -34,7 +31,7 @@ int main(int argc, const char *argv[]) setrlimit(RLIMIT_STACK, &rl); #endif /* defined(i386) */ -#if !defined (STRICT_OPENSTEP) +#if 0 #define LENGTH (TEXT_SEGMENT_START - PAGE_ZERO_START) if ((r=vm_deallocate(mach_task_self(), 0, LENGTH)) != KERN_SUCCESS) { @@ -42,7 +39,7 @@ int main(int argc, const char *argv[]) exit(-10); } - where = PAGE_ZERO_START; + where = (void*)PAGE_ZERO_START; if ((r = vm_allocate(mach_task_self(), (vm_address_t *)&where, (vm_size_t) LENGTH, FALSE)) != KERN_SUCCESS) { fprintf(stderr, "Could not allocate err=%d\n", r); @@ -52,9 +49,5 @@ int main(int argc, const char *argv[]) #endif - ExecutorArgc = argc; - ExecutorArgv = argv; - Executor::nextmain(); - - return NSApplicationMain (argc, argv); + NSApplicationLoad(); } diff --git a/OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.mm b/OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.mm index e0d9a545..4e3dcf5d 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.mm +++ b/OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.mm @@ -1825,9 +1825,9 @@ - (void) drawRect:(NSRect)rect break; case seenOpenPage: RESTOREA5; - do - contextswitch(&nextstep_sp, &romlib_sp); - while (printstate != __idle && printstate != seenClosePage); + do { + + } while (printstate != __idle && printstate != seenClosePage); goto avoidrestorea5; break; default: @@ -1848,7 +1848,7 @@ - (id)step [self lockFocus]; do { - contextswitch (&nextstep_sp, &romlib_sp); + } while (printstate != seenOpenDoc && printstate != seenPageSetUp && [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] @@ -2039,9 +2039,6 @@ - (void)readSelectionFromPasteboard:(NSPasteboard*)pboard sendsuspendevent (); RESTOREA5; } - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); saveROMlib_pasteboard = ROMlib_pasteboard; ROMlib_pasteboard = pboard; { @@ -2049,18 +2046,12 @@ - (void)readSelectionFromPasteboard:(NSPasteboard*)pboard sendresumeevent (YES); RESTOREA5; } - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); ROMlib_pasteboard = saveROMlib_pasteboard; { SETUPA5; sendpaste (); RESTOREA5; } - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); } - (BOOL) writeSelectionToPasteboard:(NSPasteboard *) pboard @@ -2073,9 +2064,6 @@ - (BOOL) writeSelectionToPasteboard:(NSPasteboard *) pboard sendcopy (); RESTOREA5; } - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); saveROMlib_pasteboard = ROMlib_pasteboard; ROMlib_pasteboard = pboard; { @@ -2083,9 +2071,6 @@ - (BOOL) writeSelectionToPasteboard:(NSPasteboard *) pboard sendsuspendevent (); RESTOREA5; } - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); - contextswitch (&nextstep_sp, &romlib_sp); ROMlib_pasteboard = saveROMlib_pasteboard; { SETUPA5; @@ -2105,8 +2090,8 @@ -(NSRect) rectForPage:(NSInteger) page retval.size = [[NSPrintInfo sharedPrintInfo] paperSize]; ROMlib_printtimeout = 10000; while (printstate != __idle && printstate != seenOpenPage && - --ROMlib_printtimeout != 0) - contextswitch (&nextstep_sp, &romlib_sp); + --ROMlib_printtimeout != 0) { + } if (ROMlib_printtimeout == 0) printstate = __idle; return printstate == __idle ? NSZeroRect : retval; diff --git a/OSX-only/CocoaExecutor/NeXT Classes/ourstuff.h b/OSX-only/CocoaExecutor/NeXT Classes/ourstuff.h index d80e7b38..abd9c400 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/ourstuff.h +++ b/OSX-only/CocoaExecutor/NeXT Classes/ourstuff.h @@ -29,6 +29,7 @@ extern NSMenu *global_menu; extern NSCursor *realcursor, *blankcursor; extern NSPasteboard *ROMlib_pasteboard; #endif +void NeXTMain(); } extern NSInteger ROMlib_ourchangecount; diff --git a/src/main.cpp b/src/main.cpp index 84f966b6..8068c710 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -109,6 +109,12 @@ char ROMlib_rcsid_main[] = #include #endif /* MSDOS */ +#if defined(MACOSX_) +namespace Executor { + void NeXTMain(); +} +#endif + #include #if !defined (MSDOS) && !defined(CYGWIN32) @@ -142,7 +148,7 @@ using namespace std; BOOLEAN Executor::force_big_offset = CONFIG_OFFSET_P; #if defined (MACOSX_) -#define main oldmain +//#define main oldmain char *ROMlib_xfervmaddr; LONGINT ROMlib_xfervmsize = 0; #endif /* MACOSX_ */ @@ -195,12 +201,12 @@ uint32 Executor::system_version = 0x700; /* keep this in sync with Browser's .ec const option_vec Executor::common_opts = { - { "sticky", "sticky menus", opt_no_arg, NULL }, + { "sticky", "sticky menus", opt_no_arg, "" }, { "pceditkeys", "have Delete key delete one character forward", - opt_no_arg, NULL }, - { "nobrowser", "don't run Browser", opt_no_arg, NULL }, - { "bpp", "default screen depth", opt_sep, NULL }, - { "size", "default screen size", opt_sep, NULL }, + opt_no_arg, "" }, + { "nobrowser", "don't run Browser", opt_no_arg, "" }, + { "bpp", "default screen depth", opt_sep, "" }, + { "size", "default screen size", opt_sep, "" }, { "debug", ("enable certain debugging output and consistency checks. This " "is primarily used by ARDI developers, but we are making it " @@ -221,18 +227,18 @@ const option_vec Executor::common_opts = "\"unimplemented\" enables warnings for unimplemented traps. " "Example: \"executor -debug unimp,trace\""), - opt_sep, NULL }, + opt_sep, "" }, { "nodiskcache", "disable internal disk cache.", - opt_no_arg, NULL }, + opt_no_arg, "" }, { "nosound", "disable any sound hardware", - opt_no_arg, NULL }, + opt_no_arg, "" }, { "info", "print information about your system", - opt_no_arg, NULL }, + opt_no_arg, "" }, #if defined (SUPPORT_LOG_ERR_TO_RAM) { "ramlog", "log debugging information to RAM; alt-shift-7 dumps the " "accrued error log out via the normal mechanism.", - opt_no_arg, NULL }, + opt_no_arg, "" }, #endif #if defined (MSDOS) @@ -240,17 +246,17 @@ const option_vec Executor::common_opts = "use old-style 18.2 Hz timer, instead of the newer 1024 Hz " "timer. This will result in less accurate timer emulation, " "but may work around problems with certain BIOSes.", - opt_no_arg, NULL }, + opt_no_arg, "" }, { "vga", "use old-style VGA graphics modes only, and don't use SuperVGA. " "This will limit you to a slow 640x480 with 16 colors, but may let " "you run Executor even when Executor has problems with your " "video driver.", - opt_no_arg, NULL }, + opt_no_arg, "" }, { "nofilescheck", "bypass a startup check that attempts to determine if your FILES= " "parameter is large enough.", - opt_no_arg, NULL }, + opt_no_arg, "" }, { "videospeedup", "if you have a linear frame buffer (which requires a VBE 2.0 video " "driver like SciTech Display Doctor) this can make graphics much faster " @@ -262,60 +268,60 @@ const option_vec Executor::common_opts = "switch will cause Executor to crash right away; you can't use it " "on such systems, and there's nothing that can be done about it. " "Use at your own risk!", - opt_no_arg, NULL }, + opt_no_arg, "" }, { "nosync", "Allow disk data structures to stay in memory until Executor quits. " "This will dramatically speed up Executor's creation and deletion of " "many small files, but if Executor crashes the data in memory won't " "be written to disk and HFV corruption could result. " "Use at your own risk!", - opt_no_arg, NULL }, + opt_no_arg, "" }, { "skipaspi", "totally bypass ASPI drivers", - opt_no_arg, NULL }, + opt_no_arg, "" }, #endif /* MSDOS */ #if defined (MSDOS) || defined (CYGWIN32) { "macdrives", "drive letters that represent Mac formatted media", - opt_sep, NULL }, + opt_sep, "" }, { "dosdrives", "drive letters that represent DOS formatted media", - opt_sep, NULL }, + opt_sep, "" }, { "skipdrives", "drive letters that represent drives to avoid", - opt_sep, NULL }, + opt_sep, "" }, #endif #if defined (LINUX) { "nodrivesearch", "Do not look for a floppy drive, CD-ROM drive or any other drive " "except as specified by the MacVolumes environment variable", - opt_no_arg, NULL }, + opt_no_arg, "" }, #endif /* LINUX */ { "keyboards", "list available keyboard mappings", - opt_no_arg, NULL }, - { "keyboard", "choose a specific keyboard map", opt_sep, NULL }, + opt_no_arg, "" }, + { "keyboard", "choose a specific keyboard map", opt_sep, "" }, { "print", "tell program to print file; not useful unless you also " "specify a program to run and one or more documents to print.", - opt_no_arg, NULL }, -#if defined (NEXT) || defined (LINUX) + opt_no_arg, "" }, +#if defined (MACOSX_) || defined (LINUX) { "nodotfiles", "do not display filenames that begin with dot", opt_no_arg, - NULL }, + "" }, #endif #if 0 - { "noclock", "disable timer", opt_no_arg, NULL }, + { "noclock", "disable timer", opt_no_arg, "" }, #endif #if defined (NOMOUSE_COMMAND_LINE_OPTION) /* Hack Dr. Chung wanted */ - { "nomouse", "ignore missing mouse", opt_no_arg, NULL }, + { "nomouse", "ignore missing mouse", opt_no_arg, "" }, #endif { "noautorefresh", "turns off automatic detection of programs that bypass QuickDraw.", - opt_no_arg, NULL }, + opt_no_arg, "" }, { "refresh", "handle programs that bypass QuickDraw, at a performance penalty. " "Follow -refresh with an number indicating how many 60ths of a second " "to wait between each screen refresh, e.g. \"executor -refresh 10\".", opt_optional, "10", }, - { "help", "print this help message", opt_no_arg, NULL, }, - { "version", "print the Executor version", opt_no_arg, NULL, }, + { "help", "print this help message", opt_no_arg, "", }, + { "version", "print the Executor version", opt_no_arg, "", }, #if defined (MALLOC_MAC_MEMORY) { "memory", "specify the total memory you want reserved for use by the programs " @@ -324,110 +330,110 @@ const option_vec Executor::common_opts = "make five and a half megabytes available to the virtual machine. " "Executor will require extra memory above and beyond this amount " "for other uses.", - opt_sep, NULL, }, + opt_sep, "", }, { "applzone", "specify the memory to allocate for the application being run, " "e.g. \"executor -applzone 4M\" would make four megabytes " "of RAM available to the application. \"applzone\" stands for " "\"application zone\".", - opt_sep, NULL, }, + opt_sep, "", }, { "stack", "like -applzone, but specifies the amount of stack memory to allocate.", - opt_sep, NULL, }, + opt_sep, "", }, { "syszone", "like -applzone, but specifies the amount of memory to make " "available to Executor's internal system software.", - opt_sep, NULL, }, + opt_sep, "", }, #if defined (MM_MANY_APPLZONES) { "napplzones", "debugging flag, specifies the number of applzones to use", - opt_sep, NULL }, + opt_sep, "" }, #endif /* MM_MANY_APPLZONES */ #endif /* MALLOC_MAC_MEMORY */ { "system", "specify the system version that executor reports to applications", - opt_sep, NULL }, + opt_sep, "" }, #if defined (SYN68K) { "notnative", "don't use native code in syn68k", - opt_no_arg, NULL }, + opt_no_arg, "" }, #endif #if defined (MSDOS) || defined(VDRIVER_SVGALIB) || defined (CYGWIN32) { "logerr", "log diagnostic output to error log file", opt_no_arg, - NULL }, + "" }, #endif { "grayscale", "\ specify that executor should run in grayscale mode even if it is \ capable of color.", - opt_no_arg, NULL }, + opt_no_arg, "" }, { "netatalk", "use netatalk naming conventions for AppleDouble files", - opt_no_arg, NULL }, + opt_no_arg, "" }, { "afpd", "use afpd conventions for AppleDouble files (implies -netatalk)", - opt_no_arg, NULL }, + opt_no_arg, "" }, #if defined (MSDOS) { "modemport", "which PC serial port (1, 2, 3 or 4) should be used when" - " a Macintosh application access the modem port", opt_sep, NULL, + " a Macintosh application access the modem port", opt_sep, "", }, { "printerport", "which PC serial port (1, 2, 3 or 4) should be used when" " a Macintosh application *directly* accesses the printer port. This" " option does not affect printing. It only affects communications type " - " programs that do their own serial port management.", opt_sep, NULL, + " programs that do their own serial port management.", opt_sep, "", }, #endif #if CONFIG_OFFSET_P == 0 - { "offset", "offset Mac memory (i.e. simulate Win32)", opt_no_arg, NULL }, + { "offset", "offset Mac memory (i.e. simulate Win32)", opt_no_arg, "" }, #endif { "cities", "Don't use Helvetica for Geneva, Courier for Monaco and Times " - "for New York when generating PostScript", opt_no_arg, NULL }, + "for New York when generating PostScript", opt_no_arg, "" }, #if defined (CYGWIN32) { "die", "allow Executor to die instead of catching trap", opt_no_arg, - NULL }, + "" }, { "noautoevents", "disable timer driven event checking", opt_no_arg, - NULL }, + "" }, #endif #if defined (MSDOS) || defined (CYGWIN32) { "nocheckpoint", "disable \"failure.txt\" checkpointing", opt_no_arg, - NULL }, + "" }, #endif { "prvers", "specify the printer version that executor reports to applications", - opt_sep, NULL }, + opt_sep, "" }, { "prres", "specify an additional resolution available for printing, e.g. " "\"executor -prres 600x600\" will make 600dpi resolution available " "in addition to the standard 72dpi. Not all apps will be able to use " - "this additional resolution.", opt_sep, NULL }, + "this additional resolution.", opt_sep, "" }, #if defined (SDL) - { "fullscreen", "try to run in full-screen mode", opt_no_arg, NULL }, - { "hwsurface", "UNSUPPORTED", opt_no_arg, NULL }, + { "fullscreen", "try to run in full-screen mode", opt_no_arg, "" }, + { "hwsurface", "UNSUPPORTED", opt_no_arg, "" }, #if defined (CYGWIN) { "sdlaudio", "specify the audio driver to attempt to use first, e.g. " "\"executor -sdlaudio waveout\" will tell Executor to use the old " - "windows sound drivers and not use DirectSound.", opt_sep, NULL, }, + "windows sound drivers and not use DirectSound.", opt_sep, "", }, #else { "sdlaudio", "specify the audio driver to attempt to use first, e.g. " "\"executor -sdlaudio esd\" will tell Executor to use esound, " - "the Enlightened Sound Daemon instead of /dev/dsp.", opt_sep, NULL, }, + "the Enlightened Sound Daemon instead of /dev/dsp.", opt_sep, "", }, #endif #endif #if defined (CYGWIN32) && defined (SDL) - { "clipleak", "UNSUPPORTED (ignored)", opt_no_arg, NULL }, + { "clipleak", "UNSUPPORTED (ignored)", opt_no_arg, "" }, #endif #if defined(X) || defined (SDL) { "scancodes", "different form of key mapping (may be useful in " - "conjunction with -keyboard)", opt_no_arg, NULL }, + "conjunction with -keyboard)", opt_no_arg, "" }, #endif { "desperate", /* Handled specially; here for documentation purposes only. */ @@ -435,21 +441,21 @@ capable of color.", "to use as few system features as possible, which is handy for " "troubleshooting if Executor is having serious problems with " "your system.", - opt_no_arg, NULL }, + opt_no_arg, "" }, #if defined (powerpc) || defined (__ppc__) - { "ppc", "try to execute the PPC native code if possible (UNSUPPORTED)", opt_no_arg, NULL }, + { "ppc", "try to execute the PPC native code if possible (UNSUPPORTED)", opt_no_arg, "" }, #endif #if defined (CYGWIN32) - { "realmodecd", "try to use real-mode cd-rom driver", opt_no_arg, NULL }, + { "realmodecd", "try to use real-mode cd-rom driver", opt_no_arg, "" }, #endif { "appearance", "(mac or windows) specify the appearance of windows and " "menus. For example \"executor -appearance windows\" will make each " - "window have a blue title bar", opt_sep, NULL }, + "window have a blue title bar", opt_sep, "" }, - { "hfsplusro", "unsupported -- do not use", opt_no_arg, NULL }, + { "hfsplusro", "unsupported -- do not use", opt_no_arg, "" }, }; opt_database_t Executor::common_db; @@ -1274,17 +1280,7 @@ win_drive_to_bit (const char *drive_namep) #define READ_IMPLIES_EXEC 0x0400000 #endif -#ifdef MACOSX_ -namespace Executor { - PUBLIC int oldmain(int, char**); -} -extern int ExecutorArgc; -extern char **ExecutorArgv; - -A2 (PUBLIC, int, main, int, argc, char **, argv) -#else int main(int argc, char** argv) -#endif { check_structs (); @@ -1318,8 +1314,7 @@ int main(int argc, char** argv) execv(argv[0], argv); } #endif - - + int grayscale_p = FALSE; #if defined (DISPLAY_SPLASH_SCREEN) @@ -2089,6 +2084,8 @@ int main(int argc, char** argv) complain_if_no_ghostscript (); #endif + NeXTMain(); + executor_main (); if (!ROMlib_no_windows) diff --git a/src/osevent.cpp b/src/osevent.cpp index 661a82ec..5ad6986d 100644 --- a/src/osevent.cpp +++ b/src/osevent.cpp @@ -520,9 +520,6 @@ A3(PRIVATE, BOOLEAN, OSEventCommon, INTEGER, evmask, EventRecord *, eventp, } eventp->message = CLC(0); -#if defined (MACOSX_) - contextswitch(&romlib_sp, &nextstep_sp); -#endif /* MACOSX_ */ ROMlib_memnomove_p = FALSE; /* this is an icky hack needed for Excel */ ticks = TickCount(); diff --git a/src/prLowLevel.cpp b/src/prLowLevel.cpp index f92bf9a2..b5a70161 100644 --- a/src/prLowLevel.cpp +++ b/src/prLowLevel.cpp @@ -249,13 +249,13 @@ Executor::cstring_from_str255 (Str255 text) } namespace Executor { -PUBLIC ini_key_t ROMlib_printer = NULL; -PRIVATE ini_key_t ROMlib_paper = NULL; -PUBLIC ini_key_t ROMlib_port = NULL; -PUBLIC ini_key_t ROMlib_paper_orientation = NULL; -PRIVATE ini_key_t ROMlib_spool_template = NULL; +PUBLIC ini_key_t ROMlib_printer = ""; +PRIVATE ini_key_t ROMlib_paper = ""; +PUBLIC ini_key_t ROMlib_port = ""; +PUBLIC ini_key_t ROMlib_paper_orientation = ""; +PRIVATE ini_key_t ROMlib_spool_template = ""; #if defined (MSDOS) || defined (CYGWIN32) -PRIVATE ini_key_t ROMlib_print_filter = NULL; +PRIVATE ini_key_t ROMlib_print_filter = ""; #endif } @@ -491,7 +491,6 @@ P2(PUBLIC pascal, void, ROMlib_mystlproc, DialogPtr, dp, INTEGER, itemno) case LAYOUT_OK_NO: #if defined(MACOSX_) printstate = seenPageSetUp; - contextswitch(&romlib_sp, &nextstep_sp); #endif update_ROMlib_printer_vars ((TPPrDlg) dp); break; diff --git a/src/prPrinting.cpp b/src/prPrinting.cpp index 43dc99d0..4f505a0e 100644 --- a/src/prPrinting.cpp +++ b/src/prPrinting.cpp @@ -572,7 +572,6 @@ P3(PUBLIC pascal trap, TPPrPort, PrOpenDoc, THPrint, hPrint, TPPrPort, port, } #else printstate = seenOpenDoc; - contextswitch(&romlib_sp, &nextstep_sp); #endif already_open = TRUE; return port; @@ -595,7 +594,6 @@ P2(PUBLIC pascal trap, void, PrOpenPage, TPPrPort, port, TPRect, pPageFrame) ROMlib_suppressclip = 0; #else printstate = seenOpenPage; - contextswitch(&romlib_sp, &nextstep_sp); #endif } page_is_open = TRUE; @@ -613,7 +611,6 @@ P1(PUBLIC pascal trap, void, PrClosePage, TPPrPort, pPrPort) -55 + (ROMlib_rotation ? 30 : 0)); #else printstate = seenClosePage; - contextswitch(&romlib_sp, &nextstep_sp); #endif } } diff --git a/src/unix_like.cpp b/src/unix_like.cpp index f1f0617b..d48b6b29 100644 --- a/src/unix_like.cpp +++ b/src/unix_like.cpp @@ -301,8 +301,6 @@ mmap_lowglobals (void) } } -#if !defined (MACOSX_) - #if !defined (powerpc) && !defined (__ppc__) PRIVATE caddr_t round_up_to_page_size (unsigned long addr) @@ -378,7 +376,6 @@ mmap_conflict (void *start, size_t length) return retval; } -#endif /* defined (MACOSX) */ /* * This code used to try to get us memory that we could use directly (meaning @@ -389,10 +386,12 @@ mmap_conflict (void *start, size_t length) * emulation isn't an issue, we really shouldn't care. */ -#if !defined(MACOSX_) void * mmap_permanent_memory (unsigned long amount_wanted) { +#if defined(MACOSX_) + return NULL; +#else caddr_t addr_got; caddr_t badness_start; @@ -461,7 +460,7 @@ mmap_permanent_memory (unsigned long amount_wanted) #endif return addr_got; -} #endif +} #endif /* defined (LINUX) || defined (MACOSX) */ From 8b7993f0367cc6abe52aaf8058c4a212aa00501f Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Thu, 5 Feb 2015 18:41:55 -0700 Subject: [PATCH 020/390] Minor fiddling. --- CocoaExecutor.xcodeproj/project.pbxproj | 8 ++-- .../CocoaExecutor/NeXT Classes/SoundOSX.h | 42 +++++++++---------- ...cBridge.cpp => SpeechManager-MacBridge.mm} | 1 + src/include/rsys/soundopts.h | 2 + src/sounddriver.cpp | 10 +++-- 5 files changed, 34 insertions(+), 29 deletions(-) rename src/{SpeechManager-MacBridge.cpp => SpeechManager-MacBridge.mm} (99%) diff --git a/CocoaExecutor.xcodeproj/project.pbxproj b/CocoaExecutor.xcodeproj/project.pbxproj index 6dce698e..cbdd19ac 100644 --- a/CocoaExecutor.xcodeproj/project.pbxproj +++ b/CocoaExecutor.xcodeproj/project.pbxproj @@ -467,7 +467,7 @@ 559AF4B5198AE0F400DE8472 /* mkexpandtables.c in Sources */ = {isa = PBXBuildFile; fileRef = 559AF4B4198AE0F400DE8472 /* mkexpandtables.c */; }; 559AF4B8198AF72B00DE8472 /* segment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B991E1987FCBE00ADF159 /* segment.cpp */; }; 559D530D198FFA44009E479A /* SpeechManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 559D530B198FFA44009E479A /* SpeechManager.cpp */; }; - 559D5311198FFAE1009E479A /* SpeechManager-MacBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 559D530F198FFAE1009E479A /* SpeechManager-MacBridge.cpp */; }; + 559D5311198FFAE1009E479A /* SpeechManager-MacBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 559D530F198FFAE1009E479A /* SpeechManager-MacBridge.mm */; }; 55A742A2198D79DD00F1A8A5 /* SoundOSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55A742A0198D79DD00F1A8A5 /* SoundOSX.cpp */; }; 55A742A8198D819E00F1A8A5 /* FileDouble-OSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55A742A6198D819E00F1A8A5 /* FileDouble-OSX.cpp */; }; 55A742AB198DB05100F1A8A5 /* emustubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 558B98851987FCBD00ADF159 /* emustubs.cpp */; }; @@ -1195,7 +1195,7 @@ 559AF4B4198AE0F400DE8472 /* mkexpandtables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mkexpandtables.c; sourceTree = ""; }; 559D530B198FFA44009E479A /* SpeechManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechManager.cpp; sourceTree = ""; }; 559D530E198FFA6A009E479A /* SpeechManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechManager.h; sourceTree = ""; }; - 559D530F198FFAE1009E479A /* SpeechManager-MacBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "SpeechManager-MacBridge.cpp"; sourceTree = ""; }; + 559D530F198FFAE1009E479A /* SpeechManager-MacBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "SpeechManager-MacBridge.mm"; sourceTree = ""; }; 559D5310198FFAE1009E479A /* SpeechManager-MacBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SpeechManager-MacBridge.h"; sourceTree = ""; }; 55A742A0198D79DD00F1A8A5 /* SoundOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SoundOSX.cpp; sourceTree = ""; }; 55A742A1198D79DD00F1A8A5 /* SoundOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoundOSX.h; sourceTree = ""; }; @@ -2138,7 +2138,7 @@ 557F30D419898513009873EB /* CBridge.cpp */, 559D530B198FFA44009E479A /* SpeechManager.cpp */, 559D5310198FFAE1009E479A /* SpeechManager-MacBridge.h */, - 559D530F198FFAE1009E479A /* SpeechManager-MacBridge.cpp */, + 559D530F198FFAE1009E479A /* SpeechManager-MacBridge.mm */, ); indentWidth = 2; name = "Executor-Mac sources"; @@ -2954,7 +2954,7 @@ 558B99821987FCBF00ADF159 /* dump.cpp in Sources */, 558B9A371987FCBF00ADF159 /* teInsert.cpp in Sources */, 556E0558198584DE00FC4362 /* arrow_down_inactive.map in Sources */, - 559D5311198FFAE1009E479A /* SpeechManager-MacBridge.cpp in Sources */, + 559D5311198FFAE1009E479A /* SpeechManager-MacBridge.mm in Sources */, 558B9A081987FCBF00ADF159 /* qText.cpp in Sources */, 553A7ED1199708A300DFF4F6 /* sdl-sound.cpp in Sources */, 558B9A381987FCBF00ADF159 /* teMisc.cpp in Sources */, diff --git a/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h b/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h index abe37b98..ddb8efe0 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h +++ b/OSX-only/CocoaExecutor/NeXT Classes/SoundOSX.h @@ -16,27 +16,27 @@ #include "rsys/sounddriver.h" namespace Executor { - class SoundOSX : public SoundDriver { - public: - virtual bool sound_init(); - virtual void sound_shutdown(); - virtual bool sound_works(); - virtual bool sound_silent(); - virtual void sound_go(); - virtual void sound_stop(); - virtual void HungerStart(); - virtual struct hunger_info GetHungerInfo(); - virtual void HungerFinish(); - virtual void sound_clear_pending(); - virtual bool HasSoundClearPending() {return false;} - - private: - AudioUnit AudioUnit; - size_t BufferOffset; - char *Buffer; - static syn68k_addr_t handle_fake_sound_callback (syn68k_addr_t addr, void *ourself); - - }; + class SoundOSX : public SoundDriver { + public: + virtual bool sound_init(); + virtual void sound_shutdown(); + virtual bool sound_works(); + virtual bool sound_silent(); + virtual void sound_go(); + virtual void sound_stop(); + virtual void HungerStart(); + virtual struct hunger_info GetHungerInfo(); + virtual void HungerFinish(); + virtual void sound_clear_pending(); + virtual bool HasSoundClearPending() {return false;} + + private: + AudioUnit AudioUnit; + size_t BufferOffset; + char *Buffer; + static syn68k_addr_t handle_fake_sound_callback (syn68k_addr_t addr, void *ourself); + + }; } #endif /* defined(__CocoaExecutor__SoundOSX__) */ diff --git a/src/SpeechManager-MacBridge.cpp b/src/SpeechManager-MacBridge.mm similarity index 99% rename from src/SpeechManager-MacBridge.cpp rename to src/SpeechManager-MacBridge.mm index 1bb34b2d..f220b971 100644 --- a/src/SpeechManager-MacBridge.cpp +++ b/src/SpeechManager-MacBridge.mm @@ -7,6 +7,7 @@ // #include +#import #include "rsys/common.h" #include "rsys/hfs.h" #include "MemoryMgr.h" diff --git a/src/include/rsys/soundopts.h b/src/include/rsys/soundopts.h index aa4517a2..b214cbf3 100644 --- a/src/include/rsys/soundopts.h +++ b/src/include/rsys/soundopts.h @@ -89,6 +89,8 @@ struct hunger_info unsigned char *buf; /* NULL means there is no buffer; just "pretend" */ int bufsize; /* to fill it in; (!buf && bufsize) is possible! */ }; + +typedef struct hunger_info HungerInfo; extern syn68k_addr_t sound_callback (syn68k_addr_t, void *); diff --git a/src/sounddriver.cpp b/src/sounddriver.cpp index ee520d37..9d5ff497 100644 --- a/src/sounddriver.cpp +++ b/src/sounddriver.cpp @@ -19,15 +19,15 @@ char ROMlib_rcsid_sounddriver[] = #include "sdl-sound.h" #endif -using namespace Executor; +namespace Executor { /* This is the current sound driver. */ -class SoundDriver *Executor::sound_driver; +class SoundDriver *sound_driver; -int Executor::ROMlib_SND_RATE = 22255; +int ROMlib_SND_RATE = 22255; void -Executor::sound_init (void) +sound_init (void) { bool found_one_p = false; @@ -75,3 +75,5 @@ Executor::sound_init (void) /* At least the fake sound driver must always match! */ gui_assert (found_one_p); } + +} From 3022fa324783ccb2522475ab6e88750f5d9095b8 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Fri, 6 Feb 2015 19:24:43 -0700 Subject: [PATCH 021/390] Migrate over to NSSpeechSynthesizer. --- src/SpeechManager-MacBridge.mm | 542 ++++++++++++++++++++++++--------- src/include/rsys/common.h | 15 +- 2 files changed, 409 insertions(+), 148 deletions(-) diff --git a/src/SpeechManager-MacBridge.mm b/src/SpeechManager-MacBridge.mm index f220b971..f8caf493 100644 --- a/src/SpeechManager-MacBridge.mm +++ b/src/SpeechManager-MacBridge.mm @@ -13,6 +13,40 @@ #include "MemoryMgr.h" #include "SpeechManager-MacBridge.h" +#include +#include + +#define VoiceCreatorIDKey @"VoiceSynthesizerNumericID" +#define VoiceIDKey @"VoiceNumericID" +#define VoiceNameKey @"VoiceName" + +static NSSpeechSynthesizer *internalSynthesizer; +static NSArray *speechVoices; +static std::map synthesizerMap; +static dispatch_once_t initSpeech = 0; + +static dispatch_block_t initSpeechBlock= ^{ + synthesizerMap = std::map(); + NSMutableArray *tmpVoices = [[NSMutableArray alloc] init]; + @autoreleasepool { + for (NSString *aVoice in [NSSpeechSynthesizer availableVoices]) { + NSDictionary *voiceDict = [NSSpeechSynthesizer attributesForVoice:aVoice]; + NSNumber *synthesizerID = voiceDict[@"VoiceSynthesizerNumericID"]; + NSNumber *voiceID = voiceDict[@"VoiceNumericID"]; + + [tmpVoices addObject:@{VoiceNameKey: aVoice, + VoiceCreatorIDKey: synthesizerID, + VoiceIDKey: voiceID}]; + } + } + + speechVoices = [tmpVoices copy]; + [tmpVoices release]; + internalSynthesizer = [[NSSpeechSynthesizer alloc] init]; +}; + +#define BeginSpeech() dispatch_once(&initSpeech, initSpeechBlock) + using namespace ByteSwap; Executor::NumVersion MacBridge::SpeechManagerVersion (void) @@ -36,109 +70,227 @@ int16 MacBridge::SpeechBusy (void) { - SInt16 toRet = ::SpeechBusy(); - - return BigEndianValue(toRet); + BeginSpeech(); + @autoreleasepool { + SInt16 toRet = internalSynthesizer.speaking; + + return BigEndianValue(toRet); + } } int16 MacBridge::SpeechBusySystemWide(void) { - SInt16 toRet = ::SpeechBusySystemWide(); - - return BigEndianValue(toRet); + @autoreleasepool { + SInt16 toRet = [NSSpeechSynthesizer isAnyApplicationSpeaking]; + + return BigEndianValue(toRet); + } } Executor::OSErr MacBridge::CountVoices (int16 *numVoices) { - if (!numVoices) { - return CWC((Executor::OSErr)paramErr); + @autoreleasepool { + if (!numVoices) { + return CWC((Executor::OSErr)paramErr); + } + + BeginSpeech(); + SInt16 voiceCount = [NSSpeechSynthesizer availableVoices].count; + + *numVoices = BigEndianValue(voiceCount); + return CWC((Executor::OSErr)noErr); } - SInt16 voiceCount = 0; - ::OSErr toRet = ::CountVoices(&voiceCount); - - *numVoices = BigEndianValue(voiceCount); - return BigEndianValue(toRet); } -Executor::OSErr MacBridge::DisposeSpeechChannel (Executor::SpeechChannel chan) +Executor::OSErr MacBridge::DisposeSpeechChannel(Executor::SpeechChannel chan) { - ::OSErr toRet = ::DisposeSpeechChannel((::SpeechChannel)chan); + //BeginSpeech(); + Executor::LONGINT ourDat = chan->data[0]; + NSSpeechSynthesizer *synth = synthesizerMap[ourDat]; + Executor::DisposPtr((Executor::Ptr)chan); + [synth release]; + ::OSErr toRet = noErr; + synthesizerMap.erase(ourDat); return BigEndianValue(toRet); } Executor::OSErr MacBridge::SpeakString (Executor::Str255 textToBeSpoken) { - ::OSErr toRet = ::SpeakString(textToBeSpoken); - - return BigEndianValue(toRet); + BeginSpeech(); + @autoreleasepool { + NSString *ourStr = CFBridgingRelease(CFStringCreateWithPascalString(kCFAllocatorDefault, textToBeSpoken, kCFStringEncodingMacRoman)); + BOOL isBegin = [internalSynthesizer startSpeakingString:ourStr]; + ::OSErr toRet = isBegin ? noErr : -1; + + return BigEndianValue(toRet); + } } Executor::OSErr MacBridge::StopSpeech (Executor::SpeechChannel chan) { - ::OSErr toRet = ::StopSpeech((::SpeechChannel)chan); + BeginSpeech(); + NSSpeechSynthesizer *synth = synthesizerMap[chan->data[0]]; + @autoreleasepool { + [synth stopSpeaking]; + } + ::OSErr toRet = noErr; return BigEndianValue(toRet); - } Executor::OSErr MacBridge::ContinueSpeech (Executor::SpeechChannel chan) { - ::OSErr toRet = ::StopSpeech((::SpeechChannel)chan); - - return BigEndianValue(toRet); + BeginSpeech(); + @autoreleasepool { + NSSpeechSynthesizer *synth = synthesizerMap[chan->data[0]]; + [synth continueSpeaking]; + ::OSErr toRet = noErr; + + return BigEndianValue(toRet); + } } -static inline void MacVoiceSpecToExecutorVoiceSpec(Executor::VoiceSpec* ExecutorVoice, ::VoiceSpec *MacVoice) +static inline void MacVoiceSpecToExecutorVoiceSpec(Executor::VoiceSpec &ExecutorVoice, ::VoiceSpec &MacVoice) { - ExecutorVoice->creator = BigEndianValue(MacVoice->creator); - ExecutorVoice->id = BigEndianValue(MacVoice->id); + ExecutorVoice.creator = BigEndianValue(MacVoice.creator); + ExecutorVoice.id = BigEndianValue(MacVoice.id); } Executor::OSErr MacBridge::GetIndVoice (int16 index, Executor::VoiceSpec *voice) { - ::VoiceSpec macVoice = {0}; - if (!voice) { - return CWC((Executor::OSErr)paramErr); + @autoreleasepool { + BeginSpeech(); + if (!voice) { + return CWC((Executor::OSErr)paramErr); + } + NSInteger voiceIndex = BigEndianValue(index); + NSArray *voices = [NSSpeechSynthesizer availableVoices]; + if (voiceIndex >= voices.count) { + return CWC((Executor::OSErr)(-244)); + } + NSDictionary *voiceDict = [NSSpeechSynthesizer attributesForVoice:voices[voiceIndex]]; + + NSNumber *synthesizerID = voiceDict[@"VoiceSynthesizerNumericID"]; + NSNumber *voiceID = voiceDict[@"VoiceNumericID"]; + + voice->creator = BigEndianValue([synthesizerID unsignedIntValue]); + voice->id = BigEndianValue([voiceID unsignedIntValue]); + } - ::OSErr toRet = ::GetIndVoice(BigEndianValue(index), &macVoice); - - MacVoiceSpecToExecutorVoiceSpec(voice, &macVoice); - return BigEndianValue(toRet); + return CWC((Executor::OSErr)(noErr)); } Executor::OSErr MacBridge::NewSpeechChannel (Executor::VoiceSpec *voice, Executor::SpeechChannel *chan) { - ::VoiceSpec macVoice = {.creator = (OSType)BigEndianValue(voice->creator), - .id = (OSType)BigEndianValue(voice->id)}; - - ::OSErr toRet = ::NewSpeechChannel(&macVoice, (::SpeechChannel*)chan); - - MacVoiceSpecToExecutorVoiceSpec(voice, &macVoice); - - return BigEndianValue(toRet); + static Executor::LONGINT speechChanData = 0; + @autoreleasepool { + BeginSpeech(); + NSString *voiceID = nil; + ::OSType voiceIDFCC = BigEndianValue(voice->id); + ::OSType voiceCreatorFCC = BigEndianValue(voice->creator); + + for (NSDictionary *aVoice in speechVoices) { + + //NSDictionary *voiceDict = [NSSpeechSynthesizer attributesForVoice:aVoice]; + NSNumber *synthesizerID = aVoice[VoiceCreatorIDKey]; + NSNumber *voiceID = aVoice[VoiceIDKey]; + + if ([synthesizerID unsignedIntValue] == voiceCreatorFCC && [voiceID unsignedIntValue] == voiceIDFCC) { + voiceID = aVoice[VoiceNameKey]; + } + } + + if (voiceID == nil) { + return CWC((Executor::OSErr)(-244)); + } + + Executor::SpeechChannelRecord aChan; + aChan.data[0] = ++speechChanData; + + *chan = (Executor::SpeechChannel)Executor::_NewPtr_flags (sizeof(Executor::SpeechChannelRecord), FALSE, FALSE); + + **chan = aChan; + NSSpeechSynthesizer *NSsynth = [[NSSpeechSynthesizer alloc] initWithVoice:voiceID]; + synthesizerMap[aChan.data[0]] = NSsynth; + + return CWC((Executor::OSErr)noErr); + } } Executor::OSErr MacBridge::StopSpeechAt (Executor::SpeechChannel chan, int32 whereToStop) { - ::OSErr toRet = ::StopSpeechAt((::SpeechChannel)chan, BigEndianValue(whereToStop)); + NSSpeechBoundary boundary; + NSSpeechSynthesizer *synth = synthesizerMap[chan->data[0]]; + switch (whereToStop) { + //kImmediate + case CLC(0): + boundary = NSSpeechImmediateBoundary; + break; + + //kEndOfWord + case CLC(1): + boundary = NSSpeechWordBoundary; + break; + + case CLC(2): + boundary = NSSpeechSentenceBoundary; + break; + + default: + return CWC((Executor::OSErr)paramErr); + break; + } - return BigEndianValue(toRet); + @autoreleasepool { + [synth stopSpeakingAtBoundary:boundary]; + } + return CWC((Executor::OSErr)noErr); } Executor::OSErr MacBridge::PauseSpeechAt (Executor::SpeechChannel chan, int32 whereToPause) { - ::OSErr toRet = ::PauseSpeechAt((::SpeechChannel)chan, BigEndianValue(whereToPause)); + NSSpeechBoundary boundary; + NSSpeechSynthesizer *synth = synthesizerMap[chan->data[0]]; + switch (whereToPause) { + //kImmediate + case CLC(0): + boundary = NSSpeechImmediateBoundary; + break; + + //kEndOfWord + case CLC(1): + boundary = NSSpeechWordBoundary; + break; + + case CLC(2): + boundary = NSSpeechSentenceBoundary; + break; + + default: + return CWC((Executor::OSErr)paramErr); + break; + } - return BigEndianValue(toRet); + @autoreleasepool { + [synth pauseSpeakingAtBoundary:boundary]; + } + + return CWC((Executor::OSErr)noErr); } Executor::OSErr MacBridge::SetSpeechRate(Executor::SpeechChannel chan, Executor::Fixed rate) { - ::OSErr toRet = ::SetSpeechRate((::SpeechChannel)chan, BigEndianValue(rate)); + @autoreleasepool { + NSSpeechSynthesizer *synth = synthesizerMap[chan->data[0]]; + + ::Fixed ourRate = BigEndianValue(rate); + + synth.rate = FixedToFloat(ourRate); + } - return BigEndianValue(toRet); + return CWC((Executor::OSErr)noErr); } Executor::OSErr MacBridge::GetSpeechRate (Executor::SpeechChannel chan, Executor::Fixed *rate) @@ -146,19 +298,30 @@ static inline void MacVoiceSpecToExecutorVoiceSpec(Executor::VoiceSpec* Executor if (!rate) { return CWC((Executor::OSErr)paramErr); } - ::OSErr toRet; - ::Fixed ourFixed = BigEndianValue(*rate); - toRet = ::GetSpeechRate((::SpeechChannel)chan, &ourFixed); - *rate = BigEndianValue(ourFixed); + @autoreleasepool { + NSSpeechSynthesizer *synth = synthesizerMap[chan->data[0]]; + + ::Fixed ourRate = FloatToFixed(synth.rate); + + *rate = BigEndianValue(ourRate); + } - return BigEndianValue(toRet); + return CWC((Executor::OSErr)noErr); } Executor::OSErr MacBridge::SetSpeechPitch (Executor::SpeechChannel chan, Executor::Fixed pitch) { - ::OSErr toRet = ::SetSpeechPitch((::SpeechChannel)chan, BigEndianValue(pitch)); + ::OSErr wasSuccess = noErr; + @autoreleasepool { + NSSpeechSynthesizer *synth = synthesizerMap[chan->data[0]]; + + ::Fixed ourRate = BigEndianValue(pitch); + float ourFloatPitch = FixedToFloat(ourRate); + + wasSuccess = [synth setObject:@(ourFloatPitch) forProperty:NSSpeechPitchModProperty error:NULL] ? noErr : -1; + } - return BigEndianValue(toRet); + return BigEndianValue(wasSuccess); } Executor::OSErr MacBridge::GetSpeechPitch (Executor::SpeechChannel chan, Executor::Fixed *pitch) @@ -166,10 +329,18 @@ static inline void MacVoiceSpecToExecutorVoiceSpec(Executor::VoiceSpec* Executor if (!pitch) { return CWC((Executor::OSErr)paramErr); } - ::OSErr toRet; - ::Fixed ourFixed = BigEndianValue(*pitch); - toRet = ::GetSpeechRate((::SpeechChannel)chan, &ourFixed); - *pitch = BigEndianValue(ourFixed); + ::OSErr toRet = noErr; + @autoreleasepool { + NSSpeechSynthesizer *synth = synthesizerMap[chan->data[0]]; + + NSNumber *ourNum = [synth objectForProperty:NSSpeechPitchModProperty error:nil]; + if (ourNum == NULL) { + toRet = -1; + } else { + ::Fixed ourPitch = FloatToFixed(ourNum.floatValue); + *pitch = BigEndianValue(ourPitch); + } + } return BigEndianValue(toRet); } @@ -178,25 +349,25 @@ static inline void MacVoiceSpecToExecutorVoiceSpec(Executor::VoiceSpec* Executor Executor::OSErr MacBridge::UseDictionary (Executor::SpeechChannel chan, Executor::Handle dictionary) { - ::Size ExecSize = BigEndianValue(Executor::GetHandleSize(dictionary)); - ::Handle nativeHandle = ::NewHandle(ExecSize); - memcpy(*nativeHandle, dictionary->p, ExecSize); - - ::OSErr toRet = ::UseDictionary((::SpeechChannel)chan, nativeHandle); - - ::DisposeHandle(nativeHandle); - - return BigEndianValue(toRet); +#if 0 + @autoreleasepool { + ::Size ExecSize = BigEndianValue(Executor::GetHandleSize(dictionary)); + NSData *aData = [NSData dataWithBytes:dictionary->p length:ExecSize]; + NSSpeechSynthesizer *aSynth = synthesizerMap[chan]; + } +#endif + warning_unimplemented (NULL_STRING); + return CWC((Executor::OSErr)paramErr); } -Executor::OSErr MacBridge::MakeVoiceSpec (Executor::OSType creator, Executor::OSType id, Executor::VoiceSpec *voice) +Executor::OSErr MacBridge::MakeVoiceSpec (Executor::OSType creator, Executor::OSType identifier, Executor::VoiceSpec *voice) { if (!voice) { return CWC((Executor::OSErr)paramErr); } ::VoiceSpec nativeSpec = {0}; - ::OSErr toRet = ::MakeVoiceSpec(BigEndianValue(creator), BigEndianValue(id), &nativeSpec); - MacVoiceSpecToExecutorVoiceSpec(voice, &nativeSpec); + ::OSErr toRet = ::MakeVoiceSpec(BigEndianValue(creator), BigEndianValue(identifier), &nativeSpec); + MacVoiceSpecToExecutorVoiceSpec(*voice, nativeSpec); return BigEndianValue(toRet); } @@ -206,70 +377,132 @@ static inline void MacVoiceSpecToExecutorVoiceSpec(Executor::VoiceSpec* Executor Executor::VoiceDescription *info, Executor::LONGINT infoLength) { + if (BigEndianValue(infoLength) != 362) { + return CWC((Executor::OSErr)paramErr); + } + if (voice == NULL || info == NULL) { + return CWC((Executor::OSErr)paramErr); + } + + @autoreleasepool { + info->length = BigEndianValue((int32)362); + //NSSpeechSynthesizer *synth = synthesizerMap[chan->data[0]]; + NSString *voiceID = nil; + ::OSType voiceIDFCC = BigEndianValue(voice->id); + ::OSType voiceCreatorFCC = BigEndianValue(voice->creator); + + for (NSDictionary *aVoice in speechVoices) { + + //NSDictionary *voiceDict = [NSSpeechSynthesizer attributesForVoice:aVoice]; + NSNumber *synthesizerID = aVoice[VoiceCreatorIDKey]; + NSNumber *voiceID = aVoice[VoiceIDKey]; + + if ([synthesizerID unsignedIntValue] == voiceCreatorFCC && [voiceID unsignedIntValue] == voiceIDFCC) { + voiceID = aVoice[VoiceNameKey]; + } + } + if (voiceID == nil) { + return CWC((Executor::OSErr)(-244)); + } + + NSDictionary *aVoiceInfo = [NSSpeechSynthesizer attributesForVoice:voiceID]; + NSString *name = aVoiceInfo[NSVoiceName]; + CFStringGetPascalString((CFStringRef)name, info->name, 63, kCFStringEncodingMacRoman); + info->age = BigEndianValue([aVoiceInfo[NSVoiceAge] shortValue]); + info->voice = *voice; + info->version = 1; //TODO: get real version! + { + NSString *gender = aVoiceInfo[NSVoiceGender]; + if ([gender isEqualToString:NSVoiceGenderMale]) { + info->gender = CWC((int16)1); //kMale + } else if ([gender isEqualToString:NSVoiceGenderFemale]) { + info->gender = CWC((int16)2); //kFemale + } else { + info->gender = CWC((int16)0); + } + } + + NSString *comment = aVoiceInfo[NSVoiceDemoText]; + CFStringGetPascalString((CFStringRef)comment, info->comment, 255, kCFStringEncodingMacRoman); + + LangCode aLang = 0; + RegionCode aRegion = 0; + ::OSStatus ourStat = ::LocaleStringToLangAndRegionCodes([aVoiceInfo[NSVoiceLocaleIdentifier] UTF8String], &aLang, &aRegion); + if (ourStat != noErr) { + ourStat = ::LocaleStringToLangAndRegionCodes("en-US", &aLang, &aRegion); + if (ourStat != noErr) { + return CWC((Executor::OSErr)(-244)); + } + } + info->language = BigEndianValue(aLang); + info->region = BigEndianValue(aRegion); + info->script = CWC((int16)NSMacOSRomanStringEncoding); + memset(info->reserved, 0, sizeof(info->reserved)); + } + return noErr; - } Executor::OSErr MacBridge::GetVoiceInfo (const Executor::VoiceSpec *voice, Executor::OSType selector, void *voiceInfo) { +#if 0 + @autoreleasepool { + //NSSpeechSynthesizer *synth = synthesizerMap[chan->data[0]]; + NSString *voiceID = nil; + ::OSType voiceIDFCC = BigEndianValue(voice->id); + ::OSType voiceCreatorFCC = BigEndianValue(voice->creator); + + for (NSDictionary *aVoice in speechVoices) { + + //NSDictionary *voiceDict = [NSSpeechSynthesizer attributesForVoice:aVoice]; + NSNumber *synthesizerID = aVoice[VoiceCreatorIDKey]; + NSNumber *voiceID = aVoice[VoiceIDKey]; + + if ([synthesizerID unsignedIntValue] == voiceCreatorFCC && [voiceID unsignedIntValue] == voiceIDFCC) { + voiceID = aVoice[VoiceNameKey]; + } + } + if (voiceID == nil) { + return CWC((Executor::OSErr)(-244)); + } + + NSDictionary *aVoiceInfo = [NSSpeechSynthesizer attributesForVoice:voiceID]; + } +#endif // TODO: handle different data types - ::OSErr toRet = ::GetVoiceInfo((const ::VoiceSpec*)voice, BigEndianValue(selector), voiceInfo); - + ::OSErr toRet = noErr; + //::OSErr toRet = ::GetVoiceInfo((const ::VoiceSpec*)voice, BigEndianValue(selector), voiceInfo); + switch (selector) { - case CLC(soVoiceFile): - { - //TODO: error checking - unsigned char cLocation[PATH_MAX] = {0}; - ::VoiceFileInfo *theFile = (::VoiceFileInfo*)voiceInfo; - //OS X's and Executor's FSSpecs WILL point to different files. - ::FSSpec tmpSpec = theFile->fileSpec; - ::FSRef tmpRef = {0}; - ::CFURLRef tmpURL = NULL; - ::FSpMakeFSRef(&tmpSpec, &tmpRef); - tmpURL = ::CFURLCreateFromFSRef(kCFAllocatorDefault, &tmpRef); - ::CFStringRef fileName = CFURLCopyLastPathComponent(tmpURL); - ::CFURLGetFileSystemRepresentation(tmpURL, false, cLocation, sizeof(cLocation)); - Executor::Str255 strName = {0}; - CFStringGetPascalString(fileName, strName, sizeof(strName) - 1, kCFStringEncodingMacRoman); - Executor::HVCB *customPart = Executor::ROMlib_vcbbybiggestunixname((const char*)cLocation); - Executor::FSSpecPtr tmpSpecPtr = (Executor::FSSpecPtr)&theFile->fileSpec; - Executor::C_FSMakeFSSpec(customPart->vcbDrvNum, customPart->vcbDirIDM, strName, tmpSpecPtr); - - theFile->resID = BigEndianValue(theFile->resID); - ::CFRelease(tmpURL); - ::CFRelease(fileName); - } - break; - - case CLC(soVoiceDescription): - { - Executor::VoiceSpec exVSpec = {0}; - ::VoiceDescription* voiDesc = (::VoiceDescription*)voiceInfo; - voiDesc->length = BigEndianValue(voiDesc->length); - MacVoiceSpecToExecutorVoiceSpec(&exVSpec, &voiDesc->voice); - memcpy(&voiDesc->voice, &exVSpec, sizeof(exVSpec)); - voiDesc->version = BigEndianValue(voiDesc->version); - voiDesc->gender = BigEndianValue(voiDesc->gender); - voiDesc->age = BigEndianValue(voiDesc->age); - voiDesc->script = BigEndianValue(voiDesc->script); - voiDesc->language = BigEndianValue(voiDesc->language); - voiDesc->region = BigEndianValue(voiDesc->region); - //voiDesc->voice.creator - - } - break; - - default: - break; + case CLC(soVoiceFile): + //TODO: implement? + warning_unimplemented (NULL_STRING); + return CWC((Executor::OSErr)fnfErr); + break; + + case CLC(soVoiceDescription): + return MacBridge::GetVoiceDescription(voice, (Executor::VoiceDescription*)voiceInfo, CWC((Executor::LONGINT)362)); + break; + + default: + break; } return BigEndianValue(toRet); } Executor::OSErr MacBridge::SpeakText (Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes) { - ::OSErr toRet = ::SpeakText((::SpeechChannel)chan, textBuf, BigEndianValue(textBytes)); - - return BigEndianValue(toRet); + Executor::OSErr theErr = noErr; + @autoreleasepool { + NSSpeechSynthesizer *synth = synthesizerMap[chan->data[0]]; + + NSString *ourStr = [[NSString alloc] initWithBytes:textBuf length:BigEndianValue(textBytes) encoding:NSMacOSRomanStringEncoding]; + + if (![synth startSpeakingString:ourStr]) { + theErr = -1; + } + } + return BigEndianValue(theErr); } Executor::OSErr MacBridge::SetSpeechInfo ( @@ -279,23 +512,34 @@ case CLC(soVoiceDescription): ) { // TODO: handle different data types - ::OSErr toRet = ::SetSpeechInfo((::SpeechChannel)chan, BigEndianValue(selector), speechInfo); - + //::OSErr toRet = ::SetSpeechInfo((::SpeechChannel)chan, BigEndianValue(selector), speechInfo); + ::OSErr toRet = noErr; + + warning_unimplemented (NULL_STRING); return BigEndianValue(toRet); } Executor::OSErr MacBridge::GetSpeechInfo ( - Executor::SpeechChannel chan, - Executor::OSType selector, - void *speechInfo - ) + Executor::SpeechChannel chan, + Executor::OSType selector, + void *speechInfo) { // TODO: handle different data types - ::OSErr toRet = ::GetSpeechInfo((::SpeechChannel)chan, BigEndianValue(selector), speechInfo); + //::OSErr toRet = ::GetSpeechInfo((::SpeechChannel)chan, BigEndianValue(selector), speechInfo); + ::OSErr toRet = noErr; + warning_unimplemented (NULL_STRING); return BigEndianValue(toRet); } +namespace MacBridge { + typedef NS_OPTIONS(SInt32, SpeechFlags) { + kNoEndingProsody = 1, + kNoSpeechInterrupt = 2, + kPreflightThenPause = 4 + }; +} + Executor::OSErr MacBridge::SpeakBuffer ( Executor::SpeechChannel chan, const void *textBuf, @@ -303,23 +547,41 @@ case CLC(soVoiceDescription): int32 controlFlags ) { - ::OSErr toRet = ::SpeakBuffer((::SpeechChannel)chan, textBuf, BigEndianValue(textBytes), BigEndianValue(controlFlags)); - + ::OSErr toRet = noErr; + @autoreleasepool { + //TODO: handle flags + ::Size textSize = BigEndianValue(textBytes); + NSSpeechSynthesizer *synth = synthesizerMap[chan->data[0]]; + NSString *aStr = [[NSString alloc] initWithBytes:textBuf length:textSize encoding:NSMacOSRomanStringEncoding]; + if (![synth startSpeakingString:aStr]) { + toRet = -1; + } + } + return BigEndianValue(toRet); } Executor::OSErr MacBridge::TextToPhonemes (Executor::SpeechChannel chan, const void *textBuf, Executor::ULONGINT textBytes, Executor::Handle phonemeBuf, Executor::LONGINT *phonemeBytes) { ::Size ExecSize = BigEndianValue(Executor::GetHandleSize(phonemeBuf)); - ::Handle nativeHandle = ::NewHandle(ExecSize); - long tempPhonemes = BigEndianValue(*phonemeBytes); - Executor::LONGINT intPhonemes; - memcpy(*nativeHandle, phonemeBuf->p, ExecSize); - - ::OSErr toRet = ::TextToPhonemes((::SpeechChannel)chan, textBuf, BigEndianValue(textBytes), nativeHandle, &tempPhonemes); - intPhonemes = tempPhonemes; - *phonemeBytes = BigEndianValue(intPhonemes); - ::DisposeHandle(nativeHandle); - + ::Size textSize = BigEndianValue(textBytes); + ::OSErr toRet = noErr; + @autoreleasepool { + NSSpeechSynthesizer *synth = synthesizerMap[chan->data[0]]; + NSString *aStr = [[NSString alloc] initWithBytes:textBuf length:textSize encoding:NSMacOSRomanStringEncoding]; + NSString *phonemes = [synth phonemesFromText:aStr]; + [aStr release]; + Executor::LONGINT lengthInMacRoman = [phonemes lengthOfBytesUsingEncoding:NSMacOSRomanStringEncoding]; + + if (lengthInMacRoman == 0) { + return CWC((Executor::OSErr)-224); + } + if (lengthInMacRoman > ExecSize) { + Executor::SetHandleSize(phonemeBuf, BigEndianValue(lengthInMacRoman)); + } + strcpy((char*)phonemeBuf->p, [phonemes cStringUsingEncoding:NSMacOSRomanStringEncoding]); + *phonemeBytes = BigEndianValue(lengthInMacRoman); + } + return BigEndianValue(toRet); } diff --git a/src/include/rsys/common.h b/src/include/rsys/common.h index 28c3f715..5a4291e2 100644 --- a/src/include/rsys/common.h +++ b/src/include/rsys/common.h @@ -70,14 +70,13 @@ inline void sized_byteswap< 4 >(char* data) *ptr = __builtin_bswap32(*ptr); } - template <> - inline void sized_byteswap< 8 >(char* data) - { - uint64_t* ptr = reinterpret_cast(data); - *ptr = __builtin_bswap64(*ptr); - } - - +template <> +inline void sized_byteswap< 8 >(char* data) +{ + uint64_t* ptr = reinterpret_cast(data); + *ptr = __builtin_bswap64(*ptr); +} + template < typename T > T BigEndianValue(T value) { From 5dbc6c455218b62d85a700c91b03cefc15b6b7e7 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Fri, 6 Feb 2015 19:39:10 -0700 Subject: [PATCH 022/390] Move code in mman to be encapsulated in the Executor namespace. --- src/mman.cpp | 129 ++++++++++++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 63 deletions(-) diff --git a/src/mman.cpp b/src/mman.cpp index 719241cc..dd2e99bf 100644 --- a/src/mman.cpp +++ b/src/mman.cpp @@ -44,12 +44,13 @@ char ROMlib_rcsid_mman[] = #include -using namespace Executor; using namespace ByteSwap; -int Executor::ROMlib_applzone_size = DEFAULT_APPLZONE_SIZE; -int Executor::ROMlib_syszone_size = DEFAULT_SYSZONE_SIZE; -int Executor::ROMlib_stack_size = DEFAULT_STACK_SIZE; +namespace Executor { + +int ROMlib_applzone_size = DEFAULT_APPLZONE_SIZE; +int ROMlib_syszone_size = DEFAULT_SYSZONE_SIZE; +int ROMlib_stack_size = DEFAULT_STACK_SIZE; /* these two variables define, in ROMlib space, the beginning of mac-memory and the end of mac memory. They're purpose is to try to prevent routines @@ -59,13 +60,13 @@ int Executor::ROMlib_stack_size = DEFAULT_STACK_SIZE; 0xFFFF0048 both here and on a Mac. On a Mac, this doesn't cause a crash. */ -PUBLIC unsigned long Executor::ROMlib_syszone; -PUBLIC unsigned long Executor::ROMlib_memtop; +PUBLIC unsigned long ROMlib_syszone; +PUBLIC unsigned long ROMlib_memtop; #if defined (MM_MANY_APPLZONES) /* for debugging, we can have multiple applzones which are used roundrobin */ -int Executor::mm_n_applzones = 1; +int mm_n_applzones = 1; static int mm_current_applzone; #endif @@ -77,7 +78,7 @@ static int mm_current_applzone; } while (FALSE) SignedByte -Executor::hlock_return_orig_state (Handle h) +hlock_return_orig_state (Handle h) { block_header_t *block; SignedByte state; @@ -105,13 +106,13 @@ Executor::hlock_return_orig_state (Handle h) } Size -Executor::zone_size (THz zone) +zone_size (THz zone) { return (char *) ZONE_BK_LIM (zone) - (char *) zone; } SignedByte -Executor::HGetState (Handle h) +HGetState (Handle h) { block_header_t *block; @@ -140,7 +141,7 @@ Executor::HGetState (Handle h) } void -Executor::HSetState (Handle h, SignedByte flags) +HSetState (Handle h, SignedByte flags) { block_header_t *block; @@ -165,7 +166,7 @@ Executor::HSetState (Handle h, SignedByte flags) } void -Executor::HLock (Handle h) +HLock (Handle h) { block_header_t *block; @@ -190,7 +191,7 @@ Executor::HLock (Handle h) } void -Executor::HUnlock (Handle h) +HUnlock (Handle h) { block_header_t *block; @@ -215,7 +216,7 @@ Executor::HUnlock (Handle h) } void -Executor::HPurge (Handle h) +HPurge (Handle h) { block_header_t *block; @@ -240,7 +241,7 @@ Executor::HPurge (Handle h) } void -Executor::HNoPurge (Handle h) +HNoPurge (Handle h) { block_header_t *block; @@ -265,7 +266,7 @@ Executor::HNoPurge (Handle h) } void -Executor::HSetRBit (Handle h) +HSetRBit (Handle h) { block_header_t *block; @@ -290,7 +291,7 @@ Executor::HSetRBit (Handle h) } void -Executor::HClrRBit (Handle h) +HClrRBit (Handle h) { block_header_t *block; @@ -343,7 +344,7 @@ canonicalize_memory_sizes (void) void -Executor::InitApplZone (void) +InitApplZone (void) { /* ApplZone must already be set before getting here */ @@ -369,7 +370,7 @@ Executor::InitApplZone (void) void -Executor::print_mem_full_message (void) +print_mem_full_message (void) { fprintf (stderr, "Executor has run out of memory. Try specifying " @@ -382,7 +383,7 @@ Executor::print_mem_full_message (void) } void -Executor::ROMlib_InitZones (offset_enum which) +ROMlib_InitZones (offset_enum which) { static boolean_t beenhere = FALSE; static Ptr stack_begin, stack_end; @@ -545,7 +546,7 @@ Executor::ROMlib_InitZones (offset_enum which) } void -Executor::SetApplBase (Ptr newbase) +SetApplBase (Ptr newbase) { int32 totend; @@ -575,12 +576,12 @@ Executor::SetApplBase (Ptr newbase) so we just let the old bkLim stand. */ ApplZone = RM ((THz) newbase); - Executor::InitApplZone (); + InitApplZone(); SET_MEM_ERR (noErr); } void -Executor::MoreMasters (void) +MoreMasters (void) { THz current_zone; uint32 *handles; @@ -620,7 +621,7 @@ print_free (void) #endif void -Executor::InitZone (ProcPtr pGrowZone, int16 cMoreMasters, +InitZone (ProcPtr pGrowZone, int16 cMoreMasters, Ptr limitPtr, THz zone) { block_header_t *last_block; @@ -681,7 +682,7 @@ Executor::InitZone (ProcPtr pGrowZone, int16 cMoreMasters, } THz -Executor::GetZone (void) +GetZone (void) { MM_SLAM ("entry"); @@ -690,7 +691,7 @@ Executor::GetZone (void) } void -Executor::SetZone (THz hz) +SetZone (THz hz) { MM_SLAM ("entry"); TheZone = RM (hz); @@ -699,7 +700,7 @@ Executor::SetZone (THz hz) Handle -Executor::_NewEmptyHandle_flags (boolean_t sys_p) +_NewEmptyHandle_flags (boolean_t sys_p) { THz save_zone, current_zone; Handle h; @@ -739,7 +740,7 @@ Executor::_NewEmptyHandle_flags (boolean_t sys_p) } Handle -Executor::_NewHandle_flags (Size size, boolean_t sys_p, boolean_t clear_p) +_NewHandle_flags (Size size, boolean_t sys_p, boolean_t clear_p) { Handle newh; block_header_t *block; @@ -789,7 +790,7 @@ Executor::_NewHandle_flags (Size size, boolean_t sys_p, boolean_t clear_p) #define TTS_HACK (ROMlib_options & ROMLIB_DISPOSHANDLE_HACK_BIT) void -Executor::DisposHandle (Handle h) +DisposHandle (Handle h) { MM_SLAM ("entry"); @@ -854,7 +855,7 @@ Executor::DisposHandle (Handle h) } Size -Executor::GetHandleSize (Handle h) +GetHandleSize (Handle h) { block_header_t *block; Size retval; @@ -882,7 +883,7 @@ Executor::GetHandleSize (Handle h) } void -Executor::SetHandleSize (Handle h, Size newsize) +SetHandleSize (Handle h, Size newsize) { block_header_t *block; int32 oldpsize; @@ -982,7 +983,7 @@ Executor::SetHandleSize (Handle h, Size newsize) && (unsigned long) (ptr) <= (unsigned long) ZONE_BK_LIM (MR (z))) THz -Executor::HandleZone (Handle h) +HandleZone (Handle h) { THz zone; block_header_t *block; @@ -1059,7 +1060,7 @@ Executor::HandleZone (Handle h) } Handle -Executor::_RecoverHandle_flags (Ptr p, boolean_t sys_p) +_RecoverHandle_flags (Ptr p, boolean_t sys_p) { block_header_t *block; THz zones[3]; @@ -1103,7 +1104,7 @@ Executor::_RecoverHandle_flags (Ptr p, boolean_t sys_p) } void -Executor::ReallocHandle (Handle h, Size size) +ReallocHandle (Handle h, Size size) { block_header_t *oldb, *newb; int32 newsize; @@ -1190,7 +1191,7 @@ int do_save_alloc = 0; #endif Ptr -Executor::_NewPtr_flags (Size size, boolean_t sys_p, boolean_t clear_p) +_NewPtr_flags (Size size, boolean_t sys_p, boolean_t clear_p) { Ptr p; block_header_t *b; @@ -1250,7 +1251,7 @@ Executor::_NewPtr_flags (Size size, boolean_t sys_p, boolean_t clear_p) } void -Executor::DisposPtr (Ptr p) +DisposPtr (Ptr p) { MM_SLAM ("entry"); @@ -1285,7 +1286,7 @@ Executor::DisposPtr (Ptr p) Size -Executor::GetPtrSize (Ptr p) +GetPtrSize (Ptr p) { block_header_t *block; @@ -1305,7 +1306,7 @@ Executor::GetPtrSize (Ptr p) } void -Executor::SetPtrSize (Ptr p, Size newsize) +SetPtrSize (Ptr p, Size newsize) { block_header_t *block; LONGINT oldpsize; @@ -1402,7 +1403,7 @@ legit_zone_p (THz zone) } THz -Executor::PtrZone (Ptr p) +PtrZone (Ptr p) { block_header_t *block; THz zone; @@ -1434,7 +1435,7 @@ Executor::PtrZone (Ptr p) } int32 -Executor::_FreeMem_flags (boolean_t sys_p) +_FreeMem_flags (boolean_t sys_p) { uint32 freespace; @@ -1450,7 +1451,7 @@ Executor::_FreeMem_flags (boolean_t sys_p) } Size -Executor::_MaxMem_flags (Size *growp, boolean_t sys_p) +_MaxMem_flags (Size *growp, boolean_t sys_p) { block_header_t *b; THz save_zone; @@ -1555,7 +1556,7 @@ Executor::_MaxMem_flags (Size *growp, boolean_t sys_p) Size -Executor::_CompactMem_flags (Size sizeneeded, boolean_t sys_p) +_CompactMem_flags (Size sizeneeded, boolean_t sys_p) { int32 amtfree; block_header_t *src, *target, *ap; @@ -1664,7 +1665,7 @@ Executor::_CompactMem_flags (Size sizeneeded, boolean_t sys_p) } void -Executor::_ResrvMem_flags (Size needed, boolean_t sys_p) +_ResrvMem_flags (Size needed, boolean_t sys_p) { THz save_zone; THz current_zone; @@ -1725,7 +1726,7 @@ Executor::_ResrvMem_flags (Size needed, boolean_t sys_p) } void -Executor::_PurgeMem_flags (Size sizeneeded, boolean_t sys_p) +_PurgeMem_flags (Size sizeneeded, boolean_t sys_p) { long amount_free, max_free; block_header_t *b; @@ -1800,19 +1801,19 @@ BlockMove_and_possibly_flush_cache (Ptr src, Ptr dst, Size cnt, } void -Executor::BlockMove (Ptr src, Ptr dst, Size cnt) +BlockMove (Ptr src, Ptr dst, Size cnt) { BlockMove_and_possibly_flush_cache (src, dst, cnt, TRUE); } void -Executor::BlockMoveData (Ptr src, Ptr dst, Size cnt) +BlockMoveData (Ptr src, Ptr dst, Size cnt) { BlockMove_and_possibly_flush_cache (src, dst, cnt, FALSE); } void -Executor::BlockMove_the_trap (Ptr src, Ptr dst, Size cnt, boolean_t flush_p) +BlockMove_the_trap (Ptr src, Ptr dst, Size cnt, boolean_t flush_p) { MM_SLAM ("entry"); BlockMove_and_possibly_flush_cache (src, dst, cnt, flush_p); @@ -1820,7 +1821,7 @@ Executor::BlockMove_the_trap (Ptr src, Ptr dst, Size cnt, boolean_t flush_p) } void -Executor::MaxApplZone (void) +MaxApplZone (void) { MM_SLAM ("entry"); @@ -1829,7 +1830,7 @@ Executor::MaxApplZone (void) } void -Executor::MoveHHi (Handle h) +MoveHHi (Handle h) { MM_SLAM ("entry"); @@ -1858,7 +1859,7 @@ Executor::MoveHHi (Handle h) } int32 -Executor::_MaxBlock_flags (boolean_t sys_p) +_MaxBlock_flags (boolean_t sys_p) { THz save_zone; THz current_zone; @@ -1899,7 +1900,7 @@ Executor::_MaxBlock_flags (boolean_t sys_p) } void -Executor::_PurgeSpace_flags (Size *total_out, Size *contig_out, boolean_t sys_p) +_PurgeSpace_flags (Size *total_out, Size *contig_out, boolean_t sys_p) { THz save_zone, current_zone; int32 total_free; @@ -1949,7 +1950,7 @@ Executor::_PurgeSpace_flags (Size *total_out, Size *contig_out, boolean_t sys_p) } Size -Executor::StackSpace (void) +StackSpace (void) { int32 fp; @@ -1965,7 +1966,7 @@ Executor::StackSpace (void) } void -Executor::SetApplLimit (Ptr new_limit) +SetApplLimit (Ptr new_limit) { /* NOTE TO CLIFF: We can't do any sanity checks here (not even a brk()), since @@ -1984,7 +1985,7 @@ Executor::SetApplLimit (Ptr new_limit) } void -Executor::SetGrowZone (ProcPtr newgz) +SetGrowZone (ProcPtr newgz) { MM_SLAM ("entry"); @@ -1993,7 +1994,7 @@ Executor::SetGrowZone (ProcPtr newgz) } void -Executor::EmptyHandle (Handle h) +EmptyHandle (Handle h) { THz save_zone, current_zone; block_header_t *b; @@ -2054,7 +2055,7 @@ Executor::EmptyHandle (Handle h) /* Fluff for Cliff */ void -Executor::ROMlib_installhandle (Handle sh, Handle dh) +ROMlib_installhandle (Handle sh, Handle dh) { THz save_zone; @@ -2089,7 +2090,7 @@ Executor::ROMlib_installhandle (Handle sh, Handle dh) } OSErr -Executor::MemError (void) +MemError (void) { MM_SLAM ("entry"); @@ -2097,7 +2098,7 @@ Executor::MemError (void) } THz -Executor::SystemZone (void) +SystemZone (void) { MM_SLAM ("entry"); @@ -2105,7 +2106,7 @@ Executor::SystemZone (void) } THz -Executor::ApplicZone (void) +ApplicZone (void) { MM_SLAM ("entry"); @@ -2117,7 +2118,7 @@ Executor::ApplicZone (void) * NewHandleSys_copy_ptr macros to access this function. */ Handle -Executor::_NewHandle_copy_ptr_flags (Size size, const void *data_to_copy, +_NewHandle_copy_ptr_flags (Size size, const void *data_to_copy, boolean_t sys_p) { Handle h; @@ -2133,7 +2134,7 @@ Executor::_NewHandle_copy_ptr_flags (Size size, const void *data_to_copy, * NewHandleSys_copy_handle macros to access this function. */ Handle -Executor::_NewHandle_copy_handle_flags (Size size, Handle data_to_copy, boolean_t sys_p) +_NewHandle_copy_handle_flags (Size size, Handle data_to_copy, boolean_t sys_p) { Handle h; @@ -2150,7 +2151,7 @@ Executor::_NewHandle_copy_handle_flags (Size size, Handle data_to_copy, boolean_ * NewPtrSys_copy_ptr macros to access this function. */ Ptr -Executor::_NewPtr_copy_ptr_flags (Size size, const void *data_to_copy, +_NewPtr_copy_ptr_flags (Size size, const void *data_to_copy, boolean_t sys_p) { Ptr p; @@ -2166,7 +2167,7 @@ Executor::_NewPtr_copy_ptr_flags (Size size, const void *data_to_copy, * NewPtrSys_copy_handle macros to access this function. */ Ptr -Executor::_NewPtr_copy_handle_flags (Size size, Handle data_to_copy, boolean_t sys_p) +_NewPtr_copy_handle_flags (Size size, Handle data_to_copy, boolean_t sys_p) { Ptr p; @@ -2177,3 +2178,5 @@ Executor::_NewPtr_copy_handle_flags (Size size, Handle data_to_copy, boolean_t s memcpy (p, STARH (data_to_copy), size); return p; } + +} From 7d32ee0bc46b0a14c044db2df5807c20d430b88f Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sat, 7 Feb 2015 17:06:37 -0700 Subject: [PATCH 023/390] Have NeoClassic get farther on launching. --- .../NeXT Classes/MacViewClass.mm | 85 ++++++++++--------- .../CocoaExecutor/NeXT Classes/host_vdriver.h | 6 ++ src/SpeechManager-MacBridge.mm | 4 +- src/fileMisc.cpp | 33 ++++--- src/include/rsys/option.h | 4 +- src/include/rsys/vdriver.h | 4 +- src/main.cpp | 16 ++-- src/option.mm | 8 +- 8 files changed, 87 insertions(+), 73 deletions(-) diff --git a/OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.mm b/OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.mm index 4e3dcf5d..6ae2a0a8 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.mm +++ b/OSX-only/CocoaExecutor/NeXT Classes/MacViewClass.mm @@ -51,17 +51,6 @@ NSBitmapImageRep *cursorrep, *blankcursorrep; NSTimer *our_timer = nil; -void -Executor::vdriver_shutdown (void) -{ -} - - -void -Executor::vdriver_opt_register (void) -{ -} - static NSBitmapImageRep *current_screen_bitmap; /* An alias for one of the other three */ static NSBitmapImageRep *one_bpp_screen_bitmap; @@ -94,37 +83,70 @@ /* These variables are required by the vdriver interface. */ +extern vdriver_nextstep_mode_t vdriver_nextstep_modes; -uint8 *Executor::vdriver_fbuf; - -int Executor::vdriver_row_bytes; +namespace Executor { +uint8 *vdriver_fbuf; -int Executor::vdriver_width = VDRIVER_DEFAULT_SCREEN_WIDTH; +int vdriver_row_bytes; -int Executor::vdriver_height = VDRIVER_DEFAULT_SCREEN_HEIGHT; +int vdriver_width = VDRIVER_DEFAULT_SCREEN_WIDTH; -int Executor::vdriver_bpp, Executor::vdriver_log2_bpp; +int vdriver_height = VDRIVER_DEFAULT_SCREEN_HEIGHT; -int Executor::vdriver_max_bpp, Executor::vdriver_log2_max_bpp; +int vdriver_bpp, vdriver_log2_bpp; -rgb_spec_t *Executor::vdriver_rgb_spec = NULL; +int vdriver_max_bpp, vdriver_log2_max_bpp; +rgb_spec_t *vdriver_rgb_spec = NULL; static rgb_spec_t ns_rgb_spec; -extern vdriver_nextstep_mode_t vdriver_nextstep_modes; - /* For now, just force black and white cursors. */ -int Executor::host_cursor_depth = 1; +int host_cursor_depth = 1; /* True iff our display is two bit grayscale. */ -static boolean_t two_bit_grayscale_display_p; +static bool two_bit_grayscale_display_p; /* True if we should be drawing in grayscale. */ -boolean_t Executor::vdriver_grayscale_p; +bool vdriver_grayscale_p; /* True if the CLUT cannot be changed. */ -boolean_t Executor::vdriver_fixed_clut_p; +bool vdriver_fixed_clut_p; + +void +vdriver_shutdown (void) +{ +} + + std::string SystemDiskLocation() + { + const char* fsr = [[[NSBundle mainBundle] resourcePath] fileSystemRepresentation]; + if (fsr) { + return fsr; + } else { + return ""; + } + } + +void +vdriver_opt_register (void) +{ + two_bit_grayscale_display_p + = NSBitsPerSampleFromDepth([NSWindow defaultDepthLimit]) == 2; + + vdriver_fixed_clut_p = two_bit_grayscale_display_p; + vdriver_grayscale_p = two_bit_grayscale_display_p; + + /* Set up our max bpp appropriately. */ + if (two_bit_grayscale_display_p) + vdriver_max_bpp = 2; + else + vdriver_max_bpp = 8; + vdriver_log2_max_bpp = ROMlib_log2[vdriver_max_bpp]; +} + +} static void create_our_timer (id who) @@ -1725,19 +1747,6 @@ - (id) initWithFrame:(NSRect)frameRect /* Since we will be repeatedly focused on, allocate a gstate. */ [self allocateGState]; - two_bit_grayscale_display_p - = NSBitsPerSampleFromDepth([NSWindow defaultDepthLimit]) == 2; - - vdriver_fixed_clut_p = two_bit_grayscale_display_p; - vdriver_grayscale_p = two_bit_grayscale_display_p; - - /* Set up our max bpp appropriately. */ - if (two_bit_grayscale_display_p) - vdriver_max_bpp = 2; - else - vdriver_max_bpp = 8; - vdriver_log2_max_bpp = ROMlib_log2[vdriver_max_bpp]; - current_screen_bitmap = nil; self_view = self; diff --git a/OSX-only/CocoaExecutor/NeXT Classes/host_vdriver.h b/OSX-only/CocoaExecutor/NeXT Classes/host_vdriver.h index 91acd1fd..428adacb 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/host_vdriver.h +++ b/OSX-only/CocoaExecutor/NeXT Classes/host_vdriver.h @@ -1,6 +1,8 @@ #ifndef __NEXT_HOST_VDRIVER_H_ #define __NEXT_HOST_VDRIVER_H_ +#include + #define vdriver_system_busy 0 #define VDRIVER_DISPLAYED_IN_WINDOW @@ -8,6 +10,10 @@ #define vdriver_accel_rect_scroll(t, l, b, r, dx, dy) VDRIVER_ACCEL_NO_UPDATE #define vdriver_accel_wait() +namespace Executor { + extern std::string SystemDiskLocation(); +} + #define VDRIVER_DISPLAYED_IN_WINDOW #define VDRIVER_BYPASS_INTERNAL_FBUF_P() FALSE diff --git a/src/SpeechManager-MacBridge.mm b/src/SpeechManager-MacBridge.mm index f8caf493..129d0c47 100644 --- a/src/SpeechManager-MacBridge.mm +++ b/src/SpeechManager-MacBridge.mm @@ -182,6 +182,8 @@ static inline void MacVoiceSpecToExecutorVoiceSpec(Executor::VoiceSpec &Executor return CWC((Executor::OSErr)(noErr)); } +using Executor::_NewPtr_flags; + Executor::OSErr MacBridge::NewSpeechChannel (Executor::VoiceSpec *voice, Executor::SpeechChannel *chan) { static Executor::LONGINT speechChanData = 0; @@ -209,7 +211,7 @@ static inline void MacVoiceSpecToExecutorVoiceSpec(Executor::VoiceSpec &Executor Executor::SpeechChannelRecord aChan; aChan.data[0] = ++speechChanData; - *chan = (Executor::SpeechChannel)Executor::_NewPtr_flags (sizeof(Executor::SpeechChannelRecord), FALSE, FALSE); + *chan = (Executor::SpeechChannel)NewPtr(sizeof(Executor::SpeechChannelRecord)); **chan = aChan; NSSpeechSynthesizer *NSsynth = [[NSSpeechSynthesizer alloc] initWithVoice:voiceID]; diff --git a/src/fileMisc.cpp b/src/fileMisc.cpp index 2d593bcd..450f6292 100644 --- a/src/fileMisc.cpp +++ b/src/fileMisc.cpp @@ -724,9 +724,9 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ char *sysname; int sysnamelen; char *p, *ep, *newp; - static struct dangerstr { /* DANGER DANGER DANGER */ - std::string name; /* this is taken from */ - std::string value; /* instead of us including it ... */ + static struct dangerstr { /* DANGER DANGER DANGER */ + const char *name; /* this is taken from */ + std::string value; /* instead of us including it ... */ } defvec[] = { /* if changes we're SOL */ #if defined (LINUX) {"ConfigurationFolder", "/var/opt/executor/share/conf"}, @@ -787,7 +787,6 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ {"PRINTERSINI", "+/printers.ini"}, {"PRINTDEF", "+/printdef.ini"}, #endif /* defined(MSDOS) */ - {0, 0}, }; #if !defined (LINUX) @@ -796,18 +795,18 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ #define AFPD(m,n) (afpd_conventions_p ? (n) : (m)) #endif -#define CONFIGURATIONFOLDER defvec[0].name.c_str() -#define SYSTEMFOLDER defvec[1].name.c_str() -#define PUBLICDIRECTORYMAP defvec[2].name.c_str() -#define PRIVATEDIRECTORYMAP defvec[3].name.c_str() -#define DEFAULTFOLDER defvec[4].name.c_str() -#define EXCELAPP defvec[5].name.c_str() -#define WORDAPP defvec[6].name.c_str() -#define MACVOLUMES defvec[7].name.c_str() -#define SCREENDUMPFILE defvec[8].name.c_str() -#define OFFSETFILE defvec[9].name.c_str() -#define PRINTERSINI defvec[10].name.c_str() -#define PRINTDEF defvec[11].name.c_str() +#define CONFIGURATIONFOLDER defvec[0].name +#define SYSTEMFOLDER defvec[1].name +#define PUBLICDIRECTORYMAP defvec[2].name +#define PRIVATEDIRECTORYMAP defvec[3].name +#define DEFAULTFOLDER defvec[4].name +#define EXCELAPP defvec[5].name +#define WORDAPP defvec[6].name +#define MACVOLUMES defvec[7].name +#define SCREENDUMPFILE defvec[8].name +#define OFFSETFILE defvec[9].name +#define PRINTERSINI defvec[10].name +#define PRINTDEF defvec[11].name #define CONFIGURATIONFOLDER_DEF defvec[0].value.c_str() #define SYSTEMFOLDER_DEF defvec[AFPD (1, 12)].value.c_str() @@ -815,7 +814,7 @@ A0(PUBLIC, void, ROMlib_fileinit) /* INTERNAL */ #define PRIVATEDIRECTORYMAP_DEF defvec[3].value.c_str() #define DEFAULTFOLDER_DEF defvec[AFPD (4, 13)].value.c_str() #define EXCELAPP_DEF defvec[AFPD (5, 14)].value.c_str() -#define WORDAPP_DEF defvec[AFPD (6, 15)].value.c_str() +#define WORDAPP_DEF defvec[AFPD (6, 15)].value.c_str() #define MACVOLUMES_DEF defvec[7].value.c_str() #define SCREENDUMPFILE_DEF defvec[8].value.c_str() #define OFFSETFILE_DEF defvec[9].value.c_str() diff --git a/src/include/rsys/option.h b/src/include/rsys/option.h index 921891d8..81549850 100644 --- a/src/include/rsys/option.h +++ b/src/include/rsys/option.h @@ -4,7 +4,7 @@ #include namespace Executor { -typedef enum option_kind +typedef enum option_kind : int option_kind_t; enum option_kind : int { /* this option has no argument; it evaluates to `def' if provided */ opt_no_arg, @@ -18,7 +18,7 @@ typedef enum option_kind opt_ignore, /* ignore this option and its argument */ opt_sep_ignore, -} option_kind_t; +}; typedef struct option { diff --git a/src/include/rsys/vdriver.h b/src/include/rsys/vdriver.h index b4aef145..ad312eb6 100644 --- a/src/include/rsys/vdriver.h +++ b/src/include/rsys/vdriver.h @@ -186,11 +186,11 @@ extern void vdriver_set_up_internal_screen (void); #endif /* VDRIVER_SUPPORTS_REAL_SCREEN_BLITS */ #if !defined (vdriver_grayscale_p) -extern boolean_t vdriver_grayscale_p; +extern bool vdriver_grayscale_p; #endif #if !defined (vdriver_fixed_clut_p) -extern boolean_t vdriver_fixed_clut_p; +extern bool vdriver_fixed_clut_p; #endif } #endif /* !_VDRIVER_H_ */ diff --git a/src/main.cpp b/src/main.cpp index 8068c710..fb8abc9a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -737,7 +737,13 @@ A1(PRIVATE, void, setstartdir, char *, argv0) } } #if defined(MACOSX_) - misc_self_examination (lookhere); + misc_self_examination (lookhere); + std::string filePath = SystemDiskLocation(); + if (filePath != "") { + strcpy(ROMlib_startdir, filePath.c_str()); + ROMlib_startdirlen = filePath.length(); + return; + } #endif suffix = rindex(lookhere, '/'); if (suffix) @@ -749,14 +755,6 @@ A1(PRIVATE, void, setstartdir, char *, argv0) getcwd(ROMlib_startdir, sizeof ROMlib_startdir); Uchdir(savedir); ROMlib_startdirlen = strlen(ROMlib_startdir) + 1; -#if defined(MACOSX_) - if (strcmp(ROMlib_startdir + ROMlib_startdirlen - sizeof(APPWRAP), - APPWRAP) != 0) { - memmove(ROMlib_startdir + ROMlib_startdirlen - 1, APPWRAP, - sizeof(APPWRAP)); - ROMlib_startdirlen += sizeof(APPWRAP) - 1; - } -#endif #else /* defined(MSDOS) || defined(CYGWIN32) */ #if defined (MSDOS) || defined (CYGWIN32) diff --git a/src/option.mm b/src/option.mm index f56b4a08..f66ca078 100644 --- a/src/option.mm +++ b/src/option.mm @@ -285,7 +285,7 @@ Executor::opt_register (string new_interface, option_vec new_opts) { - struct opt_block *block; + struct opt_block block; if (help_buf) { @@ -319,10 +319,10 @@ } } - block = &opt_blocks.back(); + block.interface = new_interface; + block.opts = new_opts; - block->interface = new_interface; - block->opts = new_opts; + opt_blocks.push_back(block); } opt_database_t From 49c3d5845dd69f414e88e415f437328416422bdc Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sat, 7 Feb 2015 19:59:04 -0700 Subject: [PATCH 024/390] some work on adding the speech manager stubs. --- src/CBridge.cpp | 3 ++- src/emustubs.cpp | 8 ++++++++ src/include/rsys/ptocflags.h | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/CBridge.cpp b/src/CBridge.cpp index 3522f17a..17a1c32c 100644 --- a/src/CBridge.cpp +++ b/src/CBridge.cpp @@ -38,7 +38,8 @@ long CGet_ROMlib_version_long() return ROMlib_version_long; } -uint32 ROMlib_PrDrvrVers_Set(uint32 toSet){ +uint32 ROMlib_PrDrvrVers_Set(uint32 toSet) +{ ROMlib_PrDrvrVers = toSet; return ROMlib_PrDrvrVers; } diff --git a/src/emustubs.cpp b/src/emustubs.cpp index a17bb8bc..ee7322bc 100644 --- a/src/emustubs.cpp +++ b/src/emustubs.cpp @@ -51,6 +51,7 @@ char ROMlib_rcsid_emustubs[] = #include "Iconutil.h" #include "QuickTime.h" #include "CommTool.h" +#include "SpeechManager.h" #include "rsys/pstuff.h" #include "rsys/file.h" @@ -2899,6 +2900,13 @@ STUB (IconDispatch) * 0x0a5c000c TextToPhonemes */ + PRIVATE selector_table_entry_t speech_table[] = + { + { 0x0000000c, PTOCBLOCK(SpeechManagerVersion)}, + { 0x003c000c, PTOCBLOCK(SpeechBusy)}, + { 0x0040000c, PTOCBLOCK(SpeechBusySystemWide)} + }; + PRIVATE selector_table_entry_t sound_table[] = { { 0x00000000, PTOCBLOCK(FinaleUnknown1) }, diff --git a/src/include/rsys/ptocflags.h b/src/include/rsys/ptocflags.h index bcd5b213..f979f956 100644 --- a/src/include/rsys/ptocflags.h +++ b/src/include/rsys/ptocflags.h @@ -1156,3 +1156,7 @@ #define PTOC_SaveMixedModeState 0x00000162 #define PTOC_RestoreMixedModeState 0x00000162 #define PTOC_pack8_unknown_selector 0x00000000 + +#define PTOC_SpeechManagerVersion 0x00000004 +#define PTOC_SpeechBusy 0x00000004 +#define PTOC_SpeechBusySystemWide 0x00000004 From 41fbea9a633e23be7ea7b91693ad81baa9e12788 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Sat, 26 Dec 2015 16:08:40 -0700 Subject: [PATCH 025/390] Update .gitignore --- .gitignore | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 81f6b3dd..e55fe0d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ build -**.o +*.o src/apple.c src/active.c src/arrow_down_active.c @@ -25,6 +25,5 @@ src/zoom.c src/config.status src/config.log src/config.h -src/.deps/ -**/.DS_Store +.deps/ .DS_Store From 0df4f6b5d0f5d4c57b48ea611b542ce2430d197d Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Fri, 3 Mar 2017 13:40:09 -0700 Subject: [PATCH 026/390] Remove a lot of useless stuff. Quiet warnings about unknown bit shifting on negative numbers. --- .gitignore | 1 + .../NeXT Classes/Base.lproj/Executor.xib | 226 +++++++++--------- .../CocoaExecutor/NeXT Classes/MacAppClass.mm | 2 +- .../CocoaExecutor/NeXT Classes/MacViewClass.h | 3 +- src/include/rsys/byteswap.h | 10 +- src/stdfile-OSXPrivate.cpp | 170 +------------ src/stdfile-OSXPrivate.h | 1 - 7 files changed, 125 insertions(+), 288 deletions(-) diff --git a/.gitignore b/.gitignore index 710e8304..9e466a58 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ src/.deps/ .DS_Store *xcuserdata **/project.xcworkspace/ +OSX-only/CocoaExecutor/ExecutorVolume/ diff --git a/OSX-only/CocoaExecutor/NeXT Classes/Base.lproj/Executor.xib b/OSX-only/CocoaExecutor/NeXT Classes/Base.lproj/Executor.xib index 28443411..dbab611a 100644 --- a/OSX-only/CocoaExecutor/NeXT Classes/Base.lproj/Executor.xib +++ b/OSX-only/CocoaExecutor/NeXT Classes/Base.lproj/Executor.xib @@ -1,8 +1,10 @@ - - + + - - + + + + @@ -359,7 +361,7 @@ - + @@ -371,8 +373,8 @@ - - + + @@ -385,22 +387,22 @@ - + - + - - + + - + @@ -410,30 +412,48 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + @@ -455,22 +475,22 @@ - + - + - - + + - + @@ -487,15 +507,15 @@ - - + + - + @@ -516,41 +536,37 @@ - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + - - - + @@ -579,13 +595,11 @@ - - - - + + + + - -