MCPcopy Create free account
hub / github.com/Tencent/UnLua / mime_global_dot

Function mime_global_dot

Plugins/UnLuaExtensions/LuaSocket/Source/src/mime.cpp:834–853  ·  view source on GitHub ↗

-------------------------------------------------------------------------*\ * Incrementally applies smtp stuffing to a string * A, n = dot(l, D) \*-------------------------------------------------------------------------*/

Source from the content-addressed store, hash-verified

832* A, n = dot(l, D)
833\*-------------------------------------------------------------------------*/
834static int mime_global_dot(lua_State *L)
835{
836 size_t isize = 0, state = (size_t) luaL_checknumber(L, 1);
837 const char *input = luaL_optlstring(L, 2, NULL, &isize);
838 const char *last = input + isize;
839 luaL_Buffer buffer;
840 /* end-of-input blackhole */
841 if (!input) {
842 lua_pushnil(L);
843 lua_pushnumber(L, 2);
844 return 2;
845 }
846 /* process all input */
847 luaL_buffinit(L, &buffer);
848 while (input < last)
849 state = dot(*input++, state, &buffer);
850 luaL_pushresult(&buffer);
851 lua_pushnumber(L, (lua_Number) state);
852 return 2;
853}
854
855EXTENSION_NAMESPACE_END

Callers

nothing calls this directly

Calls 7

luaL_checknumberFunction · 0.85
luaL_optlstringFunction · 0.85
lua_pushnilFunction · 0.85
lua_pushnumberFunction · 0.85
luaL_buffinitFunction · 0.85
dotFunction · 0.85
luaL_pushresultFunction · 0.85

Tested by

no test coverage detected