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