Graphviz
13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
dtextract.c
Go to the documentation of this file.
1
#include <
cdt/dthdr.h
>
2
#include <stddef.h>
3
4
/* Extract objects of a dictionary.
5
**
6
** Written by Kiem-Phong Vo (5/25/96).
7
*/
8
9
Dtlink_t
*
dtextract
(
Dt_t
* dt)
10
{
11
Dtlink_t
*list, **
s
, **ends;
12
13
if
(dt->
data
.
type
& (
DT_OSET
|
DT_OBAG
))
14
list = dt->
data
.
here
;
15
else
if
(dt->
data
.
type
&
DT_SET
)
16
{ list =
dtflatten
(dt);
17
for
(ends = (
s
= dt->
data
.htab) + dt->
data
.
ntab
;
s
< ends; ++
s
)
18
*
s
=
NULL
;
19
}
20
else
// if (dt->data.type & (DT_LIST|DT_STACK))
21
{ list = dt->
data
.head;
22
dt->
data
.head =
NULL
;
23
}
24
25
dt->
data
.
type
&= ~DT_FLATTEN;
26
dt->
data
.
size
= 0;
27
dt->
data
.
here
=
NULL
;
28
29
return
list;
30
}
DT_OBAG
#define DT_OBAG
Definition
cdt.h:122
DT_SET
#define DT_SET
Definition
cdt.h:120
dtflatten
CDT_API Dtlink_t * dtflatten(Dt_t *)
Definition
dtflatten.c:10
DT_OSET
#define DT_OSET
Definition
cdt.h:121
dtextract
Dtlink_t * dtextract(Dt_t *dt)
Definition
dtextract.c:9
dthdr.h
NULL
node NULL
Definition
grammar.y:163
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
Dtdata_t::ntab
int ntab
Definition
cdt.h:78
dt_s_
Definition
cdt.h:100
dt_s_::data
Dtdata_t data
sharable data
Definition
cdt.h:102
dtlink_s_
Definition
cdt.h:51
s
Definition
grammar.c:93
lib
cdt
dtextract.c
Generated by
1.9.8