master - report: add report_get_field_prefix function
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bb4d3fa7a70881b72ddf61cba02760b89cf07b53 Commit: bb4d3fa7a70881b72ddf61cba02760b89cf07b53 Parent: 3e18b101a0845f826de29cfd0c554c5e2be2baa5 Author: Peter Rajnoha <[email protected]> AuthorDate: Thu Oct 22 13:27:59 2015 +0200 Committer: Peter Rajnoha <[email protected]> CommitterDate: Fri Oct 30 15:47:56 2015 +0100
report: add report_get_field_prefix function
--- lib/report/report.c | 15 +++++++++++++++ lib/report/report.h | 1 + 2 files changed, 16 insertions(+), 0 deletions(-)
lib/report/report.c +15 -0
@@ -3396,6 +3396,21 @@ void *report_init_for_selection(struct cmd_context *cmd, cmd); } +const char *report_get_field_prefix (report_type_t report_type_id) +{ +const struct dm_report_object_type *report_types, *report_type; + + report_types = report_type_id &DEVTYPES ? _devtypes_report_types + : _report_types; + +for (report_type = report_types; report_type->id; report_type++) { +if (report_type_id & report_type->id) +return report_type->prefix; + } + +return "" ; +} +/* * Create a row of data for an object */
lib/report/report.h +1 -0
@@ -71,6 +71,7 @@ void *report_init(struct cmd_context *cmd, const char *format, const char *keys, int quoted, int columns_as_rows, const char *selection);void *report_init_for_selection (struct cmd_context *cmd,report_type_t *report_type,const char *selection); +const char *report_get_field_prefix (report_type_t report_type); int report_for_selection(struct cmd_context *cmd, struct selection_handle *sh, struct physical_volume *pv,