php_array.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2018 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Authors: Andi Gutmans <andi@php.net> |
  16. | Zeev Suraski <zeev@php.net> |
  17. | Rasmus Lerdorf <rasmus@php.net> |
  18. | Andrei Zmievski <andrei@php.net> |
  19. +----------------------------------------------------------------------+
  20. */
  21. #ifndef PHP_ARRAY_H
  22. #define PHP_ARRAY_H
  23. PHP_MINIT_FUNCTION(array);
  24. PHP_MSHUTDOWN_FUNCTION(array);
  25. PHP_FUNCTION(ksort);
  26. PHP_FUNCTION(krsort);
  27. PHP_FUNCTION(natsort);
  28. PHP_FUNCTION(natcasesort);
  29. PHP_FUNCTION(asort);
  30. PHP_FUNCTION(arsort);
  31. PHP_FUNCTION(sort);
  32. PHP_FUNCTION(rsort);
  33. PHP_FUNCTION(usort);
  34. PHP_FUNCTION(uasort);
  35. PHP_FUNCTION(uksort);
  36. PHP_FUNCTION(array_walk);
  37. PHP_FUNCTION(array_walk_recursive);
  38. PHP_FUNCTION(count);
  39. PHP_FUNCTION(end);
  40. PHP_FUNCTION(prev);
  41. PHP_FUNCTION(next);
  42. PHP_FUNCTION(reset);
  43. PHP_FUNCTION(current);
  44. PHP_FUNCTION(key);
  45. PHP_FUNCTION(min);
  46. PHP_FUNCTION(max);
  47. PHP_FUNCTION(in_array);
  48. PHP_FUNCTION(array_search);
  49. PHP_FUNCTION(extract);
  50. PHP_FUNCTION(compact);
  51. PHP_FUNCTION(array_fill);
  52. PHP_FUNCTION(array_fill_keys);
  53. PHP_FUNCTION(range);
  54. PHP_FUNCTION(shuffle);
  55. PHP_FUNCTION(array_multisort);
  56. PHP_FUNCTION(array_push);
  57. PHP_FUNCTION(array_pop);
  58. PHP_FUNCTION(array_shift);
  59. PHP_FUNCTION(array_unshift);
  60. PHP_FUNCTION(array_splice);
  61. PHP_FUNCTION(array_slice);
  62. PHP_FUNCTION(array_merge);
  63. PHP_FUNCTION(array_merge_recursive);
  64. PHP_FUNCTION(array_replace);
  65. PHP_FUNCTION(array_replace_recursive);
  66. PHP_FUNCTION(array_keys);
  67. PHP_FUNCTION(array_key_first);
  68. PHP_FUNCTION(array_key_last);
  69. PHP_FUNCTION(array_values);
  70. PHP_FUNCTION(array_count_values);
  71. PHP_FUNCTION(array_column);
  72. PHP_FUNCTION(array_reverse);
  73. PHP_FUNCTION(array_reduce);
  74. PHP_FUNCTION(array_pad);
  75. PHP_FUNCTION(array_flip);
  76. PHP_FUNCTION(array_change_key_case);
  77. PHP_FUNCTION(array_rand);
  78. PHP_FUNCTION(array_unique);
  79. PHP_FUNCTION(array_intersect);
  80. PHP_FUNCTION(array_intersect_key);
  81. PHP_FUNCTION(array_intersect_ukey);
  82. PHP_FUNCTION(array_uintersect);
  83. PHP_FUNCTION(array_intersect_assoc);
  84. PHP_FUNCTION(array_uintersect_assoc);
  85. PHP_FUNCTION(array_intersect_uassoc);
  86. PHP_FUNCTION(array_uintersect_uassoc);
  87. PHP_FUNCTION(array_diff);
  88. PHP_FUNCTION(array_diff_key);
  89. PHP_FUNCTION(array_diff_ukey);
  90. PHP_FUNCTION(array_udiff);
  91. PHP_FUNCTION(array_diff_assoc);
  92. PHP_FUNCTION(array_udiff_assoc);
  93. PHP_FUNCTION(array_diff_uassoc);
  94. PHP_FUNCTION(array_udiff_uassoc);
  95. PHP_FUNCTION(array_sum);
  96. PHP_FUNCTION(array_product);
  97. PHP_FUNCTION(array_filter);
  98. PHP_FUNCTION(array_map);
  99. PHP_FUNCTION(array_key_exists);
  100. PHP_FUNCTION(array_chunk);
  101. PHP_FUNCTION(array_combine);
  102. PHPAPI int php_array_merge(HashTable *dest, HashTable *src);
  103. PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src);
  104. PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src);
  105. PHPAPI int php_multisort_compare(const void *a, const void *b);
  106. PHPAPI zend_long php_count_recursive(HashTable *ht);
  107. #define PHP_SORT_REGULAR 0
  108. #define PHP_SORT_NUMERIC 1
  109. #define PHP_SORT_STRING 2
  110. #define PHP_SORT_DESC 3
  111. #define PHP_SORT_ASC 4
  112. #define PHP_SORT_LOCALE_STRING 5
  113. #define PHP_SORT_NATURAL 6
  114. #define PHP_SORT_FLAG_CASE 8
  115. #define COUNT_NORMAL 0
  116. #define COUNT_RECURSIVE 1
  117. #define ARRAY_FILTER_USE_BOTH 1
  118. #define ARRAY_FILTER_USE_KEY 2
  119. ZEND_BEGIN_MODULE_GLOBALS(array)
  120. compare_func_t *multisort_func;
  121. ZEND_END_MODULE_GLOBALS(array)
  122. #define ARRAYG(v) ZEND_MODULE_GLOBALS_ACCESSOR(array, v)
  123. #endif /* PHP_ARRAY_H */