]> granicus.if.org Git - php/commitdiff
Some more TSRMLS_FETCH work
authorZeev Suraski <zeev@php.net>
Tue, 31 Jul 2001 05:56:26 +0000 (05:56 +0000)
committerZeev Suraski <zeev@php.net>
Tue, 31 Jul 2001 05:56:26 +0000 (05:56 +0000)
ext/com/COM.c
ext/ctype/php_ctype.h
ext/interbase/interbase.c
ext/mbstring/mbstring.c
ext/oracle/oracle.c
ext/rpc/com/com_wrapper.c

index cb60f4d2a8481c6a255ac5c71d9b662c63de8a2b..9d6648044b1773c35122ce9bc77471e5580fff08 100644 (file)
@@ -84,7 +84,7 @@ PHPAPI HRESULT php_COM_clone(comval *obj, comval *clone, int cleanup);
 
 PHPAPI int php_COM_get_le_comval();
 static ITypeLib *php_COM_find_typelib(char *search_string, int mode);
-static int php_COM_load_typelib(ITypeLib *TypeLib, int mode);
+static int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC);
 
 static int le_comval;
 static int codepage;
@@ -414,7 +414,7 @@ static PHP_INI_MH(OnTypelibFileChange)
                }
                if((pTL = php_COM_find_typelib(typelib_name, mode)) != NULL)
                {
-                       php_COM_load_typelib(pTL, mode);
+                       php_COM_load_typelib(pTL, mode TSRMLS_CC);
                        pTL->lpVtbl->Release(pTL);
                }
        }
@@ -606,7 +606,7 @@ PHP_FUNCTION(com_load)
 
                        if(C_TYPEINFO_VT(obj)->GetContainingTypeLib(C_TYPEINFO(obj), &pTL, &idx) == S_OK)
                        {
-                               php_COM_load_typelib(pTL, mode);
+                               php_COM_load_typelib(pTL, mode TSRMLS_CC);
                                pTL->lpVtbl->Release(pTL);
                        }
                }
@@ -623,7 +623,7 @@ PHP_FUNCTION(com_load)
                                /* idx 0 should deliver the ITypeInfo for the IDispatch Interface */
                                if(INI_INT("com.autoregister_typelib"))
                                {
-                                       php_COM_load_typelib(pTL, mode);
+                                       php_COM_load_typelib(pTL, mode TSRMLS_CC);
                                }
                                pTL->lpVtbl->Release(pTL);
                        }
@@ -1128,7 +1128,7 @@ PHP_FUNCTION(com_load_typelib)
 
        convert_to_string_ex(&arg_typelib);
        pTL = php_COM_find_typelib(Z_STRVAL_P(arg_typelib), mode);
-       if(php_COM_load_typelib(pTL, mode) == SUCCESS)
+       if(php_COM_load_typelib(pTL, mode TSRMLS_CC) == SUCCESS)
        {
                pTL->lpVtbl->Release(pTL);
                RETURN_TRUE;
@@ -1573,12 +1573,11 @@ static ITypeLib *php_COM_find_typelib(char *search_string, int mode)
        return TypeLib;
 }
 
