code / tomo

Lines41.3K C23.7K Markdown9.7K YAML5.0K Tomo2.3K
7 others 763
Python231 Shell230 make212 INI47 Text21 SVG16 Lua6
(65 lines)
1 // Result (Success/Failure) type info
2 #include <err.h>
3 #include <gc.h>
4 #include <stdbool.h>
5 #include <stdint.h>
6 #include <sys/param.h>
8 #include "enums.h"
9 #include "structs.h"
10 #include "text.h"
11 #include "util.h"
13 public
14 const TypeInfo_t Result$Success$$info = {
15 .size = sizeof(Result$Success$$type),
16 .align = __alignof__(Result$Success$$type),
17 .tag = StructInfo,
18 .StructInfo =
20 .name = "Success",
21 .num_fields = 0,
22 },
23 .metamethods = Struct$metamethods,
24 };
26 public
27 const TypeInfo_t Result$Failure$$info = {
28 .size = sizeof(Result$Failure$$type),
29 .align = __alignof__(Result$Failure$$type),
30 .tag = StructInfo,
31 .StructInfo =
33 .name = "Failure",
34 .num_fields = 1,
35 .fields =
36 (NamedType_t[1]){
37 {.name = "reason", .type = &Text$info},
38 },
39 },
40 .metamethods = Struct$metamethods,
41 };
43 public
44 const TypeInfo_t Result$$info = {
45 .size = sizeof(Result_t),
46 .align = __alignof__(Result_t),
47 .tag = EnumInfo,
48 .EnumInfo =
50 .name = "Result",
51 .num_tags = 2,
52 .tags =
53 (NamedType_t[2]){
55 .name = "Success",
56 .type = &Result$Success$$info,
57 },
59 .name = "Failure",
60 .type = &Result$Failure$$info,
61 },
62 },
63 },
64 .metamethods = Enum$metamethods,
65 };