=========================================================================*\ * Internal functions \*=========================================================================*/
| 86 | * Internal functions |
| 87 | \*=========================================================================*/ |
| 88 | static 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 | |
| 104 | static int dirty(lua_State *L) { |
| 105 | int is = 0; |
no test coverage detected