Re: [PHP-DEV] Access raw buffer (for binary data)

2005-11-01 Thread Zeev Suraski
At 10:47 01/11/2005, Rasmus Lerdorf wrote: Derick Rethans wrote: On Tue, 1 Nov 2005, Marco Bambini wrote: Thanks a lot Rasmus, I have just (wrongly) assumed that the convert_to_string function tries to search for the 0 termination character. It doesn't - but, PHP strings always require \0 to

Re: [PHP-DEV] Access raw buffer (for binary data)

2005-11-01 Thread Derick Rethans
On Tue, 1 Nov 2005, Rasmus Lerdorf wrote: > Derick Rethans wrote: > > On Tue, 1 Nov 2005, Marco Bambini wrote: > > > > > Thanks a lot Rasmus, I have just (wrongly) assumed that the > > > convert_to_string > > > function tries to search for the 0 termination character. > > > > It doesn't - but, P

Re: [PHP-DEV] Access raw buffer (for binary data)

2005-11-01 Thread Rasmus Lerdorf
Derick Rethans wrote: On Tue, 1 Nov 2005, Marco Bambini wrote: Thanks a lot Rasmus, I have just (wrongly) assumed that the convert_to_string function tries to search for the 0 termination character. It doesn't - but, PHP strings always require \0 to be the last character so you always need t

Re: [PHP-DEV] Access raw buffer (for binary data)

2005-11-01 Thread Derick Rethans
On Tue, 1 Nov 2005, Marco Bambini wrote: > Thanks a lot Rasmus, I have just (wrongly) assumed that the convert_to_string > function tries to search for the 0 termination character. It doesn't - but, PHP strings always require \0 to be the last character so you always need to allocate one more by

Re: [PHP-DEV] Access raw buffer (for binary data)

2005-10-31 Thread Marco Bambini
Thanks a lot Rasmus, I have just (wrongly) assumed that the convert_to_string function tries to search for the 0 termination character. Thanks, Marco Bambini On Nov 1, 2005, at 1:35 AM, Rasmus Lerdorf wrote: Marco Bambini wrote: I am developing a PHP plugin using PHP 4.4 SDK (not 5) and I

Re: [PHP-DEV] Access raw buffer (for binary data)

2005-10-31 Thread Rasmus Lerdorf
Marco Bambini wrote: I am developing a PHP plugin using PHP 4.4 SDK (not 5) and I need to access a parameter as a raw char * pointer instead of a string or any other C type. Until now to access parameters I am using the zend_get_parameters_ex routine and then the various convert_to_something ro

[PHP-DEV] Access raw buffer (for binary data)

2005-10-31 Thread Marco Bambini
I am developing a PHP plugin using PHP 4.4 SDK (not 5) and I need to access a parameter as a raw char * pointer instead of a string or any other C type. Until now to access parameters I am using the zend_get_parameters_ex routine and then the various convert_to_something routines. I think I