home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume24
/
gnuplot3
/
part24
< prev
next >
Wrap
Text File
|
1991-10-28
|
49KB
|
1,678 lines
Newsgroups: comp.sources.misc
From: gershon%gr@cs.utah.edu (Elber Gershon)
Subject: v24i046: gnuplot3 - interactive function plotting utility, Part24/26
Message-ID: <1991Oct29.031102.4252@sparky.imd.sterling.com>
X-Md4-Signature: fe8e6d16ea57d803ea23e5e08a6f7bf0
Date: Tue, 29 Oct 1991 03:11:02 GMT
Approved: kent@sparky.imd.sterling.com
Submitted-by: gershon%gr@cs.utah.edu (Elber Gershon)
Posting-number: Volume 24, Issue 46
Archive-name: gnuplot3/part24
Environment: UNIX, MS-DOS, VMS
Supersedes: gnuplot2: Volume 11, Issue 65-79
#!/bin/sh
# this is Part.24 (part 24 of a multipart archive)
# do not concatenate these parts, unpack them in order with /bin/sh
# file gnuplot/standard.c continued
#
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck
if test "$Scheck" != 24; then
echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping gnuplot/standard.c'
else
echo 'x - continuing file gnuplot/standard.c'
sed 's/^X//' << 'SHAR_EOF' >> 'gnuplot/standard.c' &&
X q = q*z2 + qpzero[n];
X }
X return(p/q);
}
X
double qzero(x)
double x;
{
double p, q, z, z2;
int n;
X
X z = 8.0 / x;
X z2 = z * z;
X p = pqzero[5];
X q = qqzero[5];
X for (n=4; n>=0; n--) {
X p = p*z2 + pqzero[n];
X q = q*z2 + qqzero[n];
X }
X return(p/q);
}
X
double yzero(x)
double x;
{
double p, q, x2;
int n;
X
X x2 = x * x;
X p = pyzero[8];
X q = qyzero[8];
X for (n=7; n>=0; n--) {
X p = p*x2 + pyzero[n];
X q = q*x2 + qyzero[n];
X }
X return(p/q);
}
X
double rj0(x)
double x;
{
X if ( x <= 0.0 )
X x = -x;
X if ( x < 8.0 )
X return(jzero(x));
X else
X return( sqrt(TWO_ON_PI/x) *
X (pzero(x)*cos(x-PI_ON_FOUR) - 8.0/x*qzero(x)*sin(x-PI_ON_FOUR)) );
X
}
X
double ry0(x)
double x;
{
X if ( x < 0.0 )
X return(dzero/dzero); /* error */
X if ( x < 8.0 )
X return( yzero(x) + TWO_ON_PI*rj0(x)*log(x) );
X else
X return( sqrt(TWO_ON_PI/x) *
X (pzero(x)*sin(x-PI_ON_FOUR) +
X (8.0/x)*qzero(x)*cos(x-PI_ON_FOUR)) );
X
}
X
X
double jone(x)
double x;
{
double p, q, x2;
int n;
X
X x2 = x * x;
X p = pjone[8];
X q = qjone[8];
X for (n=7; n>=0; n--) {
X p = p*x2 + pjone[n];
X q = q*x2 + qjone[n];
X }
X return(p/q);
}
X
double pone(x)
double x;
{
double p, q, z, z2;
int n;
X
X z = 8.0 / x;
X z2 = z * z;
X p = ppone[5];
X q = qpone[5];
X for (n=4; n>=0; n--) {
X p = p*z2 + ppone[n];
X q = q*z2 + qpone[n];
X }
X return(p/q);
}
X
double qone(x)
double x;
{
double p, q, z, z2;
int n;
X
X z = 8.0 / x;
X z2 = z * z;
X p = pqone[5];
X q = qqone[5];
X for (n=4; n>=0; n--) {
X p = p*z2 + pqone[n];
X q = q*z2 + qqone[n];
X }
X return(p/q);
}
X
double yone(x)
double x;
{
double p, q, x2;
int n;
X
X x2 = x * x;
X p = 0.0;
X q = qyone[8];
X for (n=7; n>=0; n--) {
X p = p*x2 + pyone[n];
X q = q*x2 + qyone[n];
X }
X return(p/q);
}
X
double rj1(x)
double x;
{
double v,w;
X v = x;
X if ( x < 0.0 )
X x = -x;
X if ( x < 8.0 )
X return(v*jone(x));
X else {
X w = sqrt(TWO_ON_PI/x) *
X (pone(x)*cos(x-THREE_PI_ON_FOUR) -
X 8.0/x*qone(x)*sin(x-THREE_PI_ON_FOUR)) ;
X if (v < 0.0)
X w = -w;
X return( w );
X }
}
X
double ry1(x)
double x;
{
X if ( x <= 0.0 )
X return(dzero/dzero); /* error */
X if ( x < 8.0 )
X return( x*yone(x) + TWO_ON_PI*(rj1(x)*log(x) - 1.0/x) );
X else
X return( sqrt(TWO_ON_PI/x) *
X (pone(x)*sin(x-THREE_PI_ON_FOUR) +
X (8.0/x)*qone(x)*cos(x-THREE_PI_ON_FOUR)) );
}
X
X
f_besj0()
{
struct value a;
double x;
X (void) pop(&a);
X if (imag(&a) > zero)
X int_error("can only do bessel functions of reals",NO_CARET);
X push( complex(&a,rj0(real(&a)),0.0) );
}
X
X
f_besj1()
{
struct value a;
double x;
X (void) pop(&a);
X if (imag(&a) > zero)
X int_error("can only do bessel functions of reals",NO_CARET);
X push( complex(&a,rj1(real(&a)),0.0) );
}
X
X
f_besy0()
{
struct value a;
double x;
X (void) pop(&a);
X if (imag(&a) > zero)
X int_error("can only do bessel functions of reals",NO_CARET);
X if (real(&a) > 0.0)
X push( complex(&a,ry0(real(&a)),0.0) );
X else {
X push( complex(&a,0.0,0.0) );
X undefined = TRUE ;
X }
}
X
X
f_besy1()
{
struct value a;
double x;
X (void) pop(&a);
X if (imag(&a) > zero)
X int_error("can only do bessel functions of reals",NO_CARET);
X if (real(&a) > 0.0)
X push( complex(&a,ry1(real(&a)),0.0) );
X else {
X push( complex(&a,0.0,0.0) );
X undefined = TRUE ;
X }
}
X
SHAR_EOF
echo 'File gnuplot/standard.c is complete' &&
chmod 0666 gnuplot/standard.c ||
echo 'restore of gnuplot/standard.c failed'
Wc_c="`wc -c < 'gnuplot/standard.c'`"
test 15347 -eq "$Wc_c" ||
echo 'gnuplot/standard.c: original size 15347, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= gnuplot/term.c ==============
if test -f 'gnuplot/term.c' -a X"$1" != X"-c"; then
echo 'x - skipping gnuplot/term.c (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting gnuplot/term.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'gnuplot/term.c' &&
/* GNUPLOT - term.c */
/*
X * Copyright (C) 1986, 1987, 1990, 1991 Thomas Williams, Colin Kelley
X *
X * Permission to use, copy, and distribute this software and its
X * documentation for any purpose with or without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and
X * that both that copyright notice and this permission notice appear
X * in supporting documentation.
X *
X * Permission to modify the software is granted, but not the right to
X * distribute the modified code. Modifications are to be distributed
X * as patches to released version.
X *
X * This software is provided "as is" without express or implied warranty.
X *
X *
X * AUTHORS
X *
X * Original Software:
X * Thomas Williams, Colin Kelley.
X *
X * Gnuplot 2.0 additions:
X * Russell Lang, Dave Kotz, John Campbell.
X *
X * Gnuplot 3.0 additions:
X * Gershon Elber and many others.
X *
X * Send your comments or suggestions to
X * pixar!info-gnuplot@sun.com.
X * This is a mailing list; to join it send a note to
X * pixar!info-gnuplot-request@sun.com.
X * Send bug reports to
X * pixar!bug-gnuplot@sun.com.
X */
X
#include <stdio.h>
#include "plot.h"
#include "setshow.h"
#include "term.h"
#include "bitmap.h"
X
/* for use by all drivers */
#define sign(x) ((x) >= 0 ? 1 : -1)
#define abs(x) ((x) >= 0 ? (x) : -(x))
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) < (b) ? (a) : (b))
X
BOOLEAN term_init; /* true if terminal has been initialized */
X
extern FILE *outfile;
extern char outstr[];
extern BOOLEAN term_init;
extern int term;
extern float xsize, ysize;
X
extern char input_line[];
extern struct lexical_unit token[];
extern int num_tokens, c_token;
extern struct value *const_express();
X
extern BOOLEAN interactive;
X
/*
X * instead of <strings.h>
X */
extern char *strcpy();
extern int strlen(), strcmp(), strncmp();
#ifndef AMIGA_AC_5
extern double sqrt();
#endif
X
char *getenv();
X
#ifdef __TURBOC__
char *turboc_init();
#endif
#ifdef PC
void reopen_binary();
#endif
#ifdef vms
char *vms_init();
void vms_reset();
void term_mode_tek();
void term_mode_native();
void term_pasthru();
void term_nopasthru();
void reopen_binary();
void fflush_binary();
#endif
X
/* This is needed because the unixplot library only writes to stdout. */
#ifdef UNIXPLOT
FILE save_stdout;
#endif
int unixplot=0;
X
#define NICE_LINE 0
#define POINT_TYPES 6
X
X
do_point(x,y,number)
int x,y;
int number;
{
register int htic,vtic;
register struct termentry *t = &term_tbl[term];
X
X if (number < 0) { /* do dot */
X (*t->move)(x,y);
X (*t->vector)(x,y);
X return;
X }
X
X number %= POINT_TYPES;
X htic = (t->h_tic/2); /* should be in term_tbl[] in later version */
X vtic = (t->v_tic/2);
X
X switch(number) {
X case 0: /* do diamond */
X (*t->move)(x-htic,y);
X (*t->vector)(x,y-vtic);
X (*t->vector)(x+htic,y);
X (*t->vector)(x,y+vtic);
X (*t->vector)(x-htic,y);
X (*t->move)(x,y);
X (*t->vector)(x,y);
X break;
X case 1: /* do plus */
X (*t->move)(x-htic,y);
X (*t->vector)(x-htic,y);
X (*t->vector)(x+htic,y);
X (*t->move)(x,y-vtic);
X (*t->vector)(x,y-vtic);
X (*t->vector)(x,y+vtic);
X break;
X case 2: /* do box */
X (*t->move)(x-htic,y-vtic);
X (*t->vector)(x-htic,y-vtic);
X (*t->vector)(x+htic,y-vtic);
X (*t->vector)(x+htic,y+vtic);
X (*t->vector)(x-htic,y+vtic);
X (*t->vector)(x-htic,y-vtic);
X (*t->move)(x,y);
X (*t->vector)(x,y);
X break;
X case 3: /* do X */
X (*t->move)(x-htic,y-vtic);
X (*t->vector)(x-htic,y-vtic);
X (*t->vector)(x+htic,y+vtic);
X (*t->move)(x-htic,y+vtic);
X (*t->vector)(x-htic,y+vtic);
X (*t->vector)(x+htic,y-vtic);
X break;
X case 4: /* do triangle */
X (*t->move)(x,y+(4*vtic/3));
X (*t->vector)(x-(4*htic/3),y-(2*vtic/3));
X (*t->vector)(x+(4*htic/3),y-(2*vtic/3));
X (*t->vector)(x,y+(4*vtic/3));
X (*t->move)(x,y);
X (*t->vector)(x,y);
X break;
X case 5: /* do star */
X (*t->move)(x-htic,y);
X (*t->vector)(x-htic,y);
X (*t->vector)(x+htic,y);
X (*t->move)(x,y-vtic);
X (*t->vector)(x,y-vtic);
X (*t->vector)(x,y+vtic);
X (*t->move)(x-htic,y-vtic);
X (*t->vector)(x-htic,y-vtic);
X (*t->vector)(x+htic,y+vtic);
X (*t->move)(x-htic,y+vtic);
X (*t->vector)(x-htic,y+vtic);
X (*t->vector)(x+htic,y-vtic);
X break;
X }
}
X
X
/*
X * general point routine
X */
line_and_point(x,y,number)
int x,y,number;
{
X /* temporary(?) kludge to allow terminals with bad linetypes
X to make nice marks */
X
X (*term_tbl[term].linetype)(NICE_LINE);
X do_point(x,y,number);
}
X
/*
X * general arrow routine
X */
#define ROOT2 (1.41421) /* sqrt of 2 */
X
do_arrow(sx, sy, ex, ey, head)
X int sx,sy; /* start point */
X int ex, ey; /* end point (point of arrowhead) */
X BOOLEAN head;
{
X register struct termentry *t = &term_tbl[term];
X int len = (t->h_tic + t->v_tic)/2; /* arrowhead size = avg of tic sizes */
X
X /* draw the line for the arrow. That's easy. */
X (*t->move)(sx, sy);
X (*t->vector)(ex, ey);
X
X if (head) {
X /* now draw the arrow head. */
X /* we put the arrowhead marks at 45 degrees to line */
X if (sx == ex) {
X /* vertical line, special case */
X int delta = ((float)len / ROOT2 + 0.5);
X if (sy < ey)
X delta = -delta; /* up arrow goes the other way */
X (*t->move)(ex - delta, ey + delta);
X (*t->vector)(ex,ey);
X (*t->vector)(ex + delta, ey + delta);
X } else {
X int dx = sx - ex;
X int dy = sy - ey;
X double coeff = len / sqrt(2.0*((double)dx*(double)dx
X + (double)dy*(double)dy));
X int x,y; /* one endpoint */
X
X x = (int)( ex + (dx + dy) * coeff );
X y = (int)( ey + (dy - dx) * coeff );
X (*t->move)(x,y);
X (*t->vector)(ex,ey);
X
X x = (int)( ex + (dx - dy) * coeff );
X y = (int)( ey + (dy + dx) * coeff );
X (*t->vector)(x,y);
X }
X }
}
X
#ifdef DUMB /* paper or glass dumb terminal */
#include "term/dumb.trm"
#endif
X
X
#ifdef PC /* all PC types */
#include "term/pc.trm"
#endif
X
/*
X all TEK types (TEK,BITGRAPH,KERMIT,VTTEK,SELANAR) are ifdef'd in tek.trm,
X but most require various TEK routines. Hence TEK must be defined for
X the others to compile.
*/
#ifdef BITGRAPH
# ifndef TEK
# define TEK
# endif
#endif
X
#ifdef SELENAR
# ifndef TEK
# define TEK
# endif
#endif
X
#ifdef KERMIT
# ifndef TEK
# define TEK
# endif
#endif
X
#ifdef LN03P
# ifndef TEK
# define TEK
# endif
#endif
X
#ifdef VTTEK
# ifndef TEK
# define TEK
# endif
#endif
X
#ifdef T410X /* Tektronix 4106, 4107, 4109 and 420x terminals */
#include "term/t410x.trm"
#endif
X
#ifdef TEK /* all TEK types, TEK, BBN, SELANAR, KERMIT, VTTEK */
#include "term/tek.trm"
#endif
X
#ifdef EPSONP /* bit map types, EPSON, NEC, PROPRINTER, STAR Color */
#include "term/epson.trm"
#endif
X
#ifdef HPLJII /* HP LaserJet II */
#include "term/hpljii.trm"
#endif
X
#ifdef HPLJII /* HP LaserJet III in HPGL mode */
# ifndef HPGL
# define HPGL
# endif
#endif
X
#ifdef FIG /* Fig 1.4FS Interactive graphics program */
#include "term/fig.trm"
#include "term/bigfig.trm"
#endif
X
#ifdef GPR /* Apollo Graphics Primitive Resource (fixed-size window) */
#include "term/gpr.trm"
#endif /* GPR */
X
#ifdef APOLLO /* Apollo Graphics Primitive Resource (resizable window) */
#include "term/apollo.trm"
#endif /* APOLLO */
X
#ifdef IMAGEN /* IMAGEN printer */
#include "term/imagen.trm"
#endif
X
#ifdef EEPIC /* EEPIC (LATEX) type */
#include "term/eepic.trm"
# ifndef LATEX
# define LATEX
# endif
#endif
X
#ifdef EMTEX /* EMTEX (LATEX for PC) type */
# ifndef LATEX
# define LATEX
# endif
#endif
X
#ifdef LATEX /* LATEX type */
#include "term/latex.trm"
#endif
X
#ifdef POSTSCRIPT /* POSTSCRIPT type */
#include "term/post.trm"
#endif
X
#ifdef PRESCRIBE /* PRESCRIBE type */
#include "term/kyo.trm"
#endif
X
#ifdef UNIXPC /* unix-PC ATT 7300 or 3b1 machine */
#include "term/unixpc.trm"
#endif /* UNIXPC */
X
#ifdef AED
#include "term/aed.trm"
#endif /* AED */
X
#ifdef CGI
#include "term/cgi.trm"
#endif /* CGI */
X
#ifdef HP2648
/* also works for HP2647 */
#include "term/hp2648.trm"
#endif /* HP2648 */
X
#ifdef HP26
#include "term/hp26.trm"
#endif /* HP26 */
X
#ifdef HP75
#ifndef HPGL
#define HPGL
#endif
#endif
X
/* HPGL - includes HP75 and HPLJIII in HPGL mode */
#ifdef HPGL
#include "term/hpgl.trm"
#endif /* HPGL */
X
/* Roland DXY800A plotter driver by Martin Yii, eln557h@monu3.OZ
X and Russell Lang, rjl@monu1.cc.monash.oz */
#ifdef DXY800A
#include "term/dxy.trm"
#endif /* DXY800A */
X
#ifdef IRIS4D
#include "term/iris4d.trm"
#endif /* IRIS4D */
X
#ifdef QMS
#include "term/qms.trm"
#endif /* QMS */
X
#ifdef REGIS
#include "term/regis.trm"
#endif /* REGIS */
X
#ifdef SUN
#include "term/sun.trm"
#endif /* SUN */
X
#ifdef VWS
#include "term/vws.trm"
#endif /* VWS */
X
#ifdef V384
#include "term/v384.trm"
#endif /* V384 */
X
#ifdef UNIXPLOT
#include "term/unixplot.trm"
#endif /* UNIXPLOT */
X
#ifdef X11
#include "term/x11.trm"
#endif /* X11 */
X
#ifdef DXF
#include "term/dxf.trm"
#endif /* DXF */
X
#ifdef AMIGASCREEN
#include "term/amiga.trm"
#endif
X
X
/* Dummy functions for unavailable features */
X
/* change angle of text. 0 is horizontal left to right.
* 1 is vertical bottom to top (90 deg rotate)
*/
static int null_text_angle()
{
return FALSE ; /* can't be done */
}
X
/* change justification of text.
X * modes are LEFT (flush left), CENTRE (centred), RIGHT (flush right)
X */
static int null_justify_text()
{
return FALSE ; /* can't be done */
}
X
X
/* Change scale of plot.
X * Parameters are x,y scaling factors for this plot.
X * Some terminals (eg latex) need to do scaling themselves.
X */
static int null_scale()
{
return FALSE ; /* can't be done */
}
X
static int do_scale()
{
return TRUE ; /* can be done */
}
X
options_null()
{
X term_options[0] = '\0'; /* we have no options */
}
X
static UNKNOWN_null()
{
}
X
/*
X * term_tbl[] contains an entry for each terminal. "unknown" must be the
X * first, since term is initialized to 0.
X */
struct termentry term_tbl[] = {
X {"unknown", "Unknown terminal type - not a plotting device",
X 100, 100, 1, 1,
X 1, 1, options_null, UNKNOWN_null, UNKNOWN_null,
X UNKNOWN_null, null_scale, UNKNOWN_null, UNKNOWN_null, UNKNOWN_null,
X UNKNOWN_null, UNKNOWN_null, null_text_angle,
X null_justify_text, UNKNOWN_null, UNKNOWN_null}
X
#ifdef AMIGASCREEN
X ,{"amiga", "Amiga Custom Screen",
X AMIGA_XMAX, AMIGA_YMAX, AMIGA_VCHAR, AMIGA_HCHAR,
X AMIGA_VTIC, AMIGA_HTIC, options_null, AMIGA_init, AMIGA_reset,
X AMIGA_text, null_scale, AMIGA_graphics, AMIGA_move, AMIGA_vector,
X AMIGA_linetype, AMIGA_put_text, null_text_angle,
X AMIGA_justify_text, do_point, do_arrow}
#endif
X
#ifdef DUMB
X ,{"dumb", "printer or glass dumb terminal",
X DUMB_XMAX, DUMB_YMAX, 1, 1,
X 1, 1, DUMB_options, DUMB_init, DUMB_reset,
X DUMB_text, null_scale, DUMB_graphics, DUMB_move, DUMB_vector,
X DUMB_linetype, DUMB_put_text, null_text_angle,
X null_justify_text, DUMB_point, DUMB_arrow}
#endif
X
#ifdef PC
#ifdef __TURBOC__
X
X ,{"egalib", "IBM PC/Clone with EGA graphics board",
X EGALIB_XMAX, EGALIB_YMAX, EGALIB_VCHAR, EGALIB_HCHAR,
X EGALIB_VTIC, EGALIB_HTIC, options_null, EGALIB_init, EGALIB_reset,
X EGALIB_text, null_scale, EGALIB_graphics, EGALIB_move, EGALIB_vector,
X EGALIB_linetype, EGALIB_put_text, EGALIB_text_angle,
X EGALIB_justify_text, do_point, do_arrow}
X
X ,{"vgalib", "IBM PC/Clone with VGA graphics board",
X VGA_XMAX, VGA_YMAX, VGA_VCHAR, VGA_HCHAR,
X VGA_VTIC, VGA_HTIC, options_null, VGA_init, VGA_reset,
X VGA_text, null_scale, VGA_graphics, VGA_move, VGA_vector,
X VGA_linetype, VGA_put_text, VGA_text_angle,
X VGA_justify_text, do_point, do_arrow}
X
X ,{"vgamono", "IBM PC/Clone with VGA Monochrome graphics board",
X VGA_XMAX, VGA_YMAX, VGA_VCHAR, VGA_HCHAR,
X VGA_VTIC, VGA_HTIC, options_null, VGA_init, VGA_reset,
X VGA_text, null_scale, VGA_graphics, VGA_move, VGA_vector,
X VGAMONO_linetype, VGA_put_text, VGA_text_angle,
X VGA_justify_text, line_and_point, do_arrow}
X
X ,{"svga", "IBM PC/Clone with Super VGA graphics board",
X SVGA_XMAX, SVGA_YMAX, SVGA_VCHAR, SVGA_HCHAR,
X SVGA_VTIC, SVGA_HTIC, options_null, SVGA_init, SVGA_reset,
X SVGA_text, null_scale, SVGA_graphics, SVGA_move, SVGA_vector,
X SVGA_linetype, SVGA_put_text, SVGA_text_angle,
X SVGA_justify_text, do_point, do_arrow}
X
X ,{"mcga", "IBM PC/Clone with MCGA graphics board",
X MCGA_XMAX, MCGA_YMAX, MCGA_VCHAR, MCGA_HCHAR,
X MCGA_VTIC, MCGA_HTIC, options_null, MCGA_init, MCGA_reset,
X MCGA_text, null_scale, MCGA_graphics, MCGA_move, MCGA_vector,
X MCGA_linetype, MCGA_put_text, MCGA_text_angle,
X MCGA_justify_text, line_and_point, do_arrow}
X
X ,{"cga", "IBM PC/Clone with CGA graphics board",
X CGA_XMAX, CGA_YMAX, CGA_VCHAR, CGA_HCHAR,
X CGA_VTIC, CGA_HTIC, options_null, CGA_init, CGA_reset,
X CGA_text, null_scale, CGA_graphics, CGA_move, CGA_vector,
X CGA_linetype, CGA_put_text, MCGA_text_angle,
X CGA_justify_text, line_and_point, do_arrow}
X
X ,{"hercules", "IBM PC/Clone with Hercules graphics board",
X HERC_XMAX, HERC_YMAX, HERC_VCHAR, HERC_HCHAR,
X HERC_VTIC, HERC_HTIC, options_null, HERC_init, HERC_reset,
X HERC_text, null_scale, HERC_graphics, HERC_move, HERC_vector,
X HERC_linetype, HERC_put_text, MCGA_text_angle,
X HERC_justify_text, line_and_point, do_arrow}
#ifdef ATT6300
X ,{"att", "IBM PC/Clone with AT&T 6300 graphics board",
X ATT_XMAX, ATT_YMAX, ATT_VCHAR, ATT_HCHAR,
X ATT_VTIC, ATT_HTIC, options_null, ATT_init, ATT_reset,
X ATT_text, null_scale, ATT_graphics, ATT_move, ATT_vector,
X ATT_linetype, ATT_put_text, ATT_text_angle,
X ATT_justify_text, line_and_point, do_arrow}
#endif
#else /* TURBO */
X
X ,{"cga", "IBM PC/Clone with CGA graphics board",
X CGA_XMAX, CGA_YMAX, CGA_VCHAR, CGA_HCHAR,
X CGA_VTIC, CGA_HTIC, options_null, CGA_init, CGA_reset,
X CGA_text, null_scale, CGA_graphics, CGA_move, CGA_vector,
X CGA_linetype, CGA_put_text, CGA_text_angle,
X null_justify_text, line_and_point, do_arrow}
X
X ,{"egabios", "IBM PC/Clone with EGA graphics board (BIOS)",
X EGA_XMAX, EGA_YMAX, EGA_VCHAR, EGA_HCHAR,
X EGA_VTIC, EGA_HTIC, options_null, EGA_init, EGA_reset,
X EGA_text, null_scale, EGA_graphics, EGA_move, EGA_vector,
X EGA_linetype, EGA_put_text, EGA_text_angle,
X null_justify_text, do_point, do_arrow}
X
X ,{"vgabios", "IBM PC/Clone with VGA graphics board (BIOS)",
X VGA_XMAX, VGA_YMAX, VGA_VCHAR, VGA_HCHAR,
X VGA_VTIC, VGA_HTIC, options_null, VGA_init, VGA_reset,
X VGA_text, null_scale, VGA_graphics, VGA_move, VGA_vector,
X VGA_linetype, VGA_put_text, VGA_text_angle,
X null_justify_text, do_point, do_arrow}
X
#ifdef EGALIB
X ,{"egalib", "IBM PC/Clone with EGA graphics board (LIB)",
X EGALIB_XMAX, EGALIB_YMAX, EGALIB_VCHAR, EGALIB_HCHAR,
X EGALIB_VTIC, EGALIB_HTIC, options_null, EGALIB_init, EGALIB_reset,
X EGALIB_text, null_scale, EGALIB_graphics, EGALIB_move, EGALIB_vector,
X EGALIB_linetype, EGALIB_put_text, null_text_angle,
X null_justify_text, do_point, do_arrow}
#endif
X
#ifdef HERCULES
X ,{"hercules", "IBM PC/Clone with Hercules graphics board",
X HERC_XMAX, HERC_YMAX, HERC_VCHAR, HERC_HCHAR,
X HERC_VTIC, HERC_HTIC, options_null, HERC_init, HERC_reset,
X HERC_text, null_scale, HERC_graphics, HERC_move, HERC_vector,
X HERC_linetype, HERC_put_text, HERC_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif /* HERCULES */
X
#ifdef ATT6300
X ,{"att", "AT&T PC/6300 graphics",
X ATT_XMAX, ATT_YMAX, ATT_VCHAR, ATT_HCHAR,
X ATT_VTIC, ATT_HTIC, options_null, ATT_init, ATT_reset,
X ATT_text, null_scale, ATT_graphics, ATT_move, ATT_vector,
X ATT_linetype, ATT_put_text, ATT_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef CORONA
X ,{"corona325", "Corona graphics ???",
X COR_XMAX, COR_YMAX, COR_VCHAR, COR_HCHAR,
X COR_VTIC, COR_HTIC, options_null, COR_init, COR_reset,
X COR_text, null_scale, COR_graphics, COR_move, COR_vector,
X COR_linetype, COR_put_text, COR_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif /* CORONA */
#endif /* TURBO */
#endif /* PC */
X
#ifdef AED
X ,{"aed512", "AED 512 Terminal",
X AED5_XMAX, AED_YMAX, AED_VCHAR, AED_HCHAR,
X AED_VTIC, AED_HTIC, options_null, AED_init, AED_reset,
X AED_text, null_scale, AED_graphics, AED_move, AED_vector,
X AED_linetype, AED_put_text, null_text_angle,
X null_justify_text, do_point, do_arrow}
X ,{"aed767", "AED 767 Terminal",
X AED_XMAX, AED_YMAX, AED_VCHAR, AED_HCHAR,
X AED_VTIC, AED_HTIC, options_null, AED_init, AED_reset,
X AED_text, null_scale, AED_graphics, AED_move, AED_vector,
X AED_linetype, AED_put_text, null_text_angle,
X null_justify_text, do_point, do_arrow}
#endif
X
#ifdef APOLLO
X ,{"apollo", "Apollo Graphics Primitive Resource, rescaling of subsequent plots after window resizing",
X 0, 0, 0, 0, /* APOLLO_XMAX, APOLLO_YMAX, APOLLO_VCHAR, APOLLO_HCHAR, are filled in at run-time */
X APOLLO_VTIC, APOLLO_HTIC, options_null, APOLLO_init, APOLLO_reset,
X APOLLO_text, null_scale, APOLLO_graphics, APOLLO_move, APOLLO_vector,
X APOLLO_linetype, APOLLO_put_text, APOLLO_text_angle,
X APOLLO_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef GPR
X ,{"gpr", "Apollo Graphics Primitive Resource, fixed-size window",
X GPR_XMAX, GPR_YMAX, GPR_VCHAR, GPR_HCHAR,
X GPR_VTIC, GPR_HTIC, options_null, GPR_init, GPR_reset,
X GPR_text, null_scale, GPR_graphics, GPR_move, GPR_vector,
X GPR_linetype, GPR_put_text, GPR_text_angle,
X GPR_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef BITGRAPH
X ,{"bitgraph", "BBN Bitgraph Terminal",
X BG_XMAX,BG_YMAX,BG_VCHAR, BG_HCHAR,
X BG_VTIC, BG_HTIC, options_null, BG_init, BG_reset,
X BG_text, null_scale, BG_graphics, BG_move, BG_vector,
X BG_linetype, BG_put_text, null_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef CGI
X ,{"cgi", "SCO CGI drivers (requires CGIDISP or CGIPRNT env variable)",
X CGI_XMAX, CGI_YMAX, 0, 0,
X CGI_VTIC, 0, options_null, CGI_init, CGI_reset,
X CGI_text, null_scale, CGI_graphics, CGI_move, CGI_vector,
X CGI_linetype, CGI_put_text, CGI_text_angle,
X CGI_justify_text, CGI_point, do_arrow}
X
X ,{"hcgi", "SCO CGI drivers (hardcopy, requires CGIPRNT env variable)",
X CGI_XMAX, CGI_YMAX, 0, 0,
X CGI_VTIC, 0, options_null, HCGI_init, CGI_reset,
X CGI_text, null_scale, CGI_graphics, CGI_move, CGI_vector,
X CGI_linetype, CGI_put_text, CGI_text_angle,
X CGI_justify_text, CGI_point, do_arrow}
#endif
X
#ifdef DXF
X ,{"dxf", "dxf-file for AutoCad (default size 120x80)",
X DXF_XMAX,DXF_YMAX,DXF_VCHAR, DXF_HCHAR,
X DXF_VTIC, DXF_HTIC, options_null,DXF_init, DXF_reset,
X DXF_text, null_scale, DXF_graphics, DXF_move, DXF_vector,
X DXF_linetype, DXF_put_text, DXF_text_angle,
X DXF_justify_text, do_point, do_arrow}
#endif
X
#ifdef DXY800A
X ,{"dxy800a", "Roland DXY800A plotter",
X DXY_XMAX, DXY_YMAX, DXY_VCHAR, DXY_HCHAR,
X DXY_VTIC, DXY_HTIC, options_null, DXY_init, DXY_reset,
X DXY_text, null_scale, DXY_graphics, DXY_move, DXY_vector,
X DXY_linetype, DXY_put_text, DXY_text_angle,
X null_justify_text, do_point, do_arrow}
#endif
X
#ifdef EEPIC
X ,{"eepic", "EEPIC -- extended LaTeX picture environment",
X EEPIC_XMAX, EEPIC_YMAX, EEPIC_VCHAR, EEPIC_HCHAR,
X EEPIC_VTIC, EEPIC_HTIC, options_null, EEPIC_init, EEPIC_reset,
X EEPIC_text, EEPIC_scale, EEPIC_graphics, EEPIC_move, EEPIC_vector,
X EEPIC_linetype, EEPIC_put_text, EEPIC_text_angle,
X EEPIC_justify_text, EEPIC_point, EEPIC_arrow}
#endif
X
#ifdef EMTEX
X
X ,{"emtex", "LATEX picture environment with emTeX specials",
X LATEX_XMAX, LATEX_YMAX, LATEX_VCHAR, LATEX_HCHAR,
X LATEX_VTIC, LATEX_HTIC, options_null, EMTEX_init, EMTEX_reset,
X EMTEX_text, LATEX_scale, LATEX_graphics, LATEX_move, LATEX_vector,
X LATEX_linetype, LATEX_put_text, LATEX_text_angle,
X LATEX_justify_text, LATEX_point, LATEX_arrow}
#endif
X
#ifdef EPS60
X ,{"epson_60dpi", "Epson-style 60-dot per inch printers",
X EPS60XMAX, EPS60YMAX, EPSONVCHAR, EPSONHCHAR,
X EPSONVTIC, EPSONHTIC, options_null, EPSONinit, EPSONreset,
X EPS60text, null_scale, EPS60graphics, EPSONmove, EPSONvector,
X EPSONlinetype, EPSONput_text, EPSON_text_angle,
X null_justify_text, do_point, do_arrow}
#endif
X
#ifdef EPSONP
X ,{"epson_lx800", "Epson LX-800, Star NL-10, NX-1000, PROPRINTER ...",
X EPSONXMAX, EPSONYMAX, EPSONVCHAR, EPSONHCHAR,
X EPSONVTIC, EPSONHTIC, options_null, EPSONinit, EPSONreset,
X EPSONtext, null_scale, EPSONgraphics, EPSONmove, EPSONvector,
X EPSONlinetype, EPSONput_text, EPSON_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef FIG
X ,{"fig", "FIG graphics language: SunView or X graphics editor",
X FIG_XMAX, FIG_YMAX, FIG_VCHAR, FIG_HCHAR,
X FIG_VTIC, FIG_HTIC, options_null, FIG_init, FIG_reset,
X FIG_text, null_scale, FIG_graphics, FIG_move, FIG_vector,
X FIG_linetype, FIG_put_text, FIG_text_angle,
X FIG_justify_text, do_point, FIG_arrow}
X ,{"bfig", "FIG graphics language: SunView or X graphics editor. Large Graph",
X BFIG_XMAX, BFIG_YMAX, BFIG_VCHAR, BFIG_HCHAR,
X BFIG_VTIC, BFIG_HTIC, options_null, FIG_init, FIG_reset,
X FIG_text, null_scale, FIG_graphics, FIG_move, BFIG_vector,
X FIG_linetype, BFIG_put_text, FIG_text_angle,
X FIG_justify_text, do_point, BFIG_arrow}
#endif
X
#ifdef HP26
X ,{"hp2623A", "HP2623A and maybe others",
X HP26_XMAX, HP26_YMAX, HP26_VCHAR, HP26_HCHAR,
X HP26_VTIC, HP26_HTIC, options_null, HP26_init, HP26_reset,
X HP26_text, null_scale, HP26_graphics, HP26_move, HP26_vector,
X HP26_linetype, HP26_put_text, null_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef HP2648
X ,{"hp2648", "HP2648 and HP2647",
X HP2648XMAX, HP2648YMAX, HP2648VCHAR, HP2648HCHAR,
X HP2648VTIC, HP2648HTIC, options_null, HP2648init, HP2648reset,
X HP2648text, null_scale, HP2648graphics, HP2648move, HP2648vector,
X HP2648linetype, HP2648put_text, HP2648_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef HP75
X ,{"hp7580B", "HP7580, and probably other HPs (4 pens)",
X HPGL_XMAX, HPGL_YMAX, HPGL_VCHAR, HPGL_HCHAR,
X HPGL_VTIC, HPGL_HTIC, options_null, HPGL_init, HPGL_reset,
X HPGL_text, null_scale, HPGL_graphics, HPGL_move, HPGL_vector,
X HP75_linetype, HPGL_put_text, HPGL_text_angle,
X null_justify_text, do_point, do_arrow}
#endif
X
#ifdef HPGL
X ,{"hpgl", "HP7475 and (hopefully) lots of others (6 pens)",
X HPGL_XMAX, HPGL_YMAX, HPGL_VCHAR, HPGL_HCHAR,
X HPGL_VTIC, HPGL_HTIC, options_null, HPGL_init, HPGL_reset,
X HPGL_text, null_scale, HPGL_graphics, HPGL_move, HPGL_vector,
X HPGL_linetype, HPGL_put_text, HPGL_text_angle,
X null_justify_text, do_point, do_arrow}
#endif
X
#ifdef HPLJII
X ,{"hpljii", "HP Laserjet series II, [75 100 150 300]",
X HPLJII_75PPI_XMAX, HPLJII_75PPI_YMAX, HPLJII_75PPI_VCHAR,
X HPLJII_75PPI_HCHAR, HPLJII_75PPI_VTIC, HPLJII_75PPI_HTIC, HPLJIIoptions,
X HPLJIIinit, HPLJIIreset, HPLJIItext, null_scale,
X HPLJIIgraphics, HPLJIImove, HPLJIIvector, HPLJIIlinetype,
X HPLJIIput_text, HPLJIItext_angle, null_justify_text, line_and_point,
X do_arrow}
X ,{"hpdj", "HP DeskJet 500, [75 100 150 300]",
X HPLJII_75PPI_XMAX, HPLJII_75PPI_YMAX, HPLJII_75PPI_VCHAR,
X HPLJII_75PPI_HCHAR, HPLJII_75PPI_VTIC, HPLJII_75PPI_HTIC, HPLJIIoptions,
X HPLJIIinit, HPLJIIreset, HPDJtext, null_scale,
X HPDJgraphics, HPLJIImove, HPLJIIvector, HPLJIIlinetype,
X HPDJput_text, HPDJtext_angle, null_justify_text, line_and_point,
X do_arrow}
#endif
X
#ifdef HPLJIII
X ,{"hpljiii_port", "HP laserjet iii (using HPGL plot vectors), portrait mode",
X HPGL_XMAX, HPGL_YMAX, HPGL_VCHAR, HPGL_HCHAR,
X HPGL_VTIC, HPGL_HTIC, options_null, HPLJIII_PORT_init, HPLJIII_reset,
X HPGL_text, null_scale, HPGL_graphics, HPGL_move, HPGL_vector,
X HPGL_linetype, HPGL_put_text, HPGL_text_angle,
X null_justify_text, do_point, do_arrow}
X ,{"hpljiii_land", "HP laserjet iii (using HPGL plot vectors), landscape mode",
X HPGL_XMAX, HPGL_YMAX, HPGL_VCHAR, HPGL_HCHAR,
X HPGL_VTIC, HPGL_HTIC, options_null, HPLJIII_LAND_init, HPLJIII_reset,
X HPGL_text, null_scale, HPGL_graphics, HPGL_move, HPGL_vector,
X HPGL_linetype, HPGL_put_text, HPGL_text_angle,
X null_justify_text, do_point, do_arrow}
#endif
X
#ifdef IMAGEN
X ,{"imagen", "Imagen laser printer",
X IMAGEN_XMAX, IMAGEN_YMAX, IMAGEN_VCHAR, IMAGEN_HCHAR,
X IMAGEN_VTIC, IMAGEN_HTIC, options_null, IMAGEN_init, IMAGEN_reset,
X IMAGEN_text, null_scale, IMAGEN_graphics, IMAGEN_move,
X IMAGEN_vector, IMAGEN_linetype, IMAGEN_put_text, IMAGEN_text_angle,
X IMAGEN_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef IRIS4D
X ,{"iris4d", "Silicon Graphics IRIS 4D Series Computer",
X IRIS4D_XMAX, IRIS4D_YMAX, IRIS4D_VCHAR, IRIS4D_HCHAR,
X IRIS4D_VTIC, IRIS4D_HTIC, IRIS4D_options, IRIS4D_init, IRIS4D_reset,
X IRIS4D_text, null_scale, IRIS4D_graphics, IRIS4D_move, IRIS4D_vector,
X IRIS4D_linetype, IRIS4D_put_text, null_text_angle,
X null_justify_text, do_point, do_arrow}
#endif
X
#ifdef KERMIT
X ,{"kc_tek40xx", "Kermit-MS tek40xx terminal emulator - color",
X TEK40XMAX,TEK40YMAX,TEK40VCHAR, KTEK40HCHAR,
X TEK40VTIC, TEK40HTIC, options_null, TEK40init, KTEK40reset,
X KTEK40Ctext, null_scale, KTEK40graphics, TEK40move, TEK40vector,
X KTEK40Clinetype, TEK40put_text, null_text_angle,
X null_justify_text, do_point, do_arrow}
X ,{"km_tek40xx", "Kermit-MS tek40xx terminal emulator - monochrome",
X TEK40XMAX,TEK40YMAX,TEK40VCHAR, KTEK40HCHAR,
X TEK40VTIC, TEK40HTIC, options_null, TEK40init, KTEK40reset,
X TEK40text, null_scale, KTEK40graphics, TEK40move, TEK40vector,
X KTEK40Mlinetype, TEK40put_text, null_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef LATEX
X ,{"latex", "LaTeX picture environment",
X LATEX_XMAX, LATEX_YMAX, LATEX_VCHAR, LATEX_HCHAR,
X LATEX_VTIC, LATEX_HTIC, options_null, LATEX_init, LATEX_reset,
X LATEX_text, LATEX_scale, LATEX_graphics, LATEX_move, LATEX_vector,
X LATEX_linetype, LATEX_put_text, LATEX_text_angle,
X LATEX_justify_text, LATEX_point, LATEX_arrow}
#endif
X
#ifdef LN03P
X ,{"ln03", "LN03-plus laser printer in tektronix mode",
X TEK40XMAX, TEK40YMAX, TEK40VCHAR, TEK40HCHAR,
X TEK40VTIC, TEK40HTIC, options_null, LN03Pinit, LN03Preset,
X TEK40text, null_scale, TEK40graphics, TEK40move, TEK40vector,
X TEK40linetype, TEK40put_text, null_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef NEC
X ,{"nec_cp6m", "NEC printer CP6, Epson LQ-800 Monochrome",
X NECXMAX, NECYMAX, NECVCHAR, NECHCHAR,
X NECVTIC, NECHTIC, options_null, NECinit, NECreset,
X NECtext, null_scale, NECMgraphics, NECmove, NECvector,
X NECMlinetype, NECput_text, NEC_text_angle,
X null_justify_text, line_and_point, do_arrow}
X ,{"nec_cp6c", "NEC printer CP6 Color",
X NECXMAX, NECYMAX, NECVCHAR, NECHCHAR,
X NECVTIC, NECHTIC, options_null, NECinit, NECreset,
X NECtext, null_scale, NECCgraphics, NECmove, NECvector,
X NECClinetype, NECput_text, NEC_text_angle,
X null_justify_text, do_point, do_arrow}
X ,{"nec_cp6d", "NEC printer CP6, Epson LQ-800 Draft monochrome",
X NECXMAX, NECYMAX, NECVCHAR, NECHCHAR,
X NECVTIC, NECHTIC, options_null, NECinit, NECreset,
X NECdraft_text, null_scale, NECMgraphics, NECmove, NECvector,
X NECMlinetype, NECput_text, NEC_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef POSTSCRIPT
X ,{"postscript", "PostScript graphics language [mode \042fontname\042 font_size]",
X PS_XMAX, PS_YMAX, PS_VCHAR, PS_HCHAR,
X PS_VTIC, PS_HTIC, PS_options, PS_init, PS_reset,
X PS_text, do_scale, PS_graphics, PS_move, PS_vector,
X PS_linetype, PS_put_text, PS_text_angle,
X PS_justify_text, PS_point, do_arrow}
#endif
X
#ifdef PRESCRIBE
X ,{"prescribe", "Prescribe - for the Kyocera Laser Printer",
X PRE_XMAX, PRE_YMAX, PRE_VCHAR, PRE_HCHAR,
X PRE_VTIC, PRE_HTIC, options_null, PRE_init, PRE_reset,
X PRE_text, null_scale, PRE_graphics, PRE_move, PRE_vector,
X PRE_linetype, PRE_put_text, null_text_angle,
X PRE_justify_text, line_and_point, do_arrow}
X ,{"kyo", "Kyocera Laser Printer with Courier font",
X PRE_XMAX, PRE_YMAX, KYO_VCHAR, KYO_HCHAR,
X PRE_VTIC, PRE_HTIC, options_null, KYO_init, PRE_reset,
X PRE_text, null_scale, PRE_graphics, PRE_move, PRE_vector,
X PRE_linetype, PRE_put_text, null_text_angle,
X PRE_justify_text, line_and_point, do_arrow}
#endif /* PRESCRIBE */
X
#ifdef QMS
X ,{"qms", "QMS/QUIC Laser printer (also Talaris 1200 and others)",
X QMS_XMAX,QMS_YMAX, QMS_VCHAR, QMS_HCHAR,
X QMS_VTIC, QMS_HTIC, options_null, QMS_init,QMS_reset,
X QMS_text, null_scale, QMS_graphics, QMS_move, QMS_vector,
X QMS_linetype,QMS_put_text, null_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef REGIS
X ,{"regis", "REGIS graphics language",
X REGISXMAX, REGISYMAX, REGISVCHAR, REGISHCHAR,
X REGISVTIC, REGISHTIC, options_null, REGISinit, REGISreset,
X REGIStext, null_scale, REGISgraphics, REGISmove, REGISvector,
X REGISlinetype, REGISput_text, REGIStext_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
X
#ifdef SELANAR
X ,{"selanar", "Selanar",
X TEK40XMAX, TEK40YMAX, TEK40VCHAR, TEK40HCHAR,
X TEK40VTIC, TEK40HTIC, options_null, SEL_init, SEL_reset,
X SEL_text, null_scale, SEL_graphics, TEK40move, TEK40vector,
X TEK40linetype, TEK40put_text, null_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef STARC
X ,{"starc", "Star Color Printer",
X STARCXMAX, STARCYMAX, STARCVCHAR, STARCHCHAR,
X STARCVTIC, STARCHTIC, options_null, STARCinit, STARCreset,
X STARCtext, null_scale, STARCgraphics, STARCmove, STARCvector,
X STARClinetype, STARCput_text, STARC_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef SUN
X ,{"sun", "SunView window system",
X SUN_XMAX, SUN_YMAX, SUN_VCHAR, SUN_HCHAR,
X SUN_VTIC, SUN_HTIC, options_null, SUN_init, SUN_reset,
X SUN_text, null_scale, SUN_graphics, SUN_move, SUN_vector,
X SUN_linetype, SUN_put_text, null_text_angle,
X SUN_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef VWS
X ,{"VWS", "VAX Windowing System (UIS)",
X VWS_XMAX, VWS_YMAX, VWS_VCHAR, VWS_HCHAR,
X VWS_VTIC, VWS_HTIC, options_null, VWS_init, VWS_reset,
X VWS_text, null_scale, VWS_graphics, VWS_move, VWS_vector,
X VWS_linetype, VWS_put_text, VWS_text_angle,
X VWS_justify_text, do_point, do_arrow}
#endif
X
#ifdef TANDY60
X ,{"tandy_60dpi", "Tandy DMP-130 series 60-dot per inch graphics",
X EPS60XMAX, EPS60YMAX, EPSONVCHAR, EPSONHCHAR,
X EPSONVTIC, EPSONHTIC, options_null, EPSONinit, EPSONreset,
X TANDY60text, null_scale, EPS60graphics, EPSONmove, EPSONvector,
X EPSONlinetype, EPSONput_text, EPSON_text_angle,
X null_justify_text, do_point, do_arrow}
#endif
X
#ifdef T410X
X ,{"tek410x", "Tektronix 4106, 4107, 4109 and 420X terminals",
X T410XXMAX, T410XYMAX, T410XVCHAR, T410XHCHAR,
X T410XVTIC, T410XHTIC, options_null, T410X_init, T410X_reset,
X T410X_text, null_scale, T410X_graphics, T410X_move, T410X_vector,
X T410X_linetype, T410X_put_text, T410X_text_angle,
X null_justify_text, T410X_point, do_arrow}
#endif
X
#ifdef TEK
X ,{"tek40xx", "Tektronix 4010 and others; most TEK emulators",
X TEK40XMAX, TEK40YMAX, TEK40VCHAR, TEK40HCHAR,
X TEK40VTIC, TEK40HTIC, options_null, TEK40init, TEK40reset,
X TEK40text, null_scale, TEK40graphics, TEK40move, TEK40vector,
X TEK40linetype, TEK40put_text, null_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef UNIXPLOT
X ,{"unixplot", "Unix plotting standard (see plot(1))",
X UP_XMAX, UP_YMAX, UP_VCHAR, UP_HCHAR,
X UP_VTIC, UP_HTIC, options_null, UP_init, UP_reset,
X UP_text, null_scale, UP_graphics, UP_move, UP_vector,
X UP_linetype, UP_put_text, null_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef UNIXPC
X ,{"unixpc", "AT&T 3b1 or AT&T 7300 Unix PC",
X uPC_XMAX, uPC_YMAX, uPC_VCHAR, uPC_HCHAR,
X uPC_VTIC, uPC_HTIC, options_null, uPC_init, uPC_reset,
X uPC_text, null_scale, uPC_graphics, uPC_move, uPC_vector,
X uPC_linetype, uPC_put_text, uPC_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef V384
X ,{"vx384", "Vectrix 384 and Tandy color printer",
X V384_XMAX, V384_YMAX, V384_VCHAR, V384_HCHAR,
X V384_VTIC, V384_HTIC, options_null, V384_init, V384_reset,
X V384_text, null_scale, V384_graphics, V384_move, V384_vector,
X V384_linetype, V384_put_text, null_text_angle,
X null_justify_text, do_point, do_arrow}
#endif
X
#ifdef VTTEK
X ,{"vttek", "VT-like tek40xx terminal emulator",
X TEK40XMAX,TEK40YMAX,TEK40VCHAR, TEK40HCHAR,
X TEK40VTIC, TEK40HTIC, options_null, VTTEK40init, VTTEK40reset,
X TEK40text, null_scale, TEK40graphics, TEK40move, TEK40vector,
X VTTEK40linetype, VTTEK40put_text, null_text_angle,
X null_justify_text, line_and_point, do_arrow}
#endif
X
#ifdef X11
X ,{"x11", "X11 Window System",
X X11_XMAX, X11_YMAX, X11_VCHAR, X11_HCHAR,
X X11_VTIC, X11_HTIC, options_null, X11_init, X11_reset,
X X11_text, null_scale, X11_graphics, X11_move, X11_vector,
X X11_linetype, X11_put_text, null_text_angle,
X X11_justify_text, line_and_point, do_arrow}
X ,{"X11", "X11 Window System - multi-color points",
X X11_XMAX, X11_YMAX, X11_VCHAR, X11_HCHAR,
X X11_VTIC, X11_HTIC, options_null, X11_init, X11_reset,
X X11_text, null_scale, X11_graphics, X11_move, X11_vector,
X X11_linetype, X11_put_text, null_text_angle,
X X11_justify_text, do_point, do_arrow}
#endif
};
X
#define TERMCOUNT (sizeof(term_tbl)/sizeof(struct termentry))
X
X
list_terms()
{
register int i;
X
X fprintf(stderr,"\nAvailable terminal types:\n");
X for (i = 0; i < TERMCOUNT; i++)
X fprintf(stderr," %15s %s\n",
X term_tbl[i].name, term_tbl[i].description);
X (void) putc('\n',stderr);
}
X
X
/* set_term: get terminal number from name on command line */
/* will change 'term' variable if successful */
int /* term number */
set_term(c_token)
int c_token;
{
X register int t;
X char *input_name;
X
X if (!token[c_token].is_token)
X int_error("terminal name expected",c_token);
X t = -1;
X input_name = input_line + token[c_token].start_index;
X t = change_term(input_name, token[c_token].length);
X if (t == -1)
X int_error("unknown terminal type; type just 'set terminal' for a list",
X c_token);
X if (t == -2)
X int_error("ambiguous terminal name; type just 'set terminal' for a list",
X c_token);
X
X /* otherwise the type was changed */
X
X return(t);
}
X
/* change_term: get terminal number from name and set terminal type */
/* returns -1 if unknown, -2 if ambiguous, >=0 is terminal number */
int
change_term(name, length)
X char *name;
X int length;
{
X int i, t = -1;
X
X for (i = 0; i < TERMCOUNT; i++) {
X if (!strncmp(name,term_tbl[i].name,length)) {
X if (t != -1)
X return(-2); /* ambiguous */
X t = i;
X }
X }
X
X if (t == -1) /* unknown */
X return(t);
X
X /* Success: set terminal type now */
X
X term = t;
X term_init = FALSE;
X name = term_tbl[term].name;
X
X /* Special handling for unixplot term type */
X if (!strncmp("unixplot",name,8)) {
X UP_redirect (2); /* Redirect actual stdout for unixplots */
X } else if (unixplot) {
X UP_redirect (3); /* Put stdout back together again. */
X }
X
X if (interactive)
X fprintf(stderr, "Terminal type set to '%s'\n", name);
X
X return(t);
}
X
/*
X Routine to detect what terminal is being used (or do anything else
X that would be nice). One anticipated (or allowed for) side effect
X is that the global ``term'' may be set.
X The environment variable GNUTERM is checked first; if that does
X not exist, then the terminal hardware is checked, if possible,
X and finally, we can check $TERM for some kinds of terminals.
*/
/* thanks to osupyr!alden (Dave Alden) for the original GNUTERM code */
init_terminal()
{
X char *term_name = NULL;
X int t;
X char *term = NULL; /* from TERM environment var */
#ifdef X11
X char *display = NULL;
#endif
X char *gnuterm = NULL;
X
X /* GNUTERM environment variable is primary */
X gnuterm = getenv("GNUTERM");
X if (gnuterm != (char *)NULL)
X term_name = gnuterm;
X else {
#ifdef __TURBOC__
X term_name = turboc_init();
X term = (char *)NULL; /* shut up turbo C */
#endif
X
#ifdef vms
X term_name = vms_init();
#endif
X
#ifdef SUN
X term = getenv("TERM"); /* try $TERM */
X if (term_name == (char *)NULL
X && term != (char *)NULL && strcmp(term, "sun") == 0)
X term_name = "sun";
#endif /* sun */
X
#ifdef GPR
X if (gpr_isa_pad()) term_name = "gpr"; /* find out whether stdout is a DM pad. See term/gpr.trm */
#else
#ifdef APOLLO
X if (apollo_isa_pad()) term_name = "apollo"; /* find out whether stdout is a DM pad. See term/apollo.trm */
#endif /* APOLLO */
#endif /* GPR */
X
#ifdef X11
X term = getenv("TERM"); /* try $TERM */
X if (term_name == (char *)NULL
X && term != (char *)NULL && strcmp(term, "xterm") == 0)
X term_name = "x11";
X display = getenv("DISPLAY");
X if (term_name == (char *)NULL && display != (char *)NULL)
X term_name = "x11";
#endif /* x11 */
X
#ifdef AMIGASCREEN
X term_name = "amiga";
#endif
X
#ifdef UNIXPC
X if (iswind() == 0) {
X term_name = "unixpc";
X }
#endif /* unixpc */
X
#ifdef CGI
X if (getenv("CGIDISP") || getenv("CGIPRNT"))
X term_name = "cgi";
#endif /*CGI */
X }
X
X /* We have a name, try to set term type */
X if (term_name != NULL && *term_name != '\0') {
X t = change_term(term_name, strlen(term_name));
X if (t == -1)
X fprintf(stderr, "Unknown terminal name '%s'\n", term_name);
X else if (t == -2)
X fprintf(stderr, "Ambiguous terminal name '%s'\n", term_name);
X else /* successful */
X ;
X }
}
X
X
#ifdef __TURBOC__
char *
turboc_init()
{
X int g_driver,g_mode;
X char far *c1,*c2;
X char *term_name = NULL;
X struct text_info tinfo; /* So we can restore starting text mode. */
X
/* Some of this code including BGI drivers is copyright Borland Intl. */
X g_driver=DETECT;
X get_path();
X gettextinfo(&tinfo);
X initgraph(&g_driver,&g_mode,path);
X c1=getdrivername();
X c2=getmodename(g_mode);
X switch (g_driver){
X case -2: fprintf(stderr,"Graphics card not detected.\n");
X break;
X case -3: fprintf(stderr,"BGI driver file cannot be found.\n");
X break;
X case -4: fprintf(stderr,"Invalid BGI driver file.\n");
X break;
X case -5: fprintf(stderr,"Insufficient memory to load ",
X "graphics driver.");
X break;
X case 1 : term_name = "cga";
X break;
X case 2 : term_name = "mcga";
X break;
X case 3 :
X case 4 : term_name = "egalib";
X break;
X case 7 : term_name = "hercules";
X break;
X case 8 : term_name = "att";
X break;
X case 9 : term_name = "vgalib";
X break;
X }
X closegraph();
X textmode(tinfo.currmode);
X clrscr();
X fprintf(stderr,"\tTC Graphics, driver %s mode %s\n",c1,c2);
X return(term_name);
}
#endif /* __TURBOC__ */
X
/*
X This is always defined so we don't have to have command.c know if it
X is there or not.
*/
#ifndef UNIXPLOT
UP_redirect(caller) int caller;
{
X caller = caller; /* to stop Turbo C complaining
X * about caller not being used */
}
#else
UP_redirect (caller)
int caller;
/*
X Unixplot can't really write to outfile--it wants to write to stdout.
X This is normally ok, but the original design of gnuplot gives us
X little choice. Originally users of unixplot had to anticipate
X their needs and redirect all I/O to a file... Not very gnuplot-like.
X
X caller: 1 - called from SET OUTPUT "FOO.OUT"
X 2 - called from SET TERM UNIXPLOT
X 3 - called from SET TERM other
X 4 - called from SET OUTPUT
*/
{
X switch (caller) {
X case 1:
X /* Don't save, just replace stdout w/outfile (save was already done). */
X if (unixplot)
X *(stdout) = *(outfile); /* Copy FILE structure */
X break;
X case 2:
X if (!unixplot) {
X fflush(stdout);
X save_stdout = *(stdout);
X *(stdout) = *(outfile); /* Copy FILE structure */
X unixplot = 1;
X }
X break;
X case 3:
X /* New terminal in use--put stdout back to original. */
X closepl();
X fflush(stdout);
X *(stdout) = save_stdout; /* Copy FILE structure */
X unixplot = 0;
X break;
X case 4:
X /* User really wants to go to normal output... */
X if (unixplot) {
X fflush(stdout);
X *(stdout) = save_stdout; /* Copy FILE structure */
X }
X break;
X }
}
#endif
X
X
/* test terminal by drawing border and text */
/* called from command test */
test_term()
{
X register struct termentry *t = &term_tbl[term];
X char *str;
X int x,y, xl,yl, i;
X unsigned int xmax, ymax;
X char label[MAX_ID_LEN];
X int scaling;
X
X if (!term_init) {
X (*t->init)();
X term_init = TRUE;
X }
X screen_ok = FALSE;
X scaling = (*t->scale)(xsize, ysize);
X xmax = (unsigned int)(t->xmax * (scaling ? 1 : xsize));
X ymax = (unsigned int)(t->ymax * (scaling ? 1 : ysize));
X (*t->graphics)();
X /* border linetype */
X (*t->linetype)(-2);
X (*t->move)(0,0);
X (*t->vector)(xmax-1,0);
X (*t->vector)(xmax-1,ymax-1);
X (*t->vector)(0,ymax-1);
X (*t->vector)(0,0);
X (void) (*t->justify_text)(LEFT);
X (*t->put_text)(t->h_char*5,ymax-t->v_char*3,"Terminal Test");
X /* axis linetype */
X (*t->linetype)(-1);
X (*t->move)(xmax/2,0);
X (*t->vector)(xmax/2,ymax-1);
X (*t->move)(0,ymax/2);
X (*t->vector)(xmax-1,ymax/2);
X /* test width and height of characters */
X (*t->linetype)(-2);
X (*t->move)( xmax/2-t->h_char*10,ymax/2+t->v_char/2);
X (*t->vector)(xmax/2+t->h_char*10,ymax/2+t->v_char/2);
X (*t->vector)(xmax/2+t->h_char*10,ymax/2-t->v_char/2);
X (*t->vector)(xmax/2-t->h_char*10,ymax/2-t->v_char/2);
X (*t->vector)(xmax/2-t->h_char*10,ymax/2+t->v_char/2);
X (*t->put_text)(xmax/2-t->h_char*10,ymax/2,
X "12345678901234567890");
X /* test justification */
X (void) (*t->justify_text)(LEFT);
X (*t->put_text)(xmax/2,ymax/2+t->v_char*6,"left justified");
X str = "centre+d text";
X if ((*t->justify_text)(CENTRE))
X (*t->put_text)(xmax/2,
X ymax/2+t->v_char*5,str);
X else
X (*t->put_text)(xmax/2-strlen(str)*t->h_char/2,
X ymax/2+t->v_char*5,str);
X str = "right justified";
X if ((*t->justify_text)(RIGHT))
X (*t->put_text)(xmax/2,
X ymax/2+t->v_char*4,str);
X else
X (*t->put_text)(xmax/2-strlen(str)*t->h_char,
X ymax/2+t->v_char*4,str);
X /* test text angle */
X str = "rotated ce+ntred text";
X if ((*t->text_angle)(1)) {
X if ((*t->justify_text)(CENTRE))
X (*t->put_text)(t->v_char,
X ymax/2,str);
X else
X (*t->put_text)(t->v_char,
X ymax/2-strlen(str)*t->h_char/2,str);
X }
X else {
X (void) (*t->justify_text)(LEFT);
X (*t->put_text)(t->h_char*2,ymax/2-t->v_char*2,"Can't rotate text");
SHAR_EOF
true || echo 'restore of gnuplot/term.c failed'
fi
echo 'End of part 24'
echo 'File gnuplot/term.c is continued in part 25'
echo 25 > _shar_seq_.tmp
exit 0
exit 0 # Just in case...
--
Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
Sterling Software, IMD UUCP: uunet!sparky!kent
Phone: (402) 291-8300 FAX: (402) 291-4362
Please send comp.sources.misc-related mail to kent@uunet.uu.net.