21 #ifndef __CCL_ITERATOR_H__
22 # define __CCL_ITERATOR_H__
43 # define CCL_ITERATOR_TYPEDEF(_typename_,_eltype_) \
44 typedef struct ccl_iterator_ ## _typename_ ## _st _typename_; \
45 struct ccl_iterator_ ## _typename_ ## _st { \
46 int (*has_more_elements) (const _typename_ *i); \
47 _eltype_ (*next_element) (_typename_ *i); \
48 void (*delete_iterator) (_typename_ *i); \
67 # define ccl_iterator_has_more_elements(i) ((i)->has_more_elements (i))
75 # define ccl_iterator_next_element(i) ((i)->next_element (i))
81 # define ccl_iterator_delete(i) ((i)->delete_iterator (i))
85 extern ccl_pointer_iterator *
86 ccl_iterator_crt_filter (ccl_pointer_iterator *base,
87 int (*accept) (
void *obj,
void *data),
91 extern ccl_pointer_iterator *
92 ccl_iterator_crt_concat (ccl_pointer_iterator *i1, ccl_pointer_iterator *i2);
94 extern ccl_pointer_iterator *
95 ccl_iterator_crt_sequence (
int nb_iterators, ccl_pointer_iterator **iterators);
97 extern ccl_pointer_iterator *
98 ccl_iterator_crt_dup (ccl_pointer_iterator *iterators,
Frequently used prototypes of generic functions.
#define CCL_ITERATOR_TYPEDEF(_typename_, _eltype_)
Macro-function used to define and declare a new iterator type.
void ccl_delete_proc(void *ptr)
Prototype of procedures used to release the resources allocated to the object pointed by ptr...
Some useful and common macros.
void * ccl_duplicate_func(void *ptr)
Prototype of functions used to duplicate an object pointed by ptr.