From bcd90b96d4f5883dd9bff923d53b631190d9bd74 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 15 Jan 2020 19:01:28 -0800 Subject: [PATCH] Add comment to lib_gFindMap so I know what the fuck I did --- src/lua_baselib.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index dfc5398cd..6964d5cc9 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2802,6 +2802,31 @@ Lpushdim (lua_State *L, int c, struct searchdim *v) I decided to make this return a table because userdata is scary and tables let the user set their own fields. */ +/* +Returns: + +[1] => map number +[2] => map title +[3] => search frequency table + +The frequency table is unsorted. It has the following format: + +{ + ['mapnum'], + + ['matchd'] => matches in map title string + ['keywhd'] => matches in map keywords + + The above two tables have the following format: + + { + ['pos'] => offset from start of string + ['siz'] => length of match + }... + + ['total'] => the total matches +}... +*/ static int lib_gFindMap(lua_State *L) { const char *query = luaL_checkstring(L, 1);