2024-07-17 12:39:44 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <lua.h>
|
|
|
|
#include <_cgo_export.h>
|
|
|
|
|
2024-07-18 17:34:27 +01:00
|
|
|
// void* clua_alloc(void* ud, void *ptr, size_t osize, size_t nsize)
|
|
|
|
// {
|
|
|
|
// return (void*) go_allocf((GoUintptr) ud,(GoUintptr) ptr, osize, nsize);
|
|
|
|
// }
|
|
|
|
|
2024-07-17 12:39:44 +01:00
|
|
|
|
2024-07-18 17:34:27 +01:00
|
|
|
lua_State* clua_newstate(void* f, void* ud)
|
2024-07-17 12:39:44 +01:00
|
|
|
{
|
2024-07-18 17:34:27 +01:00
|
|
|
return lua_newstate((lua_Alloc)f, ud);
|
2024-07-17 12:39:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
l_noret cluaL_errorL(lua_State* L, char* msg)
|
|
|
|
{
|
2024-07-17 16:44:41 +01:00
|
|
|
luaL_errorL(L, msg);
|
2024-07-17 12:39:44 +01:00
|
|
|
}
|
2024-07-18 14:30:39 +01:00
|
|
|
|
|
|
|
void clua_pushcclosurek(lua_State* L, void* f, char* debugname, int nup, void* cont) {
|
2024-07-18 17:34:27 +01:00
|
|
|
return lua_pushcclosurek(L, (lua_CFunction)f, debugname, nup, (lua_Continuation)cont);
|
2024-07-18 19:30:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void* clua_newuserdatadtor(lua_State* L, size_t sz, void* dtor) {
|
|
|
|
return lua_newuserdatadtor(L, sz, (void (*)(void*))dtor);
|
2024-07-18 14:30:39 +01:00
|
|
|
}
|