]> git.lizzy.rs Git - uwu-lang.git/blobdiff - api/int.c
Add :ref module and refactor type handling
[uwu-lang.git] / api / int.c
index 0b9329d91a1a5ba06b88dfaf2213517262779801..8446d1d7c1a2c01b2caeb6451b0a672a6f681778 100644 (file)
--- a/api/int.c
+++ b/api/int.c
@@ -13,7 +13,12 @@ UwUVMValue uwuint_create(int value)
        return vm_value;
 }
 
-void *uwuint_copy(void *data)
+int uwuint_get(UwUVMValue vm_value)
+{
+       return *(int *) vm_value.data;
+}
+
+void *uwuint_clone(void *data)
 {
        int *copy = malloc(sizeof(*copy));
        *copy = *(int *) data;
@@ -26,7 +31,7 @@ char *uwuint_print(void *data)
 }
 
 UwUVMType uwuint_type = {
-       .copy = &uwuint_copy,
-       .delete = &free,
+       .clone = &uwuint_clone,
+       .delet = &free,
        .print = &uwuint_print,
 };