tneed this - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit fa256eecfaf035cd6c46335452357856dc0bd9e9
parent 733e9d3977ae9896f94b1f7312b0398ccce19c35
Author: rsc 
Date:   Wed, 21 Apr 2004 02:43:50 +0000

need this

Diffstat:
  A src/cmd/acidtypes/sym.c             |      50 +++++++++++++++++++++++++++++++

1 file changed, 50 insertions(+), 0 deletions(-)
---
diff --git a/src/cmd/acidtypes/sym.c b/src/cmd/acidtypes/sym.c
t@@ -0,0 +1,50 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#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;
+}