-/* @(#) $Id$ */
-
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
*
* and/or modify it under the terms of the GNU General Public
* License (version 2) as published by the FSF - Free Software
* Foundation.
- *
- * License details at the LICENSE file included with OSSEC or
- * online at: http://www.ossec.net/en/licensing.html
*/
-
+
/* Common API for dealing with directory trees */
-
#ifndef _OS_DIRTREE
#define _OS_DIRTREE
-typedef struct _OSTreeNode
-{
+typedef struct _OSDirTree OSDirTree;
+
+typedef struct _OSTreeNode {
struct _OSTreeNode *next;
- void *child;
-
+ OSDirTree *child;
+
char *value;
void *data;
-}OSTreeNode;
-
+} OSTreeNode;
-typedef struct _OSDirTree
-{
+struct _OSDirTree {
OSTreeNode *first_node;
OSTreeNode *last_node;
-}OSDirTree;
-
+};
-OSDirTree *OSDirTree_Create();
-void OSDirTree_AddToTree(OSDirTree *tree, char *str, void *data, char sep);
-void *OSDirTree_SearchTree(OSDirTree *tree, char *str, char sep);
-
+OSDirTree *OSDirTree_Create(void);
+void OSDirTree_AddToTree(OSDirTree *tree, const char *str, void *data, char sep) __attribute__((nonnull(1, 2)));
+void *OSDirTree_SearchTree(const OSDirTree *tree, const char *str, char sep) __attribute__((nonnull));
+OSTreeNode *OSDirTree_GetFirstNode(OSDirTree *tree) __attribute__((nonnull));
-#endif
+#endif /* _OS_DIRTREE */
-/* EOF */