Date: 10/05/00
- Next message: mranner <email protected>: "[PHP-DEV] PHP 4.0 Bug #7053: after second include() or require() of the same file php does not set __FILE__"
- Previous message: Jouni Ahto: "Re: [PHP-DEV] ext_skel broken"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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:
> > >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
> > >
> > >ZEND_DECLARE_MODULE_GLOBALS(stocks) <== line 29
> > >
> > >
> > >The 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 <email protected>
> > >For additional commands, e-mail: php-dev-help <email protected>
> > >To contact the list administrators, e-mail: php-list-admin <email protected>
> >
> > ---
> > Andi Gutmans <andi <email protected>>
> > http://www.zend.com/
> >
> > --
> > PHP Development Mailing List <http://www.php.net/>
> > To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
> > For additional commands, e-mail: php-dev-help <email protected>
> > To contact the list administrators, e-mail: php-list-admin <email protected>
> >
--- Andi Gutmans <andi <email protected>> http://www.zend.com/-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: mranner <email protected>: "[PHP-DEV] PHP 4.0 Bug #7053: after second include() or require() of the same file php does not set __FILE__"
- Previous message: Jouni Ahto: "Re: [PHP-DEV] ext_skel broken"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

