1 /*
2  * Python object wrapper of libfsxfs_volume_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_VOLUME_H )
23 #define _PYFSXFS_VOLUME_H
24 
25 #include <common.h>
26 #include <types.h>
27 
28 #include "pyfsxfs_libbfio.h"
29 #include "pyfsxfs_libfsxfs.h"
30 #include "pyfsxfs_python.h"
31 
32 #if defined( __cplusplus )
33 extern "C" {
34 #endif
35 
36 typedef struct pyfsxfs_volume pyfsxfs_volume_t;
37 
38 struct pyfsxfs_volume
39 {
40 	/* Python object initialization
41 	 */
42 	PyObject_HEAD
43 
44 	/* The libfsxfs volume
45 	 */
46 	libfsxfs_volume_t *volume;
47 
48 	/* The libbfio file IO handle
49 	 */
50 	libbfio_handle_t *file_io_handle;
51 };
52 
53 extern PyMethodDef pyfsxfs_volume_object_methods[];
54 extern PyTypeObject pyfsxfs_volume_type_object;
55 
56 int pyfsxfs_volume_init(
57      pyfsxfs_volume_t *pyfsxfs_volume );
58 
59 void pyfsxfs_volume_free(
60       pyfsxfs_volume_t *pyfsxfs_volume );
61 
62 PyObject *pyfsxfs_volume_signal_abort(
63            pyfsxfs_volume_t *pyfsxfs_volume,
64            PyObject *arguments );
65 
66 PyObject *pyfsxfs_volume_open(
67            pyfsxfs_volume_t *pyfsxfs_volume,
68            PyObject *arguments,
69            PyObject *keywords );
70 
71 PyObject *pyfsxfs_volume_open_file_object(
72            pyfsxfs_volume_t *pyfsxfs_volume,
73            PyObject *arguments,
74            PyObject *keywords );
75 
76 PyObject *pyfsxfs_volume_close(
77            pyfsxfs_volume_t *pyfsxfs_volume,
78            PyObject *arguments );
79 
80 PyObject *pyfsxfs_volume_get_label(
81            pyfsxfs_volume_t *pyfsxfs_volume,
82            PyObject *arguments );
83 
84 PyObject *pyfsxfs_volume_get_file_entry_by_inode(
85            pyfsxfs_volume_t *pyfsxfs_volume,
86            PyObject *arguments,
87            PyObject *keywords );
88 
89 PyObject *pyfsxfs_volume_get_root_directory(
90            pyfsxfs_volume_t *pyfsxfs_volume,
91            PyObject *arguments );
92 
93 PyObject *pyfsxfs_volume_get_file_entry_by_path(
94            pyfsxfs_volume_t *pyfsxfs_volume,
95            PyObject *arguments,
96            PyObject *keywords );
97 
98 #if defined( __cplusplus )
99 }
100 #endif
101 
102 #endif /* !defined( _PYFSXFS_VOLUME_H ) */
103 
104