Back to index

radiance  4R0+20100331
Functions | Variables
psmeta.c File Reference
#include "meta.h"
#include "plot.h"
#include "psplot.h"

Go to the source code of this file.

Functions

static void doprim (PRIMITIVE *p)
static int doglobal (PRIMITIVE *g)
int main (int argc, char **argv)
void plot (FILE *infp)

Variables

static const char RCSid [] = "$Id: psmeta.c,v 1.4 2003/11/15 02:13:37 schorsch Exp $"
char * progname
static short newpage = TRUE

Function Documentation

int doglobal ( PRIMITIVE *  g) [static]

Definition at line 74 of file psmeta.c.

{
       FILE  *fp = NULL;

       switch (g->com) {

       case PEOF:
              return(0);

       case PPAUS:
              break;

       case PINCL:
              if (g->args == NULL)
                  error(USER, "missing include file name in include");
              if (g->arg0 == 2 || (fp = fopen(g->args, "r")) == NULL) {
                  if (g->arg0 != 0)
                     fp = mfopen(g->args, "r");
                  else {
                     sprintf(errmsg, "cannot open user include file \"%s\"",
                                   g->args);
                     error(USER, errmsg);
                  }
              }
              plot(fp);
              fclose(fp);
              break;

       case PDRAW:
              fflush(stdout);
              break;

       case PEOP:
              endpage();
              newpage = TRUE;
              break;

       case PSET:
              set(g->arg0, g->args);
              break;

       case PUNSET:
              unset(g->arg0);
              break;

       case PRESET:
              reset(g->arg0);
              break;

       case POPEN:
              segopen(g->args);
              break;

       case PCLOSE:
              segclose();
              break;

       default:
              sprintf(errmsg, "unknown command '%c' in doglobal", g->com);
              error(WARNING, errmsg);
              break;
       }

       return(1);
}

Here is the call graph for this function:

void doprim ( PRIMITIVE *  p) [static]

Definition at line 145 of file psmeta.c.

{

       switch (p->com) {

       case PMSTR:
              printstr(p);
              break;

       case PVSTR:
              plotvstr(p);
              break;

       case PLSEG:
              plotlseg(p);
              break;

       case PRFILL:
              fillrect(p);
              break;

       case PTFILL:
              filltri(p);
              break;

       case PPFILL:
              fillpoly(p);
              break;

       case PSEG:
              doseg(p);
              break;

       default:
              sprintf(errmsg, "unknown command '%c' in doprim", p->com);
              error(WARNING, errmsg);
              return;
       }
       newpage = FALSE;
}

Here is the call graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 24 of file psmeta.c.

{
       FILE  *fp;

       progname = *argv++;
       argc--;

       init(progname);
       if (argc)
              while (argc)  {
                     fp = efopen(*argv, "r");
                     plot(fp);
                     fclose(fp);
                     argv++;
                     argc--;
              }
       else
              plot(stdin);

       if (!newpage)
              endpage();

       done();
       return(0);
}

Here is the call graph for this function:

void plot ( FILE *  infp)

Definition at line 56 of file psmeta.c.

{
       PRIMITIVE  nextp;

       do {
              readp(&nextp, infp);
              while (isprim(nextp.com)) {
                     doprim(&nextp);
                     readp(&nextp, infp);
              }
       } while (doglobal(&nextp));

}

Here is the call graph for this function:


Variable Documentation

short newpage = TRUE [static]

Definition at line 18 of file psmeta.c.

char* progname

Definition at line 16 of file psmeta.c.

const char RCSid[] = "$Id: psmeta.c,v 1.4 2003/11/15 02:13:37 schorsch Exp $" [static]

Definition at line 2 of file psmeta.c.