MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / lua_upvalueid

Function lua_upvalueid

lib/lua/src/lapi.c:1431–1450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1429
1430
1431LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) {
1432 TValue *fi = index2value(L, fidx);
1433 switch (ttypetag(fi)) {
1434 case LUA_VLCL: { /* lua closure */
1435 return *getupvalref(L, fidx, n, NULL);
1436 }
1437 case LUA_VCCL: { /* C closure */
1438 CClosure *f = clCvalue(fi);
1439 if (1 <= n && n <= f->nupvalues)
1440 return &f->upvalue[n - 1];
1441 /* else */
1442 } /* FALLTHROUGH */
1443 case LUA_VLCF:
1444 return NULL; /* light C functions have no upvalues */
1445 default: {
1446 api_check(L, 0, "function expected");
1447 return NULL;
1448 }
1449 }
1450}
1451
1452
1453LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1,

Callers 1

checkupvalFunction · 0.85

Calls 2

index2valueFunction · 0.85
getupvalrefFunction · 0.85

Tested by

no test coverage detected