/ast/src/cmd/mailx/port/ |
H A D | dtclose.c | 75 int dtclose(reg Dt_t* dt) argument 77 int dtclose(dt) 78 reg Dt_t* dt; 81 if(dt->nview > 0 ) /* can't close if being viewed */ 84 if(dt->view) /* turn off viewing */ 85 dtview(dt,NIL(Dt_t*)); 88 if(dt->disc->eventf && 89 (*dt->disc->eventf)(dt,DT_CLOSE,NIL(Void_t*),dt [all...] |
H A D | dtsize.c | 85 int dtsize(Dt_t* dt) argument 87 int dtsize(dt) 88 Dt_t* dt; 94 UNFLATTEN(dt); 96 if(dt->data->size < 0) /* !(dt->data->type&DT_HASH) */ 97 { if(dt->data->type&DT_TREE) 98 dt->data->size = dtcount(dt->data->here); 99 else if(dt [all...] |
H A D | dtrestore.c | 78 int dtrestore(reg Dt_t* dt, reg Dtlink_t* list) argument 80 int dtrestore(dt, list) 81 reg Dt_t* dt; 87 reg Dtsearch_f searchf = dt->meth->searchf; 89 type = dt->data->type&DT_FLATTEN; 93 list = dt->data->here; 96 { if(dt->data->size != 0) 100 dt->data->type &= ~DT_FLATTEN; 102 if(dt->data->type&DT_HASH) 103 { dt [all...] |
H A D | dtopen.c | 84 Dt_t* dt = (Dt_t*)Version; /* shut-up unuse warning */ local 92 if(!(dt = (Dt_t*) malloc(sizeof(Dt_t)))) 96 dt->searchf = NIL(Dtsearch_f); 97 dt->meth = NIL(Dtmethod_t*); 98 dt->disc = NIL(Dtdisc_t*); 99 dtdisc(dt,disc,0); 100 dt->nview = 0; 101 dt->view = dt->walk = NIL(Dt_t*); 106 if((e = (*disc->eventf)(dt,DT_OPE [all...] |
H A D | dtmethod.c | 77 Dtmethod_t* dtmethod(Dt_t* dt, Dtmethod_t* meth) argument 79 Dtmethod_t* dtmethod(dt, meth) 80 Dt_t* dt; 87 reg Dtdisc_t* disc = dt->disc; 88 reg Dtmethod_t* oldmeth = dt->meth; 94 if((dt->data->type&(DT_STACK|DT_QUEUE)) || 99 (*disc->eventf)(dt,DT_METH,(Void_t*)meth,disc) < 0) 103 list = dtflatten(dt); 104 if(dt->data->type&DT_LIST) 105 dt [all...] |
H A D | dtwalk.c | 78 int dtwalk(reg Dt_t* dt, int (*userf)(Dt_t*, Void_t*, Void_t*), Void_t* data) argument 80 int dtwalk(dt,userf,data) 81 reg Dt_t* dt; 90 for(obj = dtfirst(dt); obj; ) 91 { if(!(walk = dt->walk) ) 92 walk = dt; 93 next = dtnext(dt,obj);
|
H A D | dtview.c | 77 static Void_t* dtvsearch(Dt_t* dt, reg Void_t* obj, reg int type) argument 79 static Void_t* dtvsearch(dt,obj,type) 80 Dt_t* dt; 90 return (*(dt->meth->searchf))(dt,obj,type); 96 { for(d = dt; d; d = d->view) 98 { dt->walk = d; 103 dt->walk = NIL(Dt_t*); 108 if(!dt->walk) 109 dt 136 dtview(reg Dt_t* dt, reg Dt_t* view) argument [all...] |
H A D | dtflatten.c | 77 Dtlink_t* dtflatten(Dt_t* dt) argument 79 Dtlink_t* dtflatten(dt) 80 Dt_t* dt; 86 if(dt->data->type&DT_FLATTEN ) 87 return dt->data->here; 90 if(dt->data->type&DT_HASH) 91 { eslot = (slot = dt->data->htab) + dt->data->ntab; 103 else if(dt->data->type&DT_TREE)/* eliminate left children */ 104 { for(r = dt [all...] |
H A D | dtrenew.c | 77 Void_t* dtrenew(Dt_t* dt, reg Void_t* obj) argument 79 Void_t* dtrenew(dt, obj) 80 Dt_t* dt; 87 reg Dtdisc_t* disc = dt->disc; 89 UNFLATTEN(dt); 91 if(!(e = dt->data->here) || OBJ(e,disc) != obj) 94 if(dt->data->type&DT_TREE) 96 dt->data->here = e->left; 101 dt->data->here = r; 104 else if(dt [all...] |
H A D | dtextract.c | 76 Dtlink_t* dtextract(reg Dt_t* dt) argument 78 Dtlink_t* dtextract(dt) 79 reg Dt_t* dt; 84 UNFLATTEN(dt); 86 if(dt->data->type&DT_TREE) 87 list = dt->data->here; 88 else if(dt->data->type&DT_HASH) /* make a big list of everything */ 90 eslot = (slot = dt->data->htab) + dt->data->ntab; 102 else /*if(dt [all...] |
H A D | dtdisc.c | 73 ** dt : dictionary 80 static Void_t* dtmemory(Dt_t* dt,Void_t* addr,size_t size,Dtdisc_t* disc) argument 82 static Void_t* dtmemory(dt, addr, size, disc) 83 Dt_t* dt; /* dictionary */ 97 Dtdisc_t* dtdisc(Dt_t* dt, Dtdisc_t* disc, int type) argument 99 Dtdisc_t* dtdisc(dt,disc,type) 100 Dt_t* dt; 111 if(!(old = dt->disc) ) /* initialization call from dtopen() */ 112 { dt->disc = disc; 113 if(!(dt [all...] |
H A D | dthash.c | 72 ** dt: dictionary 81 static void dthtab(Dt_t* dt) argument 83 static void dthtab(dt) 84 Dt_t* dt; 91 s = dt->data->size; 92 if((nslot = dt->data->ntab) == 0) 98 slot = (Dtlink_t**)(*dt->memoryf) 99 (dt,NIL(Void_t*),nslot*sizeof(Dtlink_t*),dt->disc); 106 eslot = (oslot = dt 124 dthash(Dt_t* dt, reg Void_t* obj, int type) argument [all...] |
/ast/src/cmd/tests/cdt/ |
H A D | tlist.c | 30 Dt_t* dt; local 33 if(!(dt = dtopen(&Disc,Dtlist)) ) 35 if((long)dtinsert(dt,1L) != 1) 37 if((long)dtappend(dt,2L) != 2) 39 if((long)dtappend(dt,3L) != 3) 41 if((long)dtappend(dt,1L) != 1) 43 if((long)dtappend(dt,2L) != 2) 45 if((long)dtappend(dt,3L) != 3) 48 if((long)dtlast(dt) != 3) 50 if((long)dtprev(dt, [all...] |
H A D | tsearch.c | 36 Dt_t* dt; local 41 dt = dtopen(&Disc,Dtoset); 42 if((long)dtinsert(dt,7L) != 7) 44 if((long)dtinsert(dt,1L) != 1) 46 if((long)dtinsert(dt,3L) != 3) 48 if((long)dtinsert(dt,4L) != 4) 50 if((long)dtinsert(dt,2L) != 2) 52 if((long)dtinsert(dt,6L) != 6) 54 if((long)dtinsert(dt,7L) != 7) 57 if((long)dtatmost(dt, [all...] |
H A D | tstack.c | 30 Dt_t* dt; local 33 if(!(dt = dtopen(&Disc,Dtstack)) ) 35 if((long)dtinsert(dt,1L) != 1) 37 if((long)dtinsert(dt,3L) != 3) 39 if((long)dtinsert(dt,2L) != 2) 41 if((long)dtinsert(dt,3L) != 3) 43 if((long)dtinsert(dt,2L) != 2) 45 if((long)dtinsert(dt,3L) != 3) 48 if((long)dtlast(dt) != 1) 50 if((long)dtprev(dt, [all...] |
H A D | tqueue.c | 30 Dt_t* dt; local 33 if(!(dt = dtopen(&Disc,Dtqueue)) ) 35 if((long)dtinsert(dt,1L) != 1) 37 if((long)dtinsert(dt,3L) != 3) 39 if((long)dtinsert(dt,2L) != 2) 41 if((long)dtinsert(dt,3L) != 3) 43 if((long)dtinsert(dt,2L) != 2) 45 if((long)dtinsert(dt,3L) != 3) 48 if((long)dtlast(dt) != 3) 50 if((long)dtprev(dt, [all...] |
H A D | tdeque.c | 30 Dt_t* dt; local 34 if(!(dt = dtopen(&Disc,Dtdeque)) ) 36 if((long)dtinsert(dt,3L) != 3) 38 if((long)dtappend(dt,4L) != 4) 40 if((long)dtinsert(dt,2L) != 2) 42 if((long)dtappend(dt,5L) != 5) 44 if((long)dtinsert(dt,1L) != 1) 46 if((long)dtappend(dt,6L) != 6) 49 for(k = 1, i = (long)dtfirst(dt); i != 0; i = (long)dtnext(dt, [all...] |
H A D | dttest.h | 24 static int compare(Dt_t* dt, Void_t* o1, Void_t* o2, Dtdisc_t* disc) argument 26 static int compare(dt,o1,o2,disc) 27 Dt_t* dt; 37 static int rcompare(Dt_t* dt, Void_t* o1, Void_t* o2, Dtdisc_t* disc) argument 39 static int rcompare(dt,o1,o2,disc) 40 Dt_t* dt; 50 static Void_t* newint(Dt_t* dt, Void_t* o, Dtdisc_t* disc) argument 52 static Void_t* newint(dt,o,disc) 53 Dt_t* dt; 62 static unsigned int hashint(Dt_t* dt, Void_ argument [all...] |
/ast/src/lib/libast/cdt/ |
H A D | dtclose.c | 29 int dtclose(Dt_t* dt) argument 31 int dtclose(dt) 32 Dt_t* dt; 37 Dtdisc_t *disc = dt->disc; 39 if(!dt || dt->nview > 0 ) /* can't close if being viewed */ 43 ev = (*disc->eventf)(dt, DT_CLOSE, (Void_t*)1, disc); 48 if(dt->view) /* turn off viewing at this point */ 49 dtview(dt,NIL(Dt_t*)); 51 type = dt [all...] |
H A D | dtmethod.c | 30 Dtmethod_t* dtmethod(Dt_t* dt, Dtmethod_t* meth) argument 32 Dtmethod_t* dtmethod(dt, meth) 33 Dt_t* dt; 38 Dtdisc_t *disc = dt->disc; 39 Dtmethod_t *oldmt = dt->meth; 40 Dtdata_t *newdt, *olddt = dt->data; 46 if(disc->eventf && (*disc->eventf)(dt,DT_METH,(Void_t*)meth,disc) < 0) 49 list = dtextract(dt); /* extract elements out of dictionary */ 52 if(dt->searchf == oldmt->searchf) /* ie, not viewpathing */ 53 dt 82 dtcustomize(Dt_t* dt, int type, int action) argument [all...] |
H A D | dtdisc.c | 25 ** dt : dictionary 32 static Void_t* dtmemory(Dt_t* dt, Void_t* addr, size_t size, Dtdisc_t* disc) argument 34 static Void_t* dtmemory(dt, addr, size, disc) 35 Dt_t* dt; /* dictionary */ 52 Dtdisc_t* dtdisc(Dt_t* dt, Dtdisc_t* disc, int type) argument 54 Dtdisc_t* dtdisc(dt,disc,type) 55 Dt_t* dt; 63 if(!(old = dt->disc) ) /* initialization call from dtopen() */ 64 { dt->disc = disc; 65 if(!(dt [all...] |
H A D | dtwalk.c | 31 int dtwalk(Dt_t* dt, int (*userf)(Dt_t*, Void_t*, Void_t*), Void_t* data) argument 33 int dtwalk(dt,userf,data) 34 Dt_t* dt; 43 for(obj = dtfirst(dt); obj; ) 44 { if(!(walk = dt->walk) ) 45 walk = dt; 46 next = dtnext(dt,obj);
|
H A D | dtopen.c | 31 static int _dttype2005(Dt_t* dt, int type) argument 33 if (type == DT_DELETE && (dt->meth->type&(DT_OBAG|DT_BAG))) 48 Dt_t *dt, pdt; local 54 dt = NIL(Dt_t*); 76 { if(data) /* dt should be allocated with dt->data */ 88 dt = &pdt.data->dict; 89 else if(!(dt = (Dt_t*) malloc(sizeof(Dt_t))) ) 95 *dt = pdt; 97 dt 122 _dtmake(Dt_t* dt, Void_t* obj, int type) argument 146 _dtfree(Dt_t* dt, Dtlink_t* l, int type) argument 157 dtuserlock(Dt_t* dt, unsigned int key, int type) argument 166 dtuserdata(Dt_t* dt, Void_t* data, unsigned int key) argument [all...] |
H A D | dtview.c | 35 static Void_t* dtvsearch(Dt_t* dt, reg Void_t* obj, reg int type) argument 37 static Void_t* dtvsearch(dt,obj,type) 38 Dt_t* dt; 48 return (*(dt->meth->searchf))(dt,obj,type); 54 ((type & (DT_FIRST|DT_LAST|DT_ATLEAST|DT_ATMOST)) && !(dt->meth->type&DT_ORDERED) ) ) 55 { for(d = dt; d; d = d->view) 58 dt->walk = d; 62 if(dt->meth->type & DT_ORDERED) /* ordered sets/bags */ 68 for(d = dt; 124 dtview(reg Dt_t* dt, reg Dt_t* view) argument [all...] |
/ast/src/cmd/tests/vmalloc/ |
H A D | tresize.c | 30 Void_t *dt[10]; local 36 if(!(dt[0] = vmalloc(vm, 32)) ) 38 if(!(dt[1] = vmalloc(vm, 32)) ) 40 if(!(dt[2] = vmalloc(vm, 32)) ) 42 vmfree(vm,dt[1]); 43 vmfree(vm,dt[2]); 44 if(vmresize(vm, dt[0], 60, 1) != dt[0]) 46 if(vmresize(vm, dt[0], 32, 1) != dt[ [all...] |