MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / auxgetinfo

Function auxgetinfo

deps/lua/src/ldebug.c:193–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191
192
193static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar,
194 Closure *f, CallInfo *ci) {
195 int status = 1;
196 if (f == NULL) {
197 info_tailcall(ar);
198 return status;
199 }
200 for (; *what; what++) {
201 switch (*what) {
202 case 'S': {
203 funcinfo(ar, f);
204 break;
205 }
206 case 'l': {
207 ar->currentline = (ci) ? currentline(L, ci) : -1;
208 break;
209 }
210 case 'u': {
211 ar->nups = f->c.nupvalues;
212 break;
213 }
214 case 'n': {
215 ar->namewhat = (ci) ? getfuncname(L, ci, &ar->name) : NULL;
216 if (ar->namewhat == NULL) {
217 ar->namewhat = ""; /* not found */
218 ar->name = NULL;
219 }
220 break;
221 }
222 case 'L':
223 case 'f': /* handled by lua_getinfo */
224 break;
225 default: status = 0; /* invalid option */
226 }
227 }
228 return status;
229}
230
231
232LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {

Callers 1

lua_getinfoFunction · 0.85

Calls 4

info_tailcallFunction · 0.85
funcinfoFunction · 0.85
currentlineFunction · 0.85
getfuncnameFunction · 0.85

Tested by

no test coverage detected