diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-04-04 18:44:16 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-04-04 18:44:16 +0000 |
commit | bd9baa8184e8ff78b6644e8d88817a3ac8ec67fe (patch) | |
tree | 626eb6aa1a8779330e88e16987c6f25c226507f6 /cpukit/sapi/include/rtems/rbtree.h | |
parent | 2011-04-04 Sebastien Bourdeauducq <sebastien.bourdeauducq@gmail.com> (diff) | |
download | rtems-bd9baa8184e8ff78b6644e8d88817a3ac8ec67fe.tar.bz2 |
2010-07-28 Gedare Bloom <giddyup44@yahoo.com>
PR 1641/cpukit
* sapi/Makefile.am, sapi/preinstall.am, score/Makefile.am,
score/preinstall.am: Add Red Black Tree data structure to score.
* sapi/include/rtems/rbtree.h, sapi/inline/rtems/rbtree.inl,
score/include/rtems/score/rbtree.h, score/inline/rtems/score/rbtree.inl,
score/src/rbtree.c, score/src/rbtreeextract.c,
score/src/rbtreefind.c, score/src/rbtreefindheader.c,
score/src/rbtreeget.c, score/src/rbtreeinsert.c,
score/src/rbtreepeek.c: New files.
Diffstat (limited to 'cpukit/sapi/include/rtems/rbtree.h')
-rw-r--r-- | cpukit/sapi/include/rtems/rbtree.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/cpukit/sapi/include/rtems/rbtree.h b/cpukit/sapi/include/rtems/rbtree.h new file mode 100644 index 0000000000..68f4ec697e --- /dev/null +++ b/cpukit/sapi/include/rtems/rbtree.h @@ -0,0 +1,74 @@ +/** + * @file rtems/rbtree.h + * + * This include file contains all the constants and structures associated + * with the RBTree API in RTEMS. The rbtree is a Red Black Tree that + * is part of the Super Core. This is the published interface to that + * code. + * + */ + +/* + * Copyright (c) 2010 Gedare Bloom. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#ifndef _RTEMS_RBTREE_H +#define _RTEMS_RBTREE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <rtems/system.h> +#include <rtems/score/rbtree.h> + +/** + * @typedef rtems_rbtree_node + * + * A node that can be manipulated in the rbtree. + */ +typedef RBTree_Node rtems_rbtree_node; + +/** + * @typedef rtems_rbtree_control + * + * The rbtree's control anchors the rbtree. + */ +typedef RBTree_Control rtems_rbtree_control; + +/** + * @brief RBTree initializer for an empty rbtree with designator @a name. + */ +#define RTEMS_RBTREE_INITIALIZER_EMPTY(name) \ + RBTREE_INITIALIZER_EMPTY(name) + +/** + * @brief RBTree definition for an empty rbtree with designator @a name. + */ +#define RTEMS_RBTREE_DEFINE_EMPTY(name) \ + RBTREE_DEFINE_EMPTY(name) + +/** + * @brief macro to return the structure containing the @a node. + * + * This macro returns a pointer of type @a object_type that points + * to the structure containing @a node, where @a object_member is the + * field name of the rtems_rbtree_node structure in objects of @a object_type. + */ +#define rtems_rbtree_container_of(node,object_type, object_member) \ + _RBTree_Container_of(node,object_type,object_member) + +#include <rtems/rbtree.inl> + +#ifdef __cplusplus +} +#endif + +#endif +/* end of include file */ |