printer CHANGE allow passing argument to the caller's provided printer callback
diff --git a/src/xml.c b/src/xml.c
index 83c6a74..a3c2354 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -1363,7 +1363,7 @@
}
API int
-lyxml_dump_clb(ssize_t (*writeclb)(const void *buf, size_t count), struct lyxml_elem *elem, int options)
+lyxml_dump_clb(ssize_t (*writeclb)(void *arg, const void *buf, size_t count), void *arg, struct lyxml_elem *elem, int options)
{
struct lyout out;
@@ -1372,7 +1372,8 @@
}
out.type = LYOUT_CALLBACK;
- out.method.writeclb = writeclb;
+ out.method.clb.f = writeclb;
+ out.method.clb.arg = arg;
return dump_elem(&out, elem, 0, options);
}