Skip to content

Commit

Permalink
Avoid TSRMLS_FETCH()'s, and clean up a bit of stale extern's and layo…
Browse files Browse the repository at this point in the history
…ut on the way
  • Loading branch information
zsuraski committed Jul 30, 2001
1 parent b577038 commit 1c25b8d
Show file tree
Hide file tree
Showing 72 changed files with 211 additions and 223 deletions.
4 changes: 2 additions & 2 deletions ext/aspell/php_aspell.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
extern zend_module_entry aspell_module_entry;
#define aspell_module_ptr &aspell_module_entry

extern PHP_MINIT_FUNCTION(aspell);
extern PHP_MINFO_FUNCTION(aspell);
PHP_MINIT_FUNCTION(aspell);
PHP_MINFO_FUNCTION(aspell);

PHP_FUNCTION(aspell_new);
PHP_FUNCTION(aspell_check);
Expand Down
6 changes: 4 additions & 2 deletions ext/com/COM.c
Original file line number Diff line number Diff line change
Expand Up @@ -1686,14 +1686,16 @@ PHP_FUNCTION(com_isenum)
}
/* }}} */

void php_register_COM_class()
void php_register_COM_class(void)
{
TSRMLS_FETCH();

INIT_OVERLOADED_CLASS_ENTRY(com_class_entry, "COM", NULL,
php_COM_call_function_handler,
php_COM_get_property_handler,
php_COM_set_property_handler);

zend_register_internal_class(&com_class_entry);
zend_register_internal_class(&com_class_entry TSRMLS_CC);
}

PHP_MINIT_FUNCTION(COM)
Expand Down
6 changes: 4 additions & 2 deletions ext/com/VARIANT.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,16 @@ static void php_variant_destructor(zend_rsrc_list_entry *rsrc)
efree(rsrc);
}

void php_register_VARIANT_class()
void php_register_VARIANT_class(void)
{
TSRMLS_FETCH();

INIT_OVERLOADED_CLASS_ENTRY(VARIANT_class_entry, "VARIANT", NULL,
php_VARIANT_call_function_handler,
php_VARIANT_get_property_handler,
php_VARIANT_set_property_handler);

zend_register_internal_class(&VARIANT_class_entry);
zend_register_internal_class(&VARIANT_class_entry TSRMLS_CC);
}

#endif /* PHP_WIN32 */
30 changes: 15 additions & 15 deletions ext/com/php_COM.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@

BEGIN_EXTERN_C()

extern PHP_MINIT_FUNCTION(COM);
extern PHP_MSHUTDOWN_FUNCTION(COM);
PHP_MINIT_FUNCTION(COM);
PHP_MSHUTDOWN_FUNCTION(COM);

extern PHPAPI HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult);
extern PHPAPI HRESULT php_COM_get_ids_of_names(comval *obj, OLECHAR FAR* FAR* rgszNames, DISPID FAR* rgDispId);
extern PHPAPI HRESULT php_COM_release(comval *obj);
extern PHPAPI HRESULT php_COM_addref(comval *obj);
extern PHPAPI HRESULT php_COM_set(comval *obj, IDispatch FAR* pDisp, int cleanup);
extern PHPAPI HRESULT php_COM_clone(comval *obj, comval *clone, int cleanup);
PHPAPI HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult);
PHPAPI HRESULT php_COM_get_ids_of_names(comval *obj, OLECHAR FAR* FAR* rgszNames, DISPID FAR* rgDispId);
PHPAPI HRESULT php_COM_release(comval *obj);
PHPAPI HRESULT php_COM_addref(comval *obj);
PHPAPI HRESULT php_COM_set(comval *obj, IDispatch FAR* pDisp, int cleanup);
PHPAPI HRESULT php_COM_clone(comval *obj, comval *clone, int cleanup);

extern int php_COM_get_le_comval();
int php_COM_get_le_comval();

extern zend_module_entry COM_module_entry;
extern zend_class_entry com_class_entry;
zend_module_entry COM_module_entry;
zend_class_entry com_class_entry;

extern pval php_COM_get_property_handler(zend_property_reference *property_reference);
extern int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value);
extern char *php_COM_error_message(HRESULT hr);
extern void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference);
pval php_COM_get_property_handler(zend_property_reference *property_reference);
int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value);
char *php_COM_error_message(HRESULT hr);
void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference);

#ifdef DEBUG
extern int resourcecounter;
Expand Down
4 changes: 2 additions & 2 deletions ext/com/php_VARIANT.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

extern int php_VARIANT_get_le_variant();

