Path: utzoo!attcan!uunet!mcsun!hp4nl!integow!hot From: hot@integow.uucp (Roland van Hout) Newsgroups: alt.sources Subject: PD plot(4) librarys (and hercules driver for interactive 386) part 3 of 9 Keywords: plot interface graphics Message-ID: <1391@integow.uucp> Date: 28 Oct 90 03:53:10 GMT Organization: Integrity BV, Woerden, the Netherlands Lines: 668 #!/bin/sh # This is part 03 of a multipart archive if touch 2>&1 | fgrep '[-amc]' > /dev/null then TOUCH=touch else TOUCH=true fi # ============= libplot/lp/charset.0 ============== echo "x - extracting libplot/lp/charset.0 (Text)" sed 's/^X//' << 'SHAR_EOF' > libplot/lp/charset.0 && X 2,0, 100, 0,0, -100, 0,2, 100, 0,6, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ! */ X 1,6, 100, 1,2, -100, 1,-2, 100, 1,2, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* " */ X 1,1, 100, 0,6, -100, 2,0, 100, 0,-6, -100, 1,2, 100, -4,0, -100, 0,2, 100, 4,0, -200,-200,-200,-200,-200 /* # */ X 0,2, 100, 1,-1, 2,0, 1,1, 0,1, -4,2, 0,1, 1,1, 2,0, 1,-1, -100, -2,2, 100, 0,-8, -200 /* $ */ X 0,2, 100, 3,4, -100, -2,0, 100, -1,-1, 0,1, 1,0, -100, 2,-3, 100, 0,-1, -1,0, 1,1, -200,-200,-200 /* % */ X 4,0, 100, -3,5, 0,2, 1,1, 1,-1, 0,-2, -3,-2, 0,-2, 1,-1, 2,0, 1,2, -200,-200,-200,-200,-200 /* & */ X 1,6, 100, 1,2, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ' */ X 3,0, 100, -1,2, 0,4, 1,2, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ( */ X 1,0, 100, 1,2, 0,4, -1,2, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ) */ X 0,2, 100, 4,4, -100, -4,0, 100, 4,-4, -100, -2,0, 100, 0,4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* * */ X 2,2, 100, 0,4, -100, -2,-2, 100, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* + */ X 2,0, 100, -1,0, 0,1, 1,0, 0,-1, -1,-1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* , */ X 0,4, 100, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* - */ X 1,0, 100, 0,1, 1,0, 0,-1, -1,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* . */ X 0,1, 100, 3,6, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* / */ X 1,0, 100, -1,3, 0,2, 1,3, 2,0, 1,-3, 0,-2, -1,-3, -2,0, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* 0 */ X 1,0, 100, 2,0, -1,0, 0,8, -1,-1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* 1 */ X 4,0, 100, -4,0, 0,1, 1,2, 2,1, 1,1, 0,2, -1,1, -2,0, -1,-1, 0,-1, -200,-200,-200,-200,-200 /* 2 */ X 0,1, 100, 1,-1, 2,0, 1,1, 0,2, -1,1, -2,0, 2,0, 1,1, 0,2, -1,1, -2,0, -1,-1, -200 /* 3 */ X 4,0, 100, 0,8, 0,-4, -4,0, 1,4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* 4 */ X 0,1, 100, 1,-1, 2,0, 1,1, 0,2, -1,1, -3,0, 0,4, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* 5 */ X 0,4, 100, 3,0, 1,-1, 0,-2, -1,-1, -2,0, -1,1, 0,6, 1,1, 2,0, 1,-1, -200,-200,-200,-200,-200 /* 6 */ X 1,0, 100, 3,8, -4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* 7 */ X 0,1, 100, 0,2, 4,2, 0,2, -1,1, -2,0, -1,-1, 0,-2, 4,-2, 0,-2, -1,-1, -2,0, -1,1, -200 /* 8 */ X 4,0, 100, 0,8, -3,0, -1,-1, 0,-2, 1,-1, 2,0, 1,1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* 9 */ X 1,0, 100, 0,1, 1,0, 0,-1, -1,0, -100, 0,4, 100, 0,1, 1,0, 0,-1, -1,0, -200,-200,-200,-200,-200 /* : */ X 2,0, 100, -1,0, 0,1, 1,0, 0,-1, -1,-1, -100, 0,5, 100, 0,1, 1,0, 0,-1, -1,0, -200,-200,-200 /* ; */ X 4,1, 100, -3,3, 3,3, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* < */ X 0,3, 100, 4,0, -100, 0,2, 100, -4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* = */ X 0,1, 100, 3,3, -3,3, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* > */ X 2,0, 100, 0,0, -100, 0,2, 100, 0,1, 2,2, 0,2, -1,1, -2,0, -1-1, -200,-200,-200,-200,-200,-200,-200 /* ? */ X 4,1, 100, -3,0, -1,1, 0,4, 1,1, 2,0, 1,-1, 0,-2, -1,-1, -1,0, 0,2, 2,1, -200, -200, -200 /* @ */ X 100, 0,5, 2,3, 2,-3, 0,-5, -100, 0,4, 100, -4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* A */ X 0,4, 100, 3,0, 1,-1, 0,-2, -1,-1, -3,0, 0,8, 3,0, 1,-1, 0,-2, -1,-1, -200,-200,-200,-200,-200 /* B */ X 4,1, 100, -1,-1, -2,0, -1,1, 0,6, 1,1, 2,0, 1,-1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* C */ X 100, 0,8, 3,0, 1,-1, 0,-6, -1,-1, -3,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* D */ X 4,0, 100, -4,0, 0,4, 3,0, -3,0, 0,4, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* E */ X 100, 0,4, 3,0, -3,0, 0,4, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* F */ X 2,3, 100, 2,0, 0,-2, -1,-1, -2,0, -1,1, 0,6, 1,1, 2,0, 1,-1, -200,-200,-200,-200,-200,-200,-200 /* G */ X 100, 0,8, 0,-4, 4,0, 0,4, 0,-8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* H */ X 1,0, 100, 2,0, -1,0, 0,8, 1,0, -2,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* I */ X 0,2, 100, 0,-1, 1,-1, 2,0, 1,1, 0,7, -1,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* J */ X 100, 0,8, 0,-4, 4,4, -4,-4, 4,-4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* K */ X 4,0, 100, -4,0, 0,8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* L */ X 100, 0,8, 2,-3, 2,3, 0,-8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* M */ X 100, 0,8, 4,-8, 0,8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* N */ X 0,1, 100, 0,6, 1,1, 2,0, 1,-1, 0,-6, -1,-1, -2,0, -1,1, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* O */ X 100, 0,8, 3,0, 1,-1, 0,-2, -1,-1, -3,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* P */ X 0,1, 100, 0,6, 1,1, 2,0, 1,-1, 0,-6, -1,-1, -2,0, -1,1, -100, 2,1, 100, 2,-2, -200,-200,-200 /* Q */ X 100, 0,8, 3,0, 1,-1, 0,-2, -1,-1, -3,0, 2,0, 2,-4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* R */ X 0,1, 100, 1,-1, 2,0, 1,1, 0,2, -1,1, -2,0, -1,1, 0,2, 1,1, 2,0, 1,-1, -200,-200,-200 /* S */ X 2,0, 100, 0,8, -2,0, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* T */ X 0,8, 100, 0,-7, 1,-1, 2,0, 1,1, 0,-1, 0,8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* U */ X 0,8, 100, 1,-5, 1,-3, 1,3, 1,5, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* V */ X 0,8, 100, 0,-6, 1,-2, 1,3, 0,1, 0,-1, 1,-3, 1,2, 0,6, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* W */ X 100, 4,8, -100, -4,0, 100, 4,-8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* X */ X 2,0, 100, 0,5, -2,3, 2,-3, 2,3, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* Y */ X 0,8, 100, 4,0, -4,-8, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* Z */ X 3,0, 100, -1,0, 0,8, 1,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* [ */ X 0,7, 100, 3,-6, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* \ */ X 1,0, 100, 1,0, 0,8, -1,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ] */ X 0,6, 100, 2,2, 2,-2, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ^ */ X 100, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* _ */ X 2,8, 100, 1,-2, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ` */ X 4,1, 100, -1,-1, -2,0, -1,1, 0,2, 1,2, 3,0, 0,-5, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* a */ X 0,8, 100, 0,-8, 0,1, 1,-1, 2,0, 1,1, 0,3, -1,1, -3,0, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* b */ X 4,1, 100, -1,-1, -2,0, -1,1, 0,3, 1,1, 2,0, 1,-1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* c */ X 4,8, 100, 0,-8, 0,1, -1,-1, -2,0, -1,1, 0,3, 1,1, 3,0, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* d */ X 4,1, 100, -1,-1, -2,0, -1,1, 0,3, 1,1, 2,0, 1,-1, 0,-1, -4,0, -200,-200,-200,-200,-200,-200,-200 /* e */ X 1,0, 100, 0,7, 1,1, 1,0, 1,-1, -100, -2,-3, 100, -2,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* f */ X 4,1, 100, -1,-1, -2,0, -1,1, 0,3, 1,1, 3,0, 0,-7, -1,-1, -2,0, -1,1, -200,-200,-200,-200,-200 /* g */ X 100, 0,8, 0,-4, 1,1, 2,0, 1,-1, 0,-4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* h */ X 1,0, 100, 2,0, -1,0, 0,5, -100, 0,2, 100, 0,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* i */ X 0,-2, 100, 1,-1, 1,0, 1,1, 0,7, -100, 0,2, 100, 0,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* j */ X 100, 0,8, 0,-5, 4,2, -2,-1, 2,-4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* k */ X 1,0, 100, 2,0, -1,0, 0,8, -1,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* l */ X 100, 0,5, 0,-1, 1,1, 1,0, 0,-5, 0,4, 1,1, 1,0, 0,-5, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* m */ X 100, 0,5, 0,-1, 1,1, 2,0, 1,-1, 0,-4, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* n */ X 1,0, 100, -1,1, 0,3, 1,1, 2,0, 1,-1, 0,-3, -1,-1, -2,0, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* o */ X 0,-3, 100, 0,8, 3,0, 1,-1, 0,-3, -1,-1, -2,0, -1,1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* p */ X 4,1, 100, -1,-1, -2,0, -1,1, 0,3, 1,1, 3,0, 0,-8, -1,0, 2,0, -200,-200,-200,-200,-200,-200,-200 /* q */ X 100, 0,5, 0,-2, 2,2, 2,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* r */ X 0,1, 100, 1,-1, 2,0, 1,1, 0,1, -4,1, 0,1, 1,1, 2,0, 1,-1, -200,-200,-200,-200,-200,-200,-200 /* s */ X 2,0, 100, 0,8, -100, -2,-3, 100, 4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* t */ X 0,5, 100, 0,-4, 1,-1, 2,0, 1,1, 0,-1, 0,5, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* u */ X 0,5, 100, 2,-5, 2,5, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* v */ X 0,5, 100, 0,-3, 1,-2, 1,3, 0,2, 0,-2, 1,-3, 1,2, 0,3, -200,-200,-200,-200,-200,-200,-200,-200,-200 /* w */ X 100, 4,5, -100, -4,0, 100, 4,-5, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* x */ X 0,5, 100, 2,-5, -2,-3, 2,3, 2,5, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* y */ X 4,0, 100, -4,0, 4,5, -4,0, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* z */ X 3,0, 100, -1,1, 0,2, -1,1, 1,1, 0,2, 1,1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* { */ X 2,0, 100, 0,8, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* | */ X 1,0, 100, 1,1, 0,2, 1,1, -1,1, 0,2, -1,1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* } */ X 1,6, 100, 1,1, 1,-1, 1,1, -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200 /* ~ */ SHAR_EOF $TOUCH -am 0706211890 libplot/lp/charset.0 && chmod 0644 libplot/lp/charset.0 || echo "restore of libplot/lp/charset.0 failed" set `wc -c libplot/lp/charset.0`;Wc_c=$1 if test "$Wc_c" != "11475"; then echo original size 11475, current size $Wc_c fi # ============= libplot/lp/circle.c ============== echo "x - extracting libplot/lp/circle.c (Text)" sed 's/^X//' << 'SHAR_EOF' > libplot/lp/circle.c && X/* X * do_ci.c X * X * Copyright (c) 1988 Environmental Defense Fund, Inc. X */ X X#include X#include X#include "plotlp.h" X#ifdef TESTVER X#include "dbgvars.h" X#endif X X#define DEGREES_TO_RADIANS 3.1415926535898 / 180.0 X Xcircle(x,y,r) Xint x,y,r; X{ X POINT t, X t0, X t1; X float radius; X int i_radius, X chordangle; X int i; X X#ifdef TESTVER X int xwas_on; /* for debugging */ X X /* turn debug2 off, if necessary, for the duration of do_CI() */ X if (debug2x) { X xwas_on = TRUE; X debug2x = FALSE; X } else { X xwas_on = FALSE; X } X#endif X X X radius=r*gxscrunch; X X if (scaling) { X i_radius = (int) (radius * x_scaler); X if (i_radius < 0) X i_radius -= 1; X } else X i_radius = (int) radius; X current.x=x*gxscrunch;current.y=y*gyscrunch; X current.x += offx; current.y += offy; X t.x = t0.x = i_radius + current.x; X t.y = t0.y = current.y; X chordangle=1; X for (i = chordangle; i < 360; i += chordangle) { X t1.x = (double) radius *cos((double) i X * DEGREES_TO_RADIANS) + current.x; X t1.y = (double) radius *sin((double) i X * DEGREES_TO_RADIANS) + current.y; X X put_seg(t, t1); X t = t1; X } X /* plot last full or partial chord; chordangle may not be a factor of 360 */ X put_seg(t, t0); X X#ifdef TESTVER /* reset debug2x if necessary */ X if (xwas_on) { X debug2x = TRUE; X } X#endif X} SHAR_EOF $TOUCH -am 1010212988 libplot/lp/circle.c && chmod 0644 libplot/lp/circle.c || echo "restore of libplot/lp/circle.c failed" set `wc -c libplot/lp/circle.c`;Wc_c=$1 if test "$Wc_c" != "1407"; then echo original size 1407, current size $Wc_c fi # ============= libplot/lp/const.h ============== echo "x - extracting libplot/lp/const.h (Text)" sed 's/^X//' << 'SHAR_EOF' > libplot/lp/const.h && X/* X * const.h X * X * Copyright (c) 1988 Environmental Defense Fund, Inc. X */ X Xtypedef struct { X int x, X y; X} POINT; X X#define PA 0 X#define PR 1 X#define PD 2 X#define PU 3 X X#define ESC 27 X X#define TRUE 1 X#define FALSE 0 X X/* LINE TYPES */ X#define DOTS 0 X#define SHORT_DASH 1 X#define BROKN_1 2 X#define BROKN_2 3 X#define BROKN_DOT 4 X#define BROKN_DASH 5 X#define BROKN_2DASH 6 X#define SOLID 7 X X/* FILL TYPES: values assigned to var fill_type */ X#define BI_SOLID 1 X#define UNI_SOLID 2 X#define PARALLEL 3 X#define CROSS_HATCH 4 X X/* Charater set defines */ X#define CHAR_ELEM 28 X#define NUM_CHAR 94 X X/* Printer model: values of global var 'printer' */ X#define EPSON 1 /* Epson LQ 1500 */ X#define LASERLOW 2 /* HP LaserJet Plus low sized 5" x 6" */ X#define IBM_PRO 3 /* IBM Proprinter */ X#define LASERMED 4 /* HP LaserJet Plus med sized 8" x 6" */ X#define LASERHIGH 5 /* HP LaserJet Plus extra large 8" x 11"*/ X X#define BITMAPSIZE 935000 SHAR_EOF $TOUCH -am 1007125888 libplot/lp/const.h && chmod 0644 libplot/lp/const.h || echo "restore of libplot/lp/const.h failed" set `wc -c libplot/lp/const.h`;Wc_c=$1 if test "$Wc_c" != "951"; then echo original size 951, current size $Wc_c fi # ============= libplot/lp/dbgvars.h ============== echo "x - extracting libplot/lp/dbgvars.h (Text)" sed 's/^X//' << 'SHAR_EOF' > libplot/lp/dbgvars.h && X/* X * dbgvars.h X * X * Copyright (c) 1988 Environmental Defense Fund, Inc. X * X * the home for these vars is set_dbgs.c X */ X X#include X Xextern FILE *errfp; X Xextern int debug1c, X debug1f, X debug2, X debug2x, X debug3, X debug4, X debug5, X debug6, X debug7, X debug8, X debug9; SHAR_EOF $TOUCH -am 1007125888 libplot/lp/dbgvars.h && chmod 0644 libplot/lp/dbgvars.h || echo "restore of libplot/lp/dbgvars.h failed" set `wc -c libplot/lp/dbgvars.h`;Wc_c=$1 if test "$Wc_c" != "346"; then echo original size 346, current size $Wc_c fi # ============= libplot/lp/ep_map.c ============== echo "x - extracting libplot/lp/ep_map.c (Text)" sed 's/^X//' << 'SHAR_EOF' > libplot/lp/ep_map.c && X/* X * ep_map.c X * X * Copyright (c) 1988 Environmental Defense Fund, Inc. X */ X X#include X#include "const.h" X#include "fillcnst.h" X X#ifdef TESTVER X#include X#include "dbgvars.h" X#endif X X/* Constants */ X/* SCALEX = 10.15 (inches) / 10366 (plotter units) * 180 (dots/inch) */ X#define SCALEX 0.1762492 X/* SCALEY = 7.8 (inches) / 7963 (plotter units) * 180 (dots/inch) */ X#define SCALEY 0.1763154 X X#define YLIM 1404 X#define XLIM 231 X X#define ROUNDER 0.0 X X#ifdef TESTVER X#define PUT_BIT(x, y) map[(tempindex = (tempy = y) + YLIM * ((tempx = x) >> 3))] |= BITS[x & 7]; X#else X#define PUT_BIT(x, y) map[y + YLIM * (x >> 3)] |= BITS[x & 7] X#endif X X#define ABS(x) ( (x) > 0.0 ? (x) : -(x) ) X Xstatic char BITS[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; X X/* move bit map to maps.c for combined printer version --- */ X/* char map[XLIM * YLIM]; */ Xextern char map[]; X X#ifdef TESTVER Xstatic int tempindex, X tempx, X tempy; Xstatic POINT tempp1, X tempp2; X Xep_catch() X{ X fprintf(stderr, "Segmentation violation\n"); X fprintf(stderr, "tempindex = %d x = %d y = %d p1 = %d,%d p2 = %d,%d\n", tempindex, tempx, tempy, tempp1.x, tempp1.y, tempp2.x, tempp2.y); X ep_dump_map(FALSE); X exit(1); X} X Xepcatchi() X{ X ep_dump_map(FALSE); X exit(1); X} X X#endif X X Xep_put_seg(p1, p2) X POINT p1, X p2; X{ X double diffx, X diffy, X change_ratio; X register int x, X y; X register int inc; X X#ifdef TESTVER X if (debug2 || debug2x) { X fprintf(errfp, "p1 ( %d, %d ); p2 ( %d, %d )\n", X p1.x, p1.y, p2.x, p2.y); X } X#if 0 X signal(SIGSEGV, ep_catch); X signal(SIGINT, epcatchi); X#endif X tempp1 = p1; X tempp2 = p2; X#endif X X p1.x = SCALEX * (double) p1.x + ROUNDER; X p2.x = SCALEX * (double) p2.x + ROUNDER; X p1.y = SCALEY * (double) p1.y + ROUNDER; X p2.y = SCALEY * (double) p2.y + ROUNDER; X X diffx = p2.x - p1.x; X diffy = p2.y - p1.y; X X if (diffx != 0.0 && diffy != 0.0) { X if (ABS(diffx) > ABS(diffy)) { X inc = (diffx < 0) ? -1 : 1; X change_ratio = diffy / diffx; X for (x = p1.x; x != p2.x; x += inc) { X y = (x - p1.x) * change_ratio + p1.y + ROUNDER; X PUT_BIT(x, y); X } X PUT_BIT(p2.x, p2.y); X } else { X inc = (diffy < 0) ? -1 : 1; X change_ratio = diffx / diffy; X for (y = p1.y; y != p2.y; y += inc) { X x = (y - p1.y) * change_ratio + p1.x + ROUNDER; X PUT_BIT(x, y); X } X PUT_BIT(p2.x, p2.y); X } X } else { X if (diffx) { /* horizontal line */ X y = p1.y; X inc = (diffx < 0) ? -1 : 1; X for (x = p1.x; x != p2.x; x += inc) { X PUT_BIT(x, y); X } X PUT_BIT(p2.x, y); X } else { X x = p1.x; X inc = (diffy < 0) ? -1 : 1; X for (y = p1.y; y != p2.y; y += inc) { X PUT_BIT(x, y); X } X PUT_BIT(x, p2.y); X } X } X} X X X/* LEFT_CUTOFF is the number of dot rows along left edge of page to skip over. X * shifts image to the left by that many dot rows on the hardcopy page */ X#define LEFT_CUTOFF 72 X Xep_dump_map(to_printer) X int to_printer; X{ X register int k; X int map_max = XLIM * YLIM; X int i, X j; X char hdr[5]; X register char *pm0, X *pm1, X *pm2, X *pb; X char buf[180]; X int non_blank; X short int lim; X X#ifndef TESTVER X to_printer = TRUE; X#endif X X if (to_printer) { X hdr[0] = ESC; X hdr[1] = '3'; X hdr[2] = 24; /* Spacing at 24/180 inch per line */ X write(1, hdr, 3); X hdr[1] = '*'; X hdr[2] = 39; /* Triple density, 24 pins */ X hdr[3] = (YLIM - LEFT_CUTOFF) & 0x0ff; X hdr[4] = ((YLIM - LEFT_CUTOFF) >> 8) & 0x0ff; X for (k = 0; k < map_max; k += 3 * YLIM) { X write(1, hdr, 5); X pm0 = &map[k + LEFT_CUTOFF]; X pm1 = &map[k + YLIM + LEFT_CUTOFF]; X pm2 = &map[k + (2 * YLIM) + LEFT_CUTOFF]; X lim = YLIM - LEFT_CUTOFF; X while ((lim -= 60) >= 0) { X pb = buf; X for (i = 0; i < 60; i++) { X *pb++ = *pm0++; X *pb++ = *pm1++; X *pb++ = *pm2++; X } X write(1, buf, 180); X fflush(stdout); X } X X if (lim < 0) X for (lim += 60; lim > 0; lim--) { X pb = buf; X *pb++ = *pm0++; X *pb++ = *pm1++; X *pb++ = *pm2++; X write(1, buf, 3); X fflush(stdout); X } X write(1, "\n\r", 2);/* LF and CR to end line */ X } X hdr[0] = '\f'; /* Initialize the printer */ X write(1, hdr, 1); X fflush(stdout); X hdr[0] = ESC; /* Initialize the printer */ X hdr[1] = '@'; X write(1, hdr, 2); X fflush(stdout); X#ifdef TESTVER X fclose(errfp); X#endif X X } X#ifdef TESTVER X else { X FILE *tty, X *ttyout; X int dump_start, X dump_stop; X X if ((tty = fopen(TTY, "r")) == NULL) { X perror(TTY); X exit(10); X } X if ((ttyout = fopen(TTY, "w")) == NULL) { X perror(TTY); X exit(10); X } X fprintf(ttyout, "Enter start bit:"); X fflush(ttyout); X fscanf(tty, "%d", &dump_start); X dump_stop = dump_start + 79; X non_blank = 0; X pb = buf; X for (k = 0; k < XLIM * YLIM; k += YLIM) { X for (i = 0; i < 8; i++) { X for (j = k + dump_start; j < k + dump_stop; j++) { X if (map[j] & BITS[i]) { X sprintf(pb, "."); X non_blank = 1; X } else { X sprintf(pb, " "); X } X pb++; X } X if (non_blank) { X sprintf(pb, "\n\000"); X printf("%s", buf); X } X non_blank = 0; X pb = buf; X } X } X } X#endif X X} X X Xep_init_map() X{ X register int k; X int map_max = XLIM * YLIM; X register char *mp; X X#ifdef TRUESOLID X extern double PUs_per_dot; /* declared in file filltype.c */ X X PUs_per_dot = 1.0 / SCALEX; /* used by fix_fill() in file filltype.c */ X#endif X X mp = map; X for (k = 0; k < map_max; k++) { X *mp++ = 0; X } X} SHAR_EOF $TOUCH -am 1007125888 libplot/lp/ep_map.c && chmod 0644 libplot/lp/ep_map.c || echo "restore of libplot/lp/ep_map.c failed" set `wc -c libplot/lp/ep_map.c`;Wc_c=$1 if test "$Wc_c" != "5595"; then echo original size 5595, current size $Wc_c fi # ============= libplot/lp/fillcnst.h ============== echo "x - extracting libplot/lp/fillcnst.h (Text)" sed 's/^X//' << 'SHAR_EOF' > libplot/lp/fillcnst.h && X/* X * fillcnst.h X * X * Copyright (c) 1988 Environmental Defense Fund, Inc. X */ X X#define DEG_TO_RAD 0.017453292 /* pi/180 */ X#define PI 3.1415926535898 X#define PI_2 1.5707962 /* pi/2; approx 180 deg */ X#define PI_4 0.7853981 /* pi/4; approx 90 deg */ X#define PI_9 0.3490658 /* pi/9; approx 20 deg */ X X/* values stored in global vars C_A, C_B, A_B */ X#define GENR 0 /* non-special angle relationship */ X#define PARL 1 /* segment & hatch line parallel */ X#define VERT 2 /* segment is vertical */ X#define HORZ 3 /* segment is horizontal */ X Xtypedef struct { X double xx, X yy; X} FPOINT; X X/* X * fill_type / fill_angle combos: values for hatching and filler X * these are values assigned to vars fill and fixed_fill X */ X#define SOLIDFILL 0 X#define CROSS_0 4 X#define CROSS_45 1 X#define PARLL_0 2 X#define PARLL_45 5 X#define PARLL_90 6 X#define PARLL_135 3 X#define OTHER -1 SHAR_EOF $TOUCH -am 1007125888 libplot/lp/fillcnst.h && chmod 0644 libplot/lp/fillcnst.h || echo "restore of libplot/lp/fillcnst.h failed" set `wc -c libplot/lp/fillcnst.h`;Wc_c=$1 if test "$Wc_c" != "975"; then echo original size 975, current size $Wc_c fi # ============= libplot/lp/fillvars.h ============== echo "x - extracting libplot/lp/fillvars.h (Text)" sed 's/^X//' << 'SHAR_EOF' > libplot/lp/fillvars.h && X/* X * fillvars.h X * X * Copyright (c) 1988 Environmental Defense Fund, Inc. X * X * the home for these vars is hatch.c X */ X Xextern int hatch_degs; /* hatch angle in degrees */ Xextern double hatch_rads; /* hatch angle in radians */ Xextern double x_shift; Xextern double chg_x_CA, X chg_y_CA, X chg_x_CB, X chg_y_CB, X chg_x_AB, X chg_y_AB; X X/* X * status of line segment: vertical (VERT), horizontal (HORZ), X * parallel to the hatch lines (PARL), or generic (GENR) -- non-special X */ Xextern int C_A, X C_B, X A_B; X X/* variables used by fix_fill(), which is called from do_FT and do_SP */ Xextern int fill, X fixed_fill, X pen_number, X spacing; SHAR_EOF $TOUCH -am 1007125888 libplot/lp/fillvars.h && chmod 0644 libplot/lp/fillvars.h || echo "restore of libplot/lp/fillvars.h failed" set `wc -c libplot/lp/fillvars.h`;Wc_c=$1 if test "$Wc_c" != "700"; then echo original size 700, current size $Wc_c fi echo "End of part 3, continue with part 4" exit 0 -- UUCP: ..!uunet!mcsun!hp4nl!integow!hot or hot@integow.UUCP or hot@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