Update lua-argon2 for cosmopolitan/redbean

This commit is contained in:
Paul Kulchenko 2021-09-15 18:17:35 -07:00 committed by Justine Tunney
parent b51db9f923
commit 42aafc847e
3 changed files with 16 additions and 6 deletions

View file

@ -20,12 +20,12 @@ original implementaiton.
*/ */
#include <string.h> #include <libc/isystem/string.h>
#include <stdio.h> #include <libc/isystem/stdio.h>
#include <argon2.h> #include <third_party/argon2/argon2.h>
#include <lauxlib.h> #include <third_party/lua/lauxlib.h>
#include <lua.h> #include <third_party/lua/lua.h>
#include <lualib.h> #include <third_party/lua/lualib.h>
#ifndef LUA_51 #ifndef LUA_51

View file

@ -60,6 +60,7 @@ TOOL_NET_DIRECTDEPS = \
THIRD_PARTY_REGEX \ THIRD_PARTY_REGEX \
THIRD_PARTY_SQLITE3 \ THIRD_PARTY_SQLITE3 \
THIRD_PARTY_ZLIB \ THIRD_PARTY_ZLIB \
THIRD_PARTY_ARGON2 \
TOOL_DECODE_LIB TOOL_DECODE_LIB
TOOL_NET_DEPS := \ TOOL_NET_DEPS := \
@ -85,6 +86,7 @@ o/$(MODE)/tool/net/redbean.com.dbg: \
$(TOOL_NET_DEPS) \ $(TOOL_NET_DEPS) \
o/$(MODE)/tool/net/redbean.o \ o/$(MODE)/tool/net/redbean.o \
o/$(MODE)/tool/net/lsqlite3.o \ o/$(MODE)/tool/net/lsqlite3.o \
o/$(MODE)/tool/net/largon2.o \
o/$(MODE)/tool/net/net.pkg \ o/$(MODE)/tool/net/net.pkg \
$(CRT) \ $(CRT) \
$(APE) $(APE)
@ -143,6 +145,7 @@ o/$(MODE)/tool/net/redbean-demo.com.dbg: \
$(TOOL_NET_DEPS) \ $(TOOL_NET_DEPS) \
o/$(MODE)/tool/net/redbean.o \ o/$(MODE)/tool/net/redbean.o \
o/$(MODE)/tool/net/lsqlite3.o \ o/$(MODE)/tool/net/lsqlite3.o \
o/$(MODE)/tool/net/largon2.o \
o/$(MODE)/tool/net/net.pkg \ o/$(MODE)/tool/net/net.pkg \
o/$(MODE)/tool/net/demo/sql.lua.zip.o \ o/$(MODE)/tool/net/demo/sql.lua.zip.o \
o/$(MODE)/tool/net/demo/fetch.lua.zip.o \ o/$(MODE)/tool/net/demo/fetch.lua.zip.o \

View file

@ -5421,9 +5421,16 @@ static const luaL_Reg kLuaFuncs[] = {
extern int luaopen_lsqlite3(lua_State *); extern int luaopen_lsqlite3(lua_State *);
#ifndef UNSECURE
extern int luaopen_argon2(lua_State *);
#endif
static const luaL_Reg kLuaLibs[] = { static const luaL_Reg kLuaLibs[] = {
{"re", LuaRe}, // {"re", LuaRe}, //
{"lsqlite3", luaopen_lsqlite3}, // {"lsqlite3", luaopen_lsqlite3}, //
#ifndef UNSECURE
{"argon2", luaopen_argon2}, //
#endif
}; };
static void LuaSetArgv(lua_State *L) { static void LuaSetArgv(lua_State *L) {