Subversion Repositories Vertical

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 11
Line 132... Line 132...
132
 *
132
 *
133
 * Revision 1.1  97/01/03  13:33:57  13:33:57  mjames (Mike James)
133
 * Revision 1.1  97/01/03  13:33:57  13:33:57  mjames (Mike James)
134
 * Initial revision
134
 * Initial revision
135
 *
135
 *
136
 *
136
 *
137
 */
137
*/
138
/*
138
/*
139
@title
139
@title
140
PROGRAM cdiread: Converter for .CDI files
140
PROGRAM cdiread: Converter for .CDI files
141
@application external
141
@application external
142
@text
142
@text
Line 155... Line 155...
155
Commonly seen with a '.CDI' file suffix. I think this is one of the random Racal-Zuken output
155
Commonly seen with a '.CDI' file suffix. I think this is one of the random Racal-Zuken output
156
file types.
156
file types.
157
@end
157
@end
158
*/
158
*/
159
#include <stdio.h>
159
#include <stdio.h>
160
#include <stdlib.h>
-
 
161
#include <string.h>
160
#include <string.h>
-
 
161
#include <stdlib.h>
162
#if defined HAS_TCL
162
#if defined HAS_TCL
163
#include "tcl_l.h"
163
#include "tcl_l.h"
164
#endif
164
#endif
165
#include "cmdlog.h"
-
 
166
#include "cmdparse.h"
-
 
167
#include "database.h"
-
 
168
#include "expression.h"
165
#include "expression.h"
169
#include "generic.h"
166
#include "generic.h"
-
 
167
#include "database.h"
170
#include "printout.h"
168
#include "printout.h"
171
#include "routing.h"
169
#include "routing.h"
-
 
170
#include "cmdparse.h"
-
 
171
#include "cmdlog.h"
-
 
172
#include "yacc_common.h"
172
 
173
 
173
#ident                                                                                        \
-
 
174
    "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/cdi_src/cdi_main.c,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $";
174
#ident "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/cdi_src/cdi_main.c,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $"
175
#if defined YYDEBUG
-
 
176
extern int yydebug;
-
 
177
#else
-
 
178
int yydebug = 0;
-
 
179
#endif
-
 
180
extern FILE *yyin;
-
 
181
 
175
 
182
int main (int argc, char *argv[])
176
int main(int argc , char * argv[])
183
 
177
 
184
{
178
{
185
        InitialiseData ();
179
    InitialiseData();
186
        ExecuteString (
-
 
187
            "echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ",
180
    ExecuteString("echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ", argc-1, (argv+1));
188
            argc - 1,
-
 
189
            (argv + 1));
-
 
190
        ExecuteString ("do $(VERTICAL_INIT) ", argc - 2, (argv + 2));
181
    ExecuteString("do $(VERTICAL_INIT) ", argc-2, (argv+2));
191
 
182
 
-
 
183
    Log(LOG_GENERAL,
192
        Log (LOG_GENERAL, "# Finished initialisation script\n");
184
        "# Finished initialisation script\n");
193
        print_header (stdout, "'cdiread': From .cdi file");
185
    print_header(stdout,"'cdiread': From .cdi file");
194
        yydebug = 0;
186
    yydebug = 0;
195
        if (argc > 2 && argv[2][0] == 'd')
187
    if (argc>2 && argv[2][0]=='d')
196
                yydebug = 1;
188
        yydebug = 1;
197
        if (argc > 1)
189
    if (argc>1)
198
                yyin = fopen (argv[1], "r");
190
        yyin = fopen(argv[1],"r");
199
        else
191
    else
200
                yyin = stdin;
192
        yyin = stdin;
201
        if (!yyin)
193
    if(!yyin)
202
                printf ("cannot open input file (%s)\n", argv[1]);
194
        printf("cannot open input file (%s)\n",argv[1]);
203
        else
195
    else
204
                while (yyparse () == 0)
196
        while(yyparse()==0);
205
                        ;
-
 
206
 
197
 
207
        perform_routing (Free);
198
    perform_routing(Free);
208
        list_database (stdout, 0); /* no jumpers :0= no hierarchy */
199
    list_database(stdout,0);/* no jumpers :0= no hierarchy */
209
        list_devices (
200
    list_devices(stdout,
210
            stdout,
201
         PRINT_TYPE|PRINT_EXPAND_BUS|
211
            PRINT_TYPE | PRINT_EXPAND_BUS | PRINT_GENERIC | PRINT_GROUP | PRINT_ROUTE_FLAGS |
202
         PRINT_GENERIC|PRINT_GROUP|
212
                PRINT_EQUIVALENT_PINS);
203
         PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS);
-
 
204
    }
-
 
205
 
-
 
206
 
213
}
207