Date: 08/09/00
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #5916 Updated: error compiling zend-scanner.i"
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #5845 Updated: compile with imap support fails do to c-lient"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I try to include some statistical function module on my php4.
I have gotten C-source codes , compiled and installed
under /usr/local/lib/libRmath.a on my Solaris 2.7 station.
The following is the part of the original C-source(wilcox.c).-
-----------
..
static double ***w;
...
static void
w_init_maybe(int m, int n)
{
int i;
....
if (!w) {
...
w = (double ***) calloc(m+1, sizeof(double **));
if (!w)
MATHLIB_ERROR("wilcox allocation error %d", 1);
...
}
...
double pwilcox(double x, double m, double n, int lower, int log_p)
...
w_init_maybe(m,n)
...
}/* pwilcox */
----------------------------------
I have made necessary files using ext_skel script and modified config.m4
and stat.c files under php4.
This is a part of my stat.c file in question.
----------------------------------
...
function_entry_stat_functions[] = {
PHP_FE(p_wilcox, NULL)
....
PHP_FUNCTION(p_wilcox)
{
zval **x, **m, **n, **lower, **log_p ;
double a, b, c;
int t, p;
double ret_val;
....
convert_to_double_ex(x);
...
convert_to_long_ex(log_p)
a = (*x)->value.lval;
..
p = (*log_p)->value.lval;
ret_val=pwilcox(a,b,c,t,p);
RETURN_DOUBLE(ret_val);
}
#endif /* HAVE_STAT */
------------------------------
On my shell, I tried to test it by tying
>./php -f ext/stat/stat.php
It gave me
--- wilcox allocation error 1 -----------<stat.php>--- .. $x=6.0; .. $retval = p_wilcox(6.0, 3.0, 4.0, 1, 1); echo "pwilcox="; echo "$retval"; ---------------
I do not know how to handle "w" on my stat.c file. I looked into apidoc.txt but due to my shallow c-knowledge, it doesn't help much. Could someone give me a hint to go on ? Thanks.
Jinsoo
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #5916 Updated: error compiling zend-scanner.i"
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #5845 Updated: compile with imap support fails do to c-lient"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

