[comp.sources.amiga] v90i004: plplot 2.6 - C library for making scientific plots, Part03/12

Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator) (01/15/90)

Submitted-by: Anthony M. Richardson <amr@dukee.egr.duke.edu>
Posting-number: Volume 90, Issue 004
Archive-name: applications/plplot-2.6/part03

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 3 (of 12)."
# Contents:  drivers/README drivers/preferences.c examples/example01.c
#   include/dispatch.h include/plamiga.h lattice/Makefile.inc
#   lattice/make-all src/pldeco.c src/plenv.c src/plfontld.c
#   src/plgrid3.c src/plt3zz.c src/plw3d.c unix/Makefile unix/hp7470.c
#   unix/hp7580.c unix/xterm.c
# Wrapped by tadguy@xanth on Sun Jan 14 18:11:29 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'drivers/README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'drivers/README'\"
else
echo shar: Extracting \"'drivers/README'\" \(3273 characters\)
sed "s/^X//" >'drivers/README' <<'END_OF_FILE'
XMaking a new driver is pretty easy.  If you can write a C program that
Xcan draw a line on the given device, you can probably write a plplot
Xdriver for it.
X
XOverview
XThe best way to create a new driver is to start with one of the old ones.
XAt the minimum you will need to supply routines to (1) open/initialize the
Xdevice, (2) draw a line between two points on the device, and (3) close
Xthe device.  These three routines are discussed further below.
XAfter writing the routines you will need to update the dispatch table
X(dispatch.c) in the drivers directory.
X
XThe initialization routine.
X   This routine is of type void and takes no arguments. This routine
X   sets up the resolution and page size for plplot. It accomplishes this
X   by calling the following routines:
X
X   (1) setpxl(float x, float y)  
X       Set the resolution in dots per mm in the x and y directions.
X       example -- setpxl(40.,40.)    40 dots/mm or 1016 dpi
X
X   (2) setphy(int minx, int maxx, int miny, int maxy)
X       Set the min and max page coordinates for the device.  The values
X       passed to your line drawing routine will be within this range.
X       example -- setphy(0,10299,0,7649)
X
X   (3) scol(int color) 
X       Set default pen color.
X       example -- scol(1)
X       
X   (4) swid(int width)
X       Set default pen width.
X       example -- swid(1)
X
X   (5) smod(int mode)
X       Set/clear interactive device flag. If mode == 1 device is interactive
X       i.e. a terminal (plplot will wait for user input before clearing
X       the screen). If mode == 0 device is not interactive.
X       example -- smod(0) 
X
X    Portrait/landscape mode of plotting is set by the driver.  See the
X    supplied drivers for one method of doing this.  If you are writing
X    a new dirver you might want to ignore this for now (add it in later).
X
XThe line drawing routine
X    This should be of type void. It should draw a line between two points
X    It takes the following integer arguments
X       x1 - x coord of first point
X       y1 - y coord of first point
X       x2 - x coord of second point
X       y2 - y coord of second point
X    These will all be within the range specified by setphy() in the
X    initialization routine.
X
XThe close/tidy routine
X    This is of type void. It takes no arguments.  Use it to cleanup
X    and recover any allocated resources.
X
X
XUpdating the dispatch table
X    You'll need to update the dispatch table in dispatch.c.
X    Add the function declarations for your 3 driver routines to the
X    others near the top of the file. Update the dispatch table.
X    The first entry is a character string that is printed out in
X    the device selection menu.  The 4th entry should be the name
X    of your initialization routine. The 5th your line routine and the
X    8th your close/tidy routine.  All the others can be set to NULL
X    (You'll probably want to add these later).
X
X
XNote: I've noticed that the pattern fill routines mess up on low
Xresolution devices. I got around this by faking plplot into thinking
Xthat the device has high resolution by using setpxl() and setphy()
Xto make a high resolution virtual page.  I then scale down the values
XI receive in the line drawing routine before passing them on to the
Xdevice. An example of this is in the iff driver.
X
XTony
Xresolution 
END_OF_FILE
if test 3273 -ne `wc -c <'drivers/README'`; then
    echo shar: \"'drivers/README'\" unpacked with wrong size!
fi
# end of 'drivers/README'
fi
if test -f 'drivers/preferences.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'drivers/preferences.c'\"
else
echo shar: Extracting \"'drivers/preferences.c'\" \(3175 characters\)
sed "s/^X//" >'drivers/preferences.c' <<'END_OF_FILE'
X#include "plplot.h"
X#include <stdio.h>
X
Xstatic int orient, select=0, curwid;
Xstatic long bmapx, bmapy, bmapxmax, bmapymax, xdpi, ydpi;
Xstatic long dwidth, dheight;
X
Xvoid prefsetup(xddpi, yddpi, xwid, ywid)
XPLINT xwid, ywid;
XPLFLT xddpi, yddpi;
X{
X   /* Ignore these and use preferences data instead. */
X}
X
Xvoid prefselect(ori, name)
XPLINT ori;
Xchar *name;
X{
X   orient = ori;
X   select = 1;
X}
X
X/* Most of the code is in plsupport.c  where it is shared with the menu
X   selection printer dump. */
Xvoid prefinit()
X{
X   char line[10];
X   int mode, openprinter(), mapinit(), queryprint();
X   void closeprinter();
X
X   if(!select) {
X      printf("Landscape or portrait orientation? (0 or 1) ");
X      fgets(line,sizeof(line),stdin);
X      if(sscanf(line,"%d",&orient) != 1)
X         orient = 0;
X   }
X   select = 0;
X
X   if(openprinter()) plexit("");
X
X   mode = queryprint(&bmapx, &bmapy, &bmapxmax, &bmapymax, &xdpi, &ydpi);
X
X   /* If mode == 1 we want to adjust the bitmap size so that the aspect
X      ratio is maintained. */
X   if(mode) {
X      if((float)bmapxmax*bmapy > (float)bmapymax*bmapx)
X         bmapy = (int)(((float)bmapx*bmapymax)/bmapxmax + .5);
X      else
X         bmapx = (int)(((float)bmapy*bmapxmax)/bmapymax + .5);
X   }
X
X   /* Leave a little space for pen width. */
X   dwidth = bmapx - 2;
X   dheight = bmapy - 2;
X
X   if(!orient) {
X      setpxl((PLFLT)(ydpi/25.4), (PLFLT)(xdpi/25.4));
X      setphy(0,bmapymax,0,bmapxmax);
X   }
X   else {
X      setpxl((PLFLT)(xdpi/25.4), (PLFLT)(ydpi/25.4));
X      setphy(0,bmapxmax,0,bmapymax);
X   }
X
X   scol(1);
X   swid(1);
X   smod(0);
X
X   /* Allocate bitmap and initial for line drawing */
X   if(mapinit(bmapx, bmapy)) {
X      closeprinter();
X      plexit("");
X   }
X}
X
Xvoid preftext()
X{
X}
X
Xvoid prefgraph()
X{
X}
X
Xvoid prefclear()
X{
X   void ejectpage(), dmpport();
X
X   dmpport(0L,bmapx,bmapy);
X   /* Eject the page. */
X   ejectpage();
X}
X
Xvoid prefpage()
X{
X   void mapclear();
X
X   mapclear();
X}
X
Xvoid prefwidth(width)
XPLINT width;
X{
X   if(width < 1)
X      curwid = 1;
X   else if(width > 3)
X      curwid = 3;
X   else
X      curwid = width;
X}
X
Xvoid prefcolor(color)
XPLINT color;
X{
X}
X
Xvoid prefline(x1,y1,x2,y2)
XPLINT x1, y1, x2, y2;
X{
X   long xn1, yn1, xn2, yn2;
X   void mapline();
X
X   if(!orient) {
X      xn1 = (x1*dheight)/bmapymax;
X      yn1 = (y1*dwidth)/bmapxmax;
X      xn2 = (x2*dheight)/bmapymax;
X      yn2 = (y2*dwidth)/bmapxmax;
X      switch(curwid) {
X         case 3:
X            mapline(yn1,xn1,yn2,xn2);
X         case 2:
X            mapline(yn1+2,xn1+2,yn2+2,xn2+2);
X         case 1:
X         default:
X            mapline(yn1+1,xn1+1,yn2+1,xn2+1);
X      }
X   }
X   else {
X      xn1 = (x1*dwidth)/bmapxmax;
X      yn1 = (y1*dheight)/bmapymax;
X      xn2 = (x2*dwidth)/bmapxmax;
X      yn2 = (y2*dheight)/bmapymax;
X      switch(curwid) {
X         case 3:
X            mapline(xn1,dheight-yn1,xn2,dheight-yn2);
X         case 2:
X            mapline(xn1+2,dheight-yn1+2,xn2+2,dheight-yn2+2);
X         case 1:
X         default:
X            mapline(xn1+1,dheight-yn1+1,xn2+1,dheight-yn2+1);
X      }
X   }
X}
X
Xvoid preftidy()
X{
X   void dmpport(), mapfree(), closeprinter();
X
X   dmpport(0L,bmapx,bmapy);
X   mapfree();
X   closeprinter();
X}
END_OF_FILE
if test 3175 -ne `wc -c <'drivers/preferences.c'`; then
    echo shar: \"'drivers/preferences.c'\" unpacked with wrong size!
fi
# end of 'drivers/preferences.c'
fi
if test -f 'examples/example01.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'examples/example01.c'\"
else
echo shar: Extracting \"'examples/example01.c'\" \(2726 characters\)
sed "s/^X//" >'examples/example01.c' <<'END_OF_FILE'
X/* Demonstration program for PLPLOT: */
X
X/* Plots three simple functions, each function occupies a separate page */
X
X#include "plplot.h"
X#include <stdio.h>
X#include <math.h>
X
Xstatic PLFLT xs[6] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
Xstatic PLFLT ys[6] = {1.0, 4.0, 9.0, 16.0, 25.0, 36.0};
X
Xmain()
X{
X  /* Declare these static to reduce required stack size */
X  static PLFLT x[101], y[101];
X  PLINT space0 = 0, mark0 = 0, space1 = 1500, mark1 =1500;
X
X  PLINT i;
X
X  /* Ask user to specify the output device */
X  plstar(1,1);
X
X  /* Set up the viewport and window using PLENV. The range in X is */
X  /* 0.0 to 6.0, and the range in Y is 0.0 to 30.0. The axes are */
X  /* scaled separately (just = 0), and we just draw a labelled */
X  /* box (axis = 0). */
X
X  plenv((PLFLT)0.0,(PLFLT)6.0,(PLFLT)0.0,(PLFLT)30.0,0,0);
X  plcol(2);
X  pllab("(x)","(y)","#frPLPLOT Example 1 - y=x#u2");
X
X  /* Plot the data points */
X
X  plcol(3);
X  plpoin(6,xs,ys,9);
X
X  for (i=0; i<60; i++) {
X     x[i]=0.1*(i+1);
X     y[i]= pow(x[i],2.);
X  }
X
X  /* Draw the line through the data */
X
X  plcol(4);
X  plline(60,x,y);
X
X  /*===============================================================*/
X
X  /* Set up the viewport and window using PLENV. The range in X is
X     -2.0 to 10.0, and the range in Y is -0.4 to 2.0. The axes are
X     scaled separately (just = 0), and we draw a box with axes
X     (axis = 1). */
X
X  plcol(1);
X  plenv((PLFLT)-2.0,(PLFLT)10.0,(PLFLT)-0.4,(PLFLT)1.2,0,1);
X  plcol(2);
X  pllab("(x)","sin(x)/x","#frPLPLOT Example 1 - Sinc Function");
X
X  /* Fill up the arrays */
X
X  for (i=0; i<100; i++) {
X     x[i] = (i-19.0)/6.0;
X     y[i] = 1.0;
X     if (x[i] != 0.0) y[i] = sin(x[i])/x[i];
X  }
X
X  /* Draw the line */
X
X  plcol(3);
X  plline(100,x,y);
X
X  /*===============================================================*/
X
X  /* For the final graph we wish to override the default tick intervals,
X     and so do not use PLENV */
X
X  pladv(0);
X
X  /* Use standard viewport, and define X range from 0 to 360 degrees,
X     Y range from -1.2 to 1.2. */
X
X  plvsta();
X  plwind((PLFLT)0.0,(PLFLT)360.0,(PLFLT)-1.2,(PLFLT)1.2);
X
X  /* Draw a box with ticks spaced 30 degrees apart in X, and 0.2 in Y. */
X
X  plcol(1);
X  plbox("bcnst",(PLFLT)30.0,3,"bcnstv",(PLFLT)0.2,2);
X
X  /* Superimpose a dashed line grid, with 1.5 mm marks and spaces.
X     plstyl expects a pointer!! */
X
X  plstyl(1,&mark1,&space1);
X  plcol(2);
X  plbox("g",(PLFLT)30.0,3,"g",(PLFLT)0.2,2);
X  plstyl(0,&mark0,&space0);
X
X  plcol(3);
X  pllab("Angle (degrees)","sine","#frPLPLOT Example 1 - Sine function");
X
X  for (i=0; i<101; i++ ) {
X     x[i] = 3.6 * i;
X     y[i] = sin(x[i]*3.141592654/180.0);
X  }
X
X  plcol(4);
X  plline(101,x,y);
X
X  /* Don't forget to call PLEND to finish off! */
X
X  plend();
X}
END_OF_FILE
if test 2726 -ne `wc -c <'examples/example01.c'`; then
    echo shar: \"'examples/example01.c'\" unpacked with wrong size!
fi
# end of 'examples/example01.c'
fi
if test -f 'include/dispatch.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/dispatch.h'\"
else
echo shar: Extracting \"'include/dispatch.h'\" \(2848 characters\)
sed "s/^X//" >'include/dispatch.h' <<'END_OF_FILE'
X/* Declare structure containing pointers to device dependent functions. */
X
X/* pl_MenuStr : Pointer to string that is printed in device menu. */
X/* pl_setup   : Use this routine to set orientation, x and y  resolution
X *              (dots/mm)  and x and y page widths. Some device drivers
X *              may  choose to ignore any or all of these. A call to
X *              this routine is optional! If a particular driver requires
X *              any of these parameters and they are not set by a call to
X *              pl_setup() then they should be prompted for in pl_init().
X *              The user may call this routine only once and it is called
X *              before plstar() or plbeg(). */
X/* pl_file    : Set graphics storage file name. This routine is also
X *              optional. If a device requires a file for storage, the
X *              file name should be prompted for if this routine is not
X *              used. This routine may be called before plstar(), plbeg(),
X *              plenv(), or pladv(). This routine does NOT open the file. */
X/* pl_init    : Initialize device.  This routine may also prompt the user
X *              for certain device parameters or open a graphics file (see
X *               note). Called only once to set things up. */
X/* pl_line    : Draws a line between two points. */
X/* pl_clear   : Clears screen or ejects page or closes file (see note). */
X/* pl_page    : Set up for plotting on a new page. May also open a new
X *              a new graphics file (see note). */
X/* pl_tidy    : Tidy up. May close graphics file (see note). */
X/* pl_color   : Change pen color. */
X/* pl_text    : Switch device to text mode. */
X/* pl_graph   : Switch device to graphics mode. */
X/* pl_width   : Set graphics pen width. */
X
X/* NOTE: Some devices allow multi-page plots to be stored in a single *
X *       graphics file, in which case the graphics file should be opened *
X *       in the pl_init() routine and closed in pl_tidy(). If multi-page *
X *       plots need to be stored in different files then pl_page() should *
X *       open the file and pl_clear() should close it. Do NOT open files *
X *       in both pl_init() and pl_page() or close files in both pl_clear() *
X *       and pl_tidy() */
X
Xstruct dispatch_table {
X   char *pl_MenuStr;
X   void (*pl_setup) PLARGS((PLFLT xdpi, PLFLT ydpi, PLINT xwid, PLINT ywid));
X   void (*pl_select) PLARGS((PLINT orient, char *filename));
X   void (*pl_init) PLARGS((void));
X   void (*pl_line) PLARGS((PLINT x1, PLINT y1, PLINT x2, PLINT y2));
X   void (*pl_clear) PLARGS((void));
X   void (*pl_page) PLARGS((void));
X   void (*pl_tidy) PLARGS((void));
X   void (*pl_color) PLARGS((PLINT color));
X   void (*pl_text) PLARGS((void));
X   void (*pl_graph) PLARGS((void));
X   void (*pl_width) PLARGS((PLINT width));
X};
X
Xtypedef struct dispatch_table  DISPATCH_TABLE;
END_OF_FILE
if test 2848 -ne `wc -c <'include/dispatch.h'`; then
    echo shar: \"'include/dispatch.h'\" unpacked with wrong size!
fi
# end of 'include/dispatch.h'
fi
if test -f 'include/plamiga.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'include/plamiga.h'\"
else
echo shar: Extracting \"'include/plamiga.h'\" \(3003 characters\)
sed "s/^X//" >'include/plamiga.h' <<'END_OF_FILE'
X#include <exec/types.h>
X#include <exec/ports.h>
X#include <exec/memory.h>
X#include <devices/printer.h>
X#include <devices/prtbase.h>
X#include <graphics/display.h>
X#include <graphics/gfxbase.h>
X#include <graphics/view.h>
X#include <graphics/gfxmacros.h>
X#include <intuition/intuition.h>
X#include <intuition/intuitionbase.h>
X#include <intuition/screens.h>
X
X/* Graphics data buffer file. */
X#define PLOTBFFR      "t:plplot.plt"
X
X#ifndef PLARGS
X  #ifdef LATTICE_50
X     #define PLARGS(a)   a
X  #else
X     #define PLARGS(a)   ()
X  #endif
X#endif
X
X#ifdef LATTICE_50
X   #include <proto/exec.h>
X   #include <proto/graphics.h>
X   #include <proto/intuition.h>
X   #include <proto/dos.h>
X#endif
X
X/* Flags for variables in PLPrefs structure. */
X/* WinType defines */
X#define PLCUST      01  /* Open on custom screen */
X#define PLASP       02  /* Maintain initial aspect */
X#define PLBUFF      04  /* Buffer plot in t:plplot.plt */
X
X/* ScrType defines */
X#define PLLACE      01
X#define PLHIRES     02
X
Xtypedef unsigned short USHORT;
X
Xstruct PLPrefs {
X   USHORT   WinType;
X   USHORT   ScrType;
X   USHORT   WXPos, WYPos;      /* Position of Window (WorkBench) */
X   USHORT   WWidth, WHeight;   /* Window width, height (WorkBench) */
X   USHORT   CXPos, CYPos;      /* Position of Window (Custom) */
X   USHORT   CWidth, CHeight;   /* Window width, height (Custom) */
X   USHORT   Depth;             /* Screen Depth (1, 2, 3, 4) (Custom) */
X   USHORT   Color[16];         /* Color RGB values (Custom Only) */
X};
X
X/* Define graphics operation types */
X#define PENU  10
X#define PEND  20
X#define SPEN  30
X#define PWID  40
X
Xextern struct IntuitionBase *IntuitionBase;
Xextern struct GfxBase *GfxBase;
X
Xextern struct Screen *PLScreen;
Xextern struct Window *PLWindow;
Xextern struct RastPort *PLSRPort;      /* Screen rastport */
Xextern struct RastPort *PLWRPort;      /* Window rastport */
Xextern struct ViewPort *PLVPort;
Xextern struct ColorMap *PLCMap;
X
Xextern struct PLPrefs PLCurPrefs;
Xextern PLINT XOffset, YOffset, PLWidth, PLHeight;
Xextern PLINT InitPLWidth, InitPLHeight;
X
Xvoid OpenPLWind PLARGS((void));
Xvoid OpenLibs PLARGS((void));
Xvoid ClosePLWind PLARGS((void));
Xvoid CloseLibs PLARGS((void));
Xvoid GetPLDefs PLARGS((void));
Xvoid SetPLDefs PLARGS((void));
Xvoid setlimits PLARGS((void));
Xvoid plcolreq PLARGS((void));
Xvoid RestorePrefs PLARGS((void));
Xvoid setpen PLARGS((PLINT color));
Xvoid MakePLMenu PLARGS((void));
Xvoid enablemenus PLARGS((void));
Xvoid disablemenus PLARGS((void));
Xvoid menuselect PLARGS((ULONG class, USHORT code));
Xvoid eventwait PLARGS((void));
XPLINT eventhandler PLARGS((ULONG class, USHORT code));
XPLINT procmess PLARGS((void));
Xvoid remakeplot PLARGS((void));
Xvoid PLDraw PLARGS((PLINT x, PLINT y));
Xvoid PLMove PLARGS((PLINT x, PLINT y));
Xvoid prepupdate PLARGS((void));
Xint getpoint PLARGS((long *com, long *x, long *y));
Xvoid finiupdate PLARGS((void));
X
Xvoid screendump PLARGS((PLINT type));
Xvoid saveiff PLARGS((void));
Xvoid disablegads PLARGS((PLINT flag));
Xvoid enablegads PLARGS((void));
END_OF_FILE
if test 3003 -ne `wc -c <'include/plamiga.h'`; then
    echo shar: \"'include/plamiga.h'\" unpacked with wrong size!
fi
# end of 'include/plamiga.h'
fi
if test -f 'lattice/Makefile.inc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'lattice/Makefile.inc'\"
else
echo shar: Extracting \"'lattice/Makefile.inc'\" \(2886 characters\)
sed "s/^X//" >'lattice/Makefile.inc' <<'END_OF_FILE'
XODIR = ram:pltemp
XNLST = ram:plname.lst
XCFLG = -$(LFLGS) -i/include -O -o$(ODIR)/
X
XSRCS  =   /src/define.c \
X          /src/fcnvrt.c \
X          /src/genlin.c \
X          /src/global.c \
X          /src/icnvrt.c \
X          /src/movphy.c \
X          /src/movwor.c \
X          /src/pl3cut.c \
X          /src/plabv.c \
X          /src/pladv.c \
X          /src/plbeg.c \
X          /src/plbin.c \
X          /src/plbox.c \
X          /src/plbox3.c \
X          /src/plccal.c \
X          /src/plclr.c \
X          /src/plcntr.c \
X          /src/plcol.c \
X          /src/plcont.c \
X          /src/plcvec.c \
X          /src/pldeco.c \
X          /src/pldtik.c \
X          /src/plend.c \
X          /src/plenv.c \
X          /src/plerrx.c \
X          /src/plerry.c \
X          /src/plerx1.c \
X          /src/plery1.c \
X          /src/plexit.c \
X          /src/plfill.c \
X          /src/plfont.c \
X          /src/plfontld.c \
X          /src/plform.c \
X          /src/plgra.c \
X          /src/plgrid3.c \
X          /src/plgspa.c \
X          /src/plhist.c \
X          /src/plhrsh.c \
X          /src/pljoin.c \
X          /src/pllab.c \
X          /src/pllclp.c \
X          /src/plline.c \
X          /src/pllsty.c \
X          /src/plmesh.c \
X          /src/plmtex.c \
X          /src/plnxtv.c \
X          /src/plot3d.c \
X          /src/plpage.c \
X          /src/plpat.c \
X          /src/plpoi1.c \
X          /src/plpoin.c \
X          /src/plpsty.c \
X          /src/plptex.c \
X          /src/plr135.c \
X          /src/plr45.c \
X          /src/plschr.c \
X          /src/plside3.c \
X          /src/plsmaj.c \
X          /src/plsmin.c \
X          /src/plssym.c \
X          /src/plstar.c \
X          /src/plstik.c \
X          /src/plstr.c \
X          /src/plstrl.c \
X          /src/plstyl.c \
X          /src/plsvpa.c \
X          /src/plsym.c \
X          /src/plsym1.c \
X          /src/plt3zz.c \
X          /src/pltext.c \
X          /src/plvpor.c \
X          /src/plvsta.c \
X          /src/plw3d.c \
X          /src/plwid.c \
X          /src/plwind.c \
X          /src/plxtik.c \
X          /src/plxybx.c \
X          /src/plxytx.c \
X          /src/plytik.c \
X          /src/plzbx.c \
X          /src/plztx.c \
X          /src/setphy.c \
X          /src/setpxl.c \
X          /src/setsub.c \
X          /src/stindex.c \
X          /src/strpos.c \
X          /src/stsearch.c \
X          /src/xform.c
X
XAMGA  =   /Amiga/amiga.c \
X          /Amiga/plmenu.c \
X          /Amiga/plprefs.c \
X          /Amiga/plsupport.c \
X          /Amiga/plwindow.c
X
XDRVS  =   /drivers/aegis.c \
X          /drivers/dispatch.c \
X          /drivers/hpplot.c \
X          /drivers/iff.c \
X          /drivers/postscript.c \
X          /drivers/preferences.c \
X
X$(LIB): $(SRCS) $(DRVS) $(AMGA)
X    @makedir $(ODIR)
X    @lc $(CFLG) $?
X    @list > $(NLST) $(ODIR) lformat="~%s~%s"
X    @oml $@ r @$(NLST)
X    @delete $(ODIR) all quiet
X    @delete $(NLST) quiet
X
END_OF_FILE
if test 2886 -ne `wc -c <'lattice/Makefile.inc'`; then
    echo shar: \"'lattice/Makefile.inc'\" unpacked with wrong size!
fi
# end of 'lattice/Makefile.inc'
fi
if test -f 'lattice/make-all' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'lattice/make-all'\"
else
echo shar: Extracting \"'lattice/make-all'\" \(3196 characters\)
sed "s/^X//" >'lattice/make-all' <<'END_OF_FILE'
X.key lib
X.def lib "FFP"
X
X; This script makes the entire plplot library.  It should be invoked via
X; "execute make-all [FFP | IEEEF | IEEED]". If FFP (the default) is
X; specified then PLFLT is typedef'd to float and the fast floating point
X; math routines are to be used. If IEEEF then PLFLT is still typedef'd
X; to float but the IEEE math routines are to be used.  Finally if IEEED
X; is specified then PLFLT is double and the IEEE math routines are to be
X; used.
X
Xif not "<lib>" eq "FFP"
X   if not "<lib>" eq "IEEEF"
X      if not "<lib>" eq "IEEED"
X            echo "usage: execute make-all [FFP | IEEEF | IEEED]"
X            skip end
X      endif
X   endif
Xendif
X
X; Make the FFP library.
Xif "<lib>" eq "FFP"
X   ask "Are you sure you want to (re)make the complete FFP library? (y or n)"
X   if not warn
X      skip end
X   endif
X
X   if exists /pllibs/plpffp.lib
X      delete /pllibs/plpffp.lib
X   endif
X
X   cd /src
X   lmk LFLG1=-ff
X   list >ofiles #?.o lformat="%s"
X   oml /pllibs/plpffp.lib r @ofiles
X   delete ofiles
X
X   cd /drivers
X   lmk LFLG1=-ff
X   list >ofiles #?.o lformat="%s"
X   oml /pllibs/plpffp.lib r @ofiles
X   delete ofiles
X
X   cd /Amiga
X   lmk LFLG1=-ff
X   list >ofiles #?.o lformat="%s"
X   oml /pllibs/plpffp.lib r @ofiles
X   delete ofiles
X
X   cd /lattice
Xendif
X
X; Create the IEEE library with "float" floating point variables.
X; Unfortunately there is a bug involving prototypes and float's in Lattice 5.04.
X; (The calling function promotes all float's to double's in spite of the
X; prototype while the called function expects a float.) I get around this
X; and still get prototyping by creating the library without prototyping in
X; effect (so that the conventional C conversions occur). Prototypes can still
X; be used when linking your driver to the library. This works but causes the
X; library to be larger than it normally would be. (I have reported this
X; bug to Lattice by the way.)
Xif "<lib>" eq "IEEEF"
X   ask "Are you sure you want to (re)make the complete IEEEF library? (y or n)"
X   if not warn
X      skip end
X   endif
X
X   if exists /pllibs/plplcmf.lib
X      delete /pllibs/plplcmf.lib
X   endif
X
X   cd /src
X   lmk LFLG1=-dNOPROTS
X   list >ofiles #?.o lformat="%s"
X   oml /pllibs/plplcmf.lib r @ofiles
X   delete ofiles
X
X   cd /drivers
X   lmk LFLG1=-dNOPROTS
X   list >ofiles #?.o lformat="%s"
X   oml /pllibs/plplcmf.lib r @ofiles
X   delete ofiles
X
X   cd /Amiga
X   lmk LFLG1=-dNOPROTS
X   list >ofiles #?.o lformat="%s"
X   oml /pllibs/plplcmf.lib r @ofiles
X   delete ofiles
X
X   cd /lattice
Xendif
X
X; Make the IEEE library with "double" floating point variables.
Xif "<lib>" eq "IEEED"
X   ask "Are you sure you want to (re)make the complete IEEED library? (y or n)"
X   if not warn
X      skip end
X   endif
X
X   if exists /pllibs/plplcmd.lib
X      delete /pllibs/plplcmd.lib
X   endif
X
X   cd /src
X   lmk LFLG1=-dPLDBL
X   list >ofiles #?.o lformat="%s"
X   oml /pllibs/plplcmd.lib r @ofiles
X   delete ofiles
X
X   cd /drivers
X   lmk LFLG1=-dPLDBL
X   list >ofiles #?.o lformat="%s"
X   oml /pllibs/plplcmd.lib r @ofiles
X   delete ofiles
X
X   cd /Amiga
X   lmk LFLG1=-dPLDBL
X   list >ofiles #?.o lformat="%s"
X   oml /pllibs/plplcmd.lib r @ofiles
X   delete ofiles
X
X   cd /lattice
Xendif
X
Xlab end
END_OF_FILE
if test 3196 -ne `wc -c <'lattice/make-all'`; then
    echo shar: \"'lattice/make-all'\" unpacked with wrong size!
fi
# end of 'lattice/make-all'
fi
if test -f 'src/pldeco.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/pldeco.c'\"
else
echo shar: Extracting \"'src/pldeco.c'\" \(3037 characters\)
sed "s/^X//" >'src/pldeco.c' <<'END_OF_FILE'
X/* Decode a character string, and return an array of float integer symbol */
X/* numbers. This routine is responsible for interpreting all escape */
X/* sequences. At present the following escape sequences are defined */
X/* (the letter following the # may be either upper or lower case): */
X
X/* #u       :      up one level (returns -1) */
X/* #d       :      down one level (returns -2) */
X/* #b       :      backspace (returns -3) */
X/* #+       :      toggles overline mode (returns -4) */
X/* #-       :      toggles underline mode (returns -5) */
X/* ##       :      # */
X/* #gx      :      greek letter corresponding to roman letter x */
X/* #fn      :      switch to Normal font */
X/* #fr      :      switch to Roman font */
X/* #fi      :      switch to Italic font */
X/* #fs      :      switch to Script font */
X/* #(nnn)   :      Hershey symbol number nnn (any number of digits) */
X
X#include "plplot.h"
X#include <stdio.h>
X#include <ctype.h>
X#ifdef PLSTDC
X#include <string.h>
X#else
Xextern int strlen();
X#endif
X
Xstatic char font[] = "nris";
Xstatic char greek[] = "ABGDEZYHIKLMNCOPRSTUFXQWabgdezyhiklmncoprstufxqw";
X#define PLMAXSTR      300
Xstatic short symbol[PLMAXSTR];
X
Xextern short int *fntlkup;
Xextern short int numberfonts, numberchars;
X
Xvoid pldeco(sym,length,text)
XPLINT *length;
Xshort int **sym;
Xchar *text;
X{
X   PLINT ch,icol,ifont,ig,j,lentxt;
X   char test;
X
X   /* Initialize parameters. */
X   lentxt=strlen(text);
X   *length=0;
X   *sym = symbol;
X   gatt(&ifont,&icol);
X   if(ifont > numberfonts)
X      ifont = 1;
X
X   /* Get next character; treat non-printing characters as spaces. */
X   j=0;
X   while(j<lentxt) {
X     if(*length >= PLMAXSTR)
X        return;
X     test=text[j++];
X     ch=test;
X     if (ch<0 || ch>175)   ch = 32;
X
X     /* Test for escape sequence (#) */
X     if (ch=='#' && (lentxt-j)>=1) {
X       test=text[j++];
X       if (test=='#')
X         symbol[(*length)++] = *(fntlkup+(ifont-1)*numberchars+ch);
X       else if (tolower(test)=='u')
X         symbol[(*length)++] = -1;
X       else if (tolower(test)=='d')
X         symbol[(*length)++] = -2;
X       else if (tolower(test)=='b')
X         symbol[(*length)++] = -3;
X       else if (test=='+')
X         symbol[(*length)++] = -4;
X       else if (test=='-')
X         symbol[(*length)++] = -5;
X       else if (test=='(') {
X         symbol[*length] = 0;
X         while ('0'<=text[j] && text[j]<='9') {
X           symbol[*length] = symbol[*length]*10 + text[j] - '0';
X           j++;
X         }
X         (*length)++;
X         if (text[j]==')') j++;
X       }
X       else if (tolower(test)=='f') {
X         test=text[j++];
X         ifont = strpos(font,(char)tolower(test)) + 1;
X         if (ifont==0 || ifont > numberfonts)
X            ifont = 1;
X       }
X       else if (tolower(test)=='g') {
X         test=text[j++];
X         ig = strpos(greek,test) + 1;
X         symbol[(*length)++] = *(fntlkup+(ifont-1)*numberchars + 127 + ig);
X       }
X     }
X     else
X       /* Decode character. */
X       symbol[(*length)++] = *(fntlkup+(ifont-1)*numberchars + ch);
X   }
X}
END_OF_FILE
if test 3037 -ne `wc -c <'src/pldeco.c'`; then
    echo shar: \"'src/pldeco.c'\" unpacked with wrong size!
fi
# end of 'src/pldeco.c'
fi
if test -f 'src/plenv.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/plenv.c'\"
else
echo shar: Extracting \"'src/plenv.c'\" \(3019 characters\)
sed "s/^X//" >'src/plenv.c' <<'END_OF_FILE'
X/* Simple interface for defining viewport and window. If "just"=1,  */
X/* X and Y scales will be the same, otherwise they are scaled       */
X/* independently. The "axis" parameter is interpreted as follows:   */
X/* axis=-2 : draw no box, axis or labels                            */
X/* axis=-1 : draw box only                                          */
X/* axis= 0 : Draw box and label with coordinates                    */
X/* axis= 1 : Also draw the coordinate axes                          */
X/* axis= 2 : Draw a grid at major tick positions                    */
X/* axis=10 : Logarithmic X axis, L!=r Y axis, No X=0 axis         */
X/* axis=11 : Logarithmic X axis, L!=r Y axis, X=0 axis            */
X/* axis=20 : L!=r X axis, Logarithmic Y axis, No Y=0 axis         */
X/* axis=21 : L!=r X axis, Logarithmic Y axis, Y=0 axis            */
X/* axis=30 : Logarithmic X and Y axes                               */
X
X#include "plplot.h"
X#include <stdio.h>
X#include <math.h>
X
Xvoid plenv(xmin,xmax,ymin,ymax,just,axis)
XPLINT just,axis;
XPLFLT xmin, xmax, ymin, ymax;
X{
X    PLINT level;
X    PLFLT chrdef, chrht;
X    PLFLT lb, rb, tb, bb, dx, dy;
X    PLFLT xsize, ysize, xscale, yscale;
X    PLFLT spxmin, spxmax, spymin, spymax;
X    PLFLT vpxmin, vpxmax, vpymin, vpymax;
X    PLFLT scale;
X
X    glev(&level);
X    if (level < 1) plexit("Please call plstar before plenv.");
X
X    if (xmin == xmax) plexit("Invalid xmin and xmax arguments in plenv");
X    if (ymin == ymax) plexit("Invalid ymin and ymax arguments in plenv");
X    if ((just != 0) && (just != 1)) plexit("Invalid just option in plenv");
X
X
X    pladv(0);
X    if (just == 0)
X      plvsta();
X    else {
X      gchr(&chrdef,&chrht);
X      lb = 7.0 * chrht;
X      rb = 4.0 * chrht;
X      tb = 4.0 * chrht;
X      bb = 4.0 * chrht;
X      dx = abs(xmax-xmin);
X      dy = abs(ymax-ymin);
X      plgspa(&spxmin,&spxmax,&spymin,&spymax);
X      xsize = spxmax - spxmin;
X      ysize = spymax - spymin;
X      xscale = dx/(xsize - lb - rb);
X      yscale = dy/(ysize - tb - bb);
X      scale = max(xscale,yscale);
X      vpxmin = max(lb,0.5*(xsize - dx/scale));
X      vpxmax = vpxmin + (dx/scale);
X      vpymin = max(bb,0.5*(ysize - dy/scale));
X      vpymax = vpymin + (dy/scale);
X      plsvpa(vpxmin,vpxmax,vpymin,vpymax);
X    }
X    plwind(xmin,xmax,ymin,ymax);
X    if (axis == -2)
X       ;
X    else if (axis == -1)
X       plbox("bc",0.0,0,"bc",0.0,0);
X    else if (axis == 0)
X       plbox("bcnst",0.0,0,"bcnstv",0.0,0);
X    else if (axis == 1)
X       plbox("abcnst",0.0,0,"abcnstv",0.0,0);
X    else if (axis == 2)
X       plbox("abcgnst",0.0,0,"abcgnstv",0.0,0);
X    else if (axis == 10)
X       plbox("bclnst",0.0,0,"bcnstv",0.0,0);
X    else if (axis == 11)
X       plbox("bclnst",0.0,0,"abcnstv",0.0,0);
X    else if (axis == 20)
X       plbox("bcnst",0.0,0,"bclnstv",0.0,0);
X    else if (axis == 21)
X       plbox("bcnst",0.0,0,"abclnstv",0.0,0);
X    else if (axis == 30)
X       plbox("bclnst",0.0,0,"bclnstv",0.0,0);
X    else
X       fprintf(stderr,"Invalid axis argument in plenv.\n");
X}
END_OF_FILE
if test 3019 -ne `wc -c <'src/plenv.c'`; then
    echo shar: \"'src/plenv.c'\" unpacked with wrong size!
fi
# end of 'src/plenv.c'
fi
if test -f 'src/plfontld.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/plfontld.c'\"
else
echo shar: Extracting \"'src/plfontld.c'\" \(2221 characters\)
sed "s/^X//" >'src/plfontld.c' <<'END_OF_FILE'
X/* Loads either the standard or extended font */
X
X#include "plplot.h"
X#include <stdio.h>
X
Xshort int *fntlkup;
Xshort int *fntindx;
Xshort int *fntbffr;
Xshort int numberfonts, numberchars;
Xshort int indxleng;
X
Xstatic short fontloaded=0;
X
Xvoid plfontld(fnt)
XPLINT fnt;
X{
X   static short charset;
X   short bffrleng;
X   FILE *fontfile;
X   FILE *indxfile;
X   FILE *lkupfile;
X   PLINT level;
X
X   glev(&level);
X   if (level < 1)  plexit("Please call plstar before calling plfontld.");
X
X   if(fontloaded) {
X      if(charset == fnt) return;
X      free((VOID *)fntindx);
X      free((VOID *)fntbffr);
X      free((VOID *)fntlkup);
X   }
X
X   fontloaded = 1;
X   charset = fnt;
X
X   if(fnt)
X      fontfile = fopen(XSTRKFONT,"r");
X   else
X      fontfile = fopen(SSTRKFONT,"r");
X   if(!fontfile)
X      plexit("Error opening font file.\n");
X   fread((char *)&bffrleng,sizeof(short),1,fontfile);
X   fntbffr = (short *)malloc(bffrleng*sizeof(short));
X   if(!fntbffr)
X      plexit("Out of memory while allocating font buffer.\n");
X   fread((char *)fntbffr,sizeof(short),bffrleng,fontfile);
X   fclose(fontfile);
X
X   if(fnt)
X     indxfile = fopen(XFONTINDX,"r");
X   else
X     indxfile = fopen(SFONTINDX,"r");
X   if(!indxfile)
X      plexit("Error opening font file.\n");
X   fread((char *)&indxleng,sizeof(short),1,indxfile);
X   fntindx = (short int *)malloc(indxleng*sizeof(short int));
X   if(!fntindx)
X      plexit("Out of memory while allocating font buffer.\n");
X   fread((char *)fntindx,sizeof(short int),indxleng,indxfile);
X   fclose(indxfile);
X
X   if(fnt)
X      lkupfile = fopen(XFONTLKUP,"r");
X   else
X      lkupfile = fopen(SFONTLKUP,"r");
X   if(!lkupfile)
X      plexit("Error opening font file.\n");
X   fread((char *)&bffrleng,sizeof(short),1,lkupfile);
X   numberfonts = bffrleng/256;
X   numberchars = bffrleng & 0xff;
X   bffrleng = numberfonts*numberchars;
X   fntlkup = (short int *)malloc(bffrleng*sizeof(short int));
X   if(!fntlkup)
X      plexit("Out of memory while allocating font buffer.\n");
X   fread((char *)fntlkup,sizeof(short int),bffrleng,lkupfile);
X   fclose(lkupfile);
X}
X
Xvoid plfontrel()
X{
X   if(fontloaded) {
X      free((VOID *)fntindx);
X      free((VOID *)fntbffr);
X      free((VOID *)fntlkup);
X      fontloaded=0;
X   }
X}
X
END_OF_FILE
if test 2221 -ne `wc -c <'src/plfontld.c'`; then
    echo shar: \"'src/plfontld.c'\" unpacked with wrong size!
fi
# end of 'src/plfontld.c'
fi
if test -f 'src/plgrid3.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/plgrid3.c'\"
else
echo shar: Extracting \"'src/plgrid3.c'\" \(3106 characters\)
sed "s/^X//" >'src/plgrid3.c' <<'END_OF_FILE'
X/* Routine to draw a grid around the back side of the 3d plot */
X/* wih hidden line removal */
X
X#include "plplot.h"
X#include <math.h>
X
Xextern PLINT pl3upv;
X
Xvoid plgrid3a(tick)
XPLFLT tick;
X{
X    PLFLT xmin, ymin, zmin, xmax, ymax, zmax, zscale;
X    PLFLT cxx, cxy, cyx, cyy, cyz;
X    PLINT u[3], v[3];
X    PLINT nsub, mode, prec;
X    PLFLT tp;
X
X    gw3wc(&cxx,&cxy,&cyx,&cyy,&cyz);
X    gdom(&xmin,&xmax,&ymin,&ymax);
X    grange(&zscale,&zmin,&zmax);
X
X    nsub = 0;
X    pldtik(zmin,zmax,&tick,&nsub,&mode,&prec);
X    tp = tick * floor(zmin/tick) + tick;
X
X    pl3upv = 0;
X
X    if (cxx >= 0.0 && cxy <= 0.0)  {
X        while ( tp <= zmax ) {
X            u[0] = wcpcx(w3wcx(xmin,ymax,tp));
X            v[0] = wcpcy(w3wcy(xmin,ymax,tp));
X            u[1] = wcpcx(w3wcx(xmax,ymax,tp));
X            v[1] = wcpcy(w3wcy(xmax,ymax,tp));
X            u[2] = wcpcx(w3wcx(xmax,ymin,tp));
X            v[2] = wcpcy(w3wcy(xmax,ymin,tp));
X            plnxtv(u,v,3,0);
X
X            tp += tick;
X        }
X        u[0] = wcpcx(w3wcx(xmax,ymax,zmin));
X        v[0] = wcpcy(w3wcy(xmax,ymax,zmin));
X        u[1] = wcpcx(w3wcx(xmax,ymax,zmax));
X        v[1] = wcpcy(w3wcy(xmax,ymax,zmax));
X        plnxtv(u,v,2,0);
X    }
X    else if(cxx <= 0.0  && cxy <= 0.0)  {
X        while ( tp <= zmax ) {
X            u[0] = wcpcx(w3wcx(xmax,ymax,tp));
X            v[0] = wcpcy(w3wcy(xmax,ymax,tp));
X            u[1] = wcpcx(w3wcx(xmax,ymin,tp));
X            v[1] = wcpcy(w3wcy(xmax,ymin,tp));
X            u[2] = wcpcx(w3wcx(xmin,ymin,tp));
X            v[2] = wcpcy(w3wcy(xmin,ymin,tp));
X            plnxtv(u,v,3,0);
X
X            tp += tick;
X        }
X        u[0] = wcpcx(w3wcx(xmax,ymin,zmin));
X        v[0] = wcpcy(w3wcy(xmax,ymin,zmin));
X        u[1] = wcpcx(w3wcx(xmax,ymin,zmax));
X        v[1] = wcpcy(w3wcy(xmax,ymin,zmax));
X        plnxtv(u,v,2,0);
X    }
X    else if(cxx <= 0.0  && cxy >= 0.0)  {
X        while ( tp <= zmax ) {
X            u[0] = wcpcx(w3wcx(xmax,ymin,tp));
X            v[0] = wcpcy(w3wcy(xmax,ymin,tp));
X            u[1] = wcpcx(w3wcx(xmin,ymin,tp));
X            v[1] = wcpcy(w3wcy(xmin,ymin,tp));
X            u[2] = wcpcx(w3wcx(xmin,ymax,tp));
X            v[2] = wcpcy(w3wcy(xmin,ymax,tp));
X            plnxtv(u,v,3,0);
X
X            tp += tick;
X        }
X        u[0] = wcpcx(w3wcx(xmin,ymin,zmin));
X        v[0] = wcpcy(w3wcy(xmin,ymin,zmin));
X        u[1] = wcpcx(w3wcx(xmin,ymin,zmax));
X        v[1] = wcpcy(w3wcy(xmin,ymin,zmax));
X        plnxtv(u,v,2,0);
X    }
X    else if(cxx >= 0.0  && cxy >= 0.0)  {
X        while ( tp <= zmax ) {
X            u[0] = wcpcx(w3wcx(xmin,ymin,tp));
X            v[0] = wcpcy(w3wcy(xmin,ymin,tp));
X            u[1] = wcpcx(w3wcx(xmin,ymax,tp));
X            v[1] = wcpcy(w3wcy(xmin,ymax,tp));
X            u[2] = wcpcx(w3wcx(xmax,ymax,tp));
X            v[2] = wcpcy(w3wcy(xmax,ymax,tp));
X            plnxtv(u,v,3,0);
X
X            tp += tick;
X        }
X        u[0] = wcpcx(w3wcx(xmin,ymax,zmin));
X        v[0] = wcpcy(w3wcy(xmin,ymax,zmin));
X        u[1] = wcpcx(w3wcx(xmin,ymax,zmax));
X        v[1] = wcpcy(w3wcy(xmin,ymax,zmax));
X        plnxtv(u,v,2,0);
X    }
X
X    pl3upv = 1;
X}
X
END_OF_FILE
if test 3106 -ne `wc -c <'src/plgrid3.c'`; then
    echo shar: \"'src/plgrid3.c'\" unpacked with wrong size!
fi
# end of 'src/plgrid3.c'
fi
if test -f 'src/plt3zz.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/plt3zz.c'\"
else
echo shar: Extracting \"'src/plt3zz.c'\" \(2154 characters\)
sed "s/^X//" >'src/plt3zz.c' <<'END_OF_FILE'
X/* Draws the next zig-zag line for a 3-d plot. The data is stored in */
X/* array z(*,ly) as a function of x() and y(). The subarray */
X/* z(1:nx,1:ny) is plotted out, starting at index (xstar0,ystar0). */
X/* Depending on the state of "flg0", the sequence of data points */
X/* sent to plnxtv is altered so as to allow cross-hatch plotting, */
X/* or plotting parallel to either the x-axis or the y-axis. */
X
X#include "plplot.h"
X
Xvoid plt3zz(xstar0,ystar0,dx,dy,flg0,init,x,y,z,ly,nx,ny,u,v)
XPLINT xstar0, ystar0, dx, dy, flg0, ly, nx, ny, init;
XPLFLT *x, *y, *z;
XPLINT *u, *v;
X{
X      PLINT flag;
X      PLINT n;
X      PLINT xstart, ystart;
X
X      n = 0;
X      xstart = xstar0;
X      ystart = ystar0;
X      flag = flg0;
X
Xlab1:
X      if (1 <= xstart && xstart <= nx && 1 <= ystart && ystart <= ny) {
X        u[n] = wcpcx(w3wcx(x[xstart-1],y[ystart-1],
X                      *(z+(xstart-1)*ly+(ystart-1))));
X        v[n] = wcpcy(w3wcy(x[xstart-1],y[ystart-1],
X                      *(z+(xstart-1)*ly+(ystart-1))));
X        if (flag == -3) {
X          ystart = ystart + dy;
X          flag = -flag;
X        }
X        else if (flag == -2)
X          ystart = ystart + dy;
X        else if (flag == -1) {
X          ystart = ystart + dy;
X          flag = 1;
X        }
X        else if (flag == 1)
X          xstart = xstart + dx;
X        else if (flag == 2)  {
X          xstart = xstart + dx;
X          flag = -2;
X        }
X        else if (flag == 3) {
X          xstart = xstart + dx;
X          flag = -flag;
X        }
X        n = n+1;
X        goto lab1;
X      }
X
X      if (flag == 1 || flag == -2) {
X        if (flag == 1) {
X          xstart = xstart - dx;
X          ystart = ystart + dy;
X        }
X        else if (flag == -2) {
X          ystart = ystart - dy;
X          xstart = xstart + dx;
X        }
X
X        if (1 <= xstart && xstart <= nx  && 1 <= ystart && ystart <= ny) {
X          u[n] = wcpcx(w3wcx(x[xstart-1],y[ystart-1],
X                       *(z+(xstart-1)*ly+(ystart-1))));
X          v[n] = wcpcy(w3wcy(x[xstart-1],y[ystart-1],
X                       *(z+(xstart-1)*ly+(ystart-1))));
X          n = n+1;
X        }
X
X      }
X      plnxtv(u,v,n,init);
X}
END_OF_FILE
if test 2154 -ne `wc -c <'src/plt3zz.c'`; then
    echo shar: \"'src/plt3zz.c'\" unpacked with wrong size!
fi
# end of 'src/plt3zz.c'
fi
if test -f 'src/plw3d.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'src/plw3d.c'\"
else
echo shar: Extracting \"'src/plw3d.c'\" \(2197 characters\)
sed "s/^X//" >'src/plw3d.c' <<'END_OF_FILE'
X/* Set up a window for three-dimensional plotting. The data are mapped */
X/* into a box with world coordinate size "basex" by "basey" by "height", */
X/* with the base being symmetrically positioned about zero. Thus */
X/* the mapping between data 3-d and world 3-d coordinates is given by: */
X
X/*   x = xmin   =>   wx = -0.5*basex */
X/*   x = xmax   =>   wx =  0.5*basex */
X/*   y = ymin   =>   wy = -0.5*basey */
X/*   y = ymax   =>   wy =  0.5*basey */
X/*   z = zmin   =>   wz =  0.0 */
X/*   z = zmax   =>   wz =  height */
X
X/* The world coordinate box is then viewed from position "alt"-"az", */
X/* measured in degrees. For proper operation, 0 <= alt <= 90 degrees, */
X/* but az can be any value. */
X
X#include "plplot.h"
X#include <math.h>
X
X#define  dtr   0.01745329252
X
Xvoid plw3d(basex,basey,height,xmin0,xmax0,ymin0,ymax0,zmin0,zmax0,alt,az)
XPLFLT basex, basey, height, xmin0, xmax0, ymin0, ymax0, zmin0, zmax0;
XPLFLT alt, az;
X{
X      PLFLT xmin, xmax, ymin, ymax, zmin, zmax, d;
X      PLFLT cx, cy, saz, caz, salt, calt, zscale;
X      PLINT level;
X
X      glev(&level);
X      if (level < 3) plexit("Please set up 2-d window before calling plw3d.");
X      if (basex <= 0.0 || basey <= 0.0 || height <= 0.0)
X              plexit("Invalid world coordinate boxsize in plw3d.");
X      if (xmin0 == xmax0 || ymin0 == ymax0 || zmin0 == zmax0)
X              plexit("Invalid axis range in plw3d.");
X      if (alt<0.0 || alt>90.0)
X              plexit("Altitude must be between 0 and 90 degrees in plw3d.");
X
X      d = 1.0e-5*(xmax0-xmin0);
X      xmax = xmax0 + d;
X      xmin = xmin0 - d;
X      d = 1.0e-5*(ymax0-ymin0);
X      ymax = ymax0 + d;
X      ymin = ymin0 - d;
X      d = 1.0e-5*(zmax0-zmin0);
X      zmax = zmax0 + d;
X      zmin = zmin0 - d;
X      cx = basex/(xmax-xmin);
X      cy = basey/(ymax-ymin);
X      zscale = height/(zmax-zmin);
X      saz = sin(dtr*az);
X      caz = cos(dtr*az);
X      salt = sin(dtr*alt);
X      calt = cos(dtr*alt);
X
X      sdom(xmin,xmax,ymin,ymax);
X      srange(zscale,zmin,zmax);
X      sbase(basex,basey,(PLFLT)(0.5*(xmin+xmax)),(PLFLT)(0.5*(ymin+ymax)));
X
X      sw3wc((PLFLT)(cx*caz),(PLFLT)(-cy*saz),(PLFLT)(cx*saz*salt),(PLFLT)(cy*caz*salt),(PLFLT)(zscale*calt));
X}
X
END_OF_FILE
if test 2197 -ne `wc -c <'src/plw3d.c'`; then
    echo shar: \"'src/plw3d.c'\" unpacked with wrong size!
fi
# end of 'src/plw3d.c'
fi
if test -f 'unix/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'unix/Makefile'\"
else
echo shar: Extracting \"'unix/Makefile'\" \(2767 characters\)
sed "s/^X//" >'unix/Makefile' <<'END_OF_FILE'
XSRCS  =   ../src/define.c \
X          ../src/fcnvrt.c \
X          ../src/genlin.c \
X          ../src/global.c \
X          ../src/icnvrt.c \
X          ../src/movphy.c \
X          ../src/movwor.c \
X          ../src/pl3cut.c \
X          ../src/plabv.c \
X          ../src/pladv.c \
X          ../src/plbeg.c \
X          ../src/plbin.c \
X          ../src/plbox.c \
X          ../src/plbox3.c \
X          ../src/plccal.c \
X          ../src/plclr.c \
X          ../src/plcntr.c \
X          ../src/plcol.c \
X          ../src/plcont.c \
X          ../src/plcvec.c \
X          ../src/pldeco.c \
X          ../src/pldtik.c \
X          ../src/plend.c \
X          ../src/plenv.c \
X          ../src/plerrx.c \
X          ../src/plerry.c \
X          ../src/plerx1.c \
X          ../src/plery1.c \
X          ../src/plexit.c \
X          ../src/plfill.c \
X          ../src/plfont.c \
X          ../src/plfontld.c \
X          ../src/plform.c \
X          ../src/plgra.c \
X          ../src/plgrid3.c \
X          ../src/plgspa.c \
X          ../src/plhist.c \
X          ../src/plhrsh.c \
X          ../src/pljoin.c \
X          ../src/pllab.c \
X          ../src/pllclp.c \
X          ../src/plline.c \
X          ../src/pllsty.c \
X          ../src/plmesh.c \
X          ../src/plmtex.c \
X          ../src/plnxtv.c \
X          ../src/plot3d.c \
X          ../src/plpage.c \
X          ../src/plpat.c \
X          ../src/plpoi1.c \
X          ../src/plpoin.c \
X          ../src/plpsty.c \
X          ../src/plptex.c \
X          ../src/plr135.c \
X          ../src/plr45.c \
X          ../src/plschr.c \
X          ../src/plside3.c \
X          ../src/plsmaj.c \
X          ../src/plsmin.c \
X          ../src/plssym.c \
X          ../src/plstar.c \
X          ../src/plstik.c \
X          ../src/plstr.c \
X          ../src/plstrl.c \
X          ../src/plstyl.c \
X          ../src/plsvpa.c \
X          ../src/plsym.c \
X          ../src/plsym1.c \
X          ../src/plt3zz.c \
X          ../src/pltext.c \
X          ../src/plvpor.c \
X          ../src/plvsta.c \
X          ../src/plw3d.c \
X          ../src/plwid.c \
X          ../src/plwind.c \
X          ../src/plxtik.c \
X          ../src/plxybx.c \
X          ../src/plxytx.c \
X          ../src/plytik.c \
X          ../src/plzbx.c \
X          ../src/plztx.c \
X          ../src/setphy.c \
X          ../src/setpxl.c \
X          ../src/setsub.c \
X          ../src/stindex.c \
X          ../src/strpos.c \
X          ../src/stsearch.c \
X          ../src/xform.c
X
XDRVS  =   xterm.c \
X          tektronix.c \
X          dg300.c \
X          hp7470.c \
X          hp7580.c \
X          impress.c \
X          laserjetii.c \
X          postscript.c \
X          dispatch.c
X
X/home/dukee2/amr/lib/libplplots.a: $(SRCS) $(DRVS)
X	cc -c -I../include $?
X	ar -r $@ $(?F:.c=.o)
X	/bin/rm $(?F:.c=.o)
END_OF_FILE
if test 2767 -ne `wc -c <'unix/Makefile'`; then
    echo shar: \"'unix/Makefile'\" unpacked with wrong size!
fi
# end of 'unix/Makefile'
fi
if test -f 'unix/hp7470.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'unix/hp7470.c'\"
else
echo shar: Extracting \"'unix/hp7470.c'\" \(3143 characters\)
sed "s/^X//" >'unix/hp7470.c' <<'END_OF_FILE'
X/* This file contains the IMPRESS device dependent subroutines for */
X/* use with plplot. */
X
X#include "plplot.h"
X#include <stdio.h>
X
X#define ESC          27
X#define HP7470X   10299
X#define HP7470Y    7649
X
Xstatic FILE *OutFile;
Xstatic int porient;
Xstatic int select=0;
Xstatic char FileName[80];
Xstatic int curpen, curwid;
X
Xvoid hp7470setup(xdpi,ydpi,xwid,ywid)
XPLINT xwid, ywid;
XPLFLT xdpi, ydpi;
X{
X}
X
X/* Open file.  Set up for graphics. */
Xvoid hp7470init()
X{
X      char response[80];
X      int ori;
X
X      smod(0);  /* not an interactive terminal */
X      scol(1);
X      swid(1);
X      setpxl(40.,40.);
X      
X      if(!select) {
X         printf("Landscape or portrait orientation? (0 or 1): ");
X         fgets(response,sizeof(response),stdin);
X         if(sscanf(response,"%d",&ori) != 1)
X            ori = 0;   /* carriage return defaults to landscape */
X      }
X      
X      porient = ori;
X      if(!porient)
X         setphy(0,HP7470X,0,HP7470Y);
X      else
X         setphy(0,HP7470Y,0,HP7470X);
X
X      OutFile = NULL;
X      while(!OutFile) {
X         if(!select) {
X            printf("Enter graphics command storage file name. ");
X            fgets(response,sizeof(response),stdin);
X            if(sscanf(response,"%s",FileName) != 1) {
X                printf("Invalid entry.n");
X                continue;
X            }
X         }
X         if ((OutFile = fopen(FileName,"w")) == NULL) 
X             printf("Can't open %s.\n",FileName);
X         select=0;
X      }
X      fprintf(OutFile,"%c.I200;;17:%c.N;19:%c.M;;;10:in;\n",ESC,ESC,ESC);
X}
X
Xvoid hp7470select(ori,file)
XPLINT ori;
Xchar *file;
X{
X   porient = ori;
X   strncpy(FileName,file,79);
X   FileName[79]='\0';
X   select = 1;
X}
X
X/* Sets the IMPRESS to text mode */
Xvoid hp7470text()
X{
X}
X
X/* Sets the IMPRESS to graphics mode */
Xvoid hp7470graph()
X{
X}
X
X/* Form feed */
Xvoid hp7470clear()
X{
X}
X
Xstatic PLINT xold, yold;
X
Xvoid hp7470page()
X{
X   fprintf(OutFile,"pg;\n");
X   xold = -100000;
X   yold = -100000;
X}
X
Xvoid hp7470color(colour)
XPLINT colour;
X{
X  if(colour<1 || colour>8)
X    fprintf(stderr,"\nInvalid pen selection.");
X  else {
X    fprintf(OutFile,"sp%d %d\n",colour,curwid);
X    curpen = colour;
X  }
X}
X
Xvoid hp7470width(width)
XPLINT width;
X{
X  if(width<1 || width>48)
X    fprintf(stderr,"\nInvalid pen width selection.");
X  else {
X    fprintf(OutFile,"sp%d %d\n",curpen,width);
X    curwid = width;
X  }
X}
X
Xvoid hp7470line(x1,y1,x2,y2)
XPLINT x1,y1,x2,y2;
X{
X
X      if(!porient) {
X         if(x1 == xold && y1 == yold) 
X           /* Add new point to path */
X           fprintf(OutFile,"pd%d %d\n",x2,y2);
X         else 
X           /* Write out old path */
X           fprintf(OutFile,"pu%d %d pd%d %d\n",x1,y1,x2,y2);
X      }
X      else {
X         if(x1 == xold && y1 == yold) 
X           /* Add new point to path */
X           fprintf(OutFile,"pd%d %d\n",HP7470X-y2,x2);
X         else 
X           /* Write out old path */
X           fprintf(OutFile,"pu%d %d pd%d %d\n",HP7470X-y1,x1,HP7470X-y2,x2);
X      }
X        
X      xold = x2;
X      yold = y2;
X}
X      
X/* Close graphics file */
Xvoid hp7470tidy()
X{
X      fprintf(OutFile,"sp0\n");
X      fclose(OutFile);
X      select = 0;
X}
X
END_OF_FILE
if test 3143 -ne `wc -c <'unix/hp7470.c'`; then
    echo shar: \"'unix/hp7470.c'\" unpacked with wrong size!
fi
# end of 'unix/hp7470.c'
fi
if test -f 'unix/hp7580.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'unix/hp7580.c'\"
else
echo shar: Extracting \"'unix/hp7580.c'\" \(3003 characters\)
sed "s/^X//" >'unix/hp7580.c' <<'END_OF_FILE'
X/* This file contains the IMPRESS device dependent subroutines for */
X/* use with plplot. */
X
X#include "plplot.h"
X#include <stdio.h>
X
X#define HPXMIN  -4500
X#define HPXMAX   4500
X#define HPYMIN  -2790
X#define HPYMAX   2790
X#define ESC    27
X
Xstatic FILE *OutFile;
Xstatic int  porient;
Xstatic int select=0;
Xchar FileName[80];
X
Xvoid hp7580setup(xdpi,ydpi,xwid,ywid)
XPLINT xwid, ywid;
XPLFLT xdpi, ydpi;
X{
X}
X
X/* Open file.  Set up for graphics. */
Xvoid hp7580init()
X{
X      char response[80];
X      int ori;
X
X      smod(0);  /* not an interactive terminal */
X      scol(1);
X      swid(1);
X      setpxl(40.,40.);
X      
X      if(!select) {
X         printf("Landscape or portrait orientation? (0 or 1): ");
X         fgets(response,sizeof(response),stdin);
X         if(sscanf(response,"%d",&ori) != 1)
X            ori = 0;   /* carriage return defaults to landscape */
X      }
X      
X      porient = ori;
X      if(!porient)
X         setphy(HPXMIN,HPXMAX,HPYMIN,HPYMAX);
X      else
X         setphy(HPYMIN,HPYMAX,HPXMIN,HPXMAX);
X
X      OutFile = NULL;
X      while(!OutFile) {
X         if(!select) {
X            printf("Enter graphics command storage file name. ");
X            fgets(response,sizeof(response),stdin);
X            if(sscanf(response,"%s",FileName) != 1) {
X                printf("Invalid entry.n");
X                continue;
X            }
X         }
X         if ((OutFile = fopen(FileName,"w")) == NULL) 
X             printf("Can't open %s.\n",FileName);
X         select = 0;
X      }
X      fprintf(OutFile,"%c.I200;;17:%c.N;19:%c.M;;;10:in;\n",ESC,ESC,ESC);
X      fprintf(OutFile,"ro 90;ip;sp 4;pa;");
X}
X
Xvoid hp7580select(ori,file)
XPLINT ori;
Xchar *file;
X{
X   porient = ori;
X   strncpy(FileName,file,sizeof(FileName)-1);
X   FileName[sizeof(FileName)-1] = '\0';
X   select = 1;
X}
X
X/* Sets to text mode */
Xvoid hp7580text()
X{
X}
X
X/* Sets the IMPRESS to graphics mode */
Xvoid hp7580graph()
X{
X}
X
X/* Form feed */
Xvoid hp7580clear()
X{
X}
X
Xstatic int xold, yold;
X
Xvoid hp7580page()
X{
X   xold=-100000; yold=-100000;
X}
X
X/* May put something here someday */
Xvoid hp7580color(colour)
XPLINT colour;
X{
X  if(colour<1 || colour>8)
X    fprintf(stderr,"\nInvalid pen selection.");
X  else
X    fprintf(OutFile,"sp%d\n",colour);
X}
X
Xvoid hp7580width(width)
XPLINT width;
X{
X}
X
Xvoid hp7580line(x1,y1,x2,y2)
XPLINT x1,y1,x2,y2;
X{
X
X      if(!porient) {
X         if(x1 == xold && y1 == yold) 
X           /* Add new point to path */
X           fprintf(OutFile," %d %d",x2,y2);
X         else 
X           /* Write out old path */
X           fprintf(OutFile,"\npu%d %d pd%d %d",x1,y1,x2,y2);
X      }
X      else {
X         if(x1 == xold && y1 == yold) 
X           /* Add new point to path */
X           fprintf(OutFile," %d %d",-y2,x2);
X         else 
X           /* Write out old path */
X           fprintf(OutFile,"\npu%d %d pd%d %d",-y1,x1,-y2,x2);
X      }
X        
X      xold = x2;
X      yold = y2;
X}
X      
X/* Close graphics file */
Xvoid hp7580tidy()
X{
X      fprintf(OutFile,"\nsp0");
X      fclose(OutFile);
X      select = 0;
X}
X
END_OF_FILE
if test 3003 -ne `wc -c <'unix/hp7580.c'`; then
    echo shar: \"'unix/hp7580.c'\" unpacked with wrong size!
fi
# end of 'unix/hp7580.c'
fi
if test -f 'unix/xterm.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'unix/xterm.c'\"
else
echo shar: Extracting \"'unix/xterm.c'\" \(2806 characters\)
sed "s/^X//" >'unix/xterm.c' <<'END_OF_FILE'
X#include "plplot.h"
X#include <stdio.h>
X
X/* This file contains the xterm dependent routines for use with plplot. */
X
X#define TEKX   1023
X#define TEKY    779
X
X/* Define graphics control characters. */
X#define FF   12
X#define CAN  24
X#define ESC  27
X#define GS   29
X#define US   31
X#define ETX  003
X
Xvoid xtesetup(xdpi, ydpi, xwid, ywid)
XPLINT xwid, ywid;
XPLFLT xdpi, ydpi;
X{
X   /* the user doesn't know what he's talking about. ignore this stuff */
X}
X
Xvoid xteselect(ori, name)
XPLINT ori;
Xchar *name;
X{
X}
X
Xvoid xteinit()
X{
X      /* tell plplot that this is an interactive device (so pause after */
X      /* drawing graph).  use if smod(0) if sending grphx to a file. */
X      smod(1);   /* interactive device */
X
X      /* set default pen color (this should be the desired pen number) */
X      /* plplot will actually tell the device to use this pen by */
X      /* making a call to plcolor. */
X      scol(1);
X
X      swid(1);
X      /* set device resolution in dots/mm */
X      setpxl(4.771*16,4.653*16);
X
X      /* set page size using setphy(xmin,xmax,ymin,ymax) */
X      /* plplot assumes that the min coordinates are in the lower left */
X      setphy(0,16*TEKX,0,16*TEKY);
X
X      printf("%c[?38h",ESC); /* open graphics window */
X      printf("%c",GS);       /* set to vector mode */
X      printf("%c%c",ESC,FF);
X}
X
X/* Sets to text mode */
Xvoid xtetext()
X{
X    printf("%c",US);
X}
X
X/* Sets to graphics mode */
Xvoid xtegraph()
X{
X    /* Nothing has to be done here */
X}
X
X/* Clears the screen */
Xvoid xteclear()
X{
X     putchar('\007');
X     fflush(stdout);
X     while(getchar() != '\n')
X        ;
X     printf("%c%c",ESC,FF);
X}
X
Xstatic PLINT xold, yold;
X
Xvoid xtepage()
X{
X   xold = -100000;
X   yold = -100000;
X}
X
X/* Change color */
Xvoid xtecolor(colour)
XPLINT colour;
X{
X}
X
Xvoid xtewidth(width)
XPLINT width;
X{
X}
X
X/* Draws a line in the current colour from (x1,y1) to (x2,y2) */
Xvoid xteline(x1,y1,x2,y2)
XPLINT x1,y1,x2,y2;
X{
X    PLINT hy,ly,hx,lx;
X
X    x1 >>= 4;
X    y1 >>= 4;
X    x2 >>= 4;
X    y2 >>= 4;
X    /* If continuation of previous line just send new point */
X    if(x1 == xold && y1 == yold) {
X       hy = y2/32 + 32;
X       ly = y2 - (y2/32)*32 + 96;
X       hx = x2/32 + 32;
X       lx = x2 - (x2/32)*32 + 64;
X       printf("%c%c%c%c",hy,ly,hx,lx);
X    }
X    else {
X       printf("%c",GS);
X       hy = y1/32 + 32;
X       ly = y1 - (y1/32)*32 + 96;
X       hx = x1/32 + 32;
X       lx = x1 - (x1/32)*32 + 64;
X       printf("%c%c%c%c",hy,ly,hx,lx);
X       hy = y2/32 + 32;
X       ly = y2 - (y2/32)*32 + 96;
X       hx = x2/32 + 32;
X       lx = x2 - (x2/32)*32 + 64;
X       printf("%c%c%c%c",hy,ly,hx,lx);
X    }
X    xold = x2;
X    yold = y2;
X}
X
Xvoid xtetidy()
X{
X   putchar('\007');
X   fflush(stdout);
X   while(getchar() != '\n')
X      ;
X   printf("%c%c",US,CAN);
X   printf("%c%c",ESC,ETX);
X   fflush(stdout);
X}
X
END_OF_FILE
if test 2806 -ne `wc -c <'unix/xterm.c'`; then
    echo shar: \"'unix/xterm.c'\" unpacked with wrong size!
fi
# end of 'unix/xterm.c'
fi
echo shar: End of archive 3 \(of 12\).
cp /dev/null ark3isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 12 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Submissions to comp.sources.amiga and comp.binaries.amiga should be sent to:
	amiga@cs.odu.edu	
or	amiga@xanth.cs.odu.edu	( obsolescent mailers may need this address )
or	...!uunet!xanth!amiga	( very obsolescent mailers need this address )

Comments, questions, and suggestions s should be addressed to ``amiga-request''
(only use ``amiga'' for submissions) at the above addresses.