[comp.sources.amiga] v91i053: Print 1.5a - configurable print command, Part01/03

amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator) (03/14/91)

Submitted-by: hoover@math4.uni-bielefeld.de (Uwe Sch"urkamp)
Posting-number: Volume 91, Issue 053
Archive-name: utilities/print-1.5a/part01

[ includes uuencoded executable and icon, and German docs  ...tad ]

	Print  lets  you  sort  of completely specify the output of your printer
without  having  to enter and change preferences every two minutes or so or
having  to  break  your fingers to get to the dip switches of your printer.
Print  will  handle  special German umlauts correctly and map them to their
proper  values as well as intercept the thousands of form feeds that mainly
utility programmers love to put into their text files :-)

	In  addition  Print will allow you to change type size and print quality
of your printer and lots of other neat things.

	As  far  as  I  know Print is the first program for the Amiga which gets
German users both Umlauts AND brackets in one go without using the graphics
mode.  If I'm wrong, please tell me so I can shoot myself...

#!/bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 3)."
# Contents:  print.info.uu src src/getprefs.c src/icon.h src/iconify.c
#   src/iconify.h src/info.c src/info.h src/inout.c src/inprint.c
#   src/print.h src/print15a.c
# Wrapped by tadguy@ab20 on Wed Mar 13 19:34:41 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'print.info.uu' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'print.info.uu'\"
else
echo shar: Extracting \"'print.info.uu'\" \(6641 characters\)
sed "s/^X//" >'print.info.uu' <<'END_OF_FILE'
Xbegin 666 print.info
XMXQ```0```````````&8`4@`&``,``0`!3.@``4S\````````````````````T
XM`````P````````40*(````"```````````````````````````!F`%(``@`#]
XM3B@#``````#__________________X````````````````?_O___________H
XM____]_^________________W_[________________?_O_______________[
XM]_^________________W_[________________?_O_______________]_^_S
XM_______________W_[________________?_O_______________]_^_____[
XM___________W_[________________?_O_______________]_^_________[
XM_______W_[________________?_O_______________]_^_____________[
XM___W_[________________?_O_______________]_^________________WS
XM_[________________?_K_______________]_^G_______________W_ZO__
XM______________?_I/______________]_^O?______________W_Z^_____`
XM__________?_K]_______#______]_^O[______[W______W_ZWW______?O2
XM______?_K_____'_[^______]_^.^___]__OA______W_X_S__^/_]\'____T
XM__?_KW/__W__TP'_____]_^O]/____XQ`/_____W_[_\?___\?P`?_____?_Q
XMM[B?__\'_H`?____]_^W_F?_X/_^P`___?_W_[_]>7_O__SP`?_R?_?_N_T^&
XM'_?__/@!_\]_]_^__AVC]__]_@`?/W_W_[WOGOQ[__G^``Y_?_?_O?\&?XW_4
XM^?\``)]_]_^^]T$^<?_[_D``"W_W_[__X!]___@!\```'_?_OWNX`[__^_[X&
XM```/]_^_?[X`'__[_'````?W_[__WX`/__O_````#_?_O[WGY`#_^_X`Z``/C
XM]_^_OOG_@!_X``_\`!_W_[__?G_P#_@`/_/`?_?_O]^?F_\'^`/_#S__]_^_5
XM_^?D?_?]__S\_?_W_[_O^7^/^?W_X__S__?_O^_VG_#\??X?^\__]_^_]_'CL
XM_P(``?_[/__W_[__\'Q__`?__^3_O_?_O_OX'X__S_X`&_]_]_^_^_D#<,/_5
XM^__W_/_W_[__^8`//(8/_P_S__?_O_WX2`#_?_[P_\__]_^__9X,0`/\$/__-
XMO__W_[_^YX!B`0@1__]_O_?_O__YX`,3"A$__/]_]_^__WY\`!J+&3_S_/_W7
XM_[__\8/P`L@0/P_S__?_O__N?'\""!'P_\__]_^__]^?C_X)[@__O__W_[__F
XM]__P\__O__]___?_O__YY_\.``'__/__]_^___Y_____[__S___W_[___X/_@
XM___O_P____?_O____'___\_P____]_^_____C____@_____W_[_____P\___]
XM______?_O_____\,``'_____]_^________________W_[______________+
XM__?_@```````````````!____________________P``````````````````M
XM`````````````````````````````````````````````````````````````
XM````````````````````````````````````````````````````(```````@
XM```````````@`````````````````!``````````````````$````````````
XM```````(``````````````````0``````````````````X_X````````````6
XM```"-L8`````````````````!X`````````````````'X```````````````L
XM``/\`````````````````_^``````(`````````/__`````/P`````````__<
XM\````?_@````````?__P`!____````````'___``/___\```````!___\`!_;
XM___P```````'___P`'____``````"`?___``____X``````$!___\`#____`@
XM``````<'___X`/___X``````!X?___P`____```````#Q____`#\/_\`````$
XM``/G___X`/@?^````````??__^``-P_````````!^___X``C#S````````#["
XM__^&`0.88````````/'__PX!`'_@````````</__?@?`?^````````!P__S^8
XM#@!_X````````'A_P?\1`#_@X```````.!___@0`'^_@```````\!__@H`"/+
XM]_```````#P!?^Z``//_^```````'``?]@``>?_X`P`````>``/W``$^__X/"
XM``````\``'L``9Y__C\`````#P``#8`!SS_^G``````'0``!``/^#__T@```U
XM``?@``%@```#___@`````[@``(````'__^`````#O@``P````'__\`````/?4
XM@``P````!__@`````>?D`#````#H_^``````^?^`'```#_P?@`````%^?_`,1
XM```_\\```````9^;_P4``_\//P``````Y^1_]@'__/S]@`````#Y?X_YP?_C9
XM__/``````/:?\/P!_A_[S\``````\>/_`@`!__L_P`````#P?'_\!G__Y/^`X
XM`````'@?C__-C@`;_T``````>0-PPSWP__?\P`````!Y@`\\``;_#_/`````S
XM`'A(`/Y[YG#_S\``````'@Q``O``?_^_P`````!G@&(```!__W^``````'G@5
XM`Q`"`#_\_P``````?GP`&(,(/_/\``````!Q@_``P``_#_```````&Y\?P``E
XM`?#_P```````'Y^/_`'N#_^````````'__#Q_^___P````````'G_PP``?_\X
XM`````````'___?_O__```````````__]_^__````````````?___S_```````
XM```````/___^``````````````#S__X`````````````````````````````[
XM`````````````````````````````````````````````````````````````
XM``````````````````!F`%(``@`$+R@#``````#__________________X``*
XM``````````````?_O________^D88"!`!_^_________X20(.F`'_[______G
XM___TL@2+$8?_O________^*BQWC4Y_^_________Y2%`P$0W_[_________@2
XM.+!!0H?_O________^0,"+%"A_^_________\0,`F<E'_[_________PH>"(B
XMR4?_O_________`0$$0II_^_________^0```!0'_[_________\@```"D?_\
XMO_________X````"9_^__________P````$G_[__Y_______`````+?_O__'9
XM______^````(1_^__X/______\````Q'_[_^`_______\```!R?_O_P'____N
XM___X```#A_^_\`________@```,'_[_@#_______\```$<?_OX`?_______PR
XM```:1_^_`'_______^````L'_[X`?_______X````$?_O_S________`````=
XMY_^__?_______\````!W_[__________@````6?_O_________^````!-_^_?
XM_________X````"'_[\'________@````$?_OP?________`````!_^_A___/
XM_____^`````'_[_'_________P````?_O\?_________````!_^_Y_______-
XM__P````'_Z`'_________`````?_K_?_______P!``!`!_^G^____^```?X`&
XM`>`'_Z?[_P``#____K`#^`?_H_``?___S_/_>`?^!_^A]/_\_S_G^?^\#_\'6
XM_Z'T?/Y_G_/\`!X;_\?_H/H^?S_(````#_O_Y_^@?1\````````.^__W_Z!]]
XM````````/_<#__?_H#Z````#____^X/_]_^`/T`/_______[@__W_X`??___7
XM____\$.'__?_H`^_____```/____]_^P#[_P``#________W_[`'P`______Y
XM_^`'__?_N`/______\``7___]_^\`____X``/______W_[P!_P``?______X`
XM'_?_O@``____\`'_X`@#]_^_`?_^`````<`?_`'W_[\!\`````A!___\`??_;
XMOX#P`(0A#&#___X`]_^_@/$0QC&``/___@#W_[_`^9@`````___^`/?_O^#XT
XM````!____``!]_^_X'@`____^``#_@'W_[_P?___X``'___^`_?_O_A_P``?9
XM______X']_^_^``__________@?W_[_\?__________^`_?_O_QX/_______Y
XM_``!]_^__G?/____^`````'W_[_^;___X````````??_O_Y_P```````````?
XM]_^__@````````````#W_[__`````````````/?_O_\`````````````=_^_0
XM_X````````````!W_[__P````````````/?_O__X````````````]_^___^`2
XM````````/__W_[________________?_@```````````````!___________=
XM_________P``````````````````````````````````````````````````Y
XM`````````````````````````````````````````````````````````````
XM`````````````````````````````````````````````````````````````
XM``````````(``````````````````2````````````````!OH```````````R
XM````'__P@``````````````'__>``````````_\``'@__,``````'_____P`8
XMQ__[8`````!G____Y^`?__Z@`````,?_O_^?^#___G`````#@__/_G_^/[__;
XM,`````8#S_?___^(?_^P````#`?W^_]Y_\?___`````0#____WG_Y___0```<
XM("`/^-9S:?_O__\````P@!_WJZU9_____^```!\`?CFJ+S______X````@!QU
XM_KFM6?_____@`````/_QNC-O______`````!______Y_____]`````/^?_O_V
XM_X_____R````!_'_Y^__\_____P````'S__?]________@````8__S_[____4
XM____`````?_^__W__['___^@```'__G__O__O____^````?_]___?__?___?.
XMX```!_____^__\___]_P```'________Y___W_````?________G__^_\``/6
XM\________`%__S_P``?Y____X````/_^'_``!_C_````````__P'\``#\```D
XM``````!_^`'P``'P`````````#_P`/```?``````````'_@`,```^```````H
XM```/^``0``!\``````````[X`````'P````````_]P``````/@````/____[$
XM@``````_0`________N``````!]________P0X``````#[____\```__X```)
XM```/O_```/_____P``````?`#_______X````````_______P`!?^``````#S
XM____@``____X``````'_``!_______@```````#____P`?_@"``````!__X`X
XM```!P!_\``````'P````"$'___P``````/``A"$,8/___@``````\1#&,8``%
XM___^``````#YF`````#___X``````/@````'___\````````>`#____X``/^P
XM``````!____@``?___X``````'_``!_______@```````#_________^````O
XM``!___________X``````'@________\````````=\_____X``````````!O.
XM___@`````````````'_`````````````````````````````````````````=
XM`````````````````````````````````````````````````````````````
XM`````````````````````````````````````````````````````````````
XB````````````````````````````````````````````!```$
X``
Xend
Xsize 4714
END_OF_FILE
if test 6641 -ne `wc -c <'print.info.uu'`; then
    echo shar: \"'print.info.uu'\" unpacked with wrong size!
fi
# end of 'print.info.uu'
fi
if test ! -d 'src' ; then
    echo shar: Creating directory \"'src'\"
    mkdir 'src'
fi
if test -f 'src/getprefs.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/getprefs.c'\"
else
echo shar: Extracting \"'src/getprefs.c'\" \(194 characters\)
sed "s/^X//" >'src/getprefs.c' <<'END_OF_FILE'
X/* getprefs.c
X	read values from preferences and set flags accordingly
X	HooverSoft 1990
X*/
Xextern long BIGFONT, SMALLFONT, MEDFONT;
Xextern long LQ;
Xextern long JAMMED_LINES ;
Xextern long indent;
END_OF_FILE
if test 194 -ne `wc -c <'src/getprefs.c'`; then
    echo shar: \"'src/getprefs.c'\" unpacked with wrong size!
fi
# end of 'src/getprefs.c'
fi
if test -f 'src/icon.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/icon.h'\"
else
echo shar: Extracting \"'src/icon.h'\" \(8229 characters\)
sed "s/^X//" >'src/icon.h' <<'END_OF_FILE'
X
XUSHORT icondata[] = {
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0800,0x7FFF,
X	0xFFFF,0xFFFF,0xFFD2,0x30C0,0x4080,0x0800,0x7E07,0xFFCF,
X	0xFFCF,0xFFC2,0x4810,0x74C0,0x0800,0x7CE7,0xFFFF,0xFF9F,
X	0xFFE9,0x6409,0x1623,0x0800,0x7CE6,0x479C,0x0F07,0xFFC5,
X	0x458E,0xF1A9,0xC800,0x781C,0x7F39,0xCF3F,0xFFCA,0x4281,
X	0x8088,0x6800,0x79FC,0xFF39,0xCF3F,0xFFC0,0x7160,0x8285,
X	0x0800,0x73F9,0xFE73,0x9E7F,0xFFC8,0x1811,0x6285,0x0800,
X	0x73F9,0xFE73,0x9F1F,0xFFE2,0x0601,0x3392,0x8800,0x7FFF,
X	0xFFFF,0xFFFF,0xFFE1,0x43C1,0x1192,0x8800,0x7000,0x0000,
X	0x0007,0xFFE0,0x2020,0x8853,0x4800,0x7FFF,0xFFFF,0xFFFF,
X	0xFFF2,0x0000,0x0028,0x0800,0x7FFF,0xFFFF,0xFFFF,0xFFF9,
X	0x0000,0x0014,0x8800,0x7FFF,0xFFFF,0xFFFF,0xFFFC,0x0000,
X	0x0004,0xC800,0x7FFF,0xFFFF,0xFFFF,0xFFFE,0x0000,0x0002,
X	0x4800,0x7FFF,0xCFFF,0xFFFF,0xFFFE,0x0000,0x0001,0x6800,
X	0x7FFF,0x8FFF,0xFFFF,0xFFFF,0x0000,0x0010,0x8800,0x7FFF,
X	0x07FF,0xFFFF,0xFFFF,0x8000,0x0018,0x8800,0x7FFC,0x07FF,
X	0xFFFF,0xFFFF,0xE000,0x000E,0x4800,0x7FF8,0x0FFF,0xFFFF,
X	0xFFFF,0xF000,0x0007,0x0800,0x7FE0,0x1FFF,0xFFFF,0xFFFF,
X	0xF000,0x0006,0x0800,0x7FC0,0x1FFF,0xFFFF,0xFFFF,0xE000,
X	0x0023,0x8800,0x7F00,0x3FFF,0xFFFF,0xFFFF,0xE000,0x0034,
X	0x8800,0x7E00,0xFFFF,0xFFFF,0xFFFF,0xC000,0x0016,0x0800,
X	0x7C00,0xFFFF,0xFFFF,0xFFFF,0xC000,0x0000,0x8800,0x7FF9,
X	0xFFFF,0xFFFF,0xFFFF,0x8000,0x0001,0xC800,0x7FFB,0xFFFF,
X	0xFFFF,0xFFFF,0x8000,0x0000,0xE800,0x7FFF,0xFFFF,0xFFFF,
X	0xFFFF,0x0000,0x0002,0xC800,0x7FFF,0xFFFF,0xFFFF,0xFFFF,
X	0x0000,0x0002,0x6800,0x7FFF,0xFFFF,0xFFFF,0xFFFF,0x0000,
X	0x0001,0x0800,0x7E0F,0xFFFF,0xFFFF,0xFFFF,0x0000,0x0000,
X	0x8800,0x7E0F,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0800,
X	0x7F0F,0xFFFF,0xFFFF,0xFFFF,0xC000,0x0000,0x0800,0x7F8F,
X	0xFFFF,0xFFFF,0xFFFF,0xFE00,0x0000,0x0800,0x7F8F,0xFFFF,
X	0xFFFF,0xFFFF,0xFE00,0x0000,0x0800,0x7FCF,0xFFFF,0xFFFF,
X	0xFFFF,0xF800,0x0000,0x0800,0x400F,0xFFFF,0xFFFF,0xFFFF,
X	0xF800,0x0000,0x0800,0x5FEF,0xFFFF,0xFFFF,0xFFF8,0x0200,
X	0x0080,0x0800,0x4FF7,0xFFFF,0xFFC0,0x0003,0xFC00,0x03C0,
X	0x0800,0x4FF7,0xFE00,0x001F,0xFFFF,0xFD60,0x07F0,0x0800,
X	0x47E0,0x00FF,0xFFFF,0x9FE7,0xFEF0,0x0FFC,0x0800,0x43E9,
X	0xFFF9,0xFE7F,0xCFF3,0xFF78,0x1FFE,0x0800,0x43E8,0xF9FC,
X	0xFF3F,0xE7F8,0x003C,0x37FF,0x8800,0x41F4,0x7CFE,0x7F90,
X	0x0000,0x001F,0xF7FF,0xC800,0x40FA,0x3E00,0x0000,0x0000,
X	0x001D,0xF7FF,0xE800,0x40FA,0x0000,0x0000,0x0000,0x7FEE,
X	0x07FF,0xE800,0x407D,0x0000,0x0007,0xFFFF,0xFFF7,0x07FF,
X	0xE800,0x007E,0x801F,0xFFFF,0xFFFF,0xFFF7,0x07FF,0xE800,
X	0x003E,0xFFFF,0xFFFF,0xFFFF,0xE087,0x0FFF,0xE800,0x401F,
X	0x7FFF,0xFFFE,0x0000,0x1FFF,0xFFFF,0xE800,0x601F,0x7FE0,
X	0x0001,0xFFF8,0x3FFF,0xFFFF,0xE800,0x600F,0x801F,0xFFFF,
X	0xFFF8,0x3FC0,0x0FFF,0xE800,0x7007,0xFFF8,0x07FF,0xFF80,
X	0x00BF,0xFFFF,0xE800,0x7807,0xFFF8,0x0700,0x007F,0xFFFF,
X	0xFFFF,0xE819,0x7803,0xFE00,0x00FF,0xFFFF,0xFFFF,0xF03F,
X	0xE838,0x7C00,0x01FF,0xFFFF,0xE003,0xFFC0,0x1007,0xE99C,
X	0x7E03,0xFFFC,0x0000,0x0003,0x803F,0xF803,0xEFFE,0x7E03,
X	0xE000,0x0000,0x1083,0xFFFF,0xF803,0xEE7F,0x7F01,0xE001,
X	0x0842,0x18C1,0xFFFF,0xFC01,0xEFFF,0x7F01,0xE221,0x8C63,
X	0x0001,0xFFEF,0xFC01,0xEFFF,0x7F81,0xF330,0x0000,0x0001,
X	0xFFEF,0xFC01,0xEFFF,0x7FC1,0xF000,0x0000,0x0FFF,0xFFD8,
X	0x0003,0xEFFF,0x7FC0,0xF001,0xFFFF,0xFFF0,0x0007,0xFC03,
X	0xE83C,0x7FE0,0xFFFF,0xFFC0,0x000F,0xFCFF,0xFC07,0xE87F,
X	0x7FF0,0xFF80,0x003F,0xFFFF,0xE3FF,0xFC0F,0xEFFE,0x7FF0,
X	0x007F,0xFFFF,0xFFFE,0x1FFF,0xFC0F,0xEE7F,0x7FF8,0xFFFE,
X	0x1FFF,0xFF81,0xFFFF,0xFC07,0xEFFF,0x7FF8,0xF07F,0xE000,
X	0x007F,0xFFF8,0x0003,0xEFFF,0x7FFC,0xEF9F,0xFFFF,0xFFF0,
X	0x0000,0x0003,0xEFFF,0x7FFC,0xDFFF,0xFFC0,0x0000,0x0000,
X	0x0003,0xEFFF,0x7FFC,0xFF80,0x0000,0x0000,0x0000,0x0001,
X	0xEFFF,0x7FFC,0x0000,0x0000,0x0000,0x0000,0x0001,0xE87F,
X	0x7FFE,0x0000,0x0000,0x0000,0x0000,0x0001,0xEFFE,0x7FFE,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0xEE7F,0x7FFF,0x0000,
X	0x0000,0x0000,0x0000,0x0000,0xEFFF,0x7FFF,0x8000,0x0000,
X	0x0000,0x0000,0x0001,0xEFFF,0x7FFF,0xF000,0x0000,0x0000,
X	0x0000,0x0001,0xEFFF,0x7FFF,0xFF00,0x0000,0x0000,0x0000,
X	0x7FFF,0xE9F9,0x7FFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
X	0xEC31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0FFF,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x00C0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X	0x00BF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x07FF,
X	0x0000,0x0000,0x0000,0x0000,0x0004,0x0000,0x07F8,0x0000,
X	0x0000,0x0000,0x0000,0x0002,0x4000,0x0000,0x0000,0x0000,
X	0x0000,0x0000,0x00DF,0x4000,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x3FFF,0xE100,0x04C0,0x0000,0x0000,0x0000,0x0000,
X	0x0FFF,0xEF00,0x027F,0x0000,0x0000,0x07FE,0x0000,0xF07F,
X	0xF980,0x06FF,0x0000,0x3FFF,0xFFFF,0xF801,0x8FFF,0xF6C0,
X	0x07FF,0x0000,0xCFFF,0xFFFF,0xCFC0,0x3FFF,0xFD40,0x0000,
X	0x0001,0x8FFF,0x7FFF,0x3FF0,0x7FFF,0xFCE0,0x0404,0x0007,
X	0x07FF,0x9FFC,0xFFFC,0x7F7F,0xFE60,0x03C0,0x000C,0x079F,
X	0xEFFF,0xFFFF,0x10FF,0xFF60,0x0600,0x0018,0x0FEF,0xF7FE,
X	0xF3FF,0x8FFF,0xFFE0,0x01FF,0x0020,0x1FFF,0xFFFE,0xF3FF,
X	0xCFFF,0xFE80,0x0100,0x4040,0x1FF1,0xACE6,0xD3FF,0xDFFF,
X	0xFE00,0x0000,0x6100,0x3FEF,0x575A,0xB3FF,0xFFFF,0xFFC0,
X	0x0000,0x3E00,0xFC73,0x545E,0x7FFF,0xFFFF,0xFFC0,0x0100,
X	0x0400,0xE3FD,0x735A,0xB3FF,0xFFFF,0xFFC0,0x00C0,0x0001,
X	0xFFE3,0x7466,0xDFFF,0xFFFF,0xFFE0,0x0000,0x0003,0xFFFF,
X	0xFFFF,0xFCFF,0xFFFF,0xFFE8,0x01E0,0x0007,0xFCFF,0xF7FF,
X	0xFF1F,0xFFFF,0xFFE4,0x0000,0x000F,0xE3FF,0xCFDF,0xFFE7,
X	0xFFFF,0xFFF8,0x0000,0x000F,0x9FFF,0xBFEF,0xFFFF,0xFFFF,
X	0xFFFC,0x07C0,0x000C,0x7FFE,0x7FF7,0xFFFF,0xFFFF,0xFFFE,
X	0x0000,0x0003,0xFFFD,0xFFFB,0xFFFF,0x63FF,0xFFFF,0x4000,
X	0x000F,0xFFF3,0xFFFD,0xFFFF,0x7FFF,0xFFFF,0xC000,0x000F,
X	0xFFEF,0xFFFE,0xFFFF,0xBFFF,0xFFBF,0xC000,0x000F,0xFFFF,
X	0xFFFF,0x7FFF,0x9FFF,0xFFBF,0xE03E,0x000F,0xFFFF,0xFFFF,
X	0xFFFF,0xCFFF,0xFFBF,0xE000,0x000F,0xFFFF,0xFFFF,0xFFFF,
X	0xCFFF,0xFF7F,0xE000,0x1FE7,0xFFFF,0xFFFF,0xFFF8,0x02FF,
X	0xFE7F,0xE000,0x0FF3,0xFFFF,0xFFC0,0x0000,0x01FF,0xFC3F,
X	0xE000,0x0FF1,0xFE00,0x0000,0x0000,0x01FF,0xF80F,0xE000,
X	0x07E0,0x0000,0x0000,0x0000,0x00FF,0xF003,0xE001,0x03E0,
X	0x0000,0x0000,0x0000,0x007F,0xE001,0xE7C0,0x03E0,0x0000,
X	0x0000,0x0000,0x003F,0xF000,0x6000,0x01F0,0x0000,0x0000,
X	0x0000,0x001F,0xF000,0x2000,0x00F8,0x0000,0x0000,0x0000,
X	0x001D,0xF000,0x0000,0x00F8,0x0000,0x0000,0x0000,0x7FEE,
X	0x0000,0x0000,0x007C,0x0000,0x0007,0xFFFF,0xFFF7,0x0000,
X	0x0000,0x007E,0x801F,0xFFFF,0xFFFF,0xFFF7,0x0000,0x0000,
X	0x003E,0xFFFF,0xFFFF,0xFFFF,0xE087,0x0000,0x0003,0x001F,
X	0x7FFF,0xFFFE,0x0000,0x1FFF,0xC000,0x0000,0x001F,0x7FE0,
X	0x0001,0xFFF8,0x3FFF,0xE000,0x0000,0x000F,0x801F,0xFFFF,
X	0xFFF8,0x3FC0,0x0000,0x0000,0x0007,0xFFF8,0x07FF,0xFF80,
X	0x00BF,0xF000,0x0000,0x0007,0xFFF8,0x0700,0x007F,0xFFFF,
X	0xF000,0x0000,0x0003,0xFE00,0x00FF,0xFFFF,0xFFFF,0xF000,
X	0x0000,0x0000,0x01FF,0xFFFF,0xE003,0xFFC0,0x1000,0x0000,
X	0x0003,0xFFFC,0x0000,0x0003,0x803F,0xF800,0x0000,0x0003,
X	0xE000,0x0000,0x1083,0xFFFF,0xF800,0x0000,0x0001,0xE001,
X	0x0842,0x18C1,0xFFFF,0xFC00,0x0000,0x0001,0xE221,0x8C63,
X	0x0001,0xFFEF,0xFC00,0x0000,0x0001,0xF330,0x0000,0x0001,
X	0xFFEF,0xFC00,0x0000,0x0001,0xF000,0x0000,0x0FFF,0xFFD8,
X	0x0000,0x0000,0x0000,0xF001,0xFFFF,0xFFF0,0x0007,0xFC00,
X	0x0000,0x0000,0xFFFF,0xFFC0,0x000F,0xFCFF,0xFC00,0x0000,
X	0x0000,0xFF80,0x003F,0xFFFF,0xE3FF,0xFC00,0x0000,0x0000,
X	0x007F,0xFFFF,0xFFFE,0x1FFF,0xFC00,0x0000,0x0000,0xFFFE,
X	0x1FFF,0xFF81,0xFFFF,0xFC00,0x0000,0x0000,0xF07F,0xE000,
X	0x007F,0xFFF8,0x0000,0x0000,0x0000,0xEF9F,0xFFFF,0xFFF0,
X	0x0000,0x0000,0x0000,0x0000,0xDFFF,0xFFC0,0x0000,0x0000,
X	0x0000,0x0000,0x0000,0xFF80,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
X	0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
X};
X
Xstruct Image icon = {
X	0,0,	
X	101,80,	
X	2,	
X	icondata,	
X	0x0003,0x0000,	
X	NULL	
X};
END_OF_FILE
if test 8229 -ne `wc -c <'src/icon.h'`; then
    echo shar: \"'src/icon.h'\" unpacked with wrong size!
fi
# end of 'src/icon.h'
fi
if test -f 'src/iconify.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/iconify.c'\"
else
echo shar: Extracting \"'src/iconify.c'\" \(4573 characters\)
sed "s/^X//" >'src/iconify.c' <<'END_OF_FILE'
X/*  :ts=8 bk=0
X *
X * iconify.c:	You asked for it, you got it.
X *
X * Copyright 1987 by Leo L. Schwab.
X * Permission is hereby granted for use in any and all programs, both
X * Public Domain and commercial in nature, provided this Copyright notice
X * is left intact.  Purveyors of programs, at their option, may wish observe
X * the following conditions (in the spirit of hackerdom):
X *	1: You send me a free, registered copy of the program that uses the
X *	   iconify feature,
X *	2: If you're feeling really nice, a mention in the program's
X *	   documentation of my name would be neat.
X *
X *			 		8712.10		(415) 456-3960
X */
X#include <exec/types.h>
X#include <devices/timer.h>
X#include <intuition/intuition.h>
X#include "iconify.h"
X
X/*
X * It is recommended that the tick rate not be made too rapid to avoid
X * bogging down the system.
X */
X#define	LEO_TICKS_PER_SECOND	10
X
X/*
X * Some programmers may not wish to have the added functionality of the
X * ICON_FUNCTION feature.  If you're such a programmer, you may comment out
X * the following #define, which will eliminate the code to handle function
X * calls, and make iconify() even smaller.
X */
X/*
X Commented by HooverSoft for use with Print15A
X
X#define	USE_FUNCTIONS
X
X*/
X/*
X * Jim Mackraz suggested making icons easily identifiable by outside
X * programs, so this constant gets stuffed into the UserData field.
X */
X#define	ICON	0x49434f4eL		/*  'ICON'  */
X
X
Xextern void	*OpenWindow(), *GetMsg(),  *CreateExtIO(),
X		*CheckIO();
Xextern long	OpenDevice(), DoubleClick();
X
X
Xstatic struct Gadget gadget = {
X	NULL,
X	0, 0, 0, 0,
X	NULL,				/*  Set later  */
X	GADGIMMEDIATE,
X	WDRAGGING,			/*  Observe the Magic!  */
X	NULL,				/*  Set later  */
X	NULL, NULL, NULL, NULL,
X	0, 0
X};
X
Xstatic struct NewWindow windef = {
X	0, 0, 0, 0,			/*  Set later  */
X	-1, -1,
X	GADGETDOWN,
X	BORDERLESS | SMART_REFRESH | NOCAREREFRESH,
X	&gadget,
X	NULL, NULL, NULL, NULL,		/*  Lotsa these  */
X	0, 0, 0, 0,
X	WBENCHSCREEN
X};
X
Xstatic struct Window		*win;
X
X#ifdef USE_FUNCTIONS
Xstatic struct timerequest	*tr;
Xstatic struct MsgPort		*reply;
X#endif
X
X
Xiconify (left, top, width, height, screen, ptr, type)
XUWORD *left, *top, width, height;
Xstruct Screen *screen;
XAPTR ptr;
Xint type;
X{
X	register struct IntuiMessage	*msg;
X	long				secs = 0, mics = 0,
X					cs, cm,
X					class,
X					sigmask;
X
X	windef.LeftEdge		= *left;
X	windef.TopEdge		= *top;
X	windef.Width		= width;
X	windef.Height		= height;
X	windef.Type = (windef.Screen = screen) ? CUSTOMSCREEN : WBENCHSCREEN;
X
X	gadget.Flags		= GADGHCOMP | GRELWIDTH | GRELHEIGHT;
X
X	switch (type & 3) {
X	case ICON_IMAGE:
X		gadget.Flags		|= GADGIMAGE;
X	case ICON_BORDER:
X		gadget.GadgetRender	= ptr;
X		break;
X
X	case ICON_FUNCTION:
X#ifdef USE_FUNCTIONS
X		gadget.GadgetRender	= NULL;
X#else
X		return (0);
X#endif
X		break;
X
X	default:
X		return (0);
X	}
X
X	if (!openstuff ())
X		return (0);
X	sigmask = 1L << win -> UserPort -> mp_SigBit;
X
X#ifdef USE_FUNCTIONS
X	if (type == ICON_FUNCTION) {
X		sigmask |= 1L << reply -> mp_SigBit;
X		tr -> tr_node.io_Command= TR_ADDREQUEST;
X		tr -> tr_time.tv_secs	= 0;
X		tr -> tr_time.tv_micro	= (1000000L / LEO_TICKS_PER_SECOND);
X		SendIO (tr);
X		/*
X		 * Make initialization call to user's function.
X		 * Isn't typecasting wonderful?  :-|
X		 */
X		(* ((void (*)()) ptr)) (win, (WORD) 1);
X	}
X#endif
X
X	while (1) {
X		Wait (sigmask);
X
X#ifdef USE_FUNCTIONS
X		if (GetMsg (reply)) {
X			/*
X			 * Call user's function to do something to the icon.
X			 */
X			(* ((void (*)()) ptr)) (win, (WORD) 0);
X			tr -> tr_time.tv_secs	= 0;
X			tr -> tr_time.tv_micro	=
X			 (1000000L / LEO_TICKS_PER_SECOND);
X			SendIO (tr);
X		}
X#endif
X
X		if (msg = GetMsg (win -> UserPort)) {
X			class = msg -> Class;
X			cs = msg -> Seconds;
X			cm = msg -> Micros;
X			ReplyMsg (msg);
X
X			if (class == GADGETDOWN) {
X				if (DoubleClick (secs, mics, cs, cm))
X					break;
X				secs = cs;  mics = cm;
X			}
X		}
X	}
X
X#ifdef USE_FUNCTIONS
X	if (type == ICON_FUNCTION) {
X		AbortIO (tr);
X		WaitIO (tr);
X	}
X#endif
X
X	*left = win -> LeftEdge;
X	*top = win -> TopEdge;
X	closestuff ();
X	return (1);
X}
X
Xstatic
Xopenstuff ()
X{
X	if (!(win = OpenWindow (&windef)))
X		return (0);
X	win -> UserData = (BYTE *) ICON;
X		
X#ifdef USE_FUNCTIONS
X	if (!(reply = CreatePort (NULL, NULL)) ||
X	    !(tr = CreateExtIO (reply, (long) sizeof (*tr))) ||
X	    OpenDevice (TIMERNAME, UNIT_VBLANK, tr, 0L)) {
X		closestuff ();
X		return (0);
X	}
X#endif
X
X	return (1);
X}
X
Xstatic
Xclosestuff ()
X{
X#ifdef USE_FUNCTIONS
X	if (tr) {
X		if (tr -> tr_node.io_Device)
X			CloseDevice (tr);
X		DeleteExtIO (tr, (long) sizeof (*tr));
X	}
X	if (reply)		DeletePort (reply);
X#endif
X
X	if (win)		CloseWindow (win);
X}
END_OF_FILE
if test 4573 -ne `wc -c <'src/iconify.c'`; then
    echo shar: \"'src/iconify.c'\" unpacked with wrong size!
fi
# end of 'src/iconify.c'
fi
if test -f 'src/iconify.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/iconify.h'\"
else
echo shar: Extracting \"'src/iconify.h'\" \(857 characters\)
sed "s/^X//" >'src/iconify.h' <<'END_OF_FILE'
X/*  :ts=8 bk=0
X *
X * iconify.h:	Should be used by all programs intending to use iconify.c.
X *
X * Copyright 1987 by Leo L. Schwab.
X * Permission is hereby granted for use in any and all programs, both
X * Public Domain and commercial in nature, provided this Copyright notice
X * is left intact.  Purveyors of programs, at their option, may wish observe
X * the following conditions (in the spirit of hackerdom):
X *	1: You send me a free, registered copy of the program that uses the
X *	   iconify feature,
X *	2: If you're feeling really nice, a mention in the program's
X *	   documentation of my name would be neat.
X *
X *			 		8712.10		(415) 456-3960
X */
X
X#define	ICON_IMAGE	0
X#define	ICON_BORDER	1
X#define	ICON_FUNCTION	2
X
X/*  Suggested icon size for a standard (640 x 200) WorkBench screen.  */
X#define	ICONWIDTH	((UWORD) 50)
X#define	ICONHEIGHT	((UWORD) 25)
END_OF_FILE
if test 857 -ne `wc -c <'src/iconify.h'`; then
    echo shar: \"'src/iconify.h'\" unpacked with wrong size!
fi
# end of 'src/iconify.h'
fi
if test -f 'src/info.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/info.c'\"
else
echo shar: Extracting \"'src/info.c'\" \(500 characters\)
sed "s/^X//" >'src/info.c' <<'END_OF_FILE'
X/* info.c
X	display copyright notice and distribution stuff
X	coded 6.12.90 by hoover
X*/
X
Xextern struct IntuiMessage *msg, *GetMsg();
X#include <exec/types.h>
X#include <intuition/intuition.h>
X#include "info.h"
X
Xstruct Window *iw, *OpenWindow();
Xvoid info()
X{
X	iw = OpenWindow(&infowindow);
X	if(!iw)
X		close_all("Could not open info window.",1L);
X	PrintIText(iw->RPort, &infotext2,0L,0L);
X
X	WaitPort(iw->UserPort);
X	msg = GetMsg(iw->UserPort);
X	ReplyMsg(msg);
X	CloseWindowSafely(iw,NULL);
X	return;
X	}
X
X	
END_OF_FILE
if test 500 -ne `wc -c <'src/info.c'`; then
    echo shar: \"'src/info.c'\" unpacked with wrong size!
fi
# end of 'src/info.c'
fi
if test -f 'src/info.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/info.h'\"
else
echo shar: Extracting \"'src/info.h'\" \(2160 characters\)
sed "s/^X//" >'src/info.h' <<'END_OF_FILE'
X
XSHORT IBorderVectors1[] = {
X	0,0,
X	136,0,
X	136,14,
X	0,14,
X	0,0
X};
Xstruct Border IBorder1 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	IBorderVectors1,	
X	NULL	
X};
X
Xstruct IntuiText infotext1 = {
X	1,0,JAM2,	
X	15,2,	
X	NULL,	
X	(UBYTE *)"Acknowledged!",	
X	NULL	
X};
X
Xstruct Gadget ackgad = {
X	NULL,	
X	122,126,	
X	135,13,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&IBorder1,	
X	NULL,	
X	&infotext1,	
X	NULL,	
X	NULL,	
X	815,	
X	NULL	
X};
X
X#define GadgetList1 ackgad
X
Xstruct IntuiText infotext13 = {
X	1,0,JAM2,	
X	15,116,	
X	NULL,	
X	(UBYTE *)"for problems, bug reports & ideas.",	
X	NULL	
X};
Xstruct IntuiText infotext12 = {
X	1,0,JAM2,	
X	15,107,	
X	NULL,	
X	(UBYTE *)"Contact hoover@math4.uni-bielefeld.de",	
X	&infotext13	
X};
Xstruct IntuiText infotext11 = {
X	1,0,JAM2,	
X	15,98,	
X	NULL,	
X	(UBYTE *)"program is strictly prohibited.",	
X	&infotext12	
X};
X
Xstruct IntuiText infotext10 = {
X	1,0,JAM2,	
X	15,90,	
X	NULL,	
X	(UBYTE *)"Any commercial distribution of this",	
X	&infotext11	
X};
X
Xstruct IntuiText infotext9 = {
X	2,0,JAM2,	
X	93,20,	
X	NULL,	
X	(UBYTE *)"All rights reserved.",	
X	&infotext10	
X};
X
Xstruct IntuiText infotext8 = {
X	1,0,JAM2,	
X	15,77,	
X	NULL,	
X	(UBYTE *)"charity (preferably Greenpeace).",	
X	&infotext9	
X};
X
Xstruct IntuiText infotext7 = {
X	1,0,JAM2,	
X	13,69,	
X	NULL,	
X	(UBYTE *)"to make a donation to your favourite",	
X	&infotext8	
X};
X
Xstruct IntuiText infotext6 = {
X	1,0,JAM2,	
X	15,61,	
X	NULL,	
X	(UBYTE *)"If you use Print regularly I ask you",	
X	&infotext7	
X};
X
Xstruct IntuiText infotext5 = {
X	1,0,JAM2,	
X	15,47,	
X	NULL,	
X	(UBYTE *)"distribution of this program.",	
X	&infotext6	
X};
X
Xstruct IntuiText infotext4 = {
X	1,0,JAM2,	
X	15,39,	
X	NULL,	
X	(UBYTE *)"charge more than a minimal fee for the",	
X	&infotext5	
X};
X
Xstruct IntuiText infotext3 = {
X	1,0,JAM2,	
X	15,31,	
X	NULL,	
X	(UBYTE *)"This program is FreeWare. You may not",	
X	&infotext4	
X};
X
Xstruct IntuiText infotext2 = {
X	2,0,JAM2,	
X	55,12,	
X	NULL,	
X	(UBYTE *)"Print V1.5A (c) HooverSoft 1990",	
X	&infotext3	
X};
X
Xstruct NewWindow infowindow = {
X	123,27,	
X	350,142,	
X	0,1,	
X	GADGETUP,	
X	WINDOWDRAG+WINDOWDEPTH+ACTIVATE+NOCAREREFRESH,	
X	&ackgad,	
X	NULL,	
X	(UBYTE *)"Print INFO",	
X	NULL,	
X	NULL,	
X	5,5,	
X	-1,-1,	
X	WBENCHSCREEN	
X	};
X
X
END_OF_FILE
if test 2160 -ne `wc -c <'src/info.h'`; then
    echo shar: \"'src/info.h'\" unpacked with wrong size!
fi
# end of 'src/info.h'
fi
if test -f 'src/inout.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/inout.c'\"
else
echo shar: Extracting \"'src/inout.c'\" \(3174 characters\)
sed "s/^X//" >'src/inout.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include <exec/types.h>
X#include <intuition/intuition.h>
X#include <intuition/intuitionbase.h>
X#include <libraries/reqbase.h>
Xextern struct reqFileRequester reqreq;
Xextern struct FILE *infile, *printer, *cfile;
Xextern  void *ArpBase, *ReqBase, *mw, *OpenLibrary(), *OpenWindow();
Xextern struct  IntuitionBase  *IntuitionBase;
X
X#define PRINTERNAME (UBYTE *) "PAR:"
X
XULONG NO_REQLIB = 0L;  /* flag for existence of req.library */
X
Xstruct IntuiText fbody = {
X	1,0,
X	JAM1|COMPLEMENT,
X	30,5,
X	NULL,
X	(UBYTE *) "Well...",
X	NULL
X	};
X
Xstruct IntuiText ok = {
X	1,0,
X	JAM1|COMPLEMENT,
X	6,3,
X	NULL,
X	(UBYTE *)	"Whoops!",
X	NULL
X	};
X
Xvoid close_all(why, error)
XUBYTE *why;
Xlong error;
X{
X	if(error)
X		{
X		fbody.IText = why;
X		AutoRequest(IntuitionBase->ActiveWindow, &fbody, &ok, &ok,\
X						NULL, NULL, 380L, 50L);
X		}
X
X	if(printer)
X		fclose(printer);
X	if(infile)
X		fclose(infile);
X	if(cfile)
X		fclose(cfile);
X
X
X	if(mw)
X		CloseWindowSafely(mw,NULL);
X	if(IntuitionBase)
X		CloseLibrary(IntuitionBase);
X	if(ArpBase)
X		CloseLibrary(ArpBase);
X	if(ReqBase)
X		{
X		PurgeFiles(&reqreq);
X		CloseLibrary(ReqBase);
X		}
X
X	exit(0L);
X}
X
Xvoid open_all()
X{
X	IntuitionBase = OpenLibrary("intuition.library",0L);
X	if(!IntuitionBase)
X		exit(FALSE);
X
X	ArpBase = OpenLibrary("arp.library",0L);
X	if(!ArpBase)
X		close_all("FATAL ERROR: no arp.library!", 1L);
X
X	ReqBase = OpenLibrary("req.library", 0L);
X		if(!ReqBase)
X		close_all("FATAL ERROR: no req.library!", 1L);
X
X	return;
X}
X
X/* help coded 17 Oct 1990 by hoover
X	supply online help to user
X*/
X
Xvoid help()
X{
X	printf("---------------------------------------------------------------\n");
X	printf("Usage: Print [options] {switches} file1 ... fileN\n");
X	printf("---------------------------------------------------------------\n");
X	printf("Supported options that take an argument:\n");
X	printf("---------------------------------------------------------------\n");
X	printf("-i n   \t indent text with n spaces        \t (Default:   8)\n");
X	printf("-t n   \t convert each tab to n spaces     \t (Default:   3)\n");
X	printf("-u n   \t national char set after printing \t (Default:   2)\n");
X	printf("-l n   \t number of lines per page         \t (Default:  72)\n");
X	printf("-o n   \t offset of paper top to head (mm) \t (Default:   0)\n");
X	printf("-f file\t read printer commands from file  \t (Default: OFF)\n");
X	printf("---------------------------------------------------------------\n");
X	printf("Options that do not expect an argument:\n");
X	printf("-B   \t switch to 10 CPI\n");
X	printf("-M   \t switch to 12 CPI (DEFAULT)\n");
X	printf("-S   \t switch to 15 CPI\n");
X	printf("-F   \t print name of file (DEFAULT OFF)\n");
X	printf("-P   \t pagenumbering on (DEFAULT OFF)\n");
X	printf("-Q   \t switch to letter quality (DEFAULT ON)\n");
X	printf("-D   \t switch to high speed mode (draft)\n");
X	printf("-V   \t copy processed files to stdout\n");
X	printf("-N   \t be NICE and print in quiet mode (DEFAULT OFF)\n");
X	printf("-R   \t Don't reset printer after printing (DEFAULT OFF)\n");
X	printf("-T   \t Don't transform any characters (DEFAULT OFF)\n");
X	printf("-8   \t Switch to Jammed Print mode (8LPI) (DEFAULT OFF)\n");
X	exit(0L);
X}
X
X
END_OF_FILE
if test 3174 -ne `wc -c <'src/inout.c'`; then
    echo shar: \"'src/inout.c'\" unpacked with wrong size!
fi
# end of 'src/inout.c'
fi
if test -f 'src/inprint.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/inprint.c'\"
else
echo shar: Extracting \"'src/inprint.c'\" \(11493 characters\)
sed "s/^X//" >'src/inprint.c' <<'END_OF_FILE'
X#include <exec/exec.h>
X#include <exec/execbase.h>
X#include <libraries/dosextens.h>
X#include <libraries/dos.h>
X#include <libraries/reqbase.h>
X#include <libraries/arpbase.h>
X#include <intuition/preferences.h>
X#include <intuition/intuition.h>
X#include <graphics/gfx.h>
X#include <intuition/intuitionbase.h>
X
X#include"print.h"
X#include"iconify.h"
X#include"icon.h"
X
Xstruct IntuitionBase *IntuitionBase;
Xstruct ArpBase *ArpBase;
Xstruct ReqBase	*ReqBase;
X/*#define DEBUG1.5 1L */
X
Xstruct IntuiMessage *msg, *GetMsg();
Xstruct Gadget *igad = 0L;
X		 long  gadid = 0L;		
X		 long size;
XUBYTE *pt;
X
XULONG le, te;
X
XULONG class, code;
Xchar filename[132];
X
XULONG ARPREQUEST = 0L;
X
Xvoid *OpenLibrary();
Xstruct Window *mw, *OpenWindow();
X
Xstruct FileRequester *fr, *ArpAllocFreq();
X
Xstruct reqFileRequester reqreq;
Xchar reqdirname[300], reqfilename[60];
Xchar  reqpathname[370];
X
Xstruct Preferences *prefs, *GetPrefs();
X
Xextern void *AllocMem();
X
Xextern long BIGFONT, SMALLFONT, MEDFONT, FILENAMES, PAGENUMBERING;
Xextern long LQ ,  LOUD;
Xextern long NOTUSA, plength ; 
Xextern long HAVE_PRINTED_ONE , RESET , JAMMED_LINES ;
Xextern long DONT_TRANSFORM;
Xextern long OFFSET;
Xextern long tabsize, offset, indent;
Xextern struct Image icon;
X
X/* getprefs coded 18-dec-90
X	by hoover
X*/
Xvoid get_prefs()
X{
X	prefs = AllocMem(sizeof(struct Preferences), MEMF_CLEAR);
X	if(!GetPrefs(prefs, sizeof(struct Preferences)  ) )
X		close_all("Could not find preferences!", 1L);
X
X	RemoveGList(mw, &cpigad, -1L);
X
X	if(prefs->PrintSpacing == SIX_LPI)
X		{
X		JAMMED_LINES = 0L;
X		lpigad.GadgetText = &jammed_linestext;
X		}
X	else
X		{
X		JAMMED_LINES = 1L;
X		lpigad.GadgetText = &nojammed_linestext;
X		}
X
X	switch(prefs->PrintPitch)
X		{
X		case PICA:
X			BIGFONT = 1L;
X			MEDFONT = SMALLFONT = 0L;
X			cpigad.GadgetText = &i10cpitext;
X			break;
X
X		case ELITE:
X			BIGFONT = SMALLFONT =0L;
X			MEDFONT = 1L;
X			cpigad.GadgetText = &i12cpitext;
X			break;
X
X		case FINE:
X			BIGFONT = MEDFONT = 0L;
X			SMALLFONT = 1L;
X			cpigad.GadgetText = &i15cpitext;
X			break;
X
X		case default:
X			break;
X		}
X	
X	if(prefs->PrintQuality == DRAFT)
X		{
X		LQ = 0L;
X		nlqgad.GadgetText = &nonlqtext;
X		}
X	else
X		{
X		LQ = 1;
X		nlqgad.GadgetText = &nlqtext;
X		}
X
X	indent = prefs->PrintLeftMargin;
X	sprintf(indstring, "%ld", indent);
X
X	plength = prefs->PaperLength;
X
X	if(prefs)
X		FreeMem(prefs, sizeof(struct Preferences));
X
X	AddGList(mw, &cpigad, 1L, 130867, NULL);
X	RefreshGadgets(mw->FirstGadget, mw, NULL);
X	return;
X	}
X
X/* preview performs a preview on the file to print and
X	returns a string suitable for printf) 
X*/
Xpreview(name)
XUBYTE *name;
X{
X	struct FileInfoBlock *fb = NULL ;
X	struct FileLock *fl=NULL;
X
X	long hours,mins,secs;
X
X
X	fl = (struct FileLock *) ArpLock(name, ACCESS_READ);
X	if(!fl)
X		{
X		SimpleRequest("Can't lock file %s!", name);
X		return;
X		}
X	/* Memory will be released on CloseLibrary(ArpBase) */
X	fb = (struct FileInfoBlock *) ArpAllocMem(sizeof(struct FileInfoBlock),\
X																	MEMF_CLEAR|MEMF_CHIP);
X
X	if(!fb)
X		{
X		SimpleRequest("No memory for FileInfoBlock!");
X		return;
X		}
X	if(!Examine(fl, fb))
X		{
X		SimpleRequest("Examine of %s failed.",name);
X		return;
X		}
X
X	size = fb -> fib_Size;
X	if(LQ)
X		secs = size /   80;
X	else
X		secs = size / 240;
X
X	if(!LOUD)
X	secs *= 2;
X  
X	SimpleRequest("Filename : %s\nFilesize : %ld bytes.\n\
XEst. time: %ld min %ld sec.", fb->fib_FileName,size,secs / 60L,secs%60L);
X	
X	return;
X}
X
X		
X
X
Xvoid inprint()
X{
X
X
X	le = te = 50L;
X
X
X	reqreq.PathName = reqpathname;
X	reqreq.Dir = reqdirname;
X	reqreq.File = reqfilename;
X	reqreq.dirnamescolor = 2;
X	reqreq.devicenamescolor = 2;	
X	reqreq.Flags = FRQCACHINGM;
X	fr = ArpAllocFreq();
X
X
X	mw = OpenWindow(&printwindow);
X	if(!mw)
X		close_all("Unable to open Window!",1L);
X	PrintIText(mw->RPort, &IntuiTextList1, 0L, 0L);
X
X
X	for(;;)
X		{
X		WaitPort(mw->UserPort);
X		msg = GetMsg(mw->UserPort);
X		class = msg->Class;
X		code = msg->Code;
X
X		igad = (struct Gadget *) msg -> IAddress;
X		gadid = igad -> GadgetID;
X		ReplyMsg(msg);
X
X		if(class == GADGETUP )
X			{
X
X
X			switch(gadid)
X				{
X				long okay = 0L;
X
X				case HELPGADGET:
X									if(!ARPREQUEST) {
X										reqreq.Title = "Choose preview file";
X										if(FileRequester(&reqreq))
X											preview(reqpathname);
X										break;
X										}
X									else 
X										{
X										fr->fr_Hail = (BYTE *) "Choose preview file";
X										pt = (UBYTE *)FileRequest(fr);
X										if(pt)
X											{
X											strcpy(filename,fr->fr_Dir);
X											TackOn(filename,fr->fr_File);
X											preview(filename);
X											break;
X											}
X										break;
X										}
X				case REQGAD:
X									RemoveGadget(mw, &reqgad);
X									if(ARPREQUEST)
X										{
X										reqgad.GadgetText = &noarptext;
X										ARPREQUEST = 0L;
X										goto fuckoff10;
X										}
X									else
X										{
X										RemoveGadget(mw, &reqgad);
X										reqgad.GadgetText = &arptext;
X										ARPREQUEST = 1L;
X										}
Xfuckoff10:
X									AddGadget(mw, &reqgad, -1L);
X									RefreshGadgets(&reqgad, mw, 0L);
X									break;
X		
X				case INFOGADGET:
X										info();
X										break;
X
X				case PREFGADGET:
X										get_prefs();
X										break;
X
X				case SLEEPGADGET: CloseWindowSafely(mw,NULL);
X										SetTaskPri(FindTask(0L), -10L);
X										okay = \
X										iconify(&le,&te,101,80,NULL,&icon,ICON_IMAGE);
X										SetTaskPri(FindTask(0L), 0L);
X										if(okay)
X											{
X											mw = OpenWindow(&printwindow);
X											if(!mw)
X												close_all("Unable to open Window!",1L);
X											PrintIText(mw->RPort, &IntuiTextList1, 0L, 0L);
X											}
X										else
X											close_all("Internal iconify error!");
X										break;
X
X				case NOISYGADGET:	RemoveGadget(mw, &nogad);
X										if(LOUD)
X											{	
X											nogad.GadgetText = &quiettext;
X											LOUD = 0L;
X											goto fuckoff;
X											}
X										if(!LOUD)
X											{
X											nogad.GadgetText = &noisytext;
X											LOUD = 1L;
X											}
Xfuckoff:
X										AddGadget(mw, &nogad, -1L);
X										RefreshGadgets(&nogad,mw,0L);
X										break;
X
X			case QUITGADGET:
X							         if(TwoGadRequest("Really quit Print?"))
X											{
X											if(HAVE_PRINTED_ONE)
X											  clean_printer();
X											close_all("",0L);
X											}
X										else
X											break;
X
X				case PRINTGADGET:	
X										if(ARPREQUEST)
X											{
X											fr->fr_Hail	= (BYTE *) "Choose File to print";
X											pt = (UBYTE *)FileRequest(fr);
X											if(pt)
X												{
X												strcpy(filename,fr->fr_Dir);
X												TackOn(filename,fr->fr_File);
X													RemoveGadget(mw, &printgad); 
X													printgad.GadgetText = &waittext;
X													AddGadget(mw, &printgad, -1L);
X													RefreshGadgets(mw->FirstGadget,mw,0L);
X
X													init_printer();
X													print_file(filename);
X													HAVE_PRINTED_ONE = 1L;
X
X												RemoveGadget(mw, &printgad);
X												printgad.GadgetText = &printtext;
X												AddGadget(mw, &printgad, -1L); 
X												RefreshGadgets(&printgad,mw,0L); 
X												}
X											pt = (UBYTE *) NULL;	
X											}
X										else
X											{
X											reqreq.Title =  "Choose file to print";
X											if (FileRequester(&reqreq))
X												{
X												RemoveGadget(mw, &printgad); 
X												printgad.GadgetText = &waittext;
X												AddGadget(mw, &printgad, -1L);
X												RefreshGadgets(mw->FirstGadget,mw,0L);
X												init_printer(); 
X												print_file(reqpathname); 
X												HAVE_PRINTED_ONE = 1L;
X
X												RemoveGadget(mw, &printgad);
X												printgad.GadgetText = &printtext;
X												AddGadget(mw, &printgad, -1L); 
X												RefreshGadgets(&printgad,mw,0L); 
X												}
X											}
X										break;
X
X					case PAGENOGADGET:
X										RemoveGadget(mw, &pngad);
X										if(PAGENUMBERING)
X												{	
X												pngad.GadgetText = &nopagenotext;
X												PAGENUMBERING = 0L;
X												goto fuckoff1;
X												}
X											if(!PAGENUMBERING)
X												{
X												pngad.GadgetText = &pagenotext;
X												PAGENUMBERING  = 1L;
X												}
Xfuckoff1:
X											AddGadget(mw, &pngad, -1L);
X											RefreshGadgets(&pngad,mw,0L);
X											break;
X
X					case FILENAMEGADGET:
X											RemoveGadget(mw, &fngad);
X											if(FILENAMES)
X												{	
X												fngad.GadgetText = &nofilenametext;
X												FILENAMES = 0L;
X												goto fuckoff2;
X												}
X											if(!FILENAMES)
X												{
X												fngad.GadgetText = &filenametext;
X												FILENAMES  = 1L;
X												}
X						
Xfuckoff2:
X											AddGadget(mw, &fngad, -1L);
X											RefreshGadgets(&fngad,mw,0L);
X											break;
X
X					case RESETGADGET:
X											RemoveGadget(mw, &resgad);
X											if(RESET)
X												{	
X												resgad.GadgetText = &noresettext;
X												RESET = 0L;
X												goto fuckoff3;
X												}
X											if(!RESET)
X												{
X												resgad.GadgetText = &resettext;
X												RESET  = 1L;
X												}
X						
Xfuckoff3:
X											AddGadget(mw, &resgad, -1L);
X											RefreshGadgets(&resgad,mw,0L);
X											break;
X					case IBMGADGET:	
X											RemoveGadget(mw, &ibmgad);
X											if(DONT_TRANSFORM)
X												{	
X												ibmgad.GadgetText = &nodont_transformtext;
X												DONT_TRANSFORM = 0L;
X												goto fuckoff4;
X												}
X											if(!DONT_TRANSFORM)
X												{
X												ibmgad.GadgetText = &dont_transformtext;
X												DONT_TRANSFORM  = 1L;
X												}
X						
Xfuckoff4:
X											AddGadget(mw, &ibmgad, -1L);
X											RefreshGadgets(&ibmgad,mw,0L);
X											break;
X
X					case NLQGADGET:
X											RemoveGadget(mw, &nlqgad);
X											if(LQ)
X												{	
X												nlqgad.GadgetText = &nonlqtext;
X												LQ = 0L;
X												goto fuckoff5;
X												}
X											if(!LQ)
X												{
X												nlqgad.GadgetText = &nlqtext;
X												LQ  = 1L;
X												}
X						
Xfuckoff5:
X											AddGadget(mw, &nlqgad, -1L);
X											RefreshGadgets(&nlqgad,mw,0L);
X											break;
X
X					case LPIGADGET:
X											RemoveGadget(mw, &lpigad);
X											if(JAMMED_LINES)
X												{	
X												lpigad.GadgetText = &nojammed_linestext;
X												JAMMED_LINES = 0L;
X												goto fuckoff6;
X												}
X											if(!JAMMED_LINES)
X												{
X												lpigad.GadgetText = &jammed_linestext;
X												JAMMED_LINES  = 1L;
X												}
X						
Xfuckoff6:
X											AddGadget(mw, &lpigad, -1L);
X											RefreshGadgets(&lpigad,mw,0L);
X											break;
X
X
X					case OFFGADGET:	offset = atoi(offstring);
X											OFFSET = 1L;
X											break;
X
X					case TABGADGET:	tabsize = atoi(tabstring);
X											break;
X					case INDGADGET:	indent = atoi(indstring);
X											break;
X					case CFGADGET:		scan_file(cfstring);
X											break;
X
X					case CPIGADGET:	RemoveGadget(mw, &cpigad);
X											if (BIGFONT)
X												{
X												BIGFONT =  0L;
X						 						cpigad.GadgetText = &i15cpitext;
X												SMALLFONT = 1L;
X												goto finalfuckoff;
X												}
X											if(SMALLFONT)
X												{
X												SMALLFONT = 0L;
X												MEDFONT = 1L;
X												cpigad.GadgetText = &i12cpitext;
X												goto finalfuckoff;
X												}
X											if(MEDFONT)
X												{
X												MEDFONT = 0L;
X												BIGFONT = 1L;
X												cpigad.GadgetText = &i10cpitext;
X												}
Xfinalfuckoff:
X											AddGadget(mw, &cpigad, 1L);
X											RefreshGadgets(&cpigad,mw,0L);
X											break;
X
X					case default:		break; 
X					} /* End switch()*/
X				}	
X			}
X		}		
END_OF_FILE
if test 11493 -ne `wc -c <'src/inprint.c'`; then
    echo shar: \"'src/inprint.c'\" unpacked with wrong size!
fi
# end of 'src/inprint.c'
fi
if test -f 'src/print.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/print.h'\"
else
echo shar: Extracting \"'src/print.h'\" \(11209 characters\)
sed "s/^X//" >'src/print.h' <<'END_OF_FILE'
X#include <exec/types.h>
X#include <intuition/intuition.h>
X#include <intuition/intuitionbase.h>
X
XSHORT BorderVectors1[] = {
X	0,0,
X	102,0,
X	102,9,
X	0,9,
X	0,0
X};
Xstruct Border Border1 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors1,	
X	NULL	
X};
XSHORT helpBorderVectors1[] = {
X	0,0,
X	30,0,
X	30,9,
X	0,9,
X	0,0
X};
Xstruct Border helpBorder1 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	helpBorderVectors1,	
X	NULL	
X};
Xstruct IntuiText helptext = {
X	2,0,JAM2,	
X	3,0,	
X	NULL,	
X	(UBYTE *)"PRE",	
X	NULL	
X};
X
Xstruct Gadget helpgad = {
X	NULL,	
X	318,46,	
X	28,8,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&helpBorder1,	
X	NULL,	
X	&helptext,	
X	NULL,	
X	NULL,	
X	82,	
X	NULL	
X};
X#define HELPGADGET 82L
X
XSHORT reqBorderVectors[] = {
X	0,0,
X	31,0,
X	31,9,
X	0,9,
X	0,0
X};
Xstruct Border reqborder = {
X	-1,-1,	
X	3,0,JAM2,	
X	5,	
X	reqBorderVectors,	
X	NULL	
X};
X
Xstruct IntuiText reqtext = {
X	2,0,JAM2,	
X	3,0,	
X	NULL,	
X	(UBYTE *)"REQ",	
X	NULL	
X};
Xstruct IntuiText reqtext_1 = {
X	2,0,JAM2,	
X	3,0,	
X	NULL,	
X	(UBYTE *)"ARP",	
X	NULL	
X};
X#define arptext reqtext_1
X#define noarptext reqtext
X
Xstruct Gadget reqgad = {
X	&helpgad,	
X	205,13,	
X	29,8,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&reqborder,	
X	NULL,	
X	&reqtext,	
X	NULL,	
X	NULL,	
X	45L,	
X	NULL	
X};
X#define REQGAD 45L
X
XSHORT prefBorderVectors[] = {
X	0,0,
X	51,0,
X	51,9,
X	0,9,
X	0,0
X};
Xstruct Border prefborder = {
X	-1,-1,	
X	3,0,JAM2,	
X	5,	
X	prefBorderVectors,	
X	NULL	
X};
X
Xstruct IntuiText preftext = {
X	2,0,JAM2,	
X	6,0,	
X	NULL,	
X	(UBYTE *)"PREFS",	
X	NULL	
X};
Xstruct Gadget prefgad = {
X	&reqgad,	
X	295,13,	
X	50,8,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&prefborder,	
X	NULL,	
X	&preftext,	
X	NULL,	
X	NULL,	
X	84L,	
X	NULL	
X};
X#define PREFGADGET 84L
X
XSHORT infoBorderVectors[] = {
X	0,0,
X	51,0,
X	51,9,
X	0,9,
X	0,0
X};
Xstruct Border infoborder = {
X	-1,-1,	
X	3,0,JAM2,	
X	5,	
X	infoBorderVectors,	
X	NULL	
X};
X
Xstruct IntuiText infotext = {
X	2,0,JAM2,	
X	9,0,	
X	NULL,	
X	(UBYTE *)"INFO",	
X	NULL	
X};
Xstruct Gadget infogad = {
X	&prefgad,	
X	240,13,	
X	50,8,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&infoborder,	
X	NULL,	
X	&infotext,	
X	NULL,	
X	NULL,	
X	167,	
X	NULL	
X};
X#define INFOGADGET 167L
X
Xstruct IntuiText IText1 = {
X	2,0,JAM2,	
X	9,0,	
X	NULL,	
X	(UBYTE *)"HAVE A NAP!",	
X	NULL	
X};
X
Xstruct Gadget sleepgad = {
X	&infogad,	
X	208,46,	
X	101,8,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&Border1,	
X	NULL,	
X	&IText1,	
X	NULL,	
X	NULL,	
X	999,	
X	NULL	
X};
X#define SLEEPGADGET 999L
X
XUBYTE offgadSIBuff[4] =
X	"0";
Xstruct StringInfo offgadSInfo = {
X	offgadSIBuff,	
X	NULL,	
X	0,	
X	3,	
X	0,	
X	0,0,0,0,0,	
X	0,	
X	0,	
X	NULL	
X};
X#define offstring offgadSInfo.Buffer
XSHORT BorderVectors2[] = {
X	0,0,
X	32,0,
X	32,9,
X	0,9,
X	0,0
X};
Xstruct Border Border2 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors2,	
X	NULL	
X};
X
X#define OFFGADGET 988L
Xstruct Gadget offgad = {
X	&sleepgad,	
X	68,124,	
X	31,8,	
X	NULL,	
X	RELVERIFY+STRINGRIGHT+LONGINT,	
X	STRGADGET,	
X	(APTR)&Border2,	
X	NULL,	
X	NULL,	
X	NULL,	
X	(APTR)&offgadSInfo,	
X	988L,	
X	NULL	
X};
X
XSHORT BorderVectors3[] = {
X	0,0,
X	124,0,
X	124,32,
X	0,32,
X	0,0
X};
Xstruct Border Border3 = {
X
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors3,	
X	NULL	
X};
X
Xstruct IntuiText IText2 = {
X	1,0,JAM2,	
X	5,12,	
X	NULL,	
X	(UBYTE *)"QUIT || CANCEL",	
X	NULL	
X};
X
X#define QUITGADGET 9L
Xstruct Gadget quitgad = {
X	&offgad,	
X	214,94,	
X	123,31,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&Border3,	
X	NULL,	
X	&IText2,	
X	NULL,	
X	NULL,	
X	9,	
X	NULL	
X};
X
XSHORT BorderVectors4[] = {
X	0,0,
X	124,0,
X	124,32,
X	0,32,
X	0,0
X};
X
Xstruct Border Border4 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors4,	
X	NULL	
X};
X
Xstruct IntuiText IText3 = {
X	1,0,JAM2,	
X	16,11,	
X	NULL,	
X	(UBYTE *)" PRINT FILE",	
X	NULL	
X};
X
Xstruct IntuiText IText3_1 = {
X	3,0,JAM2,	
X	16,11,	
X	NULL,	
X	(UBYTE *)"Please wait",	
X	NULL	
X};
X#define PRINTGADGET 8L
X#define printtext IText3
X#define waittext  IText3_1
X
Xstruct Gadget printgad = {
X	&quitgad,	
X	214,58,	
X	123,31,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&Border4,	
X	NULL,	
X	&IText3,	
X	NULL,	
X	NULL,	
X	8,	
X	NULL	
X};
X
XUBYTE cfgadSIBuff[80] =
X	"Default: NEC";
Xstruct StringInfo cfgadSInfo = {
X	cfgadSIBuff,	
X	NULL,	
X	0,	
X	80,	
X	0,	
X	0,0,0,0,0,	
X	0,	
X	0,	
X	NULL	
X};
X
X#define cfstring cfgadSInfo.Buffer
XSHORT BorderVectors5[] = {
X	0,0,
X	140,0,
X	140,9,
X	0,9,
X	0,0
X};
Xstruct Border Border5 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors5,	
X	NULL	
X};
X#define CFGADGET 100L
X
Xstruct Gadget cfgad = {
X	&printgad,	
X	208,34,	
X	139,8,	
X	NULL,	
X	RELVERIFY+STRINGCENTER,	
X	STRGADGET,	
X	(APTR)&Border5,	
X	NULL,	
X	NULL,	
X	NULL,	
X	(APTR)&cfgadSInfo,	
X	100,	
X	NULL	
X};
X
XUBYTE tabgadSIBuff[3] =
X	"3";
Xstruct StringInfo tabgadSInfo = {
X	tabgadSIBuff,	
X	NULL,	
X	0,	
X	3,	
X	0,	
X	0,0,0,0,0,	
X	0,	
X	0,	
X	NULL	
X};
X#define tabstring tabgadSInfo.Buffer
XSHORT BorderVectors6[] = {
X	0,0,
X	32,0,
X	32,9,
X	0,9,
X	0,0
X};
Xstruct Border Border6 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors6,	
X	NULL	
X};
X#define TABGADGET 12L
Xstruct Gadget tabgad = {
X	&cfgad,	
X	68,113,	
X	31,8,	
X	NULL,	
X	RELVERIFY+STRINGRIGHT+LONGINT,	
X	STRGADGET,	
X	(APTR)&Border6,	
X	NULL,	
X	NULL,	
X	NULL,	
X	(APTR)&tabgadSInfo,	
X	12,	
X	NULL	
X};
X#define indstring indgadSInfo.Buffer
XUBYTE indgadSIBuff[3] =
X	"8";
Xstruct StringInfo indgadSInfo = {
X	indgadSIBuff,	
X	NULL,	
X	0,	
X	3,	
X	0,	
X	0,0,0,0,0,	
X	0,	
X	0,	
X	NULL	
X};
X
XSHORT BorderVectors7[] = {
X	0,0,
X	32,0,
X	32,9,
X	0,9,
X	0,0
X};
Xstruct Border Border7 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors7,	
X	NULL	
X};
X#define INDGADGET 333L
Xstruct Gadget indgad = {
X	&tabgad,	
X	68,102,	
X	31,8,	
X	NULL,	
X	RELVERIFY+STRINGRIGHT+LONGINT,	
X	STRGADGET,	
X	(APTR)&Border7,	
X	NULL,	
X	NULL,	
X	NULL,	
X	(APTR)&indgadSInfo,	
X	333,	
X	NULL	
X};
X
XSHORT BorderVectors8[] = {
X	0,0,
X	77,0,
X	77,15,
X	0,15,
X	0,0
X};
Xstruct Border Border8 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors8,	
X	NULL	
X};
X
X#define nopagenotext IText4
X#define pagenotext IText4_1
X
Xstruct IntuiText IText4 = {
X	3,0,JAM2,	
X	7,3,	
X	NULL,	
X	(UBYTE *)"NO PAGE#",	
X	NULL	
X};
Xstruct IntuiText IText4_1 = {
X	3,0,JAM2,	
X	7,3,	
X	NULL,	
X	(UBYTE *)"PAGE#   ",	
X	NULL	
X};
X#define PAGENOGADGET 120L
Xstruct Gadget pngad = {
X	&indgad,	
X	124,114,	
X	76,14,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&Border8,	
X	NULL,	
X	&IText4,	
X	NULL,	
X	NULL,	
X	120,	
X	NULL	
X};
X
XSHORT BorderVectors9[] = {
X	0,0,
X	77,0,
X	77,15,
X	0,15,
X	0,0
X};
Xstruct Border Border9 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors9,	
X	NULL	
X};
X
Xstruct IntuiText IText5 = {
X	3,0,JAM2,	
X	7,3,	
X	NULL,	
X	(UBYTE *)"NOISY",	
X	NULL	
X};
Xstruct IntuiText IText5_1 = {
X	3,0,JAM2,	
X	7,3,	
X	NULL,	
X	(UBYTE *)"QUIET",	
X	NULL	
X};
X
X#define NOISYGADGET  7L
X#define noisytext IText5
X#define quiettext IText5_1
X
Xstruct Gadget nogad = {
X	&pngad,	
X	124,93,	
X	76,14,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&Border9,	
X	NULL,	
X	&IText5,	
X	NULL,	
X	NULL,	
X	7,	
X	NULL	
X};
X
XSHORT BorderVectors10[] = {
X	0,0,
X	77,0,
X	77,15,
X	0,15,
X	0,0
X};
X
Xstruct Border Border10 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors10,	
X	NULL	
X};
X#define FILENAMEGADGET 6L
X#define nofilenametext IText6
X#define filenametext IText6_1
X
Xstruct IntuiText IText6 = {
X	3,0,JAM2,	
X	7,3,	
X	NULL,	
X	(UBYTE *)"NO FILEN",	
X	NULL	
X};
Xstruct IntuiText IText6_1 = {
X	3,0,JAM2,	
X	7,3,	
X	NULL,	
X	(UBYTE *)"FILENAME",	
X	NULL	
X};
X
Xstruct Gadget fngad = {
X	&nogad,	
X	125,71,	
X	76,14,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&Border10,	
X	NULL,	
X	&IText6,	
X	NULL,	
X	NULL,	
X	6,	
X	NULL	
X};
X
XSHORT BorderVectors11[] = {
X	0,0,
X	77,0,
X	77,15,
X	0,15,
X	0,0
X};
Xstruct Border Border11 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors11,	
X	NULL	
X};
X#define resettext  IText7
X#define noresettext IText7_1
X
Xstruct IntuiText IText7 = {
X	3,0,JAM2,	
X	7,3,	
X	NULL,	
X	(UBYTE *)"RESET   ",	
X	NULL	
X};
Xstruct IntuiText IText7_1 = {
X	3,0,JAM2,	
X	7,3,	
X	NULL,	
X	(UBYTE *)"NO RESET",	
X	NULL	
X};
X#define RESETGADGET 5L
Xstruct Gadget resgad = {
X	&fngad,	
X	124,49,	
X	76,14,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&Border11,	
X	NULL,	
X	&IText7,	
X	NULL,	
X	NULL,	
X	5,	
X	NULL	
X};
X
XSHORT BorderVectors12[] = {
X	0,0,
X	77,0,
X	77,15,
X	0,15,
X	0,0
X};
Xstruct Border Border12 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors12,	
X	NULL	
X};
X
Xstruct IntuiText IText8 = {
X	3,0,JAM2,	
X	7,3,	
X	NULL,	
X	(UBYTE *)"IBM FONT",	
X	NULL	
X};
Xstruct IntuiText IText8_1 = {
X	3,0,JAM2,	
X	7,3,	
X	NULL,	
X	(UBYTE *)"PLAIN   ",	
X	NULL	
X};
X
X#define nodont_transformtext IText8
X#define dont_transformtext IText8_1
X#define IBMGADGET 4L
X
Xstruct Gadget ibmgad = {
X	&resgad,	
X	123,28,	
X	76,14,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&Border12,	
X	NULL,	
X	&IText8,	
X	NULL,	
X	NULL,	
X	4,	
X	NULL	
X};
X
XSHORT BorderVectors13[] = {
X	0,0,
X	61,0,
X	61,15,
X	0,15,
X	0,0
X};
Xstruct Border Border13 = {
X	-1,-1,	
X	3,0,JAM2,	
X	5,	
X	BorderVectors13,	
X	NULL	
X};
X
Xstruct IntuiText IText9 = {
X	3,0,JAM2,	
X	9,3,	
X	NULL,	
X	(UBYTE *)"6 LPI",	
X	NULL	
X};
X
Xstruct IntuiText IText9_1 = {
X	3,0,JAM2,	
X	9,3,	
X	NULL,	
X	(UBYTE *)"8 LPI",	
X	NULL	
X};
X
X#define jammed_linestext IText9_1
X#define nojammed_linestext IText9
X#define LPIGADGET	3L
X
Xstruct Gadget lpigad = {
X	&ibmgad,	
X	26,84,	
X	60,14,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&Border13,	
X	NULL,	
X	&IText9,	
X	NULL,	
X	NULL,	
X	3,	
X	NULL	
X};
X
XSHORT BorderVectors14[] = {
X	0,0,
X	61,0,
X	61,15,
X	0,15,
X	0,0
X};
Xstruct Border Border14 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors14,	
X	NULL	
X};
X
Xstruct IntuiText IText10 = {
X	3,0,JAM2,	
X	10,3,	
X	NULL,	
X	(UBYTE *)"NLQ  ",	
X	NULL	
X};
Xstruct IntuiText IText10_1 = {
X	3,0,JAM2,	
X	10,3,	
X	NULL,	
X	(UBYTE *)"DRAFT",	
X	NULL	
X};
X#define NLQGADGET 2L
X#define nlqtext IText10
X#define nonlqtext IText10_1
X
Xstruct Gadget nlqgad = {
X	&lpigad,	
X	26,56,	
X	60,14,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&Border14,	
X	NULL,	
X	&IText10,	
X	NULL,	
X	NULL,	
X	2,	
X	NULL	
X};
X
XSHORT BorderVectors15[] = {
X	0,0,
X	61,0,
X	61,15,
X	0,15,
X	0,0
X};
Xstruct Border Border15 = {
X	-1,-1,	
X	3,0,JAM1,	
X	5,	
X	BorderVectors15,	
X	NULL	
X};
X
Xstruct IntuiText IText11 = {
X	3,0,JAM2,	
X	4,4,	
X	NULL,	
X	(UBYTE *)"12 CPI",	
X	NULL	
X};
X
Xstruct IntuiText IText11_1 = {
X	3,0,JAM2,	
X	4,4,	
X	NULL,	
X	(UBYTE *)"10 CPI",	
X	NULL	
X};
Xstruct IntuiText IText11_2 = {
X	3,0,JAM2,	
X	4,4,	
X	NULL,	
X	(UBYTE *)"15 CPI",	
X	NULL	
X};
X#define i15cpitext IText11_2
X#define i12cpitext IText11
X#define i10cpitext IText11_1
X#define CPIGADGET 150L
X
Xstruct Gadget cpigad = {
X	&nlqgad,	
X	26,26,	
X	60,14,	
X	NULL,	
X	RELVERIFY,	
X	BOOLGADGET,	
X	(APTR)&Border15,	
X	NULL,	
X	&IText11,	
X	NULL,	
X	NULL,	
X	150,	
X	NULL	
X};
X
X#define GadgetList1 cpigad
X
Xstruct IntuiText IText19 = {
X	2,1,JAM2,	
X	9,123,	
X	NULL,	
X	(UBYTE *)"Offset",	
X	NULL	
X};
X
Xstruct IntuiText IText18 = {
X	2,1,JAM2,	
X	228,25,	
X	NULL,	
X	(UBYTE *)"COMMAND FILE",	
X	&IText19	
X};
X
X
Xstruct IntuiText IText17 = {
X	2,1,JAM2,	
X	19,112,	
X	NULL,	
X	(UBYTE *)" Tabs",	
X	&IText18	
X};
X
Xstruct IntuiText IText16 = {
X	2,1,JAM2,	
X	10,102,	
X	NULL,	
X	(UBYTE *)"Indent",	
X	&IText17	
X};
X
Xstruct IntuiText IText15 = {
X	2,1,JAM2,	
X	129,15,	
X	NULL,	
X	(UBYTE *)"SWITCHES",	
X	&IText16	
X};
X
Xstruct IntuiText IText14 = {
X	2,1,JAM2,	
X	42,74,	
X	NULL,	
X	(UBYTE *)"LPI",	
X	&IText15	
X};
X
Xstruct IntuiText IText13 = {
X	2,1,JAM2,	
X	27,44,	
X	NULL,	
X	(UBYTE *)"QUALITY",	
X	&IText14	
X};
X
Xstruct IntuiText IText12 = {
X	2,1,JAM2,	
X	14,15,	
X	NULL,	
X	(UBYTE *)"PRINT STYLE",	
X	&IText13	
X};
X
X#define IntuiTextList1 IText12
X
Xstruct NewWindow printwindow = {
X	134,40,	
X	354,136,	
X	0,1,	
X	GADGETUP+REQSET+CLOSEWINDOW+REQVERIFY+REQCLEAR,	
X	WINDOWDRAG+WINDOWDEPTH+ACTIVATE+NOCAREREFRESH,	
X	&cpigad,	
X	NULL,	
X	(UBYTE *)"Print V1.5A (c) HooverSoft 1990",	
X	NULL,	
X	NULL,	
X	5,5,	
X	-1,-1,	
X	WBENCHSCREEN	
X};
X
X
END_OF_FILE
if test 11209 -ne `wc -c <'src/print.h'`; then
    echo shar: \"'src/print.h'\" unpacked with wrong size!
fi
# end of 'src/print.h'
fi
if test -f 'src/print15a.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/print15a.c'\"
else
echo shar: Extracting \"'src/print15a.c'\" \(12380 characters\)
sed "s/^X//" >'src/print15a.c' <<'END_OF_FILE'
X/* Print V1.5a
X	(C) HooverSoft 1990
X	Let's see if we can somehow tell the printer what we
X	really want...
X*/
X
X/* Includes that we need...*/
X
X#include <stdio.h>
X#include <time.h>
X#include <exec/types.h>
X
X
X
X
X#define  ESC			0x1B	/* escape sequence introducer */
X#define  NUL			0x00	/* Null character */
X#define  CEND			0xff  /* End of control sequence */
X#define  FS				0x1c  /* Another weird control char */
X
X#define LINE6HEIGHT	4L   /* "Height" of line in mm  */
X#define LINE8HEIGHT  3L
X#define SILENT		1L
X#define NOISY		0L
X#define  USA 		0L
X#define  GERMAN	2L
X#define  PLAIN		1L
X
X#define PRINTERNAME (UBYTE *) "PAR:"
X
X#define FILE_NOT_FOUND 1L
X#define  MAXFILES 20L
X#define  MAXCOMMANDS 15L
X
X#define ULLAFANFOLD 12L
X
Xstatic char *cnames[MAXCOMMANDS] =
X{
X	"set8lpi",
X	"underline",
X	"quiet",
X	"tencpi",
X	"twelvecpi",
X	"fiftcpi",
X	"lperpage",
X	"setquality",
X	"setdraft",
X	"neglinefeed",
X	"loud",
X	"resetprinter",
X	"changecharusa",
X	"changecharother",
X	"set6lpi"
X};
X
X/* Define Offsets for command table */
X#define SET8LPI			0L
X#define UNDERLINE   1L
X#define QUIET				2L
X#define TENCPI				3L
X#define TWELVECPI			4L
X#define FIFTCPI			5L
X#define LPERPAGE   		6L
X#define SETQUALITY 		7L
X#define SETDRAFT 			8L
X#define NEGLINEFEED  	9L
X#define LOUDNESS			10L
X#define RESETPRINTER		11L
X#define CHANGECHARUSA	12L
X#define CHANGECHAROTHER 13L
X#define SET6LPI			14L
X
X#define NOARG 0xff
X
Xstruct FILE  *infile, *printer, *cfile;
X
X
Xstatic UBYTE	ctable[MAXCOMMANDS][5] =
X{
X	ESC, '0',  CEND, NULL, NULL, /* set 8lpi mode */		
X  	ESC, '-', CEND, NULL, NULL, /* set underine */		
X	ESC, 's', SILENT,CEND, NULL, /* quiet print mode */
X	ESC, 'P', CEND, NULL,NULL,	  /* 10 CPI */
X	ESC, 'M', CEND, NULL, NULL,  /* 12 CPI */
X	ESC, 'g', CEND, NULL, NULL,  /* 15 CPI */
X	ESC, 'C',  CEND, NULL,NULL,  /* lines per page */
X	ESC, 'x', CEND,NULL, NULL,	  /* near letter printing quality */
X	ESC, 'x', NULL, CEND, NULL,  /* Print mode high speed draft */	
X	FS, 'R', CEND, NULL, NULL,   /* Negative form feed at end of printing */						 
X	ESC, 's', NOISY, CEND, NULL,  /* quiet print mode */
X	ESC, '@', CEND, NULL, NULL,  /* Full printer reset */	
X	ESC, 'R',  NULL, CEND, NULL, /* change national char set to USA */
X	ESC, 'R', CEND, NULL, NULL,    /* change nation char set to n */
X	ESC, '2', CEND, NULL, NULL   /* set 6lpi mode */
X};
X
Xlong i, indent = 8,  tabsize = 3, plength = 72, charset = 2;
Xchar	files[MAXFILES][80L]; 	/* Field to hold filenames */
Xlong howmany = 0; 			/* No. of Files to spool */
Xlong  verbose = 0;		   /* verbose option */ 
Xlong offset = 0;
X
Xlong BIGFONT, SMALLFONT, MEDFONT, FILENAMES, PAGENUMBERING;
Xlong LQ = 1L, LOUD=1L;
Xlong NOTUSA = 0L; 
Xlong FROM_WB = 0L;
Xlong HAVE_PRINTED_ONE = 0L, RESET = 1L, JAMMED_LINES = 0L;
Xlong OFFSET = 0L; 			/* Offset at printing of first file */
Xlong DONT_TRANSFORM = 0L;	/* char transformation */
Xlong pageno = 1L; /* number of current page being printed */
X
X
X/*
X	scan_file()
X	This is an attempt to write a parsing function that is able to
X	read commands into the UBYTE[][] array.
X	HooverSoft 1990
X	written Nov 5 1990 by hoover
X*/
X
Xlong scan_file(filename)
XUBYTE *filename;
X{
X
X	long val0, val1, val2, val3, val4;
X
X	register long i;
X
X	char cword[20];					/* place to keep lines of the file */	
X
X
X	cfile = (struct FILE *) fopen((UBYTE *) filename, "r");
X	if(!cfile)
X		{
X		SimpleRequest("OI, could not open command file!");
X		return(FILE_NOT_FOUND);
X		}
X
X	while( (fscanf(cfile,"%x %x %x %x %x %s", \
X				&val0,&val1,&val2,&val3,&val4,&cword) ) != EOF)
X		{
X
X
X	for(i=0; i<MAXCOMMANDS; i++)
X			{
X			if(strcmp(cword,cnames[i]) != 0)
X 				continue;
X
X			else
X				{
X				ctable[i][0] = (UBYTE) val0;
X				ctable[i][1] = (UBYTE) val1;
X				ctable[i][2] = (UBYTE) val2;
X				ctable[i][3] = (UBYTE) val3;
X				ctable[i][4] = (UBYTE) val4;
X				break;
X				}
X			}			
X		}
X	fclose(cfile);
X	return(0);
X	}
X
Xvoid PutCommand(which, what)
Xlong which;
Xlong what;
X
X{
X	long i = 0;
X	while( ctable[which][i] != CEND) /* Check for end of command */
X		{
X		fputc(ctable[which][i], printer); /* write sequence to file */
X		i++;										/* and increment counter */
X		}
X/* Now put the parameter into output file */
X	if(what != NOARG)
X		fputc(what, printer);
X	return;
X}
X
X
Xvoid init_printer()
X{
X/* Let's init the printer anyway */
X
X	printer = (struct FILE *)fopen(PRINTERNAME, "w");
X	if(!printer)
X		close_all("Could not open par:",1L);		
X
X	PutCommand( RESETPRINTER, NOARG);
X
X	if( plength == 72L || FROM_WB) /* plength not set or from wb */ 
X		{
X		if(JAMMED_LINES)
X			{
X			plength = ULLAFANFOLD * 8L;
X			PutCommand(SET8LPI, NOARG);
X			}
X
X			if(!JAMMED_LINES)
X			{
X			plength = ULLAFANFOLD * 6L;
X			PutCommand( SET6LPI, NOARG);
X			}
X		}
X
X
X		if(BIGFONT)
X			PutCommand(printer , TENCPI  , NOARG);
X
X		if(SMALLFONT)
X			PutCommand( FIFTCPI, NOARG);
X
X		if(MEDFONT)
X			PutCommand( TWELVECPI, NOARG);
X
X
X		if(!MEDFONT && !SMALLFONT && !BIGFONT )
X			PutCommand( TWELVECPI, NOARG);
X
X		if(LQ)
X			PutCommand( SETQUALITY, 1);
X		else
X			PutCommand( SETDRAFT, NOARG);	
X
X		if(!LOUD)
X			PutCommand( QUIET, NOARG);
X		else
X			PutCommand( LOUDNESS, NOARG);
X
X		if(NOTUSA)		/* USA not the the default char set? */
X			PutCommand( CHANGECHARUSA, 0);
X
X	return;
X	}
X
Xvoid clean_printer()
X{
X
X/* Let's clean up a bit */
X	PutCommand( NEGLINEFEED, 0L);
X	fputc('\n',printer); 
X	
X	if(NOTUSA)	/* did we change the national char set? */
X		PutCommand( CHANGECHAROTHER, charset);
X
X	if(RESET)
X		PutCommand( RESETPRINTER, NOARG);
X
X	return;
X	}
X
X/* makefootline coded oct 19th, 1990 by hoover
X	print out current pagenumber at bottom of page
X*/
X	
Xvoid makefootline()
X{
X
X	
X	fputc('\n', printer); /* skip one line */
X	fprintf(printer, "                                   -- %ld --\n", pageno);
X	pageno++;
X	return;
X}
X
X/* endpage coded on Oct 19th, 1990 by hoover
X	used to set up end of page according to
X	user specs
X*/
X
Xvoid endpage()
X{
X	long i;
X
X	if(PAGENUMBERING) 
X		{
X		makefootline();
X
X/* makefootline prints two cr's, so we're at line 70 when finished.
X	print four more two get to the bottom of the page, then two
X	more to leave a bit of space at top of page...
X	Remember to set pageno to 2 on return!
X*/
X		fprintf(printer,"\n\n\n\n");
X		return;
X		}
X	else
X		{
X/*	if we want no pagenumbering, we're at line 68 when this is
X	called. All we've got to do is to print out 6 cr's to get
X	to the next page...
X*/
X		fprintf(printer,"\n\n\n\n\n\n");
X		return;
X		}
X	}
X
X/* coded 2 Nov 1990
X	indents line  by indent amount for printing
X	written by hoover
X*/
Xvoid indent_line(indent)
Xlong indent;	/* number of spaces to indent */
X{
X	long count;
X
X	for(count=0; count <indent; count++)
X		fputc(' ', printer);		
X
X	return;
X}
X
X/* stolen from HooverSoft's Tarif program...
X	Let's hope that it works as advertised!
X	coded god knows when by hoover
X*/
X
XUBYTE *get_time()
X{
X   long  mytime = 0L ;
X   long  *store; 
X
X   mytime = time(store);
X	return  ( (UBYTE *)ctime(store) );
X
X}
X
Xextern void inprint();
X
Xvoid print_file(name)
XUBYTE *name;
X{
X	register long c; 
X	long count, lineno;
X
X	lineno = (HAVE_PRINTED_ONE) ? 2 : 1;
X
X
X	if(!HAVE_PRINTED_ONE && OFFSET) /* first file and offset specified */
X		{
X		if(JAMMED_LINES)
X			lineno = (ULONG) (offset / LINE8HEIGHT) ;
X		else
X			lineno = (ULONG) (offset / LINE6HEIGHT);
X
X		}			
X
X	infile = (struct FILE *)fopen(name, "r");
X	if(!infile)
X		{
X		SimpleRequest("Can't open print file!");
X		goto bye;
X		}
X		HAVE_PRINTED_ONE = 1;
X/* We've printed a file, so let's tell the program so it will
X	will be able to figure out on which lineno it is.
X*/
X
X
X/* Indent first line printed */
X
X	indent_line(indent);
X
X	if(FILENAMES)
X		{
X		lineno++;
X		PutCommand( UNDERLINE, 1L);
X		fprintf(printer, "Filename: %s  printed on %s\n",\
X		name, get_time());
X		PutCommand( UNDERLINE, 0L);
X		indent_line(indent);
X		}
X
X
X
X	while( ( c = fgetc(infile) ) != EOF)
X		{
X		if(verbose)
X			putchar(c);
X
X		if(c == '\n')
X			{
X			fputc(c, printer);
X			lineno++;
X			if(lineno ==  plength-4 )
X				{
X				endpage();
X				lineno =   2; /* endpage will get to line #2 of new page */
X				}
X
X			indent_line(indent);
X			continue;
X			}
X/* convert tabs */
X
X		if(c == '\t')
X			{
X			for(count = 0; count < tabsize; count++)
X				fputc(' ',printer);
X			continue; 
X			}
X
X		if(!DONT_TRANSFORM)
X			switch(c)
X				{
X				case 0xe4:	c=0x84; /* an ae */
X							break;
X				case 0xf6:	c=0x94; /* an oe */
X							break;
X				case 0xfc:  c=0x81; /* an ue */
X							break;
X				case 0xdf:	c=0xe1; /* an sz */
X							break;
X				case 0xc4:  c=0x8e;  /* an Ae */
X							break;
X				case 0xd6:	c=0x99; /* an Oe */
X							break;
X				case 0xdc:	c=0x9a; /* an Ue */
X							break;
X            case 0xbd:  c=0xab; /* 1/2 */
X  	                     break;
X				case 0xa9:	c=0xe9;	/* sorry, no (C) in IBM font */
X												/* currently mapped to \Theta */
X								break;
X
X				case 0xb2:	c=0xfd;	/* superscript 2 */
X								break;
X
X
X				case 0xa2:  c=0x9b;   /* cent */
X								break;
X				case 0xc5:	c=0x8f;   /* A(degree) */
X									break;
X	
X				case 0xb0:	c=0xf8;   /* degree */
X								break;
X
X				case 0xc:	c=' '; /* Kill form feeds */
X									break;
X				}	/* end switch */
X			fputc(c, printer);
X		}	/* end while */ 		
X/* Printing of file finished */
X#ifdef DEBUG1.5
X		printf("Closing input file.\n");
X#endif
X		fclose(infile);
X
X/* Now we've got to 'emit' cr's till we're at the bottom of the
X	page. After endpage has been called, we'll be at line two of
X	the new page.
X*/
X
X		for( ; lineno < plength-4; lineno++)
X			fputc('\n', printer);
X
X		endpage();
X		pageno = 1;						/* Reset current page counter */
Xbye:
X	fclose(printer);
X
X	return;
X	}/* end print_file */
X
Xvoid main(argc, argv)
Xlong argc;
Xchar *argv[];
X
X{
X	
X	BIGFONT =  SMALLFONT  = FILENAMES = PAGENUMBERING = 0;
X	MEDFONT = 1L;
X	
X	open_all();
X
X
X	if(argc == 1 || argc <= 0)  /* test for workbench launch */
X		{
X		FROM_WB = 1L;
X		inprint(); 					 /* if so, call IntuiInterface */
X		}
X
X	printf("         ******************************************************\n");
X	printf("                    Print V1.5A (c) HooverSoft 1990\n");
X	printf("                     \033[33mfor the NEC PinWriter Series \033[0m\n");
X	printf("         Freely distributable for non-commercial purposes only.\n");
X	printf("                       type 'print h' for help.\n");
X	printf("         ******************************************************\n");
X
X/* test to see if user needs our help */
X
X	if(argc == 2 && *argv[1] == 'h')
X		help();
X
X	for(i=1; i< argc; i++)
X		{
X
X
X		if( (char) argv[i][0] == '-')	     /* is it option qualifier? */
X			switch( argv[i][1]  ) 		/* then scan character after it */
X				{
X				long error = 0L;
X
X				case 't':	tabsize = atoi(argv[i+1]);
X								tabsize = (tabsize < 1 || tabsize > 16) ? 3 : tabsize;
X								i++;
X								break;
X
X				case 'u':	NOTUSA = 1;
X								charset = atoi(argv[i+1]);
X								charset = (charset < 0 || charset > 14) ? 2 : charset;
X								i++;
X								break;
X
X				case 'i':	indent  = atoi(argv[i+1]);
X								indent  = (indent < 1 || indent > 30) ? 8 : indent; 
X								i++;
X								break;
X
X				case 'l':	plength = atoi(argv[i+1]);
X								plength = (plength < 1 || plength > 100)  ? 72 : plength; 
X								i++;
X 								break;
X
X				case 'f':   error = scan_file( (UBYTE *) argv[i+1]);
X								if(error == FILE_NOT_FOUND)
X									close_all("",0);
X								if(error)
X									close_all("Error in Command File!",1L);
X								i++;
X								break;
X
X				case 'o':	offset = atoi(argv[i+1]);
X								OFFSET = 1L;
X								offset = (offset < 1 || offset > 300)  ? 60L : offset; 
X								i++;
X								break;
X
X				case 'V':	verbose = 1L;
X								break;
X
X				case 'B':	BIGFONT = 1L;
X								break;
X	
X				case 'M':	MEDFONT = 1L;
X								break;
X
X				case 'P':	PAGENUMBERING = 1L;
X								break;
X
X				case 'S':	SMALLFONT = 1L;
X								break;
X
X				case 'T':	DONT_TRANSFORM = 1L;
X								break;
X
X				case 'F':   FILENAMES = 1L;
X								break;
X
X				case 'Q':	LQ = 1;
X								break;
X	
X				case 'R':	RESET = 0;
X								break;
X
X				case 'D':	LQ = 0;
X								break;
X
X				case 'N':	LOUD = 0L;
X								break;
X
X				case '8':	JAMMED_LINES = 1L;
X								break;
X
X				case default :	printf("Unknown option -%c\n", argv[i][1]);
X									i++;
X									break; 
X  
X				} 	/* end switch */
X		else									/* no qualifier? Then regard as file */
X			{
X			strcpy(files[howmany], (UBYTE *) argv[i]);
X			howmany++;
X			}
X		}			/* end for */
X
X
X	if(howmany > MAXFILES)
X		close_all("Too many files!",1L);
X
X
X	init_printer();
X
X	for(i = 0; i < howmany; i++)
X		print_file(files[i]);
X
X	clean_printer();			/* end for () */
X
X	close_all("",0L);
X	}				/* end main() */
END_OF_FILE
if test 12380 -ne `wc -c <'src/print15a.c'`; then
    echo shar: \"'src/print15a.c'\" unpacked with wrong size!
fi
# end of 'src/print15a.c'
fi
echo shar: End of archive 1 \(of 3\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 3 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
Mail comments to the moderator at <amiga-request@uunet.uu.net>.
Post requests for sources, and general discussion to comp.sys.amiga.misc.