1 /* 2 * Python object wrapper of libevt_file_t 3 * 4 * Copyright (C) 2011-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( _PYEVT_FILE_H ) 23 #define _PYEVT_FILE_H 24 25 #include <common.h> 26 #include <types.h> 27 28 #include "pyevt_libbfio.h" 29 #include "pyevt_libevt.h" 30 #include "pyevt_python.h" 31 32 #if defined( __cplusplus ) 33 extern "C" { 34 #endif 35 36 typedef struct pyevt_file pyevt_file_t; 37 38 struct pyevt_file 39 { 40 /* Python object initialization 41 */ 42 PyObject_HEAD 43 44 /* The libevt file 45 */ 46 libevt_file_t *file; 47 48 /* The libbfio file IO handle 49 */ 50 libbfio_handle_t *file_io_handle; 51 }; 52 53 extern PyMethodDef pyevt_file_object_methods[]; 54 extern PyTypeObject pyevt_file_type_object; 55 56 int pyevt_file_init( 57 pyevt_file_t *pyevt_file ); 58 59 void pyevt_file_free( 60 pyevt_file_t *pyevt_file ); 61 62 PyObject *pyevt_file_signal_abort( 63 pyevt_file_t *pyevt_file, 64 PyObject *arguments ); 65 66 PyObject *pyevt_file_open( 67 pyevt_file_t *pyevt_file, 68 PyObject *arguments, 69 PyObject *keywords ); 70 71 PyObject *pyevt_file_open_file_object( 72 pyevt_file_t *pyevt_file, 73 PyObject *arguments, 74 PyObject *keywords ); 75 76 PyObject *pyevt_file_close( 77 pyevt_file_t *pyevt_file, 78 PyObject *arguments ); 79 80 PyObject *pyevt_file_is_corrupted( 81 pyevt_file_t *pyevt_file, 82 PyObject *arguments ); 83 84 PyObject *pyevt_file_get_ascii_codepage( 85 pyevt_file_t *pyevt_file, 86 PyObject *arguments ); 87 88 int pyevt_file_set_ascii_codepage_from_string( 89 pyevt_file_t *pyevt_file, 90 const char *codepage_string ); 91 92 PyObject *pyevt_file_set_ascii_codepage( 93 pyevt_file_t *pyevt_file, 94 PyObject *arguments, 95 PyObject *keywords ); 96 97 int pyevt_file_set_ascii_codepage_setter( 98 pyevt_file_t *pyevt_file, 99 PyObject *string_object, 100 void *closure ); 101 102 PyObject *pyevt_file_get_format_version( 103 pyevt_file_t *pyevt_file, 104 PyObject *arguments ); 105 106 PyObject *pyevt_file_get_number_of_records( 107 pyevt_file_t *pyevt_file, 108 PyObject *arguments ); 109 110 PyObject *pyevt_file_get_record_by_index( 111 PyObject *pyevt_file, 112 int record_index ); 113 114 PyObject *pyevt_file_get_record( 115 pyevt_file_t *pyevt_file, 116 PyObject *arguments, 117 PyObject *keywords ); 118 119 PyObject *pyevt_file_get_records( 120 pyevt_file_t *pyevt_file, 121 PyObject *arguments ); 122 123 PyObject *pyevt_file_get_number_of_recovered_records( 124 pyevt_file_t *pyevt_file, 125 PyObject *arguments ); 126 127 PyObject *pyevt_file_get_recovered_record_by_index( 128 PyObject *pyevt_file, 129 int record_index ); 130 131 PyObject *pyevt_file_get_recovered_record( 132 pyevt_file_t *pyevt_file, 133 PyObject *arguments, 134 PyObject *keywords ); 135 136 PyObject *pyevt_file_get_recovered_records( 137 pyevt_file_t *pyevt_file, 138 PyObject *arguments ); 139 140 #if defined( __cplusplus ) 141 } 142 #endif 143 144 #endif /* !defined( _PYEVT_FILE_H ) */ 145 146