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