}
#endif
-typedef struct {
- zval *return_value;
- zend_class_entry *scope;
-} add_info_t;
-
-/* {{{ add_function_info */
-static int add_function_info(zend_function *func, add_info_t *add_info TSRMLS_DC)
-{
- char *name;
- char *decorated;
- zend_class_entry *scope;
- if (func->internal_function.handler != zif_display_disabled_function) {
- /* ?? internal_function->type = ZEND_INTERNAL_FUNCTION; */
- if (func->common.scope)
- scope = func->common.scope;
- else
- scope = add_info->scope;
- if (scope) {
- spprintf(&name, 0, "%s::%s", scope->name, func->common.function_name);
- spprintf(&decorated, 0, "%s%s %s%s::%s()",
-#ifdef ZEND_ACC_FINAL
- func->common.fn_flags & ZEND_ACC_FINAL ? "final " :
-#endif
- (func->common.fn_flags & ZEND_ACC_ABSTRACT ? "abstract " : ""),
- zend_visibility_string(func->common.fn_flags),
- func->common.fn_flags & ZEND_ACC_STATIC ? "static " : "",
- scope->name,
- func->common.function_name);
- } else {
- name = estrdup(func->common.function_name);
- spprintf(&decorated, 0, "%s()", func->common.function_name);
- }
- add_assoc_string(add_info->return_value, name, decorated, 0);
- efree(name);
- }
- return 0;
-}
-/* }}} */
-
-/* {{{ add_class_info */
-static int add_class_info(zend_class_entry **zclass, add_info_t *add_info TSRMLS_DC)
-{
-/* char *f;
- spprintf(&f, 0, "class %s", (*zclass)->name);
- add_next_index_string(return_value, f, 0);*/
- add_info->scope = *zclass;
- zend_hash_apply_with_argument(&(*zclass)->function_table, (apply_func_arg_t)add_function_info, add_info TSRMLS_CC);
- return 0;
-}
-/* }}} */
-
-/* {{{ proto array function_list()
- Returns an array of all php functions */
-PHP_FUNCTION(function_list)
-{
- add_info_t add_info;
-
- if (ZEND_NUM_ARGS()) {
- WRONG_PARAM_COUNT;
- }
-
- if (array_init(return_value) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to initialize array");
- RETURN_FALSE;
- }
-
- add_info.return_value = return_value;
- add_info.scope = NULL;
-
- zend_hash_apply_with_argument(EG(function_table), (apply_func_arg_t)add_function_info, &add_info TSRMLS_CC);
- zend_hash_apply_with_argument(EG(class_table), (apply_func_arg_t)add_class_info, &add_info TSRMLS_CC);
-}
-/* }}} */
-
function_entry basic_functions[] = {
- PHP_FE(function_list, NULL)
PHP_FE(constant, NULL)
PHP_FE(bin2hex, NULL)
PHP_FE(sleep, NULL)