1999-10-06 16:34:36 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2001-12-11 15:32:16 +00:00
|
|
|
| PHP Version 4 |
|
1999-10-06 16:34:36 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2001-12-11 15:32:16 +00:00
|
|
|
| Copyright (c) 1997-2002 The PHP Group |
|
1999-10-06 16:34:36 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2000-05-18 15:34:45 +00:00
|
|
|
| This source file is subject to version 2.02 of the PHP license, |
|
1999-10-06 16:34:36 +00:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
|
|
| available at through the world-wide-web at |
|
2000-05-18 15:34:45 +00:00
|
|
|
| http://www.php.net/license/2_02.txt. |
|
1999-10-06 16:34:36 +00:00
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
|
|
|
+----------------------------------------------------------------------+
|
2002-02-28 08:29:35 +00:00
|
|
|
| Authors: Rasmus Lerdorf <rasmus@php.net> |
|
1999-10-06 16:34:36 +00:00
|
|
|
| Zeev Suraski <zeev@zend.com> |
|
|
|
|
| Pedro Melo <melo@ip.pt> |
|
2001-09-16 20:49:57 +00:00
|
|
|
| Sterling Hughes <sterling@php.net> |
|
1999-10-06 16:34:36 +00:00
|
|
|
| |
|
|
|
|
| Based on code from: Shawn Cokus <Cokus@math.washington.edu> |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
/* $Id$ */
|
|
|
|
|
2000-07-02 23:46:51 +00:00
|
|
|
#ifndef PHP_RAND_H
|
|
|
|
#define PHP_RAND_H
|
1999-10-06 16:34:36 +00:00
|
|
|
|
2000-04-22 15:44:35 +00:00
|
|
|
#include <stdlib.h>
|
2001-09-09 10:44:12 +00:00
|
|
|
#include "basic_functions.h"
|
2000-04-22 15:44:35 +00:00
|
|
|
|
2001-09-09 10:44:12 +00:00
|
|
|
/* System Rand functions */
|
2001-09-05 19:47:55 +00:00
|
|
|
#ifndef RAND_MAX
|
|
|
|
#define RAND_MAX (1<<15)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAVE_LRAND48
|
|
|
|
#define PHP_RAND_MAX 2147483647
|
|
|
|
#else
|
|
|
|
#define PHP_RAND_MAX RAND_MAX
|
|
|
|
#endif
|
|
|
|
|
2001-09-09 10:44:12 +00:00
|
|
|
/* MT Rand */
|
2001-09-16 20:49:57 +00:00
|
|
|
#define PHP_MT_RAND_MAX ((long) (0x7FFFFFFF)) /* (1<<31) - 1 */
|
2001-09-09 10:44:12 +00:00
|
|
|
|
2001-09-16 20:49:57 +00:00
|
|
|
PHPAPI void php_srand(long seed TSRMLS_DC);
|
|
|
|
PHPAPI long php_rand(TSRMLS_D);
|
2001-09-09 10:44:12 +00:00
|
|
|
PHPAPI void php_mt_srand(php_uint32 seed TSRMLS_DC);
|
|
|
|
PHPAPI php_uint32 php_mt_rand(TSRMLS_D);
|
|
|
|
|
2000-07-02 23:46:51 +00:00
|
|
|
#endif /* PHP_RAND_H */
|