Back to index

plt-scheme  4.2.1
Defines | Enumerations | Functions | Variables
plcore.c File Reference
#include "plcore.h"

Go to the source code of this file.

Defines

#define DEBUG
#define NEED_PLDEBUG

Enumerations

enum  { AT_BOP, DRAWING, AT_EOP }

Functions

void plP_init (void)
void plP_eop (void)
void plP_bop (void)
void plP_tidy (void)
void plP_state (PLINT op)
void plP_esc (PLINT op, void *ptr)
void plP_swin (PLWindow *plwin)
void plP_line (short *x, short *y)
void plP_polyline (short *x, short *y, PLINT npts)
void plP_fill (short *x, short *y, PLINT npts)
void plP_text (PLINT base, PLFLT just, PLFLT *xform, PLINT x, PLINT y, PLINT refx, PLINT refy, const char *string)
static void grline (short *x, short *y, PLINT npts)
static void grpolyline (short *x, short *y, PLINT npts)
static void grfill (short *x, short *y, PLINT npts)
void difilt (PLINT *xscl, PLINT *yscl, PLINT npts, PLINT *clpxmi, PLINT *clpxma, PLINT *clpymi, PLINT *clpyma)
void sdifilt (short *xscl, short *yscl, PLINT npts, PLINT *clpxmi, PLINT *clpxma, PLINT *clpymi, PLINT *clpyma)
static void setdef_diplt ()
static void setdef_didev ()
static void setdef_diori ()
static void pldi_ini (void)
void pldid2pc (PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax)
void pldip2dc (PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax)
void c_plsdiplt (PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax)
void c_plsdiplz (PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax)
static void calc_diplt (void)
void c_plgdiplt (PLFLT *p_xmin, PLFLT *p_ymin, PLFLT *p_xmax, PLFLT *p_ymax)
void c_plsdidev (PLFLT mar, PLFLT aspect, PLFLT jx, PLFLT jy)
static void calc_didev (void)
void c_plgdidev (PLFLT *p_mar, PLFLT *p_aspect, PLFLT *p_jx, PLFLT *p_jy)
void c_plsdiori (PLFLT rot)
static void calc_diori (void)
void c_plgdiori (PLFLT *p_rot)
void c_plsdimap (PLINT dimxmin, PLINT dimxmax, PLINT dimymin, PLINT dimymax, PLFLT dimxpmm, PLFLT dimypmm)
static void calc_dimap ()
void c_plflush (void)
void pllib_init ()
void c_plstar (PLINT nx, PLINT ny)
void c_plstart (const char *devname, PLINT nx, PLINT ny)
MZ_DLLEXPORT void c_plinit (void)
MZ_DLLEXPORT void c_plend (void)
void c_plend1 (void)
void c_plsstrm (PLINT strm)
void c_plgstrm (PLINT *p_strm)
void c_plmkstrm (PLINT *p_strm)
void plstrm_init (void)
void pl_cpcolor (PLColor *to, PLColor *from)
void c_plcpstrm (PLINT iplsr, PLINT flags)
void pllib_devinit ()
static int plDispatchSequencer (const void *p1, const void *p2)
static void plInitDispatchTable ()
static void plSelectDev ()
static void plLoadDriver (void)
void c_plfontld (PLINT ifont)
void c_plreplot (void)
void plgFileDevs (char ***p_menustr, char ***p_devname, int *p_ndev)
void plgDevs (char ***p_menustr, char ***p_devname, int *p_ndev)
static void plgdevlst (char **p_menustr, char **p_devname, int *p_ndev, int type)
void c_plgpage (PLFLT *p_xp, PLFLT *p_yp, PLINT *p_xleng, PLINT *p_yleng, PLINT *p_xoff, PLINT *p_yoff)
MZ_DLLEXPORT void c_plspage (PLFLT xp, PLFLT yp, PLINT xleng, PLINT yleng, PLINT xoff, PLINT yoff)
void c_plssub (PLINT nx, PLINT ny)
MZ_DLLEXPORT void c_plsdev (const char *devname)
void c_plgdev (char *p_dev)
void c_plsmem (PLINT maxx, PLINT maxy, void *plotmem)
void plgpls (PLStream **p_pls)
void c_plglevel (PLINT *p_level)
void plsKeyEH (void(*KeyEH)(PLGraphicsIn *, void *, int *), void *KeyEH_data)
void plsButtonEH (void(*ButtonEH)(PLGraphicsIn *, void *, int *), void *ButtonEH_data)
void plsbopH (void(*handler)(void *, int *), void *handler_data)
void plseopH (void(*handler)(void *, int *), void *handler_data)
void plsError (PLINT *errcode, char *errmsg)
void c_plsori (PLINT ori)
MZ_DLLEXPORT void c_plwid (PLINT width)
void plgfile (FILE **p_file)
void plsfile (FILE *file)
void c_plgfnam (char *fnam)
MZ_DLLEXPORT void c_plsfnam (const char *fnam)
void c_plspause (PLINT pause)
void c_plprec (PLINT setp, PLINT prec)
void plP_gprec (PLINT *p_setp, PLINT *p_prec)
void c_plsesc (char esc)
void plgesc (char *p_esc)
void c_plgver (char *p_ver)
void plsxwin (PLINT window_id)
void c_plgfam (PLINT *p_fam, PLINT *p_num, PLINT *p_bmax)
void c_plsfam (PLINT fam, PLINT num, PLINT bmax)
void c_plfamadv (void)
void c_plgxax (PLINT *p_digmax, PLINT *p_digits)
void c_plsxax (PLINT digmax, PLINT digits)
void c_plgyax (PLINT *p_digmax, PLINT *p_digits)
void c_plsyax (PLINT digmax, PLINT digits)
void c_plgzax (PLINT *p_digmax, PLINT *p_digits)
void c_plszax (PLINT digmax, PLINT digits)
void c_plgchr (PLFLT *p_def, PLFLT *p_ht)
void c_plgvpd (PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax)
void c_plgvpw (PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax)
void plP_gdom (PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax)
void plP_grange (PLFLT *p_zscl, PLFLT *p_zmin, PLFLT *p_zmax)
void plP_gw3wc (PLFLT *p_dxx, PLFLT *p_dxy, PLFLT *p_dyx, PLFLT *p_dyy, PLFLT *p_dyz)
void plP_gclp (PLINT *p_ixmin, PLINT *p_ixmax, PLINT *p_iymin, PLINT *p_iymax)
void plP_sclp (PLINT ixmin, PLINT ixmax, PLINT iymin, PLINT iymax)
void plP_gphy (PLINT *p_ixmin, PLINT *p_ixmax, PLINT *p_iymin, PLINT *p_iymax)
void plP_gsub (PLINT *p_nx, PLINT *p_ny, PLINT *p_cs)
void plP_ssub (PLINT nx, PLINT ny, PLINT cs)
void plP_gpixmm (PLFLT *p_x, PLFLT *p_y)
void plP_setpxl (PLFLT xpmm, PLFLT ypmm)
void plP_setphy (PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax)
void c_plscompression (PLINT compression)
void c_plgcompression (PLINT *compression)
void plP_getinitdriverlist (char *names)
PLINT plP_checkdriverinit (char *names)
void plP_image (short *x, short *y, unsigned short *z, PLINT nx, PLINT ny, PLFLT xmin, PLFLT ymin, PLFLT dx, PLFLT dy, unsigned short zmin, unsigned short zmax)

Variables

static int foo

Define Documentation

#define DEBUG

Definition at line 10 of file plcore.c.

#define NEED_PLDEBUG

Definition at line 12 of file plcore.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
AT_BOP 
DRAWING 
AT_EOP 

Definition at line 48 of file plcore.c.


Function Documentation

void c_plcpstrm ( PLINT  iplsr,
PLINT  flags 
)

Definition at line 1468 of file plcore.c.

{
    int i;
    PLStream *plsr;

    plsr = pls[iplsr];
    if (plsr == NULL) {
       fprintf(stderr, "plcpstrm: stream %d not in use\n", (int) iplsr);
       return;
    }

/* May be debugging */

    plsc->debug = plsr->debug;

/* Plot buffer -- need to copy file pointer so that plreplot() works */
/* This also prevents inadvertent writes into the plot buffer */

    plsc->plbufFile = plsr->plbufFile;

/* Driver interface */
/* Transformation must be recalculated in current driver coordinates */

    if (plsr->difilt & PLDI_PLT) 
       plsdiplt(plsr->dipxmin, plsr->dipymin, plsr->dipxmax, plsr->dipymax);

    if (plsr->difilt & PLDI_DEV)
       plsdidev(plsr->mar, plsr->aspect, plsr->jx, plsr->jy);

    if (plsr->difilt & PLDI_ORI)
       plsdiori(plsr->diorot);

/* Map device coordinates */

    if ( ! (flags & 0x01)) {
       pldebug("plcpstrm", "mapping parameters: %d %d %d %d %f %f\n",
              plsr->phyxmi, plsr->phyxma, plsr->phyymi, plsr->phyyma,
              plsr->xpmm, plsr->ypmm);
       plsdimap(plsr->phyxmi, plsr->phyxma, plsr->phyymi, plsr->phyyma,
               plsr->xpmm, plsr->ypmm);
    }

/* current color */

    pl_cpcolor(&plsc->curcolor, &plsr->curcolor);

/* cmap 0 */

    plsc->icol0 = plsr->icol0;
    plsc->ncol0 = plsr->ncol0;
    if (plsc->cmap0 != NULL)
       free((void *) plsc->cmap0);

    plsc->cmap0 = (PLColor *) calloc(1, plsc->ncol0 * sizeof(PLColor));
    for (i = 0; i < plsc->ncol0; i++)
       pl_cpcolor(&plsc->cmap0[i], &plsr->cmap0[i]);

/* cmap 1 */

    plsc->icol1 = plsr->icol1;
    plsc->ncol1 = plsr->ncol1;
    if (plsc->cmap1 != NULL)
       free((void *) plsc->cmap1);

    plsc->cmap1 = (PLColor *) calloc(1, plsc->ncol1 * sizeof(PLColor));
    for (i = 0; i < plsc->ncol1; i++) 
       pl_cpcolor(&plsc->cmap1[i], &plsr->cmap1[i]);

/* Initialize if it hasn't been done yet. */

    if (plsc->level == 0)
       plinit();
}

