cvs: pecl /stats config.m4 php_statistics.h statistics.c
| From: | Andrey Hristov | Date: | Fri, 09 Jan 2004 19:22:36 +0000 |
| Subject: | cvs: pecl /stats config.m4 php_statistics.h statistics.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-721@lists.php.net to get a copy of this message | ||
andrey Fri Jan 9 14:22:36 2004 EDT
Modified files:
/pecl/stats php_statistics.h statistics.c config.m4
Log:
statistics -> stats
lgamma() is not available on windows, for now the functions that use this
functions will return false.
Index: pecl/stats/php_statistics.h
diff -u pecl/stats/php_statistics.h:1.3 pecl/stats/php_statistics.h:1.4
--- pecl/stats/php_statistics.h:1.3 Fri Jan 9 13:58:32 2004
+++ pecl/stats/php_statistics.h Fri Jan 9 14:22:36 2004
@@ -16,22 +16,22 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_statistics.h,v 1.3 2004/01/09 18:58:32 andrey Exp $ */
+/* $Id: php_statistics.h,v 1.4 2004/01/09 19:22:36 andrey Exp $ */
#ifndef PHP_STATISTICS_H
#define PHP_STATISTICS_H
-extern zend_module_entry statistics_module_entry;
-#define phpext_statistics_ptr &statistics_module_entry
+extern zend_module_entry stats_module_entry;
+#define phpext_stats_ptr &stats_module_entry
#ifdef PHP_WIN32
-#define PHP_STATISTICS_API __declspec(dllexport)
+#define PHP_STATS_API __declspec(dllexport)
#else
-#define PHP_STATISTICS_API
+#define PHP_STATS_API
#endif
-PHP_MINFO_FUNCTION(statistics);
+PHP_MINFO_FUNCTION(stats);
PHP_FUNCTION(stats_bin_counts);
PHP_FUNCTION(stats_cdf_t);
@@ -99,13 +99,13 @@
#ifdef ZTS
-#define STATISTICS_D zend_statistics_globals *statistics_globals
-#define STATISTICS_G(v) (statistics_globals->v)
-#define STATISTICS_FETCH() zend_statistics_globals *statistics_globals =
ts_resource(statistics_globals_id)
+#define STATS_D zend_stats_globals *stats_globals
+#define STATS_G(v) (stats_globals->v)
+#define STATS_FETCH() zend_stats_globals *stats_globals = ts_resource(stats_globals_id)
#else
-#define STATISTICS_D
-#define STATISTICS_G(v) (statistics_globals.v)
-#define STATISTICS_FETCH()
+#define STATS_D
+#define STATS_G(v) (stats_globals.v)
+#define STATS_FETCH()
#endif
#endif /* PHP_STATISTICS_H */
Index: pecl/stats/statistics.c
diff -u pecl/stats/statistics.c:1.2 pecl/stats/statistics.c:1.3
--- pecl/stats/statistics.c:1.2 Fri Jan 9 13:58:32 2004
+++ pecl/stats/statistics.c Fri Jan 9 14:22:36 2004
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: statistics.c,v 1.2 2004/01/09 18:58:32 andrey Exp $ */
+/* $Id: statistics.c,v 1.3 2004/01/09 19:22:36 andrey Exp $ */
#ifdef HAVE_CONFIG_H
@@ -115,23 +115,23 @@
zend_module_entry statistics_module_entry = {
STANDARD_MODULE_HEADER,
- "statistics",
+ "stats",
statistics_functions,
NULL,
NULL,
NULL,
NULL,
- PHP_MINFO(statistics),
+ PHP_MINFO(stats),
"0.4",
STANDARD_MODULE_PROPERTIES,
};
#ifdef COMPILE_DL_STATISTICS
-ZEND_GET_MODULE(statistics)
+ZEND_GET_MODULE(stats)
#endif
-PHP_MINFO_FUNCTION(statistics)
+PHP_MINFO_FUNCTION(stats)
{
php_info_print_table_start();
php_info_print_table_row(2, "Statistics Support", "enabled");
@@ -2730,6 +2730,7 @@
Not documented */
PHP_FUNCTION(stats_dens_beta)
{
+#ifndef PHP_WIN32
double a;
double b;
double beta;
@@ -2746,6 +2747,9 @@
y = beta * pow(x, a - 1.0) * pow(1.0 - x, b - 1.0);
RETURN_DOUBLE(y);
+#endif
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is not currently supported on the
Win32 platform");
+ RETURN_FALSE;
}
/* }}} */
@@ -2808,6 +2812,7 @@
Not documented */
PHP_FUNCTION(stats_dens_chisquare)
{
+#ifndef PHP_WIN32
double dfr;
double e;
double x;
@@ -2824,6 +2829,10 @@
y = exp (z);
RETURN_DOUBLE(y);
+
+#endif
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is not currently supported on the
Win32 platform");
+ RETURN_FALSE;
}
/* }}} */
@@ -2831,6 +2840,7 @@
Not documented */
PHP_FUNCTION(stats_dens_t)
{
+#ifndef PHP_WIN32
double dfr;
double e;
double f;
@@ -2857,6 +2867,10 @@
fac3 = lgamma(e) + 0.5 * log(dfr * STATS_PI);
RETURN_DOUBLE(exp( fac1 - (fac2 + fac3) ));
+
+#endif
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is not currently supported on the
Win32 platform");
+ RETURN_FALSE;
}
/* }}} */
@@ -2864,6 +2878,7 @@
Not documented */
PHP_FUNCTION(stats_dens_gamma)
{
+#ifndef PHP_WIN32
double shape;
double scale;
double x;
@@ -2885,6 +2900,9 @@
;
RETURN_DOUBLE(exp(z));
+#endif
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is not currently supported on the
Win32 platform");
+ RETURN_FALSE;
}
/* }}} */
@@ -2919,6 +2937,7 @@
*/
PHP_FUNCTION(stats_dens_f)
{
+#ifndef PHP_WIN32
double dfr1;
double dfr2;
double efr1;
@@ -2944,6 +2963,9 @@
z = (fac1 + fac3) - (fac2 + fac4);
RETURN_DOUBLE(exp(z));
+#endif
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is not currently supported on the
Win32 platform");
+ RETURN_FALSE;
}
/* }}} */
@@ -2992,6 +3014,7 @@
Not documented */
PHP_FUNCTION(stats_dens_pmf_poisson)
{
+#ifndef PHP_WIN32
double lb;
double z;
double x;
@@ -3003,6 +3026,9 @@
z = (x * log(lb)) - (lb + lgamma(x + 1.0));
RETURN_DOUBLE(exp(z));
+#endif
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is not currently supported on the
Win32 platform");
+ RETURN_FALSE;
}
/* }}} */
Index: pecl/stats/config.m4
diff -u pecl/stats/config.m4:1.1 pecl/stats/config.m4:1.2
--- pecl/stats/config.m4:1.1 Fri Jan 9 13:23:51 2004
+++ pecl/stats/config.m4 Fri Jan 9 14:22:36 2004
@@ -1,9 +1,9 @@
-dnl $Id: config.m4,v 1.1 2004/01/09 18:23:51 andrey Exp $
+dnl $Id: config.m4,v 1.2 2004/01/09 19:22:36 andrey Exp $
dnl config.m4 for extension stats
PHP_ARG_ENABLE(stats, whether to enable stats support,
[ --enable-stats Enable statistics support])
if test "$PHP_STATS" != "no"; then
- PHP_NEW_EXTENSION(statistics, statistics.c com.c dcdflib.c ipmpar.c linpack.c randlib.c ,
$ext_shared)
+ PHP_NEW_EXTENSION(stats, statistics.c com.c dcdflib.c ipmpar.c linpack.c randlib.c , $ext_shared)
fi