Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / openbios / fs / hfsplus / include / btree.h
1 /*
2  * libhfs - library for reading and writing Macintosh HFS volumes.
3  *
4  * The fucntions are used to handle the various forms of btrees
5  * found on HFS+ volumes.
6  *
7  * Copyright (C) 2000 Klaus Halfmann <khalfmann@libra.de>
8  * Original 1996-1998 Robert Leslie <rob@mars.org>
9  * Additional work by  Brad Boyer (flar@pants.nu)
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
24  * MA 02110-1301, USA.
25  *
26  * $Id: btree.h,v 1.10 2000/10/25 05:43:04 hasi Exp $
27  */
28
29 /** Intialize catalog btree, so that btree_close can safely be called. */
30 extern void btree_reset(btree* bt);
31
32 /** Intialize catalog btree */
33 extern int btree_init_cat(btree* bt, volume* vol, hfsp_fork_raw* fork);
34
35 /** Intialize extents btree */
36 extern int btree_init_extent(btree* bt, volume* vol, hfsp_fork_raw* fork);
37
38 /** close the btree and free any resources */
39 extern void btree_close(btree* bt);
40
41 /* Read node at given index */
42 extern node_buf* btree_node_by_index(btree* bt, UInt16 index);
43
44 /* returns pointer to key given by index in current node */
45 extern void* btree_key_by_index(btree* bt, node_buf* buf, UInt16 index);
46
47 #ifdef DEBUG
48     /* Dump all the btree information to stdout */
49   extern void btree_print(btree* bt);
50 #endif