]> git.lizzy.rs Git - uwu-lang.git/blob - api/nil.c
Unify value types
[uwu-lang.git] / api / nil.c
1 #include <string.h>
2 #include "nil.h"
3
4 UwUVMValue uwunil_create()
5 {
6         return (UwUVMValue) {
7                 .type = &uwunil_type,
8                 .data = NULL,
9         };
10 }
11
12 static void *uwunil_copy(void *data)
13 {
14         return data;
15 }
16
17 static void uwunil_delete(void *data)
18 {
19         (void) data;
20 }
21
22 static char *uwunil_print(void *data)
23 {
24         (void) data;
25         return strdup("");
26 }
27
28 UwUVMType uwunil_type = {
29         .copy = &uwunil_copy,
30         .delete = &uwunil_delete,
31         .print = &uwunil_print,
32 };