home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Phoenix CD 2.0
/
Phoenix_CD.cdr
/
02a
/
psmagic1.zip
/
PSLOAD.INI
< prev
next >
Wrap
Text File
|
1989-12-21
|
23KB
|
792 lines
%
% PSLOAD.INI - startup script for PS interpreter
%
%
% This postscript program is run with the systemdict and userdict
% sitting on the dictionary stack.
%
% Errors are not yet working - so beware !
%
% ...
(%%[ Initializing... ]%%\n) print flush
1 dup eq setpacking
% get rid of statusdict first.
2 index begin /statusdict exch def end
% Initialize Systemdict first
2 1 roll
dup dup /systemdict 2 1 roll put
begin
/userdict 1 index def
/errordict 30 dict def
/$error 9 dict def
/true 1 dup eq def
/false 1 0 eq def
/handleerror { //errordict /handleerror get exec } bind def
/prompt
{
execdict /execdepth get { (P) print } repeat
(S>) print flush
} bind def
/=string 128 string def
/=print { dup type /stringtype ne { //=string cvs } if print } def
/= { //=print exec (\n) print } def
/stack { count 1 sub 0 1 3 2 roll { index = } for } bind def
/version ($X:pi_init.ps,v11.2$) (,v) search pop pop pop 0 1 index length 1 sub getinterval def
/_vdate ($Date: 89/02/07 15:36:27 $) 7 1 index length 9 sub getinterval def
(\004)cvn { grestoreall initgraphics } bind def
(\032)cvn {} def
end
begin
/#copies 1 def
/execdict 11 dict def
execdict begin
/doquit false def
/execdepth -1 def
/execlimit 20 def
/execsaves 0 def
/trace false def
/eofseen false def
/stdin (%stdin)(r)file def
/exitserver false def
/abortjob false def
/enableabort true def
end
/letter { (\377LT) _setpapertype } bind def
/lettersmall { (\377lt)_setpapertype } bind def
/legal { (\377LG) _setpapertype } bind def
/note { (\377NT) _setpapertype } bind def
/a4 { (\377A4) _setpapertype } bind def
/a4small { (\377a4) _setpapertype } bind def
/b5 { (\377B5) _setpapertype } bind def
/ledger { (\377LD) _setpapertype } bind def
/b4 { (\377B4) _setpapertype } bind def
/a3 { (\377A3) _setpapertype } bind def
/executivepaper { (\377EX) _setpapertype } bind def
/start_cleanup
{
_disableinterrupts
clear
false _endjob
countdictstack 2 sub { end } repeat
{ //execdict /execsaves get dup type /savetype ne { exit } if restore } loop
} bind def
/start
{
(%%[ PostScript(tm) - Copyright (C), Terra Systems ]%%\n) print
(%%[ Version: ) print version print (; Version date: ) print _vdate print ( ]%%\n) print flush
% close this file
currentfile closefile
{ //userdict /server get stopped //start_cleanup exec } bind loop
(%%[ PostScript(tm) Terminating ]%%\n) print flush
//systemdict /quit get exec
} bind def
% interpreter loop - preamble, called with server loop
/server_common
{
//execdict begin
execdepth 1 add
dup execlimit ge { pop end //errordict /execstackoverflow get exec stop } if
/execdepth exch def
loop % on argument
/doquit false def
/execdepth execdepth 1 sub def
end
} def
% interactive interpreter loop
/executive
{
(%%[ Starting Executive ]%%\n) print flush
{
_disableinterrupts
{
% begin execdict
prompt
(%statementedit) (r) _enableinterrupts file _disableinterrupts
dup /stmtfile exch def
end
0 _clearinterrupts _enableinterrupts
cvx exec
}
stopped _disableinterrupts
{
{ currentdict //execdict ne { exit } if end } loop
handleerror
} if
//execdict begin
/stmtfile where { pop stmtfile status { stmtfile closefile } if } if
stdin bytesavailable -1 eq doquit or
{
exitserver { stop } { exit } ifelse
}
if
}
server_common
(%%[ Exiting Executive ]%%\n) print flush
} bind def
% interpreter loop
/server
{
(%%[ Starting Server ]%\n) print flush
_disableinterrupts
{
_beginjob
/execsaves save def
/exitserver false def
/abortjob false def
_clearexitserver
stdin
end
//statusdict begin
//=string _getjobname dup length 0 gt
{
dup length string copy
}
{
pop null
}
ifelse
/jobname exch def
end
{ 0 _clearinterrupts _enableinterrupts cvx exec _disableinterrupts } stopped
_disableinterrupts
//execdict begin
exitserver not and
{
/abortjob //$error /newerror get def
handleerror
(%%[ Flushing until EOF seen ]%%\n) print flush
stdin _flushfile
(%%[ EOF ]%%\n) print flush
} if
clear
countdictstack 2 sub { end } repeat
//execdict begin
% put this on stack because of restore
exitserver
doquit
abortjob
execsaves restore
/abortjob exch def
_resetstdin
% use doquit here
{
% if not exitserver, quit
not { exit } if
stdin end
(%%[ exitserver: permanent state may be changed ]%%\n) print flush
{ 0 _clearinterrupts _enableinterrupts cvx exec _disableinterrupts } stopped
_disableinterrupts
//execdict begin
{
/abortjob //$error /newerror get def
handleerror
(%%[ Flushing until EOF seen ]%%\n) print flush
stdin _flushfile
(%%[ EOF ]%%\n) print flush
} if
clear
countdictstack 2 sub { end } repeat
_resetstdin
//execdict begin
}
{
pop % "exitserver" field
}
ifelse
flush
abortjob enableabort and not _endjob
}
server_common
(%%[ Exiting Server ]%%\n) print flush
_enableinterrupts
} bind def
% userdict version of quit
/quit
{
//execdict /doquit true put
stop
} bind def
end
$error begin
/newerror false def
/errorname /--none-- def
/command /--none-- def
/ostack [] def
/estack [] def
/dstack [] def
/vmerror 1 string def
vmerror 0 0 put
end
errordict begin
% save the state when an error occurs. called as "cause errname doerror -"
/doerror
{
//$error begin
vmerror 0 get 1 gt
{
vmerror 0 0 put
(Doerror: recursive vmerror\n) print flush
stop
}
if
newerror
{
(Doerror: Error within an error\n) print
(olderror: ) print errorname //=string cvs print (\n) print
(newerror: ) print //=string cvs print (\n) print
flush end
stop
} if
/newerror true def
/errorname exch def
/command exch def
_opstack /ostack exch def
/estack countexecstack array execstack def
/dstack countdictstack array dictstack
0 countdictstack 1 sub getinterval def
end
} bind def
/stackunderflow { /stackunderflow //errordict /doerror get exec stop } bind def
/unregistered { /unregistered //errordict /doerror get exec stop } bind def
/dictstackunderflow { /dictstackunderflow //errordict /doerror get exec stop } bind def
/typecheck { /typecheck //errordict /doerror get exec stop } bind def
/undefinedresult { /undefinedresult //errordict /doerror get exec stop } bind def
/invalidexit { /invalidexit //errordict /doerror get exec stop } bind def
/dictfull { /dictfull //errordict /doerror get exec stop } bind def
/nocurrentpoint { /nocurrentpoint //errordict /doerror get exec stop } bind def
/limitcheck { /limitcheck //errordict /doerror get exec stop } bind def
/invalidaccess { /invalidaccess //errordict /doerror get exec stop } bind def
/invalidfileaccess { /invalidfileaccess //errordict /doerror get exec stop } bind def
/ioerror { /ioerror //errordict /doerror get exec stop } bind def
/invalidfont { /invalidfont //errordict /doerror get exec stop } bind def
/invalidrestore { /invalidrestore //errordict /doerror get exec stop } bind def
/rangecheck { /rangecheck //errordict /doerror get exec stop } bind def
/execstackoverflow { /execstackoverflow //errordict /doerror get exec stop } bind def
/dictstackoverflow { end end end end /dictstackoverflow //errordict /doerror get exec stop } bind def
/unmatchedmark { /unmatchedmark //errordict /doerror get exec stop } bind def
/syntaxerror { /syntaxerror //errordict /doerror get exec stop } bind def
/undefined { /undefined //errordict /doerror get exec stop } bind def
/undefinedfilename { /undefinedfilename //errordict /doerror get exec stop } bind def
/VMerror { //$error /vmerror get dup 0 get 1 add 0 exch put
/vmerror //errordict /doerror get exec stop } bind def
/timeout { /timeout //errordict /doerror get exec stop } bind def
/interrupt { /interrupt //errordict /doerror get exec stop } bind def
/PasswordIncorrect /unregistered load def
/papermismatch
{
(%%[ Paper mismatch, requested paper type ) print
//systemdict /framedevice get eq
{ pop exch 8 mul =print ( X ) print =print pop ( pixels) print }
{ (") print print (") print }
ifelse
(, ignored ]%%) = flush
} bind def
/stackoverflow
{
_opstack
//errordict begin
/stackoverflow dup doerror
//$error /ostack 3 -1 roll put
end
stop
} bind def
/handleerror
{
//$error begin
vmerror 0 0 put
newerror
{
%currentfile closefile
(%%[ Error: ) print
errorname //=string cvs print
(; OffendingCommand: ) print
/command load //=string cvs print
( ]%%\n) print
flush
} if
/newerror false def
end
} bind def
end
statusdict begin
/product =string _getproductname dup length string copy def
/jobname null def
/manualfeed false def
/debugmode 0 def
/jobstate (busy) def
/jobsource (stdin) def
/frametoprinter {} def
/revision 1 def
% status procedure, called on ^T
/statusproc
{
(%%[ status: compiling; source comm ]%%\n) print flush
} bind def
/printererror
{
(%%[ PrinterError:) print
statusdict /_enginestatus get exec
dup 2 and 2 eq { ( no_paper) print } if
dup 4 and 4 eq { ( paper_jam) print } if
dup 16#1000 and 16#1000 eq { ( awaiting_manual_feed) print } if
dup 16#eff1 and 0 ne { ( misc_engine_problems) print } if
0 eq { ( engine ready) print } if
( ]%%\n) print flush
}bind def
% stub out these two.
/setidlefonts { cleartomark } def
/idlefonts { mark } def
% set up compatibility for PS-40 ledger tray.
%/ledgertray { (\377LD) _setpapertype 7920 0 translate 90 rotate } bind def
end
/serverdict 3 dict def
serverdict begin
/exitserver statusdict /exitserver get def
/setrealdevice null def
/execjob null def
end
%
% Definition of == and pstack operators
%
% create dictionary
19 dict begin
% store its name in itself
/==dict currentdict def
% string for outputting things
/==string 128 string def
% recursion level, max
/rlv 0 def
/rmx 10 def
% top level
/ptype
{
/rlv rlv 1 add def
rlv rmx eq { errordict /execstackoverflow get exec } if
dup type exec
/rlv rlv 1 sub def
} def
% types that you unparse using cvs
/integertype { //==string cvs print } def
/booleantype /integertype load def
/realtype /integertype load def
% simple composite types, use CVS mostly
/stringtype { (\() print print (\)) print } def
/nametype { dup xcheck not { (/) print } if //==string cvs print } def
/operatortype { (--) dup print exch //==string cvs print print } def
% recursive type
/arraytype
{
dup rcheck
{
dup xcheck
{ (}) ({) }
{ (]) ([) }
ifelse
print
exch { ptype ( ) print } forall
print
}
{ (-) print type =string cvs 0 1 index length 4 sub getinterval print (-) print }
ifelse
}
def
/packedarraytype /arraytype load def
% types that you can't unparse
/fonttype { pop (-fontid-) print } def
/dicttype { pop (-dictionary-) print } def
/nulltype { pop (-null-) print } def
/marktype { pop (-mark-) print } def
/savetype { pop (-savelevel-) print } def
/filetype { pop (-filestream-) print } def
% store top-level routine in systemdict
systemdict begin
/==print { //==dict begin ptype end } def
/== { //==dict begin ptype end (\n) print } def
end
userdict begin
/pstack { count 1 sub 0 1 3 2 roll { index == } for } def
end
end
%
% Initialize graphics state
%
{} settransfer
72 0 dtransform dup mul exch dup mul add sqrt 5 div 45 { dup mul exch dup mul add 1 exch sub } bind setscreen
%
% Initialize font stuff
%
% put FontDirectory and StandardEncoding in systemdict
systemdict /FontDirectory 250 dict readonly put
systemdict /StandardEncoding
[/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/space /exclam /quotedbl /numbersign /dollar /percent /ampersand
/quoteright /parenleft /parenright /asterisk /plus /comma /hyphen /period
/slash /zero /one /two /three /four /five /six /seven /eight /nine
/colon /semicolon /less /equal /greater /question /at /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 /bracketleft
/backslash /bracketright /asciicircum /underscore /quoteleft /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
/braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/exclamdown /cent /sterling /fraction /yen /florin /section /currency
/quotesingle /quotedblleft /guillemotleft /guilsinglleft /guilsinglright
/fi /fl /.notdef /endash /dagger /daggerdbl /periodcentered /.notdef
/paragraph /bullet /quotesinglbase /quotedblbase /quotedblright
/guillemotright /ellipsis /perthousand /.notdef /questiondown /.notdef
/grave /acute /circumflex /tilde /macron /breve /dotaccent /dieresis
/.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /emdash
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/AE /.notdef /ordfeminine /.notdef /.notdef /.notdef /.notdef /Lslash
/Oslash /OE /ordmasculine /.notdef /.notdef /.notdef /.notdef /.notdef
/ae /.notdef /.notdef /.notdef /dotlessi /.notdef /.notdef /lslash
/oslash /oe /germandbls /.notdef /.notdef /.notdef /.notdef ]
put
%
% Initialize the CharStrings dictionary
%
systemdict /_CharStrings 229 dict put
_CharStrings
dup /space 61231 put
dup /exclam 33 put
dup /quotedbl 34 put
dup /numbersign 35 put
dup /dollar 164 put
dup /percent 37 put
dup /ampersand 38 put
dup /quoteright 185 put
dup /parenleft 40 put
dup /parenright 41 put
dup /asterisk 42 put
dup /plus 43 put
dup /comma 44 put
dup /hyphen 8510 put
dup /period 46 put
dup /slash 47 put
dup /zero 48 put
dup /one 49 put
dup /two 50 put
dup /three 51 put
dup /four 52 put
dup /five 53 put
dup /six 54 put
dup /seven 55 put
dup /eight 56 put
dup /nine 57 put
dup /colon 58 put
dup /semicolon 59 put
dup /less 60 put
dup /equal 61 put
dup /greater 62 put
dup /question 63 put
dup /at 64 put
dup /A 65 put
dup /B 66 put
dup /C 67 put
dup /D 68 put
dup /E 69 put
dup /F 70 put
dup /G 71 put
dup /H 72 put
dup /I 73 put
dup /J 74 put
dup /K 75 put
dup /L 76 put
dup /M 77 put
dup /N 78 put
dup /O 79 put
dup /P 80 put
dup /Q 81 put
dup /R 82 put
dup /S 83 put
dup /T 84 put
dup /U 85 put
dup /V 86 put
dup /W 87 put
dup /X 88 put
dup /Y 89 put
dup /Z 90 put
dup /bracketleft 91 put
dup /backslash 92 put
dup /bracketright 93 put
dup /asciicircum 195 put
dup /underscore 95 put
dup /quoteleft 169 put
dup /a 97 put
dup /b 98 put
dup /c 99 put
dup /d 100 put
dup /e 101 put
dup /f 102 put
dup /g 103 put
dup /h 104 put
dup /i 105 put
dup /j 106 put
dup /k 107 put
dup /l 108 put
dup /m 109 put
dup /n 110 put
dup /o 111 put
dup /p 112 put
dup /q 113 put
dup /r 114 put
dup /s 115 put
dup /t 116 put
dup /u 117 put
dup /v 118 put
dup /w 119 put
dup /x 120 put
dup /y 121 put
dup /z 122 put
dup /braceleft 123 put
dup /bar 124 put
dup /braceright 125 put
dup /asciitilde 61053 put
dup /exclamdown 161 put
dup /cent 162 put
dup /sterling 163 put
dup /fraction 128 put
dup /yen 165 put
dup /florin 61346 put
dup /section 167 put
dup /currency 36 put
dup /quotesingle 39 put
dup /quotedblleft 170 put
dup /guillemotleft 171 put
dup /guilsinglleft 61226 put
dup /guilsinglright 61227 put
dup /fi 61476 put
dup /fl 61477 put
dup /endash 61220 put
dup /dagger 61232 put
dup /daggerdbl 61233 put
dup /periodcentered 8494 put
dup /paragraph 182 put
dup /bullet 8631 put
dup /quotesinglbase 9138 put
dup /quotedblbase 61224 put
dup /quotedblright 186 put
dup /guillemotright 187 put
dup /ellipsis 65074 put
dup /perthousand 61249 put
dup /questiondown 191 put
dup /grave 131 put
dup /acute 133 put
dup /circumflex 130 put
dup /tilde 132 put
dup /macron 134 put
dup /breve 135 put
dup /dotaccent 136 put
dup /dieresis 137 put
dup /ring 138 put
dup /cedilla 139 put
dup /hungarumlaut 205 put
dup /ogonek 206 put
dup /caron 140 put
dup /emdash 61221 put
dup /AE 225 put
dup /ordfeminine 227 put
dup /Lslash 232 put
dup /Oslash 233 put
dup /OE 234 put
dup /ordmasculine 235 put
dup /ae 241 put
dup /dotlessi 245 put
dup /lslash 248 put
dup /oslash 249 put
dup /oe 250 put
dup /germandbls 251 put
dup /Aacute 61730 put
dup /Acircumflex 61731 put
dup /Adieresis 61735 put
dup /Agrave 61729 put
dup /Aring 61736 put
dup /Atilde 61732 put
dup /Ccedilla 61741 put
dup /Eacute 61745 put
dup /Ecircumflex 61746 put
dup /Edieresis 61749 put
dup /Egrave 61744 put
dup /Iacute 61759 put
dup /Icircumflex 61760 put
dup /Idieresis 61764 put
dup /Igrave 61758 put
dup /Ntilde 61772 put
dup /Oacute 61776 put
dup /Ocircumflex 61777 put
dup /Odieresis 61780 put
dup /Ograve 61775 put
dup /Otilde 61778 put
dup /Scaron 61788 put
dup /Uacute 61792 put
dup /Ucircumflex 61793 put
dup /Udieresis 61797 put
dup /Ugrave 61791 put
dup /Ydieresis 61805 put
dup /Zcaron 61808 put
dup /aacute 61858 put
dup /acircumflex 61859 put
dup /adieresis 61863 put
dup /agrave 61857 put
dup /aring 61864 put
dup /atilde 61860 put
dup /ccedilla 61869 put
dup /eacute 61873 put
dup /ecircumflex 61874 put
dup /edieresis 61877 put
dup /egrave 61872 put
dup /iacute 61887 put
dup /icircumflex 61888 put
dup /idieresis 61892 put
dup /igrave 61886 put
dup /ntilde 61900 put
dup /oacute 61904 put
dup /ocircumflex 61905 put
dup /odieresis 61908 put
dup /ograve 61903 put
dup /otilde 61906 put
dup /scaron 61916 put
dup /uacute 61920 put
dup /ucircumflex 61921 put
dup /udieresis 61925 put
dup /ugrave 61919 put
dup /ydieresis 61933 put
dup /zcaron 61936 put
dup /minus 45 put
dup /copyright 211 put
dup /registered 210 put
dup /trademark 212 put
dup /logicalnot 61290 put
dup /Thorn 236 put
dup /thorn 252 put
dup /Eth 226 put
dup /eth 243 put
dup /Yacute 61803 put
dup /yacute 61931 put
dup /divide 184 put
dup /plusminus 177 put
dup /multiply 180 put
dup /brokenbar 61291 put
dup /degree 176 put
dup /onesuperior 64779 put
dup /twosuperior 64780 put
dup /threesuperior 64781 put
dup /onequarter 188 put
dup /onehalf 189 put
dup /threequarters 190 put
dup /mu 181 put
readonly
systemdict /findfont {
//FontDirectory 1 index known not
{
(%%[WARNING: Font ") print
=print
(" not found, substituting Courier.]%%\n) print flush
/Courier
} if
//FontDirectory exch get
} bind put
%
% Install all the fonts
%
_installfonts
false setpacking
%
% Execute startup file
%
(startup.ps) /run load stopped
{
$error begin
newerror
errorname /undefinedfilename ne
and
{
(%%[Error in startup.ps]%%\n) print
handleerror
}
{
$error /newerror false put
}
ifelse
end
}
if
clear
countdictstack 2 sub { end } repeat
%
% Start running!
%
start