Back to index

radiance  4R0+20100331
Classes | Defines | Typedefs | Functions | Variables
meta.h File Reference
#include "copyright.h"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include "rterror.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  primitive
struct  plist

Defines

#define TRUE   1
#define FALSE   0
#define PEOF   'F' /* end of file global */
#define PEOP   'E' /* end of page global */
#define PPAUS   'P' /* pause global */
#define PDRAW   'D' /* draw global */
#define POPEN   'O' /* open segment */
#define PCLOSE   'C' /* close segment */
#define PSET   'S' /* set global */
#define PUNSET   'U' /* unset global */
#define PRESET   'R' /* reset global to default */
#define PINCL   'I' /* include file */
#define PLSEG   'l' /* line segment command */
#define PRFILL   'r' /* rectangle fill command */
#define PTFILL   't' /* triangle fill command */
#define PMSTR   'm' /* matrix string command */
#define PVSTR   'v' /* vector string command */
#define PSEG   's' /* print segment command */
#define PPFILL   'p' /* polygon fill command */
#define NCOMMANDS   17 /* number of commands */
#define COML   "lrtmsvpOCESURPDIF" /* command letters */
#define ADELIM   '`' /* additional argument delimiter */
#define CDELIM   '#' /* comment delimiter */
#define MAXARGS   2048 /* maximum argument string for primitive */
#define SALL   0 /* set all */
#define SPAT0   04 /* set pattern 0 */
#define SPAT1   05 /* set pattern 1 */
#define SPAT2   06 /* set pattern 2 */
#define SPAT3   07 /* set pattern 3 */
#define TDIR   "/tmp/" /* directory for temporary files */
#define MDIR   "/usr/local/lib/meta/" /* directory for metafiles */
#define TTY   "/dev/tty" /* console name */
#define MAXFNAME   64 /* maximum file name length */
#define XYSIZE   (1<<14) /* metafile coordinate size */
#define max(x, y)   ((x) > (y) ? (x) : (y))
#define min(x, y)   ((x) < (y) ? (x) : (y))
#define abs(x)   ((x) < 0 ? -(x) : (x))
#define iscom(c)   (comndx(c) != -1)
#define isglob(c)   isupper(c)
#define isprim(c)   islower(c)
#define WIDTH(wspec)   ((wspec)==0 ? 0 : 12*(1<<(wspec)))
#define CONV(coord, size)   ((int)(((long)(coord)*(size))>>14))
#define ICONV(dcoord, size)   ((int)(((long)(dcoord)<<14)/(size)))
#define XMN   0 /* index in xy array for xmin */
#define YMN   1 /* index in xy array for ymin */
#define XMX   2 /* index in xy array for xmax */
#define YMX   3 /* index in xy array for ymax */

Typedefs

typedef struct primitive
typedef struct plist

Functions

char * savestr ()
PRIMITIVE * pop ()
FILE * efopen ()
FILE * mfopen ()
void expand (FILE *infp, short *exlist)
PRIMITIVE * palloc (void)
void pfree (PRIMITIVE *p)
void plfree (PLIST *pl)
void sort (FILE *infp, int(*pcmp)())
void pmergesort (FILE *fi[], int nf, PLIST *pl, int(*pcmp)(), FILE *ofp)
void mdraw (int x, int y)
void msegment (int xmin, int ymin, int xmax, int ymax, char *sname, int d, int thick, int color)
void mvstr (int xmin, int ymin, int xmax, int ymax, char *s, int d, int thick, int color)
void mtext (int x, int y, char *s, int cpi, int color)
void mpoly (int x, int y, int border, int pat, int color)
void mtriangle (int xmin, int ymin, int xmax, int ymax, int d, int pat, int color)
void mrectangle (int xmin, int ymin, int xmax, int ymax, int pat, int color)
void mline (int x, int y, int type, int thick, int color)
void mcloseseg (void)
void mopenseg (char *sname)
void msetpat (int pn, char *pat)
void minclude (char *fname)
void mdone (void)
void mendpage (void)
int comndx (int c)
PRIMITIVE * pop (PLIST *pl)
void push (PRIMITIVE *p, PLIST *pl)
void add (PRIMITIVE *p, PLIST *pl)
void append (PLIST *pl1, PLIST *pl2)
void fargs (PRIMITIVE *p)
char * nextscan (char *start, char *format, char *result)
void mcopy (char *p1, char *p2, int n)
int inseg (void)
void closeseg (void)
void openseg (char *name)
void segprim (PRIMITIVE *p)
void segment (PRIMITIVE *p, void(*funcp)(PRIMITIVE *p))
int xlate (short extrema, PRIMITIVE *p, PRIMITIVE *px)
void cgraph (int width, int length)
void cplot (void)
void cpoint (int c, double x, double y)
void gcalc (char *types)
int readp (PRIMITIVE *p, FILE *fp)
void writep (PRIMITIVE *p, FILE *fp)
void writeof (FILE *fp)

