diff options
author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2008-07-12 15:12:09 +0000 |
---|---|---|
committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2008-07-12 15:12:09 +0000 |
commit | ae055017169f699f262606fd307e836d456d2535 (patch) | |
tree | 962ca43faf2829da6629496cfcd3782f3ce9fd8a /apps/gui/gwps.h | |
parent | 70029587ca0a7a2c0ffdbc48145c369385dfc803 (diff) |
Introduce a new WPS parsing error case: limits exceeded. It includes the cases when there are too many tokens, lines, sublines, viewports, strings, characters or conditional levels. This prevents the parser from failing silently or going on, as it used to do in those cases. Thanks to fml (Alexander Levin) for mentioning this issue.
I also changed the error types from #defines to an enum, for cleanliness.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18015 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/gwps.h')
-rw-r--r-- | apps/gui/gwps.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index 69a84f915b..99bf701a7d 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h @@ -126,6 +126,15 @@ struct align_pos { (1/HZ sec, or 100ths of sec) */ #define SUBLINE_RESET -1 +enum wps_parse_error { + PARSE_OK, + PARSE_FAIL_UNCLOSED_COND, + PARSE_FAIL_INVALID_CHAR, + PARSE_FAIL_COND_SYNTAX_ERROR, + PARSE_FAIL_COND_INVALID_PARAM, + PARSE_FAIL_LIMITS_EXCEEDED, +}; + enum wps_token_type { WPS_NO_TOKEN, /* for WPS tags we don't want to save as tokens */ WPS_TOKEN_UNKNOWN, |