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