GRASS Programmer's Manual
6.5.svn(2014)-r66266
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
btree/find.c
Go to the documentation of this file.
1
#include <stdio.h>
2
#include <grass/btree.h>
3
4
int
btree_find
(
const
BTREE * B,
const
void
*key,
void
**
data
)
5
{
6
int
q
;
7
int
dir;
8
9
10
if
(B->N <= 0)
11
return
0;
12
13
q = 1;
14
while
(q > 0) {
15
dir = (*B->cmp) (B->node[q].key, key);
16
if
(dir == 0) {
17
*data = B->node[
q
].data;
18
return
1;
19
}
20
if
(dir > 0)
21
q = B->node[
q
].left;
/* go left */
22
else
23
q = B->node[
q
].right;
/* go right */
24
}
25
26
return
0;
27
}
forms.q
tuple q
Definition:
forms.py:2019
btree_find
int btree_find(const BTREE *B, const void *key, void **data)
Definition:
btree/find.c:4
menudata.data
tuple data
Definition:
core/menudata.py:219
lib
btree
find.c
Generated on Sat Jan 2 2016 01:46:47 for GRASS Programmer's Manual by
1.8.5