+static void print_json(FILE *of, const struct lnstat_file *lnstat_files,
+ const struct field_params *fp)
+{
+ json_writer_t *jw = jsonw_new(of);
+ int i;
+
+ jsonw_start_object(jw);
+ for (i = 0; i < fp->num; i++) {
+ const struct lnstat_field *lf = fp->params[i].lf;
+
+ jsonw_uint_field(jw, lf->name, lf->result);
+ }
+ jsonw_end_object(jw);
+ jsonw_destroy(&jw);
+}
+