master - libdm: report: add dm_report_compact_fields
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5edf6a56c4077edd238bf08bf369e7d82bca4ecf Commit: 5edf6a56c4077edd238bf08bf369e7d82bca4ecf Parent: 44394cd246dceec20dd404e3d39ba5867176d54b Author: Peter Rajnoha <[email protected]> AuthorDate: Fri Dec 5 11:42:43 2014 +0100 Committer: Peter Rajnoha <[email protected]> CommitterDate: Fri Dec 5 12:00:28 2014 +0100
libdm: report: add dm_report_compact_fields
Add new dm_report_compact_fields function to cause report outout (dm_report_output) to ignore fields which don't have any value set in any of the rows reported. This provides support for compact report output where only fields which have something to report are displayed.
--- WHATS_NEW_DM | 1 + libdm/libdevmapper.h | 7 +++++ libdm/libdm-report.c | 67 +++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 66 insertions(+), 9 deletions(-)
WHATS_NEW_DM +1 -0
@@ -1,5 +1,6 @@ Version 1.02.93 - ==================================== + Add dm_report_compact_fields to remove empty fields from report output. Remove unimplemented dm_report_set_output_selection from libdevmapper.h. Version 1.02.92 - 24th November 2014
libdm/libdevmapper.h +7 -0
@@ -1753,6 +1753,13 @@ struct dm_report *dm_report_init_with_selection(uint32_t *report_types,const struct dm_report_reserved_value reserved_values[], void *private_data);int dm_report_object (struct dm_report *rh,void *object); + +/* +* Compact report output so that if field value is empty for all rows in +* the report, drop the field from output completely (including headers). +*/ +int dm_report_compact_fields (struct dm_report *rh); +int dm_report_output (struct dm_report *rh);void dm_report_free (struct dm_report *rh);
libdm/libdm-report.c +58 -9
86 lines not on this page · raw message