MCPcopy Create free account
hub / github.com/apache/thrift / checkgroup

Function checkgroup

lib/lua/src/luasocket.c:53–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53static 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
70static void *checktype(lua_State *L, int index, const char *typename) {
71 if (strcmp(typename, SOCKET_ANY) == 0 ||

Callers 1

checktypeFunction · 0.85

Calls 1

throw_argerrorFunction · 0.85

Tested by

no test coverage detected