need this
This commit is contained in:
parent
733e9d3977
commit
fa256eecfa
1 changed files with 50 additions and 0 deletions
50
src/cmd/acidtypes/sym.c
Normal file
50
src/cmd/acidtypes/sym.c
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue