On 10/20/02, "Tony Leake" <[EMAIL PROTECTED]> wrote:
> and now I'm trying to write functions that will read and write from the
> pipe. So far I have this, it isn't finished as you will see.
>
> PHP_FUNCTION(pipe_read)
> {
> pipe_r_le_struct *st_pipe_r;
> zval *read;
> zval * res;
> char buf[1024];
>
> if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) ==
> FAILURE) {
> return;
> }
>
> ZEND_FETCH_RESOURCE(st_pipe_r, pipe_r_le_struct *, &res, -1,
> "pipe_r", le_pipe_r);
>
Try using curly brackets:
if (!st_pipe_r) {
RETURN_FALSE;
}
Any I take it you mean this:
read(st_pipe_r->fd, buf, sizeof(buf));
> if(!st_pipe_r) RETURN_FALSE;
>
> read(fd, buf, sizeof(buf));
> }
Aside from that, I can't see any obvious mistakes.
--Wez.
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php