FreeCalypso > hg > ueda-linux
annotate ueda/libuschem/graphsym_load.c @ 117:a79853ec3ab5
HEADER10_Shrouded.fp: silk corner makes no sense here
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 13 Jun 2020 04:25:44 +0000 |
parents | cd92449fdb51 |
children |
rev | line source |
---|---|
0
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 * The black magic of loading/prescanning gschem-based uschem symbols |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 #include <ctype.h> |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 #include <stdio.h> |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 #include <strings.h> |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 #include "graphsym.h" |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 extern char *malloc(); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 extern char *copystr(); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 #define MAXLINE 256 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 static struct graphsym *symstruct; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 static FILE *inf; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 static int lineno; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 static struct graphsym_pindef **pintail; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 read_symbol_file(gs, f) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 struct graphsym *gs; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 FILE *f; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 symstruct = gs; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 inf = f; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 lineno = 0; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 pintail = &gs->gs_pins; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 mymain(); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 if (!gs->gs_npins) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 fprintf(stderr, "%s: symbol has no pins (invalid)\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 gs->gs_pathname); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 static |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 mymain() |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 char line[MAXLINE]; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
40 register char *cp; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
41 register int c; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
42 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
43 while (getline(line)) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
44 if (line[0] == '%') /* PS-like comments */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
45 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
46 if (line[0] == '\0') /* allow blank lines too */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
47 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
48 if (!isalpha(line[0])) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
49 inv: fprintf(stderr, "%s: line %d: invalid symbol data\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
50 symstruct->gs_pathname, lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
51 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
52 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
53 for (cp = line; isalpha(*cp); cp++) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
54 ; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
55 if (!isspace(*cp)) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
56 goto inv; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
57 *cp++ = '\0'; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
58 while (isspace(*cp)) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
59 cp++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
60 if (!strcmp(line, "PS")) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
61 if (strcmp(cp, "{")) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
62 goto inv; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
63 skip_ps_block(); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
64 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
65 } else if (strlen(line) != 1) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
66 goto inv; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
67 line[1] = ' '; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
68 /* dispatch by single-char type */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
69 switch (line[0]) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
70 case 'v': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
71 continue; /* ignore */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
72 /* simple graphics */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
73 case 'L': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
74 case 'B': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
75 case 'V': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
76 case 'A': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
77 /* ignore at this stage too */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
78 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
79 case 'P': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
80 handle_pin(line, lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
81 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
82 case 'T': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
83 handle_T_obj(line, lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
84 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
85 default: |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
86 goto inv; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
87 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
88 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
89 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
90 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
91 static |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
92 handle_pin(objline, objlineno) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
93 char *objline; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
94 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
95 int numparams[7]; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
96 char junkline[MAXLINE]; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
97 register struct graphsym_pindef *pin; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
98 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
99 parse_numline(objline, objlineno, numparams, 7); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
100 pin = (struct graphsym_pindef *) malloc(sizeof(struct graphsym_pindef)); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
101 if (!pin) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
102 perror("malloc"); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
103 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
104 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
105 bzero(pin, sizeof(struct graphsym_pindef)); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
106 if (numparams[6]) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
107 pin->gspd_x = numparams[2]; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
108 pin->gspd_y = numparams[3]; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
109 } else { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
110 pin->gspd_x = numparams[0]; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
111 pin->gspd_y = numparams[1]; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
112 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
113 *pintail = pin; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
114 pintail = &pin->gspd_next; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
115 symstruct->gs_npins++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
116 if (!getline(junkline) || strcmp(junkline, "{")) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
117 fprintf(stderr, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
118 "%s: line %d: P line must be followed by '{' line\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
119 symstruct->gs_pathname, objlineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
120 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
121 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
122 read_pin_attrs(pin, objlineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
123 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
124 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
125 static |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
126 read_pin_attrs(pin, objlineno) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
127 struct graphsym_pindef *pin; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
128 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
129 char line[MAXLINE]; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
130 int Tline_parsed[9]; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
131 register char *cp; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
132 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
133 for (;;) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
134 if (!getline(line)) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
135 badeof: fprintf(stderr, "%s: EOF in pin attribute block\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
136 symstruct->gs_pathname); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
137 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
138 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
139 if (line[0] == '%') /* PS-like comments */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
140 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
141 if (line[0] == '\0') /* allow blank lines too */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
142 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
143 if (line[0] == '}') |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
144 return; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
145 if (!isalpha(line[0])) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
146 inv: fprintf(stderr, "%s: line %d: invalid symbol data\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
147 symstruct->gs_pathname, lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
148 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
149 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
150 for (cp = line; isalpha(*cp); cp++) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
151 ; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
152 if (!isspace(*cp)) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
153 goto inv; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
154 *cp++ = '\0'; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
155 if (!strcmp(line, "attr")) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
156 while (isspace(*cp)) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
157 cp++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
158 handle_attr(pin, cp); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
159 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
160 } else if (strcmp(line, "T")) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
161 fprintf(stderr, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
162 "%s: line %d: wrong object type in pin attribute block\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
163 symstruct->gs_pathname, lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
164 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
165 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
166 line[1] = ' '; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
167 parse_numline(line, lineno, Tline_parsed, 9); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
168 if (Tline_parsed[8] < 1) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
169 fprintf(stderr, "%s: line %d: T object: num_lines<1!\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
170 symstruct->gs_pathname, lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
171 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
172 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
173 if (Tline_parsed[8] > 1) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
174 fprintf(stderr, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
175 "%s: line %d: multiline text object in attribute block not supported\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
176 symstruct->gs_pathname, lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
177 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
178 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
179 if (!getline(line)) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
180 goto badeof; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
181 handle_attr(pin, line); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
182 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
183 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
184 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
185 static |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
186 handle_attr(pin, line) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
187 register struct graphsym_pindef *pin; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
188 register char *line; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
189 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
190 register char *cp; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
191 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
192 cp = index(line, '='); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
193 if (!cp) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
194 return; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
195 *cp++ = '\0'; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
196 if (!*cp) /* avoid null string values */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
197 return; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
198 if (!strcmp(line, "pinname")) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
199 if (pin->gspd_pinname) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
200 dup: fprintf(stderr, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
201 "%s: line %d: duplicate %s attribute (ignored)\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
202 symstruct->gs_pathname, lineno, line); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
203 return; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
204 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
205 pin->gspd_pinname = copystr(cp); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
206 } else if (!strcmp(line, "pinnumber")) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
207 if (pin->gspd_pinnumber) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
208 goto dup; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
209 pin->gspd_pinnumber = copystr(cp); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
210 if (!strcmp(cp, "%d")) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
211 symstruct->gs_varpins++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
212 } else if (!strcmp(line, "forcenet")) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
213 if (pin->gspd_forcenet) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
214 goto dup; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
215 pin->gspd_forcenet = copystr(cp); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
216 symstruct->gs_forcenets++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
217 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
218 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
219 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
220 static |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
221 handle_T_obj(objline, objlineno) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
222 char *objline; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
223 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
224 int numparams[9]; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
225 char junkline[MAXLINE]; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
226 register int i; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
227 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
228 parse_numline(objline, objlineno, numparams, 9); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
229 if (numparams[8] < 1) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
230 fprintf(stderr, "%s: line %d: T object: num_lines<1!\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
231 symstruct->gs_pathname, objlineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
232 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
233 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
234 for (i = numparams[8]; i; i--) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
235 if (!getline(junkline)) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
236 fprintf(stderr, "%s: EOF in T object\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
237 symstruct->gs_pathname); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
238 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
239 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
240 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
241 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
242 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
243 static |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
244 parse_numline(line, lineno, numarray, nfields) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
245 char *line; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
246 int lineno; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
247 int *numarray; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
248 int nfields; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
249 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
250 register char *cp, *np; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
251 register int i; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
252 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
253 for (i = 0, cp = line+1; i < nfields; i++) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
254 if (!isspace(*cp)) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
255 inv: fprintf(stderr, "%s: line %d: invalid numeric line\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
256 symstruct->gs_pathname, lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
257 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
258 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
259 while (isspace(*cp)) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
260 cp++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
261 np = cp; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
262 if (*cp == '-') |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
263 cp++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
264 if (!isdigit(*cp)) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
265 goto inv; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
266 while (isdigit(*cp)) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
267 cp++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
268 numarray[i] = atoi(np); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
269 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
270 if (*cp) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
271 goto inv; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
272 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
273 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
274 static |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
275 getline(linebuf) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
276 char *linebuf; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
277 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
278 register char *cp; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
279 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
280 if (fgets(linebuf, MAXLINE, inf) == NULL) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
281 return(0); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
282 lineno++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
283 /* strip trailing newline or other whitespace */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
284 cp = index(linebuf, '\0'); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
285 while (cp > linebuf && isspace(cp[-1])) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
286 cp--; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
287 *cp = '\0'; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
288 return(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
289 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
290 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
291 static |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
292 skip_ps_block() |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
293 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
294 register int c, n; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
295 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
296 for (n = 0; n >= 0; ) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
297 c = getc(inf); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
298 switch (c) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
299 case EOF: |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
300 badeof: fprintf(stderr, "%s: EOF in a PS block\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
301 symstruct->gs_pathname); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
302 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
303 case '%': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
304 for (;;) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
305 c = getc(inf); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
306 if (c == EOF) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
307 goto badeof; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
308 if (c == '\n') |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
309 break; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
310 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
311 /* FALL THRU */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
312 case '\n': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
313 lineno++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
314 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
315 case '(': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
316 skip_over_ps_string(); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
317 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
318 case ')': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
319 fprintf(stderr, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
320 "%s: line %d: unmatched \')\' in a PS block", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
321 symstruct->gs_pathname, lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
322 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
323 case '{': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
324 n++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
325 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
326 case '}': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
327 n--; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
328 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
329 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
330 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
331 c = getc(inf); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
332 if (c != '\n') { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
333 fprintf(stderr, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
334 "%s: line %d: '}' closing PS block must be directly followed by newline\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
335 symstruct->gs_pathname, lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
336 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
337 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
338 lineno++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
339 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
340 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
341 static |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
342 skip_over_ps_string() |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
343 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
344 register int c, n; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
345 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
346 for (n = 1; n > 0; ) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
347 c = getc(inf); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
348 switch (c) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
349 case EOF: |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
350 badeof: fprintf(stderr, "%s: EOF in a PS block\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
351 symstruct->gs_pathname); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
352 exit(1); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
353 case '\n': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
354 lineno++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
355 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
356 case '(': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
357 n++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
358 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
359 case ')': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
360 n--; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
361 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
362 case '\\': |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
363 c = getc(inf); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
364 if (c == EOF) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
365 goto badeof; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
366 if (c == '\n') |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
367 lineno++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
368 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
369 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
370 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
371 } |