1
0
Fork 0
forked from len0rd/rockbox
* remove debug statement from llex.c
 * add DEBUGF to rocklua.c on parse error
 * add file_exists wrapper


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21025 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Maurus Cuelenaere 2009-05-22 01:03:22 +00:00
parent 2cd4a94bdc
commit fb6b15980a
3 changed files with 10 additions and 1 deletions

View file

@ -102,7 +102,6 @@ static const char *txtToken (LexState *ls, int token) {
void luaX_lexerror (LexState *ls, const char *msg, int token) { void luaX_lexerror (LexState *ls, const char *msg, int token) {
char buff[MAXSRC]; char buff[MAXSRC];
luaO_chunkid(buff, getstr(ls->source), MAXSRC); luaO_chunkid(buff, getstr(ls->source), MAXSRC);
rb->splashf(3*HZ, "%d %c 0x%X", ls->linenumber, ls->linenumber, ls->linenumber);
msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg); msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg);
if (token) if (token)
luaO_pushfstring(ls->L, "%s near " LUA_QS, msg, txtToken(ls, token)); luaO_pushfstring(ls->L, "%s near " LUA_QS, msg, txtToken(ls, token));

View file

@ -406,6 +406,14 @@ RB_WRAP(filesize)
return 1; return 1;
} }
RB_WRAP(file_exists)
{
const char* path = luaL_checkstring(L, 1);
bool result = rb->file_exists(path);
lua_pushboolean(L, result);
return 1;
}
#define R(NAME) {#NAME, rock_##NAME} #define R(NAME) {#NAME, rock_##NAME}
static const luaL_Reg rocklib[] = static const luaL_Reg rocklib[] =
{ {
@ -440,6 +448,7 @@ static const luaL_Reg rocklib[] =
R(rename), R(rename),
R(ftruncate), R(ftruncate),
R(filesize), R(filesize),
R(file_exists),
/* Kernel */ /* Kernel */
R(sleep), R(sleep),

View file

@ -93,6 +93,7 @@ enum plugin_status plugin_start(const void* parameter)
dlmalloc_stats(); dlmalloc_stats();
if (status) { if (status) {
DEBUGF("%s\n", lua_tostring(L, -1));
rb->splashf(5 * HZ, "%s", lua_tostring(L, -1)); rb->splashf(5 * HZ, "%s", lua_tostring(L, -1));
lua_pop(L, 1); lua_pop(L, 1);
} }