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
commitc18a2ac9469ddc7488834a81e49150ebb5506ed4 (patch)
tree2a9fafd40359419d36504b55e6041a9fdda23bc6 /src/crypto.h
parent2a7f5c95a5406b6de215dbc24a733e29d609d20f (diff)
parente29d3ea86551380ace8e2c86c9f1f63e901941e1 (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;\
}