| 1 | /* |
| 2 | * AIDE (Advanced Intrusion Detection Environment) |
| 3 | * |
| 4 | * Copyright (C) 2023 Hannes von Haugwitz |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation; either version 2 of the |
| 9 | * License, or (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License along |
| 17 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 19 | */ |
| 20 | |
| 21 | #ifndef TREE_H_INCLUDED |
| 22 | #define TREE_H_INCLUDED |
| 23 | |
| 24 | typedef struct tree_node tree_node; |
| 25 | |
| 26 | typedef int (*tree_cmp_f)(const void*, const void*); |
| 27 | |
| 28 | tree_node *tree_insert(tree_node *, void *, void *, tree_cmp_f); |
| 29 | void *tree_search(tree_node *, void *, tree_cmp_f); |
| 30 | |
| 31 | tree_node *tree_walk_first(tree_node *); |
| 32 | tree_node *tree_walk_next(tree_node *); |
| 33 | |
| 34 | void *tree_get_data(tree_node *n); |
| 35 | |
| 36 | #endif |