xref: /csrg-svn/lib/libplot/dumb/dumb.h (revision 19970)
115433Sralph /*
2*19970Sdist  * Copyright (c) 1980 Regents of the University of California.
3*19970Sdist  * All rights reserved.  The Berkeley software License Agreement
4*19970Sdist  * specifies the terms and conditions for redistribution.
5*19970Sdist  *
6*19970Sdist  *	@(#)dumb.h	5.1 (Berkeley) 05/07/85
7*19970Sdist  *
8*19970Sdist  *
915433Sralph  * This accepts plot file formats and produces the appropriate plots
1015433Sralph  * for dumb terminals.  It can also be used for printing terminals and
1115433Sralph  * lineprinter listings, although there is no way to specify number of
1215433Sralph  * lines and columns different from your terminal.  This would be easy
1315433Sralph  * to change, and is left as an exercise for the reader.
1415433Sralph  */
1515433Sralph 
1615433Sralph #include <math.h>
1715433Sralph 
1815433Sralph #define scale(x,y) y = LINES-1-(LINES*y/rangeY +minY); x = COLS*x/rangeX + minX
1915433Sralph 
2015433Sralph extern int minX, rangeX;	/* min and range of x */
2115433Sralph extern int minY, rangeY;	/* min and range of y */
2215433Sralph extern int currentx, currenty;
2315433Sralph extern int COLS, LINES;
2415433Sralph 
2515433Sralph /* A very large screen! (probably should use malloc) */
2615433Sralph #define MAXCOLS		132
2715433Sralph #define MAXLINES	90
2815433Sralph 
2915433Sralph extern char screenmat[MAXCOLS][MAXLINES];
30