| 51 | } |
| 52 | |
| 53 | static void *checkgroup(lua_State *L, int index, const char *groupname) { |
| 54 | if (!lua_getmetatable(L, index)) { |
| 55 | throw_argerror(L, index, groupname); |
| 56 | } |
| 57 | |
| 58 | lua_pushstring(L, groupname); |
| 59 | lua_rawget(L, -2); |
| 60 | if (lua_isnil(L, -1)) { |
| 61 | lua_pop(L, 2); |
| 62 | throw_argerror(L, index, groupname); |
| 63 | } else { |
| 64 | lua_pop(L, 2); |
| 65 | return lua_touserdata(L, index); |
| 66 | } |
| 67 | return NULL; // Not reachable |
| 68 | } |
| 69 | |
| 70 | static void *checktype(lua_State *L, int index, const char *typename) { |
| 71 | if (strcmp(typename, SOCKET_ANY) == 0 || |
no test coverage detected