plan9port/src/libmach/demangler.c

28 lines
427 B
C
Raw Normal View History

2005-11-29 04:05:42 +00:00
#include <u.h>
#include <libc.h>
#include <bio.h>
#include <mach.h>
void
main(void)
{
Biobuf b, bout;
char *p, *s;
char buf[100000];
2005-11-29 04:05:42 +00:00
Binit(&b, 0, OREAD);
Binit(&bout, 1, OWRITE);
2005-11-29 04:05:42 +00:00
while((p = Brdline(&b, '\n')) != nil){
p[Blinelen(&b)-1] = 0;
werrstr("no error");
s = demanglegcc2(p, buf);
if(s == p)
Bprint(&bout, "# %s (%r)\n", p);
else
Bprint(&bout, "%s\t%s\n", p, s);
}
Bflush(&bout);
exits(0);
}