From 614469b54430e05540f7e7d8d719dd60ecf4ad64 Mon Sep 17 00:00:00 2001 From: Dave Wysochanski Date: Fri, 20 Aug 2010 13:02:39 +0000 Subject: [PATCH] Define GET_NUM_PROPERTY_FN macro to simplify numeric property 'get' functions. --- lib/report/properties.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/report/properties.c b/lib/report/properties.c index cd6570852..b99f63090 100644 --- a/lib/report/properties.c +++ b/lib/report/properties.c @@ -20,6 +20,15 @@ #include "lvm-types.h" #include "metadata.h" +#define GET_NUM_PROPERTY_FN(NAME, VALUE) \ +static int _ ## NAME ## _get (void *obj, struct lvm_property_type *prop) \ +{ \ + struct volume_group *vg = (struct volume_group *)obj; \ +\ + prop->v.n_val = VALUE; \ + return 1; \ +} + static int _not_implemented(void *obj, struct lvm_property_type *prop) { log_errno(ENOSYS, "Function not implemented"); -- 2.43.5