Commit 449c3d5a authored by Diederik van Arkel's avatar Diederik van Arkel

Mass update mac version

parent 2fbf9de1
......@@ -482,8 +482,24 @@ read_object_file (object_file_offset,object_file_size) file_name file_n file nam
(file_contents,file) = read_object_data nametable_names file;
{FileContents|code_list,code_offset,data_list,data_offset,symbol_table,text_relocation_n,text_relocations,data_relocation_n,data_relocations}=file_contents;
{text_symbols,data_symbols,toc_symbols,bss_symbols,toc0_symbol,imported_symbols,symbols}=symbol_table;
code_list = file_contents.FileContents.code_list;
code_offset = file_contents.FileContents.code_offset;
data_list = file_contents.FileContents.data_list;
data_offset = file_contents.FileContents.data_offset;
symbol_table = file_contents.FileContents.symbol_table;
text_relocation_n = file_contents.FileContents.text_relocation_n;
text_relocations = file_contents.FileContents.text_relocations;
data_relocation_n = file_contents.FileContents.data_relocation_n;
data_relocations = file_contents.FileContents.data_relocations;
// {text_symbols,data_symbols,toc_symbols,bss_symbols,toc0_symbol,imported_symbols,symbols}=symbol_table;
text_symbols = symbol_table.text_symbols;
data_symbols = symbol_table.data_symbols;
toc_symbols = symbol_table.toc_symbols;
bss_symbols = symbol_table.bss_symbols;
toc0_symbol = symbol_table.toc0_symbol;
imported_symbols = symbol_table.imported_symbols;
symbols = symbol_table.symbols;
(imported_symbols,symbols,file,names_table) = read_object_names nametable_names (object_file_offset+name_table_offset) file_contents.local_symbols imported_symbols file_n symbols file names_table;
......
......@@ -2,7 +2,17 @@ definition module IdePlatform
import StdPSt, StdString
import StdIOCommon
from IdeState import General
from IdeState import :: General
PlatformProcessAttributes :: [ProcessAttribute *(PSt General)]
RunProgram :: !.String !*(PSt General) -> *PSt General
SetWindowIcon :: !Id !Int !(PSt .l) -> PSt .l
SetProcessIcon :: !Int !(PSt .l) -> PSt .l
GetDialogBackgroundColour :: !(PSt .l) -> (!Colour, !PSt .l)
ProjectIcon :== 32513
ImpmodIcon :== 32516
DefmodIcon :== 32515
CleanIcon :== 32512
AbcmodIcon :== 32514
......@@ -5,7 +5,11 @@ import StdArray, StdEnum, StdList
import StdFunc
import PmCleanSystem
import errwin
from IdeState import General
from IdeState import :: General
GetDialogBackgroundColour :: !(PSt .l) -> (!Colour,!PSt .l)
GetDialogBackgroundColour ps
= (LightGrey, ps)
PlatformProcessAttributes :: [ProcessAttribute *(PSt General)]
PlatformProcessAttributes = []
......@@ -17,3 +21,16 @@ RunProgram path ps
(ps,_) = Execute updateErrorWindow path ao ps
= ps
//-- Win only for now ?!
SetWindowIcon :: !Id !Int !(PSt .l) -> PSt .l
SetWindowIcon wId iId ps = ps
SetProcessIcon :: !Int !(PSt .l) -> PSt .l
SetProcessIcon iId ps = ps
ProjectIcon :== 32513
ImpmodIcon :== 32516
DefmodIcon :== 32515
CleanIcon :== 32512
AbcmodIcon :== 32514
......@@ -2,10 +2,16 @@ definition module Platform
import StdPSt, StdString
import StdIOCommon
from IdeState import General
PlatformDependant win mac :== mac
initPlatformCommandLine :: !*(PSt .l) -> (![String],!*PSt .l)
installPlatformEventHandlers :: !*(PSt .l) -> *(PSt .l)
openPlatformWindowMenu :: !*(PSt .l) -> *(PSt .l)
TooltempDir :: String
EnvsDir :: String
PrefsDir :: String
batchOptions :: !*World -> (!Bool,Bool,String,*File,!*World)
wAbort :: !String !*World -> *World
implementation module Platform
import StdInt
import StdInt, StdMisc, StdFile
import StdPSt
//import menuwindowmenu
import PmCleanSystem
import StdIOCommon, IdeState
import errwin
import StdIOCommon
import StdSystem
PlatformDependant w m :== m
PlatformDependant win mac
:== mac
initPlatformCommandLine :: !*(PSt .l) -> (![String],!*PSt .l)
initPlatformCommandLine ps
......@@ -26,9 +25,31 @@ openPlatformWindowMenu ps
= ps
// = openWindowMenu ps
batchOptions :: !*World -> (!Bool,Bool,String,*File,!*World)
batchOptions world
# interact = True
force_update = undef
prj_name = undef
logfile = undef
= (interact,force_update,prj_name,logfile,world)
wAbort :: !String !*World -> *World
wAbort message world
# stderr = fwrites message stderr
# (_,world) = fclose stderr world
= world
install_apple_event_handlers :: Int
install_apple_event_handlers
= code ()(r=D0) {
call .install_apple_event_handlers
}
TooltempDir :: String
TooltempDir = applicationpath "Temp"
EnvsDir :: String
EnvsDir = applicationpath "Config"
PrefsDir :: String
PrefsDir = applicationpath "Config"
......@@ -34,7 +34,7 @@ instance == CodeGenerateAsmOrCode
| Patherror Pathname
instance == CompilerMsg
:: WindowFun env :== !([String]) -> env -> env
:: WindowFun env :== ([String]) -> env -> env
Compile :: // Compiles the given file:
!String // compiler exe name and options
......@@ -103,6 +103,7 @@ Link :: // Links the given file:
!Bool // generate dll?
!String // name of file containing symbols to be exported from dll
!Pathname // startup directory
!Bool // add 'carb' 0 resource?
!*(PSt .l) // state
->
( !*(PSt .l) // state
......@@ -162,7 +163,7 @@ CompilePollCompleted :: !*env -> (!CompilePollCompletedResult, !*env) | FileEnv
:: CompilingInfo
InitCompilingInfo :: !*CompilingInfo
InitCompilingInfo :: *CompilingInfo
ExitCleanCompiler :: !*(!*CompilingInfo,*env) -> *(!*CompilingInfo,*env)
......
This diff is collapsed.
......@@ -25,3 +25,9 @@ FReadOnly :: !{#Char} !*env -> (!Bool, !*env) | FileSystem env
GetLongPathName :: !String -> String;
GetShortPathName :: !String -> (!Bool,!String);
import StdPSt, StdMaybe
selectDirectory` :: !(PSt .l) -> (!Maybe String,!(PSt .l))
ShellDefault :: !{#Char} !(PSt .l) -> (!Int,!(PSt .l))
......@@ -8,7 +8,7 @@ import UtilDate
import StdSystem
import ostypes, OS_utilities;
from files import GetFInfo,GetCatInfo1,GetCatInfo2,GetWDInfo,HGetVol;
from files import GetFInfo,GetCatInfo1,GetCatInfo2/*,GetWDInfo*/,HGetVol;
//---
......@@ -41,11 +41,13 @@ FReadOnly path files
= ((hd dct).fileInfo.pi_fileInfo.isReadOnly,files)
*/
//--
import files
//import files
from PmCleanSystem import Launch
LaunchApplication :: !{#Char} !{#Char} !Bool !Files -> ( !Bool, !Files)
LaunchApplication execpath homepath console files
// set working directory???
# (error_n,_) = LaunchApplication` execpath 0xC8000000 OSNewToolbox
# (error_n,files) = Launch execpath files
| error_n >= 0
= (True,files)
= (False,files)
......@@ -56,7 +58,7 @@ LaunchApplication execpath homepath console files
FExists :: !String !Files -> (!Bool, !Files);
FExists name disk = (result == 0, disk);
where
(result,_,_) = GetFInfo name OSNewToolbox;
(result,_,_) = GetFInfo name NewToolbox;
/* Returns the last modification date of the indicated file.
......@@ -67,7 +69,7 @@ FModified path disk
| result <> 0 = (NoDate,disk);
= ({exists=True,yy=years,mm=months,dd=days,h=hours,m=minutes,s=seconds},disk);
where
(result,modification,_) = GetFInfo path OSNewToolbox;
(result,modification,_) = GetFInfo path NewToolbox;
(years,months,days,_,_) = Secs2Date modification 0;
(hours,minutes,seconds,_) = Secs2Time modification 0;
......@@ -80,7 +82,7 @@ FStartUpDir applicationname files
| result==0
= (pathName % (0,size pathName-2), files);
where
(result,wd_vref_num,directory_id,tb1) = HGetVol OSNewToolbox;
(result,wd_vref_num,directory_id,tb1) = HGetVol NewToolbox;
(pathName,_) = Get_directory_path wd_vref_num directory_id "" tb1;
GetFullApplicationPath :: !*Files -> ({#Char}, *Files);
......@@ -104,14 +106,14 @@ LastColon s i
= (True, i);
= LastColon s (dec i);
Get_name_and_parent_id_of_directory :: !Int !Int !*OSToolbox -> (!String,!Int,!*OSToolbox);
Get_name_and_parent_id_of_directory :: !Int !Int !*Toolbox -> (!String,!Int,!*Toolbox);
Get_name_and_parent_id_of_directory volumeNumber directoryId tb
| 0 == osError = (folderName,parentId,tb1);
= abort ("Error code returned by BPGetCatInfo: " +++ toString osError);
where
(osError,folderName,parentId,tb1) = GetCatInfo2 volumeNumber directoryId String64 tb;
Get_directory_path :: !Int !Int !String !*OSToolbox -> (!String, !*OSToolbox);
Get_directory_path :: !Int !Int !String !*Toolbox -> (!String, !*Toolbox);
Get_directory_path volumeNumber directoryId path tb
| directoryId==2
= (folderName +++ ":" +++ path, tb1);
......@@ -135,7 +137,7 @@ GetShortPathName :: !String -> (!Bool,!String);
GetShortPathName s = (True,s)//quoted_string s)
//--
GetFName :: !.{#Char} !*OSToolbox -> (!Int,!Int,!*OSToolbox);
GetFName :: !.{#Char} !*Toolbox -> (!Int,!Int,!*Toolbox);
GetFName ioNamePtr t = code (ioNamePtr=R80O0D0SD1,t=U)(ioResult=D0,ioDate_and_Time=I80A0,t2=Z){
instruction 0x39400000 | li r10,0
instruction 0x9141000C | stw r10,12(sp)
......@@ -149,3 +151,18 @@ GetFName ioNamePtr t = code (ioNamePtr=R80O0D0SD1,t=U)(ioResult=D0,ioDate_and_Ti
instruction 0x8321004C | lwz r25,76(sp)
};
import StdFileSelect, StdPSt, StdPStClass
selectDirectory` :: !(PSt .l) -> (!Maybe String,!PSt .l)
selectDirectory` ps
# (ms,ps) = selectDirectory ps
# ms = mapMaybe removeDirsep ms
= (ms,ps)
where
removeDirsep s
# final = dec (size s)
| s.[final] == ':' = s%(0,dec final)
= s
ShellDefault :: !{#Char} !(PSt .l) -> (!Int,!(PSt .l))
ShellDefault _ ps = abort "no ShellDefault on a Mac silly:-)"
......@@ -3,7 +3,7 @@ definition module UtilNewlinesFile
//1.3
from StdString import String
//3.1
from StdClass import ==, toString
from StdClass import class ==, class toString
:: NewlineConvention
= NewlineConventionNone | NewlineConventionMac | NewlineConventionUnix | NewlineConventionDos
......@@ -34,7 +34,7 @@ readLine file
// the second argument is the newline string
// the file should have been opened with mode FWriteData
writeAnyLine :: !{#Char} !{#Char} !*File -> !*File
writeAnyLine :: !{#Char} !{#Char} !*File -> *File
convertLine :: !*{#Char} -> (NewlineConvention, *{#Char})
......
......@@ -38,7 +38,7 @@ instance toString NewlineConvention where
= "\xd\xa"
// slice that returns a unique array
(%.) infixl 9 :: !.{#Char} !(!Int,!Int) -> !.{#Char}
(%.) infixl 9 :: !.{#Char} !(!Int,!Int) -> .{#Char}
(%.) string indices
= code
{
......@@ -92,7 +92,7 @@ readLine file
(_, line, file`)
= readAnyLine file
writeAnyLine :: !{#Char} !{#Char} !*File -> !*File
writeAnyLine :: !{#Char} !{#Char} !*File -> *File
writeAnyLine line newlineString file
# maxIndex
= size line - 1
......
definition module linker2;
from StdString import String;
from StdFile import Files;
from StdFile import :: Files;
:: SymbolArray :== {!Symbol};
......
......@@ -202,13 +202,15 @@ create_names_table :: *NamesTable;
create_names_table = createArray SYMBOL_TABLE_SIZE EmptyNamesTableElement;
insert_symbol_in_symbol_table :: !String Int Int !*NamesTable -> *NamesTable;
insert_symbol_in_symbol_table symbol_name symbol_n file_n names_table=:{[symbol_hash]=symbol_list}
insert_symbol_in_symbol_table symbol_name symbol_n file_n names_table/*=:{[symbol_hash]=symbol_list}*/
#! symbol_list=names_table.[symbol_hash];
| symbol_in_symbol_table_list symbol_list
= names_table;
= { names_table & [symbol_hash] = NamesTableElement symbol_name symbol_n file_n symbol_list};
{}{
= { names_table & [symbol_hash] = NamesTableElement symbol_name symbol_n file_n symbol_list};
{};{
symbol_hash=symbol_name_hash symbol_name;
symbol_in_symbol_table_list EmptyNamesTableElement
= False;
symbol_in_symbol_table_list (NamesTableElement string _ _ symbol_table_list)
......@@ -218,7 +220,8 @@ insert_symbol_in_symbol_table symbol_name symbol_n file_n names_table=:{[symbol_
}
find_symbol_in_symbol_table :: !String !*NamesTable -> (!NamesTableElement,!*NamesTable);
find_symbol_in_symbol_table symbol_name names_table=:{[symbol_hash]=symbol_list}
find_symbol_in_symbol_table symbol_name names_table/*=:{[symbol_hash]=symbol_list}*/
#! symbol_list=names_table.[symbol_hash];
= (symbol_in_symbol_table_list symbol_list,names_table);
{
symbol_hash=symbol_name_hash symbol_name;
......@@ -302,10 +305,10 @@ sort_symbols symbols symbol_array0
heap_sort_lp :: *SortArray Int Int Int SortElement-> *SortArray;
heap_sort_lp a i j max_index ir
| j<max_index
= heap_sort1 a i j max_index ir;
= heap_sort1 a i j (inc j) max_index ir;
{
heap_sort1 :: !*SortArray !Int !Int !Int !SortElement -> *SortArray;
heap_sort1 a=:{[j]=a_j,[j1]=a_j_1} i j max_index ir
heap_sort1 :: !*SortArray !Int !Int !Int !Int !SortElement -> *SortArray;
heap_sort1 a=:{[j]=a_j,[j1]=a_j_1} i j j1 max_index ir
= heap_sort1 a_j a_j_1 a i j max_index ir;
{
heap_sort1 :: !SortElement !SortElement !*SortArray !Int !Int !Int !SortElement -> *SortArray;
......@@ -313,8 +316,6 @@ sort_symbols symbols symbol_array0
| a_j.offset < a_j_1.offset
= heap_sort2 a i (inc j) max_index ir;
= heap_sort2 a i j max_index ir;
j1=inc j;
}
}
| j>max_index
......@@ -377,7 +378,7 @@ reverse_symbols l = reverse_symbols l EmptySymbolIndex;
= case (m1,m2) of {
(Module {module_offset=offset1},Module {module_offset=offset2})
-> offset1<=offset2;
}
};
sort_modules :: !*Xcoff -> .Xcoff;
sort_modules xcoff=:{symbol_table}
......@@ -395,7 +396,11 @@ sort_modules xcoff=:{symbol_table}
(bss_symbols1,symbols3)=reverse_and_sort_symbols bss_symbols symbols2;
// {symbol_table} = xcoff;
{text_symbols,data_symbols,bss_symbols,symbols=symbols0} = symbol_table;
// {text_symbols,data_symbols,bss_symbols,symbols=symbols0} = symbol_table;
text_symbols = symbol_table.text_symbols;
data_symbols = symbol_table.data_symbols;
bss_symbols = symbol_table.bss_symbols;
symbols0 = symbol_table.symbols;
}
read_library_files :: ![String] Int Int !*Files *NamesTable -> (![String],!LibraryList,!Int,!*Files,!*NamesTable);
......@@ -805,7 +810,7 @@ define_symbols n_symbols symbol_table_string string_table names_table file_n
= (names_table0,symbol_table0);
= case (symbol_table_string BYTE (offset+16)) of {
C_HIDEXT
-> define_symbols_lp (symbol_n+1+n_numaux) names_table0 (new_symbol_table n_value);
-> define_symbols_lp (symbol_n+1+n_numaux) names_table0 (new_symbol_table symbol_table0 n_value);
C_EXT
| n_scnum==N_UNDEF
| x_sm_typ_t==XTY_ER
......@@ -817,7 +822,7 @@ define_symbols n_symbols symbol_table_string string_table names_table file_n
};
}
-> abort "error in EXT symbol";
-> define_symbols_lp (symbol_n+1+n_numaux) names_table1 (new_symbol_table n_value);
-> define_symbols_lp (symbol_n+1+n_numaux) names_table1 (new_symbol_table symbol_table0 n_value);
{
names_table1=insert_symbol_in_symbol_table name_of_symbol symbol_n_2 file_n names_table0;
}
......@@ -825,18 +830,18 @@ define_symbols n_symbols symbol_table_string string_table names_table file_n
-> define_symbols_lp (symbol_n+1+n_numaux) names_table0 symbol_table0;
C_STAT
-> define_symbols_lp (symbol_n+1+n_numaux) names_table0 symbol_table0;
}
};
{
new_symbol_table :: Int -> .SymbolTable;
new_symbol_table n_value
new_symbol_table :: *SymbolTable Int -> .SymbolTable;
new_symbol_table symbol_table0 n_value
| x_sm_typ_t==XTY_SD
= symbol_table_with_csect;
= symbol_table_with_csect symbol_table0;
| x_sm_typ_t==XTY_LD
= symbol_table_with_label;
= symbol_table_with_label symbol_table0;
| x_sm_typ_t==XTY_CM
= symbol_table_with_common n_value;
= symbol_table_with_common symbol_table0 n_value;
symbol_table_with_csect
symbol_table_with_csect symbol_table0
| n_scnum==TEXT_SECTION && (x_smclass==XMC_PR || x_smclass==XMC_GL)
= {symbol_table0 &
symbols = {symbol_table0.symbols & [symbol_n_2]=
......@@ -877,7 +882,7 @@ define_symbols n_symbols symbol_table_string string_table names_table file_n
(abort "Error in symbol table")
));
symbol_table_with_label
symbol_table_with_label symbol_table0
| n_scnum==TEXT_SECTION && x_smclass==XMC_PR
= {symbol_table0 &
symbols = {symbol_table0.symbols & [symbol_n_2]=
......@@ -896,7 +901,7 @@ define_symbols n_symbols symbol_table_string string_table names_table file_n
-> symbol_table1;
XMC_TC0
-> symbol_table1;
}
};
{
symbol_table1
=> {symbol_table0 &
......@@ -906,10 +911,10 @@ define_symbols n_symbols symbol_table_string string_table names_table file_n
};
{
x_scnlen_2 = (inc x_scnlen) >> 1;
}
};
symbol_table_with_common n_value
| n_scnum==BSS_SECTION && x_smclass==XMC_BS
symbol_table_with_common symbol_table0 n_value
| n_scnum==BSS_SECTION && (x_smclass==XMC_BS || x_smclass==XMC_RW)
= {symbol_table0 &
symbols = {symbol_table0.symbols & [symbol_n_2]=
Module {section_n=BSS_SECTION,
......@@ -1049,39 +1054,39 @@ read_xcoff_file :: !String *NamesTable Bool !String !*File !*Files Int -> (![Str
read_xcoff_file file_name names_table0 one_pass_link header_string file files1 file_n
# (ok1,n_sections,symbol_table_offset,n_symbols,file) = parse_xcoff_header header_string file;
| not ok1
= error ("Not an xcoff file: \""+++file_name+++"\"") file files1;
= error ("Not an xcoff file: \""+++file_name+++"\"") names_table0 file files1;
# (ok2,text_relocation_offset,n_text_relocations,text_section_offset,text_section_size,text_v_address,file)
= read_xcoff_text_or_data_section_header ".text" file;
| not ok2
= error "Error in text section header" file files1;
= error "Error in text section header" names_table0 file files1;
# (ok3,data_relocation_offset,n_data_relocations,data_section_offset,data_section_size,data_v_address,file)
= read_xcoff_text_or_data_section_header ".data" file;
| not ok3
= error "Error in data section header" file files1;
= error "Error in data section header" names_table0 file files1;
# (ok4,file)
= read_other_section_headers n_sections file;
| not ok4
= error "Error in section header" file files1;
= error "Error in section header" names_table0 file files1;
# (ok5,text_section,file)
= read_text_section one_pass_link text_section_offset text_section_size file;
| not ok5
= error "Error in text section" file files1;
= error "Error in text section" names_table0 file files1;
# (ok6,data_section,file)
= read_section one_pass_link data_section_offset data_section_size file;
| not ok6
= error "Error in data section" file files1;
= error "Error in data section" names_table0 file files1;
# (ok7,text_relocations,file)
= read_relocations text_relocation_offset n_text_relocations file;
| not ok7
= error "Error in text relocations" file files1;
= error "Error in text relocations" names_table0 file files1;
# (ok8,data_relocations,file)
= read_relocations data_relocation_offset n_data_relocations file;
| not ok8
= error "Error in data relocations" file files1;
= error "Error in data relocations" names_table0 file files1;
# (ok9,symbol_table_string,string_table,file)
= read_symbol_table symbol_table_offset n_symbols file;
| not ok9
= error ("Error in symbol table "+++file_name) file files1;
= error ("Error in symbol table "+++file_name) names_table0 file files1;
= ([],text_section,data_section,xcoff_file,names_table1,close_file file files1);
{
xcoff_file={header=header,symbol_table=symbol_table0,n_symbols=n_symbols_2,
......@@ -1100,8 +1105,8 @@ read_xcoff_file file_name names_table0 one_pass_link header_string file files1 f
(_,files2)=fclose file files1;
}
error :: String !*File *Files -> (![String],!*String,!*String,!*Xcoff,!*NamesTable,!*Files);
error error_string file files1
error :: String !*NamesTable !*File *Files -> (![String],!*String,!*String,!*Xcoff,!*NamesTable,!*Files);
error error_string names_table0 file files1
= ([error_string],empty_section_string,empty_section_string,empty_xcoff,names_table0,close_file file files1);
}
......
definition module linker3;
from StdFile import Files;
from StdString import String;
from StdFile import :: Files;
import linker2;
:: *Sections = Sections !*String !*String !Sections | EndSections;
......
This diff is collapsed.
definition module linker_resources;
from StdString import String;
from StdFile import Files;
from StdFile import :: Files;
read_application_options :: !{#Char} !*Files -> (!Bool,(!Int, !{#Char}), !Int, !Int, !Int, !Int, !Int, !Int, !Int, !Int, !*Files);
create_application_resource :: !{#Char} /* RWS ... */ !Bool /* ... RWS */ (!Int, !{#Char}) !Int !Int !Int !Int !Int !Int !Int !*Files -> (!Bool,!*Files);
create_application_resource :: !{#Char} !Bool /* RWS ... */ !Bool /* ... RWS */ (!Int, !{#Char}) !Int !Int !Int !Int !Int !Int !Int !*Files -> (!Bool,!*Files);
......@@ -11,8 +11,8 @@ import pointer;
import StdMisc;
create_application_resource :: !{#Char} /* RWS ... */ !Bool /* ... RWS */ (!Int, !{#Char}) !Int !Int !Int !Int !Int !Int !Int !*Files -> (!Bool,!*Files);
create_application_resource file_name /* RWS ... */ application_existed /* ... RWS */ font_info heap_size heap_size_multiple stack_size flags application_and_extra_memory_size initial_heap_size memory_profile_minimum_heap_size files
create_application_resource :: !{#Char} !Bool /* RWS ... */ !Bool /* ... RWS */ (!Int, !{#Char}) !Int !Int !Int !Int !Int !Int !Int !*Files -> (!Bool,!*Files);
create_application_resource file_name add_carb /* RWS ... */ application_existed /* ... RWS */ font_info heap_size heap_size_multiple stack_size flags application_and_extra_memory_size initial_heap_size memory_profile_minimum_heap_size files
| error_n<>0
= (False,files);
| ref_num==(-1)
......@@ -21,7 +21,11 @@ create_application_resource file_name /* RWS ... */ application_existed /* ... R
= (False,files);
= (True,files);
{}{
(res_error,_)=ResError (CloseResFile ref_num t8);
(res_error,_)=ResError (CloseResFile ref_num t9);
/* DvA ... */
(ok6,t9)=add_carb_resource add_carb t8;
/* ... DvA */
/* RWS ... */
(ok5,t8)=add_font_resource font_info t7;
......@@ -48,8 +52,8 @@ create_application_resource file_name /* RWS ... */ application_existed /* ... R
null_string1=toString '\0';
*/
(error_n,t1)= if application_existed
(SetFileType "APPL" file_name OSNewToolbox)
(SetFileTypeAndCreator "APPL" "\0\0\0\0" file_name OSNewToolbox);
(SetFileType "APPL" file_name NewToolbox)
(SetFileTypeAndCreator "APPL" "\0\0\0\0" file_name NewToolbox);
/* RWS */
open_resource_file t0
......@@ -220,7 +224,22 @@ add_font_resource (font_size, font_name) t0
}
/* ... RWS */
/* DvA ... */
add_carb_resource :: Bool *Int -> (!Bool,!*Int);
add_carb_resource add t0
| not add
= (True,t0);
| handle==0
= (False,t1);
= (error_n==0,t4);
{}{
(handle,_,t1) = NewHandle 8 t0;
t2 = copy_string_to_handle "\0\0\0\0\0\0\0\0" handle 8 t1;
(error_n,t3) = ResError (AddResource handle "carb" 0 "" t2);
// (_,t4) = DisposHandle handle t3;
t4 = t3;
}
/* ... DvA */
// RWS added flags parameter
add_size_resource :: Int Int *Int -> (!Bool,!*Int);
......@@ -245,7 +264,7 @@ read_application_options file_name files
| not pef_read
= (False, (0, ""), 0, 0, 0, 0, 0, 0, 0, 0, files)
# (ref_num, t)
= HOpenResFile 0 0 file_name 1 OSNewToolbox
= HOpenResFile 0 0 file_name 1 NewToolbox
| ref_num == (-1)
= (False, (0, ""), 0, 0, 0, 0, 0, 0, 0, 0, files)
# (size_read, _, minimum_size, t)
......@@ -269,7 +288,7 @@ read_application_options file_name files
flags, initial_heap_size, profile_heap_size, pef_size,
minimum_size-heap_size-stack_size, files);
read_font_resource :: !*OSToolbox -> (!Bool, !Int, !{#Char}, !*OSToolbox);
read_font_resource :: !*Toolbox -> (!Bool, !Int, !{#Char}, !*Toolbox);
read_font_resource t
# (handle,t)
= Get1Resource "Font" 128 t
......@@ -305,7 +324,7 @@ read_size_resource t
= LoadLong ptr t;
= (True, flags, minimum_size, t);
read_sthp_resource :: *OSToolbox -> (!Bool, !Int, !Int, !Int, !Int, !Int, !*OSToolbox);
read_sthp_resource :: *Toolbox -> (!Bool, !Int, !Int, !Int, !Int, !Int, !*Toolbox);
read_sthp_resource t
# (handle,t)
= Get1Resource "STHP" 0 t
......@@ -333,7 +352,7 @@ read_sthp_resource t
= LoadLong ptr t;
= (True, stack_size, heap_size_multiple, heap_size, flags, initial_heap_size, t);
read_prfl_resource :: *OSToolbox -> (!Bool, !Int, !*OSToolbox);
read_prfl_resource :: *Toolbox -> (!Bool, !Int, !*Toolbox);
read_prfl_resource t
# (handle,t)
= Get1Resource "PRFL" 128 t
......@@ -370,7 +389,7 @@ read_pef_size_from_data_fork name files
// otherwise
= (True, pef_size, files);
LoadString :: Int Int *{#Char} Ptr *OSToolbox -> (!*{#Char}, Ptr, !*OSToolbox);
LoadString :: Int Int *{#Char} Ptr *Toolbox -> (!*{#Char}, Ptr, !*Toolbox);
LoadString n size string ptr t
| n == size
= (string, ptr, t);
......
definition module xcoff_linker;
from StdFile import Files;
from StdString import String;
from StdFile import :: Files;
import linker2;
mark_used_modules :: !Int !Int !*{#Bool} !{#Int} !*{#*Xcoff} -> (![String],!*{#Bool},!*{#*Xcoff});
link_xcoff_files :: ![String] ![String] !String !(!Int, !{#Char}) !Int !Int !Int !Int !Int !Int !Int !Bool !*Files -> ((!Bool,![String]),!*Files);
link_xcoff_files :: ![String] ![String] !String !(!Int, !{#Char}) !Int !Int !Int !Int !Int !Int !Int !Bool !Bool !*Files -> ((!Bool,![String]),!*Files);
This diff is collapsed.
Markdown is supported
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