home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-21 | 78.6 KB | 2,167 lines |
- Newsgroups: comp.sources.misc
- From: woo@playfair.stanford.edu ("Alexander Woo")
- Subject: v40i020: gnuplot - interactive function plotting utility, Part08/33
- Message-ID: <1993Oct21.144434.1859@sparky.sterling.com>
- X-Md4-Signature: 6632020fd749f75fca25ab9a3a2c9e56
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Sterling Software
- Date: Thu, 21 Oct 1993 14:44:34 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: woo@playfair.stanford.edu ("Alexander Woo")
- Posting-number: Volume 40, Issue 20
- Archive-name: gnuplot/part08
- Environment: UNIX, MS-DOS, VMS
- Supersedes: gnuplot3: Volume 24, Issue 23-48
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: gnuplot/bitmap.c gnuplot/header.mac gnuplot/readline.c
- # Wrapped by kent@sparky on Wed Oct 20 17:14:41 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 8 (of 33)."'
- if test -f 'gnuplot/bitmap.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gnuplot/bitmap.c'\"
- else
- echo shar: Extracting \"'gnuplot/bitmap.c'\" \(52378 characters\)
- sed "s/^X//" >'gnuplot/bitmap.c' <<'END_OF_FILE'
- X#ifndef lint
- Xstatic char *RCSid = "$Id: bitmap.c%v 3.50 1993/07/09 05:35:24 woo Exp $";
- X#endif
- X
- X
- X/* GNUPLOT - bitmap.c */
- X/*
- X * Copyright (C) 1986 - 1993 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 * Jyrki Yli-Nokari <jty@intrin.UUCP>
- X * Ronald J. Hartranft <rjh2@ns.cc.lehigh.edu>
- X * Russell Lang <rjl@monu1.cc.monash.edu.au>
- X *
- X * There is a mailing list for gnuplot users. Note, however, that the
- X * newsgroup
- X * comp.graphics.gnuplot
- X * is identical to the mailing list (they
- X * both carry the same set of messages). We prefer that you read the
- X * messages through that newsgroup, to subscribing to the mailing list.
- X * (If you can read that newsgroup, and are already on the mailing list,
- X * please send a message info-gnuplot-request@dartmouth.edu, asking to be
- X * removed from the mailing list.)
- X *
- X * The address for mailing to list members is
- X * info-gnuplot@dartmouth.edu
- X * and for mailing administrative requests is
- X * info-gnuplot-request@dartmouth.edu
- X * The mailing list for bug reports is
- X * bug-gnuplot@dartmouth.edu
- X * The list of those interested in beta-test versions is
- X * info-gnuplot-beta@dartmouth.edu
- X */
- X
- X/*
- X** General raster plotting routines.
- X** Raster routines written and copyrighted 1987 by
- X** Jyrki Yli-Nokari (jty@intrin.UUCP)
- X** Intrinsic, Ltd.
- X**
- X** You may use this code for anything you like as long as
- X** you are not selling it and the credit is given and
- X** this message retained.
- X**
- X*/
- X
- X/* Bitmap plotting routines derived from above raster plotting routines
- X * Russell Lang, 1990
- X */
- X
- X#include <stdio.h>
- X#include "plot.h"
- X#include "bitmap.h"
- X
- Xbitmap *b_p = (bitmap *)NULL; /* global pointer to bitmap */
- Xunsigned int b_currx, b_curry; /* the current coordinates */
- Xunsigned int b_xsize, b_ysize; /* the size of the bitmap */
- Xunsigned int b_planes; /* number of color planes */
- Xunsigned int b_psize; /* size of each plane */
- Xunsigned int b_rastermode; /* raster mode rotates -90deg */
- Xunsigned int b_linemask = 0xffff; /* 16 bit mask for dotted lines */
- Xunsigned int b_value = 1; /* colour of lines */
- Xunsigned int b_hchar; /* width of characters */
- Xunsigned int b_hbits; /* actual bits in char horizontally */
- Xunsigned int b_vchar; /* height of characters */
- Xunsigned int b_vbits; /* actual bits in char vertically */
- Xunsigned int b_angle; /* rotation of text */
- Xchar_box b_font[FNT_CHARS]; /* the current font */
- Xunsigned int b_pattern[] = {0xffff, 0x1111,
- X 0xffff, 0x5555, 0x3333, 0x7777, 0x3f3f, 0x0f0f, 0x5f5f};
- Xint b_maskcount = 0;
- Xunsigned int b_lastx, b_lasty; /* last pixel set - used by b_line */
- X
- X#define IN(i,size) ((unsigned)i < (unsigned)size)
- X
- X/* 5x9 font, bottom row first, left pixel in lsb */
- Xchar_row GPFAR fnt5x9[FNT_CHARS][FNT5X9_VBITS] = {
- X /* */ {000000,000000,000000,000000,000000,000000,000000,000000,000000},
- X /*!*/ {000000,000000,0x0004,000000,0x0004,0x0004,0x0004,0x0004,0x0004},
- X /*"*/ {000000,000000,000000,000000,000000,000000,0x000a,0x000a,0x000a},
- X /*#*/ {000000,000000,0x000a,0x000a,0x001f,0x000a,0x001f,0x000a,0x000a},
- X /*$*/ {000000,000000,0x0004,0x000f,0x0014,0x000e,0x0005,0x001e,0x0004},
- X /*%*/ {000000,000000,0x0018,0x0019,0x0002,0x0004,0x0008,0x0013,0x0003},
- X /*&*/ {000000,000000,0x0016,0x0009,0x0015,0x0002,0x0005,0x0005,0x0002},
- X /*'*/ {000000,000000,000000,000000,000000,0x0002,0x0004,0x0006,0x0006},
- X /*(*/ {000000,000000,0x0008,0x0004,0x0002,0x0002,0x0002,0x0004,0x0008},
- X /*)*/ {000000,000000,0x0002,0x0004,0x0008,0x0008,0x0008,0x0004,0x0002},
- X /***/ {000000,000000,0x0004,0x0015,0x000e,0x001f,0x000e,0x0015,0x0004},
- X /*+*/ {000000,000000,000000,0x0004,0x0004,0x001f,0x0004,0x0004,000000},
- X /*,*/ {000000,0x0002,0x0004,0x0006,0x0006,000000,000000,000000,000000},
- X /*-*/ {000000,000000,000000,000000,000000,0x001f,000000,000000,000000},
- X /*.*/ {000000,000000,0x0006,0x0006,000000,000000,000000,000000,000000},
- X /*-/-*/{000000,000000,000000,0x0001,0x0002,0x0004,0x0008,0x0010,000000},
- X /*0*/ {000000,000000,0x000e,0x0011,0x0013,0x0015,0x0019,0x0011,0x000e},
- X /*1*/ {000000,000000,0x000e,0x0004,0x0004,0x0004,0x0004,0x0006,0x0004},
- X /*2*/ {000000,000000,0x001f,0x0001,0x0001,0x000e,0x0010,0x0011,0x000e},
- X /*3*/ {000000,000000,0x000e,0x0011,0x0010,0x000c,0x0010,0x0011,0x000e},
- X /*4*/ {000000,000000,0x0008,0x0008,0x001f,0x0009,0x000a,0x000c,0x0008},
- X /*5*/ {000000,000000,0x000e,0x0011,0x0010,0x0010,0x000f,0x0001,0x001f},
- X /*6*/ {000000,000000,0x000e,0x0011,0x0011,0x000f,0x0001,0x0002,0x000c},
- X /*7*/ {000000,000000,0x0001,0x0001,0x0002,0x0004,0x0008,0x0010,0x001f},
- X /*8*/ {000000,000000,0x000e,0x0011,0x0011,0x000e,0x0011,0x0011,0x000e},
- X /*9*/ {000000,000000,0x0006,0x0008,0x0010,0x001e,0x0011,0x0011,0x000e},
- X /*:*/ {000000,000000,000000,0x0006,0x0006,000000,0x0006,0x0006,000000},
- X /*;*/ {000000,0x0001,0x0002,0x0006,0x0006,000000,0x0006,0x0006,000000},
- X /*<*/ {000000,000000,0x0008,0x0004,0x0002,0x0001,0x0002,0x0004,0x0008},
- X /*=*/ {000000,000000,000000,000000,0x001f,000000,0x001f,000000,000000},
- X /*>*/ {000000,000000,0x0002,0x0004,0x0008,0x0010,0x0008,0x0004,0x0002},
- X /*?*/ {000000,000000,0x0004,000000,0x0004,0x0008,0x0010,0x0011,0x000e},
- X /*@*/ {000000,000000,0x000e,0x0015,0x0015,0x0016,0x0010,0x0011,0x000e},
- X /*A*/ {000000,000000,0x0011,0x0011,0x001f,0x0011,0x0011,0x000a,0x0004},
- X /*B*/ {000000,000000,0x000f,0x0012,0x0012,0x000e,0x0012,0x0012,0x000f},
- X /*C*/ {000000,000000,0x000e,0x0011,0x0001,0x0001,0x0001,0x0011,0x000e},
- X /*D*/ {000000,000000,0x000f,0x0012,0x0012,0x0012,0x0012,0x0012,0x000f},
- X /*E*/ {000000,000000,0x001f,0x0001,0x0001,0x0007,0x0001,0x0001,0x001f},
- X /*F*/ {000000,000000,0x0001,0x0001,0x0001,0x0007,0x0001,0x0001,0x001f},
- X /*G*/ {000000,000000,0x001e,0x0011,0x0011,0x0019,0x0001,0x0001,0x001e},
- X /*H*/ {000000,000000,0x0011,0x0011,0x0011,0x001f,0x0011,0x0011,0x0011},
- X /*I*/ {000000,000000,0x000e,0x0004,0x0004,0x0004,0x0004,0x0004,0x000e},
- X /*J*/ {000000,000000,0x000e,0x0011,0x0010,0x0010,0x0010,0x0010,0x0010},
- X /*K*/ {000000,000000,0x0011,0x0009,0x0005,0x0003,0x0005,0x0009,0x0011},
- X /*L*/ {000000,000000,0x001f,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
- X /*M*/ {000000,000000,0x0011,0x0011,0x0011,0x0015,0x0015,0x001b,0x0011},
- X /*N*/ {000000,000000,0x0011,0x0011,0x0011,0x0019,0x0015,0x0013,0x0011},
- X /*O*/ {000000,000000,0x000e,0x0011,0x0011,0x0011,0x0011,0x0011,0x000e},
- X /*P*/ {000000,000000,0x0001,0x0001,0x0001,0x000f,0x0011,0x0011,0x000f},
- X /*Q*/ {000000,0x0018,0x000e,0x0015,0x0011,0x0011,0x0011,0x0011,0x000e},
- X /*R*/ {000000,000000,0x0011,0x0009,0x0005,0x000f,0x0011,0x0011,0x000f},
- X /*S*/ {000000,000000,0x000e,0x0011,0x0010,0x000e,0x0001,0x0011,0x000e},
- X /*T*/ {000000,000000,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x001f},
- X /*U*/ {000000,000000,0x000e,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011},
- X /*V*/ {000000,000000,0x0004,0x0004,0x000a,0x000a,0x0011,0x0011,0x0011},
- X /*W*/ {000000,000000,0x0011,0x001b,0x0015,0x0011,0x0011,0x0011,0x0011},
- X /*X*/ {000000,000000,0x0011,0x0011,0x000a,0x0004,0x000a,0x0011,0x0011},
- X /*Y*/ {000000,000000,0x0004,0x0004,0x0004,0x0004,0x000a,0x0011,0x0011},
- X /*Z*/ {000000,000000,0x001f,0x0001,0x0002,0x0004,0x0008,0x0010,0x001f},
- X /*[*/ {000000,000000,0x000e,0x0002,0x0002,0x0002,0x0002,0x0002,0x000e},
- X /*\*/ {000000,000000,000000,0x0010,0x0008,0x0004,0x0002,0x0001,000000},
- X /*]*/ {000000,000000,0x000e,0x0008,0x0008,0x0008,0x0008,0x0008,0x000e},
- X /*^*/ {000000,000000,000000,000000,000000,000000,0x0011,0x000a,0x0004},
- X /*_*/ {000000,000000,0x001f,000000,000000,000000,000000,000000,000000},
- X /*`*/ {000000,000000,000000,000000,000000,0x0008,0x0004,0x000c,0x000c},
- X /*a*/ {000000,000000,0x001e,0x0011,0x001e,0x0010,0x000e,000000,000000},
- X /*b*/ {000000,000000,0x000d,0x0013,0x0011,0x0013,0x000d,0x0001,0x0001},
- X /*c*/ {000000,000000,0x000e,0x0011,0x0001,0x0011,0x000e,000000,000000},
- X /*d*/ {000000,000000,0x0016,0x0019,0x0011,0x0019,0x0016,0x0010,0x0010},
- X /*e*/ {000000,000000,0x000e,0x0001,0x001f,0x0011,0x000e,000000,000000},
- X /*f*/ {000000,000000,0x0004,0x0004,0x0004,0x000e,0x0004,0x0014,0x0008},
- X /*g*/ {0x000e,0x0011,0x0016,0x0019,0x0011,0x0019,0x0016,000000,000000},
- X /*h*/ {000000,000000,0x0011,0x0011,0x0011,0x0013,0x000d,0x0001,0x0001},
- X /*i*/ {000000,000000,0x000e,0x0004,0x0004,0x0004,0x0006,000000,0x0004},
- X /*j*/ {0x0006,0x0009,0x0008,0x0008,0x0008,0x0008,0x000c,000000,0x0008},
- X /*k*/ {000000,000000,0x0009,0x0005,0x0003,0x0005,0x0009,0x0001,0x0001},
- X /*l*/ {000000,000000,0x000e,0x0004,0x0004,0x0004,0x0004,0x0004,0x0006},
- X /*m*/ {000000,000000,0x0015,0x0015,0x0015,0x0015,0x000b,000000,000000},
- X /*n*/ {000000,000000,0x0011,0x0011,0x0011,0x0013,0x000d,000000,000000},
- X /*o*/ {000000,000000,0x000e,0x0011,0x0011,0x0011,0x000e,000000,000000},
- X /*p*/ {0x0001,0x0001,0x000d,0x0013,0x0011,0x0013,0x000d,000000,000000},
- X /*q*/ {0x0010,0x0010,0x0016,0x0019,0x0011,0x0019,0x0016,000000,000000},
- X /*r*/ {000000,000000,0x0001,0x0001,0x0001,0x0013,0x000d,000000,000000},
- X /*s*/ {000000,000000,0x000f,0x0010,0x000e,0x0001,0x001e,000000,000000},
- X /*t*/ {000000,000000,0x0008,0x0014,0x0004,0x0004,0x001f,0x0004,0x0004},
- X /*u*/ {000000,000000,0x0016,0x0019,0x0011,0x0011,0x0011,000000,000000},
- X /*v*/ {000000,000000,0x0004,0x000a,0x0011,0x0011,0x0011,000000,000000},
- X /*w*/ {000000,000000,0x000a,0x0015,0x0015,0x0011,0x0011,000000,000000},
- X /*x*/ {000000,000000,0x0011,0x000a,0x0004,0x000a,0x0011,000000,000000},
- X /*y*/ {0x000e,0x0010,0x001e,0x0011,0x0011,0x0011,0x0011,000000,000000},
- X /*z*/ {000000,000000,0x001f,0x0002,0x0004,0x0008,0x001f,000000,000000},
- X /*{*/ {000000,000000,0x0008,0x0004,0x0004,0x0002,0x0004,0x0004,0x0008},
- X /*|*/ {000000,000000,0x0004,0x0004,0x0004,000000,0x0004,0x0004,0x0004},
- X /*}*/ {000000,000000,0x0002,0x0004,0x0004,0x0008,0x0004,0x0004,0x0002},
- X /*~*/ {000000,000000,000000,000000,000000,000000,0x0008,0x0015,0x0002},
- X /*DEL*/{000000,000000,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f},
- X};
- X
- X/* 9x17 font, bottom row first, left pixel in lsb */
- Xchar_row GPFAR fnt9x17[FNT_CHARS][FNT9X17_VBITS] = {
- X /* */ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,000000,000000,000000,000000,000000},
- X /*!*/ {000000,000000,000000,000000,0x0010,000000,000000,000000,0x0010,
- X 0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010},
- X /*"*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,0x0044,0x0044,0x0044,0x0044,0x0044},
- X /*#*/ {000000,000000,000000,000000,0x0044,0x0044,0x0044,0x0044,0x01ff,
- X 0x0044,0x0044,0x0044,0x01ff,0x0044,0x0044,0x0044,0x0044},
- X /*$*/ {000000,000000,000000,000000,0x0010,0x0010,0x007e,0x0091,0x0110,
- X 0x0090,0x007c,0x0012,0x0011,0x0112,0x00fc,0x0010,0x0010},
- X /*%*/ {000000,000000,000000,000000,0x0080,0x0141,0x0081,0x0002,0x0004,
- X 0x0008,0x0010,0x0020,0x0040,0x0080,0x0102,0x0105,0x0002},
- X /*&*/ {000000,000000,000000,000000,0x011c,0x00a2,0x0041,0x00c1,0x0141,
- X 0x0022,0x001c,0x0014,0x0022,0x0022,0x001c,000000,000000},
- X /*'*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,0x0004,0x0008,0x0010,0x0030,0x0038,0x0010},
- X /*(*/ {000000,000000,000000,000000,0x0040,0x0020,0x0010,0x0008,0x0008,
- X 0x0004,0x0004,0x0004,0x0008,0x0008,0x0010,0x0020,0x0040},
- X /*)*/ {000000,000000,000000,000000,0x0004,0x0008,0x0010,0x0020,0x0020,
- X 0x0040,0x0040,0x0040,0x0020,0x0020,0x0010,0x0008,0x0004},
- X /***/ {000000,000000,000000,000000,0x0010,0x0010,0x0111,0x0092,0x0054,
- X 0x0038,0x01ff,0x0038,0x0054,0x0092,0x0111,0x0010,0x0010},
- X /*+*/ {000000,000000,000000,000000,000000,000000,0x0010,0x0010,0x0010,
- X 0x0010,0x01ff,0x0010,0x0010,0x0010,0x0010,000000,000000},
- X /*,*/ {000000,000000,0x0004,0x0008,0x0010,0x0030,0x0038,0x0010,000000,
- X 000000,000000,000000,000000,000000,000000,000000,000000},
- X /*-*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,0x01ff,000000,000000,000000,000000,000000,000000},
- X /*.*/ {000000,000000,000000,000000,0x0010,0x0038,0x0010,000000,000000,
- X 000000,000000,000000,000000,000000,000000,000000,000000},
- X /*-/-*/{000000,000000,000000,000000,000000,000000,0x0001,0x0002,0x0004,
- X 0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,000000,000000},
- X /*0*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0103,0x0105,
- X 0x0109,0x0111,0x0121,0x0141,0x0181,0x0101,0x0082,0x007c},
- X /*1*/ {000000,000000,000000,000000,0x007c,0x0010,0x0010,0x0010,0x0010,
- X 0x0010,0x0010,0x0010,0x0010,0x0010,0x001c,0x0018,0x0010},
- X /*2*/ {000000,000000,000000,000000,0x01ff,0x0001,0x0001,0x0001,0x0001,
- X 0x0002,0x007c,0x0080,0x0100,0x0100,0x0101,0x0082,0x007c},
- X /*3*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0100,0x0100,
- X 0x0080,0x0078,0x0080,0x0100,0x0100,0x0101,0x0082,0x007c},
- X /*4*/ {000000,000000,000000,000000,0x0040,0x0040,0x0040,0x0040,0x0040,
- X 0x01ff,0x0041,0x0042,0x0044,0x0048,0x0050,0x0060,0x0040},
- X /*5*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0100,0x0100,
- X 0x0100,0x0080,0x007f,0x0001,0x0001,0x0001,0x0001,0x01ff},
- X /*6*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
- X 0x0081,0x007f,0x0001,0x0001,0x0001,0x0002,0x0084,0x0078},
- X /*7*/ {000000,000000,000000,000000,0x0001,0x0001,0x0001,0x0002,0x0004,
- X 0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0100,0x01ff},
- X /*8*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
- X 0x0082,0x007c,0x0082,0x0101,0x0101,0x0101,0x0082,0x007c},
- X /*9*/ {000000,000000,000000,000000,0x001c,0x0022,0x0040,0x0080,0x0100,
- X 0x0100,0x01fc,0x0102,0x0101,0x0101,0x0101,0x0082,0x007c},
- X /*:*/ {000000,000000,000000,000000,000000,000000,0x0010,0x0038,0x0010,
- X 000000,000000,000000,0x0010,0x0038,0x0010,000000,000000},
- X /*;*/ {000000,000000,000000,0x0004,0x0008,0x0010,0x0030,0x0038,0x0010,
- X 000000,000000,000000,0x0010,0x0038,0x0010,000000,000000},
- X /*<*/ {000000,000000,000000,000000,0x0040,0x0020,0x0010,0x0008,0x0004,
- X 0x0002,0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040},
- X /*=*/ {000000,000000,000000,000000,000000,000000,000000,000000,0x01ff,
- X 000000,000000,000000,0x01ff,000000,000000,000000,000000},
- X /*>*/ {000000,000000,000000,000000,0x0004,0x0008,0x0010,0x0020,0x0040,
- X 0x0080,0x0100,0x0080,0x0040,0x0020,0x0010,0x0008,0x0004},
- X /*?*/ {000000,000000,000000,0x0010,0x0038,0x0010,000000,0x0010,0x0010,
- X 0x0020,0x0040,0x0080,0x0100,0x0100,0x0101,0x0082,0x007c},
- X /*@*/ {000000,000000,000000,000000,0x007c,0x0002,0x0001,0x01f9,0x0145,
- X 0x0145,0x0145,0x0179,0x0101,0x0101,0x0101,0x0082,0x007c},
- X /*A*/ {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x01ff,
- X 0x0101,0x0082,0x0082,0x0044,0x0044,0x0028,0x0028,0x0010},
- X /*B*/ {000000,000000,000000,000000,0x007f,0x0084,0x0104,0x0104,0x0104,
- X 0x0084,0x007c,0x0084,0x0104,0x0104,0x0104,0x0084,0x007f},
- X /*C*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0001,0x0001,
- X 0x0001,0x0001,0x0001,0x0001,0x0001,0x0101,0x0082,0x007c},
- X /*D*/ {000000,000000,000000,000000,0x007f,0x0084,0x0104,0x0104,0x0104,
- X 0x0104,0x0104,0x0104,0x0104,0x0104,0x0104,0x0084,0x007f},
- X /*E*/ {000000,000000,000000,000000,0x01ff,0x0001,0x0001,0x0001,0x0001,
- X 0x0001,0x001f,0x0001,0x0001,0x0001,0x0001,0x0001,0x01ff},
- X /*F*/ {000000,000000,000000,000000,0x0001,0x0001,0x0001,0x0001,0x0001,
- X 0x0001,0x001f,0x0001,0x0001,0x0001,0x0001,0x0001,0x01ff},
- X /*G*/ {000000,000000,000000,000000,0x00fc,0x0102,0x0101,0x0101,0x0101,
- X 0x0101,0x01c1,0x0001,0x0001,0x0001,0x0001,0x0102,0x00fc},
- X /*H*/ {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x0101,
- X 0x0101,0x01ff,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101},
- X /*I*/ {000000,000000,000000,000000,0x007c,0x0010,0x0010,0x0010,0x0010,
- X 0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x007c},
- X /*J*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0100,0x0100,
- X 0x0100,0x0100,0x0100,0x0100,0x0100,0x0100,0x0100,0x0180},
- X /*K*/ {000000,000000,000000,000000,0x0101,0x0081,0x0041,0x0021,0x0011,
- X 0x0009,0x0005,0x000b,0x0011,0x0021,0x0041,0x0081,0x0101},
- X /*L*/ {000000,000000,000000,000000,0x01ff,0x0101,0x0001,0x0001,0x0001,
- X 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
- X /*M*/ {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x0101,
- X 0x0101,0x0111,0x0111,0x0129,0x0145,0x0145,0x0183,0x0101},
- X /*N*/ {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0181,0x0141,
- X 0x0141,0x0121,0x0111,0x0109,0x0105,0x0105,0x0103,0x0101},
- X /*O*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
- X 0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0082,0x007c},
- X /*P*/ {000000,000000,000000,000000,0x0001,0x0001,0x0001,0x0001,0x0001,
- X 0x0001,0x007f,0x0081,0x0101,0x0101,0x0101,0x0081,0x007f},
- X /*Q*/ {000000,000000,0x0180,0x0040,0x007c,0x0092,0x0101,0x0101,0x0101,
- X 0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0082,0x007c},
- X /*R*/ {000000,000000,000000,000000,0x0101,0x0081,0x0041,0x0021,0x0011,
- X 0x0009,0x007f,0x0081,0x0101,0x0101,0x0101,0x0081,0x007f},
- X /*S*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0100,0x0100,
- X 0x0080,0x007c,0x0002,0x0001,0x0001,0x0101,0x0082,0x007c},
- X /*T*/ {000000,000000,000000,000000,0x0038,0x0010,0x0010,0x0010,0x0010,
- X 0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0111,0x01ff},
- X /*U*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
- X 0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101},
- X /*V*/ {000000,000000,000000,000000,0x0010,0x0010,0x0028,0x0028,0x0044,
- X 0x0044,0x0082,0x0082,0x0101,0x0101,0x0101,0x0101,0x0101},
- X /*W*/ {000000,000000,000000,000000,0x0101,0x0183,0x0145,0x0145,0x0129,
- X 0x0111,0x0111,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101},
- X /*X*/ {000000,000000,000000,000000,0x0101,0x0101,0x0082,0x0082,0x0044,
- X 0x0028,0x0010,0x0028,0x0044,0x0082,0x0082,0x0101,0x0101},
- X /*Y*/ {000000,000000,000000,000000,0x0010,0x0010,0x0010,0x0010,0x0010,
- X 0x0010,0x0010,0x0028,0x0044,0x0082,0x0082,0x0101,0x0101},
- X /*Z*/ {000000,000000,000000,000000,0x01ff,0x0001,0x0002,0x0002,0x0004,
- X 0x0008,0x0010,0x0020,0x0040,0x0080,0x0080,0x0100,0x01ff},
- X /*[*/ {000000,000000,000000,000000,0x007c,0x0004,0x0004,0x0004,0x0004,
- X 0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x007c},
- X /*\*/ {000000,000000,000000,000000,000000,000000,0x0100,0x0080,0x0040,
- X 0x0020,0x0010,0x0008,0x0004,0x0002,0x0001,000000,000000},
- X /*]*/ {000000,000000,000000,000000,0x007c,0x0040,0x0040,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x007c},
- X /*^*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,0x0101,0x0082,0x0044,0x0028,0x0010},
- X /*_*/ {000000,000000,000000,000000,0x01ff,000000,000000,000000,000000,
- X 000000,000000,000000,000000,000000,000000,000000,000000},
- X /*`*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,0x0020,0x0010,0x0008,0x000c,0x001c,0x0008},
- X /*a*/ {000000,000000,000000,000000,0x03fc,0x0102,0x0101,0x0102,0x01fc,
- X 0x0100,0x0100,0x0080,0x007c,000000,000000,000000,000000},
- X /*b*/ {000000,000000,000000,000000,0x007d,0x0083,0x0101,0x0101,0x0101,
- X 0x0101,0x0101,0x0083,0x007d,0x0001,0x0001,0x0001,0x0001},
- X /*c*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0001,0x0001,
- X 0x0001,0x0101,0x0082,0x007c,000000,000000,000000,000000},
- X /*d*/ {000000,000000,000000,000000,0x017c,0x0182,0x0101,0x0101,0x0101,
- X 0x0101,0x0101,0x0182,0x017c,0x0100,0x0100,0x0100,0x0100},
- X /*e*/ {000000,000000,000000,000000,0x007c,0x0002,0x0001,0x0001,0x01ff,
- X 0x0101,0x0101,0x0082,0x007c,000000,000000,000000,000000},
- X /*f*/ {000000,000000,000000,000000,0x0010,0x0010,0x0010,0x0010,0x0010,
- X 0x0010,0x007c,0x0010,0x0010,0x0010,0x0110,0x00a0,0x0040},
- X /*g*/ {0x007c,0x0082,0x0101,0x0100,0x017c,0x0182,0x0101,0x0101,0x0101,
- X 0x0101,0x0101,0x0182,0x017c,000000,000000,000000,000000},
- X /*h*/ {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x0101,
- X 0x0103,0x0103,0x0085,0x0079,0x0001,0x0001,0x0001,0x0001},
- X /*i*/ {000000,000000,000000,000000,0x007c,0x0010,0x0010,0x0010,0x0010,
- X 0x0010,0x0010,0x0018,000000,000000,0x0018,0x0018,000000},
- X /*j*/ {0x003c,0x0042,0x0081,0x0080,0x0080,0x0080,0x0080,0x0080,0x0080,
- X 0x0080,0x0080,0x00c0,000000,000000,0x00c0,0x00c0,000000},
- X /*k*/ {000000,000000,000000,000000,0x0082,0x0042,0x0022,0x0012,0x000a,
- X 0x0016,0x0022,0x0042,0x0002,0x0002,0x0002,0x0002,0x0002},
- X /*l*/ {000000,000000,000000,000000,0x007c,0x0010,0x0010,0x0010,0x0010,
- X 0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x001c},
- X /*m*/ {000000,000000,000000,000000,0x0111,0x0111,0x0111,0x0111,0x0111,
- X 0x0111,0x0111,0x00ab,0x0045,000000,000000,000000,000000},
- X /*n*/ {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x0101,
- X 0x0101,0x0101,0x0083,0x007d,000000,000000,000000,000000},
- X /*o*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
- X 0x0101,0x0101,0x0082,0x007c,000000,000000,000000,000000},
- X /*p*/ {0x0001,0x0001,0x0001,0x0001,0x007d,0x0003,0x0081,0x0101,0x0101,
- X 0x0101,0x0101,0x0083,0x007d,000000,000000,000000,000000},
- X /*q*/ {0x0100,0x0100,0x0100,0x0100,0x017c,0x0182,0x0101,0x0101,0x0101,
- X 0x0101,0x0101,0x0182,0x017c,000000,000000,000000,000000},
- X /*r*/ {000000,000000,000000,000000,0x0001,0x0001,0x0001,0x0001,0x0001,
- X 0x0001,0x0103,0x0085,0x0079,000000,000000,000000,000000},
- X /*s*/ {000000,000000,000000,000000,0x007e,0x0081,0x0100,0x0080,0x007c,
- X 0x0002,0x0001,0x0102,0x00fc,000000,000000,000000,000000},
- X /*t*/ {000000,000000,000000,000000,0x0040,0x00a0,0x0110,0x0010,0x0010,
- X 0x0010,0x0010,0x0010,0x00fe,0x0010,0x0010,0x0010,0x0010},
- X /*u*/ {000000,000000,000000,000000,0x013c,0x0142,0x0181,0x0101,0x0101,
- X 0x0101,0x0101,0x0101,0x0101,000000,000000,000000,000000},
- X /*v*/ {000000,000000,000000,000000,0x0010,0x0028,0x0044,0x0082,0x0101,
- X 0x0101,0x0101,0x0101,0x0101,000000,000000,000000,000000},
- X /*w*/ {000000,000000,000000,000000,0x0044,0x00aa,0x0111,0x0111,0x0101,
- X 0x0101,0x0101,0x0101,0x0101,000000,000000,000000,000000},
- X /*x*/ {000000,000000,000000,000000,0x0101,0x0082,0x0044,0x0028,0x0010,
- X 0x0028,0x0044,0x0082,0x0101,000000,000000,000000,000000},
- X /*y*/ {0x007c,0x0082,0x0101,0x0100,0x0100,0x01fc,0x0102,0x0101,0x0101,
- X 0x0101,0x0101,0x0101,0x0101,000000,000000,000000,000000},
- X /*z*/ {000000,000000,000000,000000,0x01ff,0x0002,0x0004,0x0008,0x0010,
- X 0x0020,0x0040,0x0080,0x01ff,000000,000000,000000,000000},
- X /*{*/ {000000,000000,000000,000000,0x00c0,0x0020,0x0010,0x0010,0x0010,
- X 0x0008,0x0004,0x0008,0x0010,0x0010,0x0010,0x0020,0x00c0},
- X /*|*/ {000000,000000,000000,000000,0x0010,0x0010,0x0010,0x0010,0x0010,
- X 000000,000000,000000,0x0010,0x0010,0x0010,0x0010,0x0010},
- X /*}*/ {000000,000000,000000,000000,0x0006,0x0008,0x0010,0x0010,0x0010,
- X 0x0020,0x0040,0x0020,0x0010,0x0010,0x0010,0x0008,0x0006},
- X /*~*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,0x0040,0x00a0,0x0111,0x000a,0x0004},
- X /*DEL*/{000000,000000,000000,000000,0x0155,000000,0x0155,000000,0x0155,
- X 000000,0x0155,000000,0x0155,000000,0x0155,000000,0x0155},
- X};
- X
- X/* 13x25 font, bottom row first, left pixel in lsb */
- Xchar_row GPFAR fnt13x25[FNT_CHARS][FNT13X25_VBITS] = {
- X /* */ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,000000,000000,000000,000000},
- X /*!*/ {000000,000000,000000,000000,000000,0x00e0,0x00e0,0x00e0,000000,
- X 000000,000000,0x0040,0x0040,0x0040,0x0040,0x0040,0x00e0,0x00e0,
- X 0x00e0,0x00e0,0x00e0,0x00e0,0x00e0,0x00e0,0x0040},
- X /*"*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 0x0208,0x0208,0x0208,0x0208,0x0208,0x0208,0x0208},
- X /*#*/ {000000,000000,000000,000000,000000,000000,0x0208,0x0208,0x0208,
- X 0x0208,0x0208,0x0208,0x1fff,0x0208,0x0208,0x0208,0x0208,0x0208,
- X 0x1fff,0x0208,0x0208,0x0208,0x0208,0x0208,0x0208},
- X /*$*/ {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
- X 0x03f8,0x0444,0x0842,0x0840,0x0840,0x0440,0x03f8,0x0044,0x0042,
- X 0x0042,0x0842,0x0444,0x03f8,0x0040,0x0040,0x0040},
- X /*%*/ {000000,000000,000000,000000,000000,000000,0x0c00,0x1200,0x1201,
- X 0x0c01,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,
- X 0x0200,0x0400,0x0800,0x1006,0x1009,0x0009,0x0006},
- X /*&*/ {000000,000000,000000,000000,000000,000000,0x1078,0x1084,0x0902,
- X 0x0601,0x0601,0x0901,0x1081,0x0042,0x0024,0x0018,0x0018,0x0024,
- X 0x0042,0x0042,0x0042,0x0042,0x0024,0x0018,000000},
- X /*'*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,000000,000000,0x0001,0x0002,0x0004,0x0008,
- X 0x0010,0x0030,0x0078,0x0078,0x0078,0x0030,000000},
- X /*(*/ {000000,000000,000000,000000,000000,000000,0x0080,0x0040,0x0020,
- X 0x0020,0x0010,0x0008,0x0008,0x0004,0x0004,0x0004,0x0004,0x0004,
- X 0x0008,0x0008,0x0010,0x0020,0x0020,0x0040,0x0080},
- X /*)*/ {000000,000000,000000,000000,000000,000000,0x0020,0x0040,0x0080,
- X 0x0080,0x0100,0x0200,0x0200,0x0400,0x0400,0x0400,0x0400,0x0400,
- X 0x0200,0x0200,0x0100,0x0080,0x0080,0x0040,0x0020},
- X /***/ {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
- X 0x1041,0x0842,0x0444,0x0248,0x0150,0x00e0,0x1fff,0x00e0,0x0150,
- X 0x0248,0x0444,0x0842,0x1041,0x0040,0x0040,0x0040},
- X /*+*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x1fff,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,000000,000000,000000},
- X /*,*/ {000000,000000,0x0001,0x0002,0x0004,0x0008,0x0010,0x0030,0x0078,
- X 0x0078,0x0078,0x0030,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,000000,000000,000000,000000},
- X /*-*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,000000,000000,000000,0x1fff,000000,000000,
- X 000000,000000,000000,000000,000000,000000,000000},
- X /*.*/ {000000,000000,000000,000000,000000,000000,000000,0x0038,0x007c,
- X 0x007c,0x007c,0x0038,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,000000,000000,000000,000000},
- X /*-/-*/{000000,000000,000000,000000,000000,000000,000000,000000,0x0001,
- X 0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,
- X 0x0200,0x0400,0x0800,0x1000,0x1000,000000,000000},
- X /*0*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
- X 0x1001,0x1003,0x1005,0x1009,0x1011,0x1021,0x1041,0x1081,0x1101,
- X 0x1201,0x1401,0x1801,0x1001,0x0802,0x0404,0x03f8},
- X /*1*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0048,0x0070,0x0060,0x0040},
- X /*2*/ {000000,000000,000000,000000,000000,000000,0x1fff,0x0001,0x0001,
- X 0x0001,0x0001,0x0001,0x0001,0x0002,0x03fc,0x0400,0x0800,0x1000,
- X 0x1000,0x1000,0x1000,0x1001,0x0802,0x0404,0x03f8},
- X /*3*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
- X 0x1001,0x1000,0x1000,0x1000,0x0800,0x0400,0x03e0,0x0400,0x0800,
- X 0x1000,0x1000,0x1000,0x1001,0x0802,0x0404,0x03f8},
- X /*4*/ {000000,000000,000000,000000,000000,000000,0x0200,0x0200,0x0200,
- X 0x0200,0x0200,0x0200,0x0200,0x1fff,0x0201,0x0201,0x0202,0x0204,
- X 0x0208,0x0210,0x0220,0x0240,0x0280,0x0300,0x0200},
- X /*5*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
- X 0x1001,0x1000,0x1000,0x1000,0x1000,0x1000,0x0800,0x0400,0x03ff,
- X 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1fff},
- X /*6*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
- X 0x1001,0x1001,0x1001,0x1001,0x0801,0x0401,0x03ff,0x0001,0x0001,
- X 0x0001,0x0001,0x0002,0x0004,0x0808,0x0410,0x03e0},
- X /*7*/ {000000,000000,000000,000000,000000,000000,0x0001,0x0001,0x0001,
- X 0x0002,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,
- X 0x0200,0x0400,0x0800,0x0800,0x1000,0x1000,0x1fff},
- X /*8*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
- X 0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8,0x0404,0x0802,
- X 0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
- X /*9*/ {000000,000000,000000,000000,000000,000000,0x00f8,0x0104,0x0202,
- X 0x0400,0x0800,0x1000,0x1000,0x1000,0x1000,0x1ff8,0x1004,0x1002,
- X 0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
- X /*:*/ {000000,000000,000000,000000,000000,000000,000000,000000,0x0030,
- X 0x0078,0x0078,0x0030,000000,000000,000000,000000,000000,000000,
- X 0x0030,0x0078,0x0078,0x0030,000000,000000,000000},
- X /*;*/ {000000,000000,0x0001,0x0002,0x0004,0x0008,0x0010,0x0030,0x0078,
- X 0x0078,0x0078,0x0030,000000,000000,000000,000000,000000,000000,
- X 0x0030,0x0078,0x0078,0x0030,000000,000000,000000},
- X /*<*/ {000000,000000,000000,000000,000000,000000,0x0200,0x0100,0x0080,
- X 0x0040,0x0020,0x0010,0x0008,0x0004,0x0002,0x0001,0x0002,0x0004,
- X 0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0200},
- X /*=*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,0x1fff,000000,000000,000000,000000,000000,
- X 0x1fff,000000,000000,000000,000000,000000,000000},
- X /*>*/ {000000,000000,000000,000000,000000,000000,0x0008,0x0010,0x0020,
- X 0x0040,0x0080,0x0100,0x0200,0x0400,0x0800,0x1000,0x0800,0x0400,
- X 0x0200,0x0100,0x0080,0x0040,0x0020,0x0010,0x0008},
- X /*?*/ {000000,000000,000000,000000,000000,0x0040,0x00e0,0x0040,000000,
- X 000000,000000,0x0040,0x0040,0x0080,0x0100,0x0200,0x0400,0x0800,
- X 0x1000,0x1000,0x1001,0x1001,0x0802,0x0404,0x03f8},
- X /*@*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0002,
- X 0x0001,0x0001,0x0ee1,0x1111,0x1111,0x1111,0x1111,0x1111,0x12e1,
- X 0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
- X /*A*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
- X 0x1001,0x1001,0x1001,0x1fff,0x1001,0x1001,0x1001,0x1001,0x0802,
- X 0x0802,0x0404,0x0208,0x0110,0x00a0,0x00a0,0x0040},
- X /*B*/ {000000,000000,000000,000000,000000,000000,0x03ff,0x0408,0x0808,
- X 0x1008,0x1008,0x1008,0x1008,0x0808,0x0408,0x03f8,0x0408,0x0808,
- X 0x1008,0x1008,0x1008,0x1008,0x0808,0x0408,0x03ff},
- X /*C*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
- X 0x1001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
- X 0x0001,0x0001,0x0001,0x1001,0x0802,0x0404,0x03f8},
- X /*D*/ {000000,000000,000000,000000,000000,000000,0x03ff,0x0408,0x0808,
- X 0x1008,0x1008,0x1008,0x1008,0x1008,0x1008,0x1008,0x1008,0x1008,
- X 0x1008,0x1008,0x1008,0x1008,0x0808,0x0408,0x03ff},
- X /*E*/ {000000,000000,000000,000000,000000,000000,0x1fff,0x0001,0x0001,
- X 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x007f,0x0001,0x0001,
- X 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1fff},
- X /*F*/ {000000,000000,000000,000000,000000,000000,0x0001,0x0001,0x0001,
- X 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x007f,0x0001,0x0001,
- X 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1fff},
- X /*G*/ {000000,000000,000000,000000,000000,000000,0x0ff8,0x1004,0x1002,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1f01,0x0001,0x0001,
- X 0x0001,0x0001,0x0001,0x0001,0x0002,0x1004,0x0ff8},
- X /*H*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1fff,0x1001,0x1001,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001},
- X /*I*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x03f8},
- X /*J*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
- X 0x1001,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
- X 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1e00},
- X /*K*/ {000000,000000,000000,000000,000000,000000,0x1001,0x0801,0x0401,
- X 0x0201,0x0101,0x0081,0x0041,0x0021,0x0011,0x000f,0x0009,0x0011,
- X 0x0021,0x0041,0x0081,0x0101,0x0201,0x0401,0x0801},
- X /*L*/ {000000,000000,000000,000000,000000,000000,0x1fff,0x1001,0x1001,
- X 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
- X 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
- X /*M*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1041,0x1041,0x10a1,
- X 0x10a1,0x1111,0x1209,0x1209,0x1405,0x1803,0x1001},
- X /*N*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
- X 0x1001,0x1801,0x1401,0x1201,0x1201,0x1101,0x1081,0x1041,0x1041,
- X 0x1021,0x1011,0x1009,0x1009,0x1005,0x1003,0x1001},
- X /*O*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
- X 0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
- X /*P*/ {000000,000000,000000,000000,000000,000000,0x0001,0x0001,0x0001,
- X 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x03ff,0x0401,0x0801,
- X 0x1001,0x1001,0x1001,0x1001,0x0801,0x0401,0x03ff},
- X /*Q*/ {000000,000000,000000,000000,0x0c00,0x0200,0x03f8,0x0494,0x0862,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
- X 0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
- X /*R*/ {000000,000000,000000,000000,000000,000000,0x1001,0x0801,0x0401,
- X 0x0201,0x0101,0x0081,0x0041,0x0021,0x0011,0x03ff,0x0401,0x0801,
- X 0x1001,0x1001,0x1001,0x1001,0x0801,0x0401,0x03ff},
- X /*S*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
- X 0x1001,0x1000,0x1000,0x1000,0x0800,0x0400,0x03f8,0x0004,0x0002,
- X 0x0001,0x0001,0x0001,0x1001,0x0802,0x0404,0x03f8},
- X /*T*/ {000000,000000,000000,000000,000000,000000,0x00e0,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x1041,0x1fff},
- X /*U*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001},
- X /*V*/ {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x00a0,
- X 0x00a0,0x0110,0x0110,0x0208,0x0208,0x0404,0x0404,0x0802,0x0802,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001},
- X /*W*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1803,
- X 0x1405,0x1405,0x1209,0x1209,0x1111,0x1111,0x10a1,0x1041,0x1001,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001},
- X /*X*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
- X 0x0802,0x0802,0x0404,0x0208,0x0110,0x00a0,0x0040,0x00a0,0x0110,
- X 0x0208,0x0404,0x0802,0x0802,0x1001,0x1001,0x1001},
- X /*Y*/ {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x00a0,0x0110,0x0208,
- X 0x0404,0x0802,0x0802,0x1001,0x1001,0x1001,0x1001},
- X /*Z*/ {000000,000000,000000,000000,000000,000000,0x1fff,0x0001,0x0001,
- X 0x0002,0x0004,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,
- X 0x0200,0x0400,0x0400,0x0800,0x1000,0x1000,0x1fff},
- X /*[*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0008,0x0008,
- X 0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,
- X 0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x03f8},
- X /*\*/ {000000,000000,000000,000000,000000,000000,000000,000000,0x1000,
- X 0x1000,0x0800,0x0400,0x0200,0x0100,0x0080,0x0040,0x0020,0x0010,
- X 0x0008,0x0004,0x0002,0x0001,0x0001,000000,000000},
- X /*]*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0200,0x0200,
- X 0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,
- X 0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,0x03f8},
- X /*^*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 0x1001,0x0802,0x0404,0x0208,0x0110,0x00a0,0x0040},
- X /*_*/ {000000,000000,000000,000000,000000,000000,0x1fff,000000,000000,
- X 000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,000000,000000,000000,000000},
- X /*`*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,000000,000000,0x0400,0x0200,0x0100,0x0080,
- X 0x0040,0x0060,0x00f0,0x00f0,0x00f0,0x0060,000000},
- X /*a*/ {000000,000000,000000,000000,000000,000000,0x17f8,0x0804,0x0802,
- X 0x0802,0x0802,0x0804,0x0ff8,0x0800,0x0800,0x0800,0x0800,0x0404,
- X 0x03f8,000000,000000,000000,000000,000000,000000},
- X /*b*/ {000000,000000,000000,000000,000000,000000,0x03f9,0x0405,0x0803,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0803,0x0405,
- X 0x03f9,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
- X /*c*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
- X 0x1001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1001,0x0802,0x0404,
- X 0x03f8,000000,000000,000000,000000,000000,000000},
- X /*d*/ {000000,000000,000000,000000,000000,000000,0x13f8,0x1404,0x1802,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1802,0x1404,
- X 0x13f8,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000},
- X /*e*/ {000000,000000,000000,000000,000000,000000,0x0ff8,0x0004,0x0002,
- X 0x0001,0x0001,0x0001,0x1fff,0x1001,0x1001,0x1001,0x0802,0x0404,
- X 0x03f8,000000,000000,000000,000000,000000,000000},
- X /*f*/ {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x03f8,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x1040,0x0880,0x0500,0x0200},
- X /*g*/ {0x03f8,0x0404,0x0802,0x1001,0x1000,0x1000,0x13f8,0x1404,0x1802,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1802,0x1404,
- X 0x13f8,000000,000000,000000,000000,000000,000000},
- X /*h*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0803,0x0405,
- X 0x03f9,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
- X /*i*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0070,
- X 000000,000000,000000,0x00e0,0x00e0,0x00e0,000000},
- X /*j*/ {0x00f0,0x0108,0x0204,0x0402,0x0400,0x0400,0x0400,0x0400,0x0400,
- X 0x0400,0x0400,0x0400,0x0400,0x0400,0x0400,0x0400,0x0400,0x0700,
- X 000000,000000,000000,0x0700,0x0700,0x0700,000000},
- X /*k*/ {000000,000000,000000,000000,000000,000000,0x0804,0x0404,0x0204,
- X 0x0104,0x0084,0x0044,0x0024,0x0014,0x002c,0x0044,0x0084,0x0104,
- X 0x0204,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004},
- X /*l*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0070},
- X /*m*/ {000000,000000,000000,000000,000000,000000,0x1041,0x1041,0x1041,
- X 0x1041,0x1041,0x1041,0x1041,0x1041,0x1041,0x1041,0x08a3,0x0515,
- X 0x0209,000000,000000,000000,000000,000000,000000},
- X /*n*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0803,0x0405,
- X 0x03f9,000000,000000,000000,000000,000000,000000},
- X /*o*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,
- X 0x03f8,000000,000000,000000,000000,000000,000000},
- X /*p*/ {0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x03f9,0x0405,0x0803,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0803,0x0405,
- X 0x03f9,000000,000000,000000,000000,000000,000000},
- X /*q*/ {0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x13f8,0x1404,0x1802,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1802,0x1404,
- X 0x13f8,000000,000000,000000,000000,000000,000000},
- X /*r*/ {000000,000000,000000,000000,000000,000000,0x0001,0x0001,0x0001,
- X 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1001,0x0803,0x0405,
- X 0x03f9,000000,000000,000000,000000,000000,000000},
- X /*s*/ {000000,000000,000000,000000,000000,000000,0x03fc,0x0402,0x0800,
- X 0x0800,0x0800,0x0400,0x03f8,0x0004,0x0002,0x0002,0x0002,0x0804,
- X 0x07f8,000000,000000,000000,000000,000000,000000},
- X /*t*/ {000000,000000,000000,000000,000000,000000,0x0200,0x0500,0x0880,
- X 0x1040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
- X 0x07fc,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040},
- X /*u*/ {000000,000000,000000,000000,000000,000000,0x13f8,0x1404,0x1802,
- X 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
- X 0x1001,000000,000000,000000,000000,000000,000000},
- X /*v*/ {000000,000000,000000,000000,000000,000000,0x0040,0x00a0,0x0110,
- X 0x0208,0x0404,0x0802,0x0802,0x1001,0x1001,0x1001,0x1001,0x1001,
- X 0x1001,000000,000000,000000,000000,000000,000000},
- X /*w*/ {000000,000000,000000,000000,000000,000000,0x0208,0x0514,0x08a2,
- X 0x08a2,0x1041,0x1041,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
- X 0x1001,000000,000000,000000,000000,000000,000000},
- X /*x*/ {000000,000000,000000,000000,000000,000000,0x1001,0x0802,0x0404,
- X 0x0208,0x0110,0x00a0,0x0040,0x00a0,0x0110,0x0208,0x0404,0x0802,
- X 0x1001,000000,000000,000000,000000,000000,000000},
- X /*y*/ {0x03f8,0x0404,0x0802,0x1001,0x1000,0x1000,0x1000,0x1000,0x1ff8,
- X 0x1004,0x1002,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
- X 0x1001,000000,000000,000000,000000,000000,000000},
- X /*z*/ {000000,000000,000000,000000,000000,000000,0x1fff,0x0002,0x0004,
- X 0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0200,0x0400,0x0800,
- X 0x1fff,000000,000000,000000,000000,000000,000000},
- X /*{*/ {000000,000000,000000,000000,000000,000000,0x0600,0x0100,0x0080,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0020,0x0010,0x0020,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,0x0080,0x0100,0x0600},
- X /*|*/ {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,000000,000000,000000,000000,000000,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040},
- X /*}*/ {000000,000000,000000,000000,000000,000000,0x000c,0x0010,0x0020,
- X 0x0040,0x0040,0x0040,0x0040,0x0040,0x0080,0x0100,0x0080,0x0040,
- X 0x0040,0x0040,0x0040,0x0040,0x0020,0x0010,0x000c},
- X /*~*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 000000,000000,000000,000000,000000,000000,000000,000000,000000,
- X 0x0600,0x0900,0x1080,0x1041,0x0021,0x0012,0x000c},
- X /*DEL*/{000000,000000,000000,000000,000000,000000,0x1249,000000,000000,
- X 0x1249,000000,000000,0x1249,000000,000000,0x1249,000000,000000,
- X 0x1249,000000,000000,0x1249,000000,000000,0x1249},
- X};
- X
- X/*
- X** The plotting area is defined as a huge bitmap.
- X** The bitmap is stored in a dynamically allocated pixel array b_p
- X**
- X** The bitmap is allocated (and initialized to zero) with
- X** b_makebitmap(xsize, ysize, planes)
- X** and freed with b_freebitmap()
- X** xsize and ysize will be rounded up to a multiple of 8.
- X**
- X** Valid (int) coordinates range from zero to (xsize-1,ysize-1)
- X**
- X** Plotting is done via b_move(x, y) and b_vector(x, y) functions,
- X** where the point (x,y) is the target to go from the current point
- X** To set the color use b_setvalue(value) where value is the value
- X** (0 or 1 or a color number) to be stored in every pixel.
- X** To get dotted line styles, use b_setlinetype(linetype).
- X**
- X** Internally all plotting goes through b_setpixel(x, y, value).
- X*/
- X
- X
- X/*
- X** set pixel (x, y, value) to value value (this can be 1/0 or a color number).
- X*/
- Xvoid
- Xb_setpixel(x, y, value)
- Xunsigned int x, y, value;
- X{
- X register unsigned int row;
- X register unsigned char mask;
- X int i;
- X if (b_rastermode) {
- X /* interchange so that new (x,y) is old (y,b_ysize-1-x) */
- X row = x; /* temp storage */
- X x = y;
- X y = b_ysize-1-row;
- X }
- X if (IN(x, b_xsize) && IN(y, b_ysize))
- X {
- X row = y/8;
- X mask = 1<<(y%8);
- X
- X for (i=0; i<b_planes; i++) {
- X if (value&1)
- X *((*b_p)[row]+x) |= mask;
- X else
- X *((*b_p)[row]+x) &= ~mask;
- X row += b_psize;
- X value >>= 1;
- X }
- X }
- X#ifdef BITMAPDEBUG
- X else
- X {
- X if (b_rastermode)
- X fprintf(stderr, "Warning: setpixel(%d, %d, %d) out of bounds\n",
- X b_ysize-1-y, x, value);
- X else
- X fprintf(stderr, "Warning: setpixel(%d, %d, %d) out of bounds\n",
- X x, y, value);
- X }
- X#endif
- X}
- X
- X/*
- X** get pixel (x,y) value----unused
- X*/
- X/****************************
- Xunsigned int
- Xb_getpixel(x, y)
- Xunsigned int x, y;
- X{
- X register unsigned int row;
- X register unsigned char mask;
- X register unsigned char value;
- X int i;
- X
- X if (b_rastermode) {
- X row = x;
- X x = y;
- X y = b_ysize-1-row;
- X }
- X if (IN(x, b_xsize) && IN(y, b_ysize))
- X {
- X row = y/8 + (b_planes-1)*b_psize;
- X mask = 1<<(y%8);
- X
- X for (i=0; i<b_planes; i++) {
- X if ( *((*b_p)[row]+x) & mask )
- X value |= 1;
- X row -= b_psize;
- X value <<= 1;
- X }
- X return(value);
- X }
- X else
- X {
- X#ifdef BITMAPDEBUG
- X if (b_rastermode)
- X fprintf(stderr, "Warning: getpixel(%d,%d) out of bounds\n",
- X b_ysize-1-y, x);
- X else
- X fprintf(stderr, "Warning: getpixel(%d,%d) out of bounds\n", x, y);
- X#endif
- X return(0);
- X }
- X}
- X********************************/
- X
- X/*
- X** allocate the bitmap
- X*/
- Xvoid
- Xb_makebitmap(x, y, planes)
- Xunsigned int x, y, planes;
- X{
- X register unsigned j;
- X unsigned rows;
- X
- X x = 8 * (unsigned int)(x/8.0+0.9); /* round up to multiple of 8 */
- X y = 8 * (unsigned int)(y/8.0+0.9); /* round up to multiple of 8 */
- X b_psize = y/8; /* size of each plane */
- X rows = b_psize * planes; /* total number of rows of 8 pixels high */
- X b_xsize = x; b_ysize = y;
- X b_currx = b_curry = 0;
- X b_planes = planes;
- X b_value = 1;
- X b_angle = 0;
- X b_rastermode = 0;
- X /* allocate row pointers */
- X b_p = (bitmap *)alloc( (unsigned long)rows * sizeof(pixels *), "bitmap row buffer");
- X bzero(b_p, rows * sizeof(pixels *));
- X for (j = 0; j < rows; j++) {
- X /* allocate bitmap buffers */
- X (*b_p)[j] = (pixels *)alloc((unsigned long)x * sizeof(pixels),(char *)NULL);
- X if ((*b_p)[j] == (pixels *)NULL) {
- X b_freebitmap(); /* free what we have already allocated */
- X int_error("out of memory for bitmap buffer", NO_CARET);
- X }
- X bzero((*b_p)[j], x * sizeof(pixels));
- X }
- X}
- X
- X/*
- X** free the allocated bitmap
- X*/
- Xvoid
- Xb_freebitmap()
- X{
- X int j;
- X unsigned rows;
- X
- X rows = b_psize * b_planes; /* total number of rows of 8 pixels high */
- X for (j = 0; j < rows; j++)
- X {
- X (void) free((char *)(*b_p)[j]);
- X }
- X (void) free((char *)b_p);
- X b_p = (bitmap *)(NULL);
- X}
- X
- X/*
- X** set pixel at (x,y) with color b_value and dotted mask b_linemask.
- X*/
- Xvoid
- Xb_setmaskpixel(x,y,value)
- Xunsigned int x,y,value;
- X{
- X /* dotted line generator */
- X if ((b_linemask>>b_maskcount)&(unsigned int)(1)) {
- X b_setpixel(x,y,value);
- X }
- X b_maskcount= (b_maskcount+1) % 16;
- X b_lastx= x; /* last pixel set with mask */
- X b_lasty= y;
- X}
- X
- X/*
- X** draw a line from (x1,y1) to (x2,y2)
- X** with color b_value and dotted mask b_linemask.
- X*/
- Xvoid
- Xb_line(x1,y1,x2,y2)
- Xunsigned int x1,y1,x2,y2;
- X{
- Xint runcount;
- Xint dx,dy;
- Xint xinc,yinc;
- Xunsigned int xplot,yplot;
- X
- X runcount=0;
- X dx = abs((int)(x1)-(int)(x2));
- X if (x2>x1) xinc= 1;
- X if (x2==x1) xinc= 0;
- X if (x2<x1) xinc= -1;
- X dy = abs((int)(y1)-(int)(y2));
- X if (y2>y1) yinc= 1;
- X if (y2==y1) yinc= 0;
- X if (y2<y1) yinc= -1;
- X xplot=x1;
- X yplot=y1;
- X if (dx>dy) {
- X /* iterate x */
- X if ( (b_linemask==0xffff) ||
- X ((xplot!=b_lastx) && (yplot!=b_lasty)) )
- X b_setmaskpixel(xplot,yplot,b_value);
- X while (xplot!=x2) {
- X xplot+=xinc;
- X runcount+=dy;
- X if (runcount>=(dx-runcount)) {
- X yplot+=yinc;
- X runcount-=dx;
- X }
- X b_setmaskpixel(xplot,yplot,b_value);
- X }
- X } else {
- X /* iterate y */
- X if ( (b_linemask==0xffff) ||
- X ((xplot!=b_lastx) && (yplot!=b_lasty)) )
- X b_setmaskpixel(xplot,yplot,b_value);
- X while (yplot!=y2) {
- X yplot+=yinc;
- X runcount+=dx;
- X if (runcount>=(dy-runcount)) {
- X xplot+=xinc;
- X runcount-=dy;
- X }
- X b_setmaskpixel(xplot,yplot,b_value);
- X }
- X }
- X}
- X
- X/*
- X** set character size
- X*/
- Xvoid
- Xb_charsize(size)
- Xunsigned int size;
- X{
- X int j;
- X switch(size) {
- X case FNT5X9:
- X b_hchar = FNT5X9_HCHAR;
- X b_hbits = FNT5X9_HBITS;
- X b_vchar = FNT5X9_VCHAR;
- X b_vbits = FNT5X9_VBITS;
- X for (j = 0; j < FNT_CHARS; j++ )
- X b_font[j] = &fnt5x9[j][0];
- X break;
- X case FNT9X17:
- X b_hchar = FNT9X17_HCHAR;
- X b_hbits = FNT9X17_HBITS;
- X b_vchar = FNT9X17_VCHAR;
- X b_vbits = FNT9X17_VBITS;
- X for (j = 0; j < FNT_CHARS; j++ )
- X b_font[j] = &fnt9x17[j][0];
- X break;
- X case FNT13X25:
- X b_hchar = FNT13X25_HCHAR;
- X b_hbits = FNT13X25_HBITS;
- X b_vchar = FNT13X25_VCHAR;
- X b_vbits = FNT13X25_VBITS;
- X for (j = 0; j < FNT_CHARS; j++ )
- X b_font[j] = &fnt13x25[j][0];
- X break;
- X default:
- X int_error("Unknown character size",NO_CARET);
- X }
- X}
- X
- X
- X/*
- X** put characater c at (x,y) rotated by angle with color b_value.
- X*/
- Xvoid
- Xb_putc(x,y,c,angle)
- Xunsigned int x,y;
- Xchar c;
- Xunsigned int angle;
- X{
- X unsigned int i, j, k;
- X char_row fc;
- X
- X j = c - ' ';
- X for ( i = 0; i < b_vbits; i++ ) {
- X fc = *( b_font[j] + i );
- X if ( c == '_' ) { /* treat underline specially */
- X if ( fc ) { /* this this the underline row ? */
- X /* draw the under line for the full h_char width */
- X for ( k = ( b_hbits - b_hchar )/2;
- X k < ( b_hbits + b_hchar )/2; k++ ) {
- X switch(angle) {
- X case 0 : b_setpixel(x+k+1,y+i,b_value);
- X break;
- X case 1 : b_setpixel(x-i,y+k+1,b_value);
- X break;
- X }
- X }
- X }
- X }
- X else {
- X /* draw character */
- X for ( k = 0; k < b_hbits; k++ ) {
- X if ( ( fc >> k ) & 1 ) {
- X switch(angle) {
- X case 0 : b_setpixel(x+k+1,y+i,b_value);
- X break;
- X case 1 : b_setpixel(x-i,y+k+1,b_value);
- X break;
- X }
- X }
- X }
- X }
- X }
- X}
- X
- X
- X/*
- X** set b_linemask to b_pattern[linetype]
- X*/
- Xint
- Xb_setlinetype(linetype)
- Xint linetype;
- X{
- X if (linetype>=7)
- X linetype %= 7;
- X b_linemask = b_pattern[linetype+2];
- X b_maskcount=0;
- X}
- X
- X/*
- X** set b_value to value
- X*/
- Xvoid
- Xb_setvalue(value)
- Xunsigned int value;
- X{
- X b_value = value;
- X}
- X
- X/*
- X** move to (x,y)
- X*/
- Xint
- Xb_move(x, y)
- Xunsigned int x, y;
- X{
- X b_currx = x;
- X b_curry = y;
- X}
- X
- X/*
- X** draw to (x,y) with color b_value
- X*/
- Xint
- Xb_vector(x, y)
- Xunsigned int x, y;
- X{
- X b_line(b_currx, b_curry, x, y);
- X b_currx = x;
- X b_curry = y;
- X}
- X
- X
- X/*
- X** put text str at (x,y) with color b_value and rotation b_angle
- X*/
- Xint
- Xb_put_text(x,y,str)
- Xunsigned int x, y;
- Xchar *str;
- X{
- X if (b_angle == 1)
- X x += b_vchar/2;
- X else
- X y -= b_vchar/2;
- X switch (b_angle) {
- X case 0:
- X for (; *str; ++str, x += b_hchar)
- X b_putc (x, y, *str, b_angle);
- X break;
- X case 1:
- X for (; *str; ++str, y += b_hchar)
- X b_putc (x, y, *str, b_angle);
- X break;
- X }
- X}
- X
- X
- Xint
- Xb_text_angle(ang)
- Xint ang;
- X{
- X b_angle=(unsigned int)ang;
- X return TRUE;
- X}
- END_OF_FILE
- if test 52378 -ne `wc -c <'gnuplot/bitmap.c'`; then
- echo shar: \"'gnuplot/bitmap.c'\" unpacked with wrong size!
- fi
- # end of 'gnuplot/bitmap.c'
- fi
- if test -f 'gnuplot/header.mac' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gnuplot/header.mac'\"
- else
- echo shar: Extracting \"'gnuplot/header.mac'\" \(918 characters\)
- sed "s/^X//" >'gnuplot/header.mac' <<'END_OF_FILE'
- Xif1
- XLARGE equ 1 ; define your memory model here
- X
- Xifdef SMALL
- X ; default, so do nothing
- X else
- X
- Xifdef MEDIUM
- X LARGE_CODE equ 1
- X else
- X
- Xifdef COMPACT
- X LARGE_DATA equ 1
- X else
- X
- Xifdef LARGE
- X LARGE_DATA equ 1
- X LARGE_CODE equ 1
- X
- Xelse
- X %out No memory model defined--assuming SMALL
- X
- Xendif ; LARGE
- Xendif ; COMPACT
- Xendif ; MEDIUM
- Xendif ; SMALL
- X
- X
- Xbeginproc macro procname
- X
- Xifdef LARGE_CODE
- X procname proc far
- Xelse
- X procname proc near
- Xendif ; LARGE_CODE
- X
- X endm ; beginproc
- X
- X
- Xendif ; if1
- X
- X
- X_TEXT SEGMENT BYTE PUBLIC 'CODE'
- X_TEXT ENDS
- X_DATA SEGMENT WORD PUBLIC 'DATA'
- X_DATA ENDS
- XCONST SEGMENT WORD PUBLIC 'CONST'
- XCONST ENDS
- X_BSS SEGMENT WORD PUBLIC 'BSS'
- X_BSS ENDS
- X
- XDGROUP GROUP CONST, _BSS, _DATA
- X assume cs:_text, ds:dgroup, ss:dgroup, es:dgroup
- X
- X; define X as the offset of first argument on stack frame
- X
- Xifdef LARGE_CODE
- X X equ 6 ; return offset and segment + old BP
- Xelse
- X X equ 4 ; return offset + old BP
- Xendif ; LARGE_CODE
- END_OF_FILE
- if test 918 -ne `wc -c <'gnuplot/header.mac'`; then
- echo shar: \"'gnuplot/header.mac'\" unpacked with wrong size!
- fi
- # end of 'gnuplot/header.mac'
- fi
- if test -f 'gnuplot/readline.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gnuplot/readline.c'\"
- else
- echo shar: Extracting \"'gnuplot/readline.c'\" \(22204 characters\)
- sed "s/^X//" >'gnuplot/readline.c' <<'END_OF_FILE'
- X#ifndef lint
- Xstatic char *RCSid = "$Id: readline.c%v 3.50.1.9 1993/08/05 05:38:59 woo Exp $";
- X#endif
- X
- X
- X/* GNUPLOT - readline.c */
- X/*
- X * Copyright (C) 1986 - 1993 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 * Tom Tkacik
- X *
- X * Msdos port and some enhancements:
- X * Gershon Elber and many others.
- X *
- X * There is a mailing list for gnuplot users. Note, however, that the
- X * newsgroup
- X * comp.graphics.gnuplot
- X * is identical to the mailing list (they
- X * both carry the same set of messages). We prefer that you read the
- X * messages through that newsgroup, to subscribing to the mailing list.
- X * (If you can read that newsgroup, and are already on the mailing list,
- X * please send a message info-gnuplot-request@dartmouth.edu, asking to be
- X * removed from the mailing list.)
- X *
- X * The address for mailing to list members is
- X * info-gnuplot@dartmouth.edu
- X * and for mailing administrative requests is
- X * info-gnuplot-request@dartmouth.edu
- X * The mailing list for bug reports is
- X * bug-gnuplot@dartmouth.edu
- X * The list of those interested in beta-test versions is
- X * info-gnuplot-beta@dartmouth.edu
- X */
- X
- X#ifdef READLINE
- X#ifdef ATARI
- X#include "plot.h"
- X#endif
- X#ifdef _WINDOWS
- X#define _Windows
- X#endif
- X
- X/* a small portable version of GNU's readline */
- X/* this is not the BASH or GNU EMACS version of READLINE due to Copyleft
- X restrictions */
- X/* do not need any terminal capabilities except backspace, */
- X/* and space overwrites a character */
- X
- X/* NANO-EMACS line editing facility */
- X/* printable characters print as themselves (insert not overwrite) */
- X/* ^A moves to the beginning of the line */
- X/* ^B moves back a single character */
- X/* ^E moves to the end of the line */
- X/* ^F moves forward a single character */
- X/* ^K kills from current position to the end of line */
- X/* ^P moves back through history */
- X/* ^N moves forward through history */
- X/* ^H and DEL delete the previous character */
- X/* ^D deletes the current character, or EOF if line is empty */
- X/* ^L/^R redraw line in case it gets trashed */
- X/* ^U kills the entire line */
- X/* ^W kills last word */
- X/* LF and CR return the entire line regardless of the cursor postition */
- X/* EOF with an empty line returns (char *)NULL */
- X
- X/* all other characters are ignored */
- X
- X#include <stdio.h>
- X#include <ctype.h>
- X#include <signal.h>
- X
- X#if !defined(MSDOS) && !defined(ATARI) && !defined(_Windows) && !defined(DOS386)
- X
- X/*
- X * Set up structures using the proper include file
- X */
- X#if defined(_IBMR2) || defined(alliant)
- X#define SGTTY
- X#endif
- X
- X/* submitted by Francois.Dagorn@cicb.fr */
- X#ifdef SGTTY
- X#include <sgtty.h>
- Xstatic struct sgttyb orig_termio, rl_termio;
- X/* define terminal control characters */
- Xstatic struct tchars s_tchars;
- X#define VERASE 0
- X#define VEOF 1
- X#define VKILL 2
- X#ifdef TIOCGLTC /* available only with the 'new' line discipline */
- Xstatic struct ltchars s_ltchars;
- X#define VWERASE 3
- X#define VREPRINT 4
- X#define VSUSP 5
- X#endif /* TIOCGLTC */
- X#define NCCS 6
- X
- X#else /* SGTTY */
- X
- X/* SIGTSTP defines job control */
- X/* if there is job control then we need termios.h instead of termio.h */
- X/* (Are there any systems with job control that use termio.h? I hope not.) */
- X#ifdef SIGTSTP
- X#define TERMIOS
- X#include <termios.h>
- X/* Added by Robert Eckardt, RobertE@beta.TP2.Ruhr-Uni-Bochum.de */
- X#ifdef ISC22
- X#ifndef ONOCR /* taken from sys/termio.h */
- X#define ONOCR 0000020 /* true at least for ISC 2.2 */
- X#endif
- X#ifndef IUCLC
- X#define IUCLC 0001000
- X#endif
- X#endif /* ISC22 */
- X
- Xstatic struct termios orig_termio, rl_termio;
- X#else
- X#include <termio.h>
- Xstatic struct termio orig_termio, rl_termio;
- X/* termio defines NCC instead of NCCS */
- X#define NCCS NCC
- X#endif /* SIGTSTP */
- X#endif /* SGTTY */
- X
- X/* ULTRIX defines VRPRNT instead of VREPRINT */
- X#ifdef VRPRNT
- X#define VREPRINT VRPRNT
- X#endif
- X
- X/* define characters to use with our input character handler */
- Xstatic char term_chars[NCCS];
- X
- Xstatic int term_set = 0; /* =1 if rl_termio set */
- X
- X#define special_getc() ansi_getc()
- Xstatic char ansi_getc();
- X
- X#else /* !MSDOS && !ATARI && !_Windows */
- X
- X#ifdef _Windows
- X#include <windows.h>
- X#include "win/wtext.h"
- X#include "win/wgnuplib.h"
- Xextern TW textwin;
- X#define TEXTUSER 0xf1
- X#define TEXTGNUPLOT 0xf0
- X#define special_getc() msdos_getch()
- Xstatic char msdos_getch();
- X#endif
- X
- X#if defined(MSDOS) || defined(DOS386)
- X/* MSDOS specific stuff */
- X#ifdef DJGPP
- X#include <pc.h>
- X#endif
- X#ifdef __EMX__
- X#include <conio.h>
- X#endif
- X#define special_getc() msdos_getch()
- Xstatic char msdos_getch();
- X#endif /* MSDOS */
- X
- X#ifdef ATARI
- X#include <stdlib.h>
- X#ifdef __PUREC__
- X#include <tos.h>
- X#else
- X#include <osbind.h>
- X#endif
- X#define special_getc() tos_getch()
- Xstatic char tos_getch();
- X#endif
- X
- X#endif /* !MSDOS && !ATARI && !_Windows */
- X
- X#if !defined(ATARI)
- X/* is it <string.h> or <strings.h>? just declare what we need */
- Xextern int strlen();
- Xextern char *strcpy();
- X#endif
- Xextern char *alloc(); /* we'll use the safe malloc from misc.c */
- X
- X#define MAXBUF 1024
- X#define BACKSPACE 0x08 /* ^H */
- X#define SPACE ' '
- X
- Xstruct hist {
- X char *line;
- X struct hist *prev;
- X struct hist *next;
- X};
- X
- Xstatic struct hist *history = NULL; /* no history yet */
- Xstatic struct hist *cur_entry = NULL;
- X
- Xstatic char cur_line[MAXBUF]; /* current contents of the line */
- Xstatic int cur_pos = 0; /* current position of the cursor */
- Xstatic int max_pos = 0; /* maximum character position */
- X
- X
- Xvoid add_history();
- Xstatic void fix_line();
- Xstatic void redraw_line();
- Xstatic void clear_line();
- Xstatic void clear_eoline();
- Xstatic void copy_line();
- Xstatic void set_termio();
- Xstatic void reset_termio();
- X
- X/* user_putc and user_puts should be used in the place of
- X * fputc(ch,stderr) and fputs(str,stderr) for all output
- X * of user typed characters. This allows MS-Windows to
- X * display user input in a different color. */
- Xint
- Xuser_putc(ch)
- Xint ch;
- X{
- X int rv;
- X#ifdef _Windows
- X TextAttr(&textwin,TEXTUSER);
- X#endif
- X rv = fputc(ch, stderr);
- X#ifdef _Windows
- X TextAttr(&textwin,TEXTGNUPLOT);
- X#endif
- X return rv;
- X}
- X
- Xint
- Xuser_puts(str)
- Xchar *str;
- X{
- X int rv;
- X#ifdef _Windows
- X TextAttr(&textwin,TEXTUSER);
- X#endif
- X rv = fputs(str, stderr);
- X#ifdef _Windows
- X TextAttr(&textwin,TEXTGNUPLOT);
- X#endif
- X return rv;
- X}
- X
- X/* This function provides a centralized non-destructive backspace capability */
- X/* M. Castro */
- X
- Xbackspace()
- X{
- X user_putc(BACKSPACE);
- X}
- X
- Xchar *
- Xreadline(prompt)
- Xchar *prompt;
- X{
- X
- X unsigned char cur_char;
- X char *new_line;
- X /* unsigned char *new_line; */
- X
- X /* set the termio so we can do our own input processing */
- X set_termio();
- X
- X /* print the prompt */
- X fputs(prompt, stderr);
- X cur_line[0] = '\0';
- X cur_pos = 0;
- X max_pos = 0;
- X cur_entry = NULL;
- X
- X /* get characters */
- X for(;;) {
- X cur_char = special_getc();
- X#ifdef OS2
- X /* for emx: remap scan codes for cursor keys */
- X if( cur_char == 0 ) {
- X cur_char = getc(stdin);
- X switch( cur_char){
- X case 75: /* left, map to ^B */
- X cur_char=2;
- X break ;
- X case 77: /* right, map to ^F */
- X cur_char=6;
- X break ;
- X case 115: /* ctrl left */
- X case 71: /* home, map to ^A */
- X cur_char=1;
- X break ;
- X case 116: /* ctrl right */
- X case 79: /* end, map to ^E */
- X cur_char=5;
- X break ;
- X case 72: /* up, map to ^P */
- X cur_char=16;
- X break ;
- X case 80: /* down, map to ^N */
- X cur_char=14;
- X break ;
- X case 83: /* delete, map to ^D */
- X cur_char=4;
- X break ;
- X default: /* ignore */
- X cur_char=0;
- X continue ;
- X }
- X }
- X#endif /*OS2*/
- X if((isprint(cur_char)
- X#if defined(ATARI) || defined(_Windows) || defined(MSDOS) || defined(DOS386)
- X /* this should be used for all 8bit ASCII machines, I guess */
- X || ((unsigned char)cur_char > 0x7f)
- X#endif
- X )&& max_pos<MAXBUF-1) {
- X int i;
- X for(i=max_pos; i>cur_pos; i--) {
- X cur_line[i] = cur_line[i-1];
- X }
- X user_putc(cur_char);
- X cur_line[cur_pos] = cur_char;
- X cur_pos += 1;
- X max_pos += 1;
- X if (cur_pos < max_pos)
- X fix_line();
- X cur_line[max_pos] = '\0';
- X
- X /* else interpret unix terminal driver characters */
- X#ifdef VERASE
- X } else if(cur_char == term_chars[VERASE] ){ /* DEL? */
- X if(cur_pos > 0) {
- X int i;
- X cur_pos -= 1;
- X backspace();
- X for(i=cur_pos; i<max_pos; i++)
- X cur_line[i] = cur_line[i+1];
- X max_pos -= 1;
- X fix_line();
- X }
- X#endif /* VERASE */
- X#ifdef VEOF
- X } else if(cur_char == term_chars[VEOF] ){ /* ^D? */
- X if(max_pos == 0) {
- X reset_termio();
- X return((char *)NULL);
- X }
- X if((cur_pos < max_pos)&&(cur_char == 004)) { /* ^D */
- X int i;
- X for(i=cur_pos; i<max_pos; i++)
- X cur_line[i] = cur_line[i+1];
- X max_pos -= 1;
- X fix_line();
- X }
- X#endif /* VEOF */
- X#ifdef VKILL
- X } else if(cur_char == term_chars[VKILL] ){ /* ^U? */
- X clear_line(prompt);
- X#endif /* VKILL */
- X#ifdef VWERASE
- X } else if(cur_char == term_chars[VWERASE] ){ /* ^W? */
- X while((cur_pos > 0) &&
- X (cur_line[cur_pos-1] == SPACE)) {
- X cur_pos -= 1;
- X backspace();
- X }
- X while((cur_pos > 0) &&
- X (cur_line[cur_pos-1] != SPACE)) {
- X cur_pos -= 1;
- X backspace();
- X }
- X clear_eoline();
- X max_pos = cur_pos;
- X#endif /* VWERASE */
- X#ifdef VREPRINT
- X } else if(cur_char == term_chars[VREPRINT] ){ /* ^R? */
- X putc('\n',stderr); /* go to a fresh line */
- X redraw_line(prompt);
- X#endif /* VREPRINT */
- X#ifdef VSUSP
- X } else if(cur_char == term_chars[VSUSP]) {
- X reset_termio();
- X kill(0, SIGTSTP);
- X
- X /* process stops here */
- X
- X set_termio();
- X /* print the prompt */
- X redraw_line(prompt);
- X#endif /* VSUSP */
- X } else {
- X /* do normal editing commands */
- X /* some of these are also done above */
- X int i;
- X switch(cur_char) {
- X case EOF:
- X reset_termio();
- X return((char *)NULL);
- X case 001: /* ^A */
- X while(cur_pos > 0) {
- X cur_pos -= 1;
- X backspace();
- X }
- X break;
- X case 002: /* ^B */
- X if(cur_pos > 0) {
- X cur_pos -= 1;
- X backspace();
- X }
- X break;
- X case 005: /* ^E */
- X while(cur_pos < max_pos) {
- X user_putc(cur_line[cur_pos]);
- X cur_pos += 1;
- X }
- X break;
- X case 006: /* ^F */
- X if(cur_pos < max_pos) {
- X user_putc(cur_line[cur_pos]);
- X cur_pos += 1;
- X }
- X break;
- X case 013: /* ^K */
- X clear_eoline();
- X max_pos = cur_pos;
- X break;
- X case 020: /* ^P */
- X if(history != NULL) {
- X if(cur_entry == NULL) {
- X cur_entry = history;
- X clear_line(prompt);
- X copy_line(cur_entry->line);
- X } else if(cur_entry->prev != NULL) {
- X cur_entry = cur_entry->prev;
- X clear_line(prompt);
- X copy_line(cur_entry->line);
- X }
- X }
- X break;
- X case 016: /* ^N */
- X if(cur_entry != NULL) {
- X cur_entry = cur_entry->next;
- X clear_line(prompt);
- X if(cur_entry != NULL)
- X copy_line(cur_entry->line);
- X else
- X cur_pos = max_pos = 0;
- X }
- X break;
- X case 014: /* ^L */
- X case 022: /* ^R */
- X putc('\n',stderr); /* go to a fresh line */
- X redraw_line(prompt);
- X break;
- X case 0177: /* DEL */
- X case 010: /* ^H */
- X if(cur_pos > 0) {
- X cur_pos -= 1;
- X backspace();
- X for(i=cur_pos; i<max_pos; i++)
- X cur_line[i] = cur_line[i+1];
- X max_pos -= 1;
- X fix_line();
- X }
- X break;
- X case 004: /* ^D */
- X if(max_pos == 0) {
- X reset_termio();
- X return((char *)NULL);
- X }
- X if(cur_pos < max_pos) {
- X for(i=cur_pos; i<max_pos; i++)
- X cur_line[i] = cur_line[i+1];
- X max_pos -= 1;
- X fix_line();
- X }
- X break;
- X case 025: /* ^U */
- X clear_line(prompt);
- X break;
- X case 027: /* ^W */
- X while((cur_pos > 0) &&
- X (cur_line[cur_pos-1] == SPACE)) {
- X cur_pos -= 1;
- X backspace();
- X }
- X while((cur_pos > 0) &&
- X (cur_line[cur_pos-1] != SPACE)) {
- X cur_pos -= 1;
- X backspace();
- X }
- X clear_eoline();
- X max_pos = cur_pos;
- X break;
- X case '\n': /* ^J */
- X case '\r': /* ^M */
- X cur_line[max_pos+1] = '\0';
- X putc('\n', stderr);
- X new_line = (char *)alloc((unsigned long) (strlen(cur_line)+1), "history");
- X strcpy(new_line,cur_line);
- X reset_termio();
- X return(new_line);
- X default:
- X break;
- X }
- X }
- X }
- X}
- X
- X/* fix up the line from cur_pos to max_pos */
- X/* do not need any terminal capabilities except backspace, */
- X/* and space overwrites a character */
- Xstatic void
- Xfix_line()
- X{
- X int i;
- X
- X /* write tail of string */
- X for(i=cur_pos; i<max_pos; i++)
- X user_putc(cur_line[i]);
- X
- X /* write a space at the end of the line in case we deleted one */
- X user_putc(SPACE);
- X
- X /* backup to original position */
- X for(i=max_pos+1; i>cur_pos; i--)
- X backspace();
- X
- X}
- X
- X/* redraw the entire line, putting the cursor where it belongs */
- Xstatic void
- Xredraw_line(prompt)
- Xchar *prompt;
- X{
- X int i;
- X
- X fputs(prompt, stderr);
- X user_puts(cur_line);
- X
- X /* put the cursor where it belongs */
- X for(i=max_pos; i>cur_pos; i--)
- X backspace();
- X}
- X
- X/* clear cur_line and the screen line */
- Xstatic void
- Xclear_line(prompt)
- Xchar *prompt;
- X{
- X int i;
- X for(i=0; i<max_pos; i++)
- X cur_line[i] = '\0';
- X
- X for(i=cur_pos; i>0; i--)
- X backspace();
- X
- X for(i=0; i<max_pos; i++)
- X putc(SPACE, stderr);
- X
- X putc('\r', stderr);
- X fputs(prompt, stderr);
- X
- X cur_pos = 0;
- X max_pos = 0;
- X}
- X
- X/* clear to end of line and the screen end of line */
- Xstatic void
- Xclear_eoline(prompt)
- Xchar *prompt;
- X{
- X int i;
- X for(i=cur_pos; i<max_pos; i++)
- X cur_line[i] = '\0';
- X
- X for(i=cur_pos; i<max_pos; i++)
- X putc(SPACE, stderr);
- X for(i=cur_pos; i<max_pos; i++)
- X backspace();
- X}
- X
- X/* copy line to cur_line, draw it and set cur_pos and max_pos */
- Xstatic void
- Xcopy_line(line)
- Xchar *line;
- X{
- X strcpy(cur_line, line);
- X user_puts(cur_line);
- X cur_pos = max_pos = strlen(cur_line);
- X}
- X
- X/* add line to the history */
- Xvoid
- Xadd_history(line)
- Xchar *line;
- X{
- X struct hist *entry;
- X entry = (struct hist *)alloc((unsigned long)sizeof(struct hist),"history");
- X entry->line = alloc((unsigned long)(strlen(line)+1),"history");
- X strcpy(entry->line, line);
- X
- X entry->prev = history;
- X entry->next = NULL;
- X if(history != NULL) {
- X history->next = entry;
- X }
- X history = entry;
- X}
- X
- X
- X/* Convert ANSI arrow keys to control characters */
- Xstatic char
- Xansi_getc()
- X{
- X char c = getc(stdin);
- X if (c == 033) {
- X c = getc(stdin); /* check for CSI */
- X if (c == '[') {
- X c = getc(stdin); /* get command character */
- X switch (c) {
- X case 'D': /* left arrow key */
- X c = 002;
- X break;
- X case 'C': /* right arrow key */
- X c = 006;
- X break;
- X case 'A': /* up arrow key */
- X c = 020;
- X break;
- X case 'B': /* down arrow key */
- X c = 016;
- X break;
- X }
- X }
- X }
- X return c;
- X}
- X
- X#if defined(MSDOS) || defined(_Windows) || defined(DOS386)
- X
- X/* Convert Arrow keystrokes to Control characters: */
- Xstatic char
- Xmsdos_getch()
- X{
- X#ifdef DJGPP
- X char c;
- X int ch = getkey();
- X c = (ch & 0xff00) ? 0 : ch & 0xff;
- X#else
- X char c = getch();
- X#endif
- X
- X if (c == 0) {
- X#ifdef DJGPP
- X c = ch & 0xff;
- X#else
- X c = getch(); /* Get the extended code. */
- X#endif
- X switch (c) {
- X case 75: /* Left Arrow. */
- X c = 002;
- X break;
- X case 77: /* Right Arrow. */
- X c = 006;
- X break;
- X case 72: /* Up Arrow. */
- X c = 020;
- X break;
- X case 80: /* Down Arrow. */
- X c = 016;
- X break;
- X case 115: /* Ctl Left Arrow. */
- X case 71: /* Home */
- X c = 001;
- X break;
- X case 116: /* Ctl Right Arrow. */
- X case 79: /* End */
- X c = 005;
- X break;
- X case 83: /* Delete */
- X c = 004;
- X break;
- X default:
- X c = 0;
- X break;
- X }
- X }
- X else if (c == 033) { /* ESC */
- X c = 025;
- X }
- X
- X
- X return c;
- X}
- X
- X#endif /* MSDOS */
- X
- X#ifdef ATARI
- X
- X/* Convert Arrow keystrokes to Control characters: TOS version */
- X
- X/* the volatile could be necessary to keep gcc from reordering
- X the two Super calls
- X*/
- X#define CONTERM ((/*volatile*/ char *)0x484L)
- X
- Xstatic void
- Xremove_conterm()
- X{
- X void *ssp=(void*)Super(0L);
- X *CONTERM &= ~0x8;
- X Super(ssp);
- X}
- X
- Xstatic char
- Xtos_getch()
- X{
- X long rawkey;
- X char c;
- X int scan_code;
- X void *ssp;
- X static int init = 1;
- X static int in_help = 0;
- X
- X if (in_help) {
- X switch(in_help) {
- X case 1:
- X case 5: in_help++; return 'e';
- X case 2:
- X case 6: in_help++; return 'l';
- X case 3:
- X case 7: in_help++; return 'p';
- X case 4: in_help = 0; return 0x0d;
- X case 8: in_help = 0; return ' ';
- X }
- X }
- X
- X if (init) {
- X ssp = (void*)Super(0L);
- X if( !(*CONTERM & 0x8) ) {
- X *CONTERM |= 0x8;
- X } else {
- X init=0;
- X }
- X (void)Super(ssp);
- X if( init ) {
- X atexit(remove_conterm);
- X init = 0;
- X }
- X }
- X
- X (void)Cursconf(1, 0); /* cursor on */
- X rawkey = Cnecin();
- X c = (char)rawkey;
- X scan_code= ((int)(rawkey>>16)) & 0xff; /* get the scancode */
- X if( rawkey&0x07000000 ) scan_code |= 0x80; /* shift or control */
- X
- X switch (scan_code) {
- X case 0x62: /* HELP */
- X if (max_pos==0) {
- X in_help = 1;
- X return 'h';
- X } else {
- X return 0;
- X }
- X case 0xe2: /* shift HELP */
- X if (max_pos==0) {
- X in_help = 5;
- X return 'h';
- X } else {
- X return 0;
- X }
- X case 0x48: /* Up Arrow */
- X return 0x10; /* ^P */
- X case 0x50: /* Down Arrow */
- X return 0x0e; /* ^N */
- X case 0x4b: /* Left Arrow */
- X return 0x02; /* ^B */
- X case 0x4d: /* Right Arrow */
- X return 0x06; /* ^F */
- X case 0xcb: /* Shift Left Arrow */
- X case 0xf3: /* Ctrl Left Arrow (TOS-bug ?) */
- X case 0x47: /* Home */
- X return 0x01; /* ^A */
- X case 0xcd: /* Shift Right Arrow */
- X case 0xf4: /* Ctrl Right Arrow (TOS-bug ?) */
- X case 0xc7: /* Shift Home */
- X case 0xf7: /* Crtl Home */
- X return 0x05; /* ^E */
- X case 0x61: /* Undo - redraw line */
- X return 0x0c; /* ^L */
- X default:
- X if (c == 0x1b) return 0x15; /* ESC becomes ^U */
- X if (c == 0x7f) return 0x04; /* Del becomes ^D */
- X break;
- X }
- X
- X return c;
- X}
- X
- X#endif /* ATARI */
- X
- X /* set termio so we can do our own input processing */
- Xstatic void
- Xset_termio()
- X{
- X#if !defined(MSDOS) && !defined(ATARI) && !defined(_Windows) && !defined(DOS386)
- X/* set termio so we can do our own input processing */
- X/* and save the old terminal modes so we can reset them later */
- X if(term_set == 0) {
- X /*
- X * Get terminal modes.
- X */
- X#ifdef SGTTY
- X ioctl(0, TIOCGETP, &orig_termio);
- X#else /* SGTTY */
- X#ifdef TERMIOS
- X#ifdef TCGETS
- X ioctl(0, TCGETS, &orig_termio);
- X#else
- X tcgetattr(0, &orig_termio);
- X#endif /* TCGETS */
- X#else
- X ioctl(0, TCGETA, &orig_termio);
- X#endif /* TERMIOS */
- X#endif /* SGTTY */
- X
- X /*
- X * Save terminal modes
- X */
- X rl_termio = orig_termio;
- X
- X /*
- X * Set the modes to the way we want them
- X * and save our input special characters
- X */
- X#ifdef SGTTY
- X rl_termio.sg_flags |= CBREAK;
- X rl_termio.sg_flags &= ~(ECHO|XTABS);
- X ioctl(0, TIOCSETN, &rl_termio);
- X
- X ioctl(0, TIOCGETC, &s_tchars);
- X term_chars[VERASE] = orig_termio.sg_erase;
- X term_chars[VEOF] = s_tchars.t_eofc;
- X term_chars[VKILL] = orig_termio.sg_kill;
- X#ifdef TIOCGLTC
- X ioctl(0, TIOCGLTC, &s_ltchars);
- X term_chars[VWERASE] = s_ltchars.t_werasc;
- X term_chars[VREPRINT] = s_ltchars.t_rprntc;
- X term_chars[VSUSP] = s_ltchars.t_suspc;
- X
- X /* disable suspending process on ^Z */
- X s_ltchars.t_suspc = 0;
- X ioctl(0, TIOCSLTC, &s_ltchars);
- X#endif /* TIOCGLTC */
- X#else /* SGTTY */
- X rl_termio.c_iflag &= ~(BRKINT|PARMRK|INPCK|IUCLC|IXON|IXOFF);
- X rl_termio.c_iflag |= (IGNBRK|IGNPAR);
- X
- X /* rl_termio.c_oflag &= ~(ONOCR); Costas Sphocleous Irvine,CA */
- X
- X rl_termio.c_lflag &= ~(ICANON|ECHO|ECHOE|ECHOK|ECHONL|NOFLSH);
- X#ifdef OS2
- X /* for emx: remove default terminal processing */
- X rl_termio.c_lflag &= ~(IDEFAULT);
- X#endif /* OS2 */
- X rl_termio.c_lflag |= (ISIG);
- X rl_termio.c_cc[VMIN] = 1;
- X rl_termio.c_cc[VTIME] = 0;
- X
- X#ifndef VWERASE
- X#define VWERASE 3
- X#endif
- X term_chars[VERASE] = orig_termio.c_cc[VERASE];
- X term_chars[VEOF] = orig_termio.c_cc[VEOF];
- X term_chars[VKILL] = orig_termio.c_cc[VKILL];
- X#ifdef TERMIOS
- X term_chars[VWERASE] = orig_termio.c_cc[VWERASE];
- X#ifdef VREPRINT
- X term_chars[VREPRINT] = orig_termio.c_cc[VREPRINT];
- X#else
- X#ifdef VRPRNT
- X term_chars[VRPRNT] = orig_termio.c_cc[VRPRNT];
- X#endif
- X#endif
- X term_chars[VSUSP] = orig_termio.c_cc[VSUSP];
- X
- X /* disable suspending process on ^Z */
- X rl_termio.c_cc[VSUSP] = 0;
- X#endif /* TERMIOS */
- X#endif /* SGTTY */
- X
- X /*
- X * Set the new terminal modes.
- X */
- X#ifdef SGTTY
- X ioctl(0, TIOCSLTC, &s_ltchars);
- X#else
- X#ifdef TERMIOS
- X#ifdef TCSETSW
- X ioctl(0, TCSETSW, &rl_termio);
- X#else
- X tcsetattr(0, TCSADRAIN, &rl_termio);
- X#endif /* TCSETSW */
- X#else
- X ioctl(0, TCSETAW, &rl_termio);
- X#endif /* TERMIOS */
- X#endif /* SGTTY */
- X term_set = 1;
- X }
- X#endif /* !MSDOS && !ATARI && !defined(_Windows) */
- X}
- X
- Xstatic void
- Xreset_termio()
- X{
- X#if !defined(MSDOS) && !defined(ATARI) && !defined(_Windows) && !defined(DOS386)
- X/* reset saved terminal modes */
- X if(term_set == 1) {
- X#ifdef SGTTY
- X ioctl(0, TIOCSETN, &orig_termio);
- X#ifdef TIOCGLTC
- X /* enable suspending process on ^Z */
- X s_ltchars.t_suspc = term_chars[VSUSP];
- X ioctl(0, TIOCSLTC, &s_ltchars);
- X#endif /* TIOCGLTC */
- X#else /* SGTTY */
- X#ifdef TERMIOS
- X#ifdef TCSETSW
- X ioctl(0, TCSETSW, &orig_termio);
- X#else
- X tcsetattr(0, TCSADRAIN, &orig_termio);
- X#endif /* TCSETSW */
- X#else
- X ioctl(0, TCSETAW, &orig_termio);
- X#endif /* TERMIOS */
- X#endif /* SGTTY */
- X term_set = 0;
- X }
- X#endif /* !MSDOS && !ATARI && !_Windows */
- X}
- X#endif /* READLINE */
- END_OF_FILE
- if test 22204 -ne `wc -c <'gnuplot/readline.c'`; then
- echo shar: \"'gnuplot/readline.c'\" unpacked with wrong size!
- fi
- # end of 'gnuplot/readline.c'
- fi
- echo shar: End of archive 8 \(of 33\).
- cp /dev/null ark8isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 33 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-