Back to index

radiance  4R0+20100331
Defines | Functions | Variables
bgraph.c File Reference
#include <stdio.h>
#include "meta.h"
#include "mgvars.h"
#include "mgraph.h"

Go to the source code of this file.

Defines

#define istyp(s)   (s[0] == '-')
#define isvar(s)   (s[0] == '+')

Functions

static void dofile (int optc, char *optv[], char *file)
int main (int argc, char *argv[])
void quit (int code)

Variables

static const char RCSid [] = "$Id: bgraph.c,v 1.4 2003/11/15 02:13:36 schorsch Exp $"
char * progname
char * libpath [4]

Define Documentation

#define istyp (   s)    (s[0] == '-')

Definition at line 18 of file bgraph.c.

#define isvar (   s)    (s[0] == '+')

Definition at line 20 of file bgraph.c.


Function Documentation

static void dofile ( int  optc,
char *  optv[],
char *  file 
) [static]

Definition at line 64 of file bgraph.c.

{
       char  stmp[256];
       int  i;
                                          /* start fresh */
       mgclearall();
                                          /* type options first */
       for (i = 0; i < optc; i++)
              if (istyp(optv[i])) {
                     sprintf(stmp, "include=%s.plt", optv[i]+1);
                     setmgvar(progname, stdin, stmp);
              } else
                     i++;
                                          /* file next */
       mgload(file);
                                          /* variable options last */
       for (i = 0; i < optc; i++)
              if (isvar(optv[i])) {
                     sprintf(stmp, "%s=%s", optv[i]+1, optv[i+1]);
                     setmgvar(progname, stdin, stmp);
                     i++;
              }
                                          /* graph it */
       mgraph();
}

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

Definition at line 30 of file bgraph.c.

{
       char  *getenv();
       int  i, file0;
       progname = argv[0];
       libpath[0] = "";
       if ((libpath[i=1] = getenv("MDIR")) != NULL)
              i++;
       libpath[i++] = MDIR;
       libpath[i] = NULL;

       for (file0 = 1; file0 < argc; )
              if (istyp(argv[file0]))
                     file0++;
              else if (isvar(argv[file0]) && file0 < argc-1)
                     file0 += 2;
              else
                     break;

       if (file0 >= argc)
              dofile(argc-1, argv+1, NULL);
       else
              for (i = file0; i < argc; i++)
                     dofile(file0-1, argv+1, argv[i]);

       quit(0);
       return 0; /* pro forma return */
}

Here is the call graph for this function:

void quit ( int  code)

Definition at line 96 of file bgraph.c.

{
       mdone();
       exit(code);
}

Here is the call graph for this function:


Variable Documentation

char* libpath[4]

Definition at line 24 of file bgraph.c.

char* progname

Definition at line 22 of file bgraph.c.

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

Definition at line 2 of file bgraph.c.