Variables

char coms []
char errmsg []
char * progname

Class Documentation

struct primitive

Definition at line 102 of file meta.h.

Collaboration diagram for primitive:
Class Members
short arg0
char * args
short com
struct primitive * pnext
int xy
struct plist

Definition at line 112 of file meta.h.

Class Members
PRIMITIVE * pbot
PRIMITIVE * ptop

Define Documentation

#define abs (   x)    ((x) < 0 ? -(x) : (x))

Definition at line 82 of file meta.h.

#define ADELIM   '`' /* additional argument delimiter */

Definition at line 46 of file meta.h.

#define CDELIM   '#' /* comment delimiter */

Definition at line 47 of file meta.h.

#define COML   "lrtmsvpOCESURPDIF" /* command letters */

Definition at line 44 of file meta.h.

#define CONV (   coord,
  size 
)    ((int)(((long)(coord)*(size))>>14))

Definition at line 89 of file meta.h.

#define FALSE   0

Definition at line 21 of file meta.h.

#define ICONV (   dcoord,
  size 
)    ((int)(((long)(dcoord)<<14)/(size)))

Definition at line 90 of file meta.h.

#define iscom (   c)    (comndx(c) != -1)

Definition at line 84 of file meta.h.

#define isglob (   c)    isupper(c)

Definition at line 85 of file meta.h.

#define isprim (   c)    islower(c)

Definition at line 86 of file meta.h.

#define max (   x,
 
)    ((x) > (y) ? (x) : (y))

Definition at line 76 of file meta.h.

#define MAXARGS   2048 /* maximum argument string for primitive */

Definition at line 49 of file meta.h.

#define MAXFNAME   64 /* maximum file name length */

Definition at line 71 of file meta.h.

#define MDIR   "/usr/local/lib/meta/" /* directory for metafiles */

Definition at line 66 of file meta.h.

#define min (   x,
 
)    ((x) < (y) ? (x) : (y))

Definition at line 79 of file meta.h.

#define NCOMMANDS   17 /* number of commands */

Definition at line 42 of file meta.h.

#define PCLOSE   'C' /* close segment */

Definition at line 28 of file meta.h.

#define PDRAW   'D' /* draw global */

Definition at line 26 of file meta.h.

#define PEOF   'F' /* end of file global */

Definition at line 23 of file meta.h.

#define PEOP   'E' /* end of page global */

Definition at line 24 of file meta.h.

#define PINCL   'I' /* include file */

Definition at line 32 of file meta.h.

#define PLSEG   'l' /* line segment command */

Definition at line 34 of file meta.h.

#define PMSTR   'm' /* matrix string command */

Definition at line 37 of file meta.h.

#define POPEN   'O' /* open segment */

Definition at line 27 of file meta.h.

#define PPAUS   'P' /* pause global */

Definition at line 25 of file meta.h.

#define PPFILL   'p' /* polygon fill command */

Definition at line 40 of file meta.h.

#define PRESET   'R' /* reset global to default */

Definition at line 31 of file meta.h.

#define PRFILL   'r' /* rectangle fill command */

Definition at line 35 of file meta.h.

#define PSEG   's' /* print segment command */

Definition at line 39 of file meta.h.

#define PSET   'S' /* set global */

Definition at line 29 of file meta.h.

#define PTFILL   't' /* triangle fill command */

Definition at line 36 of file meta.h.

#define PUNSET   'U' /* unset global */

Definition at line 30 of file meta.h.

#define PVSTR   'v' /* vector string command */

Definition at line 38 of file meta.h.

#define SALL   0 /* set all */

Definition at line 51 of file meta.h.

#define SPAT0   04 /* set pattern 0 */

Definition at line 52 of file meta.h.

#define SPAT1   05 /* set pattern 1 */

Definition at line 53 of file meta.h.

#define SPAT2   06 /* set pattern 2 */

Definition at line 54 of file meta.h.

#define SPAT3   07 /* set pattern 3 */

Definition at line 55 of file meta.h.

#define TDIR   "/tmp/" /* directory for temporary files */

