2
This software may only be used by you under license from AT&T Corp.
3
("AT&T"). A copy of AT&T's Source Code Agreement is available at
4
AT&T's Internet website having the URL:
5
<http://www.research.att.com/sw/tools/graphviz/license/source.html>
6
If you received this software without first entering into a license
7
with AT&T, you have an infringing copy of this software and cannot use
8
it without violating AT&T's intellectual property rights.
16
/* Internal definitions for libcdt.
17
** Written by Kiem-Phong Vo (5/25/96)
26
/* short-hand notations */
29
#define uint unsigned int
35
/* this must be disjoint from DT_METHODS */
36
#define DT_FLATTEN 010000 /* dictionary already flattened */
37
#define DT_WALK 020000 /* hash table being walked */
39
/* hash start size and load factor */
41
#define HRESIZE(n) ((n) << 1)
42
#define HLOAD(s) ((s) << 1)
43
#define HINDEX(n,h) ((h)&((n)-1))
45
#define UNFLATTEN(dt) \
46
((dt->data->type&DT_FLATTEN) ? dtrestore(dt,NIL(Dtlink_t*)) : 0)
48
/* the pointer to the actual object */
49
#define INITDISC(dt,d,ky,sz,lk,cmpf) \
50
(d = dt->disc, ky = d->key, sz = d->size, lk = d->link, cmpf = d->comparf)
51
#define ELT(o,lk) ((Dtlink_t*)((char*)(o) + lk) )
52
#define OBJ(e,lk) (lk < 0 ? ((Dthold_t*)(e))->obj : (Void_t*)((char*)(e) - lk) )
53
#define KEY(o,ky,sz) ((Void_t*)(sz < 0 ? *((char**)((char*)(o) + ky)) : \
56
/* compare and hash functions */
57
#define CMP(dt,k1,k2,d,cmpf,sz) \
58
(cmpf ? (*cmpf)(dt,k1,k2,d) : \
59
sz <= 0 ? strcmp(k1,k2) : memcmp(k1,k2,sz) )
60
#define HASH(dt,k,d,sz) (d->hashf ? (*d->hashf)(dt,k,d) : dtstrhash(0,k,sz) )
62
/* tree rotation functions */
63
#define RROTATE(x,y) ((x)->left = (y)->right, (y)->right = (x), (x) = (y))
64
#define LROTATE(x,y) ((x)->right = (y)->left, (y)->left = (x), (x) = (y))
65
#define RLINK(r,x) ((r) = (r)->left = (x) )
66
#define LLINK(l,x) ((l) = (l)->right = (x) )
70
extern Void_t* malloc _ARG_((size_t));
71
extern Void_t* realloc _ARG_((Void_t*, size_t));
72
extern void free _ARG_((Void_t*));
73
extern int memcmp _ARG_((const Void_t*, const Void_t*, size_t));
74
extern int strcmp _ARG_((const char*, const char*));