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

Function lua_tocfunction

Plugins/UnLua/Source/ThirdParty/Lua/lua-5.4.3/src/lapi.c:432–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430
431
432LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) {
433 const TValue *o = index2value(L, idx);
434 if (ttislcf(o)) return fvalue(o);
435 else if (ttisCclosure(o))
436 return clCvalue(o)->f;
437 else return NULL; /* not a C function */
438}
439
440
441static void *touserdata (const TValue *o) {

Callers 1

runCFunction · 0.85

Calls 1

index2valueFunction · 0.85

Tested by 1

runCFunction · 0.68