extern PHP_MINIT_FUNCTION(VARIANT);
extern PHP_MSHUTDOWN_FUNCTION(VARIANT);
PHP_MINIT_FUNCTION(VARIANT);
PHP_MSHUTDOWN_FUNCTION(VARIANT);

extern zend_module_entry VARIANT_module_entry;

Expand Down
8 changes: 4 additions & 4 deletions ext/cpdf/php_cpdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
extern zend_module_entry cpdf_module_entry;
#define cpdf_module_ptr &cpdf_module_entry

extern PHP_MINFO_FUNCTION(cpdf);
extern PHP_MINIT_FUNCTION(cpdf);
extern PHP_RINIT_FUNCTION(cpdf);
extern PHP_MSHUTDOWN_FUNCTION(cpdf);
PHP_MINFO_FUNCTION(cpdf);
PHP_MINIT_FUNCTION(cpdf);
PHP_RINIT_FUNCTION(cpdf);
PHP_MSHUTDOWN_FUNCTION(cpdf);
PHP_FUNCTION(cpdf_global_set_document_limits);
PHP_FUNCTION(cpdf_set_creator);
PHP_FUNCTION(cpdf_set_title);
Expand Down
2 changes: 1 addition & 1 deletion ext/dbase/php_dbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
extern zend_module_entry dbase_module_entry;
#define dbase_module_ptr &dbase_module_entry

extern PHP_MINIT_FUNCTION(dbase);
PHP_MINIT_FUNCTION(dbase);
PHP_FUNCTION(dbase_open);
PHP_FUNCTION(dbase_create);
PHP_FUNCTION(dbase_close);
Expand Down
4 changes: 0 additions & 4 deletions ext/dbplus/dbplus.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ PHP_INI_END()

PHP_MINIT_FUNCTION(dbplus)
{
/* Remove comments if you have entries in php.ini
REGISTER_INI_ENTRIES();
*/

/* resource id for cdb connections */
le_dbplus_relation = zend_register_list_destructors_ex(dbplus_destruct_relation, NULL, "dbplus_relation", module_number);
le_dbplus_tupel = zend_register_list_destructors_ex(dbplus_destruct_tupel , NULL, "dbplus_tuple" , module_number);
Expand Down
3 changes: 3 additions & 0 deletions ext/dbx/dbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,11 @@ ZEND_FUNCTION(dbx_query)
zend_hash_index_find((*inforow_ptr)->value.ht, col_index, (void **) &columnname_ptr);
zend_hash_index_find((*row_ptr)->value.ht, col_index, (void **) &actual_ptr);
(*actual_ptr)->refcount+=1;

(*actual_ptr)->is_ref=1;

zend_hash_update((*row_ptr)->value.ht, (*columnname_ptr)->value.str.val, (*columnname_ptr)->value.str.len + 1, actual_ptr, sizeof(zval *), NULL);

}
}
++row_count;
Expand Down
33 changes: 17 additions & 16 deletions ext/domxml/php_domxml.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ PHP_RINIT_FUNCTION(domxml)
PHP_MINIT_FUNCTION(domxml)
{
zend_class_entry ce;

le_domxmldocp = zend_register_list_destructors_ex(php_free_xml_doc, NULL, "domdocument", module_number);
/* Freeing the document contains freeing the complete tree.
Therefore nodes, attributes etc. may not be freed seperately.
Expand All @@ -736,53 +737,53 @@ PHP_MINIT_FUNCTION(domxml)
/* le_domxmlnsp = register_list_destructors(NULL, NULL); */

INIT_OVERLOADED_CLASS_ENTRY(ce, "DomNode", php_domxmlnode_class_functions, NULL, NULL, NULL);
domxmlnode_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL);
domxmlnode_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "DomDocument", php_domxmldoc_class_functions, NULL, NULL, NULL);
domxmldoc_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL);
domxmldoc_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "DomDocumentType", php_domxmldoctype_class_functions, NULL, NULL, NULL);
domxmldoctype_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL);
domxmldoctype_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "Dtd", php_domxmldtd_class_functions, NULL, NULL, NULL);
domxmldtd_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL);
domxmldtd_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "DomElement", php_domxmlelement_class_functions, NULL, NULL, NULL);
domxmlelement_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL);
domxmlelement_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "DomAttribute", php_domxmlattr_class_functions, NULL, NULL, NULL);
domxmlattr_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL);
domxmlattr_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "DomCData", php_domxmlcdata_class_functions, NULL, NULL, NULL);
domxmlcdata_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL);
domxmlcdata_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "DomText", php_domxmltext_class_functions, NULL, NULL, NULL);
domxmltext_class_entry = zend_register_internal_class_ex(&ce, domxmlcdata_class_entry, NULL);
domxmltext_class_entry = zend_register_internal_class_ex(&ce, domxmlcdata_class_entry, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "DomComment", php_domxmlcomment_class_functions, NULL, NULL, NULL);
domxmlcomment_class_entry = zend_register_internal_class_ex(&ce, domxmlcdata_class_entry, NULL);
domxmlcomment_class_entry = zend_register_internal_class_ex(&ce, domxmlcdata_class_entry, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "DomProcessingInstruction", php_domxmlpi_class_functions, NULL, NULL, NULL);
domxmlpi_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL);
domxmlpi_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "DomNotation", php_domxmlnotation_class_functions, NULL, NULL, NULL);
domxmlnotation_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL);
domxmlnotation_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "DomEntity", php_domxmlentity_class_functions, NULL, NULL, NULL);
domxmlentity_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL);
domxmlentity_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "DomEntityReference", php_domxmlentityref_class_functions, NULL, NULL, NULL);
domxmlentityref_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL);
domxmlentityref_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "DomNamespace", php_domxmlns_class_functions, NULL, NULL, NULL);
domxmlns_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL);
domxmlns_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC);

