Open SCAP Library
/home/pvrabec/project/openscap/openscap-0.8.0/src/OVAL/probes/SEAP/generic/rbt/rbt_i32.h
00001 /*
00002  * Copyright 2010 Red Hat Inc., Durham, North Carolina.
00003  * All Rights Reserved.
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2.1 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  *
00019  * Authors:
00020  *      "Daniel Kopecek" <dkopecek@redhat.com>
00021  */
00022 #ifndef RBT_I32_H
00023 #define RBT_I32_H
00024 
00025 #include "rbt_common.h"
00026 
00027 struct rbt_i32_node {
00028         int32_t  key;
00029         void    *data;
00030 };
00031 
00032 typedef struct rbt_i32_node rbt_i32_node_t;
00033 
00034 #define rbt_i32_node_key(np) (((struct rbt_i32_node *)(rbt_node_ptr(np)->_node))->key)
00035 #define rbt_i32_node_data(np) (((struct rbt_i32_node *)(rbt_node_ptr(np)->_node))->data)
00036 
00037 rbt_t *rbt_i32_new (void);
00038 void rbt_i32_free (rbt_t *rbt);
00039 void rbt_i32_free_cb (rbt_t *rbt, void (*callback)(rbt_i32_node_t *));
00040 
00041 int rbt_i32_add(rbt_t *rbt, int32_t key, void *data, void **coll);
00042 void *rbt_i32_rep(rbt_t *rbt, int32_t key, void *data);
00043 int rbt_i32_del(rbt_t *rbt, int32_t key, void **n);
00044 int rbt_i32_get(rbt_t *rbt, int32_t key, void **data);
00045 
00046 int rbt_i32_walk_preorder(rbt_t *rbt, int (*callback)(rbt_i32_node_t *), rbt_walk_t flags);
00047 int rbt_i32_walk_inorder(rbt_t *rbt, int (*callback)(rbt_i32_node_t *), rbt_walk_t flags);
00048 int rbt_i32_walk_postorder(rbt_t *rbt, int (*callback)(rbt_i32_node_t *), rbt_walk_t flags);
00049 int rbt_i32_walk_levelorder(rbt_t *rbt, int (*callback)(rbt_i32_node_t *), rbt_walk_t flags);
00050 int rbt_i32_walk(rbt_t *rbt, rbt_walk_t type, int (*callback)(rbt_i32_node_t *));
00051 size_t rbt_i32_size(rbt_t *rbt);
00052 
00053 #endif /* RBT_I32_H */