Add Deflate() / Inflate() to redbean and fix bugs

The Compress() and Uncompress() APIs were a mistake. The functions
themselves work fine, but it's a design blemish and does superfluous
work. Since they were only introduced in the last few weeks, they're now
deprecated and references to them have been scrubbed from the website
and other documentation. Please use the new APIs since the old APIs will
be removed at some point in the future.

This change introduces automated Lua unit tests for the Redbean APIs.
There's a few functions that were broken which have now been fixed, e.g.
Underlong() and Decimate().
This commit is contained in:
Justine Tunney 2022-07-08 09:47:04 -07:00
parent a18044c504
commit fe5c475f83
12 changed files with 347 additions and 98 deletions

View file

@ -21,6 +21,7 @@ int LuaCrc32c(lua_State *);
int LuaDecimate(lua_State *);
int LuaDecodeBase64(lua_State *);
int LuaDecodeLatin1(lua_State *);
int LuaDeflate(lua_State *);
int LuaEncodeBase64(lua_State *);
int LuaEncodeLatin1(lua_State *);
int LuaEscapeFragment(lua_State *);
@ -48,6 +49,7 @@ int LuaGetTime(lua_State *);
int LuaHasControlCodes(lua_State *);
int LuaHex(lua_State *);
int LuaIndentLines(lua_State *);
int LuaInflate(lua_State *);
int LuaIsAcceptableHost(lua_State *);
int LuaIsAcceptablePath(lua_State *);
int LuaIsAcceptablePort(lua_State *);