Definition at line 64 of file meta.h.

#define TRUE   1

Definition at line 20 of file meta.h.

#define TTY   "/dev/tty" /* console name */

Definition at line 68 of file meta.h.

#define WIDTH (   wspec)    ((wspec)==0 ? 0 : 12*(1<<(wspec)))

Definition at line 88 of file meta.h.

#define XMN   0 /* index in xy array for xmin */

Definition at line 92 of file meta.h.

#define XMX   2 /* index in xy array for xmax */

Definition at line 94 of file meta.h.

#define XYSIZE   (1<<14) /* metafile coordinate size */

Definition at line 73 of file meta.h.

#define YMN   1 /* index in xy array for ymin */

Definition at line 93 of file meta.h.

#define YMX   3 /* index in xy array for ymax */

Definition at line 95 of file meta.h.


Typedef Documentation

typedef struct plist

Definition at line 116 of file meta.h.

typedef struct primitive

Definition at line 110 of file meta.h.


Function Documentation

void add ( PRIMITIVE *  p,
PLIST *  pl 
)

Here is the caller graph for this function:

void append ( PLIST *  pl1,
PLIST *  pl2 
)

Here is the caller graph for this function:

void cgraph ( int  width,
int  length 
)

Definition at line 39 of file cgraph.c.

{
       if (width * length > MAXSIZE) {
              fprintf(stderr, "%s: page too big\n", progname);
              quit(1);
       }
       dwidth = width;
       dlength = length;
       climits();                  /* get min & max values */
       cplot();                    /* do character plot */
}

Here is the call graph for this function:

Here is the caller graph for this function:

void closeseg ( void  )

Definition at line 153 of file segment.c.

