GRASS GIS 8 Programmer's Manual
8.5.0dev(2025)-565e82de51
Main Page
Related Pages
Data Structures
Data Structures
Class Hierarchy
Data Fields
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Functions
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
x
y
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
r
s
t
u
v
w
y
Enumerations
a
c
d
e
h
i
j
l
m
n
o
p
r
s
t
v
y
Enumerator
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
y
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
create.c
Go to the documentation of this file.
1
#include <
stdio.h
>
2
#include <
stdlib.h
>
3
#include <
grass/btree.h
>
4
5
int
btree_create
(
BTREE
*B,
int
(*cmp)(
const
void
*,
const
void
*),
int
incr)
6
{
7
if
(incr <= 0)
8
incr = 1;
9
10
B->
N
= 0;
11
B->
cur
= 0;
12
B->
tlen
= B->
incr
= incr;
13
14
/* must have at least 2 nodes, since node[0] is never used */
15
if
(B->
tlen
== 1)
16
B->
tlen
= 2;
17
18
B->
cmp
= cmp;
19
B->
node
= (
BTREE_NODE
*)
malloc
(B->
tlen
*
sizeof
(
BTREE_NODE
));
20
if
(B->
node
==
NULL
)
21
return
0;
22
return
1;
23
}
btree.h
NULL
#define NULL
Definition:
ccmath.h:32
btree_create
int btree_create(BTREE *B, int(*cmp)(const void *, const void *), int incr)
Definition:
create.c:5
malloc
void * malloc(YYSIZE_T)
stdio.h
stdlib.h
BTREE_NODE
Definition:
btree.h:4
BTREE
Definition:
btree.h:11
BTREE::N
int N
Definition:
btree.h:14
BTREE::cmp
int(* cmp)(const void *, const void *)
Definition:
btree.h:17
BTREE::cur
int cur
Definition:
btree.h:16
BTREE::incr
int incr
Definition:
btree.h:15
BTREE::node
BTREE_NODE * node
Definition:
btree.h:12
BTREE::tlen
int tlen
Definition:
btree.h:13
lib
btree
create.c
Generated on Thu Mar 20 2025 07:33:23 for GRASS GIS 8 Programmer's Manual by
1.9.1