Imported Upstream version 2.5.1
[ossec-hids.git] / src / headers / dirtree_op.h
1 /* @(#) $Id$ */
2
3 /* Copyright (C) 2009 Trend Micro Inc.
4  * All rights reserved.
5  *
6  * This program is a free software; you can redistribute it
7  * and/or modify it under the terms of the GNU General Public
8  * License (version 2) as published by the FSF - Free Software
9  * Foundation.
10  *
11  * License details at the LICENSE file included with OSSEC or
12  * online at: http://www.ossec.net/en/licensing.html
13  */
14  
15 /* Common API for dealing with directory trees */
16           
17
18 #ifndef _OS_DIRTREE
19 #define _OS_DIRTREE
20
21 typedef struct _OSTreeNode
22 {
23     struct _OSTreeNode *next;
24     void *child;
25     
26     char *value;
27     void *data;
28 }OSTreeNode;
29
30
31 typedef struct _OSDirTree
32 {
33     OSTreeNode *first_node;
34     OSTreeNode *last_node;
35 }OSDirTree;
36
37
38 OSDirTree *OSDirTree_Create();
39 void OSDirTree_AddToTree(OSDirTree *tree, char *str, void *data, char sep);
40 void *OSDirTree_SearchTree(OSDirTree *tree, char *str, char sep);
41          
42
43
44 #endif
45
46 /* EOF */