1 /* 2 * Python object wrapper of libfsxfs_extended_attribute_t 3 * 4 * Copyright (C) 2020-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( _PYFSXFS_EXTENDED_ATTRIBUTE_H ) 23 #define _PYFSXFS_EXTENDED_ATTRIBUTE_H 24 25 #include <common.h> 26 #include <types.h> 27 28 #include "pyfsxfs_libfsxfs.h" 29 #include "pyfsxfs_python.h" 30 31 #if defined( __cplusplus ) 32 extern "C" { 33 #endif 34 35 typedef struct pyfsxfs_extended_attribute pyfsxfs_extended_attribute_t; 36 37 struct pyfsxfs_extended_attribute 38 { 39 /* Python object initialization 40 */ 41 PyObject_HEAD 42 43 /* The libfsxfs extended attribute 44 */ 45 libfsxfs_extended_attribute_t *extended_attribute; 46 47 /* The parent object 48 */ 49 PyObject *parent_object; 50 }; 51 52 extern PyMethodDef pyfsxfs_extended_attribute_object_methods[]; 53 extern PyTypeObject pyfsxfs_extended_attribute_type_object; 54 55 PyObject *pyfsxfs_extended_attribute_new( 56 libfsxfs_extended_attribute_t *extended_attribute, 57 PyObject *parent_object ); 58 59 int pyfsxfs_extended_attribute_init( 60 pyfsxfs_extended_attribute_t *pyfsxfs_extended_attribute ); 61 62 void pyfsxfs_extended_attribute_free( 63 pyfsxfs_extended_attribute_t *pyfsxfs_extended_attribute ); 64 65 PyObject *pyfsxfs_extended_attribute_get_name( 66 pyfsxfs_extended_attribute_t *pyfsxfs_extended_attribute, 67 PyObject *arguments ); 68 69 PyObject *pyfsxfs_extended_attribute_read_buffer( 70 pyfsxfs_extended_attribute_t *pyfsxfs_extended_attribute, 71 PyObject *arguments, 72 PyObject *keywords ); 73 74 PyObject *pyfsxfs_extended_attribute_read_buffer_at_offset( 75 pyfsxfs_extended_attribute_t *pyfsxfs_extended_attribute, 76 PyObject *arguments, 77 PyObject *keywords ); 78 79 PyObject *pyfsxfs_extended_attribute_seek_offset( 80 pyfsxfs_extended_attribute_t *pyfsxfs_extended_attribute, 81 PyObject *arguments, 82 PyObject *keywords ); 83 84 PyObject *pyfsxfs_extended_attribute_get_offset( 85 pyfsxfs_extended_attribute_t *pyfsxfs_extended_attribute, 86 PyObject *arguments ); 87 88 PyObject *pyfsxfs_extended_attribute_get_size( 89 pyfsxfs_extended_attribute_t *pyfsxfs_extended_attribute, 90 PyObject *arguments ); 91 92 #if defined( __cplusplus ) 93 } 94 #endif 95 96 #endif /* !defined( _PYFSXFS_EXTENDED_ATTRIBUTE_H ) */ 97 98