This file contains a log of all the old CHANGES files.


*****************************************************************************
PLplot 4.99h changes
Jul 29, 1994
*****************************************************************************

This release contains several important new capabilities and many bug
fixes.  Changes grouped by files affected.  The old Changes.log file has
been moved to the doc directory as Rel4p99g.doc for future reference.

Maurice LeBrun	mjl@dino.ph.utexas.edu

-----------------------------------------------------------------------------
Install scripts, makefile, etc.
-----------------------------------------------------------------------------

Completely new.  configure script now generated by autoconf, using
aclocal.m4, configure.in, cf/sysconf.in, and cf/sysloc.in.  The Makefile
and certain basic header files are built from files in the cf directory.
Much more powerful than before.  See cf/README.

-----------------------------------------------------------------------------
Main source files
-----------------------------------------------------------------------------

All core source files: 
made another pass to eliminate warnings when using gcc -Wall.  Lots of
cleaning up: got rid of includes of math.h or string.h (now included by
plplot.h), and other minor changes.  Now each file has global access to
the plstream pointer via extern; many accessor functions eliminated as a
result.


plwind.c:
 * Revision 1.8  1994/07/29  20:29:24  mjl
 * Change so that window coordinates are added to the window list each time
 * plwind() is called.  Contributed by Paul Casteels.


plsym.c:
 * Revision 1.12  1994/07/21  10:11:42  mjl
 * Added a fast point draw capability: if code=-1 is given to plpoin or
 * plpoin3, instead of drawing a Hershey font character it draws a point
 * using simply a move and draw.  This is at least 4X faster.
 *
 * Revision 1.11  1994/07/20  06:09:50  mjl
 * Changed syntax of the new 3d function plpoin3() to be more like plpoin(),
 * and moved to this file.


plstream.c:
 * Revision 1.18  1994/07/26  18:17:24  mjl
 * Added missing variable declaration and initializer.
 *
 * Revision 1.17  1994/07/26  09:00:46  mjl
 * Added a quick fix so that hitting a carriage return when prompted for
 * a filename no longer aborts the program.  Contributed by Mark Olesen.


plshade.c:
 * Revision 1.10  1994/07/12  19:20:55  mjl
 * Argument list for plshade() fixed.


plpage.c:
 * Revision 1.10  1994/07/29  20:27:40  mjl
 * Added plGetCursor() and other support routines for returning the cursor
 * location in world coordinates given a mouse click, if supported by the
 * driver.  Supports multiple windows per page, and gets the correct set
 * of world coordinates for the plot selected.  Contributed by Paul Casteels.
 *
 * Revision 1.9  1994/06/30  18:27:17  mjl
 * Subpage initialization code moved to this file --
 * subpage settings can now be changed any time (previously, it had to be
 * done before calling plinit).


plmap.c: (new)
 * Revision 1.1  1994/07/29  20:26:10  mjl
 * Function to plot map backgrounds, read from the specified map data file.
 * Contributed by Wesley Ebisuzaki.


plline.c:
 * Revision 1.16  1994/07/22  15:54:37  furnish
 * Fix bug in selective segment draw capability of plpoly3().
 *
 * Revision 1.15  1994/07/20  10:38:57  mjl
 * Fixed the error return on the two new routines.
 *
 * Revision 1.14  1994/07/20  06:09:22  mjl
 * Changed syntax of the new 3d functions plline3() and plpoly3() to be more
 * like plline(), and moved to this file.


plfont.c:
 * Revision 1.16  1994/07/29  20:24:42  mjl
 * References to plfontopen() deleted, in favor of using plLibOpen().
 *
 * Revision 1.15  1994/07/26  21:14:44  mjl
 * Improvements to the way PLplot looks for various files.  Now more
 * consistent and flexible.  In particular, environmentals can be set for
 * locations of each directory (for Tcl, binary, and library files).
 * Contributed by Mark Olesen.


plctrl.c:
 * Revision 1.23  1994/07/29  20:23:53  mjl
 * Added new function plLibOpen(), used for opening and returning the file
 * handle for "library" files -- font files, map files, etc.  These are all
 * located by the same search path.
 *
 * Revision 1.22  1994/07/26  21:14:41  mjl
 * Improvements to the way PLplot looks for various files.  Now more
 * consistent and flexible.  In particular, environmentals can be set for
 * locations of each directory (for Tcl, binary, and library files).
 * Contributed by Mark Olesen.
 *
 * Revision 1.21  1994/07/25  06:44:31  mjl
 * Wrapped the include of unistd.h in a HAVE_UNISTD_H.


plcore.c:
 * Revision 1.37  1994/07/12  19:20:31  mjl
 * Two bugs fixed: cmap1 palette should now "stick" on plots saved from Tk
 * driver, and the code won't complain when a bop isn't preceded by an eop.
 *
 * Revision 1.36  1994/07/08  22:50:31  mjl
 * Fixed bug that was hosing the background color in plots saved from the
 * Tk/DP driver menu.
 *
 * Revision 1.35  1994/07/03  05:50:22  mjl
 * Added fix to prevent an infinite loop while exiting under certain error
 * conditions, submitted by Radey Shouman.
 *
 * Revision 1.34  1994/07/02  21:32:11  mjl
 * Ensure that fflush() is never called with a null pointer, since some
 * systems don't like it (submitted by Neal Holtz).
 *
 * Revision 1.33  1994/06/30  18:26:16  mjl
 * Driver interface changed to keep track of current
 * status; plsc->status is set to one of AT_BOP, DRAWING, or AT_EOP.  This
 * makes it easy to catch missing plbop/pleop's, and to collapse multiple
 * plbop's or pleop's into a single one.  Subpage initialization code moved
 * to plpage.c.
 *
 * Revision 1.32  1994/06/09  20:31:30  mjl
 * Small changes to the way plmkstrm() works.


plstream.h:
 * Revision 1.31  1994/07/23  04:46:55  mjl
 * Added pls->server_nokill, which can be set to prevent plserver from dying
 * when a ^C is hit.
 *
 * Revision 1.30  1994/07/19  22:34:46  mjl
 * Eliminated some unnecessary defines.
 *
 * Revision 1.29  1994/06/30  18:37:03  mjl
 * Added status flag to keep track of current page status.


plplotP.h:
 * Revision 1.27  1994/07/29  20:19:31  mjl
 * Added typedef for CWindow -- window coordinate structure, also prototypes
 * for plAddCWindow() and plClrCWindows(void) (contributed by Paul Casteels).
 * Also prototype for new plLibOpen() function.
 *
 * Revision 1.26  1994/07/26  21:14:38  mjl
 * Improvements to the way PLplot looks for various files.  Now more
 * consistent and flexible.  In particular, environmentals can be set for
 * locations of each directory (for Tcl, binary, and library files).
 * Contributed by Mark Olesen.
 *
 * Revision 1.25  1994/07/24  07:41:46  mjl
 * Eliminated some more system-dependent stuff, in view of plConfig.h
 * providing us with the _POSIX_SOURCE define (or not).
 *
 * Revision 1.24  1994/07/23  04:46:26  mjl
 * Decreased the amount of custom system handling due to use of plConfig.h.
 * Need to do some more yet...
 *
 * Revision 1.23  1994/07/22  15:54:09  furnish
 * Fix overaggressive behavior.
 *
 * Revision 1.22  1994/07/19  22:35:04  mjl
 * Added includes for pdf.h and plConfig.h.
 *
 * Revision 1.21  1994/06/30  18:36:06  mjl
 * Removed prototypes for deleted accessor functions.  Inserted an extern
 * PLStream *plsc declaration for easier access to PLplot state info (only
 * plcore.h, which declares the real plsc, doesn't see this declaration).
 * Now includes plstream.h.


plplot.h:
 * Revision 1.69  1994/07/29  20:17:02  mjl
 * Added typedef for new PLCursor struct and driver escape code for the get
 * cursor operation (contributed by Paul Casteels).  Added prototypes for
 * plmap() and plmeridians() (contributed by Wesley Ebisuzaki).
 *
 * Revision 1.68  1994/07/28  08:04:49  mjl
 * Bumped version number, revision to various comments.
 *
 * Revision 1.67  1994/07/20  06:07:09  mjl
 * Changed names and prototypes for the new 3d functions -- now plline3(),
 * plpoin3(), and plpoly3().
 *
 * Revision 1.66  1994/07/19  22:14:45  furnish
 * Stuff for pl3poly().
 *
 * Revision 1.65  1994/07/15  20:37:12  furnish
 * Added routines pl3line and pl3poin for drawing lines and points in 3
 * space.  Added a new example program, and dependency info to build it.
 *
 * Revision 1.64  1994/07/12  19:18:00  mjl
 * Fixed prototype for plshade().
 *
 * Revision 1.63  1994/06/30  18:33:36  mjl
 * Now includes math.h and string.h, since I was tired of getting burned by
 * leaving these out (and having strange run-time errors as a result).  The
 * PLINT type now is an "int" by default, except on MSDOS where it's a long
 * (16 bits not being enough).  The latter can be modified under 32 bit
 * compilation systems to use an int also.  So currently, you can use an
 * int as a PLINT on all systems except MSDOS, there you must use PLINT.
 *
 * Revision 1.62  1994/06/16  19:48:36  mjl
 * Inserted prototype for pltkMain(), removed prototype for plframeCmd().


plcore.h:
 * Revision 1.23  1994/07/25  06:05:35  mjl
 * Added dispatch table entry for new lj_hpgl driver.
 *
 * Revision 1.22  1994/07/19  22:36:10  mjl
 * Included plDevs.h.  Driver enabling macro renamed to PLD_<driver>, where
 * <driver> is xwin, ps, etc.  See plDevs.h for more detail.
 *
 * Revision 1.21  1994/06/30  18:29:21  mjl
 * Include-guards included, and the PLStream pointer made global.  The latter
 * will make access to PLplot state information much easier.


-----------------------------------------------------------------------------
Fortran interface
-----------------------------------------------------------------------------

sfstubs.fm4:
! Revision 1.3  1994/07/12  19:22:10  mjl
! Various cleaning up and robustifications.


sfstubs.f:
  new, provided as a failsafe in case m4 is unavailable or broken
  single precision only


fmacs.m4:
# Revision 1.3  1994/07/12  19:21:32  mjl
# Fixed type definitions to help generated text stay within 72 columns.


scstubs.c:
 * Revision 1.19  1994/07/20  06:08:03  mjl
 * Added Fortran interface routines to handle the new 3d functions plline3(),
 * plpoin3(), and plpoly3().


plstubs.h:
 * Revision 1.22  1994/07/20  06:07:44  mjl
 * Added definitions for Fortran interface routines to handle the new 3d
 * functions plline3(), plpoin3(), and plpoly3().


-----------------------------------------------------------------------------
Tcl API
-----------------------------------------------------------------------------

All files here are new, to support the new PLplot Tcl API.

tclMatrix.c:
 * Revision 1.6  1994/08/09  08:33:35  mjl
 * Changed the tclMatrix API once again.  The 'matrix' operator now sets up a
 * command for the actual name used to declare the matrix.  This is faster
 * than the old way, more intuitive, and less robust (the created matrix is
 * global).  The last problem can presumably fixed by modifications to the
 * Tcl kernel to support a matrix type, and is worth sacrificing for now
 * in favor of a better syntax.  The matrix declarator sets a local variable
 * of the same name as the created (matrix) command in order to automatically
 * free locally-declared matrix resources at the end of a proc.  So previous
 * scripts will still work.
 *
 * Revision 1.5  1994/06/30  18:55:02  mjl
 * Now accepts an initializer when matrix is declared, for example:
 * matrix base i 4 = {0, 200, 500, 600}.  Only works for 1-d arrays so far.
 *
 * Revision 1.4  1994/06/30  05:45:24  furnish
 * Cobbled together an extension facility which allows a user to define
 * their own subcommands for tclMatricies.  The idea is that you can use
 * this to implement your own matrix processing commands entirely on the
 * compiled side.  fft's, matrix multiplication, inversion, etc.
 *
 * Revision 1.3  1994/06/25  20:38:59  mjl
 * Added support for integer matrix data.  Substantially rewrote and improved
 * code in the process.  Extension to handle other types or higher
 * dimensionality arrays should now be straightforward.
 *
 * Revision 1.2  1994/06/24  20:38:23  mjl
 * Changed name of struct to tclMatrix to avoid conflicts with C++ Matrix
 * classes.
 *
 * Revision 1.1  1994/06/23  22:42:53  mjl
 * The Tcl Matrix class moved here, since it is useful independent of the
 * Tk driver.
 *
 * Revision 1.2  1994/06/16  21:55:54  mjl
 * Changed to new declaration syntax.  Now declaration must specify variable
 * that holds matrix operator name.  This allows matrix command to place a
 * trace on any unset of the variable, in which case it can clean up after
 * itself.  I.e. when a matrix is declared locally, it goes away
 * automatically when the proc exits (note to itcl users: since itcl does not
 * let you place traces on class data, you will need to either make it global
 * or create a destructor for it).
 *
 * Revision 1.1  1994/06/16  19:28:35  mjl
 * New Tcl matrix command.  Supplies a much-needed new capability to Tcl.
 * Arrays are stored as binary, column-dominant, and contiguous, so that
 * interaction with scientific code API's as well as Tcl is trivial.


tclMain.c:
 * Revision 1.3  1994/06/30  18:52:53  mjl
 * Minor change to eliminate a warning.
 *
 * Revision 1.2  1994/06/24  20:40:45  mjl
 * Created function to handle error condition.  Is handled by indirection
 * through a global pointer, so can be replaced.  This call has to bypass
 * the interpreter since it's important that the interp->result string is
 * not modified.
 *
 * Revision 1.1  1994/06/23  22:43:34  mjl
 * Handles nearly all the important setup for extended tclsh's.  Taken from
 * tclMain.c of Tcl 7.3, and modified minimally to support my needs.


tclAPI.c:
 * Revision 1.5  1994/07/19  22:33:05  mjl
 * Internal header file inclusion changed to /not/ use a search path so that
 * it will work better with makedepend.
 *
 * Revision 1.4  1994/06/30  18:52:09  mjl
 * Added API calls for: plfont, plfontld, plhist, pljoin, plmtex, plptex,
 * plschr, plssub, plsym, plvpor, plwid.
 *
 * Revision 1.3  1994/06/25  20:37:12  mjl
 * Added API calls for pladv, plbop, plbox, pleop, plstyl, plvsta, plwind.
 *
 * Revision 1.2  1994/06/24  20:38:21  mjl
 * Changed name of struct to tclMatrix to avoid conflicts with C++ Matrix
 * classes.
 *
 * Revision 1.1  1994/06/23  22:45:50  mjl
 * Contains functions, a command table, a hash table, and other tools to
 * support calling PLplot functions via Tcl commands.  Support for calling
 * PLplot directly (from pltcl) or by widget commands (from plframe) is
 * provided.


tclMatrix.h:
 * Revision 1.7  1994/06/30  18:38:49  mjl
 * Changed typedef for Mat_int back to an int, and eliminated M?D macros in
 * favor of directly addressing the array.
 *
 * Revision 1.6  1994/06/30  05:45:21  furnish
 * Cobbled together an extension facility which allows a user to define
 * their own subcommands for tclMatricies.  The idea is that you can use
 * this to implement your own matrix processing commands entirely on the
 * compiled side.  fft's, matrix multiplication, inversion, etc.
 *
 * Revision 1.5  1994/06/26  05:16:15  furnish
 * Implemented C++ wrapper class for tclMatrix, enabling easy use of a
 * tclMatrix from compiled extension commands.  Needs to have sibling
 * classes created by someone who cares.
 *
 * Revision 1.4  1994/06/25  20:35:49  mjl
 * Changed typedef for Mat_int to long.  Maybe I should have a Mat_long
 * instead?  Added put/get function handlers to matrix struct (determined
 * when created, dependent on type).
 *
 * Revision 1.3  1994/06/24  20:37:55  mjl
 * Changed name of struct to tclMatrix to avoid conflicts with C++ Matrix
 * classes.  Put in ifdef-ed extern "C" linkage statements for C++.
 *
 * Revision 1.2  1994/06/16  21:57:11  mjl
 * Added matrix operator name to command data struct.
 *
 * Revision 1.1  1994/06/16  19:49:05  mjl
 * Header file for new Tcl matrix command.


pltcl.h:
 * Revision 1.3  1994/07/19  22:34:23  mjl
 * Internal header file inclusion changed to /not/ use a search path so that
 * it will work better with makedepend.
 *
 * Revision 1.2  1994/06/30  18:37:49  mjl
 * Moved function prototypes for generic Tcl support calls into this file.
 *
 * Revision 1.1  1994/06/23  22:41:36  mjl
 * Holds function prototypes and other declarations dealing with Tcl API.


-----------------------------------------------------------------------------
Example programs
-----------------------------------------------------------------------------

All C example programs: made another pass to eliminate warnings when using
gcc -Wall.  Lots of cleaning up: got rid of includes of math.h or string.h
(now included by plplot.h), eliminated redundant casts, put in more
uniform comments, and other minor changes.

All Tcl example programs are new.

x01.tcl through x07.tcl: (new)
# Tcl demo programs, which fully reproduce their x??c counterpart.

x08c.tcl and above are just templates for now.


demos.tcl: (new)
# Revision 1.3  1994/06/30  18:47:34  mjl
# Now sources all the tcl demo files.
#
# Revision 1.2  1994/06/25  20:33:54  mjl
# Moved stuff corresponding to first demo into separate file.
#
# Revision 1.1  1994/06/23  22:39:30  mjl
# New demo file for "pltcl" interpreter.  Needs fleshing out.



xtk02.c:
 * Revision 1.7  1994/07/01  20:44:35  mjl
 * Cruft elimination.
 *
 * Revision 1.6  1994/06/30  05:46:21  furnish
 * Another plot command in tk02 which invokes a private tclMatrix
 * extension for demo purposes.  xtk02.c adds a new tclMatrix subcommand
 * "stuff", and tk02 exercises it.  Dumb, but shows how it all works.
 *
 * Revision 1.5  1994/06/23  22:40:29  mjl
 * Fix to get prototype of pltkMain() correct, and some cleaning up.
 *
 * Revision 1.4  1994/06/16  19:30:25  mjl
 * Changes to use pltkMain() for creating extended wish.  Should be more
 * portable and robust than old method.


xtk01.c:
 * Revision 1.6  1994/06/23  22:40:06  mjl
 * Fix to get prototype of pltkMain() correct.
 *
 * Revision 1.5  1994/06/16  19:30:14  mjl
 * Changes to use pltkMain() for creating extended wish.  Should be more
 * portable and robust than old method.


tk03: (new)
# Revision 1.3  1994/07/27  17:45:09  furnish
# Elucidate bug in plframe destruction mechanism.
#
# Revision 1.2  1994/07/24  07:42:59  mjl
# Eliminated "destroy ." in favor of "exit".
#
# Revision 1.1  1994/07/01  20:44:23  mjl
# Added to illustrate multiple toplevels containing plframes.


tk02:
# Revision 1.9  1994/07/24  07:42:58  mjl
# Eliminated "destroy ." in favor of "exit".
#
# Revision 1.8  1994/07/01  20:44:00  mjl
# Modified to use startup proc plstdwin when configuring main window.
#
# Revision 1.7  1994/06/30  05:46:20  furnish
# Another plot command in tk02 which invokes a private tclMatrix
# extension for demo purposes.  xtk02.c adds a new tclMatrix subcommand
# "stuff", and tk02 exercises it.  Dumb, but shows how it all works.
#
# Revision 1.6  1994/06/17  21:23:11  mjl
# Removed option database settings since they were the same as those set
# in the pldefaults proc.
#
# Revision 1.5  1994/06/16  21:56:32  mjl
# Changed to new matrix declaration syntax.  Locally declared matrices go
# away automatically when the proc exits.  It really works!
#
# Revision 1.4  1994/06/16  19:29:31  mjl
# Changes to use new plframe/matrix API for functions that require array
# arguments.
#
# Revision 1.3  1994/06/10  20:48:34  furnish
# Do a lot more from Tcl.  Still needs work, but waiting on the API
# mirroring to catch up.
#
# Revision 1.2  1994/06/09  20:29:22  mjl
# Changed to new improved megawidget instantiation method.


tk01:
# Revision 1.7  1994/07/24  07:42:57  mjl
# Eliminated "destroy ." in favor of "exit".
#
# Revision 1.6  1994/07/01  20:43:59  mjl
# Modified to use startup proc plstdwin when configuring main window.
#
# Revision 1.5  1994/06/17  21:23:09  mjl
# Removed option database settings since they were the same as those set
# in the pldefaults proc.
#
# Revision 1.4  1994/06/09  20:28:15  mjl
# Changed to new improved megawidget instantiation method.


x14c.c:
 * Revision 1.10  1994/08/10  05:28:50  mjl
 * Ensured that geometry strings are in writable memory as required, and
 * other minor tweaks to improve the demo.


x18c.c: (new)
 * Revision 1.5  1994/07/22  16:03:29  furnish
 * "Little Miss Muffet, sat on a tuffet, eating her curds and whey.
 * Along came a spider and sat down beside her, and frightened Miss
 * Muffet away."
 *
 * Revision 1.4  1994/07/21  10:12:10  mjl
 * Changed plpoin3 to use fast point draw (code=-1).
 *
 * Revision 1.3  1994/07/20  06:06:12  mjl
 * Minor changes to make it easier to play with the altitude/azimuth
 * settings.  Changed to the new API calls for the 3d functions.
 *
 * Revision 1.2  1994/07/19  22:14:05  furnish
 * Added new plots for showing hidden surface removal using pl3poly().
 *
 * Revision 1.1  1994/07/15  20:38:09  furnish
 * Example program to show off 3-d line and point plotting.


x19c.c: (new)
 * Revision 1.1  1994/07/29  20:14:45  mjl
 * Demo for generating world map backgrounds.
 * Contributed by Wesley Ebisuzaki.


-----------------------------------------------------------------------------
Drivers
-----------------------------------------------------------------------------

All device drivers: enabling macro renamed to PLD_<driver>, where <driver>
is xwin, ps, etc.  See plDevs.h for more detail.


xwin.c:
 * Revision 1.47  1994/07/27  22:18:01  mjl
 * Fixed bug in window cleanup and termination that was causing a core dump
 * for apps using multiple plframe widgets.
 *
 * Revision 1.46  1994/07/22  22:20:36  mjl
 * Fixed bug in WM hints, introduced during the last bug fix.  It was causing
 * the window to come up without user intervention and in a poor location for
 * tvtwm.  Now it should get BOTH the default and the user specified cases
 * right regardless of window manager (I hope).
 *
 * Revision 1.44  1994/07/18  20:28:46  mjl
 * Fixed a cast.
 *
 * Revision 1.43  1994/07/01  22:38:04  mjl
 * All display-dependent data broken off into a separate structure.  The X
 * driver now saves only one of these XwDisplay structs for each physical
 * X display.  These are then shared between all PLplot streams.  This
 * ensures that using multiple streams -> multiple X windows does not cause
 * abnormal termination due to running out of resources since most are now
 * shared (allocated colors, graphics contexts, etc).  The drawback is that
 * colors are no longer independent between windows, if created by a single
 * process (but this can also be an advantage).
 *
 * Revision 1.42  1994/06/17  21:21:11  mjl
 * Fixed background color for mono displays, should now come up white (much
 * easier to see).  Middle mouse button press now returns world coordinates
 * at cursor, but only correct for last plot on the page (submitted by
 * Mark Glover glover@zombi.res.utc.com).
 *
 * Revision 1.41  1994/06/09  20:05:58  mjl
 * Fixed Visual handling to support grayscale and mono displays.  Enabled
 * exporting of colormap hack flag for other files (plframe.c) that need it.
 *
 * Revision 1.40  1994/05/27  22:19:17  mjl
 * Window now placed properly when offsets (+x+y) are specified.  Thanks
 * to Mark S. Glover (glover@zombi.res.utc.com) for the fix.


tek.c:
 * Revision 1.31  1994/07/23  04:44:27  mjl
 * Added conditional compilation of atexit() code based on STDC_HEADERS.
 *
 * Revision 1.30  1994/07/22  22:21:28  mjl
 * Eliminated a gcc -Wall warning.
 *
 * Revision 1.28  1994/06/30  17:52:35  mjl
 * Made another pass to eliminate warnings when using gcc -Wall, especially
 * those created by changing a PLINT from a long to an int.
 *
 * Revision 1.27  1994/06/24  04:38:35  mjl
 * Greatly reworked the POSIX_TTY code that puts the terminal into cbreak
 * mode.  Now, initially both the original and modified terminal states are
 * saved.  When the terminal goes into graphics mode, it is also put into
 * cbreak mode.  This ensures that the program gets character-at-a-time
 * input, which is good for quitting <Q> PLplot or for paging in plrender.
 * When the terminal goes into text mode, the original terminal state
 * (canonical input, typically) is restored, which is good for reading user
 * input or command interpreters.  Just make sure you use plgra() and
 * pltext() for switching; if you switch the terminal locally it may get
 * confused until the next plgra() or pltext().
 *
 * Revision 1.26  1994/06/23  22:32:07  mjl
 * Now ensures that device is in graphics mode before issuing any graphics
 * instruction.


ps.c:
 * Revision 1.26  1994/07/12  19:14:41  mjl
 * Fix to prevent postscript interpreter from forgetting the current point
 * location after a color change.  I lost track of who contributed this.
 *
 * Revision 1.25  1994/06/30  17:52:25  mjl
 * Made another pass to eliminate warnings when using gcc -Wall, especially
 * those created by changing a PLINT from a long to an int.


hpgl.c:
 * Added new driver -- HP Laserjet III in HPGL emulation mode (lj_hpgl).
 * Produces fairly small output files (compared to the LJIIP compressed
 * rasters, MUCH smaller than the LJII full rasters).  Contributed by Conrad
 * Steenberg.


plplotX.h:
 * Revision 1.12  1994/07/28  07:42:58  mjl
 * Eliminated old CADDR_T_HACK code.
 *
 * Revision 1.11  1994/07/20  04:03:47  mjl
 * Eliminated include of plplot.h if it's already been included (this file
 * uses a search path since it may be included into user code).
 *
 * Revision 1.10  1994/07/12  19:18:19  mjl
 * Put CADDR_T_HACK code in proper location.
 *
 * Revision 1.9  1994/07/01  22:38:09  mjl
 * All display-dependent data broken off into a separate structure.  The X
 * driver now saves only one of these XwDisplay structs for each physical
 * X display.  These are then shared between all PLplot streams.  This
 * ensures that using multiple streams -> multiple X windows does not cause
 * abnormal termination due to running out of resources since most are now
 * shared (allocated colors, graphics contexts, etc).  The drawback is that
 * colors are no longer independent between windows, if created by a single
 * process (but this can also be an advantage).


