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

Function getfd

Plugins/UnLuaExtensions/LuaSocket/Source/src/select.cpp:88–102  ·  view source on GitHub ↗

=========================================================================*\ * Internal functions \*=========================================================================*/

Source from the content-addressed store, hash-verified

86* Internal functions
87\*=========================================================================*/
88static t_socket getfd(lua_State *L) {
89 t_socket fd = SOCKET_INVALID;
90 lua_pushstring(L, "getfd");
91 lua_gettable(L, -2);
92 if (!lua_isnil(L, -1)) {
93 lua_pushvalue(L, -2);
94 lua_call(L, 1, 1);
95 if (lua_isnumber(L, -1)) {
96 double numfd = lua_tonumber(L, -1);
97 fd = (numfd >= 0.0)? (t_socket) numfd: SOCKET_INVALID;
98 }
99 }
100 lua_pop(L, 1);
101 return fd;
102}
103
104static int dirty(lua_State *L) {
105 int is = 0;

Callers 2

collect_fdFunction · 0.85
check_dirtyFunction · 0.85

Calls 4

lua_pushstringFunction · 0.85
lua_gettableFunction · 0.85
lua_pushvalueFunction · 0.85
lua_isnumberFunction · 0.85

Tested by

no test coverage detected