1 /* 2 * B-tree node descriptor functions 3 * 4 * Copyright (C) 2009-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( _LIBFSHFS_BTREE_NODE_DESCRIPTOR_H ) 23 #define _LIBFSHFS_BTREE_NODE_DESCRIPTOR_H 24 25 #include <common.h> 26 #include <types.h> 27 28 #include "libfshfs_libcerror.h" 29 30 #if defined( __cplusplus ) 31 extern "C" { 32 #endif 33 34 typedef struct libfshfs_btree_node_descriptor libfshfs_btree_node_descriptor_t; 35 36 struct libfshfs_btree_node_descriptor 37 { 38 /* The (node) type 39 */ 40 uint8_t type; 41 42 /* The (node) level 43 */ 44 uint8_t level; 45 46 /* The number of records 47 */ 48 uint16_t number_of_records; 49 50 /* The next node number 51 */ 52 uint32_t next_node_number; 53 54 /* The previous node number 55 */ 56 uint32_t previous_node_number; 57 }; 58 59 int libfshfs_btree_node_descriptor_initialize( 60 libfshfs_btree_node_descriptor_t **btree_node_descriptor, 61 libcerror_error_t **error ); 62 63 int libfshfs_btree_node_descriptor_free( 64 libfshfs_btree_node_descriptor_t **btree_node_descriptor, 65 libcerror_error_t **error ); 66 67 int libfshfs_btree_node_descriptor_read_data( 68 libfshfs_btree_node_descriptor_t *btree_node_descriptor, 69 const uint8_t *data, 70 size_t data_size, 71 libcerror_error_t **error ); 72 73 #if defined( __cplusplus ) 74 } 75 #endif 76 77 #endif /* !defined( _LIBFSHFS_BTREE_NODE_DESCRIPTOR_H ) */ 78 79