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