summaryrefslogtreecommitdiffstats
path: root/fpgaedit.c
blob: 302e33b41191b48cc6ccb91ae2cd659b18ba4bbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* 
 * $Id$
 * 
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

extern int errno;
extern int yyparse();

#include "config.h"
#include "fpgaedit_parser.h"
    
int debug = 0;
FILE *fhan = NULL;

int main (int argc, char *argv[])
{
	struct arg_t *kom_arg;

	kom_arg = Cmdline (argc, argv);
	
	if (kom_arg->v)
	{
		printf ("%s: version %s\n", argv[0], PACKAGE_VERSION);
		return EXIT_FAILURE;
	}
	
	debug = kom_arg->V; 
	
	if (kom_arg->optind) 
	{
		fhan = fopen(argv[kom_arg->optind], "r+");
		if (!fhan) printf ("opening \"%s\" failed\n%s\n", 
				   argv[kom_arg->optind], strerror(errno));
	}
		
	yyparse ();
	
	return EXIT_SUCCESS;
}

void yyerror (const char *s)  /* Called by yyparse on error */
{
	printf ("%s\n", s);
}