Graphviz
12.0.1~dev.20240715.2254
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|DT_QUEUE))*/
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:126
DT_SET
#define DT_SET
Definition
cdt.h:124
dtflatten
CDT_API Dtlink_t * dtflatten(Dt_t *)
Definition
dtflatten.c:10
DT_OSET
#define DT_OSET
Definition
cdt.h:125
dtextract
Dtlink_t * dtextract(Dt_t *dt)
Definition
dtextract.c:9
dthdr.h
NULL
node NULL
Definition
grammar.y:149
_dt_s
Definition
cdt.h:104
_dt_s::data
Dtdata_t * data
Definition
cdt.h:106
_dtdata_s::ntab
int ntab
Definition
cdt.h:82
_dtdata_s::here
Dtlink_t * here
Definition
cdt.h:77
_dtdata_s::type
int type
Definition
cdt.h:76
_dtdata_s::size
int size
Definition
cdt.h:83
_dtlink_s
Definition
cdt.h:55
s
Definition
grammar.c:93
lib
cdt
dtextract.c
Generated by
1.9.8