X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Fheaders%2Fdirtree_op.h;h=77f16f9b3cb4280eda562c97dd7e8552692ad3c5;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hp=50e9aedaac6ccdaf0bb4da8ae053f295c81d27b8;hpb=914feba5d54f979cd5d7e69c349c3d01f630042a;p=ossec-hids.git diff --git a/src/headers/dirtree_op.h b/src/headers/dirtree_op.h old mode 100755 new mode 100644 index 50e9aed..77f16f9 --- a/src/headers/dirtree_op.h +++ b/src/headers/dirtree_op.h @@ -1,46 +1,37 @@ -/* @(#) $Id: dirtree_op.h,v 1.3 2009/06/24 17:06:26 dcid Exp $ */ - /* Copyright (C) 2009 Trend Micro Inc. * All rights reserved. * * This program is a free software; you can redistribute it * and/or modify it under the terms of the GNU General Public - * License (version 3) as published by the FSF - Free Software + * 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 */