code / tomo

Lines41.3K C23.7K Markdown9.7K YAML5.0K Tomo2.3K
7 others 763
Python231 Shell230 make212 INI47 Text21 SVG16 Lua6
(22 lines)
1 // Type information and methods for TypeInfos (i.e. runtime representations of types)
3 #include <err.h>
4 #include <gc.h>
5 #include <sys/param.h>
7 #include "text.h"
8 #include "types.h"
9 #include "util.h"
11 public
12 Text_t Type$as_text(const void *typeinfo, bool colorize, const TypeInfo_t *type) {
13 if (!typeinfo) return Text("Type");
15 if (colorize) return Text$concat(Text("\x1b[36;1m"), Text$from_str(type->TypeInfoInfo.type_str), Text("\x1b[m"));
16 else return Text$from_str(type->TypeInfoInfo.type_str);
19 public
20 const TypeInfo_t Void$info = {.size = 0, .align = 0, .tag = StructInfo};
21 public
22 const TypeInfo_t Abort$info = {.size = 0, .align = 0, .tag = StructInfo};