aboutsummaryrefslogtreecommitdiff
path: root/src/all.hff
diff options
context:
space:
mode:
Diffstat (limited to 'src/all.hff')
-rw-r--r--src/all.hff39
1 files changed, 28 insertions, 11 deletions
diff --git a/src/all.hff b/src/all.hff
index ff74ab7..63ca996 100644
--- a/src/all.hff
+++ b/src/all.hff
@@ -90,20 +90,17 @@ struct Type {
align usize,
konst bool,
id uint,
- t enum union {
- void,
- bool,
- int struct { sgn bool },
- flo,
- ptr *Type,
- arr struct { child *Type, length i64 },
- slice *Type,
+ u enum union {
+ Void,
+ Bool,
+ Int struct { sgn bool },
+ Flo,
+ Ptr *Type,
+ Arr struct { child *Type, length i64 },
+ Slice *Type,
}
}
-struct Decl {
-}
-
struct Parser {
fp *FILE,
curfile *const u8,
@@ -115,6 +112,19 @@ struct Parser {
}
+struct Targ {
+ name *const u8,
+ ptrsize u8,
+ intsize u8,
+ longsize u8, longalign u8,
+ llongsize u8, llongalign u8,
+ sizesize u8,
+ f64align u8,
+ valistsize u8, valistalign u8,
+ charsigned bool,
+ shortenum bool,
+}
+
// parse.cff
extern fn parser_init(*Parser, path *const u8) void;
extern fn parse(*Parser) [#]Decl;
@@ -127,6 +137,7 @@ extern fn xstrdup(str *const u8) *u8;
def FNV1A_INI u32 = 0x811c9dc5;
extern fn fnv1a(h u32, [#]const u8) u32;
extern fn fnv1a_s(h u32, *const u8) u32;
+extern fn fnv1a_i(h u32, i64) u32;
extern fn addfilepath(*const u8) int;
extern fn fatal(*Parser, Loc, fmt *const u8, ...) void;
extern fn internstr(*const u8) *const u8;
@@ -137,6 +148,12 @@ extern fn pfmt(proc *fn(u8, *void) void, parg *void, fmt *const u8, ...) void;
extern fn vefmt(fmt *const u8, ap va_list) void;
extern fn efmt(fmt *const u8, ...) void;
+// type.cff
+
+// targ.cff
+extern static g_targ *const Targ;
+extern fn targ_ini(name *const u8) bool;
+
// Inline functions
fn bswap32(x u32) u32 {
return (x >> 24)