-static int php_COM_load_typelib(ITypeLib *TypeLib, int mode)
+static int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
 {
        ITypeComp *TypeComp;
        int i;
        int interfaces;
-       TSRMLS_FETCH();
 
        if(NULL == TypeLib)
        {
@@ -1687,10 +1686,8 @@ PHP_FUNCTION(com_isenum)
 }
 /* }}} */
 
-void php_register_COM_class(void)
+void php_register_COM_class(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        INIT_OVERLOADED_CLASS_ENTRY(com_class_entry, "COM", NULL,
                                                                php_COM_call_function_handler,
                                                                php_COM_get_property_handler,
@@ -1703,7 +1700,7 @@ PHP_MINIT_FUNCTION(COM)
 {
        CoInitialize(NULL);
        le_comval = zend_register_list_destructors_ex(php_comval_destructor, NULL, "COM", module_number);
-       php_register_COM_class();
+       php_register_COM_class(TSRMLS_C);
        REGISTER_INI_ENTRIES();
        return SUCCESS;
 }
index 279aa7c1b4320c8ef8414b64e1a4cfed1dac8863..075ef6a956fdc694985d885d5069d17d75030115 100644 (file)
@@ -61,13 +61,6 @@ ZEND_BEGIN_MODULE_GLOBALS(ctype)
 ZEND_END_MODULE_GLOBALS(ctype)
 */
 
-/* In every function that needs to use variables in php_ctype_globals,
-   do call TSRMLS_FETCH(); after declaring other variables used by
-   that function, and always refer to them as CTYPEG(variable).
-   You are encouraged to rename these macros something shorter, see
-   examples in any other php module directory.
-*/
-
 #ifdef ZTS
 #define CTYPEG(v) TSRMG(ctype_globals_id, php_ctype_globals *, v)
 #else
index 980ba90e01828f95f33e156e3708476972bf71c8..5d50ee97a8b4ecb3a2330657f87508905f8163b5 100644 (file)
@@ -574,7 +574,6 @@ PHP_RSHUTDOWN_FUNCTION(ibase)
 PHP_MINFO_FUNCTION(ibase)
 {
        char tmp[32];
-       TSRMLS_FETCH();
 
        php_info_print_table_start();
        php_info_print_table_row(2, "Interbase Support", "enabled");    
index fb69c1bf4738ce3cc80061dbb99421c220833766..a3996fd356a89039c4e5c58a5415160e5fe7b3d7 100644 (file)
@@ -792,7 +792,7 @@ PHP_FUNCTION(mb_preferred_mime_name)
 
 #if defined(MBSTR_ENC_TRANS)
 static void
-php_mbstr_encoding_handler(zval *arg, char *res, char *separator)
+php_mbstr_encoding_handler(zval *arg, char *res, char *separator TSRMLS_DC)
 {
        char *var, *val;
        char *strtok_buf = NULL, **val_list;
@@ -802,7 +802,6 @@ php_mbstr_encoding_handler(zval *arg, char *res, char *separator)
        mbfl_string string, result, *ret;
        mbfl_encoding_detector *identd;
        mbfl_buffer_converter *convd;
-       TSRMLS_FETCH();
 
        mbfl_string_init(&string);
        mbfl_string_init(&result);
@@ -927,7 +926,7 @@ SAPI_POST_HANDLER_FUNC(php_mbstr_post_handler)
 {
        MBSTRG(http_input_identify_post) = mbfl_no_encoding_invalid;
 
-       php_mbstr_encoding_handler(arg, SG(request_info).post_data, "&");
+       php_mbstr_encoding_handler(arg, SG(request_info).post_data, "&" TSRMLS_CC);
 
        if (MBSTRG(http_input_identify) != mbfl_no_encoding_invalid) {
                MBSTRG(http_input_identify_post) = MBSTRG(http_input_identify);
@@ -1023,7 +1022,7 @@ void mbstr_treat_data(int arg, char *str, zval* destArray TSRMLS_DC)
                break;
        }
 
-       php_mbstr_encoding_handler(array_ptr, res, separator);
+       php_mbstr_encoding_handler(array_ptr, res, separator TSRMLS_CC);
 
        if (MBSTRG(http_input_identify) != mbfl_no_encoding_invalid) {
                switch(arg){
index c076c7abc43f0b1de79245553d8659ddc90cc3b9..2b1bc689b9c4c83fd3d84a5889dde7bf0c466ec1 100644 (file)
@@ -68,13 +68,13 @@ PHP_ORA_API php_ora_globals ora_globals;
 #define ORA_FETCHINTO_ASSOC (1<<0)
 #define ORA_FETCHINTO_NULLS (1<<1)
 
-static oraCursor *ora_get_cursor(HashTable *, pval **);
+static oraCursor *ora_get_cursor(HashTable *, pval ** TSRMLS_DC);
 static char *ora_error(Cda_Def *);
 static int ora_describe_define(oraCursor *);
 static int _close_oraconn(zend_rsrc_list_entry *rsrc TSRMLS_DC);
-static int _close_oracur(oraCursor *cur);
+static int _close_oracur(oraCursor *cur TSRMLS_DC);
 static int _ora_ping(oraConnection *conn);
-int ora_set_param_values(oraCursor *cursor, int isout);
+int ora_set_param_values(oraCursor *cursor, int isout TSRMLS_DC);
 
 void ora_do_logon(INTERNAL_FUNCTION_PARAMETERS, int persistent);
 
@@ -236,10 +236,9 @@ pval_ora_param_destructor(oraParam *param)
 
 /* {{{ _close_oracur
  */
-static int _close_oracur(oraCursor *cur)
+static int _close_oracur(oraCursor *cur TSRMLS_DC)
 {
        int i;
-       TSRMLS_FETCH();
 
        if (cur){
                if (cur->query){
@@ -279,7 +278,8 @@ static int _close_oracur(oraCursor *cur)
 static void php_close_ora_cursor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
        oraCursor *cur = (oraCursor *)rsrc->ptr;
-       _close_oracur(cur);
+
+       _close_oracur(cur TSRMLS_CC);
 }
 /* }}} */
 
@@ -772,7 +772,7 @@ PHP_FUNCTION(ora_parse)
                RETURN_FALSE;
        }
 
-       if (!(cursor = ora_get_cursor(&EG(regular_list),curs))){
+       if (!(cursor = ora_get_cursor(&EG(regular_list),curs TSRMLS_CC))){
                efree(query);
                RETURN_FALSE;
        }
@@ -822,7 +822,7 @@ PHP_FUNCTION(ora_bind)
                WRONG_PARAM_COUNT;
        }
 
-       cursor = ora_get_cursor(&EG(regular_list), curs);
+       cursor = ora_get_cursor(&EG(regular_list), curs TSRMLS_CC);
        if (cursor == NULL) {
                RETURN_FALSE;
        }
@@ -912,7 +912,7 @@ PHP_FUNCTION(ora_exec)
        if (zend_get_parameters_ex(1, &arg) == FAILURE)
                WRONG_PARAM_COUNT;
 
-       if ((cursor = ora_get_cursor(&EG(regular_list), arg)) == NULL) {
+       if ((cursor = ora_get_cursor(&EG(regular_list), arg TSRMLS_CC)) == NULL) {
                RETURN_FALSE;
        }
 
@@ -924,7 +924,7 @@ PHP_FUNCTION(ora_exec)
        }
 
        if(cursor->nparams > 0){
-               if(!ora_set_param_values(cursor, 0)){
+               if(!ora_set_param_values(cursor, 0 TSRMLS_CC)){
                        RETURN_FALSE;
                }
        }
@@ -936,7 +936,7 @@ PHP_FUNCTION(ora_exec)
        }
        
        if(cursor->nparams > 0){
-               if(!ora_set_param_values(cursor, 1)){
+               if(!ora_set_param_values(cursor, 1 TSRMLS_CC)){
                        RETURN_FALSE;
                }
        }
@@ -954,7 +954,7 @@ PHP_FUNCTION(ora_numcols)
        if (zend_get_parameters_ex(1, &arg) == FAILURE)
                WRONG_PARAM_COUNT;
 
-       if ((cursor = ora_get_cursor(&EG(regular_list), arg)) == NULL) {
+       if ((cursor = ora_get_cursor(&EG(regular_list), arg TSRMLS_CC)) == NULL) {
                RETURN_FALSE;
        }
 
@@ -972,7 +972,7 @@ PHP_FUNCTION(ora_numrows)
        if(zend_get_parameters_ex(1, &arg) == FAILURE)
                WRONG_PARAM_COUNT;
 
-       if((cursor = ora_get_cursor(&EG(regular_list), arg)) == NULL) {
+       if((cursor = ora_get_cursor(&EG(regular_list), arg TSRMLS_CC)) == NULL) {
                RETURN_FALSE;
        }
 
@@ -1028,7 +1028,7 @@ PHP_FUNCTION(ora_do)
        if (oparse(&cursor->cda, query, (sb4) - 1, 1, VERSION_7)){
                php_error(E_WARNING, "Ora_Do failed (%s)",
                                  ora_error(&cursor->cda));
-               _close_oracur(cursor);
+               _close_oracur(cursor TSRMLS_CC);
                RETURN_FALSE;
        }
        
@@ -1036,13 +1036,13 @@ PHP_FUNCTION(ora_do)
        if (cursor->cda.ft == FT_SELECT) {
                if (ora_describe_define(cursor) < 0){
                        /* error message is given by ora_describe_define() */
-                       _close_oracur(cursor);
+                       _close_oracur(cursor TSRMLS_CC);
                        RETURN_FALSE;
                }
                if (oexfet(&cursor->cda, 1, 0, 0)) {
                        php_error(E_WARNING, "Ora_Do failed (%s)",
                                          ora_error(&cursor->cda));
-                       _close_oracur(cursor);
+                       _close_oracur(cursor TSRMLS_CC);
                        RETURN_FALSE;
                }
                cursor->fetched = 1;
@@ -1050,7 +1050,7 @@ PHP_FUNCTION(ora_do)
                if (oexec(&cursor->cda)) {
                        php_error(E_WARNING, "Ora_Do failed (%s)",
                                          ora_error(&cursor->cda));
-                       _close_oracur(cursor);
+                       _close_oracur(cursor TSRMLS_CC);
                        RETURN_FALSE;
                }
        }
@@ -1070,7 +1070,7 @@ PHP_FUNCTION(ora_fetch)
                WRONG_PARAM_COUNT;
        }
 
-       if ((cursor = ora_get_cursor(&EG(regular_list), arg)) == NULL) {
+       if ((cursor = ora_get_cursor(&EG(regular_list), arg TSRMLS_CC)) == NULL) {
                RETURN_FALSE;
        }
 
@@ -1118,7 +1118,7 @@ PHP_FUNCTION(ora_fetch_into)
        }
        
        /* Find the cursor */
-       if ((cursor = ora_get_cursor(&EG(regular_list), curs)) == NULL) {
+       if ((cursor = ora_get_cursor(&EG(regular_list), curs TSRMLS_CC)) == NULL) {
                RETURN_FALSE;
        }
 
@@ -1240,7 +1240,7 @@ PHP_FUNCTION(ora_columnname)
                WRONG_PARAM_COUNT;
        }
 
-       if ((cursor = ora_get_cursor(&EG(regular_list), curs)) == NULL) {
+       if ((cursor = ora_get_cursor(&EG(regular_list), curs TSRMLS_CC)) == NULL) {
                RETURN_FALSE;
        }
 
@@ -1278,7 +1278,7 @@ PHP_FUNCTION(ora_columntype)
                WRONG_PARAM_COUNT;
        }
 
-       if ((cursor = ora_get_cursor(&EG(regular_list), curs)) == NULL) {
+       if ((cursor = ora_get_cursor(&EG(regular_list), curs TSRMLS_CC)) == NULL) {
                RETURN_FALSE;
        }
 
@@ -1346,7 +1346,7 @@ PHP_FUNCTION(ora_columnsize)
                WRONG_PARAM_COUNT;
        }
        /* Find the cursor */
-       if ((cursor = ora_get_cursor(&EG(regular_list), curs)) == NULL) {
+       if ((cursor = ora_get_cursor(&EG(regular_list), curs TSRMLS_CC)) == NULL) {
                RETURN_FALSE;
        }
 
@@ -1386,7 +1386,7 @@ PHP_FUNCTION(ora_getcolumn)
                WRONG_PARAM_COUNT;
        }
 
-       if ((cursor = ora_get_cursor(&EG(regular_list), curs)) == NULL) {
+       if ((cursor = ora_get_cursor(&EG(regular_list), curs TSRMLS_CC)) == NULL) {
                RETURN_FALSE;
        }
 
@@ -1584,11 +1584,10 @@ PHP_MINFO_FUNCTION(oracle)
 /* {{{ ora_get_cursor
  */
 static oraCursor *
-ora_get_cursor(HashTable *list, pval **ind)
+ora_get_cursor(HashTable *list, pval **ind TSRMLS_DC)
 {
        oraCursor *cursor;
        oraConnection *db_conn;
-       TSRMLS_FETCH();
 
        cursor = (oraCursor *) zend_fetch_resource(ind TSRMLS_CC, -1, "Oracle-Cursor", NULL, 1, le_cursor);
        if (! cursor) {
@@ -1724,13 +1723,12 @@ ora_describe_define(oraCursor * cursor)
 
 /* {{{ ora_set_param_values
  */
-int ora_set_param_values(oraCursor *cursor, int isout)
+int ora_set_param_values(oraCursor *cursor, int isout TSRMLS_DC)
 {
        char *paramname;
        oraParam *param;
        pval **pdata;
        int i, len, plen;
-       TSRMLS_FETCH();
 
        zend_hash_internal_pointer_reset(cursor->params);
 
index cb60f4d2a8481c6a255ac5c71d9b662c63de8a2b..9d6648044b1773c35122ce9bc77471e5580fff08 100644 (file)
@@ -84,7 +84,7 @@ PHPAPI HRESULT php_COM_clone(comval *obj, comval *clone, int cleanup);
 
 PHPAPI int php_COM_get_le_comval();
 static ITypeLib *php_COM_find_typelib(char *search_string, int mode);
-static int php_COM_load_typelib(ITypeLib *TypeLib, int mode);
+static int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC);
 
 static int le_comval;
 static int codepage;
@@ -414,7 +414,7 @@ static PHP_INI_MH(OnTypelibFileChange)
                }
                if((pTL = php_COM_find_typelib(typelib_name, mode)) != NULL)
                {
-                       php_COM_load_typelib(pTL, mode);
+                       php_COM_load_typelib(pTL, mode TSRMLS_CC);
                        pTL->lpVtbl->Release(pTL);
                }
        }
@@ -606,7 +606,7 @@ PHP_FUNCTION(com_load)
 
                        if(C_TYPEINFO_VT(obj)->GetContainingTypeLib(C_TYPEINFO(obj), &pTL, &idx) == S_OK)
                        {
-                               php_COM_load_typelib(pTL, mode);
+                               php_COM_load_typelib(pTL, mode TSRMLS_CC);
                                pTL->lpVtbl->Release(pTL);
                        }
                }
@@ -623,7 +623,7 @@ PHP_FUNCTION(com_load)
                                /* idx 0 should deliver the ITypeInfo for the IDispatch Interface */
                                if(INI_INT("com.autoregister_typelib"))
                                {
-                                       php_COM_load_typelib(pTL, mode);
+                                       php_COM_load_typelib(pTL, mode TSRMLS_CC);
                                }
                                pTL->lpVtbl->Release(pTL);
                        }
@@ -1128,7 +1128,7 @@ PHP_FUNCTION(com_load_typelib)
 
        convert_to_string_ex(&arg_typelib);
        pTL = php_COM_find_typelib(Z_STRVAL_P(arg_typelib), mode);
-       if(php_COM_load_typelib(pTL, mode) == SUCCESS)
+       if(php_COM_load_typelib(pTL, mode TSRMLS_CC) == SUCCESS)
        {
                pTL->lpVtbl->Release(pTL);
                RETURN_TRUE;
@@ -1573,12 +1573,11 @@ static ITypeLib *php_COM_find_typelib(char *search_string, int mode)
        return TypeLib;
 }
 
-static int php_COM_load_typelib(ITypeLib *TypeLib, int mode)
+static int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
 {
        ITypeComp *TypeComp;
        int i;
        int interfaces;
-       TSRMLS_FETCH();
 
        if(NULL == TypeLib)
        {
@@ -1687,10 +1686,8 @@ PHP_FUNCTION(com_isenum)
 }
 /* }}} */
 
-void php_register_COM_class(void)
+void php_register_COM_class(TSRMLS_D)
 {
-       TSRMLS_FETCH();
-
        INIT_OVERLOADED_CLASS_ENTRY(com_class_entry, "COM", NULL,
                                                                php_COM_call_function_handler,
                                                                php_COM_get_property_handler,
@@ -1703,7 +1700,7 @@ PHP_MINIT_FUNCTION(COM)
 {
        CoInitialize(NULL);
        le_comval = zend_register_list_destructors_ex(php_comval_destructor, NULL, "COM", module_number);
-       php_register_COM_class();
+       php_register_COM_class(TSRMLS_C);
        REGISTER_INI_ENTRIES();
        return SUCCESS;
 }