xref: /PHP-8.0/ext/standard/php_array.h (revision e12b9df0)
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    | http://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    | Authors: Andi Gutmans <andi@php.net>                                 |
14    |          Zeev Suraski <zeev@php.net>                                 |
15    |          Rasmus Lerdorf <rasmus@php.net>                             |
16    |          Andrei Zmievski <andrei@php.net>                            |
17    +----------------------------------------------------------------------+
18 */
19 
20 #ifndef PHP_ARRAY_H
21 #define PHP_ARRAY_H
22 
23 PHP_MINIT_FUNCTION(array);
24 PHP_MSHUTDOWN_FUNCTION(array);
25 
26 PHPAPI int php_array_merge(HashTable *dest, HashTable *src);
27 PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src);
28 PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src);
29 PHPAPI int php_multisort_compare(const void *a, const void *b);
30 PHPAPI zend_long php_count_recursive(HashTable *ht);
31 
32 #define PHP_SORT_REGULAR            0
33 #define PHP_SORT_NUMERIC            1
34 #define PHP_SORT_STRING             2
35 #define PHP_SORT_DESC               3
36 #define PHP_SORT_ASC                4
37 #define PHP_SORT_LOCALE_STRING      5
38 #define PHP_SORT_NATURAL            6
39 #define PHP_SORT_FLAG_CASE          8
40 
41 #define COUNT_NORMAL      0
42 #define COUNT_RECURSIVE   1
43 
44 #define ARRAY_FILTER_USE_BOTH	1
45 #define ARRAY_FILTER_USE_KEY	2
46 
47 ZEND_BEGIN_MODULE_GLOBALS(array)
48 	bucket_compare_func_t *multisort_func;
49 	zend_bool compare_deprecation_thrown;
50 ZEND_END_MODULE_GLOBALS(array)
51 
52 #define ARRAYG(v) ZEND_MODULE_GLOBALS_ACCESSOR(array, v)
53 
54 #endif /* PHP_ARRAY_H */
55