From 8edb00c990e563e6f91b278a212f2edf877cf763 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Thu, 11 Jun 2009 17:21:44 -0700 Subject: edify extensions for OTA package installation, part 2 Adds more edify functions for OTAs: is_mounted getprop apply_patch apply_patch_check apply_patch_space write_raw_image write_firmware_image package_extract_file This allows us to install radios, hboots, boot images, and install incremental OTA packages. Fixes a couple of dumb bugs in edify itself: - we were doubling the size of the function table each time it was *not* full, rather than each time it was full - "no such function" errors weren't visible to the parser, so they didn't prevent execution of the script. --- edify/parser.y | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'edify/parser.y') diff --git a/edify/parser.y b/edify/parser.y index 67a210fca..cf163c026 100644 --- a/edify/parser.y +++ b/edify/parser.y @@ -25,8 +25,8 @@ extern int gLine; extern int gColumn; -void yyerror(Expr** root, const char* s); -int yyparse(Expr** root); +void yyerror(Expr** root, int* error_count, const char* s); +int yyparse(Expr** root, int* error_count); %} @@ -45,6 +45,7 @@ int yyparse(Expr** root); %type arglist %parse-param {Expr** root} +%parse-param {int* error_count} %error-verbose /* declarations in increasing order of precedence */ @@ -86,7 +87,7 @@ expr: STRING { if ($$->fn == NULL) { char buffer[256]; snprintf(buffer, sizeof(buffer), "unknown function \"%s\"", $1); - yyerror(root, buffer); + yyerror(root, error_count, buffer); YYERROR; } $$->name = $1; @@ -113,9 +114,10 @@ arglist: /* empty */ { %% -void yyerror(Expr** root, const char* s) { +void yyerror(Expr** root, int* error_count, const char* s) { if (strlen(s) == 0) { s = "syntax error"; } printf("line %d col %d: %s\n", gLine, gColumn, s); + ++*error_count; } -- cgit v1.2.3