Here is the call graph for this function:

Definition at line 1279 of file plcore.c.

{
    PLINT i;

    for (i = PL_NSTREAMS-1; i >= 0; i--) {
       if (pls[i] != NULL) {
           plsstrm(i);
           c_plend1();
       }
    }
    plfontrel();
#ifdef ENABLE_DYNDRIVERS
/* Release the libltdl resources */
    lt_dlexit();
#endif
}

Here is the call graph for this function:

Definition at line 1305 of file plcore.c.

{
    if (plsc->level > 0) {
       plP_eop();
       plP_tidy();
       plsc->level = 0;
    }

/* Free all malloc'ed stream memory */

    free_mem(plsc->cmap0);
    free_mem(plsc->cmap1);
    free_mem(plsc->plwindow);
    free_mem(plsc->geometry);
    free_mem(plsc->dev);
    free_mem(plsc->BaseName);

/* Free malloc'ed stream if not in initial stream, else clear it out */

    if (ipls > 0) {
       free_mem(plsc);
       pls[ipls] = NULL;
       plsstrm(0);
    }
    else {
       memset((char *) pls[ipls], 0, sizeof(PLStream));
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2434 of file plcore.c.

{
    plsc->famadv = 1;
}

Definition at line 1071 of file plcore.c.

{
    if (plsc->dev_flush) {
       (*plsc->dispatch_table->pl_esc) ( (struct PLStream_struct *) plsc,
                                          PLESC_FLUSH, NULL );
    }
    else {
       if (plsc->OutFile != NULL)
           fflush(plsc->OutFile);
    }
}
void c_plfontld ( PLINT  ifont)

Definition at line 1989 of file plcore.c.

{
    if (ifont != 0)
       ifont = 1;

    if (plsc->level > 0)
       plfntld(ifont);
    else
       initfont = ifont;
}

Here is the call graph for this function:

void c_plgchr ( PLFLT p_def,
PLFLT p_ht 
)

Definition at line 2501 of file plcore.c.

{
    *p_def = plsc->chrdef;
    *p_ht = plsc->chrht;
}
void c_plgcompression ( PLINT compression)

Definition at line 2678 of file plcore.c.

{
    *compression = plsc->dev_compression;
}
void c_plgdev ( char *  p_dev)

Definition at line 2149 of file plcore.c.

{
    strcpy(p_dev, plsc->DevName);
}
void c_plgdidev ( PLFLT p_mar,
PLFLT p_aspect,
PLFLT p_jx,
PLFLT p_jy 
)

Definition at line 883 of file plcore.c.

{
    *p_mar = plsc->mar;
    *p_aspect = plsc->aspect;
    *p_jx = plsc->jx;
    *p_jy = plsc->jy;
}
void c_plgdiori ( PLFLT p_rot)

Definition at line 987 of file plcore.c.

{
    *p_rot = plsc->diorot;
}
void c_plgdiplt ( PLFLT p_xmin,
PLFLT p_ymin,
PLFLT p_xmax,
PLFLT p_ymax 
)

Definition at line 755 of file plcore.c.

{
    *p_xmin = plsc->dipxmin;
    *p_xmax = plsc->dipxmax;
    *p_ymin = plsc->dipymin;
    *p_ymax = plsc->dipymax;
}
void c_plgfam ( PLINT p_fam,
PLINT p_num,
PLINT p_bmax 
)

Definition at line 2408 of file plcore.c.

{
    *p_fam = plsc->family;
    *p_num = plsc->member;
    *p_bmax = plsc->bytemax;
}
void c_plgfnam ( char *  fnam)

Definition at line 2290 of file plcore.c.

{
    if (fnam == NULL) {
       plabort("filename string must be preallocated to >=80 bytes");
       return;
    }

    *fnam = '\0';
    if (plsc->FileName != NULL) {
       strncpy(fnam, plsc->FileName, 79);
       fnam[79] = '\0';
    }
}

Here is the call graph for this function:

void c_plglevel ( PLINT p_level)

Definition at line 2187 of file plcore.c.

{
    *p_level = plsc->level;
}
void c_plgpage ( PLFLT p_xp,
PLFLT p_yp,
PLINT p_xleng,
PLINT p_yleng,
PLINT p_xoff,
PLINT p_yoff 
)

Definition at line 2075 of file plcore.c.

{
    *p_xp = plsc->xdpi;
    *p_yp = plsc->ydpi;
    *p_xleng = plsc->xlength;
    *p_yleng = plsc->ylength;
    *p_xoff = plsc->xoffset;
    *p_yoff = plsc->yoffset;
}
void c_plgstrm ( PLINT p_strm)

Definition at line 1370 of file plcore.c.

{
    *p_strm = ipls;
}
void c_plgver ( char *  p_ver)

Definition at line 2383 of file plcore.c.

{
    strcpy(p_ver, VERSION);
}
void c_plgvpd ( PLFLT p_xmin,
PLFLT p_xmax,
PLFLT p_ymin,
PLFLT p_ymax 
)

Definition at line 2510 of file plcore.c.

{
    *p_xmin = plsc->vpdxmi;
    *p_xmax = plsc->vpdxma;
    *p_ymin = plsc->vpdymi;
    *p_ymax = plsc->vpdyma;
}
void c_plgvpw ( PLFLT p_xmin,
PLFLT p_xmax,
PLFLT p_ymin,
PLFLT p_ymax 
)

Definition at line 2521 of file plcore.c.

{
    *p_xmin = plsc->vpwxmi;
    *p_xmax = plsc->vpwxma;
    *p_ymin = plsc->vpwymi;
    *p_ymax = plsc->vpwyma;
}
void c_plgxax ( PLINT p_digmax,
PLINT p_digits 
)

Definition at line 2447 of file plcore.c.

{
    *p_digmax = plsc->xdigmax;
    *p_digits = plsc->xdigits;
}
void c_plgyax ( PLINT p_digmax,
PLINT p_digits 
)

Definition at line 2465 of file plcore.c.

{
    *p_digmax = plsc->ydigmax;
    *p_digits = plsc->ydigits;
}
void c_plgzax ( PLINT p_digmax,
PLINT p_digits 
)

Definition at line 2483 of file plcore.c.

{
    *p_digmax = plsc->zdigmax;
    *p_digits = plsc->zdigits;
}

Definition at line 1159 of file plcore.c.

{
    PLFLT lx, ly, xpmm_loc, ypmm_loc, aspect_old, aspect_new;
    PLINT mk = 0, sp = 0, inc = 0, del = 2000;

    pllib_init();

    if (plsc->level != 0)
       plend1();

/* Set stream number */

    plsc->ipls = ipls;

/* Set up devices */

    pllib_devinit();

/* Auxiliary stream setup */

    plstrm_init();

/* Initialize device & first page */

    plP_init();
    plP_bop();
    plsc->level = 1;

/* Calculate factor such that the character aspect ratio is preserved 
 * when the overall aspect ratio is changed, i.e., if portrait mode is
 * requested (only honored for subset of drivers) or if the aspect ratio
 * is specified in any way, or if a 90 deg rotation occurs with
 * -freeaspect. */
   
/* Case where plsc->aspect has a value.... (e.g., -a aspect on the
 * command line or 2nd parameter of plsdidev specified) */
    if (plsc->aspect > 0.) {
       lx = plsc->phyxlen / plsc->xpmm;
       ly = plsc->phyylen / plsc->ypmm;
       aspect_old = lx / ly;
       aspect_new = plsc->aspect;
       plsc->caspfactor = sqrt(aspect_old/aspect_new);
    }
/* Case of 90 deg rotations with -freeaspect (this is also how portraite
 * mode is implemented for the drivers that honor -portrait). */
    else if (plsc->freeaspect && ABS(cos(plsc->diorot * PI / 2.)) <= 1.e-5) {
       lx = plsc->phyxlen / plsc->xpmm;
       ly = plsc->phyylen / plsc->ypmm;
       aspect_old = lx / ly;
       aspect_new = ly / lx;
       plsc->caspfactor = sqrt(aspect_old/aspect_new);
    }

    else
       plsc->caspfactor = 1.;

/* Load fonts */

    plsc->cfont = 1;
    plfntld(initfont);

/* Set up subpages */

    plP_subpInit();

/* Set up number of allowed digits before switching to scientific notation */
/* The user can always change this */

    if (plsc->xdigmax == 0)
       plsc->xdigmax = 4;

    if (plsc->ydigmax == 0)
       plsc->ydigmax = 4;

    if (plsc->zdigmax == 0)
       plsc->zdigmax = 3;

/* Switch to graphics mode and set color */

    plgra();
    plcol(1);

    plstyl(0, &mk, &sp);
    plpat(1, &inc, &del);

/* Set clip limits. */

    plsc->clpxmi = plsc->phyxmi;
    plsc->clpxma = plsc->phyxma;
    plsc->clpymi = plsc->phyymi;
    plsc->clpyma = plsc->phyyma;

/* Page aspect ratio. */

    lx = plsc->phyxlen / plsc->xpmm;
    ly = plsc->phyylen / plsc->ypmm;
    plsc->aspdev = lx / ly;

/* Initialize driver interface */

    pldi_ini();

/* Apply compensating factor to original xpmm and ypmm so that 
 * character aspect ratio is preserved when overall aspect ratio
 * is changed.  This must appear here in the code because previous
 * code in this routine and in routines that it calls must use the original
 * values of xpmm and ypmm before the compensating factor is applied.  */

    plP_gpixmm(&xpmm_loc, &ypmm_loc);
    plP_setpxl(xpmm_loc*plsc->caspfactor, ypmm_loc/plsc->caspfactor); 
}

Here is the call graph for this function:

Here is the caller graph for this function:

void c_plmkstrm ( PLINT p_strm)

Definition at line 1389 of file plcore.c.

{
    int i;

    for (i = 1; i < PL_NSTREAMS; i++) {
       if (pls[i] == NULL)
           break;
    }

    if (i == PL_NSTREAMS) {
       fprintf(stderr, "plmkstrm: Cannot create new stream\n");
       *p_strm = -1;
    }
    else {
       *p_strm = i;
       plsstrm(i);
    }
    plstrm_init();
}

Here is the call graph for this function:

void c_plprec ( PLINT  setp,
PLINT  prec 
)

Definition at line 2324 of file plcore.c.

{
    plsc->setpre = setp;
    plsc->precis = prec;
}

Definition at line 2007 of file plcore.c.

{
    if (plsc->plbufFile != NULL) {
       plRemakePlot(plsc);
    }
    else {
       plwarn("plreplot: plot buffer not available");
    }
}

Here is the call graph for this function:

void c_plscompression ( PLINT  compression)

Definition at line 2663 of file plcore.c.

{
  if (plsc->level <= 0) 
     {
      plsc->dev_compression=compression;
     }
}
MZ_DLLEXPORT void c_plsdev ( const char *  devname)

Definition at line 2133 of file plcore.c.

{
    if (plsc->level > 0) {
       plwarn("plsdev: Must be called before plinit.");
       return;
    }
    if (devname != NULL) {
       strncpy(plsc->DevName, devname, sizeof(plsc->DevName) - 1);
       plsc->DevName[sizeof(plsc->DevName) - 1] = '\0';
    }
}

Here is the call graph for this function:

void c_plsdidev ( PLFLT  mar,
PLFLT  aspect,
PLFLT  jx,
PLFLT  jy 
)

Definition at line 775 of file plcore.c.

{
    plsetvar(plsc->mar, mar);
    plsetvar(plsc->aspect, aspect);
    plsetvar(plsc->jx, jx);
    plsetvar(plsc->jy, jy);

    if (mar == 0. && aspect == 0. && jx == 0. && jy == 0. && 
       ! (plsc->difilt & PLDI_ORI)) {
       plsc->difilt &= ~PLDI_DEV;
       return;
    }

    plsc->difilt |= PLDI_DEV;
    pldi_ini();
}

Here is the call graph for this function:

void c_plsdimap ( PLINT  dimxmin,
PLINT  dimxmax,
PLINT  dimymin,
PLINT  dimymax,
PLFLT  dimxpmm,
PLFLT  dimypmm 
)

Definition at line 1002 of file plcore.c.

{
    plsetvar(plsc->dimxmin, dimxmin);
    plsetvar(plsc->dimxmax, dimxmax);
    plsetvar(plsc->dimymin, dimymin);
    plsetvar(plsc->dimymax, dimymax);
    plsetvar(plsc->dimxpmm, dimxpmm);
    plsetvar(plsc->dimypmm, dimypmm);

    plsc->difilt |= PLDI_MAP;
    pldi_ini();
}

Here is the call graph for this function:

void c_plsdiori ( PLFLT  rot)

Definition at line 898 of file plcore.c.

{
    plsc->diorot = rot;
    if (rot == 0.) {
       plsc->difilt &= ~PLDI_ORI;
       pldi_ini();
       return;
    }

    plsc->difilt |= PLDI_ORI;
    pldi_ini();
}

Here is the call graph for this function:

void c_plsdiplt ( PLFLT  xmin,
PLFLT  ymin,
PLFLT  xmax,
PLFLT  ymax 
)

Definition at line 673 of file plcore.c.

{
    plsc->dipxmin = (xmin < xmax) ? xmin : xmax;
    plsc->dipxmax = (xmin < xmax) ? xmax : xmin;
    plsc->dipymin = (ymin < ymax) ? ymin : ymax;
    plsc->dipymax = (ymin < ymax) ? ymax : ymin;

    if (xmin == 0. && xmax == 1. && ymin == 0. && ymax == 1.)  {
       plsc->difilt &= ~PLDI_PLT;
       return;
    }

    plsc->difilt |= PLDI_PLT;
    pldi_ini();
}

Here is the call graph for this function:

void c_plsdiplz ( PLFLT  xmin,
PLFLT  ymin,
PLFLT  xmax,
PLFLT  ymax 
)

Definition at line 696 of file plcore.c.

{
    if (plsc->difilt & PLDI_PLT) {
       xmin = plsc->dipxmin + (plsc->dipxmax - plsc->dipxmin) * xmin;
       ymin = plsc->dipymin + (plsc->dipymax - plsc->dipymin) * ymin;
       xmax = plsc->dipxmin + (plsc->dipxmax - plsc->dipxmin) * xmax;
       ymax = plsc->dipymin + (plsc->dipymax - plsc->dipymin) * ymax;
    }

    plsdiplt(xmin, ymin, xmax, ymax);
}
void c_plsesc ( char  esc)

Definition at line 2348 of file plcore.c.

{
    switch (esc) {
       case '!':            /* ASCII 33 */
       case '#':            /* ASCII 35 */
       case '$':            /* ASCII 36 */
       case '%':            /* ASCII 37 */
       case '&':            /* ASCII 38 */
       case '*':            /* ASCII 42 */
       case '@':            /* ASCII 64 */
       case '^':            /* ASCII 94 */
       case '~':            /* ASCII 126 */
       plsc->esc = esc;
       break;

      default:
       plwarn("plsesc: Invalid escape character, ignoring.");
    }
}

Here is the call graph for this function:

void c_plsfam ( PLINT  fam,
PLINT  num,
PLINT  bmax 
)

Definition at line 2418 of file plcore.c.

{
    if (plsc->level > 0)
       plwarn("plsfam: Must be called before plinit.");

    if (fam >= 0)
       plsc->family = fam;
    if (num >= 0)
       plsc->member = num;
    if (bmax >= 0)
       plsc->bytemax = bmax;
}

Here is the call graph for this function:

MZ_DLLEXPORT void c_plsfnam ( const char *  fnam)

Definition at line 2308 of file plcore.c.

{
    plP_sfnam(plsc, fnam);
}

Here is the call graph for this function:

void c_plsmem ( PLINT  maxx,
PLINT  maxy,
void plotmem 
)

Definition at line 2164 of file plcore.c.

{
    plsc->dev = plotmem;
    plP_setphy (0, maxx, 0, maxy);
}

Here is the call graph for this function:

void c_plsori ( PLINT  ori)

Definition at line 2245 of file plcore.c.

{
    plsdiori((PLFLT) ori);
}
MZ_DLLEXPORT void c_plspage ( PLFLT  xp,
PLFLT  yp,
PLINT  xleng,
PLINT  yleng,
PLINT  xoff,
PLINT  yoff 
)

Definition at line 2090 of file plcore.c.

{
    if (xp)
       plsc->xdpi = xp;
    if (yp)
       plsc->ydpi = yp;

    if (xleng)
       plsc->xlength = xleng;
    if (yleng)
       plsc->ylength = yleng;

    if (xoff)
       plsc->xoffset = xoff;
    if (yoff)
       plsc->yoffset = yoff;

    plsc->pageset = 1;
}
void c_plspause ( PLINT  pause)

Definition at line 2316 of file plcore.c.

{
    plsc->nopause = ! pause;
}
void c_plsstrm ( PLINT  strm)

Definition at line 1342 of file plcore.c.

{
    if (strm < 0 || strm >= PL_NSTREAMS) {
       fprintf(stderr,
              "plsstrm: Illegal stream number %d, must be in [0, %d]\n",
              (int) strm, PL_NSTREAMS);
    }
    else {
       ipls = strm;
       if (pls[ipls] == NULL) {
           pls[ipls] = (PLStream *) malloc((size_t) sizeof(PLStream));
           if (pls[ipls] == NULL)
              plexit("plsstrm: Out of memory.");

           memset((char *) pls[ipls], 0, sizeof(PLStream));
       }
       plsc = pls[ipls];
       plsc->ipls = ipls;
    }
}

Here is the call graph for this function:

void c_plssub ( PLINT  nx,
PLINT  ny 
)

Definition at line 2113 of file plcore.c.

{
    if (nx > 0)
       plsc->nsubx = nx;
    if (ny > 0)
       plsc->nsuby = ny;

/* Force a page advance */

    if (plsc->level > 0) {
        plP_subpInit();
/*AWI  plP_eop();
       plP_bop();*/
    }
}

Here is the call graph for this function:

void c_plstar ( PLINT  nx,
PLINT  ny 
)

Definition at line 1119 of file plcore.c.

{
    pllib_init();

    if (plsc->level != 0)
       plend1();

    plssub(nx, ny);

    c_plinit();
}

Here is the call graph for this function:

void c_plstart ( const char *  devname,
PLINT  nx,
PLINT  ny 
)

Definition at line 1138 of file plcore.c.

{
    pllib_init();

    if (plsc->level != 0)
       plend1();

    plssub(nx, ny);
    plsdev(devname);

    c_plinit();
}

Here is the call graph for this function:

void c_plsxax ( PLINT  digmax,
PLINT  digits 
)

Definition at line 2456 of file plcore.c.

{
    plsc->xdigmax = digmax;
    plsc->xdigits = digits;
}
void c_plsyax ( PLINT  digmax,
PLINT  digits 
)

Definition at line 2474 of file plcore.c.

{
    plsc->ydigmax = digmax;
    plsc->ydigits = digits;
}
void c_plszax ( PLINT  digmax,
PLINT  digits 
)

Definition at line 2492 of file plcore.c.

{
    plsc->zdigmax = digmax;
    plsc->zdigits = digits;
}

Definition at line 2258 of file plcore.c.

{
    if (width != plsc->width && width >= 0) {
       plsc->width = width;

       if (plsc->level > 0) {
           if ( ! plsc->widthlock) 
              plP_state(PLSTATE_WIDTH);
       }
    }
}

Here is the call graph for this function:

static void calc_didev ( void  ) [static]

Definition at line 800 of file plcore.c.

{
    PLFLT lx, ly, aspect, aspdev;
    PLFLT xmin, xmax, xlen, ymin, ymax, ylen;
    PLINT pxmin, pxmax, pymin, pymax, pxlen, pylen;

    if (plsc->dev_di) {
       (*plsc->dispatch_table->pl_esc) ( (struct PLStream_struct *) plsc,
                                          PLESC_DI, NULL );
    }

    if ( ! (plsc->difilt & PLDI_DEV))
       return;

/* Calculate aspect ratio of physical device */

    lx = plsc->phyxlen / plsc->xpmm;
    ly = plsc->phyylen / plsc->ypmm;
    aspdev = lx / ly;

    if (plsc->difilt & PLDI_ORI)
       aspect = plsc->aspori;
    else
       aspect = plsc->aspect;

    if (aspect <= 0.)
       aspect = plsc->aspdev;

/* Failsafe */

    plsc->mar = (plsc->mar > 0.5) ? 0.5 : plsc->mar;
    plsc->mar = (plsc->mar < 0.0) ? 0.0 : plsc->mar;
    plsc->jx = (plsc->jx >  0.5) ?  0.5 : plsc->jx;
    plsc->jx = (plsc->jx < -0.5) ? -0.5 : plsc->jx;
    plsc->jy = (plsc->jy >  0.5) ?  0.5 : plsc->jy;
    plsc->jy = (plsc->jy < -0.5) ? -0.5 : plsc->jy;

/* Relative device coordinates that neutralize aspect ratio difference */

    xlen = (aspect < aspdev) ? (aspect / aspdev) : 1.0;
    ylen = (aspect < aspdev) ? 1.0 : (aspdev / aspect);

    xlen *= (1.0 - 2.*plsc->mar);
    ylen *= (1.0 - 2.*plsc->mar);

    xmin = (1. - xlen) * (0.5 + plsc->jx);
    xmax = xmin + xlen;

    ymin = (1. - ylen) * (0.5 + plsc->jy);
    ymax = ymin + ylen;

/* Calculate transformation coefficients */

    pxmin = plP_dcpcx(xmin);
    pxmax = plP_dcpcx(xmax);
    pymin = plP_dcpcy(ymin);
    pymax = plP_dcpcy(ymax);

    pxlen = pxmax - pxmin;
    pylen = pymax - pymin;
    pxlen = MAX(1, pxlen);
    pylen = MAX(1, pylen);

    plsc->didxax = pxlen / (double) plsc->phyxlen;
    plsc->didyay = pylen / (double) plsc->phyylen;
    plsc->didxb = pxmin - plsc->didxax * plsc->phyxmi;
    plsc->didyb = pymin - plsc->didyay * plsc->phyymi;

/* Set clip limits to conform to new page size */

    plsc->diclpxmi = plsc->didxax * plsc->phyxmi + plsc->didxb;
    plsc->diclpxma = plsc->didxax * plsc->phyxma + plsc->didxb;
    plsc->diclpymi = plsc->didyay * plsc->phyymi + plsc->didyb;
    plsc->diclpyma = plsc->didyay * plsc->phyyma + plsc->didyb;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void calc_dimap ( void  ) [static]

Definition at line 1026 of file plcore.c.

{
    PLFLT lx, ly;
    PLINT pxmin, pxmax, pymin, pymax;
    PLFLT dimxlen, dimylen, pxlen, pylen;

    if ((plsc->dimxmin == plsc->phyxmi) && (plsc->dimxmax == plsc->phyxma) &&
       (plsc->dimymin == plsc->phyymi) && (plsc->dimymax == plsc->phyyma) &&
       (plsc->dimxpmm == plsc->xpmm) && (plsc->dimypmm == plsc->ypmm)) {
       plsc->difilt &= ~PLDI_MAP;
       return;
    }

/* Set default aspect ratio */

    lx = (plsc->dimxmax - plsc->dimxmin + 1) / plsc->dimxpmm;
    ly = (plsc->dimymax - plsc->dimymin + 1) / plsc->dimypmm;

    plsc->aspdev = lx / ly;

/* Build transformation to correct physical coordinates */

    dimxlen = plsc->dimxmax - plsc->dimxmin;
    dimylen = plsc->dimymax - plsc->dimymin;

    pxmin = plsc->phyxmi;
    pxmax = plsc->phyxma;
    pymin = plsc->phyymi;
    pymax = plsc->phyyma;
    pxlen = pxmax - pxmin;
    pylen = pymax - pymin;

    plsc->dimxax = pxlen / dimxlen;
    plsc->dimyay = pylen / dimylen;
    plsc->dimxb = pxmin - pxlen * plsc->dimxmin / dimxlen;
    plsc->dimyb = pymin - pylen * plsc->dimymin / dimylen;
}

Here is the caller graph for this function:

static void calc_diori ( void  ) [static]

Definition at line 919 of file plcore.c.

{
    PLFLT r11, r21, r12, r22, cost, sint;
    PLFLT x0, y0, lx, ly, aspect;

    if (plsc->dev_di) {
       (*plsc->dispatch_table->pl_esc) ( (struct PLStream_struct *) plsc,
                                          PLESC_DI, NULL );
    }

    if ( ! (plsc->difilt & PLDI_ORI))
       return;

/* Center point of rotation */

    x0 = (plsc->phyxma + plsc->phyxmi) / 2.;
    y0 = (plsc->phyyma + plsc->phyymi) / 2.;

/* Rotation matrix */

    r11 = cos(plsc->diorot * PI / 2.);
    r21 = sin(plsc->diorot * PI / 2.);
    r12 = -r21;
    r22 = r11;

    cost = ABS(r11);
    sint = ABS(r21);

/* Flip aspect ratio as necessary.  Grungy but I don't see a better way */

    aspect = plsc->aspect;
    if (aspect == 0.)
       aspect = plsc->aspdev;

    if (plsc->freeaspect)
       plsc->aspori = aspect;
    else
       plsc->aspori = (aspect * cost + sint) / (aspect * sint + cost);

    if ( ! (plsc->difilt & PLDI_DEV)) {
       plsc->difilt |= PLDI_DEV;
       setdef_didev();
    }
    calc_didev();

/* Compute scale factors */

    lx = plsc->phyxlen;
    ly = plsc->phyylen;

/* Transformation coefficients */

    plsc->dioxax = r11;
    plsc->dioxay = r21 * (lx / ly);
    plsc->dioxb = (1. - r11) * x0 - r21 * y0 * (lx / ly);

    plsc->dioyax = r12 * (ly / lx);
    plsc->dioyay = r22;
    plsc->dioyb = (1. - r22) * y0 - r12 * x0 * (ly / lx);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void calc_diplt ( void  ) [static]

Definition at line 720 of file plcore.c.

{
    PLINT pxmin, pxmax, pymin, pymax, pxlen, pylen;

    if (plsc->dev_di) {
       (*plsc->dispatch_table->pl_esc) ( (struct PLStream_struct *) plsc,
                                          PLESC_DI, NULL );
    }

    if ( ! (plsc->difilt & PLDI_PLT))
       return;

    pxmin = plP_dcpcx(plsc->dipxmin);
    pxmax = plP_dcpcx(plsc->dipxmax);
    pymin = plP_dcpcy(plsc->dipymin);
    pymax = plP_dcpcy(plsc->dipymax);

    pxlen = pxmax - pxmin;
    pylen = pymax - pymin;
    pxlen = MAX(1, pxlen);
    pylen = MAX(1, pylen);

    plsc->dipxax = plsc->phyxlen / (double) pxlen;
    plsc->dipyay = plsc->phyylen / (double) pylen;
    plsc->dipxb = plsc->phyxmi - plsc->dipxax * pxmin;
    plsc->dipyb = plsc->phyymi - plsc->dipyay * pymin;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void difilt ( PLINT xscl,
PLINT yscl,
PLINT  npts,
PLINT clpxmi,
PLINT clpxma,
PLINT clpymi,
PLINT clpyma 
)

Definition at line 405 of file plcore.c.

{
    PLINT i, x, y;

/* Map meta coordinates to physical coordinates */

    if (plsc->difilt & PLDI_MAP) {
       for (i = 0; i < npts; i++) {
           xscl[i] = plsc->dimxax * xscl[i] + plsc->dimxb;
           yscl[i] = plsc->dimyay * yscl[i] + plsc->dimyb;
       }
    }

/* Change orientation */

    if (plsc->difilt & PLDI_ORI) {
       for (i = 0; i < npts; i++) {
           x = plsc->dioxax * xscl[i] + plsc->dioxay * yscl[i] + plsc->dioxb;
           y = plsc->dioyax * xscl[i] + plsc->dioyay * yscl[i] + plsc->dioyb;
           xscl[i] = x;
           yscl[i] = y;
       }
    }

/* Change window into plot space */

    if (plsc->difilt & PLDI_PLT) {
       for (i = 0; i < npts; i++) {
           xscl[i] = plsc->dipxax * xscl[i] + plsc->dipxb;
           yscl[i] = plsc->dipyay * yscl[i] + plsc->dipyb;
       }
    }

/* Change window into device space and set clip limits */
/* (this is the only filter that modifies them) */

    if (plsc->difilt & PLDI_DEV) {
       for (i = 0; i < npts; i++) {
           xscl[i] = plsc->didxax * xscl[i] + plsc->didxb;
           yscl[i] = plsc->didyay * yscl[i] + plsc->didyb;
       }
       *clpxmi = plsc->diclpxmi;
       *clpxma = plsc->diclpxma;
       *clpymi = plsc->diclpymi;
       *clpyma = plsc->diclpyma;
    }
    else {
      *clpxmi = plsc->phyxmi;
      *clpxma = plsc->phyxma;
      *clpymi = plsc->phyymi;
      *clpyma = plsc->phyyma;
    }
}

Here is the caller graph for this function:

static void grfill ( short *  x,
short *  y,
PLINT  npts 
) [static]

Definition at line 374 of file plcore.c.

{
    plsc->dev_npts = npts;
    plsc->dev_x = x;
    plsc->dev_y = y;

    (*plsc->dispatch_table->pl_esc) ( (struct PLStream_struct *) plsc,
                                      PLESC_FILL, NULL );
}

Here is the caller graph for this function:

static void grline ( short *  x,
short *  y,
PLINT  npts 
) [static]

Definition at line 360 of file plcore.c.

{
    (*plsc->dispatch_table->pl_line) ( (struct PLStream_struct *) plsc,
                                       x[0], y[0], x[1], y[1] );
}

Here is the caller graph for this function:

static void grpolyline ( short *  x,
short *  y,
PLINT  npts 
) [static]

Definition at line 367 of file plcore.c.

{
    (*plsc->dispatch_table->pl_polyline) ( (struct PLStream_struct *) plsc,
                                           x, y, npts );
}

Here is the caller graph for this function:

void pl_cpcolor ( PLColor to,
PLColor from 
)

Definition at line 1446 of file plcore.c.

{
    to->r = from->r;
    to->g = from->g;
    to->b = from->b;
}

Here is the caller graph for this function:

static void pldi_ini ( void  ) [static]

Definition at line 549 of file plcore.c.

{
    if (plsc->level >= 1) {
       if (plsc->difilt & PLDI_MAP)       /* Coordinate mapping */
           calc_dimap();

       if (plsc->difilt & PLDI_ORI)       /* Orientation */
           calc_diori();
       else
           setdef_diori();

       if (plsc->difilt & PLDI_PLT)       /* Plot window */
           calc_diplt();
       else
           setdef_diplt();

       if (plsc->difilt & PLDI_DEV)       /* Device window */
           calc_didev();
       else
           setdef_didev();
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pldid2pc ( PLFLT xmin,
PLFLT ymin,
PLFLT xmax,
PLFLT ymax 
)

Definition at line 582 of file plcore.c.

{
    PLFLT pxmin, pymin, pxmax, pymax;
    PLFLT sxmin, symin, sxmax, symax;
    PLFLT rxmin, rymin, rxmax, rymax;

    if (plsc->difilt & PLDI_DEV) {

       pldebug("pldid2pc",
              "Relative device coordinates (in): %f, %f, %f, %f\n",
              *xmin, *ymin, *xmax, *ymax);

       pxmin = plP_dcpcx(*xmin);
       pymin = plP_dcpcy(*ymin);
       pxmax = plP_dcpcx(*xmax);
       pymax = plP_dcpcy(*ymax);

       sxmin = (pxmin - plsc->didxb) / plsc->didxax;
       symin = (pymin - plsc->didyb) / plsc->didyay;
       sxmax = (pxmax - plsc->didxb) / plsc->didxax;
       symax = (pymax - plsc->didyb) / plsc->didyay;

       rxmin = plP_pcdcx(sxmin);
       rymin = plP_pcdcy(symin);
       rxmax = plP_pcdcx(sxmax);
       rymax = plP_pcdcy(symax);

       *xmin = (rxmin < 0) ? 0 : rxmin;
       *xmax = (rxmax > 1) ? 1 : rxmax;
       *ymin = (rymin < 0) ? 0 : rymin;
       *ymax = (rymax > 1) ? 1 : rymax;

       pldebug("pldid2pc",
              "Relative plot coordinates (out): %f, %f, %f, %f\n",
              rxmin, rymin, rxmax, rymax);
    }
}

Here is the call graph for this function:

void pldip2dc ( PLFLT xmin,
PLFLT ymin,
PLFLT xmax,
PLFLT ymax 
)

Definition at line 628 of file plcore.c.

{
    PLFLT pxmin, pymin, pxmax, pymax;
    PLFLT sxmin, symin, sxmax, symax;
    PLFLT rxmin, rymin, rxmax, rymax;

    if (plsc->difilt & PLDI_DEV) {

       pldebug("pldip2pc",
              "Relative plot coordinates (in): %f, %f, %f, %f\n",
              *xmin, *ymin, *xmax, *ymax);

       pxmin = plP_dcpcx(*xmin);
       pymin = plP_dcpcy(*ymin);
       pxmax = plP_dcpcx(*xmax);
       pymax = plP_dcpcy(*ymax);

       sxmin = pxmin * plsc->didxax + plsc->didxb;
       symin = pymin * plsc->didyay + plsc->didyb;
       sxmax = pxmax * plsc->didxax + plsc->didxb;
       symax = pymax * plsc->didyay + plsc->didyb;

       rxmin = plP_pcdcx(sxmin);
       rymin = plP_pcdcy(symin);
       rxmax = plP_pcdcx(sxmax);
       rymax = plP_pcdcy(symax);

       *xmin = (rxmin < 0) ? 0 : rxmin;
       *xmax = (rxmax > 1) ? 1 : rxmax;
       *ymin = (rymin < 0) ? 0 : rymin;
       *ymax = (rymax > 1) ? 1 : rymax;

       pldebug("pldip2pc",
              "Relative device coordinates (out): %f, %f, %f, %f\n",
              rxmin, rymin, rxmax, rymax);
    }
}

Here is the call graph for this function:

static int plDispatchSequencer ( const void p1,
const void p2 
) [static]

Definition at line 1609 of file plcore.c.

{
    const PLDispatchTable* t1 = *(PLDispatchTable **) p1;
    const PLDispatchTable* t2 = *(PLDispatchTable **) p2;

/*     printf( "sorting: t1.name=%s t1.seq=%d t2.name=%s t2.seq=%d\n", */
/*             t1->pl_DevName, t1->pl_seq, t2->pl_DevName, t2->pl_seq ); */

    return t1->pl_seq - t2->pl_seq;
}

Here is the caller graph for this function:

static void plgdevlst ( char **  p_menustr,
char **  p_devname,
int p_ndev,
int  type 
) [static]

Definition at line 2047 of file plcore.c.

{
    int i, j;

    pllib_init();

    for (i = j = 0; i < npldrivers; i++) {
       if (type < 0 || dispatch_table[i]->pl_type == type) {
           p_menustr[j] = dispatch_table[i]->pl_MenuStr;
           p_devname[j] = dispatch_table[i]->pl_DevName;
           if (++j + 1 >= *p_ndev) {
               plwarn("plgdevlst:  too many devices");
              break;
             }
       }
    }
    p_menustr[j] = NULL;
    p_devname[j] = NULL;
    *p_ndev = j;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plgDevs ( char ***  p_menustr,
char ***  p_devname,
int p_ndev 
)

Definition at line 2041 of file plcore.c.

{
    plgdevlst(*p_menustr, *p_devname, p_ndev, -1);
}

Here is the call graph for this function:

void plgesc ( char *  p_esc)

Definition at line 2371 of file plcore.c.

{
    if (plsc->esc == '\0')
       plsc->esc = '#';

    *p_esc = plsc->esc;
}

Here is the caller graph for this function:

void plgfile ( FILE **  p_file)

Definition at line 2273 of file plcore.c.

{
    *p_file = plsc->OutFile;
}
void plgFileDevs ( char ***  p_menustr,
char ***  p_devname,
int p_ndev 
)

Definition at line 2029 of file plcore.c.

{
    plgdevlst(*p_menustr, *p_devname, p_ndev, 0);
}

Here is the call graph for this function:

void plgpls ( PLStream **  p_pls)

Definition at line 2173 of file plcore.c.

{
    *p_pls = plsc;
}
static void plInitDispatchTable ( void  ) [static]

Definition at line 1621 of file plcore.c.

{
    int n;

#ifdef ENABLE_DYNDRIVERS
    char buf[300];
    char* drvdir;
    char *devnam, *devdesc, *devtype, *driver, *tag, *seqstr;
    int seq;
    int i, j, driver_found, done=0;
    FILE *fp_drvdb = NULL;
    DIR* dp_drvdir = NULL;
    struct dirent* entry;
    lt_dlhandle dlhand;

/* Open a temporary file in which all the plD_DEVICE_INFO_<driver> strings
   will be stored */
    fp_drvdb = tmpfile ();

/* Open the drivers directory */
    drvdir = plGetDrvDir ();
    dp_drvdir = opendir (drvdir);
    if (dp_drvdir == NULL)
      plabort ("plInitDispatchTable: Could not open drivers directory");

/* Loop over each entry in the drivers directory */

    pldebug ("plInitDispatchTable", "Scanning dyndrivers dir\n");
    while ((entry = readdir (dp_drvdir)) != NULL) 
    {
        char* name = entry->d_name;
        int len = strlen (name) - 3;

            pldebug ("plInitDispatchTable", 
                     "Consider file %s\n", name);

/* Only consider entries that have the ".rc" suffix */
       if ((len > 0) && (strcmp (name + len, ".rc") == 0)) {
           char path[300];
           char buf[300];
            FILE* fd;
        
/* Open the driver's info file */
            sprintf (path, "%s/%s", drvdir, name);
            fd = fopen (path, "r");
            if (fd == NULL) {
               sprintf (buf,
                  "plInitDispatchTable: Could not open driver info file %s\n",
                  name);
               plabort (buf);
           }

/* Each line in the <driver>.rc file corresponds to a specific device.
 * Write it to the drivers db file and take care of leading newline 
 * character */
 
            pldebug ("plInitDispatchTable", 
                     "Opened driver info file %s\n", name);
            while (fgets (buf, 300, fd) != NULL) 
           {
                fprintf (fp_drvdb, "%s", buf);
              if ( buf [strlen (buf) - 1] != '\n' )
                  fprintf (fp_drvdb, "\n");
                npldynamicdevices++;
           }
           fclose (fd);
       }
    }
    
/* Make sure that the temporary file containing the driversr database 
 * is ready to read and close the directory handle */
    fflush (fp_drvdb);
    closedir (dp_drvdir);

#endif

/* Allocate space for the dispatch table. */
    dispatch_table = (PLDispatchTable **) 
       malloc( (nplstaticdevices + npldynamicdevices) * sizeof(PLDispatchTable *) );

/* Initialize the dispatch table entries for the static devices by calling
   the dispatch table initialization function for each static device.  This
   is the same function that would be called at load time for dynamic
   drivers. */

    for( n=0; n < nplstaticdevices; n++ )
    {
        dispatch_table[n] = (PLDispatchTable *)malloc( sizeof(PLDispatchTable) );

        (*static_device_initializers[n])( dispatch_table[n] );
    }
    npldrivers = nplstaticdevices;

#ifdef ENABLE_DYNDRIVERS

/* Allocate space for the device and driver specs.  We may not use all of
 * these driver descriptors, but we obviously won't need more drivers than
 * devices... */
    loadable_device_list = malloc( npldynamicdevices * sizeof(PLLoadableDevice) );
    loadable_driver_list = malloc( npldynamicdevices * sizeof(PLLoadableDriver) );

    rewind( fp_drvdb );

    i = 0;
    done = !(i < npldynamicdevices);
    while( !done ) {
        char *p = fgets( buf, 300, fp_drvdb );

        if (p == 0) {
            done = 1;
            continue;
        }

        devnam  = strtok( buf, ":" );
        devdesc = strtok( 0, ":" );
        devtype = strtok( 0, ":" );
        driver  = strtok( 0, ":" );
        seqstr  = strtok( 0, ":" );
        tag     = strtok( 0, "\n" );

        seq     = atoi(seqstr);

        n = npldrivers++;

        dispatch_table[n] = malloc( sizeof(PLDispatchTable) );

    /* Fill in the dispatch table entries. */
        dispatch_table[n]->pl_MenuStr = plstrdup(devdesc);
        dispatch_table[n]->pl_DevName = plstrdup(devnam);
        dispatch_table[n]->pl_type = atoi(devtype);
        dispatch_table[n]->pl_seq = seq;
        dispatch_table[n]->pl_init = 0;
        dispatch_table[n]->pl_line = 0;
        dispatch_table[n]->pl_polyline = 0;
        dispatch_table[n]->pl_eop = 0;
        dispatch_table[n]->pl_bop = 0;
        dispatch_table[n]->pl_tidy = 0;
        dispatch_table[n]->pl_state = 0;
        dispatch_table[n]->pl_esc = 0;

    /* Add a record to the loadable device list */
        loadable_device_list[i].devnam = plstrdup(devnam);
        loadable_device_list[i].description = plstrdup(devdesc);
        loadable_device_list[i].drvnam = plstrdup(driver);
        loadable_device_list[i].tag = plstrdup(tag);

    /* Now see if this driver has been seen before.  If not, add a driver
     * entry for it. */
        driver_found = 0;
        for( j=0; j < nloadabledrivers; j++ )
            if (strcmp( driver, loadable_driver_list[j].drvnam) == 0)
            {
                driver_found = 1;
                break;
            }

        if (!driver_found)
        {
            loadable_driver_list[nloadabledrivers].drvnam = plstrdup(driver);
            loadable_driver_list[nloadabledrivers].dlhand = 0;
            nloadabledrivers++;
        }

        loadable_device_list[i].drvidx = j;

    /* Get ready for next loadable device spec */
        i++;
    }
    
/* RML: close fp_drvdb */
    fclose (fp_drvdb);

#endif

/* Finally, we need to sort the list into presentation order, based on the
   sequence number in the dispatch ttable entries. */

    qsort( dispatch_table, npldrivers, sizeof(PLDispatchTable*),
           plDispatchSequencer );
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1564 of file plcore.c.

{
    if (plsc->dev_initialized) return;
    plsc->dev_initialized = 1;

    plSelectDev();

    plLoadDriver();

/* offset by one since table is zero-based, but input list is not */
    plsc->dispatch_table = dispatch_table[plsc->device - 1];
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1096 of file plcore.c.

{
    if (lib_initialized) return;
    lib_initialized = 1;

#ifdef ENABLE_DYNDRIVERS
/* Create libltdl resources */
        lt_dlinit();   
#endif

/* Initialize the dispatch table with the info from the static drivers table
   and the available dynamic drivers. */

    plInitDispatchTable();
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void plLoadDriver ( void  ) [static]

Definition at line 1899 of file plcore.c.

{
#ifdef ENABLE_DYNDRIVERS
    int i, drvidx;
    char sym[60];
    char *tag;

    int n=plsc->device - 1;
    PLDispatchTable *dev = dispatch_table[n];
    PLLoadableDriver *driver = 0;

/* If the dispatch table is already filled in, then either the device was
 * linked in statically, or else perhaps it was already loaded.  In either
 * case, we have nothing left to do. */
    if (dev->pl_init)
        return;

    pldebug("plLoadDriver", "Device not loaded!\n");

/* Now search through the list of loadable devices, looking for the record
 * that corresponds to the requested device. */
    for( i=0; i < npldynamicdevices; i++ )
        if (strcmp( dev->pl_DevName, loadable_device_list[i].devnam ) == 0)
            break;

/* If we couldn't find such a record, then there is some sort of internal
 * logic flaw since plSelectDev is supposed to only select a valid device.
 */
    if (i == npldynamicdevices) {
        fprintf( stderr, "No such device: %s.\n", dev->pl_DevName );
        plexit("plLoadDriver detected device logic screwup");
    }

/* Note the device tag, and the driver index. Note that a given driver could
 * supply multiple devices, each with a unique tag to distinguish the driver
 * entry points for the differnet supported devices. */
    tag = loadable_device_list[i].tag;
    drvidx = loadable_device_list[i].drvidx;

    pldebug("plLoadDriver", "tag=%s, drvidx=%d\n", tag, drvidx ); 

    driver = &loadable_driver_list[drvidx];

/* Load the driver if it hasn't been loaded yet. */
    if (!driver->dlhand)
    {
        char drvspec[ 400 ];
        sprintf( drvspec, "%s/%s", plGetDrvDir (), driver->drvnam );

       pldebug("plLoadDriver", "Trying to load %s on %s\n",
              driver->drvnam, drvspec );

        driver->dlhand = lt_dlopenext( drvspec);
    }

/* If it still isn't loaded, then we're doomed. */
    if (!driver->dlhand)
    {
        pldebug("plLoadDriver", "lt_dlopenext failed because of "
               "the following reason:\n%s\n", lt_dlerror ());
        fprintf( stderr, "Unable to load driver: %s.\n", driver->drvnam );
        plexit("Unable to load driver");
    }

/* Now we are ready to ask the driver's device dispatch init function to
   initialize the entries in the dispatch table. */

    sprintf( sym, "plD_dispatch_init_%s", tag );
    {
        PLDispatchInit dispatch_init = (PLDispatchInit) lt_dlsym( driver->dlhand, sym );
        if (!dispatch_init)
        {
            fprintf( stderr,
                     "Unable to locate dispatch table initialization function for driver: %s.\n", 
                   driver->drvnam );
            return;
        }

        (*dispatch_init)( dev );
    }
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plP_bop ( void  )

Definition at line 96 of file plcore.c.

{
    int skip_driver_bop = 0;

    plP_subpInit();
    if (plsc->page_status == AT_BOP)
       return;

    plsc->page_status = AT_BOP;
    plsc->nplwin = 0;

/* Call user bop handler if present. */

    if (plsc->bop_handler != NULL)
       (*plsc->bop_handler) (plsc->bop_data, &skip_driver_bop);

    if (!skip_driver_bop)
       (*plsc->dispatch_table->pl_bop) ((struct PLStream_struct *) plsc);

    if (plsc->plbuf_write)
       plbuf_bop(plsc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PLINT plP_checkdriverinit ( char *  names)

Definition at line 2725 of file plcore.c.

{
char *buff;
char *tok=NULL;
PLINT ret=0;   /* set up return code to 0, the value if no devices match*/

buff=(char *)malloc((size_t) PL_NSTREAMS*8); /* Allocate enough memory for 8 
                                                characters for each possible stream */

if (buff!=NULL)
   {
    memset(buff,0,PL_NSTREAMS*8);    /* Make sure we clear it               */
    plP_getinitdriverlist(buff);     /* Get the list of initialised devices */

    for (tok = strtok(buff, " ,");   /* Check each device against the "name" */
         tok; tok=strtok(0, " ,"))   /* supplied to the subroutine   */
        {
        if (strstr(names,tok)!=NULL)  /* Check to see if the device has been initialised */
           {
            ret++;                   /* Bump the return code if it has      */
           }                    
        }
    free(buff);                      /* Clear up that memory we allocated   */
    }
else 
   ret=-1;                           /* Error flag */

return(ret);
}

Here is the call graph for this function:

void plP_eop ( void  )

Definition at line 69 of file plcore.c.

{
    int skip_driver_eop = 0;

    if (plsc->page_status != DRAWING)
       return;

    plsc->page_status = AT_EOP;

    if (plsc->plbuf_write)
       plbuf_eop(plsc);

/* Call user eop handler if present. */

    if (plsc->eop_handler != NULL)
       (*plsc->eop_handler) (plsc->eop_data, &skip_driver_eop);

    if (!skip_driver_eop)
       (*plsc->dispatch_table->pl_eop) ((struct PLStream_struct *) plsc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plP_esc ( PLINT  op,
void ptr 
)

Definition at line 153 of file plcore.c.

{
    (*plsc->dispatch_table->pl_esc) ((struct PLStream_struct *) plsc, op, ptr);

    if (plsc->plbuf_write)
       plbuf_esc(plsc, op, ptr);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plP_fill ( short *  x,
short *  y,
PLINT  npts 
)

Definition at line 276 of file plcore.c.

{
    PLINT i, clpxmi, clpxma, clpymi, clpyma;

    plsc->page_status = DRAWING;

    if (plsc->plbuf_write) {
       plsc->dev_npts = npts;
       plsc->dev_x = x;
       plsc->dev_y = y;
       plbuf_esc(plsc, PLESC_FILL, NULL);
    }

/* Account for driver ability to do fills */

    if (plsc->patt == 0 && ! plsc->dev_fill0) {
       if ( ! foo) {
           plwarn("Driver does not support hardware solid fills, switching to software fill.\n");
           foo = 1;
       }
       plsc->patt = 8;
       plpsty(plsc->patt);
    }
    if (plsc->dev_fill1) {
       plsc->patt = -ABS(plsc->patt);
    }

/* Perform fill.  Here we MUST NOT allow the software fill to pass through the
   driver interface filtering twice, else we get the infamous 2*rotation for
   software fills on orientation swaps. 
*/

    if (plsc->patt > 0)
       plfill_soft(x, y, npts);

    else {
       if (plsc->difilt) {
           for (i = 0; i < npts; i++) {
              xscl[i] = x[i];
              yscl[i] = y[i];
           }
           difilt(xscl, yscl, npts, &clpxmi, &clpxma, &clpymi, &clpyma);
           plP_plfclp(xscl, yscl, npts, clpxmi, clpxma, clpymi, clpyma,
                     grfill);
       }
       else {
           grfill(x, y, npts);
       }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plP_gclp ( PLINT p_ixmin,
PLINT p_ixmax,
PLINT p_iymin,
PLINT p_iymax 
)

Definition at line 2569 of file plcore.c.

{
    *p_ixmin = plsc->clpxmi;
    *p_ixmax = plsc->clpxma;
    *p_iymin = plsc->clpymi;
    *p_iymax = plsc->clpyma;
}

Here is the caller graph for this function:

void plP_gdom ( PLFLT p_xmin,
PLFLT p_xmax,
PLFLT p_ymin,
PLFLT p_ymax 
)

Definition at line 2536 of file plcore.c.

{
    *p_xmin = plsc->domxmi;
    *p_xmax = plsc->domxma;
    *p_ymin = plsc->domymi;
    *p_ymax = plsc->domyma;
}

Here is the caller graph for this function:

void plP_getinitdriverlist ( char *  names)

Definition at line 2695 of file plcore.c.

{
int i;

for (i=0;i<PL_NSTREAMS;++i)
   {
    if (pls[i]!=NULL)
       {
       if (i==0)
          strcpy(names,pls[i]->DevName);
       else
          { 
          strcat(names," ");
          strcat(names,pls[i]->DevName);
          }
       }
    else 
       break;
   }
}

Here is the caller graph for this function:

void plP_gphy ( PLINT p_ixmin,
PLINT p_ixmax,
PLINT p_iymin,
PLINT p_iymax 
)

Definition at line 2591 of file plcore.c.

{
    *p_ixmin = plsc->phyxmi;
    *p_ixmax = plsc->phyxma;
    *p_iymin = plsc->phyymi;
    *p_iymax = plsc->phyyma;
}

Here is the caller graph for this function:

void plP_gpixmm ( PLFLT p_x,
PLFLT p_y 
)

Definition at line 2622 of file plcore.c.

{
    *p_x = plsc->xpmm;
    *p_y = plsc->ypmm;
}

Here is the caller graph for this function:

void plP_gprec ( PLINT p_setp,
PLINT p_prec 
)

Definition at line 2333 of file plcore.c.

{
    *p_setp = plsc->setpre;
    *p_prec = plsc->precis;
}

Here is the caller graph for this function:

void plP_grange ( PLFLT p_zscl,
PLFLT p_zmin,
PLFLT p_zmax 
)

Definition at line 2547 of file plcore.c.

{
    *p_zscl = plsc->zzscl;
    *p_zmin = plsc->ranmi;
    *p_zmax = plsc->ranma;
}

Here is the caller graph for this function:

void plP_gsub ( PLINT p_nx,
PLINT p_ny,
PLINT p_cs 
)

Definition at line 2602 of file plcore.c.

{
    *p_nx = plsc->nsubx;
    *p_ny = plsc->nsuby;
    *p_cs = plsc->cursub;
}
void plP_gw3wc ( PLFLT p_dxx,
PLFLT p_dxy,
PLFLT p_dyx,
PLFLT p_dyy,
PLFLT p_dyz 
)

Definition at line 2557 of file plcore.c.

{
    *p_dxx = plsc->cxx;
    *p_dxy = plsc->cxy;
    *p_dyx = plsc->cyx;
    *p_dyy = plsc->cyy;
    *p_dyz = plsc->cyz;
}

Here is the caller graph for this function:

void plP_image ( short *  x,
short *  y,
unsigned short *  z,
PLINT  nx,
PLINT  ny,
PLFLT  xmin,
PLFLT  ymin,
PLFLT  dx,
PLFLT  dy,
unsigned short  zmin,
unsigned short  zmax 
)

Definition at line 2766 of file plcore.c.

{
  PLINT i, npts;
  short *xscl, *yscl;
  int   plbuf_write;

  plsc->page_status = DRAWING;

  if (plsc->dev_fastimg == 0) {
    plimageslow(x, y, z, nx-1, ny-1, 
         xmin, ymin, dx, dy, zmin, zmax);
    return ;
  }

  if (plsc->plbuf_write) {
    IMG_DT img_dt;

    img_dt.xmin=xmin;
    img_dt.ymin=ymin;
    img_dt.dx=dx;
    img_dt.dy=dy;

    plsc->dev_ix = x;
    plsc->dev_iy = y;
    plsc->dev_z = z;
    plsc->dev_nptsX = nx;
    plsc->dev_nptsY = ny;
    plsc->dev_zmin = zmin;
    plsc->dev_zmax = zmax;

    plbuf_esc(plsc, PLESC_IMAGE, &img_dt);
  }

  /* avoid re-saving plot buffer while in plP_esc() */
  plbuf_write = plsc->plbuf_write;
  plsc->plbuf_write = 0; 

  npts = nx*ny;
  if (plsc->difilt) { /* isn't this odd? when replaying the plot buffer, e.g., when resizing the window, difilt() is caled again! the plot buffer should already contain the transformed data--it would save a lot of time! (and allow for differently oriented plots when in multiplot mode) */
    PLINT clpxmi, clpxma, clpymi, clpyma;
    
    xscl = (short *) malloc(nx*ny*sizeof(short));
    yscl = (short *) malloc(nx*ny*sizeof(short));
    for (i = 0; i < npts; i++) {
      xscl[i] = x[i];
      yscl[i] = y[i];
    }
    sdifilt(xscl, yscl, npts, &clpxmi, &clpxma, &clpymi, &clpyma);
    plsc->imclxmin = clpxmi;
    plsc->imclymin = clpymi;
    plsc->imclxmax = clpxma;
    plsc->imclymax = clpyma;
    grimage(xscl, yscl, z, nx, ny);    
    free(xscl);
    free(yscl);
  } else { 
    plsc->imclxmin = plsc->phyxmi;
    plsc->imclymin = plsc->phyymi;
    plsc->imclxmax = plsc->phyxma;
    plsc->imclymax = plsc->phyyma;
    grimage(x, y, z, nx, ny );
  }
  plsc->plbuf_write = plbuf_write;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 54 of file plcore.c.

{
    plsc->page_status = AT_EOP;

    (*plsc->dispatch_table->pl_init) ((struct PLStream_struct *) plsc);

    if (plsc->plbuf_write)
       plbuf_init(plsc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plP_line ( short *  x,
short *  y 
)

Definition at line 219 of file plcore.c.

{
    PLINT i, npts = 2, clpxmi, clpxma, clpymi, clpyma;

    plsc->page_status = DRAWING;

    if (plsc->plbuf_write)
       plbuf_line(plsc, x[0], y[0], x[1], y[1]);

    if (plsc->difilt) {
       for (i = 0; i < npts; i++) {
           xscl[i] = x[i];
           yscl[i] = y[i];
       }
       difilt(xscl, yscl, npts, &clpxmi, &clpxma, &clpymi, &clpyma);
       plP_pllclp(xscl, yscl, npts, clpxmi, clpxma, clpymi, clpyma, grline);
    }
    else {
       grline(x, y, npts);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plP_polyline ( short *  x,
short *  y,
PLINT  npts 
)

Definition at line 245 of file plcore.c.

{
    PLINT i, clpxmi, clpxma, clpymi, clpyma;

    plsc->page_status = DRAWING;

    if (plsc->plbuf_write)
       plbuf_polyline(plsc, x, y, npts);

    if (plsc->difilt) {
       for (i = 0; i < npts; i++) {
           xscl[i] = x[i];
           yscl[i] = y[i];
       }
       difilt(xscl, yscl, npts, &clpxmi, &clpxma, &clpymi, &clpyma);
       plP_pllclp(xscl, yscl, npts, clpxmi, clpxma, clpymi, clpyma,
                 grpolyline);
    }
    else {
       grpolyline(x, y, npts);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plP_sclp ( PLINT  ixmin,
PLINT  ixmax,
PLINT  iymin,
PLINT  iymax 
)

Definition at line 2580 of file plcore.c.

{
    plsc->clpxmi = ixmin;
    plsc->clpxma = ixmax;
    plsc->clpymi = iymin;
    plsc->clpyma = iymax;
}

Here is the caller graph for this function:

void plP_setphy ( PLINT  xmin,
PLINT  xmax,
PLINT  ymin,
PLINT  ymax 
)

Definition at line 2642 of file plcore.c.

{
    if (xmin > xmax || ymin > ymax)
       plexit("plP_setphy: device minima must not exceed maxima");

    plsc->phyxmi = xmin;
    plsc->phyxma = xmax;
    plsc->phyymi = ymin;
    plsc->phyyma = ymax;
    plsc->phyxlen = xmax - xmin;
    plsc->phyylen = ymax - ymin;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plP_setpxl ( PLFLT  xpmm,
PLFLT  ypmm 
)

Definition at line 2631 of file plcore.c.

{
    plsc->xpmm = xpmm;
    plsc->ypmm = ypmm;
    plsc->umx = 1000.0 / plsc->xpmm;
    plsc->umy = 1000.0 / plsc->ypmm;
}

Here is the caller graph for this function:

void plP_ssub ( PLINT  nx,
PLINT  ny,
PLINT  cs 
)

Definition at line 2612 of file plcore.c.

{
    plsc->nsubx = nx;
    plsc->nsuby = ny;
    plsc->cursub = cs;
}
void plP_state ( PLINT  op)

Definition at line 142 of file plcore.c.

{
    (*plsc->dispatch_table->pl_state) ((struct PLStream_struct *) plsc, op);

    if (plsc->plbuf_write)
       plbuf_state(plsc, op);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plP_swin ( PLWindow plwin)

Definition at line 166 of file plcore.c.

{
    PLWindow *w;
    PLINT clpxmi, clpxma, clpymi, clpyma;

/* Provide plot buffer with unfiltered window data */

    if (plsc->plbuf_write)
       plbuf_esc(plsc, PLESC_SWIN, (void *) plwin);

    w = &plsc->plwin[plsc->nplwin++ % PL_MAXWINDOWS];

    w->dxmi = plwin->dxmi;
    w->dxma = plwin->dxma;
    w->dymi = plwin->dymi;
    w->dyma = plwin->dyma;

    if (plsc->difilt) {
       xscl[0] = plP_dcpcx(w->dxmi);
       xscl[1] = plP_dcpcx(w->dxma);
       yscl[0] = plP_dcpcy(w->dymi);
       yscl[1] = plP_dcpcy(w->dyma);

       difilt(xscl, yscl, 2, &clpxmi, &clpxma, &clpymi, &clpyma);

       w->dxmi = plP_pcdcx(xscl[0]);
       w->dxma = plP_pcdcx(xscl[1]);
       w->dymi = plP_pcdcy(yscl[0]);
       w->dyma = plP_pcdcy(yscl[1]);
    }

    w->wxmi = plwin->wxmi;
    w->wxma = plwin->wxma;
    w->wymi = plwin->wymi;
    w->wyma = plwin->wyma;

/* If the driver wants to process swin commands, call it now */
/* It must use the filtered data, which it can get from *plsc */

    if (plsc->dev_swin) {
       (*plsc->dispatch_table->pl_esc) ( (struct PLStream_struct *) plsc,
                                          PLESC_SWIN, NULL );
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plP_text ( PLINT  base,
PLFLT  just,
PLFLT xform,
PLINT  x,
PLINT  y,
PLINT  refx,
PLINT  refy,
const char *  string 
)

Definition at line 333 of file plcore.c.

{
    if (plsc->dev_text) {
       EscText args;

       args.base = base;
       args.just = just;
       args.xform = xform;
       args.x = x;
       args.y = y;
       args.refx = refx;
       args.refy = refy;
       args.string = string;

       if (plsc->plbuf_write)
           plbuf_esc(plsc, PLESC_HAS_TEXT, &args);

       plP_esc(PLESC_HAS_TEXT, &args);
#ifndef DEBUG_TEXT
    } else {
#endif
       plstr(base, xform, refx, refy, string);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 122 of file plcore.c.

{
    if (plsc->tidy) {
       (*plsc->tidy) (plsc->tidy_data);
       plsc->tidy = NULL;
       plsc->tidy_data = NULL;
    }

    (*plsc->dispatch_table->pl_tidy) ((struct PLStream_struct *) plsc);

    if (plsc->plbuf_write)
       plbuf_tidy(plsc);

    plsc->OutFile = NULL;
    free_mem(plsc->FileName);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plsbopH ( void(*)(void *, int *)  handler,
void handler_data 
)

Definition at line 2215 of file plcore.c.

{
    plsc->bop_handler = handler;
    plsc->bop_data = handler_data;
}
void plsButtonEH ( void(*)(PLGraphicsIn *, void *, int *)  ButtonEH,
void ButtonEH_data 
)

Definition at line 2205 of file plcore.c.

{
    plsc->ButtonEH = ButtonEH;
    plsc->ButtonEH_data = ButtonEH_data;
}
static void plSelectDev ( void  ) [static]

Definition at line 1814 of file plcore.c.

{
    int dev, i, count, length;
    char response[80];

/* Device name already specified.  See if it is valid. */

    if (*(plsc->DevName) != '\0' && *(plsc->DevName) != '?') {
       length = strlen(plsc->DevName);
       for (i = 0; i < npldrivers; i++) {
           if ((*plsc->DevName == *dispatch_table[i]->pl_DevName) &&
              (strncmp(plsc->DevName,
                      dispatch_table[i]->pl_DevName, length) == 0))
              break;
       }
       if (i < npldrivers) {
           plsc->device = i + 1;
           return;
       }
       else {
           fprintf(stderr, "Requested device %s not available\n",
                  plsc->DevName);
       }
    }

    dev = 0;
    count = 0;

    if (npldrivers == 1)
       dev = 1;

/* User hasn't specified it correctly yet, so we prompt */

    while (dev < 1 || dev > npldrivers) {
       fprintf(stdout, "\nPlotting Options:\n");
       for (i = 0; i < npldrivers; i++) {
           fprintf(stdout, " <%2d> %-10s %s\n", i + 1,
                  dispatch_table[i]->pl_DevName,
                  dispatch_table[i]->pl_MenuStr);
       }
       if (ipls == 0)
           fprintf(stdout, "\nEnter device number or keyword: ");
       else
           fprintf(stdout, "\nEnter device number or keyword (stream %d): ",
                 (int) ipls);

       fgets(response, sizeof(response), stdin);

    /* First check to see if device keyword was entered. */
    /* Final "\n" in response messes things up, so ignore it.  */

       length = strlen(response);
       if (*(response - 1 + length) == '\n')
           length--;

       for (i = 0; i < npldrivers; i++) {
           if ( ! strncmp(response, dispatch_table[i]->pl_DevName,
                        (unsigned int) length))
              break;
       }
       if (i < npldrivers) {
           dev = i + 1;
       }
       else {
           if ((dev = atoi(response)) < 1) {
              fprintf(stdout, "\nInvalid device: %s", response);
              dev = 0;
           }
       }
       if (count++ > 10)
           plexit("plSelectDev: Too many tries.");
    }
    plsc->device = dev;
    strcpy(plsc->DevName, dispatch_table[dev - 1]->pl_DevName);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plseopH ( void(*)(void *, int *)  handler,
void handler_data 
)

Definition at line 2224 of file plcore.c.

{
    plsc->eop_handler = handler;
    plsc->eop_data = handler_data;
}
void plsError ( PLINT errcode,
char *  errmsg 
)

Definition at line 2233 of file plcore.c.

{
    if (errcode != NULL)
       plsc->errcode = errcode;

    if (errmsg != NULL)
       plsc->errmsg = errmsg;
}
void plsfile ( FILE *  file)

Definition at line 2281 of file plcore.c.

{
    plsc->OutFile = file;
}
void plsKeyEH ( void(*)(PLGraphicsIn *, void *, int *)  KeyEH,
void KeyEH_data 
)

Definition at line 2195 of file plcore.c.

{
    plsc->KeyEH = KeyEH;
    plsc->KeyEH_data = KeyEH_data;
}

Definition at line 1426 of file plcore.c.

{
    if ( ! plsc->initialized) {
       plsc->initialized = 1;

       if (plsc->cmap0 == NULL)
           plscmap0n(0);

       if (plsc->cmap1 == NULL)
           plscmap1n(0);
    }
}

Here is the caller graph for this function:

void plsxwin ( PLINT  window_id)

Definition at line 2391 of file plcore.c.

{
    plsc->window_id = window_id;
}
void sdifilt ( short *  xscl,
short *  yscl,
PLINT  npts,
PLINT clpxmi,
PLINT clpxma,
PLINT clpymi,
PLINT clpyma 
)

Definition at line 461 of file plcore.c.

{
  int i;
  short x, y;

/* Map meta coordinates to physical coordinates */

    if (plsc->difilt & PLDI_MAP) {
    for (i = 0; i < npts; i++) {
        xscl[i] = plsc->dimxax * xscl[i] + plsc->dimxb;
        yscl[i] = plsc->dimyay * yscl[i] + plsc->dimyb;
    }
    }

/* Change orientation */

    if (plsc->difilt & PLDI_ORI) {
    for (i = 0; i < npts; i++) {
        x = plsc->dioxax * xscl[i] + plsc->dioxay * yscl[i] + plsc->dioxb;
        y = plsc->dioyax * xscl[i] + plsc->dioyay * yscl[i] + plsc->dioyb;
        xscl[i] = x;
        yscl[i] = y;
    }
    }

/* Change window into plot space */

    if (plsc->difilt & PLDI_PLT) {
    for (i = 0; i < npts; i++) {
        xscl[i] = plsc->dipxax * xscl[i] + plsc->dipxb;
        yscl[i] = plsc->dipyay * yscl[i] + plsc->dipyb;
    }
    }

/* Change window into device space and set clip limits */
/* (this is the only filter that modifies them) */

    if (plsc->difilt & PLDI_DEV) {
    for (i = 0; i < npts; i++) {
        xscl[i] = plsc->didxax * xscl[i] + plsc->didxb;
        yscl[i] = plsc->didyay * yscl[i] + plsc->didyb;
    }
    *clpxmi = plsc->diclpxmi;
    *clpxma = plsc->diclpxma;
    *clpymi = plsc->diclpymi;
    *clpyma = plsc->diclpyma;
    }
    else {
    *clpxmi = plsc->phyxmi;
    *clpxma = plsc->phyxma;
    *clpymi = plsc->phyymi;
    *clpyma = plsc->phyyma;
    }
}

Here is the caller graph for this function:

static void setdef_didev ( ) [static]

Definition at line 534 of file plcore.c.

{
    plsc->mar = 0.0;
    plsc->aspect = 0.0;
    plsc->jx = 0.0;
    plsc->jy = 0.0;
}

Here is the caller graph for this function:

static void setdef_diori ( ) [static]

Definition at line 543 of file plcore.c.

{
    plsc->diorot = 0.;
}

Here is the caller graph for this function:

static void setdef_diplt ( ) [static]

Definition at line 525 of file plcore.c.

{
    plsc->dipxmin = 0.0;
    plsc->dipxmax = 1.0;
    plsc->dipymin = 0.0;
    plsc->dipymax = 1.0;
}

Here is the caller graph for this function:


Variable Documentation

int foo [static]

Definition at line 273 of file plcore.c.