void free( void* ptr ); char * strdup( const char *str1 ); typedef struct WrenVM WrenVM; const char* wrenGetSlotString(WrenVM* vm, int slot); void wrenSetSlotString(WrenVM* vm, int slot, const char* text); void C_strdup(WrenVM* vm) { const char *s = wrenGetSlotString(vm, 1); char *t = strdup(s); wrenSetSlotString(vm, 0, t); free(t); }