#if defined(LIBXML_XPATH_ENABLED)
INIT_OVERLOADED_CLASS_ENTRY(ce, "XPathContext", php_xpathctx_class_functions, NULL, NULL, NULL);
xpathctx_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL);
xpathctx_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC);

INIT_OVERLOADED_CLASS_ENTRY(ce, "XPathObject", php_xpathobject_class_functions, NULL, NULL, NULL);
xpathobject_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL);
xpathobject_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC);
#endif

REGISTER_LONG_CONSTANT("XML_ELEMENT_NODE", XML_ELEMENT_NODE, CONST_CS | CONST_PERSISTENT);
Expand Down
6 changes: 3 additions & 3 deletions ext/domxml/php_domxml.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ extern zend_module_entry domxml_module_entry;
#define domxml_module_ptr &domxml_module_entry

/* directory functions */
extern PHP_MINIT_FUNCTION(domxml);
extern PHP_RINIT_FUNCTION(domxml);
extern PHP_MINFO_FUNCTION(domxml);
PHP_MINIT_FUNCTION(domxml);
PHP_RINIT_FUNCTION(domxml);
PHP_MINFO_FUNCTION(domxml);
PHP_FUNCTION(domxml_version);
PHP_FUNCTION(xmldoc);
PHP_FUNCTION(xmldocfile);
Expand Down
7 changes: 4 additions & 3 deletions ext/dotnet/dotnet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,16 @@ void php_DOTNET_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_propert
}
}

void php_register_DOTNET_class()
void php_register_DOTNET_class(void)
{
TSRMLS_FETCH();

INIT_OVERLOADED_CLASS_ENTRY(dotnet_class_entry, "DOTNET", NULL,
php_DOTNET_call_function_handler,
php_COM_get_property_handler,
php_COM_set_property_handler);

zend_register_internal_class(&dotnet_class_entry);
zend_register_internal_class(&dotnet_class_entry TSRMLS_CC);
}

