/* pads_main*/
/* $Id: eagle_main.c,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $
*
* $Log: eagle_main.c,v $
* Revision 1.1.1.1 2003/11/04 23:34:56 mjames
* Imported into local repositrory
*
* Revision 1.1 2002/12/04 22:28:28 mjames
* Initial release Eagle PCB reader
*
*/
/*
@title
PROGRAM eagle_read: Converter for Eagle .net files
@application external
@text
PCB netlist to ACFP converter. Looks for netlists in ASCII containing tags like:
@listing
Netlist
Exported from H02SM05.brd at 11-10-2002 12:15:48
EAGLE Version 4.09r1 Copyright (c) 1988-2002 CadSoft
Net Part Pad
@text
Commonly seen with a '.net' file suffix. This file is from Eagle PCB.
@text
Usage
@listing
eagle_read <eagle_file> [ d ]
@text
If a lower
case 'd' is present as the second argument, the Bison parser
(interpreter of keywords and syntax) prints extremely verbose diagnostics.
@break
Normally the acfp file produced on standard output is redirected to a file e.g.
@listing
eagle_read file.net > file.acfp
@text
Will produce file.acfp from file.net.
@break
Following this it is necessary to run the output through Vertical again in order to
set up properties on nets (power and ground being made not routable for instance) using the
del routable command. Alternatively the acfp file can be edited to set the net routing
flags for these nets.
@end
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#if defined HAS_TCL
#include "tcl_l.h"
#endif
#include "expression.h"
#include "generic.h"
#include "database.h"
#include "printout.h"
#include "routing.h"
#include "cmdparse.h"
#include "cmdlog.h"
#include "yacc_common.h"
#ident "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/eagle_src/eagle_main.c,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $"
int main(int argc , char * argv[])
{
InitialiseData();
ExecuteString("echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ", argc-1, (argv+1));
ExecuteString("do $(VERTICAL_INIT) ", argc-2, (argv+2));
Log(LOG_GENERAL,
"# Finished initialisation script\n");
print_header(stdout,"'Eagle_Read': From Eagle PCB .net file");
yydebug = 0;
if (argc>2 && argv[2][0]=='d')
yydebug = 1;
if (argc>1)
yyin
= fopen(argv
[1],"r");
else
yyin = stdin;
if(!yyin)
printf("cannot open input file (%s)\n",argv
[1]);
else
while(yyparse()==0);
perform_routing(Free);
list_database(stdout,0); /*no jumpers so flatten jumpers arg=0 */
list_devices(stdout,
PRINT_TYPE|PRINT_EXPAND_BUS|
PRINT_GENERIC|PRINT_GROUP|
PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS);
}