diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-12-30 16:53:37 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-12-30 16:53:37 +0100 |
commit | 4c52777ca9e52edd0bff76168d886de9757ea457 (patch) | |
tree | 385c548fbae43f4b4764a1c32d5babe60c84aa4d /api/ref.c | |
parent | 058d954e80f83c26deb209008f11d87a5b59418e (diff) | |
download | uwu-lang-4c52777ca9e52edd0bff76168d886de9757ea457.tar.xz |
Add :ref module and refactor type handling
Diffstat (limited to 'api/ref.c')
-rw-r--r-- | api/ref.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -1,20 +1,25 @@ #include "../src/util.h" #include "ref.h" -UwUVMValue uwuref_create(UwUVMFunction *function) +UwUVMValue uwuref_create(UwUVMFunction *value) { return (UwUVMValue) { .type = &uwuref_type, - .data = function, + .data = value, }; } -static void *uwuref_copy(void *data) +UwUVMFunction *uwuref_get(UwUVMValue value) +{ + return value.data; +} + +static void *uwuref_clone(void *data) { return data; } -static void uwuref_delete(void *data) +static void uwuref_delet(void *data) { (void) data; } @@ -25,7 +30,7 @@ static char *uwuref_print(void *data) } UwUVMType uwuref_type = { - .copy = &uwuref_copy, - .delete = &uwuref_delete, + .clone = &uwuref_clone, + .delet = &uwuref_delet, .print = &uwuref_print, }; |