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
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}
#define DT_OBAG
Definition cdt.h:122
#define DT_SET
Definition cdt.h:120
CDT_API Dtlink_t * dtflatten(Dt_t *)
Definition dtflatten.c:10
#define DT_OSET
Definition cdt.h:121
Dtlink_t * dtextract(Dt_t *dt)
Definition dtextract.c:9
node NULL
Definition grammar.y:163
int size
Definition cdt.h:79
Dtlink_t * here
Definition cdt.h:73
int type
Definition cdt.h:72
int ntab
Definition cdt.h:78
Definition cdt.h:100
Dtdata_t data
sharable data
Definition cdt.h:102
Definition grammar.c:93