diff options
author | Robert Bieber <robby@bieberphoto.com> | 2010-06-07 23:49:06 +0000 |
---|---|---|
committer | Robert Bieber <robby@bieberphoto.com> | 2010-06-07 23:49:06 +0000 |
commit | 06ea93da8269ada1b19ce28791a05e57fbb453ac (patch) | |
tree | 248c075289f84a4a880080dac131be39e983ef1a /utils/themeeditor/skin_scan.c | |
parent | ee1feb63f316dee184283fdf54039223e8b66073 (diff) | |
download | rockbox-06ea93da8269ada1b19ce28791a05e57fbb453ac.tar.gz rockbox-06ea93da8269ada1b19ce28791a05e57fbb453ac.zip |
Theme Editor: Factored out code to skip over enum/arg lists while scanning for children counts, and fixed all of the parsing bugs caused by innacurate children counts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26679 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/skin_scan.c')
-rw-r--r-- | utils/themeeditor/skin_scan.c | 59 |
1 files changed, 57 insertions, 2 deletions
diff --git a/utils/themeeditor/skin_scan.c b/utils/themeeditor/skin_scan.c index 19e959b5b8..79f7162aab 100644 --- a/utils/themeeditor/skin_scan.c +++ b/utils/themeeditor/skin_scan.c | |||
@@ -34,14 +34,69 @@ | |||
34 | /* Simple function to advance a char* past a comment */ | 34 | /* Simple function to advance a char* past a comment */ |
35 | void skip_comment(char** document) | 35 | void skip_comment(char** document) |
36 | { | 36 | { |
37 | for(/*NO INIT*/;**document != '\n' && **document != '\0'; (*document)++); | 37 | while(**document != '\n' && **document != '\0') |
38 | (*document)++; | ||
38 | if(**document == '\n') | 39 | if(**document == '\n') |
39 | (*document)++; | 40 | (*document)++; |
40 | } | 41 | } |
41 | 42 | ||
42 | void skip_whitespace(char** document) | 43 | void skip_whitespace(char** document) |
43 | { | 44 | { |
44 | for(/*NO INIT*/; **document == ' ' || **document == '\t'; (*document)++); | 45 | while(**document == ' ' || **document == '\t') |
46 | (*document)++; | ||
47 | } | ||
48 | |||
49 | void skip_arglist(char** document) | ||
50 | { | ||
51 | if(**document == ARGLISTOPENSYM) | ||
52 | (*document)++; | ||
53 | while(**document && **document != ARGLISTCLOSESYM) | ||
54 | { | ||
55 | if(**document == TAGSYM) | ||
56 | { | ||
57 | (*document)++; | ||
58 | if(**document == '\0') | ||
59 | break; | ||
60 | (*document)++; | ||
61 | } | ||
62 | else if(**document == ARGLISTOPENSYM) | ||
63 | skip_arglist(document); | ||
64 | else if(**document == ENUMLISTOPENSYM) | ||
65 | skip_enumlist(document); | ||
66 | else if(**document == COMMENTSYM) | ||
67 | skip_comment(document); | ||
68 | else | ||
69 | (*document)++; | ||
70 | } | ||
71 | if(**document == ARGLISTCLOSESYM) | ||
72 | (*document)++; | ||
73 | } | ||
74 | |||
75 | void skip_enumlist(char** document) | ||
76 | { | ||
77 | if(**document == ENUMLISTOPENSYM) | ||
78 | (*document)++; | ||
79 | while(**document && **document != ENUMLISTCLOSESYM) | ||
80 | { | ||
81 | if(**document == TAGSYM) | ||
82 | { | ||
83 | (*document)++; | ||
84 | if(**document == '\0') | ||
85 | break; | ||
86 | (*document)++; | ||
87 | } | ||
88 | else if(**document == ARGLISTOPENSYM) | ||
89 | skip_arglist(document); | ||
90 | else if(**document == ENUMLISTOPENSYM) | ||
91 | skip_enumlist(document); | ||
92 | else if(**document == COMMENTSYM) | ||
93 | skip_comment(document); | ||
94 | else | ||
95 | (*document)++; | ||
96 | } | ||
97 | |||
98 | if(**document == ENUMLISTCLOSESYM) | ||
99 | (*document)++; | ||
45 | } | 100 | } |
46 | 101 | ||
47 | char* scan_string(char** document) | 102 | char* scan_string(char** document) |