function_entry DOTNET_functions[] = {
Expand All @@ -207,7 +209,6 @@ static PHP_MINFO_FUNCTION(DOTNET)

PHP_MINIT_FUNCTION(DOTNET)
{

HRESULT hr;
CoInitialize(0);
hr = dotnet_init();
Expand Down
4 changes: 2 additions & 2 deletions ext/dotnet/php_dotnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#if WIN32|WINNT

extern PHP_MINIT_FUNCTION(DOTNET);
extern PHP_MSHUTDOWN_FUNCTION(DOTNET);
PHP_MINIT_FUNCTION(DOTNET);
PHP_MSHUTDOWN_FUNCTION(DOTNET);
PHP_FUNCTION(DOTNET_load);

extern zend_module_entry DOTNET_module_entry;
Expand Down
8 changes: 4 additions & 4 deletions ext/fbsql/php_fbsql.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ extern zend_module_entry fbsql_module_entry;

#include <FBCAccess/FBCAccess.h>

extern PHP_MINIT_FUNCTION(fbsql);
extern PHP_MSHUTDOWN_FUNCTION(fbsql);
extern PHP_RINIT_FUNCTION(fbsql);
extern PHP_RSHUTDOWN_FUNCTION(fbsql);
PHP_MINIT_FUNCTION(fbsql);
PHP_MSHUTDOWN_FUNCTION(fbsql);
PHP_RINIT_FUNCTION(fbsql);
PHP_RSHUTDOWN_FUNCTION(fbsql);
PHP_MINFO_FUNCTION(fbsql);
PHP_FUNCTION(fbsql_connect);
PHP_FUNCTION(fbsql_pconnect);
Expand Down
4 changes: 2 additions & 2 deletions ext/filepro/php_filepro.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ PHP_FUNCTION(filepro_fieldwidth);
PHP_FUNCTION(filepro_fieldcount);
PHP_FUNCTION(filepro_retrieve);

extern PHP_MINIT_FUNCTION(filepro);
extern PHP_MSHUTDOWN_FUNCTION(filepro);
PHP_MINIT_FUNCTION(filepro);
PHP_MSHUTDOWN_FUNCTION(filepro);
#else
#define phpext_filepro_ptr NULL
#endif
Expand Down
4 changes: 2 additions & 2 deletions ext/gd/php_gd.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ extern zend_module_entry gd_module_entry;

/* gd.c functions */
PHP_MINFO_FUNCTION(gd);
extern PHP_MINIT_FUNCTION(gd);
extern PHP_MSHUTDOWN_FUNCTION(gd);
PHP_MINIT_FUNCTION(gd);
PHP_MSHUTDOWN_FUNCTION(gd);

#ifndef HAVE_GDIMAGECOLORRESOLVE
static int gdImageColorResolve(gdImagePtr, int, int, int);
Expand Down
3 changes: 0 additions & 3 deletions ext/gmp/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ static void gmp_efree(void *ptr, size_t size)
*/
ZEND_MINIT_FUNCTION(gmp)
{
/* Remove comments if you have entries in php.ini
REGISTER_INI_ENTRIES();
*/
le_gmp = zend_register_list_destructors_ex(_php_gmpnum_free, NULL,
GMP_RESOURCE_NAME,
module_number);
Expand Down
3 changes: 2 additions & 1 deletion ext/hyperwave/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY("hyperwave.default_port", "418", PHP_INI_ALL, OnHyperwavePort)
PHP_INI_END()

PHP_MINIT_FUNCTION(hw) {
PHP_MINIT_FUNCTION(hw)
{
ZEND_INIT_MODULE_GLOBALS(hw, php_hw_init_globals, NULL);

REGISTER_INI_ENTRIES();
Expand Down
4 changes: 2 additions & 2 deletions ext/hyperwave/php_hyperwave.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ typedef struct {
char *bodytag;
} hw_document;

extern PHP_MINIT_FUNCTION(hw);
extern PHP_MSHUTDOWN_FUNCTION(hw);
PHP_MINIT_FUNCTION(hw);
PHP_MSHUTDOWN_FUNCTION(hw);
PHP_MINFO_FUNCTION(hw);

PHP_FUNCTION(hw_connect);
Expand Down
2 changes: 0 additions & 2 deletions ext/icap/php_icap.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ PHP_MINFO_FUNCTION(icap)

PHP_MINIT_FUNCTION(icap)
{

le_icap = zend_register_list_destructors_ex(cal_close_it, NULL, "icap", module_number);

return SUCCESS;
}

Expand Down
2 changes: 1 addition & 1 deletion ext/icap/php_icap.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "build-defs.h"
#endif

extern PHP_MINIT_FUNCTION(icap);
PHP_MINIT_FUNCTION(icap);
PHP_MINFO_FUNCTION(icap);

/* Functions accessable to PHP */
Expand Down
2 changes: 0 additions & 2 deletions ext/interbase/interbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,6 @@ static void php_ibase_init_globals(TSRMLS_D)

PHP_MINIT_FUNCTION(ibase)
{
TSRMLS_FETCH();

ZEND_INIT_MODULE_GLOBALS(ibase, php_ibase_init_globals, NULL);

REGISTER_INI_ENTRIES();
Expand Down
8 changes: 4 additions & 4 deletions ext/interbase/php_interbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ extern zend_module_entry ibase_module_entry;
#define PHP_IBASE_API
#endif

extern PHP_MINIT_FUNCTION(ibase);
extern PHP_RINIT_FUNCTION(ibase);
extern PHP_MSHUTDOWN_FUNCTION(ibase);
extern PHP_RSHUTDOWN_FUNCTION(ibase);
PHP_MINIT_FUNCTION(ibase);
PHP_RINIT_FUNCTION(ibase);
PHP_MSHUTDOWN_FUNCTION(ibase);
PHP_RSHUTDOWN_FUNCTION(ibase);
PHP_MINFO_FUNCTION(ibase);

PHP_FUNCTION(ibase_connect);
Expand Down
Loading

0 comments on commit 1c25b8d

Please sign in to comment.