drivers.h:
 * Revision 1.20  1994/07/25  06:04:58  mjl
 * Added prototype for new lj_hpgl driver.


-----------------------------------------------------------------------------
TK driver, plframe widget, and support tools
-----------------------------------------------------------------------------

tkshell.c:
 * Revision 1.23  1994/07/26  21:14:36  mjl
 * Improvements to the way PLplot looks for various files.  Now more
 * consistent and flexible.  In particular, environmentals can be set for
 * locations of each directory (for Tcl, binary, and library files).
 * Contributed by Mark Olesen.
 *
 * Revision 1.22  1994/07/25  06:44:27  mjl
 * Wrapped the include of unistd.h in a HAVE_UNISTD_H.
 *
 * Revision 1.21  1994/07/22  22:21:16  mjl
 * Eliminated a gcc -Wall warning.
 *
 * Revision 1.20  1994/07/19  22:31:50  mjl
 * All device drivers: enabling macro renamed to PLD_<driver>, where <driver>
 * is xwin, ps, etc.  See plDevs.h for more detail.  All internal header file
 * inclusion changed to /not/ use a search path so that it will work better
 * with makedepend.
 *
 * Revision 1.19  1994/06/30  18:44:18  mjl
 * Cleaning up, also moved Tk-driver-specific functions to tk.c
 *
 * Revision 1.18  1994/06/23  22:37:30  mjl
 * Minor cosmetic changes.
 *
 * Revision 1.17  1994/06/16  19:15:17  mjl
 * Moved the Tk initialization function for the tk driver into tk.c.  Changed
 * Pltk_Init to include by default some of the other Tcl commands used by
 * the PLplot/Tk driver.  Turned set_auto_path() into pls_auto_path() and
 * made it global.
 *
 * Revision 1.16  1994/06/09  20:27:35  mjl
 * Hacked out direct widget support; this was moved to plframe.c.


tkMain.c:
 * Revision 1.2  1994/06/30  18:45:05  mjl
 * Minor changes to pass gcc -Wall without warnings and other cleaning up.
 *
 * Revision 1.1  1994/06/23  22:39:10  mjl
 * Handles nearly all the important setup for extended wish's.  Taken from
 * tkMain.c of Tk 3.6, and modified minimally to support my needs.


tk.c:
 * Revision 1.44  1994/07/25  06:44:25  mjl
 * Wrapped the include of unistd.h in a HAVE_UNISTD_H.
 *
 * Revision 1.43  1994/07/23  04:45:42  mjl
 * Added code to start plserver with sigprocmask set so that a ^C doesn't
 * kill it (enabled if pls->server_nokill is set).  Contributed by Ian
 * Searle.
 *
 * Revision 1.42  1994/07/22  10:17:48  mjl
 * Bug squashed, introduced in last update.  On issuing a "Q", the cleanup
 * was getting hosed, leaving a spurious plserver window hanging around.
 * Works great now.
 *
 * Revision 1.41  1994/07/21  08:43:27  mjl
 * Eliminated some bogus Tcl-DP initializations when the Tk driver is
 * being used.
 *
 * Revision 1.40  1994/07/19  22:31:48  mjl
 * All device drivers: enabling macro renamed to PLD_<driver>, where <driver>
 * is xwin, ps, etc.  See plDevs.h for more detail.  All internal header file
 * inclusion changed to /not/ use a search path so that it will work better
 * with makedepend.
 *
 * Revision 1.39  1994/07/18  20:30:39  mjl
 * Fixed the eop driver function to flush output even if pause is turned off.
 *
 * Revision 1.38  1994/06/30  18:43:04  mjl
 * Cleaning up to remove gcc -Wall warnings, and other miscellanea.
 *
 * Revision 1.37  1994/06/16  19:13:10  mjl
 * Moved Tk initialization specific to the tk driver into this file.  Changed
 * plserver startup to include the -e <script> option, for running the
 * plserver_init proc at startup.
 *
 * Revision 1.36  1994/06/09  20:27:02  mjl
 * Changed direct widget and initialization commands to reflect changes to
 * plwidget.tcl and plframe.c.


tcpip.c:
 * Revision 1.12  1994/07/28  07:42:39  mjl
 * Fix for side-effect of defining caddr_t in plConfig.h.
 *
 * Revision 1.11  1994/07/26  21:08:47  mjl
 * Put in a user-suggested portability fix (lost track of who sent it).
 *
 * Revision 1.10  1994/07/25  06:04:21  mjl
 * Desuckified header inclusions, and added test for unistd.h before
 * including it.
 *
 * Revision 1.9  1994/07/22  22:20:59  mjl
 * Eliminated a gcc -Wall warning.
 *
 * Revision 1.8  1994/07/21  08:41:56  mjl
 * Introduced some casts to satisfy the IRIX compiler.
 *
 * Revision 1.7  1994/07/19  22:31:46  mjl
 * All device drivers: enabling macro renamed to PLD_<driver>, where <driver>
 * is xwin, ps, etc.  See plDevs.h for more detail.  All internal header file
 * inclusion changed to /not/ use a search path so that it will work better
 * with makedepend.
 *
 * Revision 1.6  1994/06/30  18:45:04  mjl
 * Minor changes to pass gcc -Wall without warnings and other cleaning up.


plwidget.tcl:
# Revision 1.25  1994/07/13  21:40:35  mjl
# Put in status message while waiting for plot to be saved.  Reassures the
# user that the program hasn't crashed, when saving very complicated plots.
#
# Revision 1.24  1994/06/09  20:24:57  mjl
# Massive reorganization and cleaning up.  Main result is that the plplot
# "megawidget" acts much more like a normal Tk widget.  Still not
# configurable; this will require extending it using itcl.  But now,
# creation and mapping is much more straightforward, both directly (from
# plserver or an extended wish) and from the plplot/tk driver.  You can do
# simply:
#
#     plxframe .plw
#     pack append . .plw {bottom fill expand}
#
# and you get a plframe "megawidget", complete with plot menu (with dump,
# zoom, etc) and status label.  Support widgets relevant for the plplot/tk
# driver do not come up unless invoked from the tk driver (by specifying
# a client to connect to).  The main drawback at this point with this method
# is that direct plotting commands in Tcl must be specified using the syntax
# (for the above example) ".plw.plwin cmd <command> <args>", whereas in
# itcl is simply ".plw <command> <args>".


pltools.tcl:
# Revision 1.13  1994/07/01  20:39:57  mjl
# Added proc plstdwin to handle "standard" initialization code.


plserver.tcl:
# Revision 1.18  1994/07/01  20:39:17  mjl
# Moved "standard" initialization code to proc plstdwin in pltools.tcl,
# so it can be used by the demos.
#
# Revision 1.17  1994/06/23  22:34:57  mjl
# Removed an unnecessary "update".
#
# Revision 1.16  1994/06/16  19:08:22  mjl
# exit_app proc simplified -- some of its previous tasks have been absorbed
# into the redefined exit proc.
#
# Revision 1.15  1994/06/09  20:16:28  mjl
# Moved the key_filter proc to plwidget.tcl, since it is better put there.
# Some cleaning up also.


plserver.h:
 * Revision 1.19  1994/07/19  22:31:45  mjl
 * All device drivers: enabling macro renamed to PLD_<driver>, where <driver>
 * is xwin, ps, etc.  See plDevs.h for more detail.  All internal header file
 * inclusion changed to /not/ use a search path so that it will work better
 * with makedepend.
 *
 * Revision 1.18  1994/06/30  18:47:06  mjl
 * Restructured, to make Tk driver more independent of plserver (tk.c no
 * longer includes this file).  Eventually it will be possible to link the
 * Tk driver with Tcl-DP only, and not X or Tk, and the function of the
 * header files must be well defined by then.
 *
 * Revision 1.17  1994/06/23  22:34:22  mjl
 * Now includes pltcl.h for all Tcl API stuff.
 *
 * Revision 1.16  1994/06/16  19:07:08  mjl
 * Include-guarded.  Now includes file tclMatrix.h, to pick up the new matrix
 * command support.  Prototype for plframe() moved here from plplot.h since
 * it shouldn't be necessary for the user to explicitly refer to it any more
 * (in lieu of using Pltk_Init()).


plserver.c:
 * Revision 1.28  1994/07/19  22:31:43  mjl
 * All device drivers: enabling macro renamed to PLD_<driver>, where <driver>
 * is xwin, ps, etc.  See plDevs.h for more detail.  All internal header file
 * inclusion changed to /not/ use a search path so that it will work better
 * with makedepend.
 *
 * Revision 1.27  1994/06/30  18:45:02  mjl
 * Minor changes to pass gcc -Wall without warnings and other cleaning up.
 *
 * Revision 1.26  1994/06/23  22:33:53  mjl
 * Fixed bug introduced in last update concerning exit handling for DP style
 * communication.
 *
 * Revision 1.25  1994/06/16  19:04:32  mjl
 * Massively restructured.  Is now just a front-end to the pltkMain()
 * function.  Structured along the preferred lines for extended wish'es.


plr.c:
 * Revision 1.17  1994/07/18  20:29:58  mjl
 * Fixed the escape function to pass ALL received escape commands.
 *
 * Revision 1.16  1994/06/30  18:43:02  mjl
 * Cleaning up to remove gcc -Wall warnings, and other miscellanea.


plframe.c:
 * Revision 1.39  1994/07/25  06:44:22  mjl
 * Wrapped the include of unistd.h in a HAVE_UNISTD_H.
 *
 * Revision 1.38  1994/07/19  22:31:41  mjl
 * All device drivers: enabling macro renamed to PLD_<driver>, where <driver>
 * is xwin, ps, etc.  See plDevs.h for more detail.  All internal header file
 * inclusion changed to /not/ use a search path so that it will work better
 * with makedepend.
 *
 * Revision 1.37  1994/07/01  22:38:48  mjl
 * Minor modification required by new X resource allocation scheme.
 *
 * Revision 1.36  1994/07/01  20:37:21  mjl
 * Force an "update" when widget is initially mapped, but before startup
 * procedure is invoked.  Ensures that "." has been mapped and that X is
 * in a sane state before continuing (otherwise new toplevels containing
 * plframes can cause a core dump).  Also some cruft elimination.
 *
 * Revision 1.35  1994/06/30  18:40:15  mjl
 * Cleaning up to remove gcc -Wall warnings, and other miscellanea.
 *
 * Revision 1.34  1994/06/23  22:32:47  mjl
 * Split off bulk of Tcl API in to separate file, where it can be used
 * more flexibly.
 *
 * Revision 1.33  1994/06/16  19:03:18  mjl
 * Changed "cmd plline" and "cmd plpoin" widget commands to use new Matrix
 * notation/capabilities/etc.
 *
 * Revision 1.32  1994/06/15  17:21:32  furnish
 * Fix cleanup so that killing a plframe doesn't core the app.
 *
 * Revision 1.31  1994/06/10  20:46:10  furnish
 * Mirror plpoin.  More of the API still needs doing.
 *
 * Revision 1.30  1994/06/09  20:15:30  mjl
 * Changed plplot direct widget commands ("<widget> cmd <command> <args>") to
 * begin with a "pl", e.g. scol<?> to plscol<?>, etc.  To make going between
 * the C and Tcl API's as natural as possible.  Added new direct widget
 * commands plenv, plcol, pllab, and plline.  These were formerly in
 * tkshell.c; having them here makes it trivial to associate independent
 * streams with different widgets without user intervention.  The call to
 * plinit() now done automatically when the widget is first mapped, and
 * the "<widget> cmd init" command no longer supported.  Some reorganization.


pldefaults.tcl:
# Revision 1.3  1994/06/17  21:22:15  mjl
# Removed check for color system before setting resources.  Eliminates some
# problems with the Tk/DP drivers on mono displays.


plcolor.tcl:
# Revision 1.4  1994/06/09  20:09:18  mjl
# Changed plplot direct widget commands to begin with a "pl", e.g. scol<?>
# to plscol<?>, etc.  To make going between the C and Tcl API's as natural
# as possible.


plclient.tcl:
# Revision 1.4  1994/06/09  20:07:54  mjl
# Eliminated references to a plw_init_proc, now obsolete.


PLXWin.tcl:
# Revision 1.1  1994/06/10  20:43:57  furnish
# New extended plframe itcl widget.


PLWin.tcl:
# Revision 1.5  1994/06/16  18:33:51  mjl
# Modified argument lists for plline and plpoin methods to use matrix names.
#
# Revision 1.4  1994/06/10  20:46:58  furnish
# Mirror plpoin.  More of the API still needs doing.
#
# Revision 1.3  1994/06/09  20:07:13  mjl
# Cleaned up and switched to plplot direct commands embedded in plframe
# widget (through "<widget> cmd <command> <args>" syntax).


plplotTK.h:
 * Revision 1.3  1994/07/19  22:34:22  mjl
 * Internal header file inclusion changed to /not/ use a search path so that
 * it will work better with makedepend.
 *
 * Revision 1.2  1994/06/30  18:36:37  mjl
 * Minor change to what header files are included.


-----------------------------------------------------------------------------
utilities
-----------------------------------------------------------------------------

pltcl.c is new: the source code for the "pltcl" Tcl-based PLplot
interpreter.

