Graphviz
13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
dtsize.c
Go to the documentation of this file.
1
#include <
cdt/dthdr.h
>
2
3
/* Return the # of objects in the dictionary
4
**
5
** Written by Kiem-Phong Vo (5/25/96)
6
*/
7
8
static
int
treecount
(
Dtlink_t
* e)
9
{
return
e ?
treecount
(e->left) +
treecount
(e->
right
) + 1 : 0;
10
}
11
12
int
dtsize
(
Dt_t
* dt)
13
{
14
UNFLATTEN
(dt);
15
16
if
(dt->
data
.
size
< 0)
// !(dt->data.type & (DT_SET|DT_BAG))
17
{
if
(dt->
data
.
type
& (
DT_OSET
|
DT_OBAG
))
18
dt->
data
.
size
=
treecount
(dt->
data
.
here
);
19
}
20
21
return
dt->
data
.
size
;
22
}
DT_OBAG
#define DT_OBAG
Definition
cdt.h:122
DT_OSET
#define DT_OSET
Definition
cdt.h:121
dthdr.h
UNFLATTEN
#define UNFLATTEN(dt)
Definition
dthdr.h:27
dtsize
int dtsize(Dt_t *dt)
Definition
dtsize.c:12
treecount
static int treecount(Dtlink_t *e)
Definition
dtsize.c:8
Dtdata_t::size
int size
Definition
cdt.h:79
Dtdata_t::here
Dtlink_t * here
Definition
cdt.h:73
Dtdata_t::type
int type
Definition
cdt.h:72
dt_s_
Definition
cdt.h:100
dt_s_::data
Dtdata_t data
sharable data
Definition
cdt.h:102
dtlink_s_
Definition
cdt.h:51
dtlink_s_::right
Dtlink_t * right
Definition
cdt.h:51
lib
cdt
dtsize.c
Generated by
1.9.8