home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
historic
/
v941.tgz
/
icon.v941src.tar
/
icon.v941src
/
ipl
/
packs
/
idol
/
idol.hqx
/
mpw.icn
< prev
next >
Wrap
Text File
|
1994-06-08
|
2KB
|
97 lines
#
# @(#)mpw.icn 1.5 10/28/93
# @(#)mpw.icn 1.4 5/5/90
# OS-specific code for Macintosh MPW
# Adapted from unix.icn by Charles Lakos
# Modified by Bob Alexander 10/28/93
#
global icontopt,env,sysok
procedure mysystem(s)
if \loud then write(s)
return system(s)
end
procedure filename(s,ext)
s ||:= \ext
return s
end
# if the filename s has extension ext then return the filename less the
# extension, otherwise fail.
procedure fileroot(s,ext)
if s[- *ext : 0] == ext then return s[1 : - *ext]
end
procedure writesublink(s)
writelink(env||"_"||s)
end
procedure envpath(filename)
return env||"_"||filename
end
#
# Installation.
# Uses hierarchical filesystem on some systems (see initialize)
#
procedure install(args)
write("Installing idol environment with prefix ",env)
fout := envopen("i_object.icn","w")
write(fout,"record idol_object(__state,__methods)")
close(fout)
fout := &null
cdicont(["i_object"])
end
procedure uninstall(args)
# not implemented yet
end
procedure makeexe(args,i)
exe := args[i]
if icont(exe) = \sysok then {
mysystem("delete "||exe||".icn")
if \exec then {
write("Executing:")
every i := exec+1 to *args do exe ||:= " "||args[i]
mysystem(exe)
}
}
return
end
#
# system-dependent compilation of idolfile.icn
# (in the idol subdirectory, if there is one)
#
procedure cdicont(idolfiles)
args := " -c"
rms := ""
every ifile := !idolfiles do args ||:= " " || envpath(ifile)
every ifile := !idolfiles do rms ||:= " " || envpath(ifile) || ".icn"
if comp = -2 then return # -t --> don't translate at all
if icont(args,"") = \sysok
then mysystem("delete "||rms)
return
end
procedure sysinitialize()
icontopt := " "
env:= "C"
sysok := 0
loud := &null
end
procedure system(s)
local fn
static f
initial {
fn := "idol.commands"
f := open(fn,"w") | stop("Can't open ",fn," for output")
write(f,"set echo 1")
}
write(f,s)
return sysok
end