1 /*
2  * Python object wrapper of libfwsi_item_t
3  *
4  * Copyright (C) 2010-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( _PYFWSI_ITEM_H )
23 #define _PYFWSI_ITEM_H
24 
25 #include <common.h>
26 #include <types.h>
27 
28 #include "pyfwsi_item_list.h"
29 #include "pyfwsi_libcerror.h"
30 #include "pyfwsi_libfwsi.h"
31 #include "pyfwsi_python.h"
32 
33 #if defined( __cplusplus )
34 extern "C" {
35 #endif
36 
37 typedef struct pyfwsi_item pyfwsi_item_t;
38 
39 struct pyfwsi_item
40 {
41 	/* Python object initialization
42 	 */
43 	PyObject_HEAD
44 
45 	/* The libfwsi item
46 	 */
47 	libfwsi_item_t *item;
48 
49 	/* The parent object
50 	 */
51 	PyObject *parent_object;
52 };
53 
54 extern PyMethodDef pyfwsi_item_object_methods[];
55 extern PyTypeObject pyfwsi_item_type_object;
56 
57 PyObject *pyfwsi_item_new(
58            PyTypeObject *type_object,
59            libfwsi_item_t *item,
60            PyObject *parent_object );
61 
62 int pyfwsi_item_init(
63      pyfwsi_item_t *pyfwsi_item );
64 
65 void pyfwsi_item_free(
66       pyfwsi_item_t *pyfwsi_item );
67 
68 PyObject *pyfwsi_item_copy_from_byte_stream(
69            pyfwsi_item_t *pyfwsi_item,
70            PyObject *arguments,
71            PyObject *keywords );
72 
73 PyObject *pyfwsi_item_get_class_type(
74            pyfwsi_item_t *pyfwsi_item,
75            PyObject *arguments );
76 
77 PyObject *pyfwsi_item_get_data_size(
78            pyfwsi_item_t *pyfwsi_item,
79            PyObject *arguments );
80 
81 #ifdef TODO
82 PyObject *pyfwsi_item_get_data(
83            pyfwsi_item_t *pyfwsi_item,
84            PyObject *arguments );
85 #endif
86 
87 PyObject *pyfwsi_item_get_number_of_extension_blocks(
88            pyfwsi_item_t *pyfwsi_item,
89            PyObject *arguments );
90 
91 PyObject *pyfwsi_item_get_extension_block_by_index(
92            PyObject *pyfwsi_item,
93            int extension_block_index );
94 
95 PyObject *pyfwsi_item_get_extension_block(
96            pyfwsi_item_t *pyfwsi_item,
97            PyObject *arguments,
98            PyObject *keywords );
99 
100 PyObject *pyfwsi_item_get_extension_blocks(
101            pyfwsi_item_t *pyfwsi_item,
102            PyObject *arguments );
103 
104 #if defined( __cplusplus )
105 }
106 #endif
107 
108 #endif /* !defined( _PYFWSI_ITEM_H ) */
109 
110