Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41682 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57766 invoked from network); 5 Nov 2008 12:50:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2008 12:50:04 -0000 Authentication-Results: pb1.pair.com header.from=Johannes.Schlueter@Sun.COM; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 192.18.6.24 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 192.18.6.24 gmp-eb-inf-2.sun.com Solaris 10 (beta) Received: from [192.18.6.24] ([192.18.6.24:57301] helo=gmp-eb-inf-2.sun.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 70/43-50953-87691194 for ; Wed, 05 Nov 2008 07:50:03 -0500 Received: from fe-emea-09.sun.com (gmp-eb-lb-1-fe3.eu.sun.com [192.18.6.10]) by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id mA5Cnvju021751 for ; Wed, 5 Nov 2008 12:49:57 GMT Received: from conversion-daemon.fe-emea-09.sun.com by fe-emea-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0K9V001011XG1800@fe-emea-09.sun.com> (original mail from johannes@php.net) for internals@lists.php.net; Wed, 05 Nov 2008 12:49:57 +0000 (GMT) Received: from [192.168.1.103] ([62.216.212.218]) by fe-emea-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0K9V003102AX81F0@fe-emea-09.sun.com>; Wed, 05 Nov 2008 12:49:49 +0000 (GMT) Date: Wed, 05 Nov 2008 13:49:44 +0100 In-reply-to: Sender: Johannes.Schlueter@Sun.COM To: =?UTF-8?Q?=E5=BC=A0=E5=BF=83=E7=81=B5?= Cc: internals@lists.php.net Message-ID: <1225889384.4251.13.camel@goldfinger.johannes.nop> MIME-version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 8BIT References: Subject: Re: [PHP-DEV] why these code cause compile error? From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Wed, 2008-11-05 at 17:07 +0800, 张心灵 wrote: > I 'am a new guy of php internal, I tried to define a class in extension > just for a attempt. > > PHP_MINIT_FUNCTION(zhangjianyu) > { > /* If you have INI entries, uncomment these lines > REGISTER_INI_ENTRIES(); > */ > zend_class_entry ce; > INIT_CLASS_ENTRY(ce, WPS_CLASS_NAME, php_wps_method_functions); > php_wps_sc_entry = zend_register_internal_class(&ce TSRMLS_CC); > zend_declare_class_constant_double(php_wps_sc_entry, "VERSION", > sizeof("VERSION"), 1.32 TSRMLS_DC); > zend_declare_class_constant_string(php_wps_sc_entry, "NAME", > sizeof("NAME"), "say say" TSRMLS_DC); TSRMLS_DC = declaration with comma you need TSRMLS_CC = call with comma Sara has a nice blog article about them (blog.libssh2.org or something, ...) johannes