Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13941 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59381 invoked by uid 1010); 23 Nov 2004 22:03:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 58992 invoked from network); 23 Nov 2004 22:03:52 -0000 Received: from unknown (HELO mail.zend.com) (80.74.107.235) by pb1.pair.com with SMTP; 23 Nov 2004 22:03:52 -0000 Received: (qmail 29225 invoked from network); 23 Nov 2004 22:03:50 -0000 Received: from localhost (HELO AndiNotebook.zend.com) (127.0.0.1) by localhost with SMTP; 23 Nov 2004 22:03:50 -0000 Message-ID: <5.1.0.14.2.20041123140325.04aca7c0@localhost> X-Sender: andi@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Tue, 23 Nov 2004 14:03:46 -0800 To: Wojtek Meler ,internals@lists.php.net In-Reply-To: <41A32765.7000105@wp-sa.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] main/main.c - php_module_startup && additional modules From: andi@zend.com (Andi Gutmans) References: <41A32765.7000105@wp-sa.pl> Sounds like a good idea. Can you put a patch together which we can review? Andi At 01:04 PM 11/23/2004 +0100, Wojtek Meler wrote: >Hi ! > >I'm writing my own sapi module and I'd like register 2 additional modules >calling php_module_startup. >I've noticed that it is imposible because > >int php_module_startup(sapi_module_struct *sf, zend_module_entry >*additional_modules, uint num_additional_modules) > >is calling >php_startup_extensions(&additional_modules, num_additional_modules); > >which signature is > >int php_startup_extensions(zend_module_entry **ptr, int count) > >php_startup_extensions expects array of pointers, while php_module_startup >gets array of structures which is not convertable to >array of pointers in such way. It works only when num_additional_modules >equals to 0 or 1. > >how about adding > > zend_module_entry *start_extensions[num_additional_modules]; > for (i=0;i start_extensions[i]=&additional_modules[i]; > >and passing start_extensions instead of &additional_modules to >php_startup_extensions ? >pros: > - works fine, > - no change in method signature >cons: > - you have to build array of structures to pass it to > php_startup_module while it is common to have single pointers to > zend_module_entry structures > >Of course it's better to change php_module_startup interface, while it is >not often used. It would be easier to create array of pointers than copying >structs to single array. Any way something should be done. > >Regards, >Wojtek > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php