]> git.lizzy.rs Git - uwu-lang.git/blob - api/nil.c
a9c54cca55a96394372bc3a02e685b5c59eed87b
[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 = VT_NAT,
8                 .value = {
9                         .nat_value = {
10                                 .type = &uwunil_type,
11                                 .data = NULL,   
12                         }
13                 }       
14         };
15 }
16
17 static void *uwunil_copy(void *data)
18 {
19         return data;
20 }
21
22 static void uwunil_delete(void *data)
23 {
24         (void) data;
25 }
26
27 static char *uwunil_print(void *data)
28 {
29         (void) data;
30         return strdup("");
31 }
32
33 UwUVMNativeType uwunil_type = {
34         .copy = &uwunil_copy,
35         .delete = &uwunil_delete,
36         .print = &uwunil_print, 
37 };