Exemplo n.º 1
0
static void Apply(Deque * d, int (*Applyfn)(void *,void * arg),void *arg) 
{
    DequeNode tmp = d->head;

    while (tmp != NULL) {
        Applyfn(tmp->Data, arg);
        tmp = tmp->Next;
    }
}
Exemplo n.º 2
0
static int Apply(TreeMap *tree,int (*Applyfn)(const void *data,void *arg),void *arg)
{
    Iterator *it = newIterator(tree);
    void *obj;

    for (obj = it->GetFirst(it);
    	 obj != NULL;
    	 obj = it->GetNext(it)) {
    	Applyfn(obj,arg);
    }
    return 1;
}
Exemplo n.º 3
0
static int Apply(ElementType *SC,int (*Applyfn)(CHAR_TYPE *,void *),void *arg)
{
    size_t i;

    if (SC == NULL) {
        return NullPtrError("Apply");
    }
    if (Applyfn == NULL) {
        return BadArgError(SC,"Apply");
    }
    for (i=0; i<SC->count;i++) {
        Applyfn(SC->contents[i],arg);
    }
    return 1;
}