Lines Matching refs:ar
164 LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) {
173 ar->i_ci = ci;
224 LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) {
227 if (ar == NULL) { /* information about non-active function? */
233 else { /* active function; get information through 'ar' */
235 name = luaG_findlocal(L, ar->i_ci, n, &pos);
246 LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) {
250 name = luaG_findlocal(L, ar->i_ci, n, &pos);
260 static void funcinfo (lua_Debug *ar, Closure *cl) {
262 ar->source = "=[C]";
263 ar->srclen = LL("=[C]");
264 ar->linedefined = -1;
265 ar->lastlinedefined = -1;
266 ar->what = "C";
271 ar->source = getstr(p->source);
272 ar->srclen = tsslen(p->source);
275 ar->source = "=?";
276 ar->srclen = LL("=?");
278 ar->linedefined = p->linedefined;
279 ar->lastlinedefined = p->lastlinedefined;
280 ar->what = (ar->linedefined == 0) ? "main" : "Lua";
282 luaO_chunkid(ar->short_src, ar->source, ar->srclen);
330 static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar,
336 funcinfo(ar, f);
340 ar->currentline = (ci && isLua(ci)) ? getcurrentline(ci) : -1;
344 ar->nups = (f == NULL) ? 0 : f->c.nupvalues;
346 ar->isvararg = 1;
347 ar->nparams = 0;
350 ar->isvararg = f->l.p->is_vararg;
351 ar->nparams = f->l.p->numparams;
356 ar->istailcall = (ci) ? ci->callstatus & CIST_TAIL : 0;
360 ar->namewhat = getfuncname(L, ci, &ar->name);
361 if (ar->namewhat == NULL) {
362 ar->namewhat = ""; /* not found */
363 ar->name = NULL;
369 ar->ftransfer = ar->ntransfer = 0;
371 ar->ftransfer = ci->u2.transferinfo.ftransfer;
372 ar->ntransfer = ci->u2.transferinfo.ntransfer;
386 LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
400 ci = ar->i_ci;
405 status = auxgetinfo(L, what, ar, cl, ci);