mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
report: add report_get_field_prefix function
This commit is contained in:
parent
3e18b101a0
commit
bb4d3fa7a7
@ -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
|
||||
*/
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user