Re: ext_skel broken
| From: | Andi Gutmans | Date: | Thu, 05 Oct 2000 19:32:54 +0000 |
| Subject: | Re: ext_skel broken | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-34336@lists.php.net to get a copy of this message | ||
Yes you are right. That structure should be for globals (per-request). The le_stocks and other resource types should not be there. Thanks for pointing that out.
Rasmus, that resource type stuff can go in a comment in the .c file. Check out php_mysql.c or we can leave it out completely.
Andi
At 10:21 PM 10/5/00 +0300, Jouni Ahto wrote:
On Thu, 5 Oct 2000, Andi Gutmans wrote: The fix looks fine. Can't think of something else right now. Andi Didn't I just had a question about a list entry types and whether they should be declared static int or something else? Somehow this one seems (at least for me...) fit better in the static int -category. But Sascha's recommendation in the summer was that it should be the way it's now. -- Jouni At 12:04 PM 10/5/00 -0700, Rasmus Lerdorf wrote:--- Andi Gutmans <andi@zend.com> http://www.zend.com/ext_skel needs to be updated. Looks like a simple enough fix, but just wanted to bounce it off of people. I am getting: stocks.c:29: parse error before `stocks_globals' stocks.c:29: warning: data definition has no type or storage class make[1]: *** [stocks.lo] Error 1 make[1]: Leaving directory `/home/rasmus/php4/ext/stocks' The generated stocks.c has: #include "php.h" #include "php_ini.h" #include "php_stocks.h" #if HAVE_STOCKS--- Andi Gutmans <andi@zend.com> http://www.zend.com/ -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.netZEND_DECLARE_MODULE_GLOBALS(stocks) <== line 29The generated php_stocks.h has: ... typedef struct {/* You can use the next one as type if your module registers any resources. Oh, you can of course rename it to something more suitable, add list entry types or remove it if it not needed. It's just an example. */ int le_stocks;} php_stocks_globals; #ifdef ZTS #define STOCKSG(v) (stocks_globals->v) #define STOCKSLS_FETCH() php_stocks_globals *stocks_globals = ts_resource(stocks_globals_id) #else #define STOCKSG(v) (stocks_globals.v) #define STOCKSLS_FETCH() #endif ... Instead of the typedef it generates it looks like it should be generating: ZEND_BEGIN_MODULE_GLOBALS(stocks)int le_stocks;ZEND_END_MODULE_GLOBALS(stocks) Anything else we need to change? I have been pitching how easy it is to build PHP extensions to people and it is very important to get people writing extensions so we need to be very careful about not breaking the various tools we provide to help people create extensions. -Rasmus -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net