MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaF_getlocalname

Function luaF_getlocalname

depends/lua/src/lfunc.c:140–150  ·  view source on GitHub ↗

** Look for n-th local variable at line 'line' in function 'func'. ** Returns NULL if not found. */

Source from the content-addressed store, hash-verified

138** Returns NULL if not found.
139*/
140const char *luaF_getlocalname (const Proto *f, int local_number, int pc) {
141 int i;
142 for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) {
143 if (pc < f->locvars[i].endpc) { /* is variable active? */
144 local_number--;
145 if (local_number == 0)
146 return getstr(f->locvars[i].varname);
147 }
148 }
149 return NULL; /* not found */
150}
151

Callers 3

findlocalFunction · 0.85
lua_getlocalFunction · 0.85
getobjnameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected