From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24837 invoked by alias); 20 Aug 2010 13:02:40 -0000 Received: (qmail 24773 invoked by uid 9657); 20 Aug 2010 13:02:40 -0000 Date: Fri, 20 Aug 2010 13:02:00 -0000 Message-ID: <20100820130240.24771.qmail@sourceware.org> From: wysochanski@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/lib/report properties.c Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00073.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-08-20 13:02:39 Modified files: lib/report : properties.c Log message: Define GET_NUM_PROPERTY_FN macro to simplify numeric property 'get' functions. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/properties.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3 --- LVM2/lib/report/properties.c 2010/08/20 12:45:09 1.2 +++ LVM2/lib/report/properties.c 2010/08/20 13:02:39 1.3 @@ -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");