summaryrefslogtreecommitdiff
path: root/utils/themeeditor/skin_parser.c
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-05-27 19:57:15 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-05-27 19:57:15 +0000
commit8ea056db4b6c60e2e623cd0e79ccb64aea5bec51 (patch)
treeb0ae89113d95c33616b4edda0abe22f63415e0a4 /utils/themeeditor/skin_parser.c
parentdeb1600bbc4d0e04f4560186fb665dc95b908e14 (diff)
downloadrockbox-8ea056db4b6c60e2e623cd0e79ccb64aea5bec51.tar.gz
rockbox-8ea056db4b6c60e2e623cd0e79ccb64aea5bec51.zip
Theme Editor: Fixed a bug in the subline parser, added a LINE element to contain logical lines, working on data model
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26337 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/skin_parser.c')
-rw-r--r--utils/themeeditor/skin_parser.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/utils/themeeditor/skin_parser.c b/utils/themeeditor/skin_parser.c
index dd061a1ac9..a6c5ea41a2 100644
--- a/utils/themeeditor/skin_parser.c
+++ b/utils/themeeditor/skin_parser.c
@@ -151,6 +151,14 @@ struct skin_element* skin_parse_line_optional(char** document, int conditional)
151 151
152 struct skin_element* root = NULL; 152 struct skin_element* root = NULL;
153 struct skin_element* current = NULL; 153 struct skin_element* current = NULL;
154 struct skin_element* retval = NULL;
155
156 /* A wrapper for the line */
157 retval = skin_alloc_element();
158 retval->type = LINE;
159 retval->line = skin_line;
160 retval->children_count = 1;
161 retval->children = skin_alloc_children(1);
154 162
155 while(*cursor != '\n' && *cursor != '\0' && *cursor != MULTILINESYM 163 while(*cursor != '\n' && *cursor != '\0' && *cursor != MULTILINESYM
156 && !((*cursor == ARGLISTSEPERATESYM 164 && !((*cursor == ARGLISTSEPERATESYM
@@ -214,7 +222,8 @@ struct skin_element* skin_parse_line_optional(char** document, int conditional)
214 /* Moving up the calling function's pointer */ 222 /* Moving up the calling function's pointer */
215 *document = cursor; 223 *document = cursor;
216 224
217 return root; 225 retval->children[0] = root;
226 return retval;
218} 227}
219 228
220struct skin_element* skin_parse_sublines(char** document) 229struct skin_element* skin_parse_sublines(char** document)
@@ -233,6 +242,7 @@ struct skin_element* skin_parse_sublines_optional(char** document,
233 retval = skin_alloc_element(); 242 retval = skin_alloc_element();
234 retval->type = SUBLINES; 243 retval->type = SUBLINES;
235 retval->next = NULL; 244 retval->next = NULL;
245 retval->line = skin_line;
236 246
237 /* First we count the sublines */ 247 /* First we count the sublines */
238 while(*cursor != '\0' && *cursor != '\n' 248 while(*cursor != '\0' && *cursor != '\n'
@@ -276,7 +286,7 @@ struct skin_element* skin_parse_sublines_optional(char** document,
276 skin_error(MULTILINE_EXPECTED); 286 skin_error(MULTILINE_EXPECTED);
277 return NULL; 287 return NULL;
278 } 288 }
279 else 289 else if(i != sublines - 1)
280 { 290 {
281 cursor++; 291 cursor++;
282 } 292 }