*/
-ZEND_API void zend_hash_apply(HashTable *ht, int (*destruct)(void *))
+ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func)
{
Bucket *p;
p = ht->pListHead;
while (p != NULL) {
- if (destruct(p->pData)) {
+ if (apply_func(p->pData)) {
p = zend_hash_apply_deleter(ht, p);
} else {
p = p->pListNext;
}
-ZEND_API void zend_hash_apply_with_argument(HashTable *ht, int (*destruct)(void *, void *), void *argument)
+ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *argument)
{
Bucket *p;
p = ht->pListHead;
while (p != NULL) {
- if (destruct(p->pData, argument)) {
+ if (apply_func(p->pData, argument)) {
p = zend_hash_apply_deleter(ht, p);
} else {
p = p->pListNext;
typedef int (*compare_func_t)(const void *, const void *);
typedef void (*sort_func_t)(void *, size_t, register size_t, compare_func_t);
typedef void (*dtor_func_t)(void *pDest);
+typedef int (*apply_func_t)(void *pDest);
+typedef int (*apply_func_arg_t)(void *pDest, void *argument);
typedef ulong (*hash_func_t)(char *arKey, uint nKeyLength);
typedef void (*copy_ctor_func_t)(void *pElement);
int (*)(void *element, int num_args, va_list args, zend_hash_key *hash_key)
ZEND_API void zend_hash_graceful_destroy(HashTable *ht);
-ZEND_API void zend_hash_apply(HashTable *ht,int (*destruct)(void *));
-ZEND_API void zend_hash_apply_with_argument(HashTable *ht,int (*destruct)(void *, void *), void *);
+ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func);
+ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *);
ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, ZEND_STD_HASH_APPLIER, int, ...);