summaryrefslogtreecommitdiffstats
path: root/src/wgtpkg-unit.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-05-02 10:34:52 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-09-19 15:25:36 +0200
commit6b647feb6483cecbfbf50efde394b5a7d8d0aa56 (patch)
tree13cca6999c0d4530f9445c19afb492021096c4ce /src/wgtpkg-unit.c
parent36b13c48406e977265669f5c99802571b8499cef (diff)
Include json description for callbacks
This tiny modification is mainly for debugging. Change-Id: Ieda90da49d365a7b092a02833227c869bd0397a4 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/wgtpkg-unit.c')
-rw-r--r--src/wgtpkg-unit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wgtpkg-unit.c b/src/wgtpkg-unit.c
index 8607eb4..123a950 100644
--- a/src/wgtpkg-unit.c
+++ b/src/wgtpkg-unit.c
@@ -249,7 +249,7 @@ static int process_one_unit(char *spec, struct unitdesc *desc)
* with its given 'closure' and the array descripbing the units.
* Return 0 in case of success or a negative value in case of error.
*/
-static int process_all_units(char *corpus, const struct unitconf *conf, int (*process)(void *closure, const struct generatedesc *desc), void *closure)
+static int process_all_units(char *corpus, const struct unitconf *conf, int (*process)(void *closure, const struct generatedesc *desc), void *closure, struct json_object *jdesc)
{
int rc, rc2;
char *beg, *end, *befbeg, *aftend;
@@ -257,6 +257,7 @@ static int process_all_units(char *corpus, const struct unitconf *conf, int (*pr
struct generatedesc gdesc;
gdesc.conf = conf;
+ gdesc.desc = jdesc;
gdesc.units = NULL;
gdesc.nunits = 0;
rc = rc2 = 0;
@@ -408,7 +409,7 @@ int unit_generator_process(struct json_object *jdesc, const struct unitconf *con
instance = NULL;
rc = apply_mustach(template, jdesc, &instance, &size);
if (!rc)
- rc = process_all_units(instance, conf, process, closure);
+ rc = process_all_units(instance, conf, process, closure, jdesc);
free(instance);
}
}