Graphviz  2.41.20171026.1811
dtextract.c
Go to the documentation of this file.
1 #include "dthdr.h"
2 
3 /* Extract objects of a dictionary.
4 **
5 ** Written by Kiem-Phong Vo (5/25/96).
6 */
7 
9 {
10  reg Dtlink_t *list, **s, **ends;
11 
12  if(dt->data->type&(DT_OSET|DT_OBAG) )
13  list = dt->data->here;
14  else if(dt->data->type&(DT_SET|DT_BAG))
15  { list = dtflatten(dt);
16  for(ends = (s = dt->data->htab) + dt->data->ntab; s < ends; ++s)
17  *s = NIL(Dtlink_t*);
18  }
19  else /*if(dt->data->type&(DT_LIST|DT_STACK|DT_QUEUE))*/
20  { list = dt->data->head;
21  dt->data->head = NIL(Dtlink_t*);
22  }
23 
24  dt->data->type &= ~DT_FLATTEN;
25  dt->data->size = 0;
26  dt->data->here = NIL(Dtlink_t*);
27 
28  return list;
29 }
CDT_API Dtlink_t * dtextract(Dt_t *)
CDT_API Dtlink_t * dtflatten(Dt_t *)
Definition: dtflatten.c:9
#define reg
Definition: dthdr.h:14
#define DT_SET
Definition: cdt.h:125
#define DT_BAG
Definition: cdt.h:126
#define NIL(t)
Definition: dthdr.h:13
#define DT_OSET
Definition: cdt.h:127
Definition: grammar.c:79
#define DT_OBAG
Definition: cdt.h:128
#define DT_FLATTEN
Definition: dthdr.h:22
Definition: cdt.h:99