aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acidtypes/dat.h
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-04-19 22:41:57 +0000
committerrsc <devnull@localhost>2004-04-19 22:41:57 +0000
commit98cd2746cff82ab359de6d6ce2c3f87b2c4166a8 (patch)
tree20ccb5bb9e6b0c369c47c66a0c4c4a8e8b7b2fb5 /src/cmd/acidtypes/dat.h
parent70e24710a84797be0c26fec6b22897ddccbf679c (diff)
downloadplan9port-98cd2746cff82ab359de6d6ce2c3f87b2c4166a8.tar.gz
plan9port-98cd2746cff82ab359de6d6ce2c3f87b2c4166a8.tar.bz2
plan9port-98cd2746cff82ab359de6d6ce2c3f87b2c4166a8.zip
add acidtypes
Diffstat (limited to 'src/cmd/acidtypes/dat.h')
-rw-r--r--src/cmd/acidtypes/dat.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/cmd/acidtypes/dat.h b/src/cmd/acidtypes/dat.h
new file mode 100644
index 00000000..30f22016
--- /dev/null
+++ b/src/cmd/acidtypes/dat.h
@@ -0,0 +1,72 @@
+typedef struct Type Type;
+typedef struct Typeref Typeref;
+typedef struct TypeList TypeList;
+
+enum
+{
+ None,
+ Base,
+ Enum,
+ Aggr,
+ Function,
+ Pointer,
+ Array,
+ Range,
+ Defer,
+ Typedef,
+};
+
+struct Type
+{ /* Font Tab 4 */
+ uint ty; /* None, Struct, ... */
+ vlong lo; /* for range */
+ char sue;
+ vlong hi;
+ uint gen;
+ uint n1; /* type number (impl dependent) */
+ uint n2; /* another type number */
+ char *name; /* name of type */
+ char *suename; /* name of struct, union, enumeration */
+ uint isunion; /* is this Struct a union? */
+ uint printfmt; /* describes base type */
+ uint xsizeof; /* size of type */
+ Type *sub; /* subtype */
+ uint n; /* count for t, tname, val */
+ Type **t; /* members of sue, params of function */
+ char **tname; /* associated names */
+ long *val; /* associated offsets or values */
+ uint didtypedef; /* internal flag */
+ uint didrange; /* internal flag */
+ uint printed; /* internal flag */
+ Type *equiv; /* internal */
+};
+
+struct TypeList
+{
+ Type *hd;
+ TypeList *tl;
+};
+
+void *erealloc(void*, uint);
+void *emalloc(uint);
+char *estrdup(char*);
+void warn(char*, ...);
+
+Type *typebynum(uint n1, uint n2);
+Type *typebysue(char, char*);
+void printtypes(Biobuf*);
+void renumber(TypeList*, uint);
+void denumber(void);
+TypeList *mktl(Type*, TypeList*);
+
+struct Dwarf;
+struct Stab;
+int dwarf2acid(struct Dwarf*, Biobuf*);
+int stabs2acid(struct Stab*, Biobuf*);
+
+Type *newtype(void);
+char *nameof(Type*, int);
+void freetypes(void);
+
+extern char *prefix;
+char *fixname(char*);