コード例 #1
0
ファイル: deque.c プロジェクト: HunterPlus/ccl
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;
    }
}
コード例 #2
0
ファイル: scapegoat.c プロジェクト: asmloverX/childish-codes
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;
}
コード例 #3
0
ファイル: strcollectiongen.c プロジェクト: jacob-navia/ccl
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;
}