diff options
| author | amelia squires <[email protected]> | 2025-04-16 13:09:46 -0500 |
|---|---|---|
| committer | amelia squires <[email protected]> | 2025-04-16 13:09:46 -0500 |
| commit | 009eb7d43d9582856c275ad3b16f7e3ff94209cc (patch) | |
| tree | 6d1f5ea000a6d72164a5b6e05b68dfbe0371ae06 /src | |
| parent | dd7a8af4050454c3901987bff24a77334f892cc4 (diff) | |
merge thingy
Diffstat (limited to 'src')
| -rw-r--r-- | src/hash/blake2.c | 1 | ||||
| -rw-r--r-- | src/io.c | 1 | ||||
| -rw-r--r-- | src/lua.c | 2 | ||||
| -rw-r--r-- | src/lua.h | 49 | ||||
| -rw-r--r-- | src/net/common.h | 3 | ||||
| -rw-r--r-- | src/reg.c | 2 | ||||
| -rw-r--r-- | src/thread.c | 2 |
7 files changed, 9 insertions, 51 deletions
diff --git a/src/hash/blake2.c b/src/hash/blake2.c index 5f38bba..adb1419 100644 --- a/src/hash/blake2.c +++ b/src/hash/blake2.c @@ -3,7 +3,6 @@ #include <string.h>
#include <stdlib.h>
#include "../crypto.h"
-#include "lua5.4/lua.h"
void mix2b(uint64_t* a, uint64_t* b, uint64_t* c, uint64_t* d, int64_t x, int64_t y){
*a = *a + *b + x;
@@ -1,5 +1,4 @@ #include <unistd.h> -#include "lua5.4/lua.h" #include "types/str.h" #include "io.h" #include "stdlib.h" @@ -3,8 +3,8 @@ #include "io.h"
#include <stdlib.h>
#include <string.h>
-#include "lua5.4/lua.h"
#include "types/str.h"
+#include <stdint.h>
#include "types/parray.h"
static int ii = 0;
@@ -76,52 +76,17 @@ int lua_assign_upvalues(lua_State* L, int fidx); int writer(lua_State*, const void*, size_t, void*);
#if LUA_VERSION_NUM == 504
- #define lreg(N, FN)\
- lua_pushstring(L, N);\
- luaL_register(L, NULL, FN);\
- lua_settable(L, -3);
-
-
- #define requiref( L, modname, f, glob ) \
- { luaL_requiref( L, modname, f, glob ); lua_pop( L, 1 ); }
-
#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);\
- lua_setfield(L, 2, N);
+ #define luaL_register(L, M, F) luaL_newlib(L, F);
+#elif LUA_VERSION_NUM = 501
+ #define luaL_tolstring lua_tolstring
- //taken straight from luaproc
- #define requiref(L, modname, f, glob){\
- lua_pushcfunction(L, f);\
- lua_pushstring(L, modname); \
- lua_call(L, 1, 1);\
- lua_getfield(L, LUA_GLOBALSINDEX, LUA_LOADLIBNAME);\
- if(lua_type(L, -1) == LUA_TTABLE){\
- lua_getfield(L, -1, "loaded");\
- if(lua_type(L, -1) == LUA_TTABLE){\
- lua_getfield(L, -1, modname);\
- if(lua_type(L, -1) == LUA_TNIL) {\
- lua_pushvalue(L, 1);\
- lua_setfield(L, -3, modname);\
- }\
- lua_pop(L, 1);\
- }\
- lua_pop(L, 1);\
- }\
- lua_pop(L, 1);\
- if(glob){\
- lua_setglobal(L, modname);\
- }else{\
- lua_pop(L, 1);\
- }\
- }
-
+ #define lua_dump(A, B, C, D) lua_dump(A, B, C)
+ #define lua_rawlen lua_objlen
+
+ #define lua_gc(A, B) lua_gc(A, B, 0)
#endif
diff --git a/src/net/common.h b/src/net/common.h index 6b1a25a..828cb04 100644 --- a/src/net/common.h +++ b/src/net/common.h @@ -1,9 +1,6 @@ #ifndef __common_net_h #define __common_net_h -#include "lua5.4/lauxlib.h" -#include "lua5.4/lua.h" - #include <sys/types.h> #include <stdio.h> #include <stdlib.h> @@ -26,7 +26,7 @@ static int lua_exit(lua_State* L){ #define open_common(name)\
int luaopen_lullaby_##name (lua_State* L){\
- luaL_register(L, NULL, name##_function_list);\
+ luaL_register(L, #name, name##_function_list);\
int tidx = lua_gettop(L);\
i_config_metatable(L, name##_config);\
lua_settop(L, tidx);\
diff --git a/src/thread.c b/src/thread.c index a6be01b..c5ae933 100644 --- a/src/thread.c +++ b/src/thread.c @@ -1,6 +1,4 @@ #include "thread.h"
-#include "lua5.4/lauxlib.h"
-#include "lua5.4/lua.h"
#include "stdint.h"
#include <stdlib.h>
#include <unistd.h>
|
