xref: /PHP-8.3/ext/zend_test/php_test.h (revision 50ccea31)
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 	int observer_observe_declaring;
42 	zend_array *observer_observe_function_names;
43 	int observer_show_return_type;
44 	int observer_show_return_value;
45 	int observer_show_init_backtrace;
46 	int observer_show_opcode;
47 	char *observer_show_opcode_in_user_handler;
48 	int observer_nesting_depth;
49 	int observer_fiber_init;
50 	int observer_fiber_switch;
51 	int observer_fiber_destroy;
52 	int observer_execute_internal;
53 	HashTable global_weakmap;
54 	int replace_zend_execute_ex;
55 	int register_passes;
56 	bool print_stderr_mshutdown;
57 	zend_long limit_copy_file_range;
58 	int observe_opline_in_zendmm;
59 	zend_mm_heap* zend_orig_heap;
60 	zend_mm_heap* zend_test_heap;
61 	zend_test_fiber *active_fiber;
62 	zend_long quantity_value;
63 	zend_string *str_test;
64 	zend_string *not_empty_str_test;
65 ZEND_END_MODULE_GLOBALS(zend_test)
66 
67 extern ZEND_DECLARE_MODULE_GLOBALS(zend_test)
68 
69 #define ZT_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(zend_test, v)
70 
71 struct bug79096 {
72 	uint64_t a;
73 	uint64_t b;
74 };
75 
76 #ifdef PHP_WIN32
77 #	define PHP_ZEND_TEST_API __declspec(dllexport)
78 #elif defined(__GNUC__) && __GNUC__ >= 4
79 #	define PHP_ZEND_TEST_API __attribute__ ((visibility("default")))
80 #else
81 #	define PHP_ZEND_TEST_API
82 #endif
83 
84 PHP_ZEND_TEST_API int ZEND_FASTCALL bug78270(const char *str, size_t str_len);
85 
86 PHP_ZEND_TEST_API struct bug79096 bug79096(void);
87 PHP_ZEND_TEST_API void bug79532(off_t *array, size_t elems);
88 
89 extern PHP_ZEND_TEST_API int *(*bug79177_cb)(void);
90 PHP_ZEND_TEST_API void bug79177(void);
91 
92 #endif
93