aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acidtypes
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-04-21 02:43:50 +0000
committerrsc <devnull@localhost>2004-04-21 02:43:50 +0000
commitfa256eecfaf035cd6c46335452357856dc0bd9e9 (patch)
tree270adbefcbf5827a0516f97e04d57333210b9c69 /src/cmd/acidtypes
parent733e9d3977ae9896f94b1f7312b0398ccce19c35 (diff)
downloadplan9port-fa256eecfaf035cd6c46335452357856dc0bd9e9.tar.gz
plan9port-fa256eecfaf035cd6c46335452357856dc0bd9e9.tar.bz2
plan9port-fa256eecfaf035cd6c46335452357856dc0bd9e9.zip
need this
Diffstat (limited to 'src/cmd/acidtypes')
-rw-r--r--src/cmd/acidtypes/sym.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/cmd/acidtypes/sym.c b/src/cmd/acidtypes/sym.c
new file mode 100644
index 00000000..7250ed44
--- /dev/null
+++ b/src/cmd/acidtypes/sym.c
@@ -0,0 +1,50 @@
+#include <u.h>
+#include <errno.h>
+#include <libc.h>
+#include <bio.h>
+#include <mach.h>
+#include <stabs.h>
+#include <ctype.h>
+#include "dat.h"
+
+Sym *symbols;
+Sym **lsym;
+
+void
+addsymx(char *fn, char *name, Type *type)
+{
+ Sym *s;
+
+ s = emalloc(sizeof *s);
+ s->fn = fn;
+ s->name = name;
+ s->type = type;
+ if(lsym == nil)
+ lsym = &symbols;
+ *lsym = s;
+ lsym = &s->next;
+}
+
+void
+dumpsyms(Biobuf *b)
+{
+ Sym *s;
+ Type *t;
+
+ for(s=symbols; s; s=s->next){
+ t = s->type;
+ t = defer(t);
+ if(t->ty == Pointer){
+ t = t->sub;
+ if(t && t->equiv)
+ t = t->equiv;
+ }
+ if(t == nil || t->ty != Aggr)
+ continue;
+ Bprint(b, "complex %s %s%s%s;\n", nameof(t, 1),
+ s->fn ? fixname(s->fn) : "", s->fn ? ":" : "", fixname(s->name));
+ }
+
+ symbols = nil;
+ lsym = &symbols;
+}