#ifndef ALGO_H #define ALGO_H typedef int (*alg_unary_funct)(void *) ; /** alg_next_iterator should return container_iterator->end if it reaches end of container */ typedef void *(*container_next)(const void *container, const void *pos); typedef const void*(*container_const_next)(const void *container, const void *current_pos); typedef int (*alg_cmp_funct)(const void *, const void *); typedef struct { void *begin; const void *end; container_next iterator; const void *container; } container_iterator; typedef struct { const void *begin; const void *end; container_const_next iterator; const void *container; } container_const_iterator; void alg_for_each(container_iterator *it, alg_unary_funct f_each); const void *alg_find(container_const_iterator *it,alg_cmp_funct cmp, const void *value); const void *alg_find_if(container_const_iterator *it, alg_unary_funct f); #endif /* ALGO_H */