Graphviz 12.0.1~dev.20240715.2254
Loading...
Searching...
No Matches
dthdr.h
Go to the documentation of this file.
1#pragma once
2
3/* Internal definitions for libcdt.
4** Written by Kiem-Phong Vo (5/25/96)
5*/
6
7#include <stdlib.h>
8
9#include <cdt.h>
10
11/* short-hand notations */
12#define left hl._left
13#define hash hl._hash
14#define htab hh._htab
15#define head hh._head
16
17/* this must be disjoint from DT_METHODS */
18#define DT_FLATTEN 010000 /* dictionary already flattened */
19#define DT_WALK 020000 /* hash table being walked */
20
21/* hash start size and load factor */
22#define HSLOT (256)
23#define HRESIZE(n) ((n) << 1)
24#define HLOAD(s) ((s) << 1)
25#define HINDEX(n,h) ((h)&((n)-1))
26
27#define UNFLATTEN(dt) \
28 ((dt->data->type&DT_FLATTEN) ? dtrestore(dt,NULL) : 0)
29
30/* tree rotation/linking functions */
31#define rrotate(x,y) ((x)->left = (y)->right, (y)->right = (x))
32#define lrotate(x,y) ((x)->right = (y)->left, (y)->left = (x))
33#define rlink(r,x) ((r) = (r)->left = (x) )
34#define llink(l,x) ((l) = (l)->right = (x) )
35
36#define RROTATE(x,y) (rrotate(x,y), (x) = (y))
37#define LROTATE(x,y) (lrotate(x,y), (x) = (y))
container data types API