1 /*
2  * Python object definition of the libvshadow store
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( _PYVSHADOW_STORE_H )
23 #define _PYVSHADOW_STORE_H
24 
25 #include <common.h>
26 #include <types.h>
27 
28 #include "pyvshadow_libvshadow.h"
29 #include "pyvshadow_python.h"
30 
31 #if defined( __cplusplus )
32 extern "C" {
33 #endif
34 
35 typedef struct pyvshadow_store pyvshadow_store_t;
36 
37 struct pyvshadow_store
38 {
39 	/* Python object initialization
40 	 */
41 	PyObject_HEAD
42 
43 	/* The libvshadow store
44 	 */
45 	libvshadow_store_t *store;
46 
47 	/* The parent object
48 	 */
49 	PyObject *parent_object;
50 };
51 
52 extern PyMethodDef pyvshadow_store_object_methods[];
53 extern PyTypeObject pyvshadow_store_type_object;
54 
55 PyObject *pyvshadow_store_new(
56            libvshadow_store_t *store,
57            PyObject *parent_object );
58 
59 int pyvshadow_store_init(
60      pyvshadow_store_t *pyvshadow_store );
61 
62 void pyvshadow_store_free(
63       pyvshadow_store_t *pyvshadow_store );
64 
65 PyObject *pyvshadow_store_has_in_volume_data(
66            pyvshadow_store_t *pyvshadow_store,
67            PyObject *arguments );
68 
69 PyObject *pyvshadow_store_read_buffer(
70            pyvshadow_store_t *pyvshadow_store,
71            PyObject *arguments,
72            PyObject *keywords );
73 
74 PyObject *pyvshadow_store_read_buffer_at_offset(
75            pyvshadow_store_t *pyvshadow_store,
76            PyObject *arguments,
77            PyObject *keywords );
78 
79 PyObject *pyvshadow_store_seek_offset(
80            pyvshadow_store_t *pyvshadow_store,
81            PyObject *arguments,
82            PyObject *keywords );
83 
84 PyObject *pyvshadow_store_get_offset(
85            pyvshadow_store_t *pyvshadow_store,
86            PyObject *arguments );
87 
88 PyObject *pyvshadow_store_get_size(
89            pyvshadow_store_t *pyvshadow_store,
90            PyObject *arguments );
91 
92 PyObject *pyvshadow_store_get_volume_size(
93            pyvshadow_store_t *pyvshadow_store,
94            PyObject *arguments );
95 
96 PyObject *pyvshadow_store_get_identifier(
97            pyvshadow_store_t *pyvshadow_store,
98            PyObject *arguments );
99 
100 PyObject *pyvshadow_store_get_creation_time(
101            pyvshadow_store_t *pyvshadow_store,
102            PyObject *arguments );
103 
104 PyObject *pyvshadow_store_get_creation_time_as_integer(
105            pyvshadow_store_t *pyvshadow_store,
106            PyObject *arguments );
107 
108 PyObject *pyvshadow_store_get_copy_identifier(
109            pyvshadow_store_t *pyvshadow_store,
110            PyObject *arguments );
111 
112 PyObject *pyvshadow_store_get_copy_set_identifier(
113            pyvshadow_store_t *pyvshadow_store,
114            PyObject *arguments );
115 
116 PyObject *pyvshadow_store_get_number_of_blocks(
117            pyvshadow_store_t *pyvshadow_store,
118            PyObject *arguments );
119 
120 PyObject *pyvshadow_store_get_block_by_index(
121            PyObject *pyvshadow_store,
122            int block_index );
123 
124 PyObject *pyvshadow_store_get_block(
125            pyvshadow_store_t *pyvshadow_store,
126            PyObject *arguments,
127            PyObject *keywords );
128 
129 PyObject *pyvshadow_store_get_blocks(
130            pyvshadow_store_t *pyvshadow_store,
131            PyObject *arguments );
132 
133 #if defined( __cplusplus )
134 }
135 #endif
136 
137 #endif /* !defined( _PYVSHADOW_STORE_H ) */
138 
139