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