cvs: ZendEngine2 / zend_hash.c zend_hash.h
| From: | Marcus Boerger | Date: | Sat, 19 Jul 2003 14:19:05 +0000 |
| Subject: | cvs: ZendEngine2 / zend_hash.c zend_hash.h | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1485@lists.php.net to get a copy of this message | ||
helly Sat Jul 19 10:19:05 2003 EDT
Modified files:
/ZendEngine2 zend_hash.c zend_hash.h
Log:
Add missing function to ease implementations
Index: ZendEngine2/zend_hash.c
diff -u ZendEngine2/zend_hash.c:1.102 ZendEngine2/zend_hash.c:1.103
--- ZendEngine2/zend_hash.c:1.102 Sat Jun 14 07:32:30 2003
+++ ZendEngine2/zend_hash.c Sat Jul 19 10:19:04 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_hash.c,v 1.102 2003/06/14 11:32:30 helly Exp $ */
+/* $Id: zend_hash.c,v 1.103 2003/07/19 14:19:04 helly Exp $ */
#include "zend.h"
@@ -1002,6 +1002,20 @@
*pos = ht->pListTail;
else
ht->pInternalPointer = ht->pListTail;
+}
+
+
+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;
+ }
}
Index: ZendEngine2/zend_hash.h
diff -u ZendEngine2/zend_hash.h:1.67 ZendEngine2/zend_hash.h:1.68
--- ZendEngine2/zend_hash.h:1.67 Tue Jun 10 16:03:25 2003
+++ ZendEngine2/zend_hash.h Sat Jul 19 10:19:04 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_hash.h,v 1.67 2003/06/10 20:03:25 imajes Exp $ */
+/* $Id: zend_hash.h,v 1.68 2003/07/19 14:19:04 helly Exp $ */
#ifndef ZEND_HASH_H
#define ZEND_HASH_H
@@ -164,6 +164,7 @@
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 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) \