Initial.ps
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Doug Wyatt, June 4, 1987 6:12:20 pm PDT
Undocumented primitives in systemdict:
clearinterrupt disableinterrupt enableinterrupt
packedarray currentpacking setpacking
currentcacheparams setcacheparams
cexec eexec setram setrom daytime internaldict makevm psdevice
% Non-operators in systemdict not defined below:
null -null- def
true true def
false false def
version (38.0) readonly def
systemdict 256 dict def
userdict 200 dict def
errordict 28 dict def
statusdict 65 dict def
/initialized 502677921 def
/FontDirectory 250 dict def
% systemdict definitions
systemdict begin
/=string 128 string def
/=print { dup type /stringtype ne { 0 cvs } if print } dup 4 get 0 =string put bind def
/= { 0 exec (\r) print } dup 0 /=print load put bind def
/stack { count dup 1 add copy 0 repeat pop } dup 5 /= load put bind def
/==print { 0 begin typeprint end } dup 0 24 dict put def
/== { 0 exec (\r) print } dup 0 /==print load put bind def
/==print load 0 get begin
/dictdict 10 dict def
dictdict begin
/systemdict dup load exch def
/userdict dup load exch def
/errordict dup load exch def
% /$error dup load exch def
% /statusdict dup load exch def
% /FontDirectory dup load exch def
% /execdict dup load exch def
% /serverdict dup load exch def
% /$printerdict dup load exch def
% /$idleTimeDict dup load exch def
end
/tprint /print load def
/cvsprint { =string cvs tprint ( ) tprint } def
/typeprint { dup type exec } def
/nulltype { pop (-null- ) tprint } def
/integertype { cvsprint } def
/realtype { cvsprint } def
/booleantype { cvsprint } def
/arraytype { dup rcheck
{ dup dup xcheck
{ ({ ) tprint { typeprint } forall (} ) tprint }
{ ([ ) tprint { typeprint } forall (] ) tprint }
ifelse wcheck not { (readonly ) print } if }
{ pop (-array- ) tprint }
ifelse } def
/packedarraytype { dup rcheck
{ dup dup xcheck
{ ({ ) tprint { typeprint } forall (} ) tprint }
{ ([ ) tprint { typeprint } forall (] ) tprint }
ifelse wcheck not { (readonly ) print } if }
{ pop (-packedarray- ) tprint }
ifelse } def
/stringtype { dup rcheck
{ dup (\() tprint tprint (\) ) tprint wcheck not { (readonly ) print } if }
{ pop (-string- ) tprint }
ifelse } def
/nametype { dup xcheck not { (/) tprint } if cvsprint } def
/dicttype { dup dictdict exch known
{ dictdict exch get cvsprint }
{ pop (-dict- ) tprint }
ifelse } def
/filetype { pop (-file- ) tprint } def
/operatortype { =string cvs tprint (^ ) tprint } def
/marktype { pop (-mark- ) tprint } def
/fonttype { pop (-fontid- ) tprint } def
/savetype { pop (-savelevel- ) tprint } def
end
/handleerror { errordict /handleerror get exec } bind def
/$error 13 dict def
/.error {
$error exch /errorname exch put
$error exch /command exch put
$error /newerror true put
$error /errorname get /VMerror ne {
$error /ostackarray get null eq {
$error /estackarray 250 array put
$error /ostackarray 500 array put
$error /dstackarray 20 array put
} if
count $error /ostackarray get exch 0 exch getinterval astore
$error exch /ostack exch put
$error /dstack $error /dstackarray get dictstack put
$error /estack $error /estackarray get execstack dup length 2 sub 0 exch getinterval put
$error /ostack get aload pop
} if
$error /initializing get { handleerror } if
interrupt
} bind def
/findfont {
dup FontDirectory exch known
{ FontDirectory exch get }
{ =print ( not found, using Courier.\n) print flush FontDirectory /Courier get }
ifelse
} bind def
/Run { dup == flush run } def
(StandardEncoding.ps) Run
(FontDirectory.ps) Run
end
systemdict readonly pop
% errordict definitions
errordict begin
/handleerror { $error begin newerror { /newerror false def
(%%[ Error: ) print errorname =print (; OffendingCommand: ) print
/command load =print ( ]%%) = flush } if end } bind def
/stackunderflow dup [ exch /.error load /exec load ] cvx def
/unregistered dup [ exch /.error load /exec load ] cvx def
/dictstackunderflow dup [ exch /.error load /exec load ] cvx def
/typecheck dup [ exch /.error load /exec load ] cvx def
/undefinedresult dup [ exch /.error load /exec load ] cvx def
/invalidexit dup [ exch /.error load /exec load ] cvx def
/dictfull dup [ exch /.error load /exec load ] cvx def
/nocurrentpoint dup [ exch /.error load /exec load ] cvx def
/limitcheck dup [ exch /.error load /exec load ] cvx def
/invalidaccess dup [ exch /.error load /exec load ] cvx def
/invalidfileaccess dup [ exch /.error load /exec load ] cvx def
/ioerror dup [ exch /.error load /exec load ] cvx def
/invalidfont dup [ exch /.error load /exec load ] cvx def
/invalidrestore dup [ exch /.error load /exec load ] cvx def
/rangecheck dup [ exch /.error load /exec load ] cvx def
/execstackoverflow dup [ exch /.error load /exec load ] cvx def
/dictstackoverflow dup [ exch /.error load /exec load ] cvx def
/stackoverflow dup [ exch /.error load /exec load ] cvx def
/unmatchedmark dup [ exch /.error load /exec load ] cvx def
/syntaxerror dup [ exch /.error load /exec load ] cvx def
/undefined dup [ exch /.error load /exec load ] cvx def
/undefinedfilename dup [ exch /.error load /exec load ] cvx def
/VMerror dup [ exch /.error load /exec load ] cvx def
/timeout dup [ exch dup /.error load /exec load ] cvx def
/interrupt /stop load def
end
% userdict definitions
/execdict 6 dict def
/cleardictstack { countdictstack 2 sub { end } repeat } bind def
/prompt { (PS) print execdepth { (>) print } repeat flush } bind def
/quit { execdict /quitflag true put interrupt } bind def
/pstack { count dup 1 add copy { == } repeat pop } bind def
/start {
execdict /execdepth 0 put
$error /initializing false put
executive
} bind def
/executive {
execdict begin
/execdepth execdepth 1 add def
(\nCedar PostScript(tm) Version ) print version print
(\nCopyright (c) 1985 Adobe Systems Incorporated.) print
(\nCopyright (c) 1987 Xerox Corporation.\n) print
{ % loop
/quitflag false def
$error /newerror false put
/prompt load stopped { handleerror (Error during prompt execution\n) print exit } if
{ mark /stmtfile (%statementedit) (r) file def } stopped
{ % if....
cleartomark $error /newerror get { % if
$error /errorname get /undefinedfilename ne { handleerror } if
$error /newerror false put exit } if
}
{ % ..else
pop stmtfile end { cvx exec } stopped execdict begin
{ handleerror stmtfile closefile } if
}
ifelse
checkquit
} loop
/quitflag false def
/execdepth execdepth 1 sub def
end
$error /doclose false put
interrupt
} bind def
prompt { (PS) print execdepth { (>) print } readonly repeat^ flush^ } readonly def
start {
disableinterrupt^ execdict /execdepth 0 put^ ReadIdleFonts serverdict begin^ /saveswitch switchsetting^ def^ setstreams initprinter dostartpage^ { userdict save^ /svlv exch^ put^ printerstatus^ -1 ne^ { statusdict /jobstate (printing test page) put^ 1 setblink^ statusdict /printererror /stop load^ put^ setrealdevice { /wtimeout usertime^ 180000 add^ def^ userdict begin^ startpage end^ { warmedup usertime^ wtimeout gt^ or^ } readonly UseIdleTime usertime^ wtimeout le^ { showpage^ printerclose^ } readonly if^ } readonly stopped^ pop^ disableinterrupt^ } readonly if^ clear^ cleardictstack svlv restore^ } readonly if^ cleardictstack $error /initializing false put^ { serverdict /server get^ exec^ serverdict begin^ setstreams setnulldevice /execjob load^ end^ exec^ } readonly loop^ } readonly def
/$printerdict $printerdict def
/cleardictstack { countdictstack^ 2 sub^ { end^ } readonly repeat^ } readonly def
/execdict execdict def
/serverdict serverdict def
/#copies 1 def
/executive {
execdict begin^ clearinterrupt^ disableinterrupt^ /execdepth execdepth 1 add^ def^ (
PostScript(tm) Version ) print version print (
Copyright (c) 1985 Adobe Systems Incorporated.
) print { /quitflag false def^ $error /newerror false put^ /prompt load^ stopped^ { handleerror (Error during prompt execution
) print exit^ } readonly if^ { mark^ idleproc clearinterrupt^ /stmtfile (%statementedit) (r) file^ def^ disableinterrupt^ } readonly stopped^ { disableinterrupt^ cleartomark^ $error /newerror get^ { $error /errorname get^ /undefinedfilename ne^ { handleerror } readonly if^ $error /newerror false put^ exit^ } readonly if^ } readonly { pop^ stmtfile end^ { clearinterrupt^ cvx^ exec^ disableinterrupt^ } readonly stopped^ execdict begin^ { disableinterrupt^ handleerror stmtfile closefile^ } readonly if^ } readonly ifelse^ checkquit } readonly loop^ /quitflag false def^ /execdepth execdepth 1 sub^ def^ end^ $error /doclose false put^ interrupt^ } readonly def
/quit { execdict /quitflag true put^ interrupt^ } readonly def
/pstack { count dup 1 add copy { == } readonly repeat pop } readonly def
/start {
disableinterrupt
execdict /execdepth 0 put
ReadIdleFonts
serverdict begin
/saveswitch switchsetting def
setstreams initprinter dostartpage {
userdict save /svlv exch put
printerstatus -1 ne {
statusdict /jobstate (printing test page) put
1 setblink
statusdict /printererror /stop load put
setrealdevice
{
/wtimeout usertime 180000 add def
userdict begin startpage end
{ warmedup usertime wtimeout gt or } UseIdleTime
usertime wtimeout le { showpage printerclose } if
} stopped pop
disableinterrupt
} if
clear cleardictstack svlv restore
} if
cleardictstack
$error /initializing false put
{
serverdict /server get exec
serverdict begin setstreams setnulldevice /execjob load end
exec
} loop
} bind def
/executive {
execdict begin
clearinterrupt disableinterrupt
/execdepth execdepth 1 add def
(\nCedar PostScript(tm) Version ) print version print
(\nCopyright (c) 1985 Adobe Systems Incorporated.) print
(\nCopyright (c) 1987 Xerox Corporation.\n) print
{ % loop
/quitflag false def
$error /newerror false put
/prompt load stopped
{ % if
handleerror (Error during prompt execution\n) print exit
} if
{ % stopped
mark idleproc clearinterrupt
/stmtfile (%statementedit) (r) file def
disableinterrupt
} stopped
{ % if....
disableinterrupt cleartomark
$error /newerror get
{ % if
$error /errorname get
/undefinedfilename ne { handleerror } if
$error /newerror false put
exit
} if
}
{ % ..else
pop stmtfile
end
{ clearinterrupt cvx exec disableinterrupt } stopped
execdict begin
{ disableinterrupt handleerror stmtfile closefile } if
} ifelse
checkquit
} loop
/quitflag false def
/execdepth execdepth 1 sub def
end
$error /doclose false put
interrupt
} bind def6789