1 /* 2 * Python object wrapper of libolecf_file_t 3 * 4 * Copyright (C) 2008-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( _PYOLECF_FILE_H ) 23 #define _PYOLECF_FILE_H 24 25 #include <common.h> 26 #include <types.h> 27 28 #include "pyolecf_libbfio.h" 29 #include "pyolecf_libolecf.h" 30 #include "pyolecf_python.h" 31 32 #if defined( __cplusplus ) 33 extern "C" { 34 #endif 35 36 typedef struct pyolecf_file pyolecf_file_t; 37 38 struct pyolecf_file 39 { 40 /* Python object initialization 41 */ 42 PyObject_HEAD 43 44 /* The libolecf file 45 */ 46 libolecf_file_t *file; 47 48 /* The libbfio file IO handle 49 */ 50 libbfio_handle_t *file_io_handle; 51 }; 52 53 extern PyMethodDef pyolecf_file_object_methods[]; 54 extern PyTypeObject pyolecf_file_type_object; 55 56 int pyolecf_file_init( 57 pyolecf_file_t *pyolecf_file ); 58 59 void pyolecf_file_free( 60 pyolecf_file_t *pyolecf_file ); 61 62 PyObject *pyolecf_file_signal_abort( 63 pyolecf_file_t *pyolecf_file, 64 PyObject *arguments ); 65 66 PyObject *pyolecf_file_open( 67 pyolecf_file_t *pyolecf_file, 68 PyObject *arguments, 69 PyObject *keywords ); 70 71 PyObject *pyolecf_file_open_file_object( 72 pyolecf_file_t *pyolecf_file, 73 PyObject *arguments, 74 PyObject *keywords ); 75 76 PyObject *pyolecf_file_close( 77 pyolecf_file_t *pyolecf_file, 78 PyObject *arguments ); 79 80 PyObject *pyolecf_file_get_sector_size( 81 pyolecf_file_t *pyolecf_file, 82 PyObject *arguments ); 83 84 PyObject *pyolecf_file_get_short_sector_size( 85 pyolecf_file_t *pyolecf_file, 86 PyObject *arguments ); 87 88 PyObject *pyolecf_file_get_ascii_codepage( 89 pyolecf_file_t *pyolecf_file, 90 PyObject *arguments ); 91 92 int pyolecf_file_set_ascii_codepage_from_string( 93 pyolecf_file_t *pyolecf_file, 94 const char *codepage_string ); 95 96 PyObject *pyolecf_file_set_ascii_codepage( 97 pyolecf_file_t *pyolecf_file, 98 PyObject *arguments, 99 PyObject *keywords ); 100 101 int pyolecf_file_set_ascii_codepage_setter( 102 pyolecf_file_t *pyolecf_file, 103 PyObject *string_object, 104 void *closure ); 105 106 PyObject *pyolecf_file_get_format_version( 107 pyolecf_file_t *pyolecf_file, 108 PyObject *arguments ); 109 110 PyObject *pyolecf_file_get_root_item( 111 pyolecf_file_t *pyolecf_file, 112 PyObject *arguments ); 113 114 PyObject *pyolecf_file_get_item_by_path( 115 pyolecf_file_t *pyolecf_file, 116 PyObject *arguments, 117 PyObject *keywords ); 118 119 #if defined( __cplusplus ) 120 } 121 #endif 122 123 #endif /* !defined( _PYOLECF_FILE_H ) */ 124 125