MCPcopy Create free account
hub / github.com/defold/defold / buffer_meth_setstats

Function buffer_meth_setstats

engine/script/src/luasocket/buffer.c:63–69  ·  view source on GitHub ↗

-------------------------------------------------------------------------*\ * object:setstats() interface \*-------------------------------------------------------------------------*/

Source from the content-addressed store, hash-verified

61* object:setstats() interface
62\*-------------------------------------------------------------------------*/
63int buffer_meth_setstats(lua_State *L, p_buffer buf) {
64 buf->received = (long) luaL_optnumber(L, 2, (lua_Number) buf->received);
65 buf->sent = (long) luaL_optnumber(L, 3, (lua_Number) buf->sent);
66 if (lua_isnumber(L, 4)) buf->birthday = timeout_gettime() - lua_tonumber(L, 4);
67 lua_pushnumber(L, 1);
68 return 1;
69}
70
71/*-------------------------------------------------------------------------*\
72* object:send() interface

Callers 3

meth_setstatsFunction · 0.85
meth_setstatsFunction · 0.85
meth_setstatsFunction · 0.85

Calls 5

luaL_optnumberFunction · 0.85
lua_isnumberFunction · 0.85
timeout_gettimeFunction · 0.85
lua_tonumberFunction · 0.85
lua_pushnumberFunction · 0.85

Tested by

no test coverage detected