{
    register int  i;
    
    if (!inseg())
        error(SYSTEM, "illegal call to closeseg");
        
                            /* undefine internal declarations */
    for (i = dectop; i > curdec; i--) {
       hashtabl[hash(dectabl[i].sname)] = dectabl[i].nexthash;
       freestr(dectabl[i].sname);
       plfree(&dectabl[i].sprims);
    }
    dectop = curdec;
                            /* define this declaration */
    i = hash(dectabl[curdec].sname);
    dectabl[curdec].nexthash = hashtabl[i];
    hashtabl[i] = curdec;
                            /* return context */
    curdec = dectabl[curdec].context;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int comndx ( int  c)

Here is the caller graph for this function:

void cplot ( void  )

Definition at line 120 of file cgraph.c.

{
       int  i, j;
       register char  *op;

       for (op = outcarr+dlength*dwidth; op > outcarr; )
              *--op = ' ';

       for (i = 0; i < MAXCUR; i++)
              mgcurve(i, cpoint);

       for (i = 0; i < dlength; i++) {
              for (j = 0; j < dwidth; j++)
                     putchar(*op++);
              putchar('\n');
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void cpoint ( int  c,
double  x,
double  y 
)

Definition at line 140 of file cgraph.c.

{
       register int  ndx;

       if (x < xmin || x > xmax || y < ymin || y > ymax)
              return;

       ndx = (dlength-1)*(1.0 - (y - ymin)/(ymax - ymin)) + 0.5;
       ndx = dwidth*ndx + (dwidth-1)*(x-xmin)/(xmax-xmin) + 0.5;

       if (outcarr[ndx] == ' ')
              outcarr[ndx] = c+'A';
       else if (outcarr[ndx] > '1' && outcarr[ndx] < '9')
              outcarr[ndx]++;
       else if (outcarr[ndx] == '9')
              outcarr[ndx] = '*';
       else if (outcarr[ndx] != '*')
              outcarr[ndx] = '2';
}

Here is the caller graph for this function:

FILE* efopen ( )

Here is the caller graph for this function:

void expand ( FILE *  infp,
short *  exlist 
)

Definition at line 39 of file expand.c.

{
 static PRIMITIVE  pincl = {PINCL, 02, {-1, -1, -1, -1}, VINPUT, NULL};
 static short  vcloaded = FALSE;

 xlist = exlist;

 if (exlist[comndx(PVSTR)] == 1 && !vcloaded) {
    vcloaded = TRUE;
    exprim(&pincl);
    }

 exfile(infp);

 if (inseg())
    error(USER, "unclosed segment in expand");
    
 }

Here is the call graph for this function:

void fargs ( PRIMITIVE *  p)

Here is the caller graph for this function:

void gcalc ( char *  types)

Definition at line 27 of file gcalc.c.

{
       int  i;

       if (strchr(types, 'h') == NULL)
              gcheader(types);
       
       xmin = gparam[XMIN].flags & DEFINED ?
                     varvalue(gparam[XMIN].name) :
                     -1e10;
       xmax = gparam[XMAX].flags & DEFINED ?
                     varvalue(gparam[XMAX].name) :
                     1e10;

       for (i = 0; i < MAXCUR; i++) {
              xsum = xxsum = ysum = yysum = xysum = 0.0;
              rsum = 0.0;
              npts = 0;
              mgcurve(i, calcpoint);
              gcvalue(i, types);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

int inseg ( void  )

Definition at line 81 of file segment.c.

{

    return(curdec != NODEC);
}

Here is the caller graph for this function:

void mcloseseg ( void  )

Definition at line 83 of file metacalls.c.

{
    pflush();
    pglob(PCLOSE, 0200, NULL);
}

Here is the call graph for this function:

void mcopy ( char *  p1,
char *  p2,
int  n 
)

Here is the caller graph for this function:

void mdone ( void  )

Definition at line 46 of file metacalls.c.

{
    pflush();
    pglob(PEOF, 0200, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void mdraw ( int  x,
int  y 
)

Definition at line 194 of file metacalls.c.

{
    if (inpoly) {
       polyval(x, y);
    } else if (x != curx || y != cury) {
       plseg(cura0, curx, cury, x, y);
       curx = x;
       cury = y;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void mendpage ( void  )

Definition at line 39 of file metacalls.c.

{
    pflush();
    pglob(PEOP, 0200, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

FILE * mfopen ( )

Here is the caller graph for this function:

void minclude ( char *  fname)

Definition at line 53 of file metacalls.c.

{
    pflush();
    pglob(PINCL, 1, fname);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void mline ( int  x,
int  y,
int  type,
int  thick,
int  color 
)

Definition at line 91 of file metacalls.c.

{
    pflush();
    cura0 = (type<<4 & 060) | (thick<<2 & 014) | (color & 03);
    curx = x;
    cury = y;
}

Here is the caller graph for this function:

void mopenseg ( char *  sname)

Definition at line 73 of file metacalls.c.

{
    pflush();
    pglob(POPEN, 0, sname);
}

Here is the call graph for this function:

void mpoly ( int  x,
int  y,
int  border,
int  pat,
int  color 
)

Definition at line 128 of file metacalls.c.

{
    pflush();
    cura0 = (border<<6 & 0100) | (pat<<2 & 014) | (color & 03);
    cap = curargs;
    inpoly = TRUE;
    putdec(x);
    *cap++ = ' ';
    putdec(y);
}
void mrectangle ( int  xmin,
int  ymin,
int  xmax,
int  ymax,
int  pat,
int  color 
)

Definition at line 104 of file metacalls.c.

{
    pflush();
    cura0 = (pat<<2 & 014) | (color & 03);
    pprim(PRFILL, cura0, xmin, ymin, xmax, ymax, NULL);
}

Here is the call graph for this function:

void msegment ( int  xmin,
int  ymin,
int  xmax,
int  ymax,
char *  sname,
int  d,
int  thick,
int  color 
)

Definition at line 181 of file metacalls.c.

{
    pflush();
    cura0 = (let_dir(d)<<4 & 060) | (thick<<2 & 014) | (color & 03);
    pprim(PSEG, cura0, xmin, ymin, xmax, ymax, sname);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void msetpat ( int  pn,
char *  pat 
)

Definition at line 62 of file metacalls.c.

{
    pflush();
    pglob(PSET, pn+4, pat);
}

Here is the call graph for this function:

void mtext ( int  x,
int  y,
char *  s,
int  cpi,
int  color 
)

Definition at line 144 of file metacalls.c.

{
    pflush();
    cura0 = (color & 03);
    if (cpi < 10) {
       cura0 += 04;
       cpi *= 2;
    }
    if (cpi > 11)
       cura0 += 020;
    if (cpi > 14)
       cura0 += 020;
    if (cpi > 18)
       cura0 += 020;
    pprim(PMSTR, cura0, x, y, x, y, s);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void mtriangle ( int  xmin,
int  ymin,
int  xmax,
int  ymax,
int  d,
int  pat,
int  color 
)

Definition at line 116 of file metacalls.c.

{
    pflush();
    cura0 = (let_dir(d)<<4 & 060) | (pat<<2 & 014) | (color & 03);
    pprim(PTFILL, cura0, xmin, ymin, xmax, ymax, NULL);
}

Here is the call graph for this function:

void mvstr ( int  xmin,
int  ymin,
int  xmax,
int  ymax,
char *  s,
int  d,
int  thick,
int  color 
)

Definition at line 168 of file metacalls.c.

{
    pflush();
    cura0 = (let_dir(d)<<4 & 060) | (thick<<2 & 014) | (color & 03);
    pprim(PVSTR, cura0, xmin, ymin, xmax, ymax, s);
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* nextscan ( char *  start,
char *  format,
char *  result 
)

Here is the caller graph for this function:

void openseg ( char *  name)

Definition at line 91 of file segment.c.

{
    register int  olddec;

    if ((olddec = lookup(name)) != NODEC &&
              dectabl[olddec].context == curdec) /* redefined segment */
        plfree(&dectabl[olddec].sprims);

    if (++dectop >= MAXDEC)
       error(SYSTEM, "too many segments in openseg");

    dectabl[dectop].sname = savestr(name);
                            /* save previous context */
    dectabl[dectop].context = curdec;
    curdec = dectop;
    
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRIMITIVE* palloc ( void  )

Definition at line 26 of file palloc.c.

{
    register PRIMITIVE  *p;

    if (maxalloc > 0 && nalloc >= maxalloc)
       return(NULL);

    if ((p = pop(&freelist)) == NULL) {
       if (morefree())
           p = pop(&freelist);
       else {
           sprintf(errmsg, "out of memory in palloc (nalloc = %d)", nalloc);
           error(SYSTEM, errmsg);
       }
    }

    nalloc++;
    return(p);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pfree ( PRIMITIVE *  p)

Here is the caller graph for this function:

void plfree ( PLIST *  pl)

Here is the caller graph for this function:

void pmergesort ( FILE *  fi[],
int  nf,
PLIST *  pl,
int(*)()  pcmp,
FILE *  ofp 
)

Definition at line 84 of file sort.c.

{
    PRIMITIVE  *plp;        /* position in list */
    PRIMITIVE  *pp[NFILES]; /* input primitives */
    int  minf = 0;
    PRIMITIVE  *minp;
    register int i;

    if (pl == NULL)
       plp = NULL;                 /* initialize list */
    else
       plp = pl->ptop;

    for (i = 0; i < nf; i++) {            /* initialize input files */
       if ((pp[i] = palloc()) == NULL)
           error(SYSTEM, "memory exhausted in pmergesort");
       readp(pp[i], fi[i]);
    }

    for ( ; ; ) {

       if (plp != NULL && isprim(plp->com))
           minp = plp;
       else
           minp = NULL;

       for (i = 0; i < nf; i++)
           if (isprim(pp[i]->com) &&
                     (minp == NULL || (*pcmp)(&pp[i], &minp) < 0))
              minp = pp[minf=i];

       if (minp == NULL)
           break;

       writep(minp, ofp);

       if (minp == plp)
           plp = plp->pnext;
       else {
           fargs(pp[minf]);
           readp(pp[minf], fi[minf]);
       }
    }

    if (plp != NULL && plp->com != PEOF)
       writep(plp, ofp);

    for (i = 0; i < nf; i++) {
       if (pp[i]->com != PEOF)
           writep(pp[i], ofp);
       pfree(pp[i]);
    }

}

Here is the call graph for this function:

Here is the caller graph for this function:

PRIMITIVE* pop ( )

Here is the caller graph for this function:

PRIMITIVE* pop ( PLIST *  pl)
void push ( PRIMITIVE *  p,
PLIST *  pl 
)

Here is the caller graph for this function:

int readp ( PRIMITIVE *  p,
FILE *  fp 
)

Definition at line 17 of file hfio.c.

{
 char  inbuf[MAXARGS];
 register int  c, nargs;
 int  tmp;

 if (fp == NULL) fp = stdin;

 restart:
 
 if ((c = getc(fp)) == EOF) {             /* used to be fatal */
    mcopy((char *)p, (char *)&peof, sizeof(PRIMITIVE));
    return(0);
 }

 if (c == CDELIM) {                /* skip user comment */
    fgets(inbuf, MAXARGS, fp);
    goto restart;
 } else if (c == '\n')                    /* skip empty line */
    goto restart;
    
 if (!iscom(c))
    error(USER, "bad command in readp");

 p->com = c;

 fscanf(fp, "%o", &tmp);
 p->arg0 = tmp & 0377;

 if (isglob(c))
    p->xy[XMN] = p->xy[YMN] = p->xy[XMX] = p->xy[YMX] = -1;
 else if (fscanf(fp, "%d %d %d %d", &p->xy[XMN], &p->xy[YMN],
                            &p->xy[XMX], &p->xy[YMX]) != 4)
    error(USER, "missing extent in readp");

 while ((c = getc(fp)) != EOF && c != '\n' && c != ADELIM);

 nargs = 0;

 if (c == ADELIM)
    while ((c = getc(fp)) != EOF && c != '\n' && nargs < MAXARGS-1)
       inbuf[nargs++] = c;

 if (nargs >= MAXARGS)
     error(USER, "too many arguments in readp");

 if (nargs)  {
    inbuf[nargs] = '\0';
    p->args = savestr(inbuf);
    }
 else
    p->args = NULL;

 return(p->com != PEOF);
 }

Here is the call graph for this function:

char* savestr ( )
void segment ( PRIMITIVE *  p,
void(*)(PRIMITIVE *p)  funcp 
)

Definition at line 179 of file segment.c.

{
    int              decln;
    PRIMITIVE curp;
    register PRIMITIVE      *sp;

    if ((decln = lookup(p->args)) == NODEC)  {
       sprintf(errmsg, "reference to undefined segment \"%s\" in segment",
                                          p->args);
       error(USER, errmsg);
    }

    for (sp = dectabl[decln].sprims.ptop; sp != NULL; sp = sp->pnext)

       if (isglob(sp->com))

           (*funcp)(sp);

       else {

           switch (curp.com = sp->com) {

              case PSEG:
              case PVSTR:
              case PTFILL:
              case PPFILL:
                  curp.arg0 = (sp->arg0 & 0100) |
                            (((sp->arg0 & 060) + p->arg0) & 060);
                  break;

              case PLSEG:
                  if (p->arg0 & 020)
                     curp.arg0 = (~sp->arg0 & 0100) | (sp->arg0 & 060);
                  else
                     curp.arg0 = sp->arg0 & 0160;
                  break;

              default:
                  curp.arg0 = sp->arg0 & 0160;
                  break;
           }
           if (p->arg0 & 014)
              curp.arg0 |= p->arg0 & 014;
           else
              curp.arg0 |= sp->arg0 & 014;
           if (p->arg0 & 03)
              curp.arg0 |= p->arg0 & 03;
           else
              curp.arg0 |= sp->arg0 & 03;

           curp.xy[XMN] = xlate(XMN, sp, p);
           curp.xy[YMN] = xlate(YMN, sp, p);
           curp.xy[XMX] = xlate(XMX, sp, p);
           curp.xy[YMX] = xlate(YMX, sp, p);
           curp.args = sp->args;

            (*funcp)(&curp);
       }

}

Here is the call graph for this function:

Here is the caller graph for this function:

void segprim ( PRIMITIVE *  p)

Here is the caller graph for this function:

void sort ( FILE *  infp,
int(*)()  pcmp 
)

Definition at line 33 of file sort.c.

{
 PRIMITIVE  *prims[PBSIZE];        /* pointers to primitives */
 PLIST  primlist;                  /* our primitives list */
 int  nprims;
 short  done;

 do  {

    for (nprims = 0; nprims < PBSIZE; nprims++)  {      /* read to global */

       if ((prims[nprims] = palloc()) == NULL)
          error(SYSTEM, "memory exhausted in sort");

       readp(prims[nprims], infp);

       if (isglob(prims[nprims]->com))
         break;
       }

       qsort(prims, nprims, sizeof(*prims), pcmp);      /* sort pointer array */

       if (nprims < PBSIZE)               /* tack on global if one */
           nprims++;

       order(prims, nprims, &primlist);   /* make array into list */

       sendsort(&primlist, pcmp);         /* send to merge sorter */

       done = primlist.pbot->com == PEOF;

       plfree(&primlist);                 /* free up array */

    }  while (!done);

 }

Here is the call graph for this function:

Here is the caller graph for this function:

void writeof ( FILE *  fp)

Definition at line 115 of file hfio.c.

{

 writep(&peof, fp);

}
void writep ( PRIMITIVE *  p,
FILE *  fp 
)
int xlate ( short  extrema,
PRIMITIVE *  p,
PRIMITIVE *  px 
)

Here is the caller graph for this function:


Variable Documentation

char coms[]

Definition at line 13 of file misc.c.

char errmsg[]

Definition at line 21 of file error.c.

char* progname

Definition at line 21 of file histo.c.