new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / headers / dirtree_op.h
1 /* Copyright (C) 2009 Trend Micro Inc.
2  * All rights reserved.
3  *
4  * This program is a free software; you can redistribute it
5  * and/or modify it under the terms of the GNU General Public
6  * License (version 2) as published by the FSF - Free Software
7  * Foundation.
8  */
9
10 /* Common API for dealing with directory trees */
11
12 #ifndef _OS_DIRTREE
13 #define _OS_DIRTREE
14
15 typedef struct _OSDirTree OSDirTree;
16
17 typedef struct _OSTreeNode {
18     struct _OSTreeNode *next;
19     OSDirTree *child;
20
21     char *value;
22     void *data;
23 } OSTreeNode;
24
25 struct _OSDirTree {
26     OSTreeNode *first_node;
27     OSTreeNode *last_node;
28 };
29
30 OSDirTree *OSDirTree_Create(void);
31 void OSDirTree_AddToTree(OSDirTree *tree, const char *str, void *data, char sep) __attribute__((nonnull(1, 2)));
32 void *OSDirTree_SearchTree(const OSDirTree *tree, const char *str, char sep) __attribute__((nonnull));
33
34 OSTreeNode *OSDirTree_GetFirstNode(OSDirTree *tree) __attribute__((nonnull));
35
36 #endif /* _OS_DIRTREE */
37