php_lcg.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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: Sascha Schumann <sascha@schumann.cx> |
  14. +----------------------------------------------------------------------+
  15. */
  16. #ifndef PHP_LCG_H
  17. #define PHP_LCG_H
  18. #include "ext/standard/basic_functions.h"
  19. typedef struct {
  20. int32_t s1;
  21. int32_t s2;
  22. int seeded;
  23. } php_lcg_globals;
  24. PHPAPI double php_combined_lcg(void);
  25. PHP_MINIT_FUNCTION(lcg);
  26. #ifdef ZTS
  27. #define LCG(v) ZEND_TSRMG(lcg_globals_id, php_lcg_globals *, v)
  28. #else
  29. #define LCG(v) (lcg_globals.v)
  30. #endif
  31. #endif