diff options
author | Zeev Suraski <zeev@php.net> | 2001-07-31 04:53:54 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2001-07-31 04:53:54 +0000 |
commit | d76cf1da183f79711d7699a2ff85f743da3f9dd2 (patch) | |
tree | 8342fd3406696bc32b81deb28d6771336fb6fe36 /ext | |
parent | 7bc71f442d7ddfecf43871b394c14100baa391b3 (diff) | |
download | php-git-d76cf1da183f79711d7699a2ff85f743da3f9dd2.tar.gz |
More TSRMLS_FETCH work
Diffstat (limited to 'ext')
-rw-r--r-- | ext/crack/crack.c | 1 | ||||
-rw-r--r-- | ext/domxml/php_domxml.c | 122 | ||||
-rw-r--r-- | ext/dotnet/dotnet.cpp | 11 | ||||
-rw-r--r-- | ext/fdf/fdf.c | 1 | ||||
-rw-r--r-- | ext/mbstring/mbstring.c | 2 | ||||
-rw-r--r-- | ext/mssql/php_mssql.c | 6 | ||||
-rw-r--r-- | ext/oci8/oci8.c | 32 | ||||
-rw-r--r-- | ext/odbc/php_odbc.c | 7 | ||||
-rw-r--r-- | ext/pgsql/pgsql.c | 5 | ||||
-rw-r--r-- | ext/rpc/dotnet/dotnet.cpp | 11 | ||||
-rw-r--r-- | ext/standard/basic_functions.c | 10 | ||||
-rw-r--r-- | ext/standard/info.c | 7 | ||||
-rw-r--r-- | ext/sybase/php_sybase_db.c | 4 | ||||
-rw-r--r-- | ext/sybase_ct/php_sybase_ct.c | 6 |
14 files changed, 106 insertions, 119 deletions
diff --git a/ext/crack/crack.c b/ext/crack/crack.c index f261381022..990ad2933c 100644 --- a/ext/crack/crack.c +++ b/ext/crack/crack.c @@ -65,7 +65,6 @@ long _crack_open_dict(char *dictpath TSRMLS_DC) { PWDICT *pwdict; long resource; - TSRMLS_FETCH(); if (CRACKG(current_id) != -1) { zend_error(E_WARNING, "Can not use more than one open dictionary with this implementation of libcrack"); diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 83b1760a7c..b20ee61138 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -466,12 +466,11 @@ static zval *php_xpathobject_new(xmlXPathObjectPtr obj, int *found) { return(wrapper); } -void *php_xpath_get_context(zval *wrapper, int rsrc_type1, int rsrc_type2) +void *php_xpath_get_context(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC) { void *obj; zval **handle; int type; - TSRMLS_FETCH(); if (Z_TYPE_P(wrapper) != IS_OBJECT) { php_error(E_ERROR, "Wrapper is not an object"); @@ -546,12 +545,11 @@ static zval *php_xpathcontext_new(xmlXPathContextPtr obj, int *found) { return(wrapper); } -void *php_dom_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2) +void *php_dom_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC) { void *obj; zval **handle; int type; - TSRMLS_FETCH(); if (Z_TYPE_P(wrapper) != IS_OBJECT) { php_error(E_ERROR, "Wrapper is not an object"); @@ -878,7 +876,7 @@ PHP_FUNCTION(domxml_attr_name) xmlAttrPtr attrp; id = getThis(); - attrp = php_dom_get_object(id, le_domxmlattrp, 0); + attrp = php_dom_get_object(id, le_domxmlattrp, 0 TSRMLS_CC); RETURN_STRING((char *) (attrp->name), 1); } @@ -892,7 +890,7 @@ PHP_FUNCTION(domxml_attr_value) xmlAttrPtr attrp; id = getThis(); - attrp = php_dom_get_object(id, le_domxmlattrp, 0); + attrp = php_dom_get_object(id, le_domxmlattrp, 0 TSRMLS_CC); RETURN_STRING((char *) xmlNodeGetContent((xmlNodePtr) attrp), 1); } @@ -906,7 +904,7 @@ PHP_FUNCTION(domxml_attr_specified) xmlAttrPtr attrp; id = getThis(); - attrp = php_dom_get_object(id, le_domxmlattrp, 0); + attrp = php_dom_get_object(id, le_domxmlattrp, 0 TSRMLS_CC); RETURN_TRUE; } @@ -923,7 +921,7 @@ PHP_FUNCTION(domxml_pi_target) xmlNodePtr nodep; id = getThis(); - nodep = php_dom_get_object(id, le_domxmlpip, 0); + nodep = php_dom_get_object(id, le_domxmlpip, 0 TSRMLS_CC); RETURN_STRING((char *)nodep->name, 1); } @@ -937,7 +935,7 @@ PHP_FUNCTION(domxml_pi_data) xmlNodePtr nodep; id = getThis(); - nodep = php_dom_get_object(id, le_domxmlpip, 0); + nodep = php_dom_get_object(id, le_domxmlpip, 0 TSRMLS_CC); RETURN_STRING(xmlNodeGetContent(nodep), 1); } @@ -954,7 +952,7 @@ PHP_FUNCTION(domxml_cdata_length) xmlNodePtr nodep; id = getThis(); - nodep = php_dom_get_object(id, le_domxmlcdatap, 0); + nodep = php_dom_get_object(id, le_domxmlcdatap, 0 TSRMLS_CC); RETURN_LONG(1); } @@ -999,7 +997,7 @@ PHP_FUNCTION(domxml_node_name) const char *str = NULL; id = getThis(); - n = php_dom_get_object(id, le_domxmlnodep, 0); + n = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); switch (n->type) { @@ -1044,7 +1042,7 @@ PHP_FUNCTION(domxml_node_value) char *str = NULL; id = getThis(); - n = php_dom_get_object(id, le_domxmlnodep, 0); + n = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); if (!n) { RETURN_FALSE; @@ -1071,7 +1069,7 @@ PHP_FUNCTION(domxml_node_type) xmlNode *n; id = getThis(); - n = php_dom_get_object(id, le_domxmlnodep, 0); + n = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); if (!n) { RETURN_FALSE; @@ -1089,7 +1087,7 @@ PHP_FUNCTION(domxml_node_first_child) int ret; id = getThis(); - nodep = php_dom_get_object(id, le_domxmlnodep, 0); + nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); first = nodep->children; if (!first) { @@ -1112,7 +1110,7 @@ PHP_FUNCTION(domxml_node_last_child) int ret; id = getThis(); - nodep = php_dom_get_object(id, le_domxmlnodep, 0); + nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); last = nodep->last; if (!last) { @@ -1135,7 +1133,7 @@ PHP_FUNCTION(domxml_node_next_sibling) int ret; id = getThis(); - if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0))) + if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC))) RETURN_FALSE; first = nodep->next; @@ -1159,7 +1157,7 @@ PHP_FUNCTION(domxml_node_previous_sibling) int ret; id = getThis(); - if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0))) + if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC))) RETURN_FALSE; first = nodep->prev; @@ -1184,7 +1182,7 @@ PHP_FUNCTION(domxml_node_owner_document) int ret; id = getThis(); - if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0))) + if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC))) RETURN_FALSE; docp = nodep->doc; @@ -1207,7 +1205,7 @@ PHP_FUNCTION(domxml_node_has_child_nodes) xmlNode *nodep; id = getThis(); - if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0))) + if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC))) RETURN_FALSE; if (nodep->children) { @@ -1226,7 +1224,7 @@ PHP_FUNCTION(domxml_node_has_attributes) xmlNode *nodep; id = getThis(); - if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0))) + if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC))) RETURN_FALSE; if(nodep->type != XML_ELEMENT_NODE) @@ -1249,7 +1247,7 @@ PHP_FUNCTION(domxml_node_prefix) xmlNsPtr ns; id = getThis(); - if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0))) + if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC))) RETURN_FALSE; ns = nodep->ns; @@ -1274,7 +1272,7 @@ PHP_FUNCTION(domxml_node_parent) int ret; id = getThis(); - nodep = php_dom_get_object(id, le_domxmlnodep, 0); + nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); last = nodep->parent; if (!last) { @@ -1296,7 +1294,7 @@ PHP_FUNCTION(domxml_node_children) int ret; id = getThis(); - nodep = php_dom_get_object(id, le_domxmlnodep, le_domxmldocp); + nodep = php_dom_get_object(id, le_domxmlnodep, le_domxmldocp TSRMLS_CC); /* Even if the nodep is a XML_DOCUMENT_NODE the type is at the same position. @@ -1330,7 +1328,7 @@ PHP_FUNCTION(domxml_node_unlink_node) xmlNode *nodep; id = getThis(); - nodep = php_dom_get_object(id, le_domxmlnodep, 0); + nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); xmlUnlinkNode(nodep); xmlFreeNode(nodep); @@ -1351,8 +1349,8 @@ PHP_FUNCTION(domxml_node_add_child) WRONG_PARAM_COUNT; } id = getThis(); - nodep = php_dom_get_object(id, le_domxmlnodep, 0); - child = php_dom_get_object(node, le_domxmlnodep, 0); + nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); + child = php_dom_get_object(node, le_domxmlnodep, 0 TSRMLS_CC); if (!child || !nodep) { RETURN_FALSE; @@ -1378,8 +1376,8 @@ PHP_FUNCTION(domxml_node_append_child) WRONG_PARAM_COUNT; } id = getThis(); - nodep = php_dom_get_object(id, le_domxmlnodep, 0); - child = php_dom_get_object(node, le_domxmlnodep, 0); + nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); + child = php_dom_get_object(node, le_domxmlnodep, 0 TSRMLS_CC); if (!child || !nodep) { RETURN_FALSE; @@ -1405,9 +1403,9 @@ PHP_FUNCTION(domxml_node_insert_before) WRONG_PARAM_COUNT; } id = getThis(); - nodep = php_dom_get_object(id, le_domxmlnodep, 0); - child = php_dom_get_object(node, le_domxmlnodep, 0); - refp = php_dom_get_object(ref, le_domxmlnodep, 0); + nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); + child = php_dom_get_object(node, le_domxmlnodep, 0 TSRMLS_CC); + refp = php_dom_get_object(ref, le_domxmlnodep, 0 TSRMLS_CC); if (!child || !nodep || !refp) { RETURN_FALSE; @@ -1433,7 +1431,7 @@ PHP_FUNCTION(domxml_node_set_name) } id = getThis(); - nodep = php_dom_get_object(id, le_domxmlnodep, 0); + nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); convert_to_string(name); if(name->value.str.len) @@ -1454,7 +1452,7 @@ PHP_FUNCTION(domxml_node_attributes) #endif id = getThis(); - nodep = php_dom_get_object(id, le_domxmlnodep, 0); + nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); if(node_attributes(&attrs, nodep) < 0) RETURN_FALSE; @@ -1492,7 +1490,7 @@ PHP_FUNCTION(domxml_node_new_child) WRONG_PARAM_COUNT; } id = getThis(); - nodep = php_dom_get_object(id, le_domxmlnodep, 0); + nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); convert_to_string(name); convert_to_string(content); @@ -1523,7 +1521,7 @@ PHP_FUNCTION(domxml_node_set_content) } id = getThis(); - nodep = php_dom_get_object(id, le_domxmlnodep, 0); + nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); convert_to_string(content); if(content->value.str.len) @@ -1548,7 +1546,7 @@ PHP_FUNCTION(domxml_notation_public_id) xmlNotationPtr nodep; id = getThis(); - nodep = (xmlNotationPtr) php_dom_get_object(id, le_domxmlnotationp, 0); + nodep = (xmlNotationPtr) php_dom_get_object(id, le_domxmlnotationp, 0 TSRMLS_CC); RETURN_STRING((char *) (nodep->PublicID), 1); } @@ -1562,7 +1560,7 @@ PHP_FUNCTION(domxml_notation_system_id) xmlNotationPtr nodep; id = getThis(); - nodep = (xmlNotationPtr) php_dom_get_object(id, le_domxmlnotationp, 0); + nodep = (xmlNotationPtr) php_dom_get_object(id, le_domxmlnotationp, 0 TSRMLS_CC); RETURN_STRING((char *) (nodep->SystemID), 1); } @@ -1604,7 +1602,7 @@ PHP_FUNCTION(domxml_elem_tagname) xmlNode *nodep; id = getThis(); - nodep = php_dom_get_object(id, le_domxmlelementp, 0); + nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC); RETURN_STRING((char *) (nodep->name), 1); } @@ -1620,7 +1618,7 @@ PHP_FUNCTION(domxml_elem_get_attribute) if ((ZEND_NUM_ARGS() == 1) && getParameters(ht, 1, &arg1) == SUCCESS) { id = getThis(); - nodep = php_dom_get_object(id, le_domxmlelementp, 0); + nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC); } else { WRONG_PARAM_COUNT; } @@ -1647,7 +1645,7 @@ PHP_FUNCTION(domxml_elem_set_attribute) if ((ZEND_NUM_ARGS() == 2) && getParameters(ht, 2, &arg1, &arg2) == SUCCESS) { id = getThis(); - nodep = php_dom_get_object(id, le_domxmlelementp, 0); + nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC); } else { WRONG_PARAM_COUNT; } @@ -1676,7 +1674,7 @@ PHP_FUNCTION(domxml_elem_remove_attribute) if ((ZEND_NUM_ARGS() == 1) && getParameters(ht, 1, &arg1) == SUCCESS) { id = getThis(); - nodep = php_dom_get_object(id, le_domxmlelementp, 0); + nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC); } else { WRONG_PARAM_COUNT; } @@ -1697,7 +1695,7 @@ PHP_FUNCTION(domxml_elem_get_attribute_node) if ((ZEND_NUM_ARGS() == 1) && getParameters(ht, 1, &arg1) == SUCCESS) { id = getThis(); - nodep = php_dom_get_object(id, le_domxmlelementp, 0); + nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC); } else { WRONG_PARAM_COUNT; } @@ -1720,8 +1718,8 @@ PHP_FUNCTION(domxml_elem_set_attribute_node) if ((ZEND_NUM_ARGS() == 1) && getParameters(ht, 1, &arg1) == SUCCESS) { id = getThis(); - nodep = php_dom_get_object(id, le_domxmlelementp, 0); - attrp = php_dom_get_object(arg1, le_domxmlattrp, 0); + nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC); + attrp = php_dom_get_object(arg1, le_domxmlattrp, 0 TSRMLS_CC); } else { WRONG_PARAM_COUNT; } @@ -1741,7 +1739,7 @@ PHP_FUNCTION(domxml_elem_get_element_by_tagname) if ((ZEND_NUM_ARGS() == 1) && getParameters(ht, 1, &arg1) == SUCCESS) { id = getThis(); - nodep = php_dom_get_object(id, le_domxmlelementp, 0); + nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC); } else { WRONG_PARAM_COUNT; } @@ -1764,7 +1762,7 @@ PHP_FUNCTION(domxml_doctype_name) xmlNodePtr attrp; id = getThis(); - attrp = php_dom_get_object(id, le_domxmldoctypep, 0); + attrp = php_dom_get_object(id, le_domxmldoctypep, 0 TSRMLS_CC); RETURN_STRING((char *) (attrp->name), 1); } @@ -1784,7 +1782,7 @@ PHP_FUNCTION(domxml_doc_doctype) int ret; id = getThis(); - if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) { + if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) { RETURN_FALSE; } @@ -1804,7 +1802,7 @@ PHP_FUNCTION(domxml_doc_implementation) xmlDocPtr docp; id = getThis(); - if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) { + if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) { RETURN_FALSE; } @@ -1832,7 +1830,7 @@ PHP_FUNCTION(domxml_doc_document_element) } } - docp = php_dom_get_object(id, le_domxmldocp, 0); + docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC); node = docp->children; if (!node) { @@ -1863,7 +1861,7 @@ PHP_FUNCTION(domxml_doc_create_element) int ret; id = getThis(); - if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) { + if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) { RETURN_FALSE; } @@ -1895,7 +1893,7 @@ PHP_FUNCTION(domxml_doc_create_text_node) int ret; id = getThis(); - if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) { + if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) { RETURN_FALSE; } @@ -1927,7 +1925,7 @@ PHP_FUNCTION(domxml_doc_create_comment) int ret; id = getThis(); - if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) { + if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) { RETURN_FALSE; } @@ -1959,7 +1957,7 @@ PHP_FUNCTION(domxml_doc_create_attribute) int ret; id = getThis(); - if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) { + if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) { RETURN_FALSE; } @@ -1992,7 +1990,7 @@ PHP_FUNCTION(domxml_doc_create_processing_instruction) int ret; id = getThis(); - if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) { + if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) { RETURN_FALSE; } @@ -2025,14 +2023,14 @@ PHP_FUNCTION(domxml_doc_imported_node) int ret; id = getThis(); - if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) { + if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) { RETURN_FALSE; } if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } - srcnode = php_dom_get_object(arg1, le_domxmlnodep, 0); + srcnode = php_dom_get_object(arg1, le_domxmlnodep, 0 TSRMLS_CC); if(!srcnode) RETURN_FALSE; @@ -2061,7 +2059,7 @@ PHP_FUNCTION(domxml_intdtd) int ret; id = getThis(); - docp = php_dom_get_object(id, le_domxmldocp, 0); + docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC); dtd = xmlGetIntSubset(docp); if (!dtd) { @@ -2084,7 +2082,7 @@ PHP_FUNCTION(domxml_dumpmem) int size; id = getThis(); - if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0))) { + if(NULL == (docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC))) { RETURN_FALSE; } @@ -2182,7 +2180,7 @@ PHP_FUNCTION(domxml_node_text_concat) } id = getThis(); - nodep = php_dom_get_object(id, le_domxmlnodep, 0); + nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC); convert_to_string(content); if(content->value.str.len) @@ -2206,7 +2204,7 @@ PHP_FUNCTION(domxml_add_root) } id = getThis(); - docp = php_dom_get_object(id, le_domxmldocp, 0); + docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC); convert_to_string(name); nodep = xmlNewDocNode(docp, NULL, name->value.str.val, NULL); @@ -2433,7 +2431,7 @@ static void php_xpathptr_new_context(INTERNAL_FUNCTION_PARAMETERS, int mode) int ret; id = getThis(); - docp = php_dom_get_object(id, le_domxmldocp, 0); + docp = php_dom_get_object(id, le_domxmldocp, 0 TSRMLS_CC); #if defined(LIBXML_XPTR_ENABLED) if(mode == PHP_XPTR) @@ -2477,7 +2475,7 @@ static void php_xpathptr_eval(INTERNAL_FUNCTION_PARAMETERS, int mode, int expr) } id = getThis(); - ctxp = php_xpath_get_context(id, le_xpathctxp, 0); + ctxp = php_xpath_get_context(id, le_xpathctxp, 0 TSRMLS_CC); convert_to_string(str); #if defined(LIBXML_XPTR_ENABLED) diff --git a/ext/dotnet/dotnet.cpp b/ext/dotnet/dotnet.cpp index 0407150e99..938491bdf4 100644 --- a/ext/dotnet/dotnet.cpp +++ b/ext/dotnet/dotnet.cpp @@ -184,10 +184,8 @@ void php_DOTNET_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_propert } } -void php_register_DOTNET_class(void) +void php_register_DOTNET_class(TSRMLS_D) { - TSRMLS_FETCH(); - INIT_OVERLOADED_CLASS_ENTRY(dotnet_class_entry, "DOTNET", NULL, php_DOTNET_call_function_handler, php_COM_get_property_handler, @@ -210,11 +208,14 @@ static PHP_MINFO_FUNCTION(DOTNET) PHP_MINIT_FUNCTION(DOTNET) { HRESULT hr; + CoInitialize(0); hr = dotnet_init(); - if (FAILED(hr)) return hr; + if (FAILED(hr)) { + return hr; + } - php_register_DOTNET_class(); + php_register_DOTNET_class(TSRMLS_C); return SUCCESS; } diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c index 8fed3d3f4b..a5da77e67b 100644 --- a/ext/fdf/fdf.c +++ b/ext/fdf/fdf.c @@ -725,7 +725,6 @@ SAPI_POST_HANDLER_FUNC(fdf_post_handler) FDFErc err; ASInt32 nBytes; zval *array_ptr = (zval *) arg; - TSRMLS_FETCH(); fp=php_open_temporary_file(NULL,"fdfdata.",&filename); if(!fp) { diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 4c97b9fb7f..fb69c1bf47 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -925,8 +925,6 @@ php_mbstr_encoding_handler(zval *arg, char *res, char *separator) #if !defined(COMPILE_DL_MBSTRING) SAPI_POST_HANDLER_FUNC(php_mbstr_post_handler) { - TSRMLS_FETCH(); - MBSTRG(http_input_identify_post) = mbfl_no_encoding_invalid; php_mbstr_encoding_handler(arg, SG(request_info).post_data, "&"); diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c index 2371a94216..1afc79bf53 100644 --- a/ext/mssql/php_mssql.c +++ b/ext/mssql/php_mssql.c @@ -157,10 +157,8 @@ static int php_mssql_message_handler(DBPROCESS *dbproc, DBINT msgno,int msgstate return 0; } -static int _clean_invalid_results(list_entry *le) +static int _clean_invalid_results(list_entry *le TSRMLS_DC) { - TSRMLS_FETCH(); - if (le->type == le_result) { mssql_link *mssql_ptr = ((mssql_result *) le->ptr)->mssql_ptr; @@ -230,7 +228,7 @@ static void _close_mssql_link(zend_rsrc_list_entry *rsrc) TSRMLS_FETCH(); mssql_ptr->valid = 0; - zend_hash_apply(&EG(regular_list),(apply_func_t) _clean_invalid_results); + zend_hash_apply(&EG(regular_list),(apply_func_t) _clean_invalid_results TSRMLS_CC); dbclose(mssql_ptr->link); dbfreelogin(mssql_ptr->login); efree(mssql_ptr); diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 4e0beb5999..f84e2f0153 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -519,14 +519,14 @@ PHP_RINIT_FUNCTION(oci) return SUCCESS; } -static int _session_pcleanup(oci_session *session) +static int _session_pcleanup(oci_session *session TSRMLS_DC) { _oci_close_session(session); return 1; } -static int _server_pcleanup(oci_server *server) +static int _server_pcleanup(oci_server *server TSRMLS_DC) { _oci_close_server(server); @@ -539,8 +539,8 @@ PHP_MSHUTDOWN_FUNCTION(oci) oci_debug("START php_mshutdown_oci"); - zend_hash_apply(OCI(user), (apply_func_t)_session_pcleanup); - zend_hash_apply(OCI(server), (apply_func_t)_server_pcleanup); + zend_hash_apply(OCI(user), (apply_func_t)_session_pcleanup TSRMLS_CC); + zend_hash_apply(OCI(server), (apply_func_t)_server_pcleanup TSRMLS_CC); zend_hash_destroy(OCI(user)); zend_hash_destroy(OCI(server)); @@ -562,8 +562,8 @@ PHP_RSHUTDOWN_FUNCTION(oci) #if 0 /* XXX free all statements, rollback all outstanding transactions */ - zend_hash_apply(OCI(user), (apply_func_t) _session_cleanup); - zend_hash_apply(OCI(server), (apply_func_t) _server_cleanup); + zend_hash_apply(OCI(user), (apply_func_t) _session_cleanup TSRMLS_CC); + zend_hash_apply(OCI(server), (apply_func_t) _server_cleanup TSRMLS_CC); #endif oci_debug("END php_rshutdown_oci"); @@ -622,7 +622,7 @@ _oci_bind_hash_dtor(void *data) /* {{{ _oci_bind_pre_exec() */ static int -_oci_bind_pre_exec(void *data) +_oci_bind_pre_exec(void *data TSRMLS_DC) { oci_bind *bind = (oci_bind *) data; @@ -637,7 +637,7 @@ _oci_bind_pre_exec(void *data) /* {{{ _oci_bind_post_exec() */ static int -_oci_bind_post_exec(void *data) +_oci_bind_post_exec(void *data TSRMLS_DC) { oci_bind *bind = (oci_bind *) data; @@ -1319,6 +1319,7 @@ oci_execute(oci_statement *statement, char *func,ub4 mode) int dtype; dvoid *buf; oci_descriptor *descr; + TSRMLS_FETCH(); statement->error = oci_error(statement->pError, @@ -1346,7 +1347,7 @@ oci_execute(oci_statement *statement, char *func,ub4 mode) we don't want to execute!!! */ if (statement->binds) { - zend_hash_apply(statement->binds, (apply_func_t) _oci_bind_pre_exec); + zend_hash_apply(statement->binds, (apply_func_t) _oci_bind_pre_exec TSRMLS_CC); } statement->error = @@ -1361,7 +1362,7 @@ oci_execute(oci_statement *statement, char *func,ub4 mode) NULL, mode)); if (statement->binds) { - zend_hash_apply(statement->binds, (apply_func_t) _oci_bind_post_exec); + zend_hash_apply(statement->binds, (apply_func_t) _oci_bind_post_exec TSRMLS_CC); } oci_handle_error(statement->conn, statement->error); @@ -1612,7 +1613,7 @@ oci_execute(oci_statement *statement, char *func,ub4 mode) /* {{{ oci_fetch() */ static int -_oci_column_pre_fetch(void *data) +_oci_column_pre_fetch(void *data TSRMLS_DC) { oci_out_column *col = (oci_out_column *) data; @@ -1631,7 +1632,7 @@ oci_fetch(oci_statement *statement, ub4 nrows, char *func) oci_out_column *column; if (statement->columns) { - zend_hash_apply(statement->columns, (apply_func_t) _oci_column_pre_fetch); + zend_hash_apply(statement->columns, (apply_func_t) _oci_column_pre_fetch TSRMLS_CC); } statement->error = @@ -2338,7 +2339,7 @@ static oci_server *_oci_open_server(char *dbname,int persistent) /* {{{ _oci_close_server() */ -static int _oci_session_cleanup(void *data) +static int _oci_session_cleanup(void *data TSRMLS_DC) { list_entry *le = (list_entry *) data; if (le->type == le_session) { @@ -2356,12 +2357,11 @@ _oci_close_server(oci_server *server) char *dbname; int oldopen; TSRMLS_FETCH(); - TSRMLS_FETCH(); oldopen = server->is_open; server->is_open = 2; if (! OCI(shutdown)) { - zend_hash_apply(&EG(regular_list), _oci_session_cleanup); + zend_hash_apply(&EG(regular_list), (apply_func_t) _oci_session_cleanup TSRMLS_CC); } server->is_open = oldopen; @@ -3917,7 +3917,7 @@ PHP_FUNCTION(ocilogoff) connection->is_open = 0; - zend_hash_apply(list, (apply_func_t) _stmt_cleanup); + zend_hash_apply(list, (apply_func_t) _stmt_cleanup TSRMLS_CC); if (zend_list_delete(connection->id) == SUCCESS) { RETURN_TRUE; diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 390b0eff60..82c2af0569 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -644,9 +644,8 @@ void odbc_transact(INTERNAL_FUNCTION_PARAMETERS, int type) RETURN_TRUE; } -static int _close_pconn_with_id(list_entry *le, int *id) +static int _close_pconn_with_id(list_entry *le, int *id TSRMLS_DC) { - if(le->type == le_pconn && (((odbc_connection *)(le->ptr))->id == *id)){ return 1; }else{ @@ -733,7 +732,7 @@ PHP_FUNCTION(odbc_close_all) zend_list_delete(i); /* Delete the persistent connection */ zend_hash_apply_with_argument(&EG(persistent_list), - (int (*)(void *, void *)) _close_pconn_with_id, (void *) &i); + (apply_func_arg_t) _close_pconn_with_id, (void *) &i TSRMLS_CC); } } } @@ -2222,7 +2221,7 @@ PHP_FUNCTION(odbc_close) if(is_pconn){ zend_hash_apply_with_argument(&EG(persistent_list), - (int (*)(void *, void *)) _close_pconn_with_id, (void *) &((*pv_conn)->value.lval)); + (apply_func_arg_t) _close_pconn_with_id, (void *) &((*pv_conn)->value.lval) TSRMLS_CC); } } /* }}} */ diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index ef16d1f7e4..bbd5cfdf06 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -187,10 +187,9 @@ _notice_handler(void *arg, const char *message) /* {{{ _rollback_transactions */ -static int _rollback_transactions(zend_rsrc_list_entry *rsrc) +static int _rollback_transactions(zend_rsrc_list_entry *rsrc TSRMLS_DC) { PGconn *link; - TSRMLS_FETCH(); if (rsrc->type != le_plink) return 0; @@ -293,7 +292,7 @@ PHP_RINIT_FUNCTION(pgsql) */ PHP_RSHUTDOWN_FUNCTION(pgsql) { - zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions); + zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions TSRMLS_CC); return SUCCESS; } /* }}} */ diff --git a/ext/rpc/dotnet/dotnet.cpp b/ext/rpc/dotnet/dotnet.cpp index 0407150e99..938491bdf4 100644 --- a/ext/rpc/dotnet/dotnet.cpp +++ b/ext/rpc/dotnet/dotnet.cpp @@ -184,10 +184,8 @@ void php_DOTNET_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_propert } } -void php_register_DOTNET_class(void) +void php_register_DOTNET_class(TSRMLS_D) { - TSRMLS_FETCH(); - INIT_OVERLOADED_CLASS_ENTRY(dotnet_class_entry, "DOTNET", NULL, php_DOTNET_call_function_handler, php_COM_get_property_handler, @@ -210,11 +208,14 @@ static PHP_MINFO_FUNCTION(DOTNET) PHP_MINIT_FUNCTION(DOTNET) { HRESULT hr; + CoInitialize(0); hr = dotnet_init(); - if (FAILED(hr)) return hr; + if (FAILED(hr)) { + return hr; + } - php_register_DOTNET_class(); + php_register_DOTNET_class(TSRMLS_C); return SUCCESS; } diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index e2ef244d47..22e0e1bffb 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1801,10 +1801,9 @@ void user_tick_function_dtor(user_tick_function_entry *tick_function_entry) efree(tick_function_entry->arguments); } -static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_function_entry) +static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_function_entry TSRMLS_DC) { zval retval; - TSRMLS_FETCH(); if (call_user_function(EG(function_table), NULL, shutdown_function_entry->arguments[0], &retval, shutdown_function_entry->arg_count-1, shutdown_function_entry->arguments+1 TSRMLS_CC)==SUCCESS) { zval_dtor(&retval); @@ -1815,11 +1814,10 @@ static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_fun return 0; } -static void user_tick_function_call(user_tick_function_entry *tick_fe) +static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC) { zval retval; zval *function = tick_fe->arguments[0]; - TSRMLS_FETCH(); if (call_user_function(EG(function_table), NULL, function, &retval, tick_fe->arg_count - 1, tick_fe->arguments+1 TSRMLS_CC) == SUCCESS) { @@ -1846,7 +1844,7 @@ static void run_user_tick_functions(int tick_count) { TSRMLS_FETCH(); - zend_llist_apply(BG(user_tick_functions), (llist_apply_func_t)user_tick_function_call); + zend_llist_apply(BG(user_tick_functions), (llist_apply_func_t) user_tick_function_call TSRMLS_CC); } static int user_tick_function_compare(user_tick_function_entry *tick_fe1, @@ -1871,7 +1869,7 @@ void php_call_shutdown_functions(void) TSRMLS_FETCH(); if (BG(user_shutdown_function_names)) zend_try { - zend_hash_apply(BG(user_shutdown_function_names), (apply_func_t) user_shutdown_function_call); + zend_hash_apply(BG(user_shutdown_function_names), (apply_func_t) user_shutdown_function_call TSRMLS_CC); memcpy(&EG(bailout), &orig_bailout, sizeof(jmp_buf)); zend_hash_destroy(BG(user_shutdown_function_names)); efree(BG(user_shutdown_function_names)); diff --git a/ext/standard/info.c b/ext/standard/info.c index 84689d1733..01a70db73d 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -39,10 +39,9 @@ PHPAPI extern char *php_ini_opened_path; /* {{{ _display_module_info */ -static int _display_module_info(zend_module_entry *module, void *arg) +static int _display_module_info(zend_module_entry *module, void *arg TSRMLS_DC) { int show_info_func = *((int *) arg); - TSRMLS_FETCH(); if (show_info_func && module->info_func) { php_printf("<h2 align=\"center\"><a name=\"module_%s\">%s</a></h2>\n", module->name, module->name); @@ -256,12 +255,12 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) int show_info_func; show_info_func = 1; - zend_hash_apply_with_argument(&module_registry, (int (*)(void *, void *)) _display_module_info, &show_info_func); + zend_hash_apply_with_argument(&module_registry, (apply_func_arg_t) _display_module_info, &show_info_func TSRMLS_CC); SECTION("Additional Modules"); php_info_print_table_start(); show_info_func = 0; - zend_hash_apply_with_argument(&module_registry, (int (*)(void *, void *)) _display_module_info, &show_info_func); + zend_hash_apply_with_argument(&module_registry, (apply_func_arg_t) _display_module_info, &show_info_func TSRMLS_CC); php_info_print_table_end(); } diff --git a/ext/sybase/php_sybase_db.c b/ext/sybase/php_sybase_db.c index 72c357ce23..7fc514a883 100644 --- a/ext/sybase/php_sybase_db.c +++ b/ext/sybase/php_sybase_db.c @@ -125,7 +125,7 @@ static int php_sybase_message_handler(DBPROCESS *dbproc,DBINT msgno,int msgstate } -static int _clean_invalid_results(list_entry *le) +static int _clean_invalid_results(list_entry *le TSRMLS_DC) { if (le->type == php_sybase_module.le_result) { sybase_link *sybase_ptr = ((sybase_result *) le->ptr)->sybase_ptr; @@ -177,7 +177,7 @@ static void _close_sybase_link(zend_rsrc_list_entry *rsrc) will *not* be in a consistent state. thies@thieso.net */ - zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results); + zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results TSRMLS_CC); dbclose(sybase_ptr->link); dbloginfree(sybase_ptr->login); efree(sybase_ptr); diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c index f9e02110fc..dfb04f36c1 100644 --- a/ext/sybase_ct/php_sybase_ct.c +++ b/ext/sybase_ct/php_sybase_ct.c @@ -95,10 +95,8 @@ ZEND_DECLARE_MODULE_GLOBALS(sybase) #define CHECK_LINK(link) { if (link==-1) { php_error(E_WARNING, "Sybase: A link to the server could not be established"); RETURN_FALSE; } } -static int _clean_invalid_results(list_entry *le) +static int _clean_invalid_results(list_entry *le TSRMLS_DC) { - TSRMLS_FETCH(); - if (le->type == le_result) { sybase_link *sybase_ptr = ((sybase_result *) le->ptr)->sybase_ptr; @@ -149,7 +147,7 @@ static void _close_sybase_link(zend_rsrc_list_entry *rsrc) sybase_ptr->valid = 0; - zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results); + zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results TSRMLS_CC); /* Non-persistent connections will always be connected or we wouldn't * get here, but since we want to check the death status anyway |