Commit 6d30fd2f authored by Diederik van Arkel's avatar Diederik van Arkel
Browse files

HeapProfiler: platform independance mods

parent 89f41bfd
...@@ -91,14 +91,13 @@ empty_header = { ...@@ -91,14 +91,13 @@ empty_header = {
/* Mac /* Mac
PCorMac pc mac :== mac; PCorMac pc mac :== mac;
from files import GetFInfo,NewToolbox,Toolbox; from files import GetFInfo,NewToolbox,:: Toolbox;
FileExists :: !String -> Bool; FileExists :: !String -> Bool;
FileExists name = result==0; FileExists name = result==0;
{ where
(result,_,_) = GetFInfo name NewToolbox; (result,_,_) = GetFInfo name NewToolbox;
}; /*
system_dependent_initial_IO=[]; system_dependent_initial_IO=[];
apple_event_open_function file_name s=:{node_size_sum} io apple_event_open_function file_name s=:{node_size_sum} io
...@@ -1302,7 +1301,8 @@ p_open_file_function file_name ps ...@@ -1302,7 +1301,8 @@ p_open_file_function file_name ps
// Set-up a dummy ProgState which can be discarded in case of errors // Set-up a dummy ProgState which can be discarded in case of errors
# (defaultPS,ps) = defaultPrintSetup ps; # (defaultPS,ps) = defaultPrintSetup ps;
# discardable_s = empty_progstate defaultPS; # discardable_s = empty_progstate defaultPS;
# ((ok, discardable_s=:{node_size_list}, application_name), ps) = accFiles (open_file file_name discardable_s) ps; # ((ok, discardable_s=:{node_size_list}, application_name), ps)
= accFiles (open_file file_name discardable_s) ps;
| ok | ok
= (ok,application_name, discardable_s, ps); = (ok,application_name, discardable_s, ps);
= (ok,"",discardable_s,ps); = (ok,"",discardable_s,ps);
......
...@@ -2,11 +2,10 @@ module heapprofiler ...@@ -2,11 +2,10 @@ module heapprofiler
import StdEnv, StdIO import StdEnv, StdIO
import flexwin import flexwin
import expand_8_3_names_in_path
import ArgEnv
import ExtNotice import ExtNotice
import Help import Help
import ShowHeapProfile import ShowHeapProfile
import Platform
import StdDebug import StdDebug
...@@ -37,7 +36,7 @@ where ...@@ -37,7 +36,7 @@ where
# hasPage = hasPrev || hasNext # hasPage = hasPrev || hasNext
# (_,ps) = openMenu Void (page_menu hasPage hasNext hasPrev recId pageId nextId prevId) ps # (_,ps) = openMenu Void (page_menu hasPage hasNext hasPrev recId pageId nextId prevId) ps
# (_,ps) = openMenu Void (help_menu) ps # (_,ps) = openMenu Void (help_menu) ps
= ps = installPlatformEventHandlers ps
file_menu recId winId closeId printId pageId nextId prevId = file_menu recId winId closeId printId pageId nextId prevId =
Menu "&File" Menu "&File"
...@@ -122,18 +121,16 @@ info = ...@@ -122,18 +121,16 @@ info =
//-- Support functions... //-- Support functions...
open_heap_file_from_command_line ps open_heap_file_from_command_line ps
| size commandline == 1 # (commandline,ps) = initPlatformCommandLine ps
| length commandline <= 1
# (dp,ps) = defaultPrintSetup ps # (dp,ps) = defaultPrintSetup ps
= (empty_progstate dp,ps) = (empty_progstate dp,ps)
= open_file_function (expand_8_3_names_in_path commandline.[1]) ps = open_file_function (commandline!!1) ps
where
commandline
= getCommandLine
openFiles _ _ _ _ _ _ _ [] ps = ps openFiles _ _ _ _ _ _ _ [] ps = ps
openFiles recId winId closeId printId pageId nextId prevId [h:t] ps openFiles recId winId closeId printId pageId nextId prevId [h:t] ps
# (info=:{application_name},ps) # (info=:{application_name},ps)
= open_file_function (expand_8_3_names_in_path h) ps = open_file_function h ps
# ps = appPLoc (const (Just application_name)) ps # ps = appPLoc (const (Just application_name)) ps
# ((err,_),ps) = syncSend2 recId (FW_SetContent info) ps # ((err,_),ps) = syncSend2 recId (FW_SetContent info) ps
| err <> SendOk | err <> SendOk
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment