From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX"  1-SEP-1989 17:57
To:	MRGATE::"ARISIA::EVERHART"
Subj:	Apple LaserWriter Symbiont (7 of 12)

Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Fri,  1 SEP 89 10:47:40 PDT
Received: from ecsgate.uncecs.edu by KL.SRI.COM with TCP; Fri, 1 Sep 89 10:46:02 PDT
Received: by ecsgate.uncecs.edu (5.59/UNCECS/8-30-88)
	id AA24512; Fri, 1 Sep 89 13:46:00 EDT
Message-Id: <8909011746.AA24512@ecsgate.uncecs.edu>
Date: Fri, 1 Sep 89 13:42 EDT
From: "Bill Bailey, 'The VAXman'" <BAILEYB@ATSUVAX1.BITNET>
Subject: Apple LaserWriter Symbiont (7 of 12)
To: INFO-VAX@KL.SRI.COM
X-Vms-To: INFOVAX

-+-+-+-+-+-+-+-+ START OF PART 7 -+-+-+-+-+-+-+-+
X`009SETUPNOTFOUND`009<Setup module not found in library.>
X
X`009.End
$ CALL UNPACK [.LASER_DIST]LASER_ERR.MSG;1 39079387
$ create/nolog 'f'
X#define`009LBR$C_TYP_UNK`0090
X#define`009LBR$C_TYP_OBJ`0091
X#define`009LBR$C_TYP_MLB`0092
X#define`009LBR$C_TYP_HLP`0093
X#define`009LBR$C_TYP_TXT`0094
X#define`009LBR$C_TYP_SHSTB`0095
X#define`009LBR$C_TYP_DECMX`0095
X#define`009LBR$C_TYP_RDEC`009127
X#define`009LBR$C_TYP_USRLW`009128
X#define`009LBR$C_TYP_USRHI`009255
X#define`009LBR$C_FLUSHDATA`0091
X#define`009LBR$C_FLUSHALL`0090
X#define`009LBR$C_MAXRECSIZ`0092048
X#define`009LBR$C_PAGESIZE`009512
X#define`009LBR$C_HASHSIZE`009512
X#define`009LBR$C_TEXTPAGE`009508
X#define`009LBR$C_DEXTQ`00950
X#define`009LBR$C_MAXCTL`00916
X#define`009LBR$C_MAXHDRSIZ`009128
X#define`009LBR$C_DEFENTALL`009300
X#define`009LBR$C_RETRYOPEN`00930
X#define`009LBR$C_RETRYWAIT`0091
X#define`009LBR$C_MINREAD`0092
X#define`009LBR$C_MAXREAD`00950
X#define`009LBR$C_MEMXTRA`00950
X#define`009LBR$C_PUTBUFSIZ`00930
X#define`009LBR$C_FLSHBFSIZ`0091
X#define`009LBR$C_MAXIDXRD`00920
X#define`009LBR$C_MAXKEYLEN`009128
X#define`009LBR$C_MAXLUHREC`00932768
X#define`009LBR$C_CREATE`0090
X#define`009LBR$C_READ`0091
X#define`009LBR$C_UPDATE`0092
X#define`009LBR$C_MAXFUNC`0092
X#define`009LBR$S_LBRDEF`00916
X#define`009LBR$L_IC_CTLTBL`0094
X#define`009LBR$L_IC_FUNC`0098
X#define`009LBR$L_IC_TYPE`00912
X#define`009LBR$S_LBRDEF1`00932
X#define`009LBR$L_OP_CTLTBL`0094
X#define`009LBR$L_OP_FNS`0098
X#define`009LBR$L_OP_CREOPT`00912
X#define`009LBR$L_OP_DNS`00916
X#define`009LBR$L_OP_RLFNA`00920
X#define`009LBR$L_OP_RNS`00924
X#define`009LBR$L_OP_RNSLEN`00928
X#define`009LBR$S_LBRDEF2`0098
X#define`009LBR$L_CL_CTLTBL`0094
X#define`009LBR$S_LBRDEF3`00912
X#define`009LBR$L_GH_CTLTBL`0094
X#define`009LBR$L_GH_RETARY`0098
X#define`009LBR$S_LBRDEF4`00912
X#define`009LBR$L_SI_CTLTBL`0094
X#define`009LBR$L_SI_IDXNUM`0098
X#define`009LBR$S_LBRDEF5`00916
X#define`009LBR$L_LK_CTLTBL`0094
X#define`009LBR$L_LK_KEYNAM`0098
X#define`009LBR$L_LK_TXTRFA`00912
X#define`009LBR$S_LBRDEF6`00916
X#define`009LBR$L_IK_CTLTBL`0094
X#define`009LBR$L_IK_KEYNAM`0098
X#define`009LBR$L_IK_TXTRFA`00912
X#define`009LBR$S_LBRDEF7`00920
X#define`009LBR$L_RK_CTLTBL`0094
X#define`009LBR$L_RK_KEYNAM`0098
X#define`009LBR$L_RK_OLDRFA`00912
X#define`009LBR$L_RK_NEWRFA`00916
X#define`009LBR$S_LBRDEF8`00912
X#define`009LBR$L_DK_CTLTBL`0094
X#define`009LBR$L_DK_KEYNAM`0098
X#define`009LBR$S_LBRDEF9`00912
X#define`009LBR$L_DD_CTLTBL`0094
X#define`009LBR$L_DD_TXTRFA`0098
X#define`009LBR$S_LBRDEF10`00916
X#define`009LBR$L_GR_CTLTBL`0094
X#define`009LBR$L_GR_BUFDES`0098
X#define`009LBR$L_GR_BUFLEN`00912
X#define`009LBR$S_LBRDEF11`00916
X#define`009LBR$L_PR_CTLTBL`0094
X#define`009LBR$L_PR_BUFDES`0098
X#define`009LBR$L_PR_TXTRFA`00912
X#define`009LBR$S_LBRDEF12`0098
X#define`009LBR$L_PE_CTLTBL`0094
X#define`009LBR$S_LBRDEF13`00920
X#define`009LBR$L_SR_CTLTBL`0094
X#define`009LBR$L_SR_IDXNUM`0098
X#define`009LBR$L_SR_RFA`00912
X#define`009LBR$L_SR_USRTN`00916
X#define`009LBR$S_LBRDEF14`00912
X#define`009LBR$L_SU_KEYDES`0094
X#define`009LBR$L_SU_TXTRFA`0098
X#define`009LBR$S_LBRDEF15`00916
X#define`009LBR$L_GI_CTLTBL`0094
X#define`009LBR$L_GI_IDXNUM`0098
X#define`009LBR$L_GI_USRTN`00912
X#define`009LBR$S_LBRDEF16`00912
X#define`009LBR$L_GU_KEYADR`0094
X#define`009LBR$L_GU_TXTRFA`0098
X#define`009LBR$C_ADDMOD`0091
X#define`009LBR$C_DELMOD`0092
X#define`009LBR$C_REPMOD`0093
X#define`009LBR$S_LBRDEF17`00916
X#define`009LBR$L_AU_CTLTBL`0094
X#define`009LBR$L_AU_FLAGS`0098
X#define`009LBR$L_AU_KEYNAM`00912
X#define`009LBR$S_LBRDEF18`00912
X#define`009LBR$L_GU_CTLTBL`0094
X#define`009LBR$L_GU_USRTN`0098
X#define`009LBR$S_LBRDEF19`0098
X#define`009LBR$L_UU_UPDESC`0094
$ CALL UNPACK [.LASER_DIST]LBRDEF.H;1 796729746
$ create/nolog 'f'
X%%%`009paint - puts a MacPaint compressed raster file on the laser printer.
X%
X%
X%`009inputs:`009/nc /ncopies /params - number of copies (default 1)
X%`009`009/sf /scale /param2 - scale factor (default 4.0)
X%
X%`00902/18/87 R. Watson Added parser stuff. Speedup mods.
X%
X
X%%`009deCompress <string>.
X%
X%`009returns a bitimage string on the stack
X%
X/deCompress
X`123
X`009/count getByte byte def`009`009`009% get count
X`009/ind 0 def`009`009`009`009% preset index
X`009count 16#80 and 0 eq `123`009`009`009% if bit stream
X`009`009/count count 1 add def
X`009`009outstring 0 count getinterval   % get right size string
X`009`009inp exch readhexstring`009`009% get bytes
X`009`009pop`009`009`009`009% toss readhexstring status
X`009`125
X`009`123`009`009`009`009`009% else repeated string
X`009`009getByte`009`009`009`009% get byte to repeat
X`009`00916#100 count sub 1 add /count exch def% get abs val of count
X`009`009count `123
X`009`009`009outstring ind byte put
X`009`009`009/ind ind 1 add def`009`009% advance index
X`009`009`125 repeat
X`009`009outstring 0 count getinterval`009% return string
X`009`125 ifelse
X`125 def
X
X
X%%`009getByte
X%
X%`009returns /byte = next input byte
X%`009`009      = 0 if no more bytes on input stream
X%
X/getByte
X`123
X`009inp instring readhexstring `123`009`009% if got one
X`009`0090 get /byte exch def`009`009% store in byte
X`009`125
X`009`123`009`009`009`009`009% else 0
X`009`009pop /byte 0 def
X`009`125 ifelse
X`125 def
X
X
X%%`009main program
X%
X/main
X`123
X`009/sTime usertime def`009`009`009% save start time
X%%%     vmstatus 10 20 string cvrs dbg exch writestring dbg ( ) writestring
X%%%              10 20 string cvrs dbg exch writestring dbg ( ) writestring
X%%%              10 20 string cvrs dbg exch writestring dbg ( \n) writestrin
Vg
X%%%      flush
X`009/iscale 1 scale div def`009`009`009% compute scale factor
X`009512 `123 getByte`125 repeat`009`009`009% eat paint header
X%`009576 720 1 `091iscale 0.0 0.0 iscale 0.0 0.0`093 `123 deCompress `125 im
Vage
X`009576 720 true `091iscale 0.0 0.0 iscale 0.0 0.0`093 `123deCompress`125 im
Vagemask
X%%%`009usertime sTime sub 1000 div 10 20 string cvrs
X%%%`009 dbg exch writestring dbg ( seconds )
X%%%`009 writestring
X%%%    vmstatus 10 20 string cvrs dbg exch writestring dbg ( ) writestring
X%%%            10 20 string cvrs dbg exch writestring dbg ( ) writestring
X%%%              10 20 string cvrs dbg exch writestring dbg ( \n) writestrin
Vg
X%%%      flush
X`009showpage
X`009currentfile flushfile`009`009`009% avoid laser_log's
X`125 def
X
X
X%%`009executable initialization
X%
X/inp (%stdin) (r) file def`009`009% define files
X/dbg (%stdout) (w) file def
X
X/table `091
X `091/#copies 1 (.nc .ncopies .param1)`093`009`009% number of copies
X `091/scale 4.0 (.sf .scale .param2)`093`009`009% scale factor
X`093 def
X
Xtable `123`009`009`009`009`009`009% apply defaults
X`009/ta exch def`009`009`009`009% save array
X`009ta 0 get`009`009`009`009% key
X`009ta 1 get`009`009`009`009% default value
X`009def`009`009`009`009`009% define default value
X`125 forall
X
Xcurrentdict /parser known `123parser`125 if`009`009% if user inputs
X
X/identity matrix def`009`009`009% make an identity matrix
X/outstring 128 string def`009`009% storage for output string
X/instring 1 string def`009`009`009% input buffer
X1 72 mul 10 72 mul moveto currentpoint translate
Xcurrentpoint transform`009`009`009% see where we are in device coords
Xidentity setmatrix`009`009`009% turn off transformation - switch to
X`009`009`009`009`009%  device coordinate system
Xtranslate`009`009`009`009% move origin to transformed currpt
X
X/doit `123
X`009`123main`125 stopped `123 (error stack:\n) = pstack flush quit`125 if
X`125 def
X%doit
Xmain
$ CALL UNPACK [.LASER_DIST]PAINT_HEX.PS;1 1244988067
$ create/nolog 'f'
X%  Parser takes 2 arguments as input:
X%  /params is an array of pairs of keyword strings and values:
X%  `091 (param1) value1 (param2) value2 ... (paramn) valuen`093
X%  /table is an array of key/default value/keyword list arrays:
X%  `091 `091/key1 default1 (.key1 .whatever1)`093
X%    `091/key2 default2 (.key2 .whatever2)`093
X%    ... `093
X%  Parser first defines /key1 to default1, /key2 to default2, etc.
X%  Then, for each param keyword in /params, it searches the arrays
X%  in /table for a matching keyword.  If found, it sets /key? to`032
X%  the value from /params.
X
X/parser `123
X
X% process each keyword value pair in the params array
X
X`009/pindex 0 def`009`009`009`009`009% preset index
X`009`009params length 2 idiv `123
X`009`009params pindex get length 1 add`009`009% build keyword str
X`009`009`009string /ks exch def
X`009`009ks 1 params pindex get putinterval`009% (.<keyword>)
X`009`009ks 0 46 put
X`009`009/ok false def`009`009`009`009% preset flag
X`009`009table `123`009`009`009`009`009% for each array
X`009`009`009/ta exch def`009`009`009% get the array
X`009`009`009`009ta 2 get`009`009% get token string
X`009`009`009`009ks search `123`009`009% search for keyword
X`009`009`009`009`009pop pop pop`009% flush search stuff
X`009`009`009`009`009ta 0 get `009% get key
X`009`009`009`009`009params pindex 1 add get % get new value
X`009`009`009`009`009def`009`009% set new value
X`009`009`009`009`009/ok true def`009% flag keyword found
X`009`009`009`009`009exit`009`009% -forall
X`009`009`009`009`125 `123
X`009`009`009`009`009pop`009`009% flush failed search
X`009`009`009`009`125 ifelse
X`009`009`125 forall`009`009`009`009% try next array
X`009`009ok not `123`009`009`009`009% if keyword not found
X`009`009`009ks = (is not a known parameter) = quit
X`009`009`125 if
X`009`009/pindex pindex 2 add def`009`009% advance to next pair
X`009`125 repeat
X`125 def
$ CALL UNPACK [.LASER_DIST]PARSER.PS;1 1566019224
$ create/nolog 'f'
X% The program below may be downloaded to a LaserWriter to correct three
X% bugs in the LaserWriter's serial I/O driver:
X%
X%   - occasional failure to send a needed XON
X%   - erroneously reading past end-of-file (control-D)
X%   - dropped characters during large volumes of output
X%
X%!
X0000000000                      % the exitserver password
X
Xversion (23.0) ne
X   `123(Patch not installed -- wrong printer type or version) = stop`125 if
Xstatusdict /Patch1Installed known
X   `123(Patch already installed -- not installed again) = stop`125 if
Xserverdict begin exitserver
Xstatusdict /Patch1Installed true put
Xcurrentfile eexec
Xce1b9f428ac69e75cc47a554265ae625851e0154ac649ad44c1c34e4c60a0493
Xa80212a3bd61248f8859cb1252a7320775a6d4ec524bcbf5771aceb8f61ea2fb
X48fcb3df8da0f105be40f697239ef0976f92c1d41e915a7389200a3e896cd955
Xd197ff27f22a617c85bce7ed59ef1a6062d01d0fdee5b4e7d298997638497cc6
Xa2d56a0eacc195795949f515bbbda9cfe899e43ad257da93f3144797b00dbb81
X8a41b4fa56a0295c25e693864084cbb5d63834f1d94a46816d4a2cbe005cc57c
X38491a6a34cfbdef303ed8731dbbe84dc6f8e1e790f3d89360d063639c8411fd
X89ad7c53d1b9732bd0942bc36257208d24792ea7c66790b6104c3a2b794a1460
Xc476ffdb5552f428f457b47319cccb0c9980036402eaca80c0b5e0ccb5f579df
X09cc6f382b536aa64da7152356c377a5b708a378e855a7ec3eccd848d5508dbf
X5c7bd28c2899e9cfd7f4ff3d7ddc08006cce42b2d8c59ef64af8ec74a2f9d23f
Xe8d4d03ba1e2686138fffc2af9c662c994ec8065a32144ba9ac5002623b39012
X521eb49cd829c3506af2895bf275367eb4d31908b14f3b1e0abfaca2f98eb9d8
X8d84ac8271ef44def53d8207ce9653d598fe8046120f223bfca0b5c74a54f70b
Xeb5a0bc09d8e79742048b875864a3b489eb91c09b701f506e994271a6640f78a
Xd131f1eef3c96e546f7273fb3533799a6470be2ed3b8f2e211bf9f9f209edbd2
X36c19d4b0b3f28ab16c39faa17070699543c212c76081961c949ebd32ada3c93
Xccdc56c2c940a2061bc11794a0159cc37255aa8c8e7e08d78f204161f1eccb7d
Xad3313b737e921b7df1fe794e9a7fc2226702ee555ceb8e803a20ebeaa440a40
X9e1f1a72412586e3071292b10e938e7f386b8e6516758633bab57223e071b1de
X8c4b73cafababc0af7bc902e8763a2817861591d7ee98f85bc28ad0ea4d13660
Xd3256aa293df1959b7b57b13edee653cfdda2fafe0698898dc5e371ca4c5b72b
Xb92750d0eea5e74955712b06958663f424a46cf75a797590f0d2a36842fe07e3
Xdb459215dab6e461a4c3fbb40ee2499af3fe4b13790de87e11afde6aadd12e77
Xd84d8076146d797269c9188d8fb725898aee284e62c472e0e7b585ef3fed434c
X000b0bb70ad6806e840cfe872ec3f28782dd08b70d29c2da2187e2dc0f13dfc0
X89f75344e3dad78a1c9b909fc72bdd92421afdc8b80850ff0d43605edfd9be56
Xd81cb17250ce7208354548f6ccc62366e8196d4adeb2d24fd5ce47bb6295fa72
Xc361197cafacbd51efd36dfa59c6f8e6cab8915a8043d609eb64726de86080d2
X4118cc69e01eab0f4ef1f364c815f306d5f43420cf7c9316e5ee69c7183dd8d2
X805a9dfe6abb33c46d3a212d5c6b6fd68418eef971
$ CALL UNPACK [.LASER_DIST]PATCH.PS;1 141829840
$ create/nolog 'f'
X% this is so that spooling to _ps will work.
$ CALL UNPACK [.LASER_DIST]PS.PS;1 571683189
$ create/nolog 'f'
X#define`009QUI$_CANCEL_OPERATION`0091
X#define`009QUI$_DISPLAY_CHARACTERISTIC`0092
X#define`009QUI$_DISPLAY_FILE`0093
X#define`009QUI$_DISPLAY_FORM`0094
X#define`009QUI$_DISPLAY_JOB`0095
X#define`009QUI$_DISPLAY_QUEUE`0096
X#define`009QUI$_TRANSLATE_QUEUE`0097
X#define`009QUI$_RESERVED_FUNC_1`0098
X#define`009QUI$_RESERVED_FUNC_2`0099
X#define`009QUI$_ACCOUNT_NAME`0091
X#define`009QUI$_AFTER_TIME`0092
X#define`009QUI$_ASSIGNED_QUEUE_NAME`0093
X#define`009QUI$_BASE_PRIORITY`0094
X#define`009QUI$_CHARACTERISTIC_NAME`0095
X#define`009QUI$_CHARACTERISTIC_NUMBER`0096
X#define`009QUI$_CHARACTERISTICS`0097
X#define`009QUI$_CHECKPOINT_DATA`0098
X#define`009QUI$_CLI`0099
X#define`009QUI$_COMPLETED_BLOCKS`00910
X#define`009QUI$_CONDITION_VECTOR`00911
X#define`009QUI$_CPU_DEFAULT`00912
X#define`009QUI$_CPU_LIMIT`00913
X#define`009QUI$_DEVICE_NAME`00914
X#define`009QUI$_ENTRY_NUMBER`00915
X#define`009QUI$_FILE_COPIES`00916
X#define`009QUI$_FILE_COPIES_CHKPT`00917
X#define`009QUI$_FILE_COPIES_DONE`00918
X#define`009QUI$_FILE_FLAGS`00919
X#define`009QUI$_FILE_SETUP_MODULES`00920
X#define`009QUI$_FILE_SPECIFICATION`00921
X#define`009QUI$_FILE_STATUS`00922
X#define`009QUI$_FIRST_PAGE`00923
X#define`009QUI$_FORM_DESCRIPTION`00924
X#define`009QUI$_FORM_FLAGS`00925
X#define`009QUI$_FORM_LENGTH`00926
X#define`009QUI$_FORM_MARGIN_BOTTOM`00927
X#define`009QUI$_FORM_MARGIN_LEFT`00928
X#define`009QUI$_FORM_MARGIN_RIGHT`00929
X#define`009QUI$_FORM_MARGIN_TOP`00930
X#define`009QUI$_FORM_NAME`00931
X#define`009QUI$_FORM_NUMBER`00932
X#define`009QUI$_FORM_SETUP_MODULES`00933
X#define`009QUI$_FORM_STOCK`00934
X#define`009QUI$_FORM_WIDTH`00935
X#define`009QUI$_GENERIC_TARGET`00936
X#define`009QUI$_INTERVENING_BLOCKS`00937
X#define`009QUI$_INTERVENING_JOBS`00938
X#define`009QUI$_JOB_COPIES`00939
X#define`009QUI$_JOB_COPIES_CHKPT`00940
X#define`009QUI$_JOB_COPIES_DONE`00941
X#define`009QUI$_JOB_FLAGS`00942
X#define`009QUI$_JOB_LIMIT`00943
X#define`009QUI$_JOB_NAME`00944
+-+-+-+-+-+-+-+-  END  OF PART 7 +-+-+-+-+-+-+-+-

