summaryrefslogtreecommitdiff
path: root/media-libs/libquvi/files/libquvi-0.9.4-luaL_setfuncs_ver.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-12-29 20:15:49 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-12-29 20:15:49 +0000
commit8467a7e8af97ab17f54668fd7d348e68754dd0cc (patch)
tree77fba8fcf047ec665a2f9775b187fdf387ee2659 /media-libs/libquvi/files/libquvi-0.9.4-luaL_setfuncs_ver.patch
parent3d947253ed94b67c6687fa96a7bbcc2572685f78 (diff)
gentoo auto-resync : 29:12:2022 - 20:15:49
Diffstat (limited to 'media-libs/libquvi/files/libquvi-0.9.4-luaL_setfuncs_ver.patch')
-rw-r--r--media-libs/libquvi/files/libquvi-0.9.4-luaL_setfuncs_ver.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/media-libs/libquvi/files/libquvi-0.9.4-luaL_setfuncs_ver.patch b/media-libs/libquvi/files/libquvi-0.9.4-luaL_setfuncs_ver.patch
new file mode 100644
index 000000000000..156468b0e7b1
--- /dev/null
+++ b/media-libs/libquvi/files/libquvi-0.9.4-luaL_setfuncs_ver.patch
@@ -0,0 +1,70 @@
+--- libquvi-0.9.4/src/lua/init.c 2013-11-04 13:55:26.000000000 +0100
++++ libquvi-0.9.4/src/lua/init.c 2022-12-29 09:25:41.579621070 +0100
+@@ -43,11 +43,19 @@ static const luaL_Reg quvi_reg_meth[] =
+
+ static const luaL_Reg quvi_http_reg_meth[] =
+ {
++#if (LUA_VERSION_NUM == 501)
+ {"metainfo", l_quvi_http_metainfo},
+ {"resolve", l_quvi_http_resolve},
+ {"cookie", l_quvi_http_cookie},
+ {"header", l_quvi_http_header},
+ {"fetch", l_quvi_http_fetch},
++#elif (LUA_VERSION_NUM >= 504)
++ {"quvi.http.metainfo", l_quvi_http_metainfo},
++ {"quvi.http.resolve", l_quvi_http_resolve},
++ {"quvi.http.cookie", l_quvi_http_cookie},
++ {"quvi.http.header", l_quvi_http_header},
++ {"quvi.http.fetch", l_quvi_http_fetch},
++#endif
+ {NULL, NULL}
+ };
+
+@@ -57,9 +65,15 @@ extern gint l_quvi_crypto_hash(lua_State
+
+ static const luaL_Reg quvi_crypto_reg_meth[] =
+ {
++#if (LUA_VERSION_NUM == 501)
+ {"encrypt", l_quvi_crypto_encrypt},
+ {"decrypt", l_quvi_crypto_decrypt},
+ {"hash", l_quvi_crypto_hash},
++#elif (LUA_VERSION_NUM >= 504)
++ {"quvi.crypto.encrypt", l_quvi_crypto_encrypt},
++ {"quvi.crypto.decrypt", l_quvi_crypto_decrypt},
++ {"quvi.crypto.hash", l_quvi_crypto_hash},
++#endif
+ {NULL, NULL}
+ };
+
+@@ -68,8 +82,13 @@ extern gint l_quvi_base64_decode(lua_Sta
+
+ static const luaL_Reg quvi_base64_reg_meth[] =
+ {
++#if (LUA_VERSION_NUM == 501)
+ {"encode", l_quvi_base64_encode},
+ {"decode", l_quvi_base64_decode},
++#elif (LUA_VERSION_NUM >= 504)
++ {"quvi.base64.encode", l_quvi_base64_encode},
++ {"quvi.base64.decode", l_quvi_base64_decode},
++#endif
+ {NULL, NULL}
+ };
+
+@@ -80,10 +99,17 @@ QuviError l_init(_quvi_t q)
+ return (QUVI_ERROR_LUA_INIT);
+
+ luaL_openlibs(q->handle.lua);
++#if (LUA_VERSION_NUM == 501)
+ luaL_register(q->handle.lua, "quvi", quvi_reg_meth);
+ luaL_register(q->handle.lua, "quvi.http", quvi_http_reg_meth);
+ luaL_register(q->handle.lua, "quvi.crypto", quvi_crypto_reg_meth);
+ luaL_register(q->handle.lua, "quvi.base64", quvi_base64_reg_meth);
++#elif (LUA_VERSION_NUM >= 504)
++ luaL_newlib(q->handle.lua, quvi_reg_meth);
++ luaL_newlib(q->handle.lua, quvi_http_reg_meth);
++ luaL_newlib(q->handle.lua, quvi_crypto_reg_meth);
++ luaL_newlib(q->handle.lua, quvi_base64_reg_meth);
++#endif
+
+ return (QUVI_OK);
+ }