xref: /PHP-8.1/ext/zend_test/php_test.h (revision 8d2df86b)
1 /*
2   +----------------------------------------------------------------------+
3   | Copyright (c) The PHP Group                                          |
4   +----------------------------------------------------------------------+
5   | This source file is subject to version 3.01 of the PHP license,      |
6   | that is bundled with this package in the file LICENSE, and is        |
7   | available through the world-wide-web at the following url:           |
8   | https://www.php.net/license/3_01.txt                                 |
9   | If you did not receive a copy of the PHP license and are unable to   |
10   | obtain it through the world-wide-web, please send a note to          |
11   | license@php.net so we can mail you a copy immediately.               |
12   +----------------------------------------------------------------------+
13   | Author:                                                              |
14   +----------------------------------------------------------------------+
15 */
16 
17 #ifndef PHP_TEST_H
18 #define PHP_TEST_H
19 
20 #include "fiber.h"
21 
22 extern zend_module_entry zend_test_module_entry;
23 #define phpext_zend_test_ptr &zend_test_module_entry
24 
25 #define PHP_ZEND_TEST_VERSION "0.1.0"
26 
27 #ifdef ZTS
28 #include "TSRM.h"
29 #endif
30 
31 #if defined(ZTS) && defined(COMPILE_DL_ZEND_TEST)
32 ZEND_TSRMLS_CACHE_EXTERN()
33 #endif
34 
35 ZEND_BEGIN_MODULE_GLOBALS(zend_test)
36 	int observer_enabled;
37 	int observer_show_output;
38 	int observer_observe_all;
39 	int observer_observe_includes;
40 	int observer_observe_functions;
41 	zend_array *observer_observe_function_names;
42 	int observer_show_return_type;
43 	int observer_show_return_value;
44 	int observer_show_init_backtrace;
45 	int observer_show_opcode;
46 	char *observer_show_opcode_in_user_handler;
47 	int observer_nesting_depth;
48 	int observer_fiber_init;
49 	int observer_fiber_switch;
50 	int observer_fiber_destroy;
51 	int observer_execute_internal;
52 	HashTable global_weakmap;
53 	int replace_zend_execute_ex;
54 	int register_passes;
55 	int observe_opline_in_zendmm;
56 	zend_mm_heap* zend_orig_heap;
57 	zend_mm_heap* zend_test_heap;
58 	zend_test_fiber *active_fiber;
59 ZEND_END_MODULE_GLOBALS(zend_test)
60 
61 extern ZEND_DECLARE_MODULE_GLOBALS(zend_test)
62 
63 #define ZT_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(zend_test, v)
64 
65 struct bug79096 {
66 	uint64_t a;
67 	uint64_t b;
68 };
69 
70 #ifdef PHP_WIN32
71 #	define PHP_ZEND_TEST_API __declspec(dllexport)
72 #elif defined(__GNUC__) && __GNUC__ >= 4
73 #	define PHP_ZEND_TEST_API __attribute__ ((visibility("default")))
74 #else
75 #	define PHP_ZEND_TEST_API
76 #endif
77 
78 PHP_ZEND_TEST_API int ZEND_FASTCALL bug78270(const char *str, size_t str_len);
79 
80 PHP_ZEND_TEST_API struct bug79096 bug79096(void);
81 PHP_ZEND_TEST_API void bug79532(off_t *array, size_t elems);
82 
83 extern PHP_ZEND_TEST_API int *(*bug79177_cb)(void);
84 PHP_ZEND_TEST_API void bug79177(void);
85 
86 #endif
87