Rename redbean Lua function GetComment to GetAssetComment

This breaking change improves consistency with other GetAsset* functions.
This commit is contained in:
Paul Kulchenko 2021-10-31 16:37:57 -07:00
parent 93d2cf3d11
commit cde92c3944
2 changed files with 6 additions and 6 deletions

View file

@ -592,6 +592,10 @@ FUNCTIONS
Turns integer like 0x01020304 into a string like 1.2.3.4. See also Turns integer like 0x01020304 into a string like 1.2.3.4. See also
ParseIp for the inverse operation. ParseIp for the inverse operation.
GetAssetComment(path:str) → str
Returns comment text associated with asset in the ZIP central
directory.
GetAssetMode(path:str) → int GetAssetMode(path:str) → int
Returns UNIX-style octal mode for ZIP asset (or local file if the Returns UNIX-style octal mode for ZIP asset (or local file if the
-D flag is used) -D flag is used)
@ -600,10 +604,6 @@ FUNCTIONS
Returns byte size of uncompressed contents of ZIP asset (or local Returns byte size of uncompressed contents of ZIP asset (or local
file if the -D flag is used) file if the -D flag is used)
GetComment(path:str) → str
Returns comment text associated with asset in the ZIP central
directory.
GetCookie(name:str) → str GetCookie(name:str) → str
Returns cookie value. Returns cookie value.

View file

@ -5092,7 +5092,7 @@ static int LuaIsDaemon(lua_State *L) {
return 1; return 1;
} }
static int LuaGetComment(lua_State *L) { static int LuaGetAssetComment(lua_State *L) {
struct Asset *a; struct Asset *a;
const char *path; const char *path;
size_t pathlen, m; size_t pathlen, m;
@ -5325,10 +5325,10 @@ static const luaL_Reg kLuaFuncs[] = {
{"Fetch", LuaFetch}, // {"Fetch", LuaFetch}, //
{"FormatHttpDateTime", LuaFormatHttpDateTime}, // {"FormatHttpDateTime", LuaFormatHttpDateTime}, //
{"FormatIp", LuaFormatIp}, // {"FormatIp", LuaFormatIp}, //
{"GetAssetComment", LuaGetAssetComment}, //
{"GetAssetMode", LuaGetAssetMode}, // {"GetAssetMode", LuaGetAssetMode}, //
{"GetAssetSize", LuaGetAssetSize}, // {"GetAssetSize", LuaGetAssetSize}, //
{"GetClientAddr", LuaGetClientAddr}, // {"GetClientAddr", LuaGetClientAddr}, //
{"GetComment", LuaGetComment}, //
{"GetCookie", LuaGetCookie}, // {"GetCookie", LuaGetCookie}, //
{"GetDate", LuaGetDate}, // {"GetDate", LuaGetDate}, //
{"GetEffectivePath", LuaGetEffectivePath}, // {"GetEffectivePath", LuaGetEffectivePath}, //