Re: function calling
| From: | Gustavo Badauy | Date: | Fri, 18 Aug 2000 14:08:09 +0000 |
| Subject: | Re: function calling | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-29412@lists.php.net to get a copy of this message | ||
Thomas,
To call functions in your extension, it's just like any other. To get the
parameters, the best example is to create the propotypes and let ext_skel do
the work.
Anyway, here is one example:
PHP_FUNCTION(myfunction)
{
zval **UserName;
zval **Password;
zval **Day
long retval = 0;
long pin = 0;
if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3,
&UserName,&Password,&Day) == FAILURE){
WRONG_PARAM_COUNT;
}
convert_to_string_ex(UserName);
convert_to_string_ex(Email);
convert_to_long_ex(Day);
retval = CreateNewUser (
Z_STRVAL_PP(UserName),
Z_STRVAL_PP(Password),
Z_LVAL_PP(Day))
Hope it helps
----- Original Message -----
From: "Thomas Eisengarten" <eisen@pro-net.de>
To: <php-dev@lists.php.net>
Sent: Friday, August 18, 2000 9:22 AM
Subject: [PHP-DEV] function calling
> is it a way to call a standardfunction (e.g. fsockopen()) from my own
> extension? and how the parameters tranfered, if it possible?! does any
> example exists, where this problem is solved?
> thomas eisengarten
>
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net