Hi,

I've got another newbie question. My .ini parser now works correctly when parsing a string (thanks to help of Matt Wilmas). With the same function I want to be able to parse content of a stream. I looked at fgets to see how to read a line from a stream. Unfortunately when I call php_stream_get_line. I get the following error:

/root/php-5.1.6/ext/qconf/qconf_common.c: In function `qconf_readline_stream': /root/php-5.1.6/ext/qconf/qconf_common.c:42: error: `tsrm_ls' undeclared (first use in this function) /root/php-5.1.6/ext/qconf/qconf_common.c:42: error: (Each undeclared identifier is reported only once /root/php-5.1.6/ext/qconf/qconf_common.c:42: error: for each function it appears in.)
make: *** [qconf_common.lo] Error 1

Googling the error returns lot's of websites, be I couldn't make out a real solution.

This is the function:

/**
* Read a line out of a stream.
*/
char *qconf_readline_stream(zval *in, char **c)
{
   char *line;
   php_stream *stream;
   size_t line_len = 0;

   PHP_STREAM_TO_ZVAL(stream, in);
   line = php_stream_get_line(stream, NULL, 0, &line_len);
if (line != NULL) *(line + line_len) = (char)0; /* make the line into a null terminated string to use string functions link sscan */

   return line;
}

Thanks a lot,
Arnold

Reply via email to