From c4351c791052ad529a4e83c600b1aa6e6420ea86 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Mon, 22 Feb 2010 14:46:32 -0800 Subject: refactor applypatch and friends Change the applypatch function to take meaningful arguments instead of argc and argv. Move all the parsing of arguments into main.c (for the standalone binary) and into install.c (for the updater function). applypatch() takes patches as Value objects, so we can pass in blobs extracted from the package without ever writing them to temp files. The patching code is changed to read the patch from memory instead of a file. A bunch of compiler warnings (mostly about signed vs unsigned types) are fixed. Support for the IMGDIFF1 format is dropped. (We've been generating IMGDIFF2 packages for some time now.) Change-Id: I217563c500012750f27110db821928a06211323f --- edify/main.c | 3 ++- edify/yydefs.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'edify') diff --git a/edify/main.c b/edify/main.c index a2b74ad..8557043 100644 --- a/edify/main.c +++ b/edify/main.c @@ -42,11 +42,12 @@ int expect(const char* expr_str, const char* expected, int* errors) { State state; state.cookie = NULL; - state.script = expr_str; + state.script = strdup(expr_str); state.errmsg = NULL; result = Evaluate(&state, e); free(state.errmsg); + free(state.script); if (result == NULL && expected != NULL) { fprintf(stderr, "error evaluating \"%s\"\n", expr_str); ++*errors; diff --git a/edify/yydefs.h b/edify/yydefs.h index 6257862..aca398f 100644 --- a/edify/yydefs.h +++ b/edify/yydefs.h @@ -33,4 +33,6 @@ typedef struct { } \ } while (0) +int yylex(); + #endif -- cgit v1.1