{ \
const struct TYPE *VAR = (const struct TYPE *)obj; \
\
- prop->v.n_val = VALUE; \
+ prop->value.integer = VALUE; \
return 1; \
}
#define GET_VG_NUM_PROPERTY_FN(NAME, VALUE) \
{ \
const struct TYPE *VAR = (const struct TYPE *)obj; \
\
- prop->v.s_val = (char *)VALUE; \
+ prop->value.string = (char *)VALUE; \
return 1; \
}
#define GET_VG_STR_PROPERTY_FN(NAME, VALUE) \
#define STR DM_REPORT_FIELD_TYPE_STRING
#define NUM DM_REPORT_FIELD_TYPE_NUMBER
-#define FIELD(type, strct, sorttype, head, field, width, fn, id, desc, writeable) \
- { type, #id, writeable, sorttype == STR, { .n_val = 0 }, _ ## id ## _get, _ ## id ## _set },
+#define FIELD(type, strct, sorttype, head, field, width, fn, id, desc, settable) \
+ { type, #id, settable, sorttype == STR, { .integer = 0 }, _ ## id ## _get, _ ## id ## _set },
struct lvm_property_type _properties[] = {
#include "columns.h"
- { 0, "", 0, 0, { .n_val = 0 }, _not_implemented_get, _not_implemented_set },
+ { 0, "", 0, 0, { .integer = 0 }, _not_implemented_get, _not_implemented_set },
};
#undef STR
#include "metadata.h"
#include "report.h"
-#define LVM_PROPERTY_NAME_LEN DM_REPORT_FIELD_TYPE_ID_LEN
-
struct lvm_property_type {
report_type_t type;
- char id[LVM_PROPERTY_NAME_LEN];
- unsigned is_writeable;
- unsigned is_string;
+ const char *id;
+ unsigned is_settable:1;
+ unsigned is_string:1;
union {
- char *s_val;
- uint64_t n_val;
- } v;
+ char *string;
+ uint64_t integer;
+ } value;
int (*get) (const void *obj, struct lvm_property_type *prop);
int (*set) (void *obj, struct lvm_property_type *prop);
};