2 * This file is part of the Symfony package.
4 * (c) Fabien Potencier <fabien@symfony.com>
6 * For the full copyright and license information, please view the LICENSE
7 * file that was distributed with this source code.
10 #ifndef PHP_SYMFONY_DEBUG_H
11 #define PHP_SYMFONY_DEBUG_H
13 extern zend_module_entry symfony_debug_module_entry;
14 #define phpext_symfony_debug_ptr &symfony_debug_module_entry
16 #define PHP_SYMFONY_DEBUG_VERSION "2.7"
19 # define PHP_SYMFONY_DEBUG_API __declspec(dllexport)
20 #elif defined(__GNUC__) && __GNUC__ >= 4
21 # define PHP_SYMFONY_DEBUG_API __attribute__ ((visibility("default")))
23 # define PHP_SYMFONY_DEBUG_API
30 ZEND_BEGIN_MODULE_GLOBALS(symfony_debug)
31 intptr_t req_rand_init;
32 void (*old_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
34 ZEND_END_MODULE_GLOBALS(symfony_debug)
36 PHP_MINIT_FUNCTION(symfony_debug);
37 PHP_MSHUTDOWN_FUNCTION(symfony_debug);
38 PHP_RINIT_FUNCTION(symfony_debug);
39 PHP_RSHUTDOWN_FUNCTION(symfony_debug);
40 PHP_MINFO_FUNCTION(symfony_debug);
41 PHP_GINIT_FUNCTION(symfony_debug);
42 PHP_GSHUTDOWN_FUNCTION(symfony_debug);
44 PHP_FUNCTION(symfony_zval_info);
45 PHP_FUNCTION(symfony_debug_backtrace);
47 static char *_symfony_debug_memory_address_hash(void * TSRMLS_DC);
48 static const char *_symfony_debug_zval_type(zval *);
49 static const char* _symfony_debug_get_resource_type(long TSRMLS_DC);
50 static int _symfony_debug_get_resource_refcount(long TSRMLS_DC);
52 void symfony_debug_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
55 #define SYMFONY_DEBUG_G(v) TSRMG(symfony_debug_globals_id, zend_symfony_debug_globals *, v)
57 #define SYMFONY_DEBUG_G(v) (symfony_debug_globals.v)
60 #endif /* PHP_SYMFONY_DEBUG_H */