dev-prajnoha-report-select - report: select: add dm_report_init_with_selection to libdm
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=710d2c246255c7e2d292f952d20d1bbaf5cc63b9 Commit: 710d2c246255c7e2d292f952d20d1bbaf5cc63b9 Parent: d99e8214a2f0a1d2756bb72a18502d093633a512 Author: Peter Rajnoha <[email protected]> AuthorDate: Thu May 29 09:38:08 2014 +0200 Committer: Peter Rajnoha <[email protected]> CommitterDate: Fri Jun 6 11:11:20 2014 +0200
report: select: add dm_report_init_with_selection to libdm
This is rebased and edited version of the original design and patch proposed by Jun'ichi Nomura:
http://www.redhat.com/archives/dm-devel/2007-April/msg00025.html
The dm_report_init_with_selection is the same as dm_report_init but it contains an additional argument to set the selection in the form of a string that contains field names to check against and selection operators. The selection string is parsend and a selection tree is composed for use in the checks against individual fields when the report is processed. The parsed selection tree is stored in dm_report structure as "selection_root".
--- libdm/libdevmapper.h | 11 ++ libdm/libdm-report.c | 427 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 429 insertions(+), 9 deletions(-)
libdm/libdevmapper.h +11 -0
@@ -1641,7 +1641,18 @@ struct dm_report *dm_report_init(uint32_t *report_types,uint32_t output_flags, const char *sort_keys, void *private_data); +struct dm_report *dm_report_init_with_selection (uint32_t *report_types, +const struct dm_report_object_type *types, +const struct dm_report_field_type *fields, +const char *output_fields, +const char *output_separator, +uint32_t output_flags, +const char *sort_keys, +const char *selection, +void *private_data);int dm_report_object (struct dm_report *rh,void *object); +int dm_report_set_output_selection (struct dm_report *rh,uint32_t *report_types, +const char *selection);int dm_report_output (struct dm_report *rh);void dm_report_free (struct dm_report *rh);
libdm/libdm-report.c +418 -9
452 lines not on this page · raw message