Debian Codegraph @

libfdata/libfdata_segments_array.h

raw symbols SCIP
1 /*
2 * The segments array functions
3 *
4 * Copyright (C) 2010-2024, Joachim Metz <[email protected]>
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( _LIBFDATA_SEGMENTS_ARRAY_H )
23 #define _LIBFDATA_SEGMENTS_ARRAY_H
24
25 #include <common.h>
26 #include <types.h>
27
28 #include "libfdata_libcdata.h"
29 #include "libfdata_libcerror.h"
30 #include "libfdata_range.h"
31
32 int libfdata_segments_array_get_segment_by_index(
33 libcdata_array_t *segments_array,
34 int segment_index,
35 int *segment_file_index,
36 off64_t *segment_offset,
37 size64_t *segment_size,
38 uint32_t *segment_flags,
39 libcerror_error_t **error );
40
41 int libfdata_segments_array_set_segment_by_index(
42 libcdata_array_t *segments_array,
43 libcdata_array_t *mapped_ranges_array,
44 size64_t *data_size,
45 int segment_index,
46 int segment_file_index,
47 off64_t segment_offset,
48 size64_t segment_size,
49 uint32_t segment_flags,
50 libcerror_error_t **error );
51
52 int libfdata_segments_array_prepend_segment(
53 libcdata_array_t *segments_array,
54 libcdata_array_t *mapped_ranges_array,
55 size64_t *data_size,
56 int segment_file_index,
57 off64_t segment_offset,
58 size64_t segment_size,
59 uint32_t segment_flags,
60 libcerror_error_t **error );
61
62 int libfdata_segments_array_append_segment(
63 libcdata_array_t *segments_array,
64 libcdata_array_t *mapped_ranges_array,
65 size64_t *data_size,
66 int *segment_index,
67 int segment_file_index,
68 off64_t segment_offset,
69 size64_t segment_size,
70 uint32_t segment_flags,
71 libcerror_error_t **error );
72
73 int libfdata_segments_array_calculate_mapped_ranges(
74 libcdata_array_t *segments_array,
75 libcdata_array_t *mapped_ranges_array,
76 libcerror_error_t **error );
77
78 int libfdata_segments_array_get_data_range_at_offset(
79 libcdata_array_t *segments_array,
80 off64_t value_offset,
81 off64_t *segment_data_offset,
82 libfdata_range_t **segment_data_range,
83 libcerror_error_t **error );
84
85 #if defined( __cplusplus )
86 extern "C" {
87 #endif
88
89 #if defined( __cplusplus )
90 }
91 #endif
92
93 #endif /* !defined( _LIBFDATA_SEGMENTS_ARRAY_H ) */
94