Fix lsqlite3.lversion() and document local changes

Fixes #507
This commit is contained in:
Justine Tunney 2022-07-24 05:08:08 -07:00
parent f968e2a726
commit 8593580d0a
4 changed files with 17 additions and 5 deletions

View file

@ -13,6 +13,8 @@
-- TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
unix.pledge('stdio')
local function test(s, b64)
assert(EncodeBase64(s) == b64)
assert(DecodeBase64(b64) == s)

View file

@ -13,6 +13,8 @@
-- TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
unix.pledge('stdio')
-- https://datatracker.ietf.org/doc/html/rfc1321#appendix-A.5
assert(Md5("hello") == "\x5d\x41\x40\x2a\xbc\x4b\x2a\x76\xb9\x71\x9d\x91\x10\x17\xc5\x92")
assert(Md5("") == "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04\xe9\x80\x09\x98\xec\xf8\x42\x7e")

View file

@ -19,6 +19,8 @@
-- 5869). As with RFC 4634, code to perform SHA-based Hashed Message
-- Authentication Codes (HMACs) is also included.
unix.pledge('stdio')
-- SHA-1
assert(Sha1("abc") == "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e\x25\x71\x78\x50\xc2\x6c\x9c\xd0\xd8\x9d")
assert(

View file

@ -41,6 +41,17 @@ lsqlite3 (MIT License)\\n\
Copyright 2002-2016 Tiago Dionizio, Doug Currie\"");
asm(".include \"libc/disclaimer.inc\"");
// LOCAL CHANGES
//
// - Remove online backup code
// - Remove trace callback code
// - Remove progress callback code
// - Removed extension loading code
// - Relocate static .data to .rodata
// - Changed lua_strlen() to lua_rawlen()
//
#define LSQLITE_VERSION "0.9.5"
/* luaL_typerror always used with arg at ndx == NULL */
#define luaL_typerror(L,ndx,str) luaL_error(L,"bad argument %d (%s expected, got nil)",ndx,str)
/* luaL_register used once, so below expansion is OK for this case */
@ -1733,11 +1744,6 @@ static int lsqlite_newindex(lua_State *L) {
return 0;
}
#ifndef LSQLITE_VERSION
/* should be defined in rockspec, but just in case... */
#define LSQLITE_VERSION "unknown"
#endif
/* Version number of this library
*/
static int lsqlite_lversion(lua_State *L) {