aboutsummaryrefslogtreecommitdiff
path: root/src/crypto.h
diff options
context:
space:
mode:
authorame <[email protected]>2024-09-30 02:17:37 -0500
committerame <[email protected]>2024-09-30 02:17:37 -0500
commitf648ac9db35f49f3dbd7373cc230f680c55cc04a (patch)
tree2a9fafd40359419d36504b55e6041a9fdda23bc6 /src/crypto.h
parent1cc24fda87c3e8df90a5ea2d526ce39adf4a7648 (diff)
parentfe33c0e979ebfc41c3eb9f561589f0d5d8810aaf (diff)
what
Diffstat (limited to 'src/crypto.h')
-rw-r--r--src/crypto.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/crypto.h b/src/crypto.h
index b3b0609..ba97f0c 100644
--- a/src/crypto.h
+++ b/src/crypto.h
@@ -44,15 +44,16 @@ int tp(lua_State*);
#define common_hash_init_update(hashname) lua_common_hash_init_update(hashname, hashname)
#define lua_common_hash_init_update(hashname, luaname) lua_common_hash_init(hashname, luaname) lua_common_hash_update(hashname, luaname)
#define lua_common_hash_init(hashname, luaname) lua_common_hash_init_ni(hashname, luaname, hashname##_init())
+#define lua_common_hash_init_l(hashname, luaname) lua_common_hash_init_ni(hashname, luaname, hashname##_init_l(L))
#define common_hash_clone(hashname) lua_common_hash_clone(hashname, hashname)
-#define lua_common_hash_clone(hashname, luaname) lua_common_hash_clone_oargs(hashname, luaname, l_##luaname##_init(L))
-#define lua_common_hash_clone_oargs(hashname, luaname, oinit)\
+#define lua_common_hash_clone(hashname, luaname) lua_common_hash_clone_oargs(hashname, luaname, l_##luaname##_init(L), *b = *a)
+#define lua_common_hash_clone_oargs(hashname, luaname, oinit, copy)\
int l_##luaname##_clone(lua_State* L){\
struct hashname##_hash* a = (struct hashname##_hash*)lua_touserdata(L, -1);\
oinit;\
struct hashname##_hash* b = (struct hashname##_hash*)lua_touserdata(L, -1);\
- *b = *a;\
+ copy;\
return 1;\
}