17 disc = dt->disc;
_DTDSC(disc,ky,sz,lk,cmpf);
22 {
if((r = dt->data->head) )
35 {
if(disc->freef || disc->link < 0)
36 {
for(r = dt->data->head; r; r = t)
39 (*disc->freef)(dt,
_DTOBJ(r,lk),disc);
41 (*dt->memoryf)(dt,(
void*)r,0,disc);
48 else return NIL(
void*);
53 !(obj = (*disc->makef)(dt,obj,disc)) )
63 {
if(disc->makef && disc->freef && (type&DT_INSERT))
64 (*disc->freef)(dt,obj,disc);
76 {
if(!(t = dt->data->here) || !t->right)
84 {
if(!(t = dt->data->here) || t == dt->data->head)
94 r->right = t = dt->data->head;
104 if((t = dt->data->head) )
105 { t->left->right = r;
110 { dt->data->head = r;
116 if(dt->data->size >= 0)
123 if((type&
DT_MATCH) || !(r = dt->data->here) ||
_DTOBJ(r,lk) != obj)
125 for(r = dt->data->head; r; r = r->right)
127 if(
_DTCMP(dt,key,k,disc,cmpf,sz) == 0)
139 r->right->left = r->left;
140 if(r == (t = dt->data->head) )
141 { dt->data->head = r->right;
143 dt->data->head->left = t->left;
146 { r->left->right = r->right;
151 dt->data->here = r == dt->data->here ? r->right :
NIL(
Dtlink_t*);
156 (*disc->freef)(dt,obj,disc);
158 (*dt->memoryf)(dt,(
void*)r,0,disc);
int(* Dtcompar_f)(Dt_t *, void *, void *, Dtdisc_t *)
CDT_API Dtmethod_t _Dtqueue
CDT_API Dtmethod_t * Dtstack
CDT_API Dtmethod_t _Dtstack
CDT_API Dtmethod_t _Dtlist
CDT_API Dtmethod_t * Dtdeque
CDT_API Dtmethod_t * Dtqueue
#define _DTDSC(dc, ky, sz, lk, cmpf)
#define _DTCMP(dt, k1, k2, dc, cmpf, sz)
struct _dthold_s Dthold_t
CDT_API Dtmethod_t * Dtlist
#define _DTKEY(o, ky, sz)