OLD | NEW |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 #define EXTERN | 5 #define EXTERN |
6 #include "go.h" | 6 #include "go.h" |
7 #include "y.tab.h" | 7 #include "y.tab.h" |
8 #include <ar.h> | 8 #include <ar.h> |
9 | 9 |
10 extern int yychar; | 10 extern int yychar; |
(...skipping 30 matching lines...) Expand all Loading... |
41 break; | 41 break; |
42 | 42 |
43 case 'I': | 43 case 'I': |
44 addidir(ARGF()); | 44 addidir(ARGF()); |
45 break; | 45 break; |
46 } ARGEND | 46 } ARGEND |
47 | 47 |
48 if(argc < 1) | 48 if(argc < 1) |
49 goto usage; | 49 goto usage; |
50 | 50 |
51 » pathname = mal(100); | 51 » pathname = mal(1000); |
52 » if(getwd(pathname, 99) == 0) | 52 » if(getwd(pathname, 999) == 0) |
53 strcpy(pathname, "/???"); | 53 strcpy(pathname, "/???"); |
54 | 54 |
55 fmtinstall('O', Oconv); // node opcodes | 55 fmtinstall('O', Oconv); // node opcodes |
56 fmtinstall('E', Econv); // etype opcodes | 56 fmtinstall('E', Econv); // etype opcodes |
57 fmtinstall('J', Jconv); // all the node flags | 57 fmtinstall('J', Jconv); // all the node flags |
58 fmtinstall('S', Sconv); // sym pointer | 58 fmtinstall('S', Sconv); // sym pointer |
59 fmtinstall('T', Tconv); // type pointer | 59 fmtinstall('T', Tconv); // type pointer |
60 fmtinstall('N', Nconv); // node pointer | 60 fmtinstall('N', Nconv); // node pointer |
61 fmtinstall('Z', Zconv); // escaped string | 61 fmtinstall('Z', Zconv); // escaped string |
62 fmtinstall('L', Lconv); // line number | 62 fmtinstall('L', Lconv); // line number |
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 p = infile; | 1502 p = infile; |
1503 else | 1503 else |
1504 p = p+1; | 1504 p = p+1; |
1505 snprint(namebuf, sizeof(namebuf), "%s", p); | 1505 snprint(namebuf, sizeof(namebuf), "%s", p); |
1506 p = strrchr(namebuf, '.'); | 1506 p = strrchr(namebuf, '.'); |
1507 if(p != nil) | 1507 if(p != nil) |
1508 *p = 0; | 1508 *p = 0; |
1509 outfile = smprint("%s.%c", namebuf, thechar); | 1509 outfile = smprint("%s.%c", namebuf, thechar); |
1510 } | 1510 } |
1511 } | 1511 } |
OLD | NEW |