diff options
author | Robert Bieber <robby@bieberphoto.com> | 2010-07-18 00:59:02 +0000 |
---|---|---|
committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-18 00:59:02 +0000 |
commit | 3c4fb8abe4e28091cb857705af2d762cd00b985a (patch) | |
tree | 804090633b693cbb185d801a75683404d345e2fc /lib/skin_parser/skin_debug.c | |
parent | eb52a45a0c1f42386dbc0e148e81972ae3878b71 (diff) | |
download | rockbox-3c4fb8abe4e28091cb857705af2d762cd00b985a.tar.gz rockbox-3c4fb8abe4e28091cb857705af2d762cd00b985a.zip |
Theme Editor: Added column number to parser error messages
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27477 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'lib/skin_parser/skin_debug.c')
-rw-r--r-- | lib/skin_parser/skin_debug.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/skin_parser/skin_debug.c b/lib/skin_parser/skin_debug.c index 4abe6252f0..c03b32e910 100644 --- a/lib/skin_parser/skin_debug.c +++ b/lib/skin_parser/skin_debug.c @@ -30,15 +30,25 @@ /* Global variables for debug output */ int debug_indent_level = 0; extern int skin_line; +extern char* skin_start; /* Global error variables */ int error_line; +int error_col; char* error_message; /* Debugging functions */ -void skin_error(enum skin_errorcode error) +void skin_error(enum skin_errorcode error, char* cursor) { + error_col = 0; + + while(cursor > skin_start && *cursor != '\n') + { + cursor--; + error_col++; + } + error_line = skin_line; switch(error) @@ -91,6 +101,11 @@ int skin_error_line() return error_line; } +int skin_error_col() +{ + return error_col; +} + char* skin_error_message() { return error_message; @@ -99,6 +114,7 @@ char* skin_error_message() void skin_clear_errors() { error_line = 0; + error_col = 0; error_message = NULL; } |