1 /*
2  * Python object wrapper of libvslvm_physical_volume_t
3  *
4  * Copyright (C) 2014-2021, Joachim Metz <joachim.metz@gmail.com>
5  *
6  * Refer to AUTHORS for acknowledgements.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #if !defined( _PYVSLVM_PHYSICAL_VOLUME_H )
23 #define _PYVSLVM_PHYSICAL_VOLUME_H
24 
25 #include <common.h>
26 #include <types.h>
27 
28 #include "pyvslvm_libvslvm.h"
29 #include "pyvslvm_python.h"
30 #include "pyvslvm_volume_group.h"
31 
32 #if defined( __cplusplus )
33 extern "C" {
34 #endif
35 
36 typedef struct pyvslvm_physical_volume pyvslvm_physical_volume_t;
37 
38 struct pyvslvm_physical_volume
39 {
40 	/* Python object initialization
41 	 */
42 	PyObject_HEAD
43 
44 	/* The libvslvm physical volume
45 	 */
46 	libvslvm_physical_volume_t *physical_volume;
47 
48 	/* The pyvslvm volume group object
49 	 */
50 	pyvslvm_volume_group_t *volume_group_object;
51 };
52 
53 extern PyMethodDef pyvslvm_physical_volume_object_methods[];
54 extern PyTypeObject pyvslvm_physical_volume_type_object;
55 
56 PyObject *pyvslvm_physical_volume_new(
57            libvslvm_physical_volume_t *physical_volume,
58            pyvslvm_volume_group_t *volume_group_object );
59 
60 int pyvslvm_physical_volume_init(
61      pyvslvm_physical_volume_t *pyvslvm_physical_volume );
62 
63 void pyvslvm_physical_volume_free(
64       pyvslvm_physical_volume_t *pyvslvm_physical_volume );
65 
66 PyObject *pyvslvm_physical_volume_get_name(
67            pyvslvm_physical_volume_t *pyvslvm_physical_volume,
68            PyObject *arguments );
69 
70 PyObject *pyvslvm_physical_volume_get_identifier(
71            pyvslvm_physical_volume_t *pyvslvm_physical_volume,
72            PyObject *arguments );
73 
74 PyObject *pyvslvm_physical_volume_get_device_path(
75            pyvslvm_physical_volume_t *pyvslvm_physical_volume,
76            PyObject *arguments );
77 
78 PyObject *pyvslvm_physical_volume_get_size(
79            pyvslvm_physical_volume_t *pyvslvm_physical_volume,
80            PyObject *arguments );
81 
82 #if defined( __cplusplus )
83 }
84 #endif
85 
86 #endif
87 
88