aboutsummaryrefslogtreecommitdiff
path: root/src/lua.h
diff options
context:
space:
mode:
authorame <[email protected]>2024-06-13 00:01:51 -0500
committerame <[email protected]>2024-06-13 00:01:51 -0500
commit90a2acc2f0c9d3904e1dea737e45ef6b10f96a22 (patch)
tree401f11f59cbf2cee3c7ec1c58906b7c4d8105e4b /src/lua.h
parent237fcfbd61a9895326538a274f025d9ed57a3903 (diff)
working on deepcopy ub
Diffstat (limited to 'src/lua.h')
-rw-r--r--src/lua.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lua.h b/src/lua.h
index 6cb28a7..3328db5 100644
--- a/src/lua.h
+++ b/src/lua.h
@@ -3,11 +3,21 @@
#include <lua5.4/lauxlib.h>
#include <stdlib.h>
+#ifndef __lua_h
+#define __lua_h
+enum deep_copy_flags {
+ SKIP_META = (1 << 0),
+ SKIP_GC = (1 << 1),
+ IS_META = (1 << 2)
+};
+#endif
+
void* __malloc_(size_t);
void __free_(void*);
-void luaI_deepcopy(lua_State* src, lua_State* dest, void* _seen, int);
+void luaI_deepcopy(lua_State* src, lua_State* dest, enum deep_copy_flags);
void lua_set_global_table(lua_State*);
+//todo: char* _luaL_tolstring(lua_State*, int, size_t*);
//generic macro that takes other macros (see below)
#define _tset_b(L, Tidx, K, V, F)\
@@ -50,6 +60,8 @@ int writer(lua_State*, const void*, size_t, void*);
#define lua_objlen(L,i) lua_rawlen(L,(i))
#define luaL_register(L, M, F) luaL_newlib(L, F);
#else
+ //todo: #define luaL_tolstring(L, idx, n) _luaL_tolstring(L, idx, n)
+
#define lreg(N, FN)\
lua_newtable(L);\
luaL_register(L, NULL, FN);\
@@ -80,6 +92,8 @@ int writer(lua_State*, const void*, size_t, void*);
lua_pop(L, 1);\
}\
}
+
+
#endif