1 /* 2 * Python object wrapper of libvslvm_segment_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_SEGMENT_H ) 23 #define _PYVSLVM_SEGMENT_H 24 25 #include <common.h> 26 #include <types.h> 27 28 #include "pyvslvm_libvslvm.h" 29 #include "pyvslvm_logical_volume.h" 30 #include "pyvslvm_python.h" 31 32 #if defined( __cplusplus ) 33 extern "C" { 34 #endif 35 36 typedef struct pyvslvm_segment pyvslvm_segment_t; 37 38 struct pyvslvm_segment 39 { 40 /* Python object initialization 41 */ 42 PyObject_HEAD 43 44 /* The libvslvm segment 45 */ 46 libvslvm_segment_t *segment; 47 48 /* The pyvslvm logical volume object 49 */ 50 pyvslvm_logical_volume_t *logical_volume_object; 51 }; 52 53 extern PyMethodDef pyvslvm_segment_object_methods[]; 54 extern PyTypeObject pyvslvm_segment_type_object; 55 56 PyObject *pyvslvm_segment_new( 57 libvslvm_segment_t *segment, 58 pyvslvm_logical_volume_t *logical_volume_object ); 59 60 int pyvslvm_segment_init( 61 pyvslvm_segment_t *pyvslvm_segment ); 62 63 void pyvslvm_segment_free( 64 pyvslvm_segment_t *pyvslvm_segment ); 65 66 #if defined( __cplusplus ) 67 } 68 #endif 69 70 #endif 71 72