Subversion Repositories Vertical

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
/*
2
@title
3
PROGRAM protel_read: Converter for Protel .net files
4
@application external
5
@text
6
PCB netlist to ACFP converter. Looks for netlists in ASCII containing tags like:
7
@listing
8
@text
9
Usage
11 mjames 10
@listing
11
protel_read <protel_file> [ d ]
12
@text
13
If a lower  
14
case 'd' is present as the second argument, the Bison parser
2 mjames 15
(interpreter of keywords and syntax) prints extremely verbose diagnostics.
16
@break
17
Normally the acfp file produced on standard output is redirected to a file e.g.
18
@listing
19
eagle_read file.net > file.acfp
20
@text
21
Will produce file.acfp from file.net.
22
@break
23
Following this it is necessary to run the output through Vertical again in order to
11 mjames 24
set up properties on nets (power and ground being made not routable for instance) using the
2 mjames 25
del routable command. Alternatively the acfp file can be edited to set the net routing
26
flags for these nets.
27
@end
28
*/
29
 
30
#include <stdio.h>
11 mjames 31
 
32
#include <string.h>
33
 
2 mjames 34
#include <stdlib.h>
35
#if defined HAS_TCL
36
#include "tcl_l.h"
37
#endif
38
#include "expression.h"
39
#include "generic.h"
11 mjames 40
#include "database.h"
2 mjames 41
#include "printout.h"
42
#include "routing.h"
11 mjames 43
#include "cmdparse.h" 
44
#include "cmdlog.h" 
45
#include "yacc_common.h"
2 mjames 46
 
11 mjames 47
#ident "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/eagle_src/eagle_main.c,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $"
48
int inside_block;
2 mjames 49
 
11 mjames 50
int main(int argc , char * argv[])
51
  {
52
  InitialiseData();
53
  ExecuteString("echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ", argc-1, (argv+1));
54
  ExecuteString("do $(VERTICAL_INIT) ", argc-2, (argv+2));
55
  Log(LOG_GENERAL,
56
        "# Finished initialisation script\n");
57
  print_header(stdout,"'Protel_Read': From Protel PCB .net file");
58
  yydebug = 0;
59
  if (argc>2 && argv[2][0]=='d')
60
    yydebug = 1;
61
  if (argc>1)
62
    yyin = fopen(argv[1],"r");
63
  else
64
    yyin = stdin;
65
  if(!yyin)
66
    printf("cannot open input file (%s)\n",argv[1]);
67
  else
68
    while(yyparse()==0);
2 mjames 69
 
11 mjames 70
  perform_routing(Free);
71
  list_database(stdout,0); /*no jumpers so flatten jumpers arg=0 */
72
    list_devices(stdout,
73
         PRINT_TYPE|PRINT_EXPAND_BUS|
74
         PRINT_GENERIC|PRINT_GROUP|
75
         PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS);
76
  }
2 mjames 77
 
78
 
11 mjames 79