new lua function "getstack"; new interface to function luaI_reportbug.
This commit is contained in:
26
inout.c
26
inout.c
@@ -5,7 +5,7 @@
|
||||
** Also provides some predefined lua functions.
|
||||
*/
|
||||
|
||||
char *rcs_inout="$Id: inout.c,v 2.18 1995/03/17 20:42:20 roberto Exp roberto $";
|
||||
char *rcs_inout="$Id: inout.c,v 2.19 1995/05/02 18:43:03 roberto Exp roberto $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -19,6 +19,14 @@ char *rcs_inout="$Id: inout.c,v 2.18 1995/03/17 20:42:20 roberto Exp roberto $";
|
||||
#include "tree.h"
|
||||
#include "lua.h"
|
||||
|
||||
|
||||
#ifndef MAXFUNCSTACK
|
||||
#define MAXFUNCSTACK 100
|
||||
#endif
|
||||
|
||||
#define MAXMESSAGE MAXFUNCSTACK*80
|
||||
|
||||
|
||||
/* Exported variables */
|
||||
Word lua_linenumber;
|
||||
Bool lua_debug;
|
||||
@@ -145,10 +153,12 @@ void lua_popfunction (void)
|
||||
}
|
||||
|
||||
/*
|
||||
** Report bug building a message.
|
||||
** Report bug building a message and pushing it on the stack.
|
||||
*/
|
||||
void luaI_reportbug (char *msg, int size)
|
||||
void luaI_reportbug (char *s, int err)
|
||||
{
|
||||
char msg[MAXMESSAGE];
|
||||
strcpy (msg, s);
|
||||
if (lua_debugline != 0)
|
||||
{
|
||||
if (funcStack)
|
||||
@@ -163,7 +173,7 @@ void luaI_reportbug (char *msg, int size)
|
||||
lua_constant[func->function]->str, func->file, line);
|
||||
line = func->line;
|
||||
func = func->next;
|
||||
lua_popfunction();
|
||||
if (err) lua_popfunction();
|
||||
} while (func);
|
||||
}
|
||||
else
|
||||
@@ -173,6 +183,7 @@ void luaI_reportbug (char *msg, int size)
|
||||
lua_debugline, lua_filename());
|
||||
}
|
||||
}
|
||||
lua_pushstring(msg);
|
||||
}
|
||||
|
||||
|
||||
@@ -288,3 +299,10 @@ void luaI_error (void)
|
||||
lua_error(s);
|
||||
}
|
||||
|
||||
void luaI_getstack (void)
|
||||
{
|
||||
char *s = lua_getstring(lua_getparam(1));
|
||||
if (s == NULL) s = "";
|
||||
luaI_reportbug(s, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user