plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

dat.h (1792B)


      1 typedef struct Type Type;
      2 typedef struct Typeref Typeref;
      3 typedef struct TypeList TypeList;
      4 typedef struct Sym Sym;
      5 
      6 enum
      7 {
      8 	None,
      9 	Base,
     10 	Enum,
     11 	Aggr,
     12 	Function,
     13 	Pointer,
     14 	Array,
     15 	Range,
     16 	Defer,
     17 	Typedef
     18 };
     19 
     20 struct Type
     21 {	/* Font Tab 4 */
     22 	uint	ty;			/* None, Struct, ... */
     23 	vlong	lo;			/* for range */
     24 	char	sue;
     25 	vlong	hi;
     26 	uint	gen;
     27 	uint	n1;			/* type number (impl dependent) */
     28 	uint	n2;			/* another type number */
     29 	char	*name;		/* name of type */
     30 	char	*suename;	/* name of struct, union, enumeration */
     31 	uint	isunion;	/* is this Struct a union? */
     32 	uint	printfmt;	/* describes base type */
     33 	uint	xsizeof;	/* size of type */
     34 	Type	*sub;		/* subtype */
     35 	uint	n;			/* count for t, tname, val */
     36 	Type	**t;		/* members of sue, params of function */
     37 	char	**tname;	/* associated names */
     38 	long	*val;		/* associated offsets or values */
     39 	uint	didtypedef;	/* internal flag */
     40 	uint	didrange;	/* internal flag */
     41 	uint 	printed;	/* internal flag */
     42 	Type	*equiv;		/* internal */
     43 };
     44 
     45 struct TypeList
     46 {
     47 	Type *hd;
     48 	TypeList *tl;
     49 };
     50 
     51 struct Sym
     52 {
     53 	char *fn;
     54 	char *name;
     55 	Type *type;
     56 	Sym *next;
     57 };
     58 
     59 void *erealloc(void*, uint);
     60 void *emalloc(uint);
     61 char *estrdup(char*);
     62 void warn(char*, ...);
     63 
     64 Type *typebynum(uint n1, uint n2);
     65 Type *typebysue(char, char*);
     66 void printtypes(Biobuf*);
     67 void renumber(TypeList*, uint);
     68 void denumber(void);
     69 TypeList *mktl(Type*, TypeList*);
     70 
     71 struct Dwarf;
     72 struct Stab;
     73 int dwarf2acid(struct Dwarf*, Biobuf*);
     74 int stabs2acid(struct Stab*, Biobuf*);
     75 
     76 Type *newtype(void);
     77 Type *defer(Type*);
     78 char *nameof(Type*, int);
     79 void freetypes(void);
     80 
     81 extern char *prefix;
     82 extern int verbose;
     83 
     84 char *fixname(char*);
     85 char *cleanstl(char*);
     86 
     87 void addsymx(char*, char*, Type*);
     88 void dumpsyms(Biobuf*);
     89 
     90 int Bfmt(Fmt*);
     91 
     92 #ifdef VARARGCK
     93 #pragma varargck type "B" char*
     94 #endif