php_gmp.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2016 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. | Author: Stanislav Malyshev <stas@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef PHP_GMP_H
  19. #define PHP_GMP_H
  20. #if HAVE_GMP
  21. #include <gmp.h>
  22. extern zend_module_entry gmp_module_entry;
  23. #define phpext_gmp_ptr &gmp_module_entry
  24. ZEND_MODULE_STARTUP_D(gmp);
  25. ZEND_MODULE_DEACTIVATE_D(gmp);
  26. ZEND_MODULE_INFO_D(gmp);
  27. ZEND_FUNCTION(gmp_init);
  28. ZEND_FUNCTION(gmp_import);
  29. ZEND_FUNCTION(gmp_export);
  30. ZEND_FUNCTION(gmp_intval);
  31. ZEND_FUNCTION(gmp_strval);
  32. ZEND_FUNCTION(gmp_add);
  33. ZEND_FUNCTION(gmp_sub);
  34. ZEND_FUNCTION(gmp_mul);
  35. ZEND_FUNCTION(gmp_div_qr);
  36. ZEND_FUNCTION(gmp_div_q);
  37. ZEND_FUNCTION(gmp_div_r);
  38. ZEND_FUNCTION(gmp_mod);
  39. ZEND_FUNCTION(gmp_divexact);
  40. ZEND_FUNCTION(gmp_neg);
  41. ZEND_FUNCTION(gmp_abs);
  42. ZEND_FUNCTION(gmp_fact);
  43. ZEND_FUNCTION(gmp_sqrt);
  44. ZEND_FUNCTION(gmp_sqrtrem);
  45. ZEND_FUNCTION(gmp_root);
  46. ZEND_FUNCTION(gmp_rootrem);
  47. ZEND_FUNCTION(gmp_pow);
  48. ZEND_FUNCTION(gmp_powm);
  49. ZEND_FUNCTION(gmp_perfect_square);
  50. ZEND_FUNCTION(gmp_prob_prime);
  51. ZEND_FUNCTION(gmp_gcd);
  52. ZEND_FUNCTION(gmp_gcdext);
  53. ZEND_FUNCTION(gmp_invert);
  54. ZEND_FUNCTION(gmp_jacobi);
  55. ZEND_FUNCTION(gmp_legendre);
  56. ZEND_FUNCTION(gmp_cmp);
  57. ZEND_FUNCTION(gmp_sign);
  58. ZEND_FUNCTION(gmp_and);
  59. ZEND_FUNCTION(gmp_or);
  60. ZEND_FUNCTION(gmp_com);
  61. ZEND_FUNCTION(gmp_xor);
  62. ZEND_FUNCTION(gmp_random);
  63. ZEND_FUNCTION(gmp_random_bits);
  64. ZEND_FUNCTION(gmp_random_range);
  65. ZEND_FUNCTION(gmp_setbit);
  66. ZEND_FUNCTION(gmp_clrbit);
  67. ZEND_FUNCTION(gmp_scan0);
  68. ZEND_FUNCTION(gmp_scan1);
  69. ZEND_FUNCTION(gmp_testbit);
  70. ZEND_FUNCTION(gmp_popcount);
  71. ZEND_FUNCTION(gmp_hamdist);
  72. ZEND_FUNCTION(gmp_nextprime);
  73. ZEND_BEGIN_MODULE_GLOBALS(gmp)
  74. zend_bool rand_initialized;
  75. gmp_randstate_t rand_state;
  76. ZEND_END_MODULE_GLOBALS(gmp)
  77. #ifdef ZTS
  78. #define GMPG(v) TSRMG(gmp_globals_id, zend_gmp_globals *, v)
  79. #else
  80. #define GMPG(v) (gmp_globals.v)
  81. #endif
  82. #else
  83. #define phpext_gmp_ptr NULL
  84. #endif
  85. #endif /* PHP_GMP_H */
  86. /*
  87. * Local variables:
  88. * tab-width: 4
  89. * c-basic-offset: 4
  90. * End:
  91. */