1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00

report: add report_get_field_prefix function

This commit is contained in:
Peter Rajnoha 2015-10-22 13:27:59 +02:00
parent 3e18b101a0
commit bb4d3fa7a7
2 changed files with 16 additions and 0 deletions

View File

@ -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
*/

View File

@ -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,