summaryrefslogtreecommitdiff
path: root/Runner/Scripting/luax_cfunctions.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-09-10 20:30:31 +0800
committerchai <chaifix@163.com>2020-09-10 20:30:31 +0800
commit639b34294ffc20721c66db46e59e07d9100ac4b8 (patch)
tree7e1d45b536fa35e9f1559e468ea66fca99524573 /Runner/Scripting/luax_cfunctions.cpp
*init
Diffstat (limited to 'Runner/Scripting/luax_cfunctions.cpp')
-rw-r--r--Runner/Scripting/luax_cfunctions.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/Runner/Scripting/luax_cfunctions.cpp b/Runner/Scripting/luax_cfunctions.cpp
new file mode 100644
index 0000000..d93a0ee
--- /dev/null
+++ b/Runner/Scripting/luax_cfunctions.cpp
@@ -0,0 +1,19 @@
+#include "luax_cfunctions.h"
+#include "luax_config.h"
+
+namespace Luax
+{
+
+ int luax_c_getupvalue(lua_State* L)
+ {
+ lua_pushvalue(L, lua_upvalueindex(1));
+ return 1;
+ }
+
+ int luax_c_errfunc(lua_State* L)
+ {
+ cc8* msg = luaL_optstring(L, lua_upvalueindex(1), "");
+ return luaL_error(L, msg);
+ }
+
+} \ No newline at end of file