1 // Logic for handling function type values
11 void register_function(void *fn, Text_t filename, int64_t line_num, Text_t name);
12 OptionalText_t get_function_name(void *fn);
13 OptionalText_t get_function_filename(void *fn);
14 int64_t get_function_line_num(void *fn);
15 Text_t Func$as_text(const void *fn, bool colorize, const TypeInfo_t *type);
16 PUREFUNC bool Func$is_none(const void *obj, const TypeInfo_t *);
18 #define Func$metamethods \
20 .as_text = Func$as_text, \
21 .is_none = Func$is_none, \
22 .serialize = cannot_serialize, \
23 .deserialize = cannot_deserialize, \
26 #define Function$info(typestr) \
27 &((TypeInfo_t){.size = sizeof(void *), \
28 .align = __alignof__(void *), \
29 .tag = FunctionInfo, \
30 .FunctionInfo.type_str = typestr, \
31 .metamethods = Func$metamethods})
32 #define Closure$info(typestr) \
33 &((TypeInfo_t){.size = sizeof(void *[2]), \
34 .align = __alignof__(void *), \
35 .tag = FunctionInfo, \
36 .FunctionInfo.type_str = typestr, \
37 .metamethods = Func$metamethods})