Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:1319 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23429 invoked from network); 6 May 2003 16:44:22 -0000 Received: from unknown (HELO ananke.ferschmann.cz) (81.0.234.145) by pb1.pair.com with SMTP; 6 May 2003 16:44:22 -0000 Received: from localhost (localhost [127.0.0.1]) by ananke.ferschmann.cz (Postfix) with ESMTP id 713D45A0A6 for ; Tue, 6 May 2003 18:44:21 +0200 (CEST) Received: from [10.1.0.2] (elara.home.ferschmann.cz [10.1.0.2]) by ananke.ferschmann.cz (Postfix) with ESMTP id E11CF5A0A5 for ; Tue, 6 May 2003 18:44:18 +0200 (CEST) To: internals@lists.php.net Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-IXZIm+8t2a/4VWMyPNeE" Organization: Message-ID: <1052239457.1770.88.camel@elara> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 06 May 2003 18:44:17 +0200 X-Virus-Scanned: by amavisd-new-20030314-p1 (Debian) Subject: [PATCH] Writing ext/ modules in C++ From: petr@ferschmann.cz (Petr Ferschmann) --=-IXZIm+8t2a/4VWMyPNeE Content-Type: multipart/mixed; boundary="=-oZqiV8L+XoKA2Nhd95uC" --=-oZqiV8L+XoKA2Nhd95uC Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello, in attachment there is simple patch which adds BEGIN_EXTERN_C() where needed for writing C++ plugins. Patch is against 4.3.0 but cleanly applies to 4.3.1.=20 I make mistake and it is reverse (so don't forget to add -R). Thanks. --=20 Petr "Fers" Ferschmann -=3D[ petr@ferschmann.cz ]=3D=3D[ http://petr.ferschmann.cz/ ]=3D- -=3D[ Koukni na http://www.postcard.cz/ ]=3D=3D[ +420 604/781 009 ]=3D- GPG Fingerprint: [83B0 6378 7A9D D993 035E 60BD FEEC F665 D2C8 1B9A] --=-oZqiV8L+XoKA2Nhd95uC Content-Disposition: attachment; filename=patch-4.3.0 Content-Type: text/x-patch; name=patch-4.3.0; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable diff -ru php-4.3.0/ext/standard/head.h php-4.3.0.orig/ext/standard/head.h --- php-4.3.0/ext/standard/head.h 2003-03-01 20:03:07.000000000 +0100 +++ php-4.3.0.orig/ext/standard/head.h 2002-02-28 09:26:45.000000000 +0100 @@ -21,8 +21,6 @@ #ifndef HEAD_H #define HEAD_H =20 -BEGIN_EXTERN_C() - extern PHP_RINIT_FUNCTION(head); PHP_FUNCTION(header); PHP_FUNCTION(setcookie); @@ -31,6 +29,4 @@ PHPAPI int php_header(void); PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_= len, time_t expires, char *path, int path_len, char *domain, int domain_len= , int secure TSRMLS_DC); =20 -END_EXTERN_C() - #endif diff -ru php-4.3.0/ext/standard/info.h php-4.3.0.orig/ext/standard/info.h --- php-4.3.0/ext/standard/info.h 2003-02-17 18:46:40.000000000 +0100 +++ php-4.3.0.orig/ext/standard/info.h 2002-10-06 19:04:10.000000000 +0200 @@ -22,8 +22,6 @@ #ifndef INFO_H #define INFO_H =20 -BEGIN_EXTERN_C() - #define PHP_ENTRY_NAME_COLOR "#ccccff" #define PHP_CONTENTS_COLOR "#cccccc" #define PHP_HEADER_COLOR "#9999cc" @@ -82,6 +80,4 @@ =20 void register_phpinfo_constants(INIT_FUNC_ARGS); =20 -END_EXTERN_C() - #endif /* INFO_H */ diff -ru php-4.3.0/ext/standard/php_string.h php-4.3.0.orig/ext/standard/ph= p_string.h --- php-4.3.0/ext/standard/php_string.h 2003-02-17 14:56:47.000000000 +0100 +++ php-4.3.0.orig/ext/standard/php_string.h 2002-10-18 00:44:44.000000000 = +0200 @@ -139,7 +139,7 @@ end -=3D needle_len; =20 while (p <=3D end) { - if ((p =3D (char*) memchr(p, *needle, (end-p+1))) && ne =3D=3D p[needle_= len-1]) { + if ((p =3D memchr(p, *needle, (end-p+1))) && ne =3D=3D p[needle_len-1]) = { if (!memcmp(needle, p, needle_len-1)) { return p; } diff -ru php-4.3.0/main/php_main.h php-4.3.0.orig/main/php_main.h --- php-4.3.0/main/php_main.h 2003-02-17 18:40:32.000000000 +0100 +++ php-4.3.0.orig/main/php_main.h 2002-09-18 23:57:29.000000000 +0200 @@ -28,8 +28,6 @@ #include "php_globals.h" #include "SAPI.h" =20 -BEGIN_EXTERN_C() - PHPAPI int php_request_startup(TSRMLS_D); PHPAPI void php_request_shutdown(void *dummy); PHPAPI void php_request_shutdown_for_exec(void *dummy); @@ -55,6 +53,4 @@ extern int php_init_environ(void); extern int php_shutdown_environ(void); =20 -END_EXTERN_C() - #endif diff -ru php-4.3.0/main/php_variables.h php-4.3.0.orig/main/php_variables.h --- php-4.3.0/main/php_variables.h 2003-02-18 20:46:24.000000000 +0100 +++ php-4.3.0.orig/main/php_variables.h 2002-10-13 10:38:09.000000000 +0200 @@ -30,8 +30,6 @@ #define PARSE_COOKIE 2 #define PARSE_STRING 3 =20 -BEGIN_EXTERN_C() - void php_treat_data(int arg, char *str, zval* destArray TSRMLS_DC); extern PHPAPI void (*php_import_environment_variables)(zval *array_ptr TSR= MLS_DC); PHPAPI void php_register_variable(char *var, char *val, pval *track_vars_a= rray TSRMLS_DC); @@ -39,6 +37,5 @@ PHPAPI void php_register_variable_safe(char *var, char *val, int val_len, = pval *track_vars_array TSRMLS_DC); PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_var= s_array TSRMLS_DC); =20 -END_EXTERN_C() =20 #endif /* PHP_VARIABLES_H */ diff -ru php-4.3.0/main/SAPI.h php-4.3.0.orig/main/SAPI.h --- php-4.3.0/main/SAPI.h 2003-02-17 18:43:40.000000000 +0100 +++ php-4.3.0.orig/main/SAPI.h 2002-11-12 21:56:47.000000000 +0100 @@ -39,8 +39,6 @@ #define SAPI_API #endif =20 -BEGIN_EXTERN_C() - =20 typedef struct { char *header; @@ -257,8 +255,6 @@ =20 #define STANDARD_SAPI_MODULE_PROPERTIES NULL, NULL, 0 =20 -END_EXTERN_C() - #endif /* SAPI_H */ =20 /* --=-oZqiV8L+XoKA2Nhd95uC-- --=-IXZIm+8t2a/4VWMyPNeE Content-Type: application/pgp-signature; name=signature.asc Content-Description: Toto je =?iso-8859-2?Q?digit=E1ln=EC?= =?ISO-8859-1?Q?_podepsan=E1?= =?iso-8859-2?Q?_=E8=E1st?= =?ISO-8859-1?Q?_zpr=E1vy?= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA+t+Zg/uz2ZdLIG5oRAqeVAKCMlndIb4Z56i2z7DZnwizth2j+WwCcCltT ytMwEkBL/1jf9rzqlFpAPwU= =Sj2I -----END PGP SIGNATURE----- --=-IXZIm+8t2a/4VWMyPNeE--