aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/eina/src/include/eina_inline_rbtree.x
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-04 18:41:13 +1000
committerDavid Walter Seikel2012-01-04 18:41:13 +1000
commitdd7595a3475407a7fa96a97393bae8c5220e8762 (patch)
treee341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/eina/src/include/eina_inline_rbtree.x
parentAdd the skeleton. (diff)
downloadSledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to 'libraries/eina/src/include/eina_inline_rbtree.x')
-rw-r--r--libraries/eina/src/include/eina_inline_rbtree.x50
1 files changed, 50 insertions, 0 deletions
diff --git a/libraries/eina/src/include/eina_inline_rbtree.x b/libraries/eina/src/include/eina_inline_rbtree.x
new file mode 100644
index 0000000..954774b
--- /dev/null
+++ b/libraries/eina/src/include/eina_inline_rbtree.x
@@ -0,0 +1,50 @@
1/* EINA - EFL data type library
2 * Copyright (C) 2002-2008 Cedric BAIL
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library;
16 * if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef EINA_RBTREE_INLINE_H_
20#define EINA_RBTREE_INLINE_H_
21
22/**
23 * @addtogroup Eina_Rbtree_Group Red-Black tree
24 *
25 * @brief These functions provide Red-Black trees management.
26 *
27 * @{
28 */
29
30static inline Eina_Rbtree *
31eina_rbtree_inline_lookup(const Eina_Rbtree *root, const void *key, int length, Eina_Rbtree_Cmp_Key_Cb cmp, const void *data)
32{
33 int result;
34
35 while (root)
36 {
37 result = cmp(root, key, length, (void*) data);
38 if (result == 0) return (Eina_Rbtree*) root;
39
40 root = root->son[result < 0 ? 0 : 1];
41 }
42
43 return NULL;
44}
45
46/**
47 * @}
48 */
49
50#endif