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
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}
#define DT_OBAG
Definition cdt.h:121
#define DT_SET
Definition cdt.h:119
CDT_API Dtlink_t * dtflatten(Dt_t *)
Definition dtflatten.c:12
#define DT_OSET
Definition cdt.h:120
Dtlink_t * dtextract(Dt_t *dt)
Definition dtextract.c:11
node NULL
Definition grammar.y:181
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:98
Dtdata_t data
sharable data
Definition cdt.h:101
Definition grammar.c:90