Tizen 2.1 base
[external/device-mapper.git] / lib / report / properties.h
1 /*
2  * Copyright (C) 2010 Red Hat, Inc. All rights reserved.
3  *
4  * This file is part of LVM2.
5  *
6  * This copyrighted material is made available to anyone wishing to use,
7  * modify, copy, or redistribute it subject to the terms and conditions
8  * of the GNU Lesser General Public License v.2.1.
9  *
10  * You should have received a copy of the GNU Lesser General Public License
11  * along with this program; if not, write to the Free Software Foundation,
12  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
13  */
14 #ifndef _LVM_PROPERTIES_H
15 #define _LVM_PROPERTIES_H
16
17 #include "libdevmapper.h"
18 #include "lvm-types.h"
19 #include "metadata.h"
20 #include "report.h"
21
22 struct lvm_property_type {
23         report_type_t type;
24         const char *id;
25         unsigned is_settable:1;
26         unsigned is_string:1;
27         unsigned is_integer:1;
28         union {
29                 const char *string;
30                 uint64_t integer;
31         } value;
32         int (*get) (const void *obj, struct lvm_property_type *prop);
33         int (*set) (void *obj, struct lvm_property_type *prop);
34 };
35
36 int lvseg_get_property(const struct lv_segment *lvseg,
37                        struct lvm_property_type *prop);
38 int lv_get_property(const struct logical_volume *lv,
39                     struct lvm_property_type *prop);
40 int vg_get_property(const struct volume_group *vg,
41                     struct lvm_property_type *prop);
42 int pvseg_get_property(const struct pv_segment *pvseg,
43                        struct lvm_property_type *prop);
44 int pv_get_property(const struct physical_volume *pv,
45                     struct lvm_property_type *prop);
46 int lv_set_property(struct logical_volume *lv,
47                     struct lvm_property_type *prop);
48 int vg_set_property(struct volume_group *vg,
49                     struct lvm_property_type *prop);
50 int pv_set_property(struct physical_volume *pv,
51                     struct lvm_property_type *prop);
52
53 #endif