}
/* }}} */
+/* {{{ proto array hash_algos(void)
+Return a list of registered hashing algorithms */
+PHP_FUNCTION(hash_algos)
+{
+ HashPosition pos;
+ char *str;
+ int str_len;
+ long idx, type;
+
+ array_init(return_value);
+ for(zend_hash_internal_pointer_reset_ex(&php_hash_hashtable, &pos);
+ (type = zend_hash_get_current_key_ex(&php_hash_hashtable, &str, &str_len, &idx, 0, &pos)) != HASH_KEY_NON_EXISTANT;
+ zend_hash_move_forward_ex(&php_hash_hashtable, &pos)) {
+ add_next_index_stringl(return_value, str, str_len, 1);
+ }
+}
+/* }}} */
+
/* Module Housekeeping */
static void php_hash_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
*/
PHP_MINFO_FUNCTION(hash)
{
+ HashPosition pos;
char buffer[2048];
char *s = buffer, *e = s + sizeof(buffer), *str;
long idx, type;
- for(zend_hash_internal_pointer_reset(&php_hash_hashtable);
- (type = zend_hash_get_current_key(&php_hash_hashtable, &str, &idx, 0)) != HASH_KEY_NON_EXISTANT;
- zend_hash_move_forward(&php_hash_hashtable)) {
+ for(zend_hash_internal_pointer_reset_ex(&php_hash_hashtable, &pos);
+ (type = zend_hash_get_current_key_ex(&php_hash_hashtable, &str, NULL, &idx, 0, &pos)) != HASH_KEY_NON_EXISTANT;
+ zend_hash_move_forward_ex(&php_hash_hashtable, &pos)) {
s += snprintf(s, e - s, "%s, ", str);
}
PHP_FE(hash_update, NULL)
PHP_FE(hash_final, NULL)
+ PHP_FE(hash_algos, NULL)
+
/* BC Land */
#ifdef PHP_HASH_MD5_NOT_IN_CORE
PHP_NAMED_FE(md5, php_if_md5, NULL)