PD plot(4) librarys (and hercules driver for interactive 386) part 1 of 9
Roland van Hout
hot at integow.uucp
Sun Oct 28 14:51:39 AEST 1990
#!/bin/sh
# This is a shell archive (shar 3.21)
# made 10/26/1990 17:46 UTC by root at hot
# Source directory /u/pd/drivers/hercules
#
# existing files WILL be overwritten
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 172 -rw-r--r-- libplot/herc/README
# 1067 -rw-rw-rw- libplot/herc/herc.mk
# 19383 -rw-rw-rw- libplot/herc/libherc.c
# 1000 -rw-r--r-- libplot/ReGIS/ReGIS.mk
# 4002 -rw-r--r-- libplot/ReGIS/libReGIS.c
# 378 -rw-r--r-- libplot/hpgl/Makefile
# 572 -rw-r--r-- libplot/hpgl/README
# 737 -rw-r--r-- libplot/hpgl/arc.c
# 174 -rw-r--r-- libplot/hpgl/box.c
# 278 -rw-r--r-- libplot/hpgl/circle.c
# 168 -rw-r--r-- libplot/hpgl/close.c
# 92 -rw-r--r-- libplot/hpgl/cont.c
# 25 -rw-r--r-- libplot/hpgl/dot.c
# 27 -rw-r--r-- libplot/hpgl/erase.c
# 1323 -rw-r--r-- libplot/hpgl/hpglchord.c
# 163 -rw-r--r-- libplot/hpgl/label.c
# 111 -rw-r--r-- libplot/hpgl/line.c
# 413 -rw-r--r-- libplot/hpgl/linmod.c
# 91 -rw-r--r-- libplot/hpgl/move.c
# 110 -rw-r--r-- libplot/hpgl/onoff.c
# 429 -rw-r--r-- libplot/hpgl/open.c
# 44 -rw-r--r-- libplot/hpgl/point.c
# 1198 -rw-r--r-- libplot/hpgl/space.c
# 1799 -rw-r--r-- libplot/lp/Makefile
# 11475 -rw-r--r-- libplot/lp/charset.0
# 1407 -rw-r--r-- libplot/lp/circle.c
# 951 -rw-r--r-- libplot/lp/const.h
# 346 -rw-r--r-- libplot/lp/dbgvars.h
# 5595 -rw-r--r-- libplot/lp/ep_map.c
# 975 -rw-r--r-- libplot/lp/fillcnst.h
# 700 -rw-r--r-- libplot/lp/fillvars.h
# 4616 -rw-r--r-- libplot/lp/ib_map.c
# 879 -rw-r--r-- libplot/lp/itoa.h
# 939 -rw-r--r-- libplot/lp/label.c
# 4267 -rw-r--r-- libplot/lp/liblj.c
# 399 -rw-r--r-- libplot/lp/linemod.c
# 9092 -rw-r--r-- libplot/lp/lj_map.c
# 1200 -rw-r--r-- libplot/lp/maps.c
# 2718 -rw-r--r-- libplot/lp/move.c
# 2082 -rw-r--r-- libplot/lp/openpl.c
# 2788 -rw-r--r-- libplot/lp/plot_cha.c
# 2173 -rw-r--r-- libplot/lp/plotlp.h
# 885 -rw-r--r-- libplot/lp/plotlpus.h
# 1389 -rw-r--r-- libplot/lp/set_dbgs.c
# 830 -rw-r--r-- libplot/lp/vars.h
# 1519 -rw-r--r-- libplot/lp/README
# 652 -rw-r--r-- libplot/lp/README2
# 364 -rw-r--r-- libplot/sun/Makefile
# 756 -rw-r--r-- libplot/sun/README
# 4672 -rw-r--r-- libplot/sun/sunplot.1
# 19634 -rw-r--r-- libplot/sun/sunplot.c
# 1933 -rw-r--r-- libplot/sun/sunplot.icon
# 119 -rw-rw-rw- libplot/cgi/CGI.h
# 1343 -rw-rw-rw- libplot/cgi/CGI.mk
# 6196 -rw-rw-rw- libplot/cgi/libCGI.c
# 199 -rw-r--r-- libplot/cgi/README
# 627 -rw-rw-rw- libplot/cgi/h.c
# 2654 -rw-r--r-- lp.c
# 658 -rw-r--r-- herc/Makefile
# 1086 -rw-r--r-- herc/bitset.h
# 121 -rw-r--r-- herc/config
# 10419 -rw-r--r-- herc/herc.c
# 6396 -rw-r--r-- herc/herc.h
# 1690 -rw-r--r-- herc/test.c
# 14 -rw-r--r-- herc/ix386/n_herc
# 23 -rw-r--r-- herc/ix386/s_herc
# 156 -rw-r--r-- herc/ix386/mdevice
# 253 -rw-r--r-- herc/ix386/README
# 3061 -rw-r--r-- README
# 4963 -rw-r--r-- plot.c
# 5349 -rw-r--r-- lpdriver.c
# 584 -rw-r--r-- makefile
# 1115 -rw-r--r-- tplot.sh
# 885 -rw-r--r-- plotlpus.h
# 5283 -rw-r--r-- driver.c
#
if touch 2>&1 | fgrep '[-amc]' > /dev/null
then TOUCH=touch
else TOUCH=true
fi
# ============= libplot/herc/README ==============
if test ! -d 'libplot'; then
echo "x - creating directory libplot"
mkdir 'libplot'
fi
if test ! -d 'libplot/herc'; then
echo "x - creating directory libplot/herc"
mkdir 'libplot/herc'
fi
echo "x - extracting libplot/herc/README (Text)"
sed 's/^X//' << 'SHAR_EOF' > libplot/herc/README &&
Xthe libherc.c is the plot(3) library
Xyou have to copy the herc.h file of the 286 or the 386 to /usr/include/sys
XDefine the correct define for or the 286 or the 386 driver.
SHAR_EOF
$TOUCH -am 1014202690 libplot/herc/README &&
chmod 0644 libplot/herc/README ||
echo "restore of libplot/herc/README failed"
set `wc -c libplot/herc/README`;Wc_c=$1
if test "$Wc_c" != "172"; then
echo original size 172, current size $Wc_c
fi
# ============= libplot/herc/herc.mk ==============
echo "x - extracting libplot/herc/herc.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > libplot/herc/herc.mk &&
X# SCCS: @(#)therc.mk 5.1
X
XOWN= bin #file owner
XGRP= bin #file group
XPROT= 664 #protections
X#define UPORT286 if you will use the V.2 driver
X
XINSDIR = /usr/lib
XTESTDIR = .
XCFLAGS = -O -DIX386
XSOURCE = libherc.c
XOFILES = libherc.o
XMAKE = make
X
Xall: libherc.a
X :
X
Xlibherc.a: $(OFILES)
X chmod $(PROT) $(OFILES)
X chgrp $(GRP) $(OFILES)
X chown $(OWN) $(OFILES)
X ar r $(TESTDIR)/libherc.a $(OFILES)
X
Xinstall: all save move
X
Xclean:
X -rm -f $(OFILES)
X
Xclobber: clean
X -rm -f $(TESTDIR)/libherc.a
X
Xdelete: clobber
X rm -f $(SOURCE)
X
Xmove:
X -rm -f $(INSDIR)/libherc.a
X cp $(TESTDIR)/libherc.a $(INSDIR)/libherc.a
X chmod $(PROT) $(INSDIR)/libherc.a
X chmod -x $(INSDIR)/libherc.a # not executable
X chgrp $(GRP) $(INSDIR)/libherc.a
X chown $(OWN) $(INSDIR)/libherc.a
X
Xsave:
X -if test -f $(INSDIR)/libherc.a ; \
X then \
X rm -f $(INSDIR)/OLDlibherc.a ; \
X cp $(INSDIR)/libherc.a $(INSDIR)/OLDlibherc.a ; \
X chmod $(PROT) $(INSDIR)/OLDlibherc.a ; \
X chmod -x $(INSDIR)/OLDlibherc.a ; \
X chgrp $(GRP) $(INSDIR)/OLDlibherc.a ; \
X chown $(OWN) $(INSDIR)/OLDlibherc.a ; \
X fi
SHAR_EOF
$TOUCH -am 1014202490 libplot/herc/herc.mk &&
chmod 0666 libplot/herc/herc.mk ||
echo "restore of libplot/herc/herc.mk failed"
set `wc -c libplot/herc/herc.mk`;Wc_c=$1
if test "$Wc_c" != "1067"; then
echo original size 1067, current size $Wc_c
fi
# ============= libplot/herc/libherc.c ==============
echo "x - extracting libplot/herc/libherc.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > libplot/herc/libherc.c &&
X
X/* plot(4) graphics library for a hercules graphic card under unix
X with the microport hercules driver in the system
X all the primitives are drawn with ioctl calls */
X
Xfloat gxscrunch,gyscrunch;
Xfloat pitograd;
Xint hercoffx,hercoffy;
X
X# include <stdio.h>
X/*# include <fcntl.h>*/
X# include <sys/herc.h>
X# include <math.h>
X
X/* Zeichensatz , IBM kompatibel */
X
Xchar font[256][8] = { { 0, 0, 0, 0, 0, 0, 0, 0 }, /* 0 */
X { 126,129,165,129,189,153,129,126 }, /* 1 */
X { 126,255,219,255,195,231,255,126 }, /* 2 */
X { 108,254,254,254,124, 56, 16, 0 }, /* 3 */
X { 16, 56,124,254,124, 56, 16, 0 }, /* 4 */
X { 56,124, 56,254,254,124, 56,124 }, /* 5 */
X { 16, 16, 56,124,254,124, 56,124 }, /* 6 */
X { 0, 0, 24, 60, 60, 24, 0, 0 }, /* 7 */
X { 255,255,231,195,195,231,255,255 }, /* 8 */
X { 0, 60,102, 66, 66,102, 60, 0 }, /* 9 */
X { 255,195,153,189,189,153,195,255 }, /* 10 */
X { 15, 7, 15,125,204,204,204,120 }, /* 11 */
X { 60,102,102,102, 60, 24,126, 24 }, /* 12 */
X { 63, 51, 63, 48, 48,112,240,224 }, /* 13 */
X { 127, 99,127, 99, 99,103,230,192 }, /* 14 */
X { 153, 90, 60,231,231, 60, 90,153 }, /* 15 */
X { 128,224,248,254,248,224,128, 0 }, /* 16 */
X { 2, 14, 62,254, 62, 14, 2, 0 }, /* 17 */
X { 24, 60,126, 24, 24,126, 60, 24 }, /* 18 */
X { 102,102,102,102,102, 0,102, 0 }, /* 19 */
X { 127,219,219,123, 27, 27, 27, 0 }, /* 20 */
X { 62, 99, 56,108,108, 56,204,120 }, /* 21 */
X { 0, 0, 0, 0,126,126,126, 0 }, /* 22 */
X { 24, 60,126, 24,126, 60, 24,255 }, /* 23 */
X { 24, 60,126, 24, 24, 24, 24, 0 }, /* 24 */
X { 24, 24, 24, 24,126, 60, 24, 0 }, /* 25 */
X { 0, 24, 12,254, 12, 24, 0, 0 }, /* 26 */
X { 0, 48, 96,254, 96, 48, 0, 0 }, /* 27 */
X { 0, 0,192,192,192,254, 0, 0 }, /* 28 */
X { 0, 36,102,255,102, 36, 0, 0 }, /* 29 */
X { 0, 24, 60,126,255,255, 0, 0 }, /* 30 */
X { 0,255,255,126, 60, 24, 0, 0 }, /* 31 */
X { 0, 0, 0, 0, 0, 0, 0, 0 }, /* 32 */
X { 48,120,120, 48, 48, 0, 48, 0 }, /* 33 */
X { 108,108,108, 0, 0, 0, 0, 0 }, /* 34 */
X { 108,108,254,108,254,108,108, 0 }, /* 35 */
X { 48,124,192,120, 12,248, 48, 0 }, /* 36 */
X { 0,198,204, 24, 48,102,198, 0 }, /* 37 */
X { 56,108, 56,118,220,204,118, 0 }, /* 38 */
X { 96, 96,192, 0, 0, 0, 0, 0 }, /* 39 */
X { 24, 48, 96, 96, 96, 48, 24, 0 }, /* 40 */
X { 96, 48, 24, 24, 24, 48, 96, 0 }, /* 41 */
X { 0,102, 60,255, 60,102, 0, 0 }, /* 42 */
X { 0, 48, 48,252, 48, 48, 0, 0 }, /* 43 */
X { 0, 0, 0, 0, 0, 48, 48, 96 }, /* 44 */
X { 0, 0, 0,252, 0, 0, 0, 0 }, /* 45 */
X { 0, 0, 0, 0, 0, 48, 48, 0 }, /* 46 */
X { 6, 12, 24, 48, 96,192,128, 0 }, /* 47 */
X { 124,198,206,222,246,230,124, 0 }, /* 48 */
X { 48,112, 48, 48, 48, 48,252, 0 }, /* 49 */
X { 120,204, 12, 56, 96,204,252, 0 }, /* 50 */
X { 120,204, 12, 56, 12,204,120, 0 }, /* 51 */
X { 28, 60,108,204,254, 12, 30, 0 }, /* 52 */
X { 252,192,248, 12, 12,204,120, 0 }, /* 53 */
X { 56, 96,192,248,204,204,120, 0 }, /* 54 */
X { 252,204, 12, 24, 48, 48, 48, 0 }, /* 55 */
X { 120,204,204,120,204,204,120, 0 }, /* 56 */
X { 120,204,204,124, 12, 24,112, 0 }, /* 57 */
X { 0, 48, 48, 0, 0, 48, 48, 0 }, /* 58 */
X { 0, 48, 48, 0, 0, 48, 48, 96 }, /* 59 */
X { 24, 48, 96,192, 96, 48, 24, 0 }, /* 60 */
X { 0, 0,252, 0, 0,252, 0, 0 }, /* 61 */
X { 96, 48, 24, 12, 24, 48, 96, 0 }, /* 62 */
X { 120,204, 12, 24, 48, 0, 48, 0 }, /* 63 */
X { 124,198,222,222,222,192,120, 0 }, /* 64 */
X { 48,120,204,204,252,204,204, 0 }, /* 65 */
X { 252,102,102,124,102,102,252, 0 }, /* 66 */
X { 60,102,192,192,192,102, 60, 0 }, /* 67 */
X { 248,108,102,102,102,108,248, 0 }, /* 68 */
X { 254, 98,104,120,104, 98,254, 0 }, /* 69 */
X { 254, 98,104,120,104, 96,240, 0 }, /* 70 */
X { 60,102,192,192,206,102, 62, 0 }, /* 71 */
X { 204,204,204,252,204,204,204, 0 }, /* 72 */
X { 120, 48, 48, 48, 48, 48,120, 0 }, /* 73 */
X { 30, 12, 12, 12,204,204,120, 0 }, /* 74 */
X { 230,102,108,120,108,102,230, 0 }, /* 75 */
X { 240, 96, 96, 96, 98,102,254, 0 }, /* 76 */
X { 198,238,254,254,214,198,198, 0 }, /* 77 */
X { 198,230,246,222,206,198,198, 0 }, /* 78 */
X { 56,108,198,198,198,108, 56, 0 }, /* 79 */
X { 252,102,102,124, 96, 96,240, 0 }, /* 80 */
X { 120,204,204,204,220,120, 28, 0 }, /* 81 */
X { 252,102,102,124,108,102,230, 0 }, /* 82 */
X { 120,204,224,112, 28,204,120, 0 }, /* 83 */
X { 252,180, 48, 48, 48, 48,120, 0 }, /* 84 */
X { 204,204,204,204,204,204,252, 0 }, /* 85 */
X { 204,204,204,204,204,120, 48, 0 }, /* 86 */
X { 198,198,198,214,254,238,198, 0 }, /* 87 */
X { 198,198,108, 56, 56,108,198, 0 }, /* 88 */
X { 204,204,204,120, 48, 48,120, 0 }, /* 89 */
X { 254,198,140, 24, 50,102,254, 0 }, /* 90 */
X { 120, 96, 96, 96, 96, 96,120, 0 }, /* 91 */
X { 192, 96, 48, 24, 12, 6, 2, 0 }, /* 92 */
X { 120, 24, 24, 24, 24, 24,120, 0 }, /* 93 */
X { 16, 56,108,198, 0, 0, 0, 0 }, /* 94 */
X { 0, 0, 0, 0, 0, 0, 0,255 }, /* 95 */
X { 48, 48, 24, 0, 0, 0, 0, 0 }, /* 96 */
X { 0, 0,120, 12,124,204,118, 0 }, /* 97 */
X { 224, 96, 96,124,102,102,220, 0 }, /* 98 */
X { 0, 0,120,204,192,204,120, 0 }, /* 99 */
X { 28, 12, 12,124,204,204,118, 0 }, /* 100 */
X { 0, 0,120,204,252,192,120, 0 }, /* 101 */
X { 56,108, 96,240, 96, 96,240, 0 }, /* 102 */
X { 0, 0,118,204,204,124, 12,248 }, /* 103 */
X { 224, 96,108,118,102,102,230, 0 }, /* 104 */
X { 48, 0,112, 48, 48, 48,120, 0 }, /* 105 */
X { 12, 0, 12, 12, 12,204,204,120 }, /* 106 */
X { 224, 96,102,108,120,108,230, 0 }, /* 107 */
X { 112, 48, 48, 48, 48, 48,120, 0 }, /* 108 */
X { 0, 0,204,254,254,214,198, 0 }, /* 109 */
X { 0, 0,248,204,204,204,204, 0 }, /* 110 */
X { 0, 0,120,204,204,204,120, 0 }, /* 111 */
X { 0, 0,220,102,102,124, 96,240 }, /* 112 */
X { 0, 0,118,204,204,124, 12, 30 }, /* 113 */
X { 0, 0,220,118,102, 96,240, 0 }, /* 114 */
X { 0, 0,124,192,120, 12,248, 0 }, /* 115 */
X { 16, 48,124, 48, 48, 52, 24, 0 }, /* 116 */
X { 0, 0,204,204,204,204,118, 0 }, /* 117 */
X { 0, 0,204,204,204,120, 48, 0 }, /* 118 */
X { 0, 0,198,214,254,254,108, 0 }, /* 119 */
X { 0, 0,198,108, 56,108,198, 0 }, /* 120 */
X { 0, 0,204,204,204,124, 12,248 }, /* 121 */
X { 0, 0,252,152, 48,100,252, 0 }, /* 122 */
X { 28, 48, 48,224, 48, 48, 28, 0 }, /* 123 */
X { 24, 24, 24, 0, 24, 24, 24, 0 }, /* 124 */
X { 224, 48, 48, 28, 48, 48,224, 0 }, /* 125 */
X { 118,220, 0, 0, 0, 0, 0, 0 }, /* 126 */
X { 0, 16, 56,108,198,198,254, 0 }, /* 127 */
X { 60,102, 96,102, 60, 12, 6, 60 }, /* 128 */
X { 0,102, 0,102,102,102, 63, 0 }, /* 129 */
X { 14, 0, 60,102,126, 96, 60, 0 }, /* 130 */
X { 126,195, 60, 6, 62,102, 63, 0 }, /* 131 */
X { 102, 0, 60, 6, 62,102, 63, 0 }, /* 132 */
X { 112, 0, 60, 6, 62,102, 63, 0 }, /* 133 */
X { 24, 24, 60, 6, 62,102, 63, 0 }, /* 134 */
X { 0, 0, 60, 96, 96, 60, 6, 28 }, /* 135 */
X { 126,195, 60,102,126, 96, 60, 0 }, /* 136 */
X { 102, 0, 60,102,126, 96, 60, 0 }, /* 137 */
X { 112, 0, 60,102,126, 96, 60, 0 }, /* 138 */
X { 102, 0, 56, 24, 24, 24, 60, 0 }, /* 139 */
X { 124,198, 56, 24, 24, 24, 60, 0 }, /* 140 */
X { 112, 0, 56, 24, 24, 24, 60, 0 }, /* 141 */
X { 99, 28, 54, 99,127, 99, 99, 0 }, /* 142 */
X { 24, 24, 0, 60,102,126,102, 0 }, /* 143 */
X { 14, 0,126, 48, 60, 48,126, 0 }, /* 144 */
X { 0, 0,127, 12,127,204,127, 0 }, /* 145 */
X { 31, 54,102,127,102,102,103, 0 }, /* 146 */
X { 60,102, 0, 60,102,102, 60, 0 }, /* 147 */
X { 0,102, 0, 60,102,102, 60, 0 }, /* 148 */
X { 0,112, 0, 60,102,102, 60, 0 }, /* 149 */
X { 60,102, 0,102,102,102, 63, 0 }, /* 150 */
X { 0,112, 0,102,102,102, 63, 0 }, /* 151 */
X { 0,102, 0,102,102, 62, 6,124 }, /* 152 */
X { 195, 24, 60,102,102, 60, 24, 0 }, /* 153 */
X { 102, 0,102,102,102,102, 60, 0 }, /* 154 */
X { 24, 24,126,192,192,126, 24, 24 }, /* 155 */
X { 28, 54, 50,120, 48,115,126, 0 }, /* 156 */
X { 102,102, 60,126, 24,126, 24, 24 }, /* 157 */
X { 248,204,204,250,198,207,198,199 }, /* 158 */
X { 14, 27, 24, 60, 24, 24,216,112 }, /* 159 */
X { 14, 0, 60, 6, 62,102, 63, 0 }, /* 160 */
X { 28, 0, 56, 24, 24, 24, 60, 0 }, /* 161 */
X { 0, 14, 0, 60,102,102, 60, 0 }, /* 162 */
X { 0, 14, 0,102,102,102, 63, 0 }, /* 163 */
X { 0,124, 0,124,102,102,102, 0 }, /* 164 */
X { 126, 0,102,118,126,110,102, 0 }, /* 165 */
X { 60,108,108, 62, 0,126, 0, 0 }, /* 166 */
X { 56,108,108, 56, 0,124, 0, 0 }, /* 167 */
X { 24, 0, 24, 48, 96,102, 60, 0 }, /* 168 */
X { 0, 0, 0,126, 96, 96, 0, 0 }, /* 169 */
X { 0, 0, 0,126, 6, 6, 0, 0 }, /* 170 */
X { 195,198,204,222, 51,102,204, 15 }, /* 171 */
X { 195,198,204,219, 55,111,207, 3 }, /* 172 */
X { 24, 24, 0, 24, 24, 24, 24, 0 }, /* 173 */
X { 0, 51,102,204,102, 51, 0, 0 }, /* 174 */
X { 0,204,102, 51,102,204, 0, 0 }, /* 175 */
X { 34,136, 34,136, 34,136, 34,136 }, /* 176 */
X { 85,170, 85,170, 85,170, 85,170 }, /* 177 */
X { 219,119,219,238,219,119,219,238 }, /* 178 */
X { 24, 24, 24, 24, 24, 24, 24, 24 }, /* 179 */
X { 24, 24, 24, 24,248, 24, 24, 24 }, /* 180 */
X { 24, 24,248, 24,248, 24, 24, 24 }, /* 181 */
X { 54, 54, 54, 54,246, 54, 54, 54 }, /* 182 */
X { 0, 0, 0, 0,254, 54, 54, 54 }, /* 183 */
X { 0, 0,248, 24,248, 24, 24, 24 }, /* 184 */
X { 54, 54,246, 6,246, 54, 54, 54 }, /* 185 */
X { 54, 54, 54, 54, 54, 54, 54, 54 }, /* 186 */
X { 0, 0,254, 6,246, 54, 54, 54 }, /* 187 */
X { 54, 54,246, 6,254, 0, 0, 0 }, /* 188 */
X { 54, 54, 54, 54,254, 0, 0, 0 }, /* 189 */
X { 24, 24,248, 24,248, 0, 0, 0 }, /* 190 */
X { 0, 0, 0, 0,248, 24, 24, 24 }, /* 191 */
X { 24, 24, 24, 24, 31, 0, 0, 0 }, /* 192 */
X { 24, 24, 24, 24,255, 0, 0, 0 }, /* 193 */
X { 0, 0, 0, 0,255, 24, 24, 24 }, /* 194 */
X { 24, 24, 24, 24, 31, 24, 24, 24 }, /* 195 */
X { 0, 0, 0, 0,255, 0, 0, 0 }, /* 196 */
X { 24, 24, 24, 24,255, 24, 24, 24 }, /* 197 */
X { 24, 24, 31, 24, 31, 24, 24, 24 }, /* 198 */
X { 54, 54, 54, 54, 55, 54, 54, 54 }, /* 199 */
X { 54, 54, 55, 48, 63, 0, 0, 0 }, /* 200 */
X { 0, 0, 63, 48, 55, 54, 54, 54 }, /* 201 */
X { 54, 54,247, 0,255, 0, 0, 0 }, /* 202 */
X { 0, 0,255, 0,247, 54, 54, 54 }, /* 203 */
X { 54, 54, 55, 48, 55, 54, 54, 54 }, /* 204 */
X { 0, 0,255, 0,255, 0, 0, 0 }, /* 205 */
X { 54, 54,247, 0,247, 54, 54, 54 }, /* 206 */
X { 24, 24,255, 0,255, 0, 0, 0 }, /* 207 */
X { 54, 54, 54, 54,255, 0, 0, 0 }, /* 208 */
X { 0, 0,255, 0,255, 24, 24, 24 }, /* 209 */
X { 0, 0, 0, 0,255, 54, 54, 54 }, /* 210 */
X { 54, 54, 54, 54, 63, 0, 0, 0 }, /* 211 */
X { 24, 24, 31, 24, 31, 0, 0, 0 }, /* 212 */
X { 0, 0, 31, 24, 31, 24, 24, 24 }, /* 213 */
X { 0, 0, 0, 0, 63, 54, 54, 54 }, /* 214 */
X { 54, 54, 54, 54,255, 54, 54, 54 }, /* 215 */
X { 24, 24,255, 24,255, 24, 24, 24 }, /* 216 */
X { 24, 24, 24, 24,248, 0, 0, 0 }, /* 217 */
X { 0, 0, 0, 0, 31, 24, 24, 24 }, /* 218 */
X { 255,255,255,255,255,255,255,255 }, /* 219 */
X { 0, 0, 0, 0,255,255,255,255 }, /* 220 */
X { 240,240,240,240,240,240,240,240 }, /* 221 */
X { 15, 15, 15, 15, 15, 15, 15, 15 }, /* 222 */
X { 255,255,255,255, 0, 0, 0, 0 }, /* 223 */
X { 0, 0, 59,110,100,110, 59, 0 }, /* 224 */
X { 0, 60,102,124,102,124, 96, 96 }, /* 225 */
X { 0,126,102, 96, 96, 96, 96, 0 }, /* 226 */
X { 0,127, 54, 54, 54, 54, 54, 0 }, /* 227 */
X { 126,102, 48, 24, 48,102,126, 0 }, /* 228 */
X { 0, 0, 63,108,108,108, 56, 0 }, /* 229 */
X { 0, 51, 51, 51, 51, 62, 48, 96 }, /* 230 */
X { 0, 59,110, 12, 12, 12, 12, 0 }, /* 231 */
X { 126, 24, 60,102,102, 60, 24,126 }, /* 232 */
X { 28, 54, 99,127, 99, 54, 28, 0 }, /* 233 */
X { 28, 54, 99, 99, 54, 54,119, 0 }, /* 234 */
X { 14, 24, 12, 62,102,102, 60, 0 }, /* 235 */
X { 0, 0,126,219,219,126, 0, 0 }, /* 236 */
X { 6, 12,126,219,219,126, 96,192 }, /* 237 */
X { 28, 96,192,252,192, 96, 28, 0 }, /* 238 */
X { 60,102,102,102,102,102,102, 0 }, /* 239 */
X { 0,126, 0,126, 0,126, 0, 0 }, /* 240 */
X { 24, 24,126, 24, 24, 0,126, 0 }, /* 241 */
X { 48, 24, 12, 24, 48, 0,126, 0 }, /* 242 */
X { 12, 24, 48, 24, 12, 0,126, 0 }, /* 243 */
X { 14, 27, 27, 24, 24, 24, 24, 24 }, /* 244 */
X { 24, 24, 24, 24, 24,216,216,112 }, /* 245 */
X { 24, 24, 0,126, 0, 24, 24, 0 }, /* 246 */
X { 0,118,220, 0,118,220, 0, 0 }, /* 247 */
X { 56,108,108, 56, 0, 0, 0, 0 }, /* 248 */
X { 0, 0, 0, 24, 24, 0, 0, 0 }, /* 249 */
X { 0, 0, 0, 0, 24, 0, 0, 0 }, /* 250 */
X { 15, 12, 12, 12,236,108, 60, 28 }, /* 251 */
X { 120,108,108,108,108, 0, 0, 0 }, /* 252 */
X { 112, 24, 48, 96,120, 0, 0, 0 }, /* 253 */
X { 0, 0, 60, 60, 60, 60, 0, 0 }, /* 254 */
X { 0, 0, 0, 0, 0, 0, 0, 0 } }; /* 255 */
X
X
X int hercfd;
X#ifndef IX386
X herc_args herchv,herccurpos;
X#else
Xstruct h {
X int c;
X int x1;
X int y1;
X int x2;
X int y2;
X } ;
X
Xstruct h herccurpos;
X
XHERC Herc;
X#endif
X
X/* #define DEBUG /* turn on if no driver calls should be made!*/
X
Xopenpl()
X{
X
X#ifndef DEBUG
X hercfd = open("/dev/herc", O_WRONLY);
X#ifndef IX386
X herccurpos=herchv;
X herccurpos.c = 0x01;
X#endif
X#endif
X}
X
Xclosepl()
X{
X#ifndef DEBUG
X close(hercfd);
X#endif
X}
X
Xspace(x0,y0,x1,y1)
Xint x0,y0,x1,y1;
X{
Xint x,y;
Xpitograd=(180.0/M_PI);
X
Xif (x1>0 && y1>0 && y0<y1 && x0<x1) {
X x=x1-x0;y=y1-y0;
X gxscrunch=(630/(float) x);gyscrunch=(347/(float) y);
X hercoffx = -(x0*gxscrunch);hercoffy=347+(y0*gyscrunch);
X}
X
X#ifdef DEBUG
Xprintf("offx=%d, offy=%d\n",hercoffx,hercoffy);
X#endif
X
X}
X
Xerase()
X{
X#ifndef DEBUG
X#ifndef IX386
X ioctl(hercfd, HERC_CLEAR, &herchv); /* Clear screen */
X#else
X close(hercfd);
X hercfd = open("/dev/herc", O_WRONLY);
X#endif
X#endif
X}
X
Xlabel(s)
Xchar *s;
X{
X register int i;
X#ifndef IX386
X herchv.str = s;
X herchv.c = strlen(s);
X herchv.x1 = herccurpos.x1/8; herchv.y1 = herccurpos.y1/8;
X ioctl(hercfd, HERC_STR, &herchv);
X#else
X Herc.cmd= SET_PIXEL;
X for (i = 0 ; i < strlen(s);i++)
X {
X gchar((int) *(s + i), 8,(herccurpos.x1 + (i * 8)),herccurpos.y1);
X }
X#endif
X}
X
Xmove(x,y)
Xint x,y;
X{
X x = x*gxscrunch;
X y = y*gyscrunch;
X y = hercoffy - y ;x += hercoffx ;
X herccurpos.x1 = x; herccurpos.y1 = y;
X#ifdef DEBUG
X printf("move %d, %d\n",x,y);
X#endif
X
X}
X
Xcont(x,y)
Xint x,y;
X{
X int xo,yo;
X xo = x*gxscrunch;
X yo = y*gyscrunch;
X yo = hercoffy - yo ;xo += hercoffx ;
X#ifndef DEBUG
X#ifndef IX386
X herchv.x1 = herccurpos.x1;
X herchv.y1 = herccurpos.y1;
X herchv.x2 = xo;
X herchv.y2 = yo;
X herchv.c = herccurpos.c;
X ioctl(hercfd, HERC_LINE, &herchv);
X#else
X hg_line(herccurpos.x1,herccurpos.y1,xo,yo);
X#endif
X#else
X printf("cont = line from %d,%d to %d,%d\n",herccurpos.x1,herccurpos.y1,xo,yo);
X#endif
X herccurpos.x1=xo;herccurpos.y1=yo;
X}
X
Xline (x1, y1, x2, y2)
Xint x1,y1,x2,y2;
X{
X move(x1,y1);
X cont(x2,y2);
X/*
X herchv.x1 = abs(lrand48() % 719);
X herchv.y1 = abs(lrand48() % 347);
X herchv.x2 = abs(lrand48() % 719);
X herchv.y2 = abs(lrand48() % 347);
X herchv.c = 0x01;
X ioctl(hercfd, HERC_LINE, &herchv);
X*/
X}
Xcircle(x,y,r)
Xint x,y,r;
X{
X/*
Xint xo,yo;
X move((x-r),y);
X xo=(x*gxscrunch);yo=(y*gyscrunch);
X yo = hercoffy + yo;xo = hercoffx + xo;
X printf("\033PpC(C)[%d,%d]",xo,yo);
X*/
X move(x,y);
X}
X
Xarc(x,y,x0,y0,x1,y1)
Xint x,y,x0,y0,x1,y1;
X{
X move(x,y);
X/*
Xfloat a1,a2,r1,r2;
Xint xo,yo,c1,c2,c;
X move(x0,y0);
X if ((x-x0) > 0) {
X r1=(y-y0)/(x-x0);
X a1=atan(r1);
X c1=(a1*pitograd);
X }
X else {
X c1=180;
X }
X if ((x-x1) > 0) {
X r2=(y-y1)/(x-x1);
X a2=atan(r2);
X c2=(a2*pitograd);
X }
X else {
X c2=180;
X }
X c=c1-c2;
X xo=(x*gxscrunch);yo=(y*gyscrunch);
X yo = hercoffy - yo;xo = hercoffx + xo;
X printf("\033PpC(A%dC) [%d,%d]\033\\",c,xo,yo);
X*/
X}
X
Xdot(xi,yi,dx,n,pat)
Xint xi,yi,dx,n,pat[256];
X{
X}
X
Xpoint(x,y)
Xint x,y;
X{
X#ifndef DEBUG
X#ifdef IX386
XHERC Herc;
X Herc.cmd= SET_PIXEL;
X#endif
X x = x*gxscrunch;
X y = y*gyscrunch;
X y = hercoffy - y ;x += hercoffx ;
X herccurpos.x1 = x; herccurpos.y1 = y;
X#ifndef IX386
X herchv.x1 = x;
X herchv.y1 = y;
X herchv.c = herccurpos.c;
X ioctl(hercfd, HERC_PLOT, &herchv);
X#else
X Herc.phys_x = x;
X Herc.phys_y = y;
X if(write(hercfd, &Herc, sizeof(HERC)) < 0)
X {
X perror("main: write hercfd failed");
X exit(2);
X }
X#endif
X#else
X printf("point %d,%d\n",x,y);
X#endif
X}
X
Xlinemod(s)
Xchar *s;
X{
X if (strcmp(s,"dotted")==0) {
X herccurpos.c=0x42;
X }
X else if (strcmp(s,"solid")==0) {
X herccurpos.c=0x01;
X }
X else if (strcmp(s,"longdashed")==0) {
X herccurpos.c=0x88;
X }
X else if (strcmp(s,"shortdashed")==0) {
X herccurpos.c=0x84;
X }
X else if (strcmp(s,"dotdashed")==0) {
X herccurpos.c=0x01;
X }
X}
X
X
X# define max(a,b) (((a) > (b)) ? (a) : (b))
X# define abs(a) (((a) < 0) ? (-a) : (a))
X# define sign(a) ((a) > 0 ? 1 : ((a) == 0 ? 0 : (-1)))
X# define TRUE (-1)
X# define FALSE (0)
Xhg_line(x1,y1,x2,y2,c)
Xint x1,y1,x2,y2,c;
X{
X int ix, iy, i, inc, x,y, dx, dy, plot, plotx, ploty;
X
X Herc.cmd= SET_PIXEL;
X dx=x2-x1; dy=y2-y1;
X ix = abs(dx); iy = abs(dy);
X inc = max(ix, iy);
X plotx = x1; ploty = y1;
X x = y = 0;
X for (i=0;i<=inc;++i)
X {
X x += ix; y += iy;
X plot = FALSE;
X if (x > inc)
X {
X plot = TRUE;
X x -= inc;
X plotx += sign(dx);
X };
X if (y > inc)
X {
X plot = TRUE;
X y -= inc;
X ploty += sign(dy);
X };
X
X if (plot)
X {
X Herc.phys_x = plotx;
X Herc.phys_y = ploty;
X if(write(hercfd, &Herc, sizeof(HERC)) < 0)
X {
X perror("main: write hercfd failed"); exit(2);
X }
X }
X };
X}
X
Xbox(x0, y0, x1, y1)
X{
X move(x0, y0);
X cont(x0, y1);
X cont(x1, y1);
X cont(x1, y0);
X cont(x0, y0);
X move(x1, y1);
X}
X /* PC spezifische Steuerroutinen */
X
X
X
Xgchar(byte,chrsize,x,y)
Xint byte,chrsize,x,y;
X{
Xregister int zeile,spalte;
Xchar h[2];
Xh[1]=0;
Xfor (zeile = 0 ; zeile <=7 ; zeile++)
X {
X for (spalte=0 ; spalte <= 7; spalte++)
X {
X if ((font[byte][zeile] & (128 >> spalte)) != 0)
X {
X Herc.phys_x = x+spalte;
X Herc.phys_y = y+zeile-7;
X if(write(hercfd, &Herc, sizeof(HERC)) < 0)
X {
X perror("main: write hercfd failed");
X exit(2);
X }
X }
X }
X }
X}
X
X
SHAR_EOF
$TOUCH -am 1014173090 libplot/herc/libherc.c &&
chmod 0666 libplot/herc/libherc.c ||
echo "restore of libplot/herc/libherc.c failed"
set `wc -c libplot/herc/libherc.c`;Wc_c=$1
if test "$Wc_c" != "19383"; then
echo original size 19383, current size $Wc_c
fi
# ============= libplot/ReGIS/ReGIS.mk ==============
if test ! -d 'libplot/ReGIS'; then
echo "x - creating directory libplot/ReGIS"
mkdir 'libplot/ReGIS'
fi
echo "x - extracting libplot/ReGIS/ReGIS.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > libplot/ReGIS/ReGIS.mk &&
XOWN= bin #file owner
XGRP= bin #file group
XPROT= 664 #protections
X
XINSDIR = /usr/lib
XINS = :
XTESTDIR = .
XCFLAGS = -O
XSOURCE = libReGIS.c
XOFILES = libReGIS.o
X
Xall: libReGIS.a
X :
X
XlibReGIS.a: $(OFILES)
X chmod $(PROT) $(OFILES)
X chgrp $(GRP) $(OFILES)
X chown $(OWN) $(OFILES)
X ar r $(TESTDIR)/libReGIS.a $(OFILES)
X
Xinstall: all save move
X
Xclean:
X -rm -f $(OFILES)
X
Xclobber: clean
X -rm -f $(TESTDIR)/libReGIS.a
X
Xdelete: clobber
X rm -f $(SOURCE)
X
Xmove:
X -rm -f $(INSDIR)/libReGIS.a
X cp $(TESTDIR)/libReGIS.a $(INSDIR)/libReGIS.a
X chmod $(PROT) $(INSDIR)/libReGIS.a
X chmod -x $(INSDIR)/libReGIS.a # not executable
X chgrp $(GRP) $(INSDIR)/libReGIS.a
X chown $(OWN) $(INSDIR)/libReGIS.a
X
Xsave:
X -if test -f $(INSDIR)/libReGIS.a ; \
X then \
X rm -f $(INSDIR)/OLDlibReGIS.a ; \
X cp $(INSDIR)/libReGIS.a $(INSDIR)/OLDlibReGIS.a ; \
X chmod $(PROT) $(INSDIR)/OLDlibReGIS.a ; \
X chmod -x $(INSDIR)/OLDlibReGIS.a ; \
X chgrp $(GRP) $(INSDIR)/OLDlibReGIS.a ; \
X chown $(OWN) $(INSDIR)/OLDlibReGIS.a ; \
X fi
SHAR_EOF
$TOUCH -am 1014195290 libplot/ReGIS/ReGIS.mk &&
chmod 0644 libplot/ReGIS/ReGIS.mk ||
echo "restore of libplot/ReGIS/ReGIS.mk failed"
set `wc -c libplot/ReGIS/ReGIS.mk`;Wc_c=$1
if test "$Wc_c" != "1000"; then
echo original size 1000, current size $Wc_c
fi
echo "End of part 1, continue with part 2"
exit 0
--
UUCP: ..!uunet!mcsun!hp4nl!integow!hot or hot at integow.UUCP or hot at hot.mug
Roland van Hout, Sr. software engineer, Integrity software consultants,
Pelmolenlaan 16, 3447 GW Woerden, Netherlands,
tel +31 3480-30131, fax +31 3480-30182
More information about the Alt.sources
mailing list