pltcl.c:
 * Revision 1.4  1994/07/19  22:33:16  mjl
 * Internal header file inclusion changed to /not/ use a search path so that
 * it will work better with makedepend.
 *
 * Revision 1.3  1994/06/30  18:55:50  mjl
 * Minor changes to eliminate gcc -Wall warnings.
 *
 * Revision 1.2  1994/06/24  20:41:35  mjl
 * Added error handler specific to pltcl.  Ensures output device is in text
 * mode before issuing error message.
 *
 * Revision 1.1  1994/06/23  22:51:28  mjl
 * A plotting interpreter that uses Tcl to drive PLplot primitives.  This can
 * be used with virtually any PLplot output driver.  The executable is an
 * extended tclsh that has been embellished with a (soon to be) large set
 * of Tcl commands for executing PLplot graphics calls.  The scripts are not
 * the same as those that plserver can execute, as the latter is object-based
 * and uses widget commands, whereas pltcl uses global commands to drive
 * PLplot.  The two style of commands are similar enough, however (differing
 * only by an introducer) that a text filter could be used to go between
 * them.


plrender.c:
 * Revision 1.40  1994/07/12  19:22:49  mjl
 * Small change to ensure that cmap0 palette "sticks" when plot is saved from
 * Tk driver.


-----------------------------------------------------------------------------
DOS drivers
-----------------------------------------------------------------------------

The djgpp driver has been upgraded to work with new configure mechanism.
The others still need to be updated.

Various bugs fixed.

-----------------------------------------------------------------------------
Amiga driver
-----------------------------------------------------------------------------

Didn't finish upgrading to new configure mechanism, so unfortunately is
currently unusable.  Will fix ASAP.



*****************************************************************************
PLPLOT 4.99g changes
May 27, 1994
*****************************************************************************

This is a MAJOR release.  Changes grouped by files affected.
The old Changes.log file has been moved to the doc directory for future
reference.

Maurice LeBrun	mjl@dino.ph.utexas.edu

-----------------------------------------------------------------------------
Documentation
-----------------------------------------------------------------------------

The document is in a MAJOR state of flux.  I take no responsibility for
any problems encountered with it, but you are free to take a look.

We have made substantial progress towards converting the (previously
LaTeX) document into LaTeXinfo.  This gives us the capability to have both
a high quality (yes, if you work at it hard enough) printed manual as well
as a hypertext-like online document, using info.  There are many info
readers around but the most famous is the one built into Emacs.  An info
document is now available and not half bad, but unfortunately mostly still
based on information as of the beta plplot4.0 series.  

The top level files: README, and ToDo have been brought up to date.

From all the questions sent my way, a PLplot FAQ has been created!!  Enjoy.

-----------------------------------------------------------------------------
Install scripts, makefile, etc.
-----------------------------------------------------------------------------

configure: changed so that now you can run it from the root directory.
Too many people thought it was GNU configure and were puzzled when it
didn't work.  So why not go further -- now it recognizes the GNU configure
--prefix option, for setting the location to install PLplot.  This is set
to override whatever you have set (if you have it set) in your
~/config/cf_plplot.m4, if you have one (whew).  Support for the Tcl-DP
extension added, and maybe more (can't remember).

Makefile:

A top-level makefile has been added.  It just does a cd to tmp, and then
recursively runs make on the specified target (not all targets supported).
Created so that PLplot can be installed just like GNU software (cd
plplot4p99g; configure; make; make install), in principle.


cf_basic.m4:

The DEF_xx macros moved here to avoid problems in the future.  This means
you must delete all DEF_xx macros in existing cf_plplot.m4 files, sorry.


cf_depend.m4:

Various changes to reflect consolidated drivers, source files, new
dependencies, etc.  Now pass the flags $(BIN_DIRFLAG), $(LIB_DIRFLAG), and
$(TCL_DIRFLAG), for those files with a need to know.  Added build of
"pltek" to default build list.


cf_plplot.m4 :

Removed DEF_xx flags since they sometimes caused problems with upgrades.
Added note about overriding INSTALL_DIR with configure prefix option,
also about meaning of the first few 'define's in the file.


makefile.m4 :

DEFAULT INSTALL DIRECTORY PROCEDURE CHANGED!!!!!
Now PLplot by default installs into:
	prefix-dir/
		bin/
		lib/
		include/
		doc/
		tcl/
It had to be done before it was too late.  Makefile overrides default
value of INSTALL_DIR if m4 macro PREFIX is defined.  Passes values for
TCL_DIRFLAG, BIN_DIRFLAG, LIB_DIRFLAG for files with a need to know.


mklinks :

New, used for bringing up and backing down PLplot versions, using
softlinks into a widely-accessed area such as /usr/local/bin,
/usr/local/lib, etc.  Read the internal notes to see why you might
want to do this.  Works great (based on the "installtk" script I wrote
that does something similar for Tcl/TK).


-----------------------------------------------------------------------------
Main source files
-----------------------------------------------------------------------------

All source files handling API: 
 * replaced call to plexit() on simple
 * (recoverable) errors with simply printing the error message (via
 * plabort()) and returning.  Should help avoid loss of computer time in some
 * critical circumstances (during a long batch run, for example).


pdfutils.c:
 * Revision 1.9  1994/04/08  12:29:00  mjl
 * Now always keeps track of bytes written or read, for use by drivers
 * that need that info.
 *
 * Revision 1.8  1994/03/23  07:26:56  mjl
 * Changed Alloc2dGrid to plAlloc2dGrid, Free2dGrid to plFree2dGrid.
 * Eliminated special malloc include handling.
 *
 * Revision 1.7  1994/01/15  17:24:59  mjl
 * All PDF functions changed to accept a pointer to a PDFstrm instead
 * of a file handle, to enable PDF operations to/from a memory buffer.
 * New PDF front-ends to fopen, fclose, getc, putc added.  pdf_bopen()
 * added for initialization of memory buffer.


plargs.c:
 * Revision 1.20  1994/05/16  21:29:39  mjl
 * Changes to plSetInternalOpt: the first argument is no longer required to
 * have a leading dash.
 *
 * Revision 1.19  1994/03/23  07:50:37  mjl
 * Added new plplot base options:
 *
 *  -hack		Set to enable some driver-specific hack
 *  -fbeg number	First family member number on output
 *  -finc number	Increment between family members
 *  -fflen length	Family member number minimum field width
 *
 * Revision 1.18  1994/02/01  22:47:49  mjl
 * Added -user <user> flag, for specifying user when invoking plserver
 * remotely (via remsh).
 *
 * Revision 1.17  1994/01/25  06:38:26  mjl
 * -db option (double buffering) added, for use with any of the X-based
 * drivers.  This holds the window fixed while drawing only into the pixmap,
 * until the end of page is seen.  Then the contents of the pixmap are
 * blitted to the window.  This allows for an animation-type facility for
 * properly constructed sequences (e.g. fixed axes) of plots.  Note, however,
 * that this is no substitute for a /real/ animation capability since
 * the speed of playback is determined by how much data has to be read
 * and processed for each frame (thus can be somewhat variable).
 *
 * Revision 1.16  1994/01/15  17:28:22  mjl
 * Added new args: -server_name, -server_host, -server_port.  -server_name is
 * used with the TK driver to specify plserver's TK main window name, if
 * already running.  -server_host and -server_port are used for the DP
 * driver, for specifying the host to run it on, and the communications port
 * (if already running).


plbox.c:
 * Revision 1.12  1994/04/30  16:15:04  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.11  1994/04/08  12:29:28  mjl
 * Hack to prevent labels like "-0.0" on some systems, caused by roundoff.


plcont.c:
 * Revision 1.11  1994/03/23  07:56:35  mjl
 * Changed name of plcontf() to plfcont(), as part of the new 2d function
 * plotter API.  plcontf is now a macro for backward compatibility.


plcore.c:
 * Revision 1.31  1994/05/07  03:23:07  mjl
 * Eliminated some obsolete operations involving fgcolor and bgcolor.
 *
 * Revision 1.30  1994/04/30  16:15:06  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.29  1994/04/08  12:31:39  mjl
 * Removed driver interface handling of nopause (it was a bad idea).  Added
 * call to (*plsc->tidy) [if defined] in plP_tidy.  Added a function
 * plsMouseEH for setting the mouse event handler (contributed by Radey
 * Shouman).
 *
 * Revision 1.28  1994/03/23  08:02:48  mjl
 * Provided for handling more basic operations in the driver interface rather
 * than the drivers themselves (pls->nopause, resetting stream parameters
 * after a tidy, etc).  Added support for hardware fill -- if the device does
 * not support the operation, the function plfill_soft is used instead.
 * Pattern fill number set/get access functions added.
 *
 * Many debugging remnants from driver interface development removed.
 *
 * Many functions moved elsewhere (this file has gotten too large):
 *
 * 	plwarn plexit plcol0 plcol1 plrgb plrgb1 plscolbg plscol0 plgcol0
 * 	plscmap1 plscmap1f1 plscolor
 *
 * Revision 1.27  1994/01/25  06:23:26  mjl
 * Moved default setting of digits variables to the correct location.
 *
 * Revision 1.26  1994/01/18  06:01:38  mjl
 * Now set default number of digits in numeric labels for axis to be switched
 * to scientific notation.  Before this capability had to be enabled by the
 * user.  The number of digits defaults to x:4, y:4, z:3 (xy or xyz plots).
 *
 * Revision 1.25  1994/01/17  21:36:51  mjl
 * Added function c_plgcol0 for retrieving RGB color values from cmap0
 * entries.  User-contributed (I lost track of who sent it).


plctrl.c:
 * Revision 1.19  1994/05/24  19:56:47  mjl
 * Changed INSTALL_DIR to BIN_DIR for locating executables.
 *
 * Revision 1.18  1994/05/10  21:52:10  mjl
 * Split off cmap1 calculation into plcmap1_calc() to make it easier to just
 * change a single control point from the plframe widget.
 *
 * Revision 1.17  1994/05/07  03:23:46  mjl
 * Eliminated all references to fgcolor and bgcolor.  Operations involving
 * the latter changed to deal with cmap0[0].
 *
 * Revision 1.16  1994/04/30  16:15:09  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.15  1994/04/25  19:08:28  mjl
 * Lots of fixes/improvements to plscmap1l to support TK palette
 * manipulators.  New function plRGB_HLS added.
 *
 * Revision 1.14  1994/04/08  12:33:22  mjl
 * Changed exit handler behavior.  Now it is called /prior/ to the stream
 * cleanup, which is more useful.  Also it is passed the error message and
 * is expected to return (if it returns) an exit code.  Prototype is:
 * static int    (*exit_handler) (char *);
 *
 * Revision 1.13  1994/03/30  07:27:16  mjl
 * Put in better handling for roundoff-generated errors in color map
 * selection.
 *
 * Revision 1.12  1994/03/23  08:11:11  mjl
 * Many functions moved into this file (from plcore.c):
 *
 * 	plwarn plexit plcol0 plcol1 plrgb plrgb1 plscolbg plscol0 plgcol0
 * 	plscmap1 plscmap1f1 plscolor
 *
 * Significant changes made to operation of old routines that manipulate the
 * color map.  plscmap1l added to set color map 1 colors using a piece-wise
 * linear relationship between intensity [0,1] (cmap 1 index) and position in
 * HLS or RGB color space.  plscmap0n added to determine the number of colors
 * to use in cmap 0 (must be called before plinit, or cmap 0 allocation).
 * This helps free up unused colors that can be used in cmap 1.
 *
 * Color 0 (in cmap 0) now defaults to black.  This is done for consistency
 * with 16 color tek displays, where color 0 is the background.  You can
 * always change it back if you want the old way (in fact, you are encouraged
 * to not rely on the default color map now that there's a supported way of
 * changing it).
 *
 * plabort() added to be almost identical to plwarn(), except for message
 * content.  Now used before a return on most error conditions.


plfill.c:
 * Revision 1.13  1994/04/30  16:15:11  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.12  1994/03/23  08:12:54  mjl
 * Split into two routines, one as a front-end to the driver interface fill
 * routine, and the other as a target of the driver interface when the driver
 * doesn't support the desired fill capability.


plfont.c:
 * Revision 1.12  1994/05/24  19:56:56  mjl
 * Changed INSTALL_DIR to LIB_DIR for locating fonts.


plline.c:
 * Revision 1.12  1994/03/23  08:21:33  mjl
 * Fiddled endlessly with plP_plfclp() trying to correctly clip polygons
 * after a zoom (in TK driver).  Eventually realized it was resistant against
 * quick hacks and got out the big gun: Foley, VanDam, et al (2nd ed), p 930:
 * the Liang-Barsky Polygon Algorithm.  Unfortunately I don't have time to
 * implement this right now; how about a volunteer?
 *
 * Revision 1.11  1994/01/25  06:34:20  mjl
 * Dashed line generation desuckified!  Should now run much faster on some
 * architectures.  The previous loop used only conditionals, assignments, and
 * integer adds at the cost of a huge number of iterations (basically testing
 * each pixel).  The new method draws directly to the desired end of dash.
 * Contributed by Wesley Ebisuzaki.
 *
 * Revision 1.10  1994/01/17  19:27:15  mjl
 * Bug fix: changed declarations of xclp[] and yclp[] from static to local
 * variables in plP_pllclp() and plP_plfclp(). plP_pllclp can call itself
 * consequently it needs local variables. Fixed problem with dash line and
 * orientation=1.  (Submitted by Wesley Ebisuzaki)


plot3d.c:
 * Revision 1.11  1994/05/13  22:56:35  mjl
 * Fixed an old bug -- it was innocuous in the company of the allocation bugs
 * fixed in the last update, which is why it wasn't discovered before now.
 * Now plots correctly as well as frees all memory allocated.
 *
 * Revision 1.10  1994/04/08  12:34:21  mjl
 * Fixed some cases of allocating memory and never freeing it.  Also changed
 * some previously fatal errors into recoverable ones.
 *
 * Revision 1.9  1994/03/23  08:22:00  mjl
 * Cruft elimination.


plsdef.c:
 * Revision 1.9  1994/03/23  08:24:33  mjl
 * Added support for hardware fill patterns (negative).


plshade.c:
 * Revision 1.8  1994/04/30  16:15:12  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.7  1994/03/23  08:29:58  mjl
 * Functions from plctest.c moved to this file for clarity and simplicity.
 * Main shade function now accepts a function evaluator and data much like
 * the contour functions.  Front-ends exist (plshade1(), plshade2()) to call
 * it in a simpler fashion, using predefined memory organizations for the
 * array.  Also, main shade function now accepts two arguments for handling
 * color of the shaded region -- the color map (0 or 1) and the index
 * (a float; >1 and integral for cmap0, in range [0,1] for cmap1).
 *
 * Revision 1.6  1993/12/09  20:36:52  mjl
 * Fixed some function prototypes.


plstream.c:
 * Revision 1.15  1994/05/10  21:52:45  mjl
 * Put in a slight optimization in cmap1 color interpolation.
 *
 * Revision 1.14  1994/04/30  16:15:13  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.13  1994/03/23  08:32:34  mjl
 * Moved color and color map handling functions into plctrl.c.
 * Changed file open routine to support new options for sequencing family
 * member files.
 *
 * Revision 1.12  1994/01/15  17:28:59  mjl
 * Added include of pdf.h.

-----------------------------------------------------------------------------
Fortran interface
-----------------------------------------------------------------------------

sccont.c:
 * Revision 1.3  1994/03/23  08:38:37  mjl
 * Name change for contour plotter base routine; lots of new plfshade
 * front-end functions added.


scstubs.c:
 * Revision 1.18  1994/03/23  08:39:10  mjl
 * Fixed some stubs to the cmap 1 handlers.

sfstubs.fm4:
! Revision 1.2  1994/04/08  12:27:25  mjl
! Added missing variable declarations.
!
! Revision 1.1  1994/03/30  07:29:40  mjl
! Moved fortran interface files up one level -- no longer separate single
! and double precision files.  Implemented m4 expansion of REAL into either
! real*4 or real*8 depending on configure settings, for portable builds
! of either the single or double precision library without copying files.
! Files with .fm4 suffix must be run through m4 to become normal fortran
! files.

-----------------------------------------------------------------------------
Example programs
-----------------------------------------------------------------------------

All C example programs: 
 * special handling for malloc re: header
 * files eliminated, include of stdio.h and stdlib.h eliminated (now done
 * by plplot.h), include of "plplot.h" changed to <plplot.h> to enable
 * simpler builds by the general user, some cleaning up also.


x14c.c:
 * Revision 1.8  1994/05/14  05:43:56  mjl
 * Now uses the DP driver and finally works the way I always wanted it to.


x16c.c:
 * Revision 1.3  1994/04/25  19:02:55  mjl
 * Increased the number of shade regions to make it a bit more interesting
 * when playing with the palette.
 *
 * Revision 1.2  1994/04/08  12:08:21  mjl
 * Cleaned up some, switched to more interesting test function.
 *
 * Revision 1.1  1994/03/30  07:22:55  mjl
 * Added to test specifically color fill capability of plshade, with optional
 * coordinate mapping.


x17c.c:
 * Revision 1.1  1994/04/08  12:08:54  mjl
 * Preliminary stab at a strip chart demo (doesn't work yet).

For use with TK:

xtk01c.c: 
 * new, demo of direct widget plotting

xtk02c.c: 
 * new, demo of direct widget plotting using [incr tcl]


All Fortran example programs changed to use a "!" as a comment character.
This works better with Lucid emacs font-locking (presumably hilite mode
in Emacs 19 too) in that it is a real comment introducer.  And most
Fortran compilers for 10 years have supported it.  For the truly backward
compiler that may still exist out there, I wrote the utils/fixfort awk
script to strip out all bang comments, so use that if you must.

x16f.f:
 new, Demonstration of plshade plotting      


-----------------------------------------------------------------------------
Font support
-----------------------------------------------------------------------------

stndfont.c:
xtndfont.c:
 * Revision 1.7  1994/03/23  06:56:24  mjl
 * Eliminated special handling for malloc includes, and finally tossed the
 * old BINARY_WRITE etc macros.  This IS ANSI C, you know.
 *
 * Revision 1.6  1994/01/15  17:22:18  mjl
 * Changed to new PDF function syntax.


-----------------------------------------------------------------------------
Include files
-----------------------------------------------------------------------------

drivers.h:
 * Revision 1.18  1994/05/25  21:58:25  mjl
 * Function prototypes for Win3 driver, contributed by Paul Casteels.
 *
 * Revision 1.17  1994/05/25  09:36:57  mjl
 * All VGA driver function names now end with "_vga", a nice simplification.
 * Since all are compiler-dependent and mutually exclusive, this should pose
 * no problem.  Also HP pen plotter driver were consolidated.  Both
 * contributions by Mark Olesen (olesen@weber.me.queensu.ca).
 *
 * Revision 1.16  1994/04/08  12:09:37  mjl
 * Added prototypes for new ljiip driver.
 *
 * Revision 1.15  1994/03/23  06:57:46  mjl
 * Changed function names in prototypes for xterm, mskermit, and added
 * prototypes for versaterm and vlt drivers (minor tek devices).
 *
 * Revision 1.14  1994/01/15  17:32:14  mjl
 * Added include of pdf.h.
 *
 * Revision 1.13  1993/12/21  10:34:40  mjl
 * Added prototype for new dp driver initialization function.


pdf.h:
 * Revision 1.9  1994/04/08  12:10:08  mjl
 * Moved unsigned type defines to this header file.
 *
 * Revision 1.8  1994/03/23  06:58:11  mjl
 * Minor change to file wrapper to make consistent with rest of package.
 *
 * Revision 1.7  1994/02/07  23:02:38  mjl
 * PLiodev struct defined.
 *
 * Revision 1.6  1994/01/15  17:33:16  mjl
 * Added typedef of PDFstrm and wrapped function prototypes in a macro so
 * the header can be read without problems by K&R compilers (cc).


plcore.h:
 * Revision 1.20  1994/05/25  21:56:46  mjl
 * Dispatch table entries for Win3 driver, contributed by Paul Casteels.
 *
 * Revision 1.19  1994/05/25  09:36:58  mjl
 * All VGA driver function names now end with "_vga", a nice simplification.
 * Since all are compiler-dependent and mutually exclusive, this should pose
 * no problem.  Also HP pen plotter driver were consolidated.  Both
 * contributions by Mark Olesen (olesen@weber.me.queensu.ca).
 *
 * Revision 1.18  1994/04/08  12:10:37  mjl
 * Added dispatch table entries for new ljiip driver.
 *
 * Revision 1.17  1994/03/23  06:59:00  mjl
 * Name changes for xterm & mskermit driver functions, addition of versaterm
 * and vlt driver functions.
 *
 * Revision 1.16  1993/12/21  10:35:07  mjl
 * Added entry for new Tcl-DP driver.


plevent.h:
 * Revision 1.1  1993/01/23  05:36:01  mjl
 * This file added for inclusion by all user-defined event handlers to be
 * used with plplot.  It contains constant definitions used to transmit
 * info on the event that occurred (e.g. keystroke definitions).


plplot.h:
 * Revision 1.61  1994/05/14  05:45:17  mjl
 * Added a new parse flage -- PL_PARSE_NODASH -- for allowing options
 * that don't begin with a dash.  Used for plSetInternalOpt, where
 * now the user can either include the dash or not.
 *
 * Revision 1.60  1994/05/10  21:50:26  mjl
 * Changed name of position field in PLControlPt typedef.
 *
 * Revision 1.59  1994/04/25  19:04:51  mjl
 * Added typedef for PLControlPt, used in specifying cmap1.  Added function
 * prototypes for plHLS_RGB (new) and plRGB_HLS (now global), for converting
 * between HLS and RGB color specifications.
 *
 * Revision 1.58  1994/04/18  20:02:59  furnish
 * Autodetect inclusion of tk.h.
 *
 * Revision 1.57  1994/04/18  19:23:25  furnish
 * Added new function Pltk_Init to allow users to easily construct PLPLOT
 * enhanced application specific extended wishen.  Works great, needs advert.
 *
 * Revision 1.56  1994/04/08  12:12:27  mjl
 * Moved PLESC tags to this file to make them more accessible to users.
 * Added PLESC_EH tag for flushing the event queue only.  Added PLMouse
 * event struct typedef.  Changed prototype for plsexit().
 *
 * Revision 1.55  1994/03/23  07:03:36  mjl
 * plplot.h now includes stdio.h and stdlib.h !  This change afforded a
 * significant simplification of the header file structure, and should
 * rarely be an imposition (most files require these anyway).  Many new
 * function prototypes added, such as the color and colormap setting
 * functions for dealing with cmap 1, and plshade and its siblings.
 *
 * Revision 1.54  1994/03/22  23:18:01  furnish
 * Include a prototype for plFrameCmd if using Tk.
 *
 * Revision 1.53  1994/01/17  21:34:21  mjl
 * Added function prototype for c_plgcol0().
 *
 * Revision 1.52  1994/01/15  17:33:42  mjl
 * Bumped version number, defined prototype wrapper macro.


plplotP.h:
 * Revision 1.20  1994/05/20  22:25:14  mjl
 * Switched order of inclusion of plplot.h with system-specific defines to
 * ensure that all sick hacks are made before too much damage occurs
 * (specifically to fix a problem on the Cray, caddr_t again, sigh).
 *
 * Revision 1.19  1994/05/10  21:51:04  mjl
 * Added prototype for new function plcmap1_calc().
 *
 * Revision 1.18  1994/04/08  12:13:14  mjl
 * Removed PLESC tag defs (now in plplot.h) and unsigned var defs (now in
 * pdf.h).
 *
 * Revision 1.17  1994/03/23  07:05:51  mjl
 * Cruft elimination, including stuff that was for dealing with non-ANSI
 * or marginally ANSI compliant compilers (special treatment for malloc
 * includes, etc).  New function prototypes, and new defines for PLSTATE
 * settings governing changes to cmap 1 and/or the color palette.
 *
 * Revision 1.16  1994/01/15  17:34:27  mjl
 * Minor documentation addition.


plplotTK.h:
 * Revision 1.1  1994/04/08  12:21:18  mjl
 * Added to allow access to TK driver internals by determined users.


plplotX.h:
 * Revision 1.7  1994/05/23  22:09:24  mjl
 * Eliminated the "pixels" var as it is no longer being used.
 *
 * Revision 1.6  1994/05/16  21:26:53  mjl
 * Added ncol0 for storing number of colors allocated in cmap0.
 *
 * Revision 1.5  1994/05/07  03:20:40  mjl
 * Added entry for: XVisualInfo *vi to XwDev struct, and prototype for new
 * global function PLX_save_colormap.
 *
 * Revision 1.4  1994/04/30  16:16:32  mjl
 * Eliminated unused variables xold, yold, from XwDev definition.
 *
 * Revision 1.3  1994/04/08  12:15:16  mjl
 * Added CADDR_T_HACK -- define this and the typedef of caddr_t will be
 * made here for braindead systems.  Added prototype for user specified
 * X event handler (MasterEH).  Include of plstream.h now uses the
 * search path.
 *
 * Revision 1.2  1994/03/23  07:06:22  mjl
 * Properly wrapped and commented.


plserver.h:
 * Revision 1.15  1994/04/08  11:53:59  mjl
 * Split off some stuff into the new file plplotTK.h, and made some function
 * name changes to help keep the namespace consistent.
 *
 * Revision 1.14  1994/03/23  06:54:14  mjl
 * Include of "plplotio.h" (no longer existant) eliminated.
 *
 * Revision 1.13  1994/03/22  23:17:35  furnish
 * Avoid collision with user code when he wants to make a custom wish
 * combined with PLPLOT.
 *
 * Revision 1.12  1994/02/07  22:57:14  mjl
 * Fixed up prototypes for pl_PacketReceive and pl_PacketSend.
 *
 * Revision 1.11  1994/01/15  17:40:04  mjl
 * Changed PLRDev definition to use pointer to PDFstrm instead of file
 * handle.  Added prototypes for new socket i/o functions.


plstream.h:
 * Revision 1.28  1994/05/07  03:22:08  mjl
 * Eliminated bgcolor, fgcolor, and bgcolorset.  Now fgcolor is a figment of
 * the X driver's imagination :-).  bgcolor is identically the same as the
 * 0th entry of cmap0.  About time I introduced some sanity to these.
 *
 * Revision 1.27  1994/04/25  19:05:33  mjl
 * Additional support for cmap1 palette.
 *
 * Revision 1.26  1994/04/08  12:20:49  mjl
 * Now includes <plplot.h> in case it hasn't been included yet.  File offset
 * for metafile removed from state structure (now local to driver).  Added:
 * * MouseEH		void*	Mouse event handler
 * * MouseEH_data	void*	Pointer to client data to pass
 * * tidy          	void*   pointer to cleanup routine
 * * tidy_data     	void*   pointer to client data to pass
 * ("tidy" is a user customization tidy routine, to be called before
 * closing a stream to do any program specific cleanup.)
 *
 * Revision 1.25  1994/03/23  07:10:51  mjl
 * Added documentation for all variables not described yet.  Changed some
 * variables used in color map selection.  Added variables:
 *
 *  dev_minor	Minor device id (for variations on one type)
 *  dev_fill0	Set if driver can do solid area fills
 *  dev_fill1	Set if driver can do pattern area fills
 *  finc		Number to increment between member files
 *  fflen		Minimum field length to use in member file number
 *
 * Revision 1.24  1994/02/01  22:46:55  mjl
 * Added pls->user (char *).
 *
 * Revision 1.23  1994/01/25  06:22:17  mjl
 * Added pls->db variable.
 *
 * Revision 1.22  1994/01/15  17:35:09  mjl
 * Added new variables for use in Tcl/TK/DP driver: server_name, server_host,
 * server_port.
 *
 * Revision 1.21  1993/12/21  10:35:46  mjl
 * Added flag to be set by driver to indicate whether TK or DP style
 * communication is being used.


plstubs.h:
 * Revision 1.21  1994/03/23  07:11:49  mjl
 * Added stub name definitions for cmap1 selectors and plshade front-ends.
 *
 * Revision 1.20  1993/12/08  06:21:19  mjl
 * Fix for dos386/djgpp; added definition for plspause (should now work from
 * fortran).


-----------------------------------------------------------------------------
Drivers
-----------------------------------------------------------------------------

All drivers: 
 * cleaned up by eliminating extraneous includes (stdio.h and
 * stdlib.h now included automatically by plplotP.h), extraneous clears
 * of pls->fileset, pls->page, and pls->OutFile = NULL (now handled in
 * driver interface or driver initialization as appropriate).  Special
 * handling for malloc includes eliminated (no longer needed) and malloc
 * prototypes fixed as necessary.


All VGA drivers:
 * Revision 1.4  1994/05/25  09:36:54  mjl
 * All VGA driver function names now end with "_vga", a nice simplification.
 * Since all are compiler-dependent and mutually exclusive, this should pose
 * no problem.  Also HP pen plotter driver were consolidated.  Both
 * contributions by Mark Olesen (olesen@weber.me.queensu.ca).


plbuf.c:
 * Revision 1.18  1994/03/23  06:39:20  mjl
 * Added support for: color map 1 color selection, color map 0 or color map 1
 * state change (palette change), polygon fills.
 *
 * Revision 1.17  1994/01/15  17:19:13  mjl
 * Eliminated include of pdf.h (not needed).


hpgl.c:
 * Revision 1.2  1994/05/26  19:21:45  mjl
 * Minor changes to bring up to spec with the other drivers.
 *
 * Revision 1.1  1994/05/25  09:34:14  mjl
 * Consolidated HP pen plotter driver, contributed by Mark Olesen
 * (olesen@weber.me.queensu.ca).


ljii.c:
 * Revision 1.17  1994/04/30  16:14:43  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.16  1994/04/08  11:34:38  mjl
 * Fix for DOS machines running DJGPP.


ljiip.c:
 * Revision 1.3  1994/04/30  16:14:45  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.2  1994/04/09  03:10:43  furnish
 * Teeny typo correction to remove duplicate symbols which caused HP to
 * be unable to produce shared lib.
 *
 * Revision 1.1  1994/04/08  11:46:44  mjl
 * New LaserJet IIp driver by Wesley Ebisuzaki, based on old ljii driver.
 * Has compression and other optimizations.


plmeta.c:
 * Revision 1.24  1994/04/08  11:38:11  mjl
 * Now allocate a PLmDev in order to keep file offset information local
 * to the driver where it belongs.  No longer keep track of bytes written
 * since the PDF output routines do that automatically.
 *
 * Revision 1.23  1994/03/23  06:39:22  mjl
 * Added support for: color map 1 color selection, color map 0 or color map 1
 * state change (palette change), polygon fills.
 *
 * Revision 1.22  1994/01/15  17:21:58  mjl
 * Changed to new PDF function syntax.


ps.c:
 * Revision 1.24  1994/05/07  03:00:04  mjl
 * Changed all occurances of bgcolor to cmap0[0].
 *
 * Revision 1.23  1994/04/30  16:14:46  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.22  1994/03/23  06:44:26  mjl
 * Added support for: color map 1 color selection, color map 0 or color map 1
 * state change (palette change), polygon fills.  Changes to generated
 * postscript code: now leaner and more robust, with less redundant
 * instructions.  Is suitable for backward paging using ghostview!
 *
 * Revision 1.21  1994/02/07  22:52:11  mjl
 * Changed the default pen width to 3 so that the default output actually
 * looks good.



tek.c:
 * Revision 1.25  1994/05/26  19:22:04  mjl
 * Supplied some missing variable initializations.
 *
 * Revision 1.24  1994/05/14  08:30:41  mjl
 * Changed to correctly set background color.  Added initialization hack to
 * improve color fill behavior using the vlt driver.
 *
 * Revision 1.23  1994/04/30  16:14:48  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.22  1994/04/08  11:36:01  mjl
 * Put nopause support back into the drivers where it is better off.
 * I don't know WHAT I was thinking.
 *
 * Revision 1.21  1994/03/23  06:50:49  mjl
 * Added new drivers: Versaterm (Mac), and VLT (Amiga).  Tek4107 driver
 * improved to actually work on a real tek 4107 (contributed by Paul
 * Kirschner), and the driver keyword changed to "tek4107t" or "tek4107f"
 * (was "t4107t" or "t4107f").  Introduced idea of minor devices -- each
 * variation on the tektronix instruction set is a new minor device.
 *
 * Added support for: color map 1 color selection, color map 0 or color map 1
 * state change (palette change), polygon fills, both solid and pattern (use
 * negative fill pattern number to get hardware pattern).  Color map now set
 * FROM PLPLOT!!  May require some additional effort to work for all minor
 * devices.
 *
 * Revision 1.20  1993/12/15  08:53:23  mjl
 * Fixed mskermit driver initialization.


xwin.c:
 * Revision 1.39  1994/05/23  22:08:00  mjl
 * Moved code responsible for getting Visual back to where it belongs
 * (it was misplaced last update, causing core dumps on some systems).
 * Assignment of pixel values in cmap1 now staggered, in order to avoid
 * a strange occurance when drawing rubber-banded boxes using xor'ed GC's
 * (e.g. while zooming in plframe widget).
 *
 * Revision 1.38  1994/05/16  21:26:29  mjl
 * The default has been reset to use the default colormap.  The constant
 * ccmap at the head of xwin.c must be set to 1 to get a custom colormap.
 * This should really be a command line switch, except now I'm having no
 * problem with using the default colormap under HPUX.  Go figure.
 *
 * Revision 1.37  1994/05/10  21:44:22  mjl
 * Some cleaning up after previous development.
 *
 * Revision 1.36  1994/05/09  19:54:53  mjl
 * Some bug fixes for non-color displays.
 *
 * Revision 1.35  1994/05/07  03:03:32  mjl
 * Massively restructured initialization to handle custom color maps.
 * Switched to XCreateWindow instead of XCreateSimpleWindow for more power.
 * Initialization of custom color map fairly complex in order to lead to
 * a minimum of flickering -- low color map colors (used by window manager),
 * cmap0 colors, and preallocated colors (used by Tk) are preserved and
 * restored at the same pixel values to avoid undue flickering when switching
 * color maps.  Function PLX_save_colormap added to support the latter.  All
 * colormap state changes now done with XStoreColors which should be much
 * speedier than the old method of freeing and allocating new cells.
 *
 * Revision 1.34  1994/04/30  16:14:50  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.33  1994/04/25  18:45:03  mjl
 * Fixed background bug introduced last update.  Added support for
 * reallocation of cmap0 and cmap1 palettes.
 *
 * Revision 1.32  1994/04/08  11:43:40  mjl
 * Some improvements to color map 1 color allocation so that it will fail
 * less often (temporary, until custom color map support is added).  Master
 * event handler with user entry point added.  Escape function recognizes
 * the PLESC_EH command for handling pending events only, and a mouse handler
 * added (both contributed by Radey Shouman).
 *
 * Revision 1.31  1994/03/23  06:41:25  mjl
 * Added support for: color map 1 color selection, color map 0 or color map 1
 * state change (palette change), polygon fills.  Color map 1 allocator tries
 * to allocate as many colors as possible (minus a small number to be
 * friendly to TK) and reports the result.  Eventually this will be improved
 * to use a custom colormap, copying the colors used by the window manager
 * to reduce the flicker when changing focus.
 *
 * Revision 1.30  1994/01/25  06:18:34  mjl
 * Added double buffering capability.

-----------------------------------------------------------------------------
TK driver, plframe widget, and support tools
-----------------------------------------------------------------------------

plserver.c:
 * Revision 1.24  1994/05/07  03:10:33  mjl
 * Changed startup to ensure that initial RGB color map values get saved (a
 * hack to get around limitations in X11R5 and Tk).
 *
 * Revision 1.23  1994/04/08  11:51:12  mjl
 * Changed main init function name (for wish builders) from plTcl_AppInit to
 * pltk_Init, to make it more conventional.
 *
 * Revision 1.22  1994/03/22  23:17:34  furnish
 * Avoid collision with user code when he wants to make a custom wish
 * combined with PLPLOT.
 *
 * Revision 1.21  1994/01/17  21:32:14  mjl
 * Eliminated -mkidx flag as it is unnecessary.  Replace with the alias:
 * alias mktclidx	"echo 'auto_mkindex . *.tcl; destroy .' | wish"
 *
 * Revision 1.20  1994/01/15  17:38:44  mjl
 * Split off communications link initialization into a Tcl proc, for
 * flexibility.
 *
 * Revision 1.19  1993/12/22  21:26:32  mjl
 * Last commit was botched on this file.
 *
 * Revision 1.18  1993/12/21  10:21:06  mjl
 * Changed -client arg name to -client_name to be more transparent (stands
 * for client program main window name).  Substantially rewrote
 * initialization to be better suited for Tcl-DP or TK style communication.
 * Created client_cmd function for handling all messages to the client.
 *
 * Revision 1.17  1993/12/15  08:59:03  mjl
 * Changes to support Tcl-DP.  Also moved functions Tcl_AppInit() and
 * set_autopath() to tkshell.c so they could be used by the TK driver
 * initialization as well.
 *
 * Revision 1.16  1993/12/09  21:29:47  mjl
 * Fixed another bug generated in the reorganization dealing with cleanup.
 *
 * Revision 1.15  1993/12/09  20:25:57  mjl
 * Completely reorganized, using the source for wish (tkMain.c) as a starting
 * point.  Will now be able to track changes to Tcl/TK more easily, and can
 * use plserver exactly like wish (including interactive usage).  Fixed a bug
 * occasionally encountered when shutting down.


tk.c:
 * Revision 1.35  1994/05/14  05:43:13  mjl
 * Additional debug information.
 *
 * Revision 1.34  1994/05/07  03:13:37  mjl
 * Replaced bgcolor by cmap0[0].
 *
 * Revision 1.33  1994/04/30  16:15:00  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.32  1994/04/08  12:05:21  mjl
 * Mouse event handler added, also escape function support for the
 * PLESC_EXPOSE, PLESC_RESIZE, PLESC_REDRAW, PLESC_EH commands (contributed
 * by Radey Shouman).  Device-specific data typedef moved into plplotTK.h
 * to allow access by determined users.  nopause handling moved back into
 * here where it belongs.  Byte count no longer kept track of here in favor
 * of doing it in the PDF write routines.
 *
 * Revision 1.31  1994/03/23  06:53:36  mjl
 * Added support for: color map 1 color selection, color map 0 or color map 1
 * state change (palette change), polygon fills.
 *
 * Revision 1.30  1994/03/22  23:17:37  furnish
 * Avoid collision with user code when he wants to make a custom wish
 * combined with PLPLOT.
 *
 * Revision 1.29  1994/02/07  23:02:11  mjl
 * Changed to using pl_PacketSend for data transfer, which now requires no
 * communication between interpreters.  Communication parameters stored in
 * the dev->iodev structure.
 *
 * Revision 1.28  1994/02/01  22:46:23  mjl
 * Added support for starting remsh with -l <user> flag.
 *
 * Revision 1.27  1994/01/25  06:21:34  mjl
 * Removed code for default selection of background color based on display
 * type -- now handled entirely in the server.  Fixed default name for
 * container window to work when program name has a leading path
 * specification.
 *
 * Revision 1.26  1994/01/17  21:33:28  mjl
 * Robustified send commands for when interpreter name has embedded blanks
 * (as occurs when the same application is started several times, each
 * creating its own main window).
 *
 * Revision 1.25  1994/01/15  17:46:48  mjl
 * Converted to new PDF function call syntax.  Substantially changed server
 * startup code -- now can handle a variety of cases including starting
 * plserver on a remote node (via remsh) or plserver already existing and
 * only needing to be contacted.  Rewrote data channel code to use socket
 * when DP driver is used.
 *
 * Revision 1.24  1993/12/22  23:09:53  mjl
 * Changes so that TK driver no longer times out on slow network connections
 * (it's just rreeaaalllyyyy ssllooowwww).  Where timeouts are a problem,
 * the client must issue the command to the server without waiting for a
 * reply, and then sit in TK wait loop until some specified condition is
 * met (usually the server sets a client interpreter variable when done).
 *
 * Revision 1.23  1993/12/21  10:30:24  mjl
 * Changed to separate initialization routines for dp vs tk drivers.
 * Reworked server_cmd function to work well with both Tcl-DP and TK send;
 * also method for putting commands in the background is better thought out
 * (and works better).  When using Tcl-DP for communication, the TK main
 * window is NOT created now.  This is a bit tricky since certain commands
 * no longer work if you don't have a main window -- like "tkwait", "update",
 * and "after", and alternate methods must be used to get the same effects.
 *
 * Revision 1.22  1993/12/15  09:04:31  mjl
 * Added support for Tcl-DP style communication.  Many small tweaks to
 * driver-plserver interactions made.  server_cmdbg() added for sending
 * commands to the server in the background (infrequently used because it
 * does not intercept errors).


plframe.c:
 * Revision 1.29  1994/05/23  22:09:04  mjl
 * Fixed some minor omissions regarding the xorGC.
 *
 * Revision 1.28  1994/05/10  21:49:52  mjl
 * Added new, more efficient ways to set colors via plframe "cmd" -- now you
 * can change only a single cmap0 entry or cmap1 control point color instead
 * of the whole map.  Took out call to XSetWMColormapWindows except when it
 * is absolutely needed.
 *
 * Revision 1.27  1994/05/07  03:09:52  mjl
 * After initializing plplot, now installs the X window colormap as the top
 * level Tk color map.  This is necessary so that the color palette tools
 * display the same colors as the plot.
 *
 * Revision 1.26  1994/04/30  16:14:56  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.25  1994/04/25  18:53:39  mjl
 * Added the PLStream pointer to the widget structure, to allow faster access
 * to PLplot internals.  Added "cmd" widget commands "scmap0", "gcmap0",
 * "scmap1", "gcmap1" for setting/getting palette settings.
 *
 * Revision 1.24  1994/04/08  11:47:41  mjl
 * Fixed some casts.
 *
 * Revision 1.23  1994/02/07  22:55:21  mjl
 * Data read is now done by a file handler for both FIFO or socket reads.
 * This has much better performance than the old way since no communication
 * between interpreters is needed.  The end of page indicator is now lit by
 * detecting eop/bop in the data stream.  The old widget command to read
 * the data stream is gone.
 *
 * Revision 1.22  1994/02/01  22:49:37  mjl
 * Changes to handle only partially received socket packets due to a slow
 * network connection.  Right now it just polls; this will be improved soon.
 *
 * Revision 1.21  1994/01/15  17:37:51  mjl
 * Added compile-time mode to route FIFO i/o through a memory buffer.
 * Changed "openfifo" widget command to "openlink" with the first argument
 * to be either "fifo" or "socket".  Added ability to create and read
 * socket for data transfer.
 *
 * Revision 1.20  1993/12/21  10:19:01  mjl
 * Added some debugging output.
 *
 * Revision 1.19  1993/12/15  08:57:36  mjl
 * Eliminated all direct knowledge plframe widget has of client code.  Now
 * all interactions to the client code are handled by the wrapper procs only.
 * Previously the plframe widget notified the client code when it was
 * destroyed, but this is not only bad at times but is also not necessary
 * (the same thing can be done in the wrapper procs through event bindings).


plr.c:
 * Revision 1.15  1994/05/14  05:41:33  mjl
 * Added a bit more debugging information.
 *
 * Revision 1.14  1994/04/30  16:14:58  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.13  1994/04/08  11:49:30  mjl
 * No longer keep track of byte count, letting the PDF read routines do it
 * for us.  Now recognizes and acts upon the PLESC_EXPOSE and PLESC_REDRAW
 * escape commands.
 *
 * Revision 1.12  1994/03/23  06:52:34  mjl
 * Added support for: color map 1 color selection, color map 0 or color map 1
 * state change (palette change), polygon fills.
 *
 * Revision 1.11  1994/02/07  22:56:18  mjl
 * Fixed error messages to use new iodev data structure.
 *
 * Revision 1.10  1994/02/01  22:43:47  mjl
 * Slight change to error handling for unrecognized commands.
 *
 * Revision 1.9  1994/01/15  17:38:12  mjl
 * Changed to new PDF function call syntax.


tcpip.c:
 * Revision 1.5  1994/05/14  05:42:52  mjl
 * Fixed the call to pl_UnRead the header -- a bogus argument was causing
 * spurious packet transmission failures.
 *
 * Revision 1.4  1994/04/08  12:00:05  mjl
 * Function name changes to reduce namespace pollution.  Robustness improved
 * in packet reader (changes stolen from Tcl-DP3.1 update).
 *
 * Revision 1.3  1994/02/07  23:00:43  mjl
 * Simplified and genericized pl_PacketReceive and pl_PacketSend functions so
 * that they work with FIFO's as well as sockets: data stream is now fully
 * packetized.  Functions require a PLiodev struct to be passed in,
 * containing lots of useful information about the connection.
 *
 * Revision 1.2  1994/02/01  22:44:35  mjl
 * Changes to support distributed operation between machines with different
 * int/long sizes.
 *
 * Revision 1.1  1994/01/15  17:50:09  mjl
 * Added to hold primarily socket related code.  The latter were taken from
 * the Tcl-DP distribution and modified to use binary i/o to/from the memory
 * buffer pointed to by pdfs->buffer (pdfs a PDFstrm *).


tkshell.c:
 * Revision 1.15  1994/05/24  19:46:35  mjl
 * Now autoloads the directory TCL_DIR for PLplot Tcl scripts.
 *
 * Revision 1.14  1994/05/09  18:00:05  furnish
 * Tcl extension code for mirroring the PLplot C API in Tcl.
 *
 * Revision 1.13  1994/05/07  03:14:57  mjl
 * Consolidated Tk code by moving Pltk_Init() to this file.  Startup routine
 * now sets auto_path and saves initial color map as well.
 *
 * Revision 1.12  1994/04/08  12:06:09  mjl
 * Function name changes to reduce namespace pollution.
 *
 * Revision 1.11  1994/03/23  06:54:40  mjl
 * Minor documentation change.
 *
 * Revision 1.10  1994/03/22  23:17:39  furnish
 * Avoid collision with user code when he wants to make a custom wish
 * combined with PLPLOT.
 *
 * Revision 1.9  1994/01/15  17:48:31  mjl
 * Added built-in Tcl commands: wait_until (for general use -- waits until
 * the specified condition evaluates to true) and host_id (Tcl-DP only).
 *
 * Revision 1.8  1993/12/21  10:32:04  mjl
 * Moved a part of the set_auto_path function back into plserver.c where
 * it belonged (adding directories to auto_path based on an input flag).
 *
 * Revision 1.7  1993/12/15  09:05:43  mjl
 * Added functions Tcl_AppInit() and set_autoload(), to be shared by both
 * the plserver and tk driver interpreter startup code.  Changes to
 * Tcl_AppInit() to support Tcl-DP style communication (taken from Tcl-DP
 * source distribution).


PLWin.tcl:
# Revision 1.2  1994/05/11  08:07:30  furnish
# Debugging.  Needs to do own toprow for some reason.
#
# Revision 1.1  1994/05/09  17:59:19  furnish
# The new [incr Tcl] interface to the PLplot Tcl extensions.


plclient.tcl:
# Revision 1.3  1994/02/07  22:52:38  mjl
# Removed references to plw_flash (no longer invoked from client side).
#
# Revision 1.2  1994/01/17  21:30:23  mjl
# Improved security for Tcl-DP communication by disabling any further
# connections after the initial client/server handshaking is finished.
#
# Revision 1.1  1994/01/15  17:36:03  mjl
# Added to hold client side initialization procs.


plcolor.tcl:
# Revision 1.3  1994/05/10  22:44:57  mjl
# Changed the way cmap1 position sliders work.  Still a monotonic
# relationship between control point number and position in cmap1 space is
# strictly enforced, but now when you try to move one past another, they
# both get moved.  Any number of control points can be shifted in this way.
# This is a much more useful way to manipulate the color map as it can be
# used to "tie" together two control points (as is appropriate for the
# center two points in the default map).
#
# Revision 1.2  1994/05/10  21:46:51  mjl
# Modified to dynamically alter colormaps.  Color editor now accepts a
# command argument and instance pointer to handle what should be done when
# a color is changed.  Hooks to new, more efficient way of setting colors
# in plframe added.  Buttons for incremental change of cmap1 position
# sliders added (except on boundary control points).
#
# Revision 1.1  1994/04/25  19:12:05  mjl
# The procs to handle palette modification (options menu).


plconfig.tcl:
# New, sets configuration options for plplot/TK driver.


pldefaults.tcl:
# Revision 1.2  1994/04/25  18:50:18  mjl
# Added resource setting for scale fonts (used in palette widgets).
# Also added variables governing fast and faster scrolling speed.
#
# Revision 1.1  1994/04/08  12:07:31  mjl
# Proc to set up defaults.  Should not be modified by the user (use
# plconfig instead).


plserver.tcl:
# Revision 1.14  1994/05/14  05:41:53  mjl
# Added a missing global declaration for the geometry variable.
#
# Revision 1.13  1994/05/07  03:11:35  mjl
# Ripped out code dependent on tk3.2 since it finally started to get in the
# way.  Also improved some documentation.
#
# Revision 1.12  1994/04/25  18:57:07  mjl
# Removed the rename of open since now we need it for reading/writing
# palette files (I hope everyone's security is up to par by now).  Deleted
# options menu -- now these are associated with the plframe widget.  Added
# shift and control attributes to key_filter as well as speeded up
# scrolling.  Shift+cursor gives the fast setting and Shift+Control+cursor
# gives the faster setting.
#
# Revision 1.11  1994/04/08  11:57:12  mjl
# Now the default resources are first loaded, then the user's customizations,
# if present.  A keystroke filtering proc was added to allow binding useful
# GUI operations to keystrokes.  The defaults are pretty reasonable, set
# in the pldefaults proc (and should be modified in plconfig).  Supported
# operations are "z" to zoom, "r" to reset zoom, "p" to print, "s" to save
# again, <Right>, <Left>, <Up>, <Down>, to scroll by cursor key while in
# zoom mode (units scrolled is user alterable as well).
#
# Revision 1.10  1994/01/15  17:43:21  mjl
# Added procs to handle communication link.  plserver_link_init gets invoked
# automatically when plserver is started by the Tcl/TK/DP driver.
# plserver_start is used when running plserver in stand-alone mode.
#
# Revision 1.9  1993/12/21  10:22:43  mjl
# Now route ALL communication to the client through the client_cmd proc.
# This part reworked to not suck when using Tcl-DP.
#
# Revision 1.8  1993/12/15  09:17:57  mjl
# Changes to support Tcl-DP and an atexit tweak.
#
# Revision 1.7  1993/12/09  20:34:45  mjl
# Added code to tell client to abort when exit is selected.


pltools.tcl:
# Revision 1.12  1994/04/25  18:58:48  mjl
# Added the simple class system by Sam Shen for support of the palette
# manipulators.  Will probably rewrite in itcl at some point.


plwidget.tcl:
# Revision 1.23  1994/05/07  03:13:11  mjl
# Minor improvements to work better with new extended wish model and custom
# color map capability.
#
# Revision 1.22  1994/04/25  19:00:34  mjl
# Added "Options" cascade menu, along with "Palette 0" and "Palette 1"
# entries.  Added shift and control modifiers to the key bindings
# responsible for calling the key_filter proc.
#
# Revision 1.21  1994/04/08  11:58:50  mjl
# Changes to support new mouse handler, keyboard filter, scrolling using
# cursor keys.  eop label should now flash correctly.
#
# Revision 1.20  1994/02/07  22:58:11  mjl
# Eliminated plw_flash in favor of plw_bop and plw_eop.  Added widget
# configure commands to set bop/eop behavior.
#
# Revision 1.19  1994/01/17  21:30:24  mjl
# Improved security for Tcl-DP communication by disabling any further
# connections after the initial client/server handshaking is finished.
#
# Revision 1.18  1994/01/15  17:41:52  mjl
# Improved handling of status label widget.  Added proc to handle
# initialization of data link via socket.
#
# Revision 1.17  1993/12/22  23:09:51  mjl
# Changes so that TK driver no longer times out on slow network connections
# (it's just rreeaaalllyyyy ssllooowwww).  Where timeouts are a problem,
# the client must issue the command to the server without waiting for a
# reply, and then sit in TK wait loop until some specified condition is
# met (usually the server sets a client interpreter variable when done).
#
# Revision 1.16  1993/12/21  10:22:44  mjl
# Now route ALL communication to the client through the client_cmd proc.
# This part reworked to not suck when using Tcl-DP.
#
# Revision 1.15  1993/12/15  09:02:13  mjl
# Changes to support Tcl-DP style communication; eliminated plframe
# widget attach and detach commands (no longer supported).


Palette files, new:

	cmap0a.pal	16 color, default

	cmap1a.pal	4 color, default (goes over one vertex of HLS cone)
	cmap1b.pal	2 color, just goes around S=1 circle
	cmap1c.pal	6 color, just goes around S=1 circle

-----------------------------------------------------------------------------
utilities
-----------------------------------------------------------------------------

plrender.c:
 * Revision 1.38  1994/04/30  16:15:17  mjl
 * Fixed format field (%ld instead of %d) or introduced casts where
 * appropriate to eliminate warnings given by gcc -Wall.
 *
 * Revision 1.37  1994/04/08  12:37:53  mjl
 * Fixed initial tcl command that is responsible for the backpage button
 * appearing.
 *
 * Revision 1.36  1994/03/23  09:03:05  mjl
 * Added support for cmap1, color map state changes, hardware polygon fills.
 *
 * Revision 1.35  1994/01/17  20:45:02  mjl
 * Converted to new syntax for PDF function calls.


pltek.c:
 * Revision 1.4  1993/07/17  00:30:03  mjl
 * Eliminated extraneous file open.


-----------------------------------------------------------------------------
DOS drivers
-----------------------------------------------------------------------------

DOS drivers moved into subdirectories of sys/dos/ since now there are at
least four different compilation systems supported.

DOS drivers upgraded to work with 4.99f, although now they may be broken
again.  I did what I could to fix them, the rest is up to the people
with machines that can test them...

DOS driver support contributed by:

	Paul Casteels			DOS/BGI (bcc)
	casteels@uia.ac.be
	(has agreed to continue supporting this driver for now)

	Paul Kirschner			DOS/DJGPP
	pek@logos.res.utc.com

	Mark Olesen			DOS/MSC + DOS/EMX
	olesen@weber.me.queensu.ca

The OS/2-PM driver has been released to be freely distributable by Geoff,
under the condition that someone else bring it up to date.  Volunteering
for the job is:

	John C. Peterson		OS/2
	jcp@trg.saic.com

-----------------------------------------------------------------------------
Amiga driver
-----------------------------------------------------------------------------

All sources:
 * Revision 1.7  1994/05/23  22:12:00  mjl
 * Minor incompatibilities with main sources fixed.
 *
 * Revision 1.6  1994/03/23  08:56:30  mjl
 * Header file rearrangement.


pla_wn.c:
 * Revision 1.8  1994/03/23  09:00:20  mjl
 * Much rearrangement and decruftifying.  Added support for cmap1, color map
 * state changes, solid polygon fills.  Screen now defaults to 16 color, and
 * palette can be set by calling program.  Added hack to capture screen
 * output into an iff file family without user intervention.
 *
 * Revision 1.7  1994/01/17  21:16:06  mjl
 * Changed virt window from 25 to 16x larger than workbench window
 * to fix problem with overflows (submitted by Wesley Ebisuzaki).


pla_menu.c:
 * Revision 1.3  1994/03/23  08:57:43  mjl
 * Header file rearrangement.  Broke code for saving an iff file from the
 * current screen off into plamiga_saveiff().



*****************************************************************************
PLPLOT 4.99f changes
*****************************************************************************

plplotX.h:
 * Revision 1.1  1993/12/08  06:20:38  mjl
 * Added for all code/data shared with the xwin driver.

xwin.c:
 * Revision 1.29  1993/12/08  06:17:33  mjl
 * Split off definition of state structure into header file.  Changed end of
 * page handler to check for and process events even if not pausing before
 * the next page.
 *
 * Revision 1.28  1993/12/06  07:42:31  mjl
 * Changed escape flush function to also handle any pending events.

sys/dos386/makefile
 brought up to date (submitted by Paul Kirschner)

gnusvga.c:
 * Revision 1.12  1993/12/08  06:12:22  mjl
 * Miscellaneous bug fixes contributed by Paul Kirschner.

plctrl.c:
 * Revision 1.11  1993/12/08  06:22:23  mjl
 * Fix for dos386/djgpp.

plpage.c:
 * Revision 1.7  1993/12/08  06:22:58  mjl
 * Fix to plbop() so that the user can just use plbop/pleop if desired and
 * never need to call pladv().

configure:
 now softlinks to tmp the contents of the fonts directory

stndfont.c:
xtndfont.c:
 * Revision 1.5  1993/12/08  06:19:04  mjl
 * Fixes so that these correctly build again (neglected to apply some global
 * changes in a previous release).

plcore.h:
drivers.h:
 * Revision 1.12  1993/12/08  20:26:21  mjl
 * Changes to support MS-Kermit output device.

tek.c:
 * Revision 1.19  1993/12/08  20:25:34  mjl
 * Added changes for MS-Kermit emulator (submitted by Paul Kirschner).
 *
 * Revision 1.18  1993/12/08  06:14:43  mjl
 * Now send an initial page clear (tek devices only) on a beginning of page.
 * This helps when there is only one graphics/alpha screen, otherwise is
 * harmless.
 *
 * Revision 1.17  1993/12/06  07:41:47  mjl
 * Changed to not turn off echo when changing tty settings.

plargs.c:
 * Revision 1.14  1993/12/06  07:46:11  mjl
 * Eliminated the obsolete -color flag.

plframe.c:
tk.c:
 * Revision 1.18  1993/12/08  06:18:06  mjl
 * Changed to include new plplotX.h header file.
 *
 * Revision 1.17  1993/12/06  07:43:09  mjl
 * Fixed bogus tmpnam call.

plcore.c:
plstream.c:
scstubs.c:
plplot.h:
plstream.h:
plstubs.h:
 * Modifications for new color model.

*****************************************************************************
PLPLOT 4.99e changes
*****************************************************************************

pdfutils.c:
 * Revision 1.6  1993/11/12  18:41:18  mjl
 * Substituted bit operations for some arithmetic ones, for faster, more
 * concise, and more portable code.

plbox.c:
 * Revision 1.9  1993/11/19  07:29:18  mjl
 * Changed the minimum distance a grid line must be from the boundary in
 * order for it to be drawn.  It was set before at 0.5 ticks (undocumented
 * and hardwired) and I changed this to 0.1 ticks while documenting it in the
 * code and making it easier to alter (but only through changing the source).
 * Maybe in the long term this should become a settable parameter.

plcore.c:
 * Revision 1.23  1993/11/15  08:38:35  mjl
 * Added documentation.  Fixed plflush to be callable from Fortran.
 * Moved plexit to this file and changed it to set nopause before issuing the
 * final end-of-page command.
 *
 * Revision 1.22  1993/11/07  09:07:38  mjl
 * Changed plflush() to call escape function if driver wants to handle
 * flushes itself.  Also found & fixed a bug in plcpstrm.

plctrl.c:
 * Revision 1.10  1993/11/15  08:39:05  mjl
 * Removed plexit().
 *
 * Revision 1.9  1993/11/07  09:08:14  mjl
 * Added user-settable exit handler (call plsexit to set).

plmeta.c:
 * Revision 1.21  1993/11/15  08:29:19  mjl
 * Now writes number of pages in file to beginning of file on each
 * new page.  For seeking to a specified number of pages before EOF.

plrender.c:
 * Revision 1.34  1993/11/15  08:42:15  mjl
 * Added code to support seeks to the specified number of pages before EOF.
 * Number is specified using "--", i.e. -b --3 to start 3 pages before EOF.
 * Also works while interactively seeking.

plserver.c:
 * Revision 1.14  1993/11/19  07:31:35  mjl
 * Updated to new call syntax for tk_toplevel().

ps.c:
 * Revision 1.19  1993/11/19  07:29:50  mjl
 * Fixed the bounding box maxima (bug reported by Jan Thorbecke).

scstubs.c:
 * Revision 1.16  1993/11/15  08:40:57  mjl
 * Added stub for PLSCOLBG.

tk.c:
 * Revision 1.17  1993/11/19  07:31:36  mjl
 * Updated to new call syntax for tk_toplevel().
 *
 * Revision 1.16  1993/11/15  08:31:16  mjl
 * Now uses tmpnam() to get temporary file instead of tempnam().  Also,
 * put in rename of dangerous Tcl commands just after startup.
 *
 * Revision 1.15  1993/11/07  09:02:52  mjl
 * Added escape function handling for dealing with flushes.

tkshell.c:
 * Changed to new argument syntax for Tk_CreateMainWindow for TK 3.4 and later.

xwin.c:
 * Revision 1.26  1993/11/07  09:02:33  mjl
 * Some minor optimizations.  Also added escape function handling for dealing
 * with flushes.

metadefs.h:
 * Revision 1.9  1993/11/15  08:31:37  mjl
 * Bumped metafile version number since now write pages info to header.

plplot.h:
 * Revision 1.47  1993/11/19  07:32:40  mjl
 * Added Convex support.
 *
 * Revision 1.46  1993/11/15  08:34:07  mjl
 * Prototype section completely reworked.  Now each prototype taken directly
 * from the definition (so includes variable names) and is accompanied by a
 * brief description of what the function does.  This makes the header file
 * much more useful as a quick reminder of the argument syntax for each
 * function (i.e. a poor man's manual).
 *
 * Revision 1.45  1993/11/07  22:49:00  mjl
 * Bumped version number to 4.99e.
 *
 * Revision 1.44  1993/11/07  09:03:22  mjl
 * Added prototype for plsexit, the new exit-handler setting function.

plplotP.h:
 * Revision 1.14  1993/11/19  07:41:52  mjl
 * define NO_ANSI_LIBC if on Convex (may be overkill but it works..)
 *
 * Revision 1.13  1993/11/15  08:34:23  mjl
 * Prototype section completely reworked.  Now each prototype taken directly
 * from the definition (so includes variable names) and is accompanied by a
 * brief description of what the function does.  This makes the header file
 * much more useful as a quick reminder of the argument syntax for each
 * function (i.e. a poor man's manual).
 *
 * Revision 1.12  1993/11/07  09:03:42  mjl
 * Added escape code for flush handling.

plserver.h:
 * Revision 1.6  1993/11/19  07:31:20  mjl
 * Fixed the prototype for tk_toplevel().

plstream.h:
 * Revision 1.18  1993/11/15  08:34:43  mjl
 * Documentation changes.
 *
 * Revision 1.17  1993/11/07  09:04:17  mjl
 * Added device variable to specify that driver wants to handle its own
 * flushes.

plstubs.h:
 * Revision 1.18  1993/11/15  08:35:22  mjl
 * Name definitions added for new stubs -- PLEOP, PLBOP, PLSCOLBG.


*****************************************************************************
PLPLOT 4.99d changes
*****************************************************************************

Note the old Changes.log file has been moved to the doc directory for
possible reference while writing the new manual.  

-----------------------------------------------------------------------------
ALL SOURCE FILES:
-----------------------------------------------------------------------------
 * Revision x.xx  1993/07/01  22:13:35  mjl
 * Changed all plplot source files to include plplotP.h (private) rather than
 * plplot.h.  Rationalized namespace -- all externally-visible internal
 * plplot functions now start with "plP_".

-----------------------------------------------------------------------------
ALL DRIVERS:
-----------------------------------------------------------------------------
 * Revision x.xx  1993/07/31  07:56:46  mjl
 * Several driver functions consolidated, for all drivers.  The width and color
 * commands are now part of a more general "state" command.  The text and
 * graph commands used for switching between modes is now handled by the
 * escape function (very few drivers require it).  The device-specific PLDev
 * structure is now malloc'ed for each driver that requires it, and freed when
 * the stream is terminated.
 *
 * Revision x.xx  1993/07/16  22:11:23  mjl
 * Eliminated low-level coordinate scaling; now done by driver interface.
 *
 * Revision x.xx  1993/07/01  21:59:45  mjl
 * Changed all plplot source files to include plplotP.h (private) rather than
 * plplot.h.  Rationalized namespace -- all externally-visible plplot functions
 * now start with "pl"; device driver functions start with "plD_".

-----------------------------------------------------------------------------
OTHER CHANGES TO MAIN SOURCE FILES:
-----------------------------------------------------------------------------
plwind.c:
 * Revision 1.5  1993/09/17  06:44:40  mjl
 * Eliminated abort on bad window bounds; now issues a warning and attempts
 * to recover.

plsym.c:
 * Revision 1.7  1993/10/21  19:30:25  mjl
 * Updated calls to private plplot utility functions (these now begin
 * with "plP_").
 *
 * Revision 1.6  1993/10/18  19:45:50  mjl
 * Added user-contributed plarrows function.

plstring.c:
 * Revision 1.6  1993/10/18  19:45:25  mjl
 * User-contributed workaround for Borland C compiler bug.
 *
 * Revision 1.5  1993/09/24  20:33:29  furnish
 * Went wild with "const correctness".  Can now pass a C++ String type to
 * most (all that I know of) PLPLOT functions.  This works b/c String has
 * an implicit conversion to const char *.  Now that PLPLOT routines take
 * const char * rather than char *, use from C++ is much easier.
 *
 * Revision 1.4  1993/08/03  01:47:00  mjl
 * Changes to eliminate warnings when compiling with gcc -Wall.

plstream.c:
 * Revision 1.10  1993/09/24  20:33:28  furnish
 * Went wild with "const correctness".  Can now pass a C++ String type to
 * most (all that I know of) PLPLOT functions.  This works b/c String has
 * an implicit conversion to const char *.  Now that PLPLOT routines take
 * const char * rather than char *, use from C++ is much easier.
 *
 * Revision 1.9  1993/09/08  02:40:51  mjl
 * Moved some functions to plstream.c.
 *
 * Revision 1.8  1993/08/09  22:12:39  mjl
 * Changed call syntax to plRotPhy to allow easier usage.
 *
 * Revision 1.7  1993/07/31  08:19:25  mjl
 * Utility function added for allocating a PLDev structure.
 *
 * Revision 1.6  1993/07/16  22:37:04  mjl
 * Eliminated obsolete functions, moved function for setting filename here.
 *
 * Revision 1.4  1993/04/26  19:57:59  mjl
 * Fixes to allow (once again) output to stdout and plrender to function as
 * a filter.  A type flag was added to handle file vs stream differences.

plshade.c:
 * Revision 1.5  1993/10/21  19:28:52  mjl
 * Added prototypes for passed-in function pointers.
 *
 * Revision 1.4  1993/09/24  20:33:27  furnish
 * Went wild with "const correctness".  Can now pass a C++ String type to
 * most (all that I know of) PLPLOT functions.  This works b/c String has
 * an implicit conversion to const char *.  Now that PLPLOT routines take
 * const char * rather than char *, use from C++ is much easier.
 *
 * Revision 1.3  1993/08/31  17:58:06  mjl
 * More cleaning up, merged documentation file into source file.
 *
 * Revision 1.2  1993/08/09  22:18:57  mjl
 * Miscellaneous cleaning up.
 *
 * Revision 1.1  1993/07/16  22:38:12  mjl
 * These include functions to shade between contour levels (currently using
 * a pattern fill).  Contributed by Wesley Ebisuzaki.

plsdef.c:
 * Revision 1.7  1993/07/16  22:36:33  mjl
 * Minor change to comments.

plpage.c:
 * Revision 1.5  1993/09/08  02:40:34  mjl
 * Trivial documentation correction.
 *
 * Revision 1.4  1993/08/09  22:15:05  mjl
 * Eliminated all vestiges of old clr/page syntax, in favor of eop/bop.

plot3d.c:
 * Revision 1.7  1993/07/28  05:54:10  mjl
 * Put in code to ensure all malloc'ed memory is freed upon exit.

plline.c:
 * Revision 1.9  1993/07/31  08:18:34  mjl
 * Clipping routine for polygons added (preliminary).

plfont.c:
 * Revision 1.9  1993/09/08  02:40:16  mjl
 * Added search of INSTALL_DIR, passed in from makefile.  Directories
 * now can be specified without the trailing slash, and the path name
 * is built up correctly (I hope) on Unix, Amiga, and MS-DOS (so special
 * handling for passing strings with a trailing backslash is gone).
 *
 * Revision 1.8  1993/07/28  05:53:47  mjl
 * Put in code to ensure all malloc'ed memory is freed upon exit.
 *
 * Revision 1.7  1993/07/01  22:15:32  mjl
 * Improved code that locates fonts, and changed the default font
 * locations on the Amiga.

plfill.c:
 * Revision 1.11  1993/07/16  22:36:16  mjl
 * Algorithm improved and simplified, submitted by Wesley Ebisuzaki.

pldtik.c:
 * Revision 1.6  1993/10/12  21:57:41  mjl
 * Same thing as last commit, only this time it's right.
 *
 * Revision 1.5  1993/10/12  21:32:38  mjl
 * Fixed bug in automatic setting of precision (it was too large by 1 place)
 * when exponent is placed separately.

plctrl.c:
 * Revision 1.8  1993/10/21  19:28:25  mjl
 * Minor bug fix.
 *
 * Revision 1.7  1993/10/18  19:44:50  mjl
 * Added functions to return fully qualified pathnames and/or executable
 * names.
 *
 * Revision 1.6  1993/09/27  20:40:12  mjl
 * Added #include <string.h> to pick up prototype for strcat.
 *
 * Revision 1.5  1993/09/08  02:37:48  mjl
 * Added plGetName for building up file name specs out of path components.
 * Also moved some utility functions from plstream.c here.
 *
 * Revision 1.4  1993/07/31  08:18:10  mjl
 * Changes to text/graph screen switching commands to reflect reorganization.

plctest.c:
 * Revision 1.3  1993/08/11  19:19:17  mjl
 * Changed debugging code to print to stderr instead of stdout.
 *
 * Revision 1.2  1993/08/09  22:18:56  mjl
 * Miscellaneous cleaning up.
 *
 * Revision 1.1  1993/07/16  22:38:13  mjl
 * These include functions to shade between contour levels (currently using
 * a pattern fill).  Contributed by Wesley Ebisuzaki.

plcore.c:
 * Revision 1.21  1993/09/24  20:33:25  furnish
 * Went wild with "const correctness".  Can now pass a C++ String type to
 * most (all that I know of) PLPLOT functions.  This works b/c String has
 * an implicit conversion to const char *.  Now that PLPLOT routines take
 * const char * rather than char *, use from C++ is much easier.
 *
 * Revision 1.20  1993/09/08  02:36:47  mjl
 * Changed mapping driver interface initialization function to not bomb if
 * called before plinit().  Changed plcpstrm to work more robustly (some
 * saves were giving garbage).
 *
 * Revision 1.19  1993/08/31  20:14:30  mjl
 * Fix to plend1() so that prematurely aborted streams do not result in a
 * core dump.  Put font loading code before plsc->level is set to 1, to
 * prevent core dumps when fonts are not found.
 *
 * Revision 1.18  1993/08/18  20:33:22  mjl
 * Many changes to driver interface to properly modify the device window
 * based on orientation and coordinate mapping.  Orientation switches now
 * automatically set the device window so as to preserve the aspect ratio.
 * Ditto for coordinate mapping (only used when copying stream parameters
 * from one to another, such as used when dumping a plot to disk from the TK
 * driver).  Switched over to new page description variables mar, aspect, jx,
 * and jy, and deleted the old ones.  Added a variable widthlock that is set
 * when -width is used to modify the pen width, so that subsequent plwid()
 * calls are ignored.
 *
 * Revision 1.17  1993/08/11  19:19:03  mjl
 * Changed debugging code to print to stderr instead of stdout, fixed
 * up some minor type mismatches.
 *
 * Revision 1.16  1993/08/09  22:20:34  mjl
 * Fixed plcpstrm() so that it no longer sucks.
 *
 * Revision 1.15  1993/08/03  01:46:58  mjl
 * Changes to eliminate warnings when compiling with gcc -Wall.
 *
 * Revision 1.14  1993/07/31  08:17:37  mjl
 * Action for driver interface setup functions now deferred until after
 * plinit() called so that these can be set via command line arguments.
 * Drivers that request it can handle these directly.
 *
 * Revision 1.13  1993/07/28  05:53:23  mjl
 * Put in code to ensure all malloc'ed memory is freed upon exit.
 *
 * Revision 1.12  1993/07/16  22:35:05  mjl
 * Addition of driver interface function for converting between device
 * coordinate systems, functions for retrieving current driver interface
 * parameters.  Also added functions for creating a new stream, copying
 * an existing stream, replaying the current plot, returning a list of
 * file-oriented devices.
 *
 * Revision 1.11  1993/07/01  22:25:16  mjl
 * Changed all plplot source files to include plplotP.h (private) rather
 * than plplot.h.  Rationalized namespace -- all externally-visible
 * internal plplot functions now start with "plP_".  Moved functions
 * plend() and plend1() to here.  Added driver interface -- sits
 * between the plplot library calls and the driver to filter the data in
 * various ways, such as to support zooms, page margins, orientation
 * changes, etc.  Changed line and polyline draw functions to go through
 * this layer.  Changed all references to the current plplot stream to be
 * through "plsc", which is set to the location of the current stream (now
 * dynamically allocated).  A table of stream pointers (max of 100) is
 * kept to allow switching between streams as before.
 *
 * Revision 1.10  1993/04/26  19:57:58  mjl
 * Fixes to allow (once again) output to stdout and plrender to function as
 * a filter.  A type flag was added to handle file vs stream differences.

plcont.c:
 * Revision 1.9  1993/07/17  21:31:55  mjl
 * Improved error message for out of range indices.

plbox.c:
 * Revision 1.8  1993/09/24  20:33:23  furnish
 * Went wild with "const correctness".  Can now pass a C++ String type to
 * most (all that I know of) PLPLOT functions.  This works b/c String has
 * an implicit conversion to const char *.  Now that PLPLOT routines take
 * const char * rather than char *, use from C++ is much easier.

plargs.c:
 * Revision 1.13  1993/08/28  06:38:05  mjl
 * The option table now requires passing of a pointer to user-defined data,
 * similar in spirit to that used in Xt or TK callbacks.  If unused, simply
 * initialize as NULL.  All option handlers changed to accept this pointer
 * as the third argument.  Especially useful from C++ for passing the "this"
 * pointer.
 *
 * Revision 1.12  1993/08/18  19:19:44  mjl
 * Added new flags -mar, -a, -jx, -jy for setting margin, aspect ratio, and
 * justification from the command line.  These are similar but not the same
 * as the same-named variables from old versions of plrender, and are treated
 * entirely different.  These now are used to set device window coordinates
 * in the driver interface.  The aspect ratio defaults to 0 for the natural
 * aspect ratio of the device, and the user normally won't need to change
 * this (plots requiring a specified aspect ratio should use plvpas or
 * plvasp).  The margin (0 to 0.5) is the *minimum* fraction of the page to
 * reserve on each side, while the justification (-0.5 to 0.5) is the
 * fractional displacement of the center of the plot in x (for -jx) or y (for
 * -jy).  Since these settings are now handled in the driver interface, ALL
 * output drivers now support margins, aspect ratio modification, and
 * justification.  The -wdev flag introduced only a month or so ago was
 * eliminated.
 *
 * Revision 1.11  1993/08/11  19:21:58  mjl
 * Changed definition of plHelp() and plSyntax() to take a mode flag
 * as argument.  Currently used to govern handling of invisible options.
 *
 * Revision 1.10  1993/08/04  18:27:03  mjl
 * Modified -bg argument handler to strip leading '#' off hex color value if
 * present, to allow it to deal with TCL-style color values.
 *
 * Revision 1.9  1993/08/03  01:46:56  mjl
 * Changes to eliminate warnings when compiling with gcc -Wall.
 *
 * Revision 1.8  1993/07/31  08:16:12  mjl
 * Flags added to change plot window (-wplt), device window (-wdev).
 * Orientation flag (-ori) changed to use new driver interface.  Aspect flag
 * (-a) deleted.
 *
 * Revision 1.7  1993/07/28  05:54:29  mjl
 * Added support for -nopixmap option.
 *
 * Revision 1.6  1993/07/16  22:32:35  mjl
 * Fixed bug encountered when setting option via plSetInternalOpt().

pdfutils.c:
 * Revision 1.5  1993/08/11  19:20:03  mjl
 * Changed debugging code to print to stderr instead of stdout, plugged
 * a hole where possible failure of fwrite went undetected.
 *
 * Revision 1.4  1993/08/03  01:46:55  mjl
 * Changes to eliminate warnings when compiling with gcc -Wall.
 *
 * Revision 1.3  1993/07/01  22:07:38  mjl
 * PDF functions start with "pdf_".

scstubs.c:
 * Revision 1.15  1993/10/21  19:27:07  mjl
 * Changed all names that ended with an underscore (as part of the C/Fortran
 * linkage) to end with a '7' instead, to avoid problems with f2c.
 *
 * Revision 1.14  1993/08/26  20:00:17  mjl
 * Inserted stub function PLINIT().
 *
 * Revision 1.13  1993/08/09  22:15:08  mjl
 * Eliminated all vestiges of old clr/page syntax, in favor of eop/bop.
 *
 * Revision 1.12  1993/07/02  07:11:39  mjl
 * Minor change to function name.
 *
 * Revision 1.11  1993/04/26  20:03:14  mjl
 * Added stub for plgchr().

sccont.c:
 * Revision 1.2  1993/10/21  19:27:06  mjl
 * Changed all names that ended with an underscore (as part of the C/Fortran
 * linkage) to end with a '7' instead, to avoid problems with f2c.

-----------------------------------------------------------------------------
OTHER CHANGES TO DRIVERS:
-----------------------------------------------------------------------------
xwin.c:
 * Revision 1.25  1993/10/01  23:18:33  mjl
 * Inserted XSync after creation of pixmap in CreatePixmap() to ensure
 * the test for a bad allocation is really completed.
 *
 * Revision 1.24  1993/09/14  22:25:44  mjl
 * One of the safety checks was mistakenly commented out.
 *
 * Revision 1.23  1993/08/28  06:29:42  mjl
 * Added a safety check that the escape function pointer for resizes is
 * initialized, and moved some XSync commands (deep magic, don't ask).
 *
 * Revision 1.22  1993/08/11  19:22:23  mjl
 * Fixed warning under Sun's acc.
 *
 * Revision 1.21  1993/07/31  07:58:33  mjl
 * Several driver functions consolidated, for all drivers.  The width and color
 * commands are now part of a more general "state" command.  The text and
 * graph commands used for switching between modes is now handled by the
 * escape function (very few drivers require it).  The color initialization
 * was modified to work better with the TK driver, and the function to detect
 * grayscale displays made external for use from tk.c.
 *
 * Revision 1.20  1993/07/28  05:34:45  mjl
 * Added error handler to trap pixmap allocation errors, and switch to a
 * slower method (redraw) of refreshing window on exposes.  Also added
 * globally visible utility functions for converting between a PLColor and
 * an XColor, as well as other minor changes.
 *
 * Revision 1.19  1993/07/16  22:17:00  mjl
 * Added escape function to redraw plot (unlike resize, the window size remains
 * unchanged).  Changed draw functions to only draw to the pixmap during page
 * redraws.  Pixmap is then copied to the actual window when done, for faster
 * and more smooth response.
 *
 * Revision 1.18  1993/07/01  22:05:48  mjl
 * Changed all plplot source files to include plplotP.h (private) rather than
 * plplot.h.  Rationalized namespace -- all externally-visible plplot functions
 * now start with "pl"; device driver functions start with "plD_".  X driver
 * enhanced to plot to a specified window id.  A pixmap is now used for
 * handling expose events.  External entries for doing expose, resize, and
 * redraw events were created using the escape function (for use from TK
 * plframe widget).  The X-driver device data is now dynamically allocated,
 * for use by multiple streams.  The default size of the created X window
 * has been reduced some.

tek.c:
 * Revision 1.16  1993/09/14  22:25:15  mjl
 * Moved define of POSIX_TTY to plplotP.h since the SX-3 isn't POSIX-compliant.
 *
 * Revision 1.15  1993/08/03  01:46:42  mjl
 * Changes to eliminate warnings when compiling with gcc -Wall.
 *
 * Revision 1.13  1993/07/28  05:38:59  mjl
 * Merged with xterm code, and added code to handle Tektronix 4105/4107
 * (color) devices.  For now just the color index selection is supported.
 * Added code to change terminal line to noncanonical (cbreak) mode on
 * POSIX systems so that entered keystrokes (including <Backspace> and "Q"
 * from plrender) do not require a <CR> to be recognized.

ps.c:
 * Revision 1.18  1993/08/09  22:13:32  mjl
 * Changed call syntax to plRotPhy to allow easier usage.  Added struct
 * specific to PS driver to improve reentrancy.
 *
 * Revision 1.16  1993/07/16  22:14:18  mjl
 * Simplified and fixed dpi settings.
 *
 * Revision 1.14  1993/04/26  20:01:59  mjl
 * Changed time type from long to time_t.

plmeta.c:
 * Revision 1.20  1993/08/20  19:35:53  mjl
 * Deleted save of pen width at every page boundary.  Eventually I'll come up
 * with a better way to save the state.
 *
 * Revision 1.19  1993/08/11  19:18:05  mjl
 * Changed debugging code to print to stderr instead of stdout.
 *
 * Revision 1.18  1993/08/03  01:46:41  mjl
 * Changes to eliminate warnings when compiling with gcc -Wall.
 *
 * Revision 1.16  1993/07/16  22:13:48  mjl
 * Switched coordinates to standard meta coords.  Eliminated obsolete low-level
 * operations.  Added write of some state information (colors and pen width)
 * at the beginning of each page to aid seeking while in renderer.
 *
 * Revision 1.15  1993/07/01  22:00:51  mjl
 * PDF functions start with "pdf_".
 *
 * Revision 1.14  1993/04/26  19:57:48  mjl
 * Fixes to allow (once again) output to stdout and plrender to function as
 * a filter.  A type flag was added to handle file vs stream differences.

plbuf.c:
 * Revision 1.16  1993/09/28  21:25:08  mjl
 * Now discards the old temp file and opens a new one on each new page.  This
 * avoids a lot of problems redisplaying partially filled pages -- we can
 * just read to EOF without worrying about junk in the file from previous
 * writes.  The old method never did work perfectly.
 *
 * Revision 1.15  1993/09/27  20:33:51  mjl
 * Insignificant change to eliminate a gcc -Wall warning.
 *
 * Revision 1.14  1993/09/08  02:27:11  mjl
 * Inserted change to ensure that streams that do not own the plot buffer
 * cannot write to it (was causing problems on plot saves).
 *
 * Revision 1.13  1993/08/30  19:11:51  mjl
 * Fixed the damage incurred by my previous "fix".  Plot buffer now appears
 * capable of accurately and unobtrusively replaying partially filled pages.
 *
 * Revision 1.12  1993/08/28  06:28:07  mjl
 * Fixed escape function reads & writes to be consistent.  Added plbuf_rewind
 * function, which writes EOP's to the end of file to make sure that dicking
 * around with the window settings before the page is complete doesn't end in
 * a core dump.
 *
 * Revision 1.10  1993/07/16  22:12:17  mjl
 * Simplified and slightly changed behavior to support plot dumps to cloned
 * plplot streams.

mgr.c:
 * Revision 1.1  1993/08/03  03:21:55  mjl
 * Added contributions from Sergio Fanchiotti for use under Linux.

ljii.c:
 * Revision 1.14  1993/08/09  22:12:32  mjl
 * Changed call syntax to plRotPhy to allow easier usage.

linuxvga.c:
 * Revision 1.1  1993/08/03  03:21:54  mjl
 * Added contributions from Sergio Fanchiotti for use under Linux.

impress.c:
 * Revision 1.12  1993/07/28  05:35:50  mjl
 * Fixed a cast in argument to free().

-----------------------------------------------------------------------------
TK DRIVERS: (all new, so I've just included a description)
-----------------------------------------------------------------------------
tkshell.c:
 * Functions to handle creation & initialization of TCL interpreter and
 * main window.  Taken from source code for "wish", copyright follows:

tkdemo1.tcl:
# Revision 1.1  1993/08/03  20:35:40  mjl
# A demo of alternate plserver startup.  Just sketched out so far.

tk.c:
 * Revision 1.1  1993/07/02  06:58:37  mjl
 * The new TCL/TK driver!  Yes it's finally here!  YAAAAAAAAYYYYYYY!!!

tclIndex:
# Tcl autoload index file: each line identifies a Tcl
# procedure and the file where that procedure is
# defined.  Generated by the "auto_mkindex" command.

plwidget.tcl:
# PLPLOT TK/TCL graphics renderer
# plplot window initialization procs

pltools.tcl:
# PLPLOT TK/TCL graphics renderer support procs

plserver.tcl:
# PLPLOT TK/TCL graphics renderer menu procs

plserver.h:
 * Declarations for plserver and associated files.  

plserver.c:
 * Plplot graphics server.

plr.c:
* Support routines to render a PLPLOT byte stream, interpreting the PLPLOT
* metacode.  

plframe.c:
 *	This module implements "plframe" widgets for the Tk toolkit.
 *	These are frames that have extra logic to allow them to be
 *	interfaced with the plplot X driver.  These are then drawn
 *	into and respond to keyboard and mouse events.

plconfig.tcl:
# Sets configuration options for plplot/TK driver.

help_tcltk.tcl:
# Create a top-level window that displays info for On Tcl/TK.. help item.

help_keys.tcl:
# Create a top-level window that displays info for On keys.. help item.

help_gui.tcl:
# Create a top-level window that displays info for On GUI.. help item.

about.tcl:
# Create a top-level window that displays info for About.. menu item.

-----------------------------------------------------------------------------
OTHER CHANGES TO INCLUDE FILES:
-----------------------------------------------------------------------------
xwin.h:
 * Revision 1.1  1993/07/28  05:52:30  mjl
 * Added to provide function prototypes and anything else necessary to
 * use X utility functions in xwin.c driver (used by plframe.c at present).

plstubs.h:
 * Revision 1.17  1993/10/21  19:27:03  mjl
 * Changed all names that ended with an underscore (as part of the C/Fortran
 * linkage) to end with a '7' instead, to avoid problems with f2c.
 *
 * Revision 1.16  1993/08/26  19:59:43  mjl
 * Inserted stub name definition for PLINIT().
 *
 * Revision 1.15  1993/08/26  18:29:08  mjl
 * Put in fix for name translation under UNICOS.
 *
 * Revision 1.14  1993/07/20  06:50:28  mjl
 * Eliminated obsolete type declarations for string conversions.
 *
 * Revision 1.13  1993/07/16  22:31:41  mjl
 * Changed method for getting stub conversion right.  Now need to define
 * the macro STUB_LINKAGE with any of the supported conversion types.
 *
 * Revision 1.12  1993/07/02  07:26:10  mjl
 * Changed include of plplot.h to plplotP.h.  Also added IRIX support.
 *
 * Revision 1.11  1993/04/26  20:00:55  mjl
 * Configuration info added for a DEC Alpha-based machine running OSF/1.
 *
 * Revision 1.10  1993/03/28  08:45:07  mjl
 * Added support for NEC SX-3.  Also moved determination of stub name handling
 * to plstubs.h (more appropriate).

plstream.h:
 * Revision 1.16  1993/09/24  20:33:17  furnish
 * Went wild with "const correctness".  Can now pass a C++ String type to
 * most (all that I know of) PLPLOT functions.  This works b/c String has
 * an implicit conversion to const char *.  Now that PLPLOT routines take
 * const char * rather than char *, use from C++ is much easier.
 *
 * Revision 1.15  1993/09/08  02:35:20  mjl
 * Added stream variables for driver interface coordinate mapping settings.
 *
 * Revision 1.14  1993/08/18  20:30:10  mjl
 * Switched over to new page description variables mar, aspect, jx, and jy,
 * and deleted the old ones.  Added a variable widthlock that is set when
 * -width is used to modify the pen width, so that subsequent plwid() calls
 * are ignored.
 *
 * Revision 1.13  1993/08/09  22:12:36  mjl
 * Changed call syntax to plRotPhy to allow easier usage.
 *
 * Revision 1.12  1993/07/31  08:13:39  mjl
 * Variables added: dev_di - the driver can handle driver interface commands;
 * dev_fill - the driver can handle polygon fill commands (both to be
 * implemented using the escape function).  Also other support variables added.
 *
 * Revision 1.11  1993/07/28  05:51:12  mjl
 * Added stream variables nopixmap (tell driver not to use pixmaps) and
 * dual_screen (set on devices that have dual text/graphics screens).
 *
 * Revision 1.10  1993/07/16  22:30:10  mjl
 * Added many new variables used in driver interface to PLStream definition.
 * Eliminated some obsolete variables and function prototypes.
 *
 * Revision 1.9  1993/07/02  07:25:30  mjl
 * Added variables for dealing with X driver, TK driver, driver interface.
 *
 * Revision 1.8  1993/04/26  19:57:52  mjl
 * Fixes to allow (once again) output to stdout and plrender to function as
 * a filter.  A type flag was added to handle file vs stream differences.

plplotP.h:
 * Revision 1.11  1993/10/06  19:52:57  mjl
 * Disabled the POSIX_TTY stuff (because it requires ANSI atexit()) when
 * NO_ANSI_LIBC is defined, and no longer define this by default for SunOS.
 * May require linking with -lansi on some systems (using acc).
 *
 * Revision 1.10  1993/09/24  20:33:16  furnish
 * Went wild with "const correctness".  Can now pass a C++ String type to
 * most (all that I know of) PLPLOT functions.  This works b/c String has
 * an implicit conversion to const char *.  Now that PLPLOT routines take
 * const char * rather than char *, use from C++ is much easier.
 *
 * Revision 1.9  1993/09/14  22:25:19  mjl
 * Moved define of POSIX_TTY to plplotP.h since the SX-3 isn't POSIX-compliant.
 *
 * Revision 1.8  1993/08/18  20:29:04  mjl
 * Added utility macro for updating stream variables from input values.
 *
 * Revision 1.7  1993/08/09  22:18:02  mjl
 * Added function prototypes for pleop(), plbop(), eliminated them for plclr()
 * and plpage().  Inserted defines to translate from the latter in case
 * someone actually uses them.  Fixed prototype for plcpstrm().
 *
 * Revision 1.6  1993/08/05  22:35:21  mjl
 * Eliminated prototypes for nonexistant functions.
 *
 * Revision 1.5  1993/08/03  01:46:51  mjl
 * Changes to eliminate warnings when compiling with gcc -Wall.
 *
 * Revision 1.4  1993/07/31  08:10:42  mjl
 * Macros for use in escape function changed to have a prefix PLESC_, similarly
 * those used in the state function start with PLSTATE_.  Some function
 * prototypes added/deleted.
 *
 * Revision 1.3  1993/07/28  05:50:12  mjl
 * Removed some unnecessary code (under ANSI C) for handling signed chars;
 * added free_mem() utility macro.
 *
 * Revision 1.2  1993/07/16  22:29:17  mjl
 * Definition of standard meta coordinates now done here.  Prototypes for
 * several new functions added.
 *
 * Revision 1.1  1993/07/02  07:27:16  mjl
 * Created to hold private PLPLOT macros, declarations, and prototypes.
 * Included by all PLPLOT source files.

plplot.h:
 * Revision 1.43  1993/10/21  19:25:32  mjl
 * Added prototype for plFindName().
 *
 * Revision 1.42  1993/10/18  19:43:20  mjl
 * Added prototype for plFindCommand function.
 *
 * Revision 1.41  1993/09/28  21:30:17  mjl
 * Made the bomb-out for non-ANSI | non-C++ compilers more explicit.
 *
 * Revision 1.40  1993/09/24  20:33:14  furnish
 * Went wild with "const correctness".  Can now pass a C++ String type to
 * most (all that I know of) PLPLOT functions.  This works b/c String has
 * an implicit conversion to const char *.  Now that PLPLOT routines take
 * const char * rather than char *, use from C++ is much easier.
 *
 * Revision 1.39  1993/09/17  06:43:19  mjl
 * Now accepts -DDOUBLE as well as -DPL_DOUBLE for setting double precision
 * floating points.
 *
 * Revision 1.38  1993/09/08  02:34:44  mjl
 * Added function prototype for plGetName, moved some others from plstream.h
 * into here.
 *
 * Revision 1.37  1993/08/28  06:35:37  mjl
 * Added client_data variable to PLOptionTable definition.
 *
 * Revision 1.36  1993/08/26  21:18:16  mjl
 * Previous safety check a little too safe -- changed to allow C++ compilers.
 *
 * Revision 1.35  1993/08/26  05:35:54  mjl
 * Put in test for __STDC__ defined, for a little added safety.
 *
 * Revision 1.34  1993/08/18  19:09:19  mjl
 * Fixed function prototypes for driver interface functions.  Added macro
 * PL_NOTSET for use in plsdidev() to leave specific variables unaltered by
 * the function call.  May be supported by other functions later.
 *
 * Revision 1.33  1993/08/11  19:27:12  mjl
 * Changed prototypes for plHelp() and plSyntax().
 *
 * Revision 1.32  1993/08/09  22:18:00  mjl
 * Added function prototypes for pleop(), plbop(), eliminated them for plclr()
 * and plpage().  Inserted defines to translate from the latter in case
 * someone actually uses them.  Fixed prototype for plcpstrm().
 *
 * Revision 1.31  1993/08/05  22:35:19  mjl
 * Eliminated prototypes for nonexistant functions.
 *
 * Revision 1.30  1993/08/03  01:46:49  mjl
 * Changes to eliminate warnings when compiling with gcc -Wall.
 *
 * Revision 1.29  1993/07/31  08:09:18  mjl
 * Cleaned up a bit.
 *
 * Revision 1.28  1993/07/16  22:28:09  mjl
 * Added prototypes for driver interface functions, new plshade function,
 * plgFileDevs (for retrieving file device list) function.  Simplified PLKey
 * definition by removing attribute info (not really necessary).
 *
 * Revision 1.27  1993/07/02  07:23:35  mjl
 * Now holds only those symbols absolutely needed by applications to use
 * PLPLOT.  Includes typedefs and function prototypes, maybe an occaisional
 * macro only.  _POSIX_SOURCE no longer defined here!
 *
 * Revision 1.26  1993/05/08  16:08:30  mjl
 * Bumped version number to 4.99d, but the 4.99d release won't happen for
 * some time yet.
 *
 * Revision 1.25  1993/04/26  20:00:53  mjl
 * Configuration info added for a DEC Alpha-based machine running OSF/1.
 *
 * Revision 1.24  1993/03/28  08:45:05  mjl
 * Added support for NEC SX-3.  Also moved determination of stub name handling
 * to plstubs.h (more appropriate).

plcore.h:
 * Revision 1.14  1993/10/18  19:42:06  mjl
 * Driver vectors for Borland C driver under DOS.
 *
 * Revision 1.13  1993/09/08  02:34:13  mjl
 * Added static function prototype for calc_dimap.
 *
 * Revision 1.12  1993/08/18  19:07:03  mjl
 * Fixed function prototype.
 *
 * Revision 1.11  1993/08/03  03:26:52  mjl
 * Additions to support new MGR and LinuxVGA drivers.
 *
 * Revision 1.9  1993/07/28  05:49:10  mjl
 * Modified table entries for xterm driver, added new ones for tek4107
 * terminal & file driver.
 *
 * Revision 1.8  1993/07/16  22:26:14  mjl
 * Added explicit support for color vs monochrome postscript output,
 * arrays and constant definitions used in driver interface.
 *
 * Revision 1.7  1993/07/02  07:22:14  mjl
 * Namespace changes.
 *
 * Revision 1.6  1993/04/26  20:00:10  mjl
 * The beginnings of a TK driver added.

pdf.h:
 * Revision 1.5  1993/07/02  07:21:41  mjl
 * All PDF routines now start with "pdf_".

metadefs.h:
 * Revision 1.8  1993/08/09  22:16:39  mjl
 * Miscellaneous cleaning up.
 *
 * Revision 1.7  1993/07/31  08:08:40  mjl
 * Added macro CHANGE_STATE for new state driver function.
 *
 * Revision 1.6  1993/07/02  07:21:12  mjl
 * Added header definitions for use by TK driver.  Also new macros for plplot
 * bop/eop commands.

drivers.h:
 * Revision 1.11  1993/10/18  19:41:49  mjl
 * Prototypes for Borland C driver under DOS.
 *
 * Revision 1.10  1993/08/03  03:26:51  mjl
 * Additions to support new MGR and LinuxVGA drivers.
 *
 * Revision 1.8  1993/07/28  05:48:24  mjl
 * Removed unnecessary function prototypes for old xterm driver, added new
 * ones for tek4107 terminal & file driver.
 *
 * Revision 1.7  1993/07/16  22:25:12  mjl
 * Added explicit support for color vs monochrome postscript output.
 *
 * Revision 1.6  1993/07/02  07:19:58  mjl
 * Changed over to new namespace.
 *
 * Revision 1.5  1993/04/26  20:00:09  mjl
 * The beginnings of a TK driver added.

-----------------------------------------------------------------------------
UTILITIES:
-----------------------------------------------------------------------------
pltek.c:
 * Revision 1.4  1993/07/17  00:30:03  mjl
 * Eliminated extraneous file open.

plrender.c:
 * Revision 1.33  1993/08/28  06:39:14  mjl
 * Option table and handlers modified to include & accept new client data
 * pointer.
 *
 * Revision 1.32  1993/08/21  20:52:55  mjl
 * Deleted old argument handling for -jx, -jy, and -mar, since these are
 * now handled by plplot itself through the driver interface.
 *
 * Revision 1.31  1993/08/18  19:12:58  mjl
 * Minor fixes.
 *
 * Revision 1.30  1993/08/13  04:42:52  mjl
 * A wild and maddening rework of the page seeking facility.  The "last bugs"
 * proved amazingly difficult to stomp out.  These turned up during tests
 * over a medium-speed network link (unobservable when running locally).  I
 * hope its really right now, because I'd just as soon never look at that
 * piece of code again.
 *
 * Revision 1.29  1993/08/11  19:29:27  mjl
 * Updated command line parsing utils to work better with the new command
 * line utils, especially as regards invisible options.  Fixed a rarely
 * encountered bug in seeking.
 *
 * Revision 1.28  1993/08/09  22:15:11  mjl
 * Eliminated all vestiges of old clr/page syntax, in favor of eop/bop.
 *
 * Revision 1.27  1993/08/03  01:47:04  mjl
 * Changes to eliminate warnings when compiling with gcc -Wall.
 *
 * Revision 1.26  1993/07/31  08:20:53  mjl
 * Removed code that is now handled in the driver interface, also changes
 * to reflect new driver functions.
 *
 * Revision 1.25  1993/07/16  22:20:18  mjl
 * Eliminated obsolete flags and processing of metafile tags (still read for
 * backward compatibility).  To be replaced by operations in the driver
 * interface.
 *
 * Revision 1.24  1993/07/02  07:19:21  mjl
 * Changed over to new namespace, new options parser.  Some options handlers
 * removed (no longer necessary).
 *
 * Revision 1.23  1993/04/26  19:58:03  mjl
 * Fixes to allow (once again) output to stdout and plrender to function as
 * a filter.  A type flag was added to handle file vs stream differences.

-----------------------------------------------------------------------------
OTHER:
-----------------------------------------------------------------------------
tarup	Archive scripts.  Renamed to be more generic.  Updated to work
zipup	with current file organization.
zooup

configure	/bin/sh script for configuring build

Subdirectories added:

drivers/tk	for Tcl/TK driver

scripts		holds utility scripts (right now only plpr, for
		Tcl/TK driver)

m4		for m4 configuration files

dos/bgi		files for DOS/Borland environment




*****************************************************************************
PLPLOT 4.99c changes
*****************************************************************************

o Added capability to have viewports greater than the display area.  In
this case the display becomes a window into the plot (i.e. the plot is
magnified).  The -mar, -jx, and -jy options of plrender were modified
to allow use of this.  Namely, specifying a negative argument for -mar
will enlarge the plot.  A "-mar -1 -jx 0 -jy 0" will result in the lower
left hand corner being plotted.  Probably -mar will be dropped from future
versions of plrender in favor of a more descriptive flag like "scl" (which
will have the opposite effect as mar).  In a GUI driver this will be
handled more naturally through zoom and pan menu/mouse operations.

o Added "install" target to makefile for installing into /usr/local/plplot.
See sys/unix/README.unix for more details.

o Eliminated SWITCH_TO_TEXT and SWITCH_TO_GRAPH metafile commands from both
driver and renderer.  These are really not necessary when a metafile is
being used and can be aggravating when using the xterm driver.  

o Added support for NEC SX-3 supercomputer, other minor fixes.

o Fixed name conflict for getdate() in ps.c on some systems.

*****************************************************************************
PLPLOT 4.99b changes
*****************************************************************************

A rather minor update, and the last one for a few weeks probably (I have
other committments). 

o Plrender now does page forward/backward operations immediately, for drivers
that can process the keystroke in a non-blocking fashion (for now only xwin
and amiga screen drivers).  This way the user can skip forward/backward at an
arbitrary speed if looking for a particular plot, without having to wait
for each page to actually finish plotting.

o Drivers _clear/_page commands all changed to _eop/_bop (end of page,
beginning of page), since that more accurately reflects what's going on now.
Interactive drivers needed their screen clear moved to the _bop function to
make the above-mentioned enhancement of plrender work.

o Amiga drivers partially finished.  Screen driver has been reconstructed
using capabilities of Amiga 2.0 OS, and is much improved.  Some menu options
as of yet unimplemented.  Other drivers (printer, IFF) still need some work.


*****************************************************************************
PLPLOT 4.99a changes
*****************************************************************************

-----------------------------------
Plrender
-----------------------------------

 * Inserted a hack for old metafiles with bad linewidth commands (WIDTH
 * commands in the body of the metafile are now ignored for metafiles version
 * 1993a and older).  WIDTH commands prior to the INIT on old metafiles are
 * still honored.
 *
 * Changed orient-setting code to switch on the basis of orient%2 and orient%4,
 * so that any value of orient gives valid output.
 *
 * Changed to a fatal error when unrecognized metafile input is encountered.
 *
 * Converted to new plplot command-line handling functions, resulting in a
 * considerable reduction in the amount of actual code.  Miscellaneous bugs
 * in file seeking fixed.  Extraneous page printed on a -p command
 * eliminated.  Many other small improvements.
 *
 * Support for polylines (even converts connected lines while reading into
 * polylines for better response), new color model support, event handler
 * support.  New events recognized allow seeking to arbitrary locations in
 * the file (absolute or relative), and backward.  Some old capabilities (no
 * longer useful) eliminated.  
 * 
 * Seeking: when using an appropriate output driver (e.g. xwin), user
 * keyboard input results in the following:
 *
 * <Backspace>	|
 * <Delete>	| Back page
 * <Page up>	|
 *
 * +<num><CR>	Seek forward <num> pages.
 * -<num><CR>	Seek backward <num> pages.
 *
 * <num><CR>	Seek to page <num>.
 *
 * Both <BS> and <DEL> are recognized for a back-page since the target
 * system may use either as its erase key.  <Page Up> is present on some
 * keyboards (different from keypad key).  Note that <Page Down> and
 * <Return> are recognized by the driver itself to advance the page.
 *
 * Illegal input is ignored.  When using the xterm driver, <backspace>,
 * <delete>, <page up>, <page down> either are ignored or don't function
 * properly.
 *
 * Fixed orientation code, previously it rotated plot in the wrong direction.
 *
 * Gave plrender an ID tag.

-----------------------------------
Main sources
-----------------------------------

ALL CODE:

 * Massive reorganization and clean up.  Main source code now isolated to
 * about two dozen files.  Routines of similar function are stored in the
 * same file, e.g. all routines to create viewports are now in plvpor.c.
 * All support for non-ANSI (K&R) C compilers removed!  


Additional changes, listed by file: 

 * scstubs.c:
 * Converted to string-integer equivalence method for C-Fortran string
 * passing.


 * sccont.c:
 * New front-end for contours from fortran.  Does amazingly little work now,
 * just defines an appropriate function evaluator and coordinate transformers
 * and calls the main contour function.


 * plwind.c:
 * Now holds all routines dealing with window specification.


 * plvpor.c:
 * Now holds all routines dealing with viewport generation.


 * pltick.c:
 * Now holds all functions dealing with tick generation, including error
 * bars.


 * plsym.c:
 * Now holds all routines dealing with PLPLOT symbols.


 * plstring.c:
 * Added to hold all functions that deal with PLPLOT strings.
 * Split off code to write a stroke font character into its own function for
 * clarity.  Changed character-decoding routine to use stream-dependent escape
 * character in text strings.


 * plstream.c:
 * Added to hold functions that primarily deal with manipulation of stream
 * quantities, through a pointer to a stream passed as an argument.  You may
 * also think of it as a driver utility library.  Eliminated negative
 * orientations.  Changed orient-setting code to switch on the basis of
 * orient%4, so that any value of orient give valid output.


 * plsdef.c:
 * Holds functions that modify plplot defaults.  These do not need direct
 * access to the stream data.  Changed references in error messages from
 * plstar to plinit.  Also changed behavior of size-setting routines (should
 * not affect user code).  Fixed data structure initializers to be
 * ANSI-conformant.


 * plpage.c:
 * Now holds all page-related functions.
 * Changed references in error messages from plstar to plinit.  Also changed
 * pladv to call grclr and grpage (instead of gradv, now gone).


 * plot3d.c:
 * Now holds all routines dealing with 3d plots (and hence has become rather
 * large).  A capability similar to that in the contour plotter (passing
 * in function evaluators instead of 2d arrays) is planned but not in this
 * version.


 * plline.c:
 * Now holds all routines dealing with line draws, including clipping and
 * dashed line support.  Polyline capability added.


 * plfont.c:
 * Added support for device-independent font files.


 * plfill.c:
 * Now holds all routines dealing with fills.


 * plcvt.c:
 * File for holding coordinate transformers (was: convert.c).


 * plctrl.c:
 * Added for the high level routines that don't result in something being
 * plotted ("control" routines) that don't need direct access to the stream
 * or dispatch table data.  Eliminated plbeg: it is now illegal to specify
 * the device by device number.


 * plcore.c:
 * Holds "core" routines -- includes routines from what was base.c, plstar.c,
 * some others.  The stream data and dispatch table are now local to this
 * file only.  Also added support for new color model, polyline support.
 * Added plscolbg() to modify background color.  Added plgver() for
 * retrieving plplot library version.  Eliminated gradv driver function.
 * Completely rewrote initialization routines.  Now plstar and plstart are
 * merely front-ends to plinit, which does all the initialization.  Added
 * plsdev for setting the device name, and plssub for setting the subpages.
 * Added plgpls for getting the current pls pointer, for offloading
 * stream-dependent code into other files.  Added plsesc/plgesc for
 * setting/getting the escape character for text strings (can be any of
 * [!#$%&*@^~], brackets not included).  Put in some checks for routines that
 * set family file parameters.  Eliminated some unused routines.  Added
 * plflush() function.


 * plcont.c:
 * Now holds all contouring routines.  The multiple contour functions have
 * been removed, since now a function is passed in instead of an array.
 * Through use of a suitable function evaluator and array evaluator, the same
 * contouring code can now be used from Fortran (with no transpose
 * necessary), C with C-like 2d arrays, C with 2d arrays stored as 1d, etc.
 * Replaced (void *) declaration for user data structures to (PLPointer), in
 * the spirit of Xt's XtPointer.  It was hoped that this would eliminate
 * certain warnings having to do with alignment (only showing up with all
 * warnings turned on), but it didn't.


 * plbox.c:
 * Now holds all box-related routines.


 * plargs.c:
 * Added code to parse command line arguments.  Accepts a data structure with
 * argument specification, syntax, description, mode flag, and function
 * handler (called if option is found).  Usable both to parse plplot command
 * flags and user command flags.  The latter is facilitated by input of user
 * routines to handle usage and help messages.  The plplot command line
 * parser removes all arguments it recognizes, allowing the user to detect
 * invalid input.  See plrender.c for a working example of usage of the case
 * of user command flags; the simpler case with no user command flags is
 * illustrated by any of the (C) example programs.  Changed the -bg flag to
 * accept a full-color argument in the form -bg rrggbb, with rr, gg, bb
 * corresponding to the background RGB values in hex.  Example: -bg FFFF00 to
 * get a yellow background.


 * plstubs.h:
 * Reduced stub routine definition to ONE set of defines through a clever
 * macro, FNAME.  Will work in principle for all systems.


-----------------------------------
Header Files
-----------------------------------

 * plstream.h:
 * Added to hold definition of PLStream data structure.  Included by all
 * files dealing with streams (and is included by driver.h).  Added to the
 * stream data structure: a device name, and the value of the escape
 * character.  Added function prototype for plgpls and some minor
 * documentation changes.


 * plplotio.h:
 * Added to handle any data structure definitions or function prototypes that
 * need access to stdio.h, so that plplot.h could remain free of this.


 * plplot.h:
 * Elimination of many function prototypes (and a few added), caused by many
 * routines becoming static in reorganization.  Added support data structures
 * and constant definitions for plplot options handling code.  Added function
 * prototypes for new functions and deleted a couple.  Eliminated case of
 * VOID == char since that should never be necessary with ANSI C.


 * plevent.h:
 * This file added for inclusion by all user-defined event handlers to be
 * used with plplot.  It contains constant definitions used to transmit
 * info on the event that occurred (e.g. keystroke definitions).


 * plcore.h:
 * Added this file for inclusion only by plcore.c.  It declares the plstream
 * data structure, and defines, declares, and initializes the dispatch
 * table data structure.


 * pdf.h:
 * Added prototypes for functions that support polyline read/writes.


 * metadefs.h:
 * Added support for polylines and new color model.  Changed PLPLOT_HEADER
 * and PLPLOT_VERSION to PLMETA_HEADER and PLMETA_VERSION so that plplot
 * could have its own distinct version number.


 * drivers.h:
 * Added this file for inclusion by all drivers, in lieu of what was
 * previously dispatch.h.  This now has only driver prototypes -- NO data
 * structure declarations.  Eliminated references to the xxx_adv (gradv)
 * driver functions.


-----------------------------------
Drivers
-----------------------------------

ALL DRIVERS:

 * All device coordinates are now expected to fit into a 16 bit address space
 * (reasonable, and good for performance).

 * Eliminated the gradv() driver calls, as these were made obsolete by
 * recent changes to plmeta and plrender.  Also eliminated page clear commands
 * from grtidy() -- plend now calls grclr() and grtidy() explicitly.

 * Changes to support new color model, polylines, and event handler support
 * (interactive devices only).  Type flag added to device definition to
 * indicate file-based or interactive.

 * Fixed orientation operation in several files and standardized certain
 * startup operations. Fixed bugs in various drivers.

 * Dummy function added for each non-active driver to eliminate warnings.


Additional changes, listed by file: 

 * xwin.c:
 * Fixed background color setting, for color and grayscale monitors.
 * Eliminated all multiple extraneous exposures during uncover or resize
 * operations.  The X driver refresh/resize works perfectly now as far as I
 * can tell.  Added refresh & resize capability.  Also reorganized
 * substantially, to be more along the lines of the new Motif driver.  Code
 * is about 2-3x more logical and flexible now.  Some operations are slower
 * now (e.g. dashed lines) because of the large virtual address space used
 * now.  Changed cursor to cross-hair for more accurate location retrieval
 * Added crude support to have mouse button 2 return cursor postition to
 * stdout.  Swapped background/foreground colors for monochrome X output.


 * xterm.c:
 * Fixed some long-standing bugs in switching between text and graphics
 * windows (didn't affect xterms, but did affect certain vt100/tek
 * emulators).


 * ps.c:
 * Eliminated the (atend) specification for BoundingBox, since this isn't
 * recognized by some programs; instead enough space is left for it and a
 * rewind and subsequent write is done from ps_tidy().  Familying is no
 * longer directly supported by the PS driver as a result.  The output done
 * by the @end function was eliminated to reduce aggravation when viewing
 * with ghostview.


 * plmeta.c:
 * Now writes out page offsets to metafile for seeking forward/backward
 * by plrender.


 * ljii.c:
 * Actually works now.


 * plbuf.c:
 * Routines for writing to and reading from a plot buffer, as well as
 * recreating an entire plot.  The driver need merely specify
 * pls->plbuf_enable = 1 for it to be used (it must of course handle the
 * expose/resize events itself).


 * null.c:
 * Null device driver, for use when you want the graphics to disappear into
 * the bit bucket.  Always appears as the last device.


-----------------------------------
Example programs
-----------------------------------

 * Added #include <stdlib.h> since the code needs to exit(1) on some errors.
 * Changed all C examples to initialize with new plinit() function, also
 * calls to PLPLOT command-line args parser added.  


-----------------------------------
Miscellaneous
-----------------------------------

Support for VMS has been suspended (perhaps permanently), since we don't use
it anymore and it's too much of a pain to support.  If anyone fixes the
makefile and verifies the package does work, however, we will include your
fixes with the release version.


*****************************************************************************
PLPLOT 4.0 changes
*****************************************************************************

Here are the biggest changes that have been made to PLPLOT, especially
those likely to affect the user.  Please see the PLPLOT docs for more
information. 

Some of the changes stem from the direction we want to take PLPLOT.  For
example, away from device dependence and use the metafile driver as our
main target.  This probably means offloading more intelligence into the
drivers in the future. 

Also, some very small files have been consolidated in order to speed
compilation and keep related routines together.


Changes from the 3.x strain by M. LeBrun
----------------------------------------

This version came originally from PLPLOT 2.6b.  In accomodating
the changes made in 3.0 (Tony's version), I had to break a few calls.
Namely, the following routines now have a different call syntax:

	plsxax plsyax plszax
	plgxax plgyax plgzax
	plmesh
	plot3d

Please see the documentation for the proper calls.  

You can now specify the argument types to PLPLOT calls in the more
generic fashion INT and FLOAT.

There have also been some new functions added and improvements made to
plrender. 


Major changes from PLPLOT 3.0.
------------------------------

The PLPLOT <-> driver interface completely rewritten.  Now a pointer
to a data structure containing all the PLPLOT "state" information for
a given data stream is passed into the driver.

Several new capabilities were added to the drivers.  This includes:

	aspect ratio scaling (see below)
	family files
	escape function
	multiple output streams

New drivers include:
	X-window
	metafile

Utilities:
	plrender	renders metafiles
	pltek		displays tektronix files

plrender has lots of options (see the docs).  In particular, the
family file output, margins, justification, and orientation flags
are fun to play with.
------------------------------------------------------------------------
A multiple output stream capability has been added.  The default
stream number is 0.  To start a new stream, call plsstrm(#) with #
set to stream number, then call plstar or plstart.  After that,
you can use this routine to switch between streams (simultaneous
plotting is not done).

------------------------------------------------------------------------
The character, sym, and tick mark lengths are no longer specified in
terms of the actual physical page dimensions by default, rather, a
virtual page size of 238 x 180 mm is used (not actual mm).  This is
to ensure the ratio of sym size and box length is independent of output
device.  For the old method of scaling, you can change back with
the call plspsc(1). (set physical scaling)

------------------------------------------------------------------------
There is a new function for specifying viewport with a given aspect
ratio -- plvpas().  This is sort of a combination of plvasp() and
plvpor(), in that you specify the corners (like plvpor) and the aspect
ratio.  The biggest box that fits within your specified box with the
given aspect ratio will be used.  Makes plvasp() and plvpor() (and plsvpa
to some extent) virtually obsolete.

------------------------------------------------------------------------
I implemented a function plsasp(aspect) to do global aspect ratio
scaling.  This never quite worked out the way I planned, and now I
recommend using plvpas instead.  I may still make plsasp() useful
in the future.

------------------------------------------------------------------------
Put in an 'escape' function in all the drivers.  I really just wanted to
add a new function to set the colors on the basis of rgb inputs.  But I
realized I'd be wanting to add support for raster operations in the future
to both the X and Amiga drivers, but no other ones.  Since it's a pain
adding a new function (even if a stub) to all the drivers and dispatch.c,
etc, I figured the escape function would be good.  You pass in the op-code
and a pointer to whatever data you want passed.

------------------------------------------------------------------------
The plcwin() and plgwin() calls are no longer supported.  Use pltext()
and plgra() instead.

------------------------------------------------------------------------
The pleop() and plbop() calls are no longer supported.  Use plclr()
and plpage() instead.

------------------------------------------------------------------------
plorient() and plselect() are no longer supported.  Use plsori(),
plsfnam(), plsfile() instead.

------------------------------------------------------------------------
Some new functions to set color, plrgb() and plhls().  The latter converts
color in hls values to rgb.  plrgb calls the gresc() function mentioned
above, and plhls() calls plrgb().  Also you can allocate a named color
(only works with X interface right now) with the plancol() routine.

------------------------------------------------------------------------
Put in family file support.  There is an option now to create a family of
files with each roughly of a given size.  Also each file is a complete
stand alone, and plrender can read a whole family like it is a single
logical file, and create a single output file or family output file. 

There are two new routines, plsfam() and plgfam(), for setting/getting
the parameters governing creation of family file sets.

Also changes were required to all drivers that support familying.  As far
as plplot is concerned, it's still just a single logical file.  The only
drivers I've put the familying into are the ps, tekf, and plmeta drivers.

------------------------------------------------------------------------
The ANSI/non-ANSI behavior of PLPLOT has changed again.  Now you need
to include plplot.h into your program to make sure you get the argument
types right (i.e. for ANSI compiler, a FLOAT really passes as a FLOAT
not a double).  Face it, we've had an ANSI standard for C for about 4
years now and ISO for 2, and vendors who don't comply should be boycotted.

All PLPLOT routines that accept a FLOAT as an argument now use an ANSI
style function declaration if PLSTDC is defined, to bypass the K&R style
promotion.  Eventually support for non-Standard C compilers will be
dropped. 

The analogous problem with ints is discussed in the GNU CC manual, under
'Known Causes of Trouble with GNU CC':

*** begin quote ***

Users often think it is a bug when GNU CC reports an error for code like this: 

    int foo (short);

    int foo (x)
    short x;
    (...)

The error message is correct; this code really is erroneous, because the
old-style non-prototype definition passes subword integers in their
promoted types.  In other words, the argument is really an int, not a
short.  The correct prototype is this:

    int foo (int);

*** end quote ***

------------------------------------------------------------------------
Some other magic being done in plplot.h includes redefinition of the
C-entry bindings (the installer can disable this but I don't recommend it). 
The point is that the C and Fortran namespaces on some systems clobber
each other, and there is no good solution except to change the C entry
names.  Each external call is prepended with a 'c_'.  So you must include
plplot.h and recompile any old programs that are to work with PLPLOT 4.0.

------------------------------------------------------------------------
Put in an alternate startup routine plstart(), that lets you specify device
name.  This makes the old plbeg() call obsolete.  See the pl_DevName entry
in the dispatch table (the second entry) for valid device names. 

------------------------------------------------------------------------
plfont.c:

Made font locating code to be much more intelligent, with 3 hardwired
locations, current directory, and $(HOME)/lib checked.  Locations
can be passed in from the makefile.

------------------------------------------------------------------------
plconf.c:

New, based on plcont.c and plcntr.c, for better Fortran interface.  Passes
grid arrays instead of function pointer for calculation of coordinate
transformation.  Also error handling changed. 

Also added fortran stub routines for the three new contour plotters: 

	plcon0 - simple contour plot, no transformation
	plcon1 - 1-d transformation, i.e. x(i), y(j).
	plcon2 - 2-d transformation, i.e. x(i,j), y(i,j)

as well as stub routines for plconf(), and three functions to handle
coordinate transformation (none, 1-d, 2-d).  Transformation functions
detect out-of-bounds coordinates and react intelligently (giving nearest
point and issuing a warning). 

------------------------------------------------------------------------
plccal.c:

  Improved interpolation algorithm to get rid of occasional contour crossing
  (especially for noisy data). 

------------------------------------------------------------------------
strtoint.f:

Changed string interface to be portable.  Each string is now a *char but
stored from fortran packed in an INTEGER*32.  The fortran stub packs the
string via 'strtoint', and the C routine unpacks via 'long_to_str'.

------------------------------------------------------------------------
System-independent makefile written in m4 for unix-like systems.  Compile
with m4 for desired system, e.g.

	m4 -DSUNOS makefile.m4 >makefile

Simplifies debugging & testing by creating symlinks between plplot/tmp and
all source & example files. 

------------------------------------------------------------------------
Reorganized directory structure.  New directories include:

docs/         examples/     fonts/        include/      lib/
src/          sys/          tmp/          utils/

Under src/, all source + directories stubc/ and stubf/.
Under sys/, amiga/  ctss/   dos/    os2/    unix/   vms/.
Under examples/, C/ and f77/.

So this way new systems can be supported without changing the top level dir
structure. 

