1 /* 2 * The object map functions 3 * 4 * Copyright (C) 2018-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( _LIBFSAPFS_OBJECT_MAP_H ) 23 #define _LIBFSAPFS_OBJECT_MAP_H 24 25 #include <common.h> 26 #include <types.h> 27 28 #include "libfsapfs_libbfio.h" 29 #include "libfsapfs_libcerror.h" 30 31 #if defined( __cplusplus ) 32 extern "C" { 33 #endif 34 35 typedef struct libfsapfs_object_map libfsapfs_object_map_t; 36 37 struct libfsapfs_object_map 38 { 39 /* The number of snapshots 40 */ 41 uint32_t number_of_snapshots; 42 43 /* The B-tree block number 44 */ 45 uint64_t btree_block_number; 46 47 /* The snapshots B-tree block number 48 */ 49 uint64_t snapshots_btree_block_number; 50 51 /* The most recent snapshot object identifier 52 */ 53 uint64_t most_recent_snapshot_identifier; 54 }; 55 56 int libfsapfs_object_map_initialize( 57 libfsapfs_object_map_t **object_map, 58 libcerror_error_t **error ); 59 60 int libfsapfs_object_map_free( 61 libfsapfs_object_map_t **object_map, 62 libcerror_error_t **error ); 63 64 int libfsapfs_object_map_read_file_io_handle( 65 libfsapfs_object_map_t *object_map, 66 libbfio_handle_t *file_io_handle, 67 off64_t file_offset, 68 libcerror_error_t **error ); 69 70 int libfsapfs_object_map_read_data( 71 libfsapfs_object_map_t *object_map, 72 const uint8_t *data, 73 size_t data_size, 74 libcerror_error_t **error ); 75 76 #if defined( __cplusplus ) 77 } 78 #endif 79 80 #endif /* !defined( _LIBFSAPFS_OBJECT_MAP_H ) */ 81 82