blob: eefd0d736beafcaa12e2a7dcd2df212e6948e923 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include <string.h>
#include <stdlib.h>
#include "str.h"
UwUVMValue uwustr_create(const char *value)
{
return (UwUVMValue) {
.type = &uwustr_type,
.data = strdup(value),
};
}
char *uwustr_get(UwUVMValue vm_value)
{
return uwuvm_print_value(vm_value);
}
static void *uwustr_clone(void *data)
{
return strdup(data);
}
static char *uwustr_print(void *data)
{
return strdup(data);
}
UwUVMType uwustr_type = {
.clone = &uwustr_clone,
.delet = &free,
.print = &uwustr_print,
};
|