summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-22 01:03:22 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-22 01:03:22 +0000
commitfb6b15980a268e95523e63c37fe105a9640191b5 (patch)
tree83098c325ee03a3a9b23677ba26033f3aec62aac /apps
parent2cd4a94bdc4977e1ff1f26d1e911c1d826ef2f84 (diff)
downloadrockbox-fb6b15980a268e95523e63c37fe105a9640191b5.tar.gz
rockbox-fb6b15980a268e95523e63c37fe105a9640191b5.zip
Lua:
* 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
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/lua/llex.c1
-rw-r--r--apps/plugins/lua/rocklib.c9
-rw-r--r--apps/plugins/lua/rocklua.c1
3 files changed, 10 insertions, 1 deletions
diff --git a/apps/plugins/lua/llex.c b/apps/plugins/lua/llex.c
index 3d0ca5b58e..85ac516be3 100644
--- a/apps/plugins/lua/llex.c
+++ b/apps/plugins/lua/llex.c
@@ -102,7 +102,6 @@ static const char *txtToken (LexState *ls, int token) {
void luaX_lexerror (LexState *ls, const char *msg, int token) {
char buff[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);
if (token)
luaO_pushfstring(ls->L, "%s near " LUA_QS, msg, txtToken(ls, token));
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c
index 1c6469641e..99bc44c9a4 100644
--- a/apps/plugins/lua/rocklib.c
+++ b/apps/plugins/lua/rocklib.c
@@ -406,6 +406,14 @@ RB_WRAP(filesize)
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}
static const luaL_Reg rocklib[] =
{
@@ -440,6 +448,7 @@ static const luaL_Reg rocklib[] =
R(rename),
R(ftruncate),
R(filesize),
+ R(file_exists),
/* Kernel */
R(sleep),
diff --git a/apps/plugins/lua/rocklua.c b/apps/plugins/lua/rocklua.c
index 4bb89ae29b..e72591445f 100644
--- a/apps/plugins/lua/rocklua.c
+++ b/apps/plugins/lua/rocklua.c
@@ -93,6 +93,7 @@ enum plugin_status plugin_start(const void* parameter)
dlmalloc_stats();
if (status) {
+ DEBUGF("%s\n", lua_tostring(L, -1));
rb->splashf(5 * HZ, "%s", lua_tostring(L, -1));
lua_pop(L, 1);
}