summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSara Golemon <pollita@php.net>2009-05-25 01:16:19 +0000
committerSara Golemon <pollita@php.net>2009-05-25 01:16:19 +0000
commit5ae1723c7eea0cf2451d1022dbf02146264c6481 (patch)
tree8c30022022699ccc3e5c77738463cf8af9431729
parentce8cc1c99d0538995f8c633c0231cdf73f967144 (diff)
downloadphp-git-5ae1723c7eea0cf2451d1022dbf02146264c6481.tar.gz
Expand zend_(u_)symtable_update_current_key to allow specifying HashPosition
-rw-r--r--Zend/zend_hash.c14
-rw-r--r--Zend/zend_hash.h8
2 files changed, 13 insertions, 9 deletions
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index 3cb666fd0f..0060779c17 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -1976,18 +1976,18 @@ ZEND_API int zend_u_symtable_exists(HashTable *ht, zend_uchar type, zstr arKey,
}
/* }}} */
-ZEND_API int zend_u_symtable_update_current_key(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, int mode) /* {{{ */
+ZEND_API int zend_u_symtable_update_current_key_ex(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, int mode, HashPosition *pos) /* {{{ */
{
zend_uchar key_type;
if (type == IS_STRING) {
key_type = HASH_KEY_IS_STRING;
- ZEND_HANDLE_NUMERIC(arKey.s, nKeyLength, zend_hash_update_current_key_ex(ht, HASH_KEY_IS_LONG, NULL_ZSTR, 0, idx, mode, NULL));
+ ZEND_HANDLE_NUMERIC(arKey.s, nKeyLength, zend_hash_update_current_key_ex(ht, HASH_KEY_IS_LONG, NULL_ZSTR, 0, idx, mode, pos));
} else {
key_type = HASH_KEY_IS_UNICODE;
- ZEND_HANDLE_U_NUMERIC(arKey.u, nKeyLength, zend_hash_update_current_key_ex(ht, HASH_KEY_IS_LONG, NULL_ZSTR, 0, idx, mode, NULL));
+ ZEND_HANDLE_U_NUMERIC(arKey.u, nKeyLength, zend_hash_update_current_key_ex(ht, HASH_KEY_IS_LONG, NULL_ZSTR, 0, idx, mode, pos));
}
- return zend_hash_update_current_key_ex(ht, key_type, arKey, nKeyLength, 0, mode, NULL);
+ return zend_hash_update_current_key_ex(ht, key_type, arKey, nKeyLength, 0, mode, pos);
}
/* }}} */
@@ -2019,10 +2019,10 @@ ZEND_API int zend_symtable_exists(HashTable *ht, const char *arKey, uint nKeyLen
}
/* }}} */
-ZEND_API int zend_symtable_update_current_key(HashTable *ht, const char *arKey, uint nKeyLength, int mode) /* {{{ */
+ZEND_API int zend_symtable_update_current_key_ex(HashTable *ht, const char *arKey, uint nKeyLength, int mode, HashPosition *pos) /* {{{ */
{
- ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_update_current_key_ex(ht, HASH_KEY_IS_LONG, NULL_ZSTR, 0, idx, mode, NULL));
- return zend_hash_update_current_key_ex(ht, HASH_KEY_IS_STRING, ZSTR(arKey), nKeyLength, 0, mode, NULL);
+ ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_update_current_key_ex(ht, HASH_KEY_IS_LONG, NULL_ZSTR, 0, idx, mode, pos));
+ return zend_hash_update_current_key_ex(ht, HASH_KEY_IS_STRING, ZSTR(arKey), nKeyLength, 0, mode, pos);
}
/* }}} */
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index 5e2b434e50..bc3dd8227b 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -374,7 +374,9 @@ ZEND_API int zend_symtable_update(HashTable *ht, const char *arKey, uint nKeyLen
ZEND_API int zend_symtable_del(HashTable *ht, const char *arKey, uint nKeyLength);
ZEND_API int zend_symtable_find(HashTable *ht, const char *arKey, uint nKeyLength, void **pData);
ZEND_API int zend_symtable_exists(HashTable *ht, const char *arKey, uint nKeyLength);
-ZEND_API int zend_symtable_update_current_key(HashTable *ht, const char *arKey, uint nKeyLength, int mode);
+ZEND_API int zend_symtable_update_current_key_ex(HashTable *ht, const char *arKey, uint nKeyLength, int mode, HashPosition *pos);
+#define zend_symtable_update_current_key(ht,arKey,nKeyLength,mode) \
+ zend_symtable_update_current_key_ex(ht, arKey, nKeyLength, mode, NULL)
ZEND_API int zend_ascii_symtable_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest);
ZEND_API int zend_ascii_symtable_del(HashTable *ht, const char *arKey, uint nKeyLength);
@@ -395,7 +397,9 @@ ZEND_API int zend_u_symtable_update(HashTable *ht, zend_uchar type, zstr arKey,
ZEND_API int zend_u_symtable_del(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength);
ZEND_API int zend_u_symtable_find(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, void **pData);
ZEND_API int zend_u_symtable_exists(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength);
-ZEND_API int zend_u_symtable_update_current_key(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, int mode);
+ZEND_API int zend_u_symtable_update_current_key_ex(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, int mode, HashPosition *pos);
+#define zend_u_symtable_update_current_key(ht,type,arKey,nKeyLength,mode) \
+ zend_u_symtable_update_current_key_ex(ht, type, arKey, nKeyLength, mode, NULL)
/* {{{ ZEND_HANDLE_*_NUMERIC macros */
#define ZEND_HANDLE_NUMERIC(key, length, func) do { \