diff options
author | Marcus Boerger <helly@php.net> | 2003-07-19 14:19:04 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-07-19 14:19:04 +0000 |
commit | 892c1fbbe744680a22285973d7feeeaebc680cfa (patch) | |
tree | b1e5c20a35c105c7daf6dc79e6863186c8835e99 /Zend | |
parent | aad797691b22e2dd3cdef177a8eade8f5f5ce23c (diff) | |
download | php-git-892c1fbbe744680a22285973d7feeeaebc680cfa.tar.gz |
Add missing function to ease implementations
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_hash.c | 14 | ||||
-rw-r--r-- | Zend/zend_hash.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 08ca21ad31..e91ee2bc27 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -1005,6 +1005,20 @@ ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos } +ZEND_API int zend_hash_has_more_elements_ex(HashTable *ht, HashPosition *pos) +{ + HashPosition *current = pos ? pos : &ht->pInternalPointer; + + IS_CONSISTENT(ht); + + if (*current && (*current)->pListNext) { + return SUCCESS; + } else { + return FAILURE; + } +} + + ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos) { HashPosition *current = pos ? pos : &ht->pInternalPointer; diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index e1f0beccea..9aa0315c38 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -164,6 +164,7 @@ ZEND_API int zend_hash_index_exists(HashTable *ht, ulong h); ZEND_API ulong zend_hash_next_free_element(HashTable *ht); /* traversing */ +ZEND_API int zend_hash_has_more_elements_ex(HashTable *ht, HashPosition *pos); ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos); ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos); ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, uint *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos); @@ -172,6 +173,8 @@ ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosi ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos); ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos); +#define zend_hash_has_more_elements(ht) \ + zend_hash_has_more_elements_ex(ht, NULL) #define zend_hash_move_forward(ht) \ zend_hash_move_forward_ex(ht, NULL) #define zend_hash_move_backwards(ht) \ |