Commit 7baded1e authored by dcw's avatar dcw
Browse files

added print option stuff.

parent d78291bf
......@@ -20,9 +20,10 @@
#include "struct.h"
#include "lexer.h"
#include "parser.h"
#include "decs.h"
#define MUSTBE(b) ASSERT(b,("Usage: datadec [-v] outfile [infile]\n"))
#define MUSTBE(b) ASSERT(b,("Usage: datadec [-vp] outfile [infile]\n"))
#define NEED_ANOTHER_ARG MUSTBE( IS_ANOTHER_ARG )
#define REQUIRE_NO_MORE_ARGS MUSTBE( argc == arg )
......@@ -33,24 +34,36 @@ main( argc, argv ) int argc; char **argv;
{
FILE *cfile, *hfile;
char tempname[256];
char *basename;
char *s;
declnlist declns;
int len;
char *basename;
BOOL verbose;
int arg;
arg = 1;
NEED_ANOTHER_ARG;
verbose = FALSE;
if( strcmp( argv[arg], "-v" )==0 )
verbose = FALSE; print = FALSE;
while( *(s=argv[arg]) == '-' )
{
for( s++; *s; s++ )
{
switch( *s )
{
case 'v':
verbose = TRUE;
break;
case 'p':
print = TRUE;
break;
default:
ABORT( ("datadec: illegal option -%c\n",*s) );
}
}
arg++;
verbose = TRUE;
NEED_ANOTHER_ARG;
}
NEED_ANOTHER_ARG;
basename = argv[arg++];
len = strlen( basename );
if( !strcmp( basename+len-2, ".c" ) )
......@@ -81,7 +94,7 @@ main( argc, argv ) int argc; char **argv;
{
if( verbose )
{
printf( "parsed declns: they are:\n\n" );
printf( "datadec: declns are:\n\n" );
print_declnlist( declns );
}
make_declns( declns, cfile, hfile, basename );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment