Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:26488 php.internals:26489 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10352 invoked by uid 1010); 10 Nov 2006 20:37:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10337 invoked from network); 10 Nov 2006 20:37:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2006 20:37:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 62.245.163.219 cause and error) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 62.245.163.219 ppp-62-245-163-219.dynamic.mnet-online.de Linux 2.6 Received: from [62.245.163.219] ([62.245.163.219:43240] helo=johannes.nop) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1D/7A-27611-403E4554 for ; Fri, 10 Nov 2006 15:37:29 -0500 Received: from johannes.nop (localhost [127.0.0.1]) by johannes.nop (8.13.8/8.13.8) with ESMTP id kAAKZlje013899; Fri, 10 Nov 2006 21:36:14 +0100 Received: (from johannes@localhost) by johannes.nop (8.13.8/8.13.8/Submit) id kAAKZURj013898; Fri, 10 Nov 2006 21:35:30 +0100 X-Authentication-Warning: johannes.nop: johannes set sender to johannes@php.net using -f To: Arnold Daniels Cc: internals@lists.php.net In-Reply-To: <4554DB25.4010701@adaniels.nl> References: <4554DB25.4010701@adaniels.nl> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Fri, 10 Nov 2006 21:35:29 +0100 Message-ID: <1163190929.1701.182.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1.1 (2.8.1.1-3.fc6) Subject: Re: [PHP-DEV] newbie question nr 2: compile error when using php_stream_get_line From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, errors complaining about something related to tsrm_ls mean that you're building a thread-safe PHP and forgot some TSRMLS[_...] macros. See for example http://blog.libssh2.org/index.php?/archives/22-What-the-heck-is-TSRMLS_CC-anyway.html for more about these macros. This should help you, but the book from Sara, mentioned in that article, is really worth buying (and being read) if you tend to do some more PHP extending stuff. johannes On Fri, 2006-11-10 at 21:03 +0100, Arnold Daniels wrote: > 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 >