Back to index

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

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Variables

static const char RCSid [] = "$Id: pexpand.c,v 1.3 2003/11/15 02:13:37 schorsch Exp $"
char * progname
int maxalloc = 0

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 20 of file pexpand.c.

{
 FILE  *fp;
 int  i;
 char  *cp;
 int  com;
 short  exlist[NCOMMANDS];  /* 1==expand, 0==pass, -1==discard */

 progname = *argv++;
 argc--;

 for (i = 0; i < NCOMMANDS; i++)
    exlist[i] = 0;

 while (argc && (**argv == '+' || **argv == '-'))  {
    i = (**argv == '+') ? 1 : -1;
    for (cp = *argv+1; *cp ; cp++)  {
       if ((com = comndx(*cp)) == -1 || *cp == PEOF) {
          sprintf(errmsg, "unknown option '%c'", *cp);
         error(WARNING, errmsg);
         }
       else
         exlist[com] = i;
       }
    argv++;
    argc--;
    }

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

 writeof(stdout);

 return(0);
 }

Here is the call graph for this function:


Variable Documentation

int maxalloc = 0

Definition at line 16 of file pexpand.c.

char* progname

Definition at line 14 of file pexpand.c.

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

Definition at line 2 of file pexpand.c.