diff options
| author | ame <[email protected]> | 2024-06-13 00:01:51 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-06-13 00:01:51 -0500 |
| commit | 2999d3412ccf5c7fc1a9e84695c7a2bce69d3e82 (patch) | |
| tree | 401f11f59cbf2cee3c7ec1c58906b7c4d8105e4b /src/lua.h | |
| parent | 152b605c856112b074dc7b41651424c4170fc067 (diff) | |
working on deepcopy ub
Diffstat (limited to 'src/lua.h')
| -rw-r--r-- | src/lua.h | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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
|
