]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - repair/btree.h
xfs_repair: don't leak buffer on xattr remote buf verifier error
[thirdparty/xfsprogs-dev.git] / repair / btree.h
CommitLineData
379397bf
BN
1/*
2 * Copyright (c) 2007 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#ifndef _BTREE_H
20#define _BTREE_H
21
22
23struct btree_root;
24
25void
26btree_init(
27 struct btree_root **root);
28
29void
30btree_destroy(
31 struct btree_root *root);
32
33int
34btree_is_empty(
35 struct btree_root *root);
36
37void *
38btree_lookup(
39 struct btree_root *root,
40 unsigned long key);
41
42void *
43btree_find(
44 struct btree_root *root,
45 unsigned long key,
46 unsigned long *actual_key);
47
48void *
49btree_peek_prev(
50 struct btree_root *root,
51 unsigned long *key);
52
53void *
54btree_peek_next(
55 struct btree_root *root,
56 unsigned long *key);
57
58void *
59btree_lookup_next(
60 struct btree_root *root,
61 unsigned long *key);
62
63void *
64btree_lookup_prev(
65 struct btree_root *root,
66 unsigned long *key);
67
68int
69btree_insert(
70 struct btree_root *root,
71 unsigned long key,
72 void *value);
73
74void *
75btree_delete(
76 struct btree_root *root,
77 unsigned long key);
78
79int
80btree_update_key(
81 struct btree_root *root,
82 unsigned long old_key,
83 unsigned long new_key);
84
85int
86btree_update_value(
87 struct btree_root *root,
88 unsigned long key,
89 void *new_value);
90
91void
92btree_clear(
93 struct btree_root *root);
94
95#ifdef BTREE_STATS
96void
97btree_print_stats(
98 struct btree_root *root,
99 FILE *f);
100#endif
101
102#endif